mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-30 04:52:04 -04:00
fix(lockfile-utils): checking dependenciesMeta (#4463)
This commit is contained in:
5
.changeset/nice-geese-press.md
Normal file
5
.changeset/nice-geese-press.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/lockfile-utils": patch
|
||||
---
|
||||
|
||||
When checking if the lockfile is up-to-date, an empty dependenciesMeta field in the manifest should be satisfied by a not set field in the lockfile.
|
||||
@@ -11,7 +11,7 @@ export default (lockfile: Lockfile, pkg: ProjectManifest, importerId: string) =>
|
||||
if (!equals({ ...pkg.devDependencies, ...pkg.dependencies, ...pkg.optionalDependencies }, importer.specifiers)) {
|
||||
return false
|
||||
}
|
||||
if (!equals(pkg.dependenciesMeta, importer.dependenciesMeta)) return false
|
||||
if (!equals(pkg.dependenciesMeta ?? {}, importer.dependenciesMeta ?? {})) return false
|
||||
for (const depField of DEPENDENCIES_FIELDS) {
|
||||
const importerDeps = importer[depField] ?? {}
|
||||
const pkgDeps = pkg[depField] ?? {}
|
||||
|
||||
@@ -236,4 +236,27 @@ test('satisfiesPackageManifest()', () => {
|
||||
foo: '1.0.0',
|
||||
},
|
||||
}, '.')).toBe(true)
|
||||
|
||||
expect(satisfiesPackageManifest({
|
||||
...DEFAULT_LOCKFILE_FIELDS,
|
||||
importers: {
|
||||
'.': {
|
||||
dependencies: {
|
||||
foo: '1.0.0',
|
||||
},
|
||||
specifiers: {
|
||||
foo: '1.0.0',
|
||||
},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
...DEFAULT_PKG_FIELDS,
|
||||
dependencies: {
|
||||
foo: '1.0.0',
|
||||
},
|
||||
devDependencies: {
|
||||
foo: '1.0.0',
|
||||
},
|
||||
dependenciesMeta: {},
|
||||
}, '.')).toBe(true)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user