Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
2e0e69c9
Commit
2e0e69c9
authored
4 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
feat(pnpm): dynamic version selection
Closes #6361
parent
04289fb1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/manager/npm/post-update/pnpm.spec.ts
+1
-1
1 addition, 1 deletion
lib/manager/npm/post-update/pnpm.spec.ts
lib/manager/npm/post-update/pnpm.ts
+8
-1
8 additions, 1 deletion
lib/manager/npm/post-update/pnpm.ts
with
9 additions
and
2 deletions
lib/manager/npm/post-update/pnpm.spec.ts
+
1
−
1
View file @
2e0e69c9
...
@@ -20,7 +20,7 @@ delete process.env.NPM_CONFIG_CACHE;
...
@@ -20,7 +20,7 @@ delete process.env.NPM_CONFIG_CACHE;
describe
(
'
generateLockFile
'
,
()
=>
{
describe
(
'
generateLockFile
'
,
()
=>
{
let
config
:
PostUpdateConfig
;
let
config
:
PostUpdateConfig
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
config
=
{
cacheDir
:
'
some-cache-dir
'
};
config
=
{
cacheDir
:
'
some-cache-dir
'
,
compatibility
:
{
pnpm
:
'
^2.0.0
'
}
};
env
.
getChildProcessEnv
.
mockReturnValue
(
envMock
.
basic
);
env
.
getChildProcessEnv
.
mockReturnValue
(
envMock
.
basic
);
});
});
it
(
'
generates lock files
'
,
async
()
=>
{
it
(
'
generates lock files
'
,
async
()
=>
{
...
...
This diff is collapsed.
Click to expand it.
lib/manager/npm/post-update/pnpm.ts
+
8
−
1
View file @
2e0e69c9
import
{
readFile
}
from
'
fs-extra
'
;
import
{
readFile
}
from
'
fs-extra
'
;
import
{
validRange
}
from
'
semver
'
;
import
{
quote
}
from
'
shlex
'
;
import
{
join
}
from
'
upath
'
;
import
{
join
}
from
'
upath
'
;
import
{
logger
}
from
'
../../../logger
'
;
import
{
logger
}
from
'
../../../logger
'
;
import
{
ExecOptions
,
exec
}
from
'
../../../util/exec
'
;
import
{
ExecOptions
,
exec
}
from
'
../../../util/exec
'
;
...
@@ -23,7 +25,12 @@ export async function generateLockFile(
...
@@ -23,7 +25,12 @@ export async function generateLockFile(
let
stderr
:
string
;
let
stderr
:
string
;
let
cmd
=
'
pnpm
'
;
let
cmd
=
'
pnpm
'
;
try
{
try
{
const
preCommands
=
[
'
npm i -g pnpm
'
];
let
installPnpm
=
'
npm i -g pnpm
'
;
const
pnpmCompatibility
=
config
.
compatibility
?.
pnpm
;
if
(
validRange
(
pnpmCompatibility
))
{
installPnpm
+=
`@
${
quote
(
pnpmCompatibility
)}
`
;
}
const
preCommands
=
[
installPnpm
];
const
tagConstraint
=
await
getNodeConstraint
(
config
);
const
tagConstraint
=
await
getNodeConstraint
(
config
);
const
execOptions
:
ExecOptions
=
{
const
execOptions
:
ExecOptions
=
{
cwd
,
cwd
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment