Skip to content

Commit 68668f1

Browse files
committed
fix(cli): revert --no-frozen-lockfile, set enableImmutableInstalls in .yarnrc.yml
Revert passing --no-frozen-lockfile to vp install from vp create. Instead, set enableImmutableInstalls: false in .yarnrc.yml so yarn Berry can create/update lockfiles in CI where it defaults to immutable.
1 parent 59efd62 commit 68668f1

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

packages/cli/src/create/bin.ts

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -804,14 +804,9 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
804804
installGitHooks(fullPath, compactOutput);
805805
}
806806
updateCreateProgress('Installing dependencies');
807-
const installSummary = await runViteInstall(
808-
fullPath,
809-
options.interactive,
810-
['--no-frozen-lockfile'],
811-
{
812-
silent: compactOutput,
813-
},
814-
);
807+
const installSummary = await runViteInstall(fullPath, options.interactive, undefined, {
808+
silent: compactOutput,
809+
});
815810
updateCreateProgress('Formatting code');
816811
await runViteFmt(fullPath, options.interactive, undefined, { silent: compactOutput });
817812
clearCreateProgress();
@@ -960,14 +955,9 @@ Use \`vp create --list\` to list all available templates, or run \`vp create --h
960955

961956
updateWorkspaceConfig(projectDir, workspaceInfo);
962957
updateCreateProgress('Installing dependencies');
963-
installSummary = await runViteInstall(
964-
workspaceInfo.rootDir,
965-
options.interactive,
966-
['--no-frozen-lockfile'],
967-
{
968-
silent: compactOutput,
969-
},
970-
);
958+
installSummary = await runViteInstall(workspaceInfo.rootDir, options.interactive, undefined, {
959+
silent: compactOutput,
960+
});
971961
updateCreateProgress('Formatting code');
972962
await runViteFmt(workspaceInfo.rootDir, options.interactive, [projectDir], {
973963
silent: compactOutput,

packages/cli/src/migration/migrator.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,11 @@ function rewriteYarnrcYml(projectPath: string): void {
11251125
if (!doc.has('nodeLinker')) {
11261126
doc.set('nodeLinker', 'node-modules');
11271127
}
1128+
// Disable immutable installs so yarn can create/update lockfiles
1129+
// (yarn Berry defaults to enableImmutableInstalls: true in CI)
1130+
if (!doc.has('enableImmutableInstalls')) {
1131+
doc.set('enableImmutableInstalls', false);
1132+
}
11281133
// catalog
11291134
rewriteCatalog(doc);
11301135
});

0 commit comments

Comments
 (0)