mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-23 23:29:17 -05:00
fix(lockfile): never add an empty patchedDependencies field to pnpm-lock.yaml (#4948)
This commit is contained in:
6
.changeset/tough-books-count.md
Normal file
6
.changeset/tough-books-count.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/lockfile-file": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Never add an empty patchedDependencies field to `pnpm-lock.yaml`.
|
||||
@@ -123,6 +123,9 @@ export function normalizeLockfile (lockfile: Lockfile, forceSharedFormat: boolea
|
||||
if ((lockfileToSave.overrides != null) && isEmpty(lockfileToSave.overrides)) {
|
||||
delete lockfileToSave.overrides
|
||||
}
|
||||
if ((lockfileToSave.patchedDependencies != null) && isEmpty(lockfileToSave.patchedDependencies)) {
|
||||
delete lockfileToSave.patchedDependencies
|
||||
}
|
||||
if (lockfileToSave.neverBuiltDependencies != null) {
|
||||
if (isEmpty(lockfileToSave.neverBuiltDependencies)) {
|
||||
delete lockfileToSave.neverBuiltDependencies
|
||||
|
||||
@@ -8,6 +8,7 @@ test('empty overrides and neverBuiltDependencies are removed during lockfile nor
|
||||
onlyBuiltDependencies: [],
|
||||
overrides: {},
|
||||
neverBuiltDependencies: [],
|
||||
patchedDependencies: {},
|
||||
packages: {},
|
||||
importers: {
|
||||
foo: {
|
||||
|
||||
Reference in New Issue
Block a user