mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-10 18:18:56 -04:00
fix: lockfile v6 repeat install when use-lockfile-v6 is not set
This commit is contained in:
6
.changeset/strange-eagles-nail.md
Normal file
6
.changeset/strange-eagles-nail.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/core": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't break lockfile v6 on repeat install if `use-lockfile-v6` is not set to `true`.
|
||||
@@ -120,7 +120,7 @@ export interface StrictInstallOptions {
|
||||
allProjects: ProjectOptions[]
|
||||
resolveSymlinksInInjectedDirs: boolean
|
||||
dedupeDirectDeps: boolean
|
||||
useLockfileV6: boolean
|
||||
useLockfileV6?: boolean
|
||||
}
|
||||
|
||||
export type InstallOptions =
|
||||
@@ -207,7 +207,6 @@ const defaults = async (opts: InstallOptions) => {
|
||||
resolveSymlinksInInjectedDirs: false,
|
||||
dedupeDirectDeps: false,
|
||||
resolvePeersFromWorkspaceRoot: false,
|
||||
useLockfileV6: false,
|
||||
} as StrictInstallOptions
|
||||
}
|
||||
|
||||
|
||||
@@ -279,6 +279,9 @@ export async function mutateModules (
|
||||
path: path.join(opts.lockfileDir, patchFile.path),
|
||||
}), patchedDependencies)
|
||||
: undefined
|
||||
if (opts.useLockfileV6 == null) {
|
||||
opts.useLockfileV6 = ctx.wantedLockfile.lockfileVersion.toString().startsWith('6.')
|
||||
}
|
||||
let needsFullResolution = !maybeOpts.ignorePackageManifest &&
|
||||
lockfileIsUpToDate(ctx.wantedLockfile, {
|
||||
overrides: opts.overrides,
|
||||
@@ -879,7 +882,7 @@ const _installInContext: InstallFunction = async (projects, ctx, opts) => {
|
||||
: newLockfile
|
||||
|
||||
if (opts.updateLockfileMinorVersion) {
|
||||
if (opts.useLockfileV6 || newLockfile.lockfileVersion.toString().startsWith('6.')) {
|
||||
if (opts.useLockfileV6) {
|
||||
newLockfile.lockfileVersion = LOCKFILE_VERSION_V6
|
||||
} else {
|
||||
newLockfile.lockfileVersion = LOCKFILE_VERSION
|
||||
|
||||
Reference in New Issue
Block a user