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: --lockfile-only in CI and with frozen-lockfile=true #4955

Merged
merged 2 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions .changeset/lucky-icons-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@pnpm/core": patch
"@pnpm/plugin-commands-installation": patch
"pnpm": patch
---

Never skip lockfile resolution when the lockfile is not up-to-date and `--lockfile-only` is used. Even if `frozen-lockfile` is `true` [#4951](https://github.com/pnpm/pnpm/issues/4951).
2 changes: 1 addition & 1 deletion packages/core/src/install/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ export async function mutateModules (
!opts.fixLockfile &&
installsOnly &&
(
frozenLockfile ||
frozenLockfile && !opts.lockfileOnly ||
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that expected to be written without brackets () around it? I didn't test anything, I'm just asking. I mean should it be (frozenLockfile && !opts.lockfileOnly)? If not then Prettier is probably to blame here, it's confusing when it's on 1 line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will work without brackets just fine. && has bigger priority than ||

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh ok I forgot about that, cool 👍🏻

opts.ignorePackageManifest ||
!needsFullResolution &&
opts.preferFrozenLockfile &&
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-commands-installation/src/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export async function handler (
}
return installDeps({
...opts,
frozenLockfileIfExists: isCI &&
frozenLockfileIfExists: isCI && !opts.lockfileOnly &&
typeof opts.rawLocalConfig['frozen-lockfile'] === 'undefined' &&
typeof opts.rawLocalConfig['prefer-frozen-lockfile'] === 'undefined',
include,
Expand Down