-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(arborist): condition to include name field in package-lock fixed (#…
…7602) When metadata is committed for the first time when there is no package-lock, when target node has the same name field value as target package name and link node also share the same name field, name field is omitted from lock file, in subsequent times when there is already a lock file, it reads target node with name field derived from realpath value of the node and included in lock file. this creates mismatch of lock file between installs. This PR adds additional condition to check if name derived from realpath is the same name as package and adds the name property. Fixes: #7166
- Loading branch information
Showing
3 changed files
with
66 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,6 +280,7 @@ Object { | |
"a": "", | ||
"link": "", | ||
"link2": "", | ||
"link3": "", | ||
}, | ||
"devDependencies": Object { | ||
"d": "", | ||
|
@@ -349,6 +350,10 @@ Object { | |
"link": true, | ||
"resolved": "target", | ||
}, | ||
"node_modules/link3": Object { | ||
"link": true, | ||
"resolved": "realPkg", | ||
}, | ||
"node_modules/nopkg": Object { | ||
"extraneous": true, | ||
}, | ||
|
@@ -401,6 +406,14 @@ Object { | |
"resolved": "file:archives/tarball-pkg-resolved.tgz", | ||
"version": "1.2.3", | ||
}, | ||
"realPkg": Object { | ||
"funding": Object { | ||
"url": "https://example.com/payme", | ||
}, | ||
"name": "link3", | ||
"resolved": "git+ssh://[email protected]/isaacs/foobarbaz.git#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"version": "1.2.3", | ||
}, | ||
"target": Object { | ||
"funding": Object { | ||
"url": "https://example.com/payme", | ||
|
@@ -466,6 +479,13 @@ Object { | |
} | ||
` | ||
|
||
exports[`test/shrinkwrap.js TAP construct metadata from node and package data > link metadata with same pkg name as link target 1`] = ` | ||
Object { | ||
"link": true, | ||
"resolved": "realPkg", | ||
} | ||
` | ||
|
||
exports[`test/shrinkwrap.js TAP construct metadata from node and package data > link target metadata 1`] = ` | ||
Object { | ||
"funding": Object { | ||
|
@@ -477,6 +497,17 @@ Object { | |
} | ||
` | ||
|
||
exports[`test/shrinkwrap.js TAP construct metadata from node and package data > link target metadata with same pkg name as link target 1`] = ` | ||
Object { | ||
"funding": Object { | ||
"url": "https://example.com/payme", | ||
}, | ||
"name": "link3", | ||
"resolved": "git+ssh://[email protected]/isaacs/foobarbaz.git#aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", | ||
"version": "1.2.3", | ||
} | ||
` | ||
|
||
exports[`test/shrinkwrap.js TAP construct metadata from node and package data > meta for dev dep 1`] = ` | ||
Object { | ||
"dependencies": Object { | ||
|
@@ -549,6 +580,7 @@ Object { | |
"a": "", | ||
"link": "", | ||
"link2": "", | ||
"link3": "", | ||
}, | ||
"devDependencies": Object { | ||
"d": "", | ||
|
@@ -572,6 +604,7 @@ Object { | |
"a": "", | ||
"link": "", | ||
"link2": "", | ||
"link3": "", | ||
}, | ||
"devDependencies": Object { | ||
"d": "", | ||
|
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