Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornlf <quitlahok@gmail.com>2022-03-23 18:23:56 +0300
committernlf <quitlahok@gmail.com>2022-03-23 18:23:56 +0300
commitbf919a5695429122274a99efc1275c2b327bc129 (patch)
tree278be0d12fd8c11161254cbc20b2dda0323f665a
parente18e71fb65be33d1f6afac77d88977d6b2512e72 (diff)
fix: make sure we loadOverrides on the root node in loadVirtual()nlf/arborist-validation
by loading the overrides on the root of the virtual tree, we effectively ensure that `npm ci` will throw an error when your package.json overrides are not in sync with the tree in your package-lock.json
-rw-r--r--workspaces/arborist/lib/arborist/load-virtual.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/workspaces/arborist/lib/arborist/load-virtual.js b/workspaces/arborist/lib/arborist/load-virtual.js
index 4d65e3da6..8a41e7686 100644
--- a/workspaces/arborist/lib/arborist/load-virtual.js
+++ b/workspaces/arborist/lib/arborist/load-virtual.js
@@ -79,7 +79,7 @@ module.exports = cls => class VirtualLoader extends cls {
async [loadRoot] (s) {
const pj = this.path + '/package.json'
const pkg = await rpj(pj).catch(() => s.data.packages['']) || {}
- return this[loadWorkspaces](this[loadNode]('', pkg))
+ return this[loadWorkspaces](this[loadNode]('', pkg, true))
}
async [loadFromShrinkwrap] (s, root) {
@@ -264,7 +264,7 @@ module.exports = cls => class VirtualLoader extends cls {
}
}
- [loadNode] (location, sw) {
+ [loadNode] (location, sw, loadOverrides) {
const p = this.virtualTree ? this.virtualTree.realpath : this.path
const path = resolve(p, location)
// shrinkwrap doesn't include package name unless necessary
@@ -290,6 +290,7 @@ module.exports = cls => class VirtualLoader extends cls {
optional,
devOptional,
peer,
+ loadOverrides,
})
// cast to boolean because they're undefined in the lock file when false
node.extraneous = !!sw.extraneous