fix: check for peerDependenciesMeta in pkgIsLeaf to fix non-determinism (#6112)
close #5106
This commit is contained in:
1 parent
0377d93678
commit
1b2e09ccfd
2 files changed
+10
-1
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/resolve-dependencies": patch
|
||||
pnpm: patch
|
||||
---
|
||||
|
||||
Fix a case of installs not being deterministic and causing lockfile changes between repeat installs. When a dependency only declares `peerDependenciesMeta` and not `peerDependencies`, `dependencies`, or `optionalDependencies`, the dependency's peers were not considered deterministically before.
|
||||
@@ -1377,7 +1377,10 @@ function getMissingPeers (pkg: PackageManifest) {
|
||||
function pkgIsLeaf (pkg: PackageManifest) {
|
||||
return isEmpty(pkg.dependencies ?? {}) &&
|
||||
isEmpty(pkg.optionalDependencies ?? {}) &&
|
||||
isEmpty(pkg.peerDependencies ?? {})
|
||||
isEmpty(pkg.peerDependencies ?? {}) &&
|
||||
// Package manifests can declare peerDependenciesMeta without declaring
|
||||
// peerDependencies. peerDependenciesMeta implies the later.
|
||||
isEmpty(pkg.peerDependenciesMeta ?? {})
|
||||
}
|
||||
|
||||
function getResolvedPackage (
|
||||
|
||||
Reference in new issue
Block a user