chore(repo): set lerna npmClient to pnpm when necessary (#17505)
This commit is contained in:
parent
32ef811cc4
commit
332f6605ae
@ -449,6 +449,14 @@ export function newLernaWorkspace({
|
|||||||
encoding: 'utf-8',
|
encoding: 'utf-8',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (packageManager === 'pnpm') {
|
||||||
|
// pnpm doesn't use the normal package.json packages field so lerna needs to be told that pnpm is the client.
|
||||||
|
updateJson('lerna.json', (json) => {
|
||||||
|
json.npmClient = 'pnpm';
|
||||||
|
return json;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
execSync(pm.install, {
|
execSync(pm.install, {
|
||||||
cwd: tmpProjPath(),
|
cwd: tmpProjPath(),
|
||||||
stdio: isVerbose() ? 'inherit' : 'pipe',
|
stdio: isVerbose() ? 'inherit' : 'pipe',
|
||||||
@ -456,6 +464,12 @@ export function newLernaWorkspace({
|
|||||||
encoding: 'utf-8',
|
encoding: 'utf-8',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Format files to ensure no changes are made during lerna repair
|
||||||
|
execSync(`${pm.runUninstalledPackage} prettier . --write`, {
|
||||||
|
cwd: tmpProjPath(),
|
||||||
|
stdio: 'ignore',
|
||||||
|
});
|
||||||
|
|
||||||
return projScope;
|
return projScope;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logError(`Failed to set up lerna workspace for e2e tests.`, e.message);
|
logError(`Failed to set up lerna workspace for e2e tests.`, e.message);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user