fix(core): use pnpm exec instead of pnpx (#7695)
pnpm is deprecating pnpx and suggests using pnpm exec instead. pnpx still works at the moment, but if for whatever reason it isn't installed then this pr can make create-nx-worksapce stsill work. [pnpx documenation](https://pnpm.io/pnpx-cli)
This commit is contained in:
parent
86baac49f5
commit
474dc283ce
@ -53,12 +53,17 @@ export function getPackageManagerCommand(
|
||||
};
|
||||
|
||||
case 'pnpm':
|
||||
const [major, minor] = getPackageManagerVersion('pnpm').split('.');
|
||||
let useExec = false;
|
||||
if (+major >= 6 && +minor >= 13) {
|
||||
useExec = true;
|
||||
}
|
||||
return {
|
||||
install: 'pnpm install --no-frozen-lockfile', // explicitly disable in case of CI
|
||||
add: 'pnpm add',
|
||||
addDev: 'pnpm add -D',
|
||||
rm: 'pnpm rm',
|
||||
exec: 'pnpx',
|
||||
exec: useExec ? 'pnpm exec' : 'pnpx',
|
||||
run: (script: string, args: string) => `pnpm run ${script} -- ${args}`,
|
||||
list: 'pnpm ls --depth 100',
|
||||
};
|
||||
|
||||
@ -49,15 +49,22 @@ export function getPackageManagerCommand(
|
||||
run: (script: string, args: string) => `yarn ${script} ${args}`,
|
||||
list: 'yarn list',
|
||||
}),
|
||||
pnpm: () => ({
|
||||
install: 'pnpm install --no-frozen-lockfile', // explicitly disable in case of CI
|
||||
add: 'pnpm add',
|
||||
addDev: 'pnpm add -D',
|
||||
rm: 'pnpm rm',
|
||||
exec: 'pnpx',
|
||||
run: (script: string, args: string) => `pnpm run ${script} -- ${args}`,
|
||||
list: 'pnpm ls --depth 100',
|
||||
}),
|
||||
pnpm: () => {
|
||||
const [major, minor] = getPackageManagerVersion('pnpm').split('.');
|
||||
let useExec = false;
|
||||
if (+major >= 6 && +minor >= 13) {
|
||||
useExec = true;
|
||||
}
|
||||
return {
|
||||
install: 'pnpm install --no-frozen-lockfile', // explicitly disable in case of CI
|
||||
add: 'pnpm add',
|
||||
addDev: 'pnpm add -D',
|
||||
rm: 'pnpm rm',
|
||||
exec: useExec ? 'pnpm exec' : 'pnpx',
|
||||
run: (script: string, args: string) => `pnpm run ${script} -- ${args}`,
|
||||
list: 'pnpm ls --depth 100',
|
||||
};
|
||||
},
|
||||
npm: () => {
|
||||
process.env.npm_config_legacy_peer_deps ??= 'true';
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user