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: process deps for all link nodes
Arborist wasn't checking for any package.json dep changes within its Link nodes thus preventing users from adding new deps on workspaces. This changeset fixes it and adds a reify test repro. Fixes: npm/cli#1984
- Loading branch information
Showing
8 changed files
with
177 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
// generated from test/fixtures/workspaces-add-new-dep | ||
module.exports = t => { | ||
const path = t.testdir({ | ||
"a": { | ||
"package.json": JSON.stringify({ | ||
"name": "a", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"abbrev": "^1.1.1" | ||
} | ||
}) | ||
}, | ||
"node_modules": { | ||
".package-lock.json": JSON.stringify({ | ||
"name": "workspaces-add-new-dep", | ||
"lockfileVersion": 2, | ||
"requires": true, | ||
"packages": { | ||
"a": { | ||
"version": "1.0.0" | ||
}, | ||
"node_modules/a": { | ||
"resolved": "a", | ||
"link": true | ||
} | ||
} | ||
}), | ||
"a": t.fixture('symlink', "../a") | ||
}, | ||
"package-lock.json": JSON.stringify({ | ||
"name": "workspaces-add-new-dep", | ||
"lockfileVersion": 2, | ||
"requires": true, | ||
"packages": { | ||
"": { | ||
"workspaces": [ | ||
"a" | ||
] | ||
}, | ||
"a": { | ||
"version": "1.0.0" | ||
}, | ||
"node_modules/a": { | ||
"resolved": "a", | ||
"link": true | ||
} | ||
}, | ||
"dependencies": { | ||
"a": { | ||
"version": "file:a" | ||
} | ||
} | ||
}), | ||
"package.json": JSON.stringify({ | ||
"name": "workspaces-add-new-dep", | ||
"workspaces": [ | ||
"a" | ||
] | ||
}) | ||
}) | ||
const {utimesSync} = require('fs') | ||
const n = Date.now() | ||
const {resolve} = require('path') | ||
|
||
utimesSync(resolve(path, "node_modules/.package-lock.json"), new Date(n), new Date(n)) | ||
return path | ||
} |
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": "a", | ||
"version": "1.0.0", | ||
"//": "abbrev is a new dep, not yet installed:", | ||
"dependencies": { | ||
"abbrev": "^1.1.1" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,6 @@ | ||
{ | ||
"name": "workspaces-add-new-dep", | ||
"workspaces": [ | ||
"a" | ||
] | ||
} |