fix: resolving peer dependencies from linked in dependencies (#6561)

This commit is contained in:
Zoltan Kochan
2023-05-18 16:27:49 +03:00
committed by GitHub
parent bcbfd42c44
commit ee78f144d5
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/resolve-dependencies": patch
"pnpm": patch
---
Peers resolution should not fail when a linked in dependency resolves a peer dependency.

View File

@@ -279,6 +279,9 @@ function resolvePeersOfNode<T extends PartialResolvedPackage> (
ctx.pathsByNodeId[cachedNodeId] &&
ctx.pathsByNodeId[cachedNodeId] === ctx.pathsByNodeId[parentPkgNodeId]
) return true
if (!ctx.dependenciesTree[parentPkgNodeId] && parentPkgNodeId.startsWith('link:')) {
return false
}
const parentDepPath = (ctx.dependenciesTree[parentPkgNodeId].resolvedPackage as T).depPath
if (!ctx.purePkgs.has(parentDepPath)) return false
const cachedDepPath = (ctx.dependenciesTree[cachedNodeId].resolvedPackage as T).depPath