Skip to content

Commit 92dd57b

Browse files
committed
fix: correct children paths
1 parent a050b50 commit 92dd57b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

deps/graph-builder/src/lockfileToDepGraph.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export async function lockfileToDepGraph (
122122
...(opts.include.optionalDependencies ? pkgSnapshot.optionalDependencies : {}),
123123
}
124124
const peerDeps = pkgSnapshot.peerDependencies ? new Set(Object.keys(pkgSnapshot.peerDependencies)) : null
125-
node.children = _getChildrenPaths(allDeps, peerDeps, '.')
125+
node.children = _getChildrenPaths(allDeps, peerDeps, node.dir)
126126
}
127127

128128
const directDependenciesByImporterId: DirectDependenciesByImporterId = {}
@@ -265,13 +265,13 @@ function getChildrenPaths (
265265
ctx: GetChildrenPathsContext,
266266
allDeps: { [alias: string]: string },
267267
peerDeps: Set<string> | null,
268-
importerId: string
268+
importerDir: string
269269
): { [alias: string]: string } {
270270
const children: { [alias: string]: string } = {}
271271
for (const [alias, ref] of Object.entries(allDeps)) {
272272
const childDepPath = dp.refToRelative(ref, alias)
273273
if (childDepPath === null) {
274-
children[alias] = path.resolve(ctx.lockfileDir, importerId, ref.slice(5))
274+
children[alias] = path.resolve(importerDir, ref.slice(5))
275275
continue
276276
}
277277
const childRelDepPath = dp.refToRelative(ref, alias)!

0 commit comments

Comments
 (0)