diff options
-rw-r--r-- | node_modules/@npmcli/arborist/lib/arborist/audit.js | 11 | ||||
-rw-r--r-- | node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js | 20 | ||||
-rw-r--r-- | node_modules/@npmcli/arborist/lib/arborist/index.js | 29 | ||||
-rw-r--r-- | node_modules/@npmcli/arborist/lib/arborist/rebuild.js | 7 | ||||
-rw-r--r-- | node_modules/@npmcli/arborist/lib/arborist/reify.js | 16 | ||||
-rw-r--r-- | node_modules/@npmcli/arborist/package.json | 2 | ||||
-rw-r--r-- | package-lock.json | 14 | ||||
-rw-r--r-- | package.json | 2 |
8 files changed, 18 insertions, 83 deletions
diff --git a/node_modules/@npmcli/arborist/lib/arborist/audit.js b/node_modules/@npmcli/arborist/lib/arborist/audit.js index eb4a35655..c0cd79bb1 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/audit.js +++ b/node_modules/@npmcli/arborist/lib/arborist/audit.js @@ -5,7 +5,6 @@ const AuditReport = require('../audit-report.js') // shared with reify const _global = Symbol.for('global') const _workspaces = Symbol.for('workspaces') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') module.exports = cls => class Auditor extends cls { async audit (options = {}) { @@ -24,15 +23,7 @@ module.exports = cls => class Auditor extends cls { process.emit('time', 'audit') const tree = await this.loadVirtual() if (this[_workspaces] && this[_workspaces].length) { - options.filterSet = this.workspaceDependencySet( - tree, - this[_workspaces], - this[_includeWorkspaceRoot] - ) - } - if (!options.workspacesEnabled) { - options.filterSet = - this.excludeWorkspacesDependencySet(tree) + options.filterSet = this.workspaceDependencySet(tree, this[_workspaces]) } this.auditReport = await AuditReport.load(tree, options) const ret = options.fix ? this.reify(options) : this.auditReport diff --git a/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js b/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js index 3e6a9838f..b7876b114 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js +++ b/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js @@ -93,7 +93,6 @@ const _checkEngine = Symbol('checkEngine') const _checkPlatform = Symbol('checkPlatform') const _virtualRoots = Symbol('virtualRoots') const _virtualRoot = Symbol('virtualRoot') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') const _failPeerConflict = Symbol('failPeerConflict') const _explainPeerConflict = Symbol('explainPeerConflict') @@ -116,13 +115,12 @@ module.exports = cls => class IdealTreeBuilder extends cls { options.registry = this.registry = registry.replace(/\/+$/, '') + '/' const { - follow = false, - force = false, + idealTree = null, global = false, + follow = false, globalStyle = false, - idealTree = null, - includeWorkspaceRoot = false, legacyPeerDeps = false, + force = false, packageLock = true, strictPeerDeps = false, workspaces = [], @@ -164,8 +162,6 @@ module.exports = cls => class IdealTreeBuilder extends cls { // don't hold onto references for nodes that are garbage collected. this[_peerSetSource] = new WeakMap() this[_virtualRoots] = new Map() - - this[_includeWorkspaceRoot] = includeWorkspaceRoot } get explicitRequests () { @@ -398,14 +394,8 @@ module.exports = cls => class IdealTreeBuilder extends cls { if (!this[_workspaces].length) { await this[_applyUserRequestsToNode](tree, options) } else { - const nodes = this.workspaceNodes(tree, this[_workspaces]) - if (this[_includeWorkspaceRoot]) { - nodes.push(tree) - } - const appliedRequests = nodes.map( - node => this[_applyUserRequestsToNode](node, options) - ) - await Promise.all(appliedRequests) + await Promise.all(this.workspaceNodes(tree, this[_workspaces]) + .map(node => this[_applyUserRequestsToNode](node, options))) } process.emit('timeEnd', 'idealTree:userRequests') diff --git a/node_modules/@npmcli/arborist/lib/arborist/index.js b/node_modules/@npmcli/arborist/lib/arborist/index.js index ccfa7cad9..d8ca67faa 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/index.js +++ b/node_modules/@npmcli/arborist/lib/arborist/index.js @@ -58,7 +58,6 @@ class Arborist extends Base { cache: options.cache || `${homedir()}/.npm/_cacache`, packumentCache: options.packumentCache || new Map(), log: options.log || procLog, - workspacesEnabled: options.workspacesEnabled !== false, } if (options.saveType && !saveTypeMap.get(options.saveType)) { throw new Error(`Invalid saveType ${options.saveType}`) @@ -74,15 +73,8 @@ class Arborist extends Base { } // returns a set of workspace nodes and all their deps - workspaceDependencySet (tree, workspaces, includeWorkspaceRoot) { + workspaceDependencySet (tree, workspaces) { const wsNodes = this.workspaceNodes(tree, workspaces) - if (includeWorkspaceRoot) { - for (const edge of tree.edgesOut.values()) { - if (edge.type !== 'workspace' && edge.to) { - wsNodes.push(edge.to) - } - } - } const set = new Set(wsNodes) const extraneous = new Set() for (const node of set) { @@ -104,25 +96,6 @@ class Arborist extends Base { for (const extra of extraneous) { set.add(extra) } - - return set - } - - excludeWorkspacesDependencySet (tree) { - const set = new Set() - for (const edge of tree.edgesOut.values()) { - if (edge.type !== 'workspace' && edge.to) { - set.add(edge.to) - } - } - for (const node of set) { - for (const edge of node.edgesOut.values()) { - if (edge.to) { - set.add(edge.to) - } - } - } - return set } } diff --git a/node_modules/@npmcli/arborist/lib/arborist/rebuild.js b/node_modules/@npmcli/arborist/lib/arborist/rebuild.js index 6fa5c0011..e48bdd76b 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/rebuild.js +++ b/node_modules/@npmcli/arborist/lib/arborist/rebuild.js @@ -34,7 +34,6 @@ const _addToBuildSet = Symbol('addToBuildSet') const _checkBins = Symbol.for('checkBins') const _queues = Symbol('queues') const _scriptShell = Symbol('scriptShell') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') const _force = Symbol.for('force') @@ -78,11 +77,7 @@ module.exports = cls => class Builder extends cls { if (!nodes) { const tree = await this.loadActual() if (this[_workspaces] && this[_workspaces].length) { - const filterSet = this.workspaceDependencySet( - tree, - this[_workspaces], - this[_includeWorkspaceRoot] - ) + const filterSet = this.workspaceDependencySet(tree, this[_workspaces]) nodes = tree.inventory.filter(node => filterSet.has(node)) } else { nodes = tree.inventory.values() diff --git a/node_modules/@npmcli/arborist/lib/arborist/reify.js b/node_modules/@npmcli/arborist/lib/arborist/reify.js index a279d8956..3a9c47974 100644 --- a/node_modules/@npmcli/arborist/lib/arborist/reify.js +++ b/node_modules/@npmcli/arborist/lib/arborist/reify.js @@ -83,7 +83,6 @@ const _validateNodeModules = Symbol('validateNodeModules') const _nmValidated = Symbol('nmValidated') const _validatePath = Symbol('validatePath') const _reifyPackages = Symbol.for('reifyPackages') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') const _omitDev = Symbol('omitDev') const _omitOptional = Symbol('omitOptional') @@ -341,15 +340,6 @@ module.exports = cls => class Reifier extends cls { filterNodes.push(actual) } } - if (this[_includeWorkspaceRoot] && (this[_workspaces].length > 0)) { - for (const tree of [this.idealTree, this.actualTree]) { - for (const {type, to} of tree.edgesOut.values()) { - if (type !== 'workspace' && to) { - filterNodes.push(to) - } - } - } - } } // find all the nodes that need to change between the actual @@ -911,11 +901,7 @@ module.exports = cls => class Reifier extends cls { // if we're operating on a workspace, only audit the workspace deps if (this[_workspaces] && this[_workspaces].length) { - options.filterSet = this.workspaceDependencySet( - tree, - this[_workspaces], - this[_includeWorkspaceRoot] - ) + options.filterSet = this.workspaceDependencySet(tree, this[_workspaces]) } this.auditReport = AuditReport.load(tree, options) diff --git a/node_modules/@npmcli/arborist/package.json b/node_modules/@npmcli/arborist/package.json index f912d2af1..b39818d48 100644 --- a/node_modules/@npmcli/arborist/package.json +++ b/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "2.10.0", + "version": "2.9.0", "description": "Manage node_modules trees", "dependencies": { "@isaacs/string-locale-compare": "^1.0.1", diff --git a/package-lock.json b/package-lock.json index b8decbc1a..e8cc960ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,7 +85,7 @@ ], "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^2.10.0", + "@npmcli/arborist": "^2.9.0", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^2.3.0", "@npmcli/map-workspaces": "^1.0.4", @@ -771,9 +771,9 @@ } }, "node_modules/@npmcli/arborist": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-2.10.0.tgz", - "integrity": "sha512-CLnD+zXG9oijEEzViimz8fbOoFVb7hoypiaf7p6giJhvYtrxLAyY3cZAMPIFQvsG731+02eMDp3LqVBNo7BaZA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-2.9.0.tgz", + "integrity": "sha512-21DTow2xC0GlkowlE4zOu99UY21nSymW14fHZmB0yeAqhagmttJPmCUZXU+ngJmJ/Dwe5YP9QJUTgEVRLqnwcg==", "inBundle": true, "dependencies": { "@isaacs/string-locale-compare": "^1.0.1", @@ -11023,9 +11023,9 @@ "dev": true }, "@npmcli/arborist": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-2.10.0.tgz", - "integrity": "sha512-CLnD+zXG9oijEEzViimz8fbOoFVb7hoypiaf7p6giJhvYtrxLAyY3cZAMPIFQvsG731+02eMDp3LqVBNo7BaZA==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/@npmcli/arborist/-/arborist-2.9.0.tgz", + "integrity": "sha512-21DTow2xC0GlkowlE4zOu99UY21nSymW14fHZmB0yeAqhagmttJPmCUZXU+ngJmJ/Dwe5YP9QJUTgEVRLqnwcg==", "requires": { "@isaacs/string-locale-compare": "^1.0.1", "@npmcli/installed-package-contents": "^1.0.7", diff --git a/package.json b/package.json index 31083ff0b..705fb779e 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ }, "dependencies": { "@isaacs/string-locale-compare": "^1.1.0", - "@npmcli/arborist": "^2.10.0", + "@npmcli/arborist": "^2.9.0", "@npmcli/ci-detect": "^1.2.0", "@npmcli/config": "^2.3.0", "@npmcli/map-workspaces": "^1.0.4", |