diff options
author | nlf <quitlahok@gmail.com> | 2022-03-23 18:23:56 +0300 |
---|---|---|
committer | Luke Karrys <luke@lukekarrys.com> | 2022-03-28 23:20:47 +0300 |
commit | 99d88454248f950b82652b592fe2b4d019c1060b (patch) | |
tree | 942d24cfa5eab88f889d4cb43cc73035b72715f5 /workspaces/arborist/lib | |
parent | bd96ae4071f9cc8a65e741f414db12e98537971d (diff) |
fix: make sure we loadOverrides on the root node in loadVirtual()
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
Diffstat (limited to 'workspaces/arborist/lib')
-rw-r--r-- | workspaces/arborist/lib/arborist/load-virtual.js | 5 |
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 |