Skip to content

Commit

Permalink
fix(arborist): when replacing a Link with a Node, make sure to remove…
Browse files Browse the repository at this point in the history
… the Link target from the root
  • Loading branch information
nlf authored and lukekarrys committed Apr 19, 2022
1 parent 4ca858c commit 3d96494
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
3 changes: 3 additions & 0 deletions workspaces/arborist/lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,9 @@ class Node {
for (const kid of node.children.values()) {
kid.parent = this
}
if (node.isLink && node.target) {
node.target.root = null
}
}

if (!node.isRoot) {
Expand Down
26 changes: 0 additions & 26 deletions workspaces/arborist/tap-snapshots/test/arborist/reify.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2228,19 +2228,6 @@ ArboristNode {
"type": "prod",
},
},
"fsChildren": Set {
ArboristNode {
"dev": true,
"extraneous": true,
"location": "target",
"name": "target",
"optional": true,
"packageName": "ABBREV",
"path": "{CWD}/test/arborist/tap-testdir-reify-collide-case-variant-dep-names/target",
"peer": true,
"version": "1.0.0",
},
},
"isProjectRoot": true,
"location": "",
"name": "tap-testdir-reify-collide-case-variant-dep-names",
Expand Down Expand Up @@ -2275,19 +2262,6 @@ ArboristNode {
"type": "prod",
},
},
"fsChildren": Set {
ArboristNode {
"dev": true,
"extraneous": true,
"location": "target",
"name": "target",
"optional": true,
"packageName": "ABBREV",
"path": "{CWD}/test/arborist/tap-testdir-reify-collide-case-variant-dep-names/target",
"peer": true,
"version": "1.0.0",
},
},
"isProjectRoot": true,
"location": "",
"name": "tap-testdir-reify-collide-case-variant-dep-names",
Expand Down

0 comments on commit 3d96494

Please sign in to comment.