Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(version): --sync-workspace-lock flag no longer work because of pnpm regression #233

Merged
merged 4 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('run install lockfile-only', () => {

const lockFileOutput = await runInstallLockFileOnly('pnpm', cwd);

expect(execSpy).toHaveBeenCalledWith('pnpm', ['install', '--lockfile-only'], { cwd });
expect(execSpy).toHaveBeenCalledWith('pnpm', ['install', '--lockfile-only', '--fix-lockfile'], { cwd });
expect(lockFileOutput).toBe('pnpm-lock.yaml');
});
});
Expand Down
4 changes: 2 additions & 2 deletions packages/version/src/__tests__/version-command.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ describe('VersionCommand', () => {
expect(changedFiles).not.toContain('package-lock.json');
});

it.skip(`should call runInstallLockFileOnly() when --sync-workspace-lock is provided and expect lockfile to be added to git`, async () => {
it(`should call runInstallLockFileOnly() when --sync-workspace-lock is provided and expect lockfile to be added to git`, async () => {
const cwd = await initFixture('lockfile-pnpm');
await new VersionCommand(
createArgv(cwd, '--bump', 'major', '--yes', '--sync-workspace-lock', '--npm-client', 'pnpm')
Expand All @@ -903,7 +903,7 @@ describe('VersionCommand', () => {
expect(importers['packages/package-4'].specifiers['@my-workspace/package-2']).toBe('workspace:~');
});

it.skip(`should call runInstallLockFileOnly() when --sync-workspace-lock is provided and expect lockfile to be added to git even without npmClient`, async () => {
it(`should call runInstallLockFileOnly() when --sync-workspace-lock is provided and expect lockfile to be added to git even without npmClient`, async () => {
const cwd = await initFixture('lockfile-pnpm');
await new VersionCommand(createArgv(cwd, '--bump', 'minor', '--yes', '--sync-workspace-lock'));

Expand Down
2 changes: 1 addition & 1 deletion packages/version/src/lib/update-lockfile-version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export async function runInstallLockFileOnly(
inputLockfileName = 'pnpm-lock.yaml';
if (await validateFileExists(path.join(cwd, inputLockfileName))) {
log.verbose('lock', `updating lock file via "pnpm install --lockfile-only"`);
await exec('pnpm', ['install', '--lockfile-only'], { cwd });
await exec('pnpm', ['install', '--lockfile-only', '--fix-lockfile'], { cwd });
outputLockfileName = inputLockfileName;
}
break;
Expand Down