This repository has been archived by the owner on Jan 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: deps of linked deps in package-lock
When having optional dependencies of a dependency of a top-level link dependency, e.g: root -> LINK(a) a -> (b) b -> OPTIONAL(c) * c marked as extraneous Any optional dependency (and all its nested nodes) were marked as extraneous in package-lock due to `calcDepFlags` missing properly following the target of Link nodes. This changeset fixes it by properly following the result of the `treeverse.visit` method that will have already followed any link targets at that point. Fixes: npm/cli#2505 PR-URL: #229 Credit: @ruyadorno Close: #229 Reviewed-by: @isaacs
- Loading branch information
Showing
7 changed files
with
113 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
test/fixtures/link-dep-has-dep-with-optional-dep/a/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "a", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"rimraf": "2.2.4" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
test/fixtures/link-dep-has-dep-with-optional-dep/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "link-dep-has-dep-with-optional-dep", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"a": "./a" | ||
} | ||
} |