mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-29 20:41:47 -04:00
fix: check for peerDependenciesMeta in pkgIsLeaf to fix non-determinism (#6112)
close #5106
This commit is contained in:
6
.changeset/lazy-brooms-search.md
Normal file
6
.changeset/lazy-brooms-search.md
Normal file
@@ -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