fix: peers resolution

ref #2919
This commit is contained in:
Zoltan Kochan
2020-10-15 00:33:15 +03:00
parent 4241bc148f
commit e8dcc42d56
2 changed files with 10 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/resolve-dependencies": patch
---
Do not skip a package's peer resolution if it was previously resolved w/o peer dependencies but in the new node it has peer dependencies.

View File

@@ -149,7 +149,11 @@ function resolvePeersOfNode<T extends PartialResolvedPackage> (
const node = ctx.dependenciesTree[nodeId]
if (node.depth === -1) return { resolvedPeers: {}, missingPeers: [] }
const resolvedPackage = node.resolvedPackage as T
if (ctx.purePkgs.has(resolvedPackage.depPath) && ctx.depGraph[resolvedPackage.depPath].depth <= node.depth) {
if (
ctx.purePkgs.has(resolvedPackage.depPath) &&
ctx.depGraph[resolvedPackage.depPath].depth <= node.depth &&
R.isEmpty(resolvedPackage.peerDependencies)
) {
ctx.pathsByNodeId[nodeId] = resolvedPackage.depPath
return { resolvedPeers: {}, missingPeers: [] }
}