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.
Do not ERESOLVE on peerOptionals not added to tree
For these dependency graphs: # case a root -> (x, y@1) x -> PEEROPTIONAL(z) z -> PEER(y@2) # case b root -> (x) PEEROPTIONAL(y@1) x -> PEEROPTIONAL(y@2) # case c root -> (x) PEEROPTIONAL(y@1) x -> PEER(z) z -> PEEROPTIONAL(y@2) The peerOptional dependency is included in the peerSet, which would raise an ERESOLVE conflict at the peerSet generation stage, even though the peerOptional dependencies will not actually be added to the tree. To address this, this commit tracks the nodes which are actually required in the peerSet generation phase, by virtue of being non-optionally depended upon by a required node in the peerSet. If a conflict occurs on a node which is not in the required set during the peerSet generation phase, we ignore it in much the same way that we would ignore peerSet errors in metadependencies or when --force is used. Of course, if the peerOptional dependency is _actually_ required, to avoid a conflict with an invalid resolution present in the tree already, and there is no suitable placement for it, then ERESOLVE will still be raised. Fix: #223 Fix: npm/cli#2667
- Loading branch information
Showing
37 changed files
with
1,153 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# peer optional failures | ||
|
||
Cases which incorrectly caused `ERESOLVE` warnings. | ||
|
||
[npm/arborist#223](https://github.com/npm/arborist/issues/223) |
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,9 @@ | ||
# peer optional failure A | ||
|
||
``` | ||
root -> (x, y@1) | ||
x -> PEEROPTIONAL(z) | ||
z -> PEER(y@2) | ||
``` | ||
|
||
[npm/arborist#223](https://github.com/npm/arborist/issues/223) |
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,8 @@ | ||
{ | ||
"name": "@isaacs/testing-peer-optional-conflict-a", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"@isaacs/testing-peer-optional-conflict-a-x": "1", | ||
"@isaacs/testing-peer-optional-conflict-a-y": "1" | ||
} | ||
} |
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,12 @@ | ||
{ | ||
"name": "@isaacs/testing-peer-optional-conflict-a-x", | ||
"version": "1.0.0", | ||
"peerDependencies": { | ||
"@isaacs/testing-peer-optional-conflict-a-z": "1" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@isaacs/testing-peer-optional-conflict-a-z": { | ||
"optional": true | ||
} | ||
} | ||
} |
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,4 @@ | ||
{ | ||
"name": "@isaacs/testing-peer-optional-conflict-a-y", | ||
"version": "1.0.0" | ||
} |
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,4 @@ | ||
{ | ||
"name": "@isaacs/testing-peer-optional-conflict-a-y", | ||
"version": "2.0.0" | ||
} |
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": "@isaacs/testing-peer-optional-conflict-a-z", | ||
"version": "1.0.0", | ||
"peerDependencies": { | ||
"@isaacs/testing-peer-optional-conflict-a-y": "2" | ||
} | ||
} |
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,8 @@ | ||
# peer optional failure b | ||
|
||
``` | ||
root -> (x) PEEROPTIONAL(y@1) | ||
x -> PEEROPTIONAL(y@2) | ||
``` | ||
|
||
[npm/arborist#223](https://github.com/npm/arborist/issues/223) |
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,15 @@ | ||
{ | ||
"name": "@isaacs/testing-peer-optional-conflict-b", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"@isaacs/testing-peer-optional-conflict-b-x": "1" | ||
}, | ||
"peerDependencies": { | ||
"@isaacs/testing-peer-optional-conflict-b-y": "1" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@isaacs/testing-peer-optional-conflict-b-y": { | ||
"optional": true | ||
} | ||
} | ||
} |
Oops, something went wrong.