From 6d1789cd5f3c8aad4ef83e38c4f5d131460dad0f Mon Sep 17 00:00:00 2001 From: Gar Date: Wed, 28 Feb 2024 09:29:12 -0800 Subject: [PATCH] fix: Arborist code cleanup (#7237) A bunch of tiny tweaks to Arborist, in service of eventually cleaning it up and removing the mixin approach. Most of the fixes are like before: removing symbols in favor of private attributes so we can easily find where state is being shared. There is also some shuffling of single-use methods into larger classes. --- workspaces/arborist/lib/arborist/audit.js | 51 - .../arborist/lib/arborist/build-ideal-tree.js | 102 +- workspaces/arborist/lib/arborist/deduper.js | 19 - workspaces/arborist/lib/arborist/index.js | 116 ++- .../arborist/lib/arborist/load-actual.js | 6 +- workspaces/arborist/lib/arborist/pruner.js | 30 - workspaces/arborist/lib/arborist/rebuild.js | 135 +-- workspaces/arborist/lib/arborist/reify.js | 52 +- .../arborist/lib/arborist/set-workspaces.js | 19 - .../arborist/lib/case-insensitive-map.js | 40 +- .../arborist/lib/get-workspace-nodes.js | 36 - workspaces/arborist/lib/index.js | 2 - workspaces/arborist/lib/query-selector-all.js | 2 - workspaces/arborist/lib/tracker.js | 57 +- workspaces/arborist/lib/version-from-tgz.js | 9 +- workspaces/arborist/lib/vuln.js | 59 +- .../tap-snapshots/test/link.js.test.cjs | 12 +- .../tap-snapshots/test/node.js.test.cjs | 908 +++++++++--------- .../arborist/test/get-workspace-nodes.js | 12 +- 19 files changed, 791 insertions(+), 876 deletions(-) delete mode 100644 workspaces/arborist/lib/arborist/audit.js delete mode 100644 workspaces/arborist/lib/arborist/deduper.js delete mode 100644 workspaces/arborist/lib/arborist/pruner.js delete mode 100644 workspaces/arborist/lib/arborist/set-workspaces.js delete mode 100644 workspaces/arborist/lib/get-workspace-nodes.js diff --git a/workspaces/arborist/lib/arborist/audit.js b/workspaces/arborist/lib/arborist/audit.js deleted file mode 100644 index af260bdc996fc..0000000000000 --- a/workspaces/arborist/lib/arborist/audit.js +++ /dev/null @@ -1,51 +0,0 @@ -// mixin implementing the audit method - -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 = {}) { - this.addTracker('audit') - if (this[_global]) { - throw Object.assign( - new Error('`npm audit` does not support testing globals'), - { code: 'EAUDITGLOBAL' } - ) - } - - // allow the user to set options on the ctor as well. - // XXX: deprecate separate method options objects. - options = { ...this.options, ...options } - - process.emit('time', 'audit') - let tree - if (options.packageLock === false) { - // build ideal tree - await this.loadActual(options) - await this.buildIdealTree() - tree = this.idealTree - } else { - 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) - } - this.auditReport = await AuditReport.load(tree, options) - const ret = options.fix ? this.reify(options) : this.auditReport - process.emit('timeEnd', 'audit') - this.finishTracker('audit') - return ret - } -} diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 374fda00854b2..8ceb6b72123f6 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -38,22 +38,15 @@ const resetDepFlags = require('../reset-dep-flags.js') // them with unit tests and reuse them across mixins const _updateAll = Symbol.for('updateAll') const _flagsSuspect = Symbol.for('flagsSuspect') -const _workspaces = Symbol.for('workspaces') const _setWorkspaces = Symbol.for('setWorkspaces') const _updateNames = Symbol.for('updateNames') const _resolvedAdd = Symbol.for('resolvedAdd') const _usePackageLock = Symbol.for('usePackageLock') const _rpcache = Symbol.for('realpathCache') const _stcache = Symbol.for('statCache') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') - -// exposed symbol for unit testing the placeDep method directly -const _peerSetSource = Symbol.for('peerSetSource') // used by Reify mixin -const _force = Symbol.for('force') -const _global = Symbol.for('global') -const _idealTreePrune = Symbol.for('idealTreePrune') +const _addNodeToTrashList = Symbol.for('addNodeToTrashList') // Push items in, pop them sorted by depth and then path // Sorts physically shallower deps up to the front of the queue, because @@ -117,6 +110,10 @@ module.exports = cls => class IdealTreeBuilder extends cls { #loadFailures = new Set() #manifests = new Map() #mutateTree = false + // a map of each module in a peer set to the thing that depended on + // that set of peers in the first place. Use a WeakMap so that we + // don't hold onto references for nodes that are garbage collected. + #peerSetSource = new WeakMap() #preferDedupe = false #prune #strictPeerDeps @@ -131,20 +128,16 @@ module.exports = cls => class IdealTreeBuilder extends cls { const { follow = false, - force = false, - global = false, installStrategy = 'hoisted', idealTree = null, - includeWorkspaceRoot = false, installLinks = false, legacyPeerDeps = false, packageLock = true, strictPeerDeps = false, - workspaces = [], + workspaces, + global, } = options - this[_workspaces] = workspaces || [] - this[_force] = !!force this.#strictPeerDeps = !!strictPeerDeps this.idealTree = idealTree @@ -152,24 +145,16 @@ module.exports = cls => class IdealTreeBuilder extends cls { this.legacyPeerDeps = legacyPeerDeps this[_usePackageLock] = packageLock - this[_global] = !!global this.#installStrategy = global ? 'shallow' : installStrategy this.#follow = !!follow - if (this[_workspaces].length && this[_global]) { + if (workspaces?.length && global) { throw new Error('Cannot operate on workspaces in global mode') } this[_updateAll] = false this[_updateNames] = [] this[_resolvedAdd] = [] - - // a map of each module in a peer set to the thing that depended on - // that set of peers in the first place. Use a WeakMap so that we - // don't hold onto references for nodes that are garbage collected. - this[_peerSetSource] = new WeakMap() - - this[_includeWorkspaceRoot] = includeWorkspaceRoot } get explicitRequests () { @@ -196,7 +181,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { process.emit('time', 'idealTree') - if (!options.add && !options.rm && !options.update && this[_global]) { + if (!options.add && !options.rm && !options.update && this.options.global) { throw new Error('global requires add, rm, or update option') } @@ -232,7 +217,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { for (const node of this.idealTree.inventory.values()) { if (!node.optional) { try { - checkEngine(node.package, npmVersion, nodeVersion, this[_force]) + checkEngine(node.package, npmVersion, nodeVersion, this.options.force) } catch (err) { if (engineStrict) { throw err @@ -243,7 +228,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { current: err.current, }) } - checkPlatform(node.package, this[_force]) + checkPlatform(node.package, this.options.force) } } } @@ -295,7 +280,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { async #initTree () { process.emit('time', 'idealTree:init') let root - if (this[_global]) { + if (this.options.global) { root = await this.#globalRootNode() } else { try { @@ -313,7 +298,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { // When updating all, we load the shrinkwrap, but don't bother // to build out the full virtual tree from it, since we'll be // reconstructing it anyway. - .then(root => this[_global] ? root + .then(root => this.options.global ? root : !this[_usePackageLock] || this[_updateAll] ? Shrinkwrap.reset({ path: this.path, @@ -329,7 +314,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { // Load on a new Arborist object, so the Nodes aren't the same, // or else it'll get super confusing when we change them! .then(async root => { - if ((!this[_updateAll] && !this[_global] && !root.meta.loadedFromDisk) || (this[_global] && this[_updateNames].length)) { + if ((!this[_updateAll] && !this.options.global && !root.meta.loadedFromDisk) || (this.options.global && this[_updateNames].length)) { await new this.constructor(this.options).loadActual({ root }) const tree = root.target // even though we didn't load it from a package-lock.json FILE, @@ -408,7 +393,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { devOptional: false, peer: false, optional: false, - global: this[_global], + global: this.options.global, installLinks: this.installLinks, legacyPeerDeps: this.legacyPeerDeps, loadOverrides: true, @@ -423,7 +408,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { devOptional: false, peer: false, optional: false, - global: this[_global], + global: this.options.global, installLinks: this.installLinks, legacyPeerDeps: this.legacyPeerDeps, root, @@ -438,11 +423,11 @@ module.exports = cls => class IdealTreeBuilder extends cls { process.emit('time', 'idealTree:userRequests') const tree = this.idealTree.target - if (!this[_workspaces].length) { + if (!this.options.workspaces.length) { await this.#applyUserRequestsToNode(tree, options) } else { - const nodes = this.workspaceNodes(tree, this[_workspaces]) - if (this[_includeWorkspaceRoot]) { + const nodes = this.workspaceNodes(tree, this.options.workspaces) + if (this.options.includeWorkspaceRoot) { nodes.push(tree) } const appliedRequests = nodes.map( @@ -458,14 +443,14 @@ module.exports = cls => class IdealTreeBuilder extends cls { // If we have a list of package names to update, and we know it's // going to update them wherever they are, add any paths into those // named nodes to the buildIdealTree queue. - if (!this[_global] && this[_updateNames].length) { + if (!this.options.global && this[_updateNames].length) { this.#queueNamedUpdates() } // global updates only update the globalTop nodes, but we need to know // that they're there, and not reinstall the world unnecessarily. const globalExplicitUpdateNames = [] - if (this[_global] && (this[_updateAll] || this[_updateNames].length)) { + if (this.options.global && (this[_updateAll] || this[_updateNames].length)) { const nm = resolve(this.path, 'node_modules') const paths = await readdirScoped(nm).catch(() => []) for (const p of paths) { @@ -510,7 +495,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { // triggers a refresh of all edgesOut. this has to be done BEFORE // adding the edges to explicitRequests, because the package setter // resets all edgesOut. - if (add && add.length || rm && rm.length || this[_global]) { + if (add && add.length || rm && rm.length || this.options.global) { tree.package = tree.package } @@ -616,7 +601,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { // // XXX: how to handle top nodes that aren't the root? Maybe the report // just tells the user to cd into that directory and fix it? - if (this[_force] && this.auditReport && this.auditReport.topVulns.size) { + if (this.options.force && this.auditReport && this.auditReport.topVulns.size) { options.add = options.add || [] options.rm = options.rm || [] const nodesTouched = new Set() @@ -900,7 +885,7 @@ This is a one-time fix-up, please be patient... // dep if allowed. const tasks = [] - const peerSource = this[_peerSetSource].get(node) || node + const peerSource = this.#peerSetSource.get(node) || node for (const edge of this.#problemEdges(node)) { if (edge.peerConflicted) { continue @@ -958,7 +943,7 @@ This is a one-time fix-up, please be patient... auditReport: this.auditReport, explicitRequest: this.#explicitRequests.has(edge), - force: this[_force], + force: this.options.force, installLinks: this.installLinks, installStrategy: this.#installStrategy, legacyPeerDeps: this.legacyPeerDeps, @@ -1099,13 +1084,13 @@ This is a one-time fix-up, please be patient... // keep track of the thing that caused this node to be included. const src = parent.sourceReference - this[_peerSetSource].set(node, src) + this.#peerSetSource.set(node, src) // do not load the peers along with the set if this is a global top pkg // otherwise we'll be tempted to put peers as other top-level installed // things, potentially clobbering what's there already, which is not // what we want. the missing edges will be picked up on the next pass. - if (this[_global] && edge.from.isProjectRoot) { + if (this.options.global && edge.from.isProjectRoot) { return node } @@ -1328,7 +1313,7 @@ This is a one-time fix-up, please be patient... const parentEdge = node.parent.edgesOut.get(edge.name) const { isProjectRoot, isWorkspace } = node.parent.sourceReference const isMine = isProjectRoot || isWorkspace - const conflictOK = this[_force] || !isMine && !this.#strictPeerDeps + const conflictOK = this.options.force || !isMine && !this.#strictPeerDeps if (!edge.to) { if (!parentEdge) { @@ -1415,7 +1400,7 @@ This is a one-time fix-up, please be patient... currentEdge: currentEdge ? currentEdge.explain() : null, edge: edge.explain(), strictPeerDeps: this.#strictPeerDeps, - force: this[_force], + force: this.options.force, } } @@ -1503,7 +1488,7 @@ This is a one-time fix-up, please be patient... // otherwise, don't bother. const needPrune = metaFromDisk && (mutateTree || flagsSuspect) if (this.#prune && needPrune) { - this[_idealTreePrune]() + this.#idealTreePrune() for (const node of this.idealTree.inventory.values()) { if (node.extraneous) { node.parent = null @@ -1514,7 +1499,7 @@ This is a one-time fix-up, please be patient... process.emit('timeEnd', 'idealTree:fixDepFlags') } - [_idealTreePrune] () { + #idealTreePrune () { for (const node of this.idealTree.inventory.values()) { if (node.extraneous) { node.parent = null @@ -1534,4 +1519,29 @@ This is a one-time fix-up, please be patient... } } } + + async prune (options = {}) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + await this.buildIdealTree(options) + + this.#idealTreePrune() + + if (!this.options.workspacesEnabled) { + const excludeNodes = this.excludeWorkspacesDependencySet(this.idealTree) + for (const node of this.idealTree.inventory.values()) { + if ( + node.parent !== null + && !node.isProjectRoot + && !excludeNodes.has(node) + ) { + this[_addNodeToTrashList](node) + } + } + } + + return this.reify(options) + } } diff --git a/workspaces/arborist/lib/arborist/deduper.js b/workspaces/arborist/lib/arborist/deduper.js deleted file mode 100644 index 1741c31a19a27..0000000000000 --- a/workspaces/arborist/lib/arborist/deduper.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = cls => class Deduper extends cls { - async dedupe (options = {}) { - // allow the user to set options on the ctor as well. - // XXX: deprecate separate method options objects. - options = { ...this.options, ...options } - const tree = await this.loadVirtual().catch(() => this.loadActual()) - const names = [] - for (const name of tree.inventory.query('name')) { - if (tree.inventory.query('name', name).size > 1) { - names.push(name) - } - } - return this.reify({ - ...options, - preferDedupe: true, - update: { names }, - }) - } -} diff --git a/workspaces/arborist/lib/arborist/index.js b/workspaces/arborist/lib/arborist/index.js index ec25117c2a874..358f3e1b1a759 100644 --- a/workspaces/arborist/lib/arborist/index.js +++ b/workspaces/arborist/lib/arborist/index.js @@ -29,15 +29,16 @@ const { resolve } = require('path') const { homedir } = require('os') const { depth } = require('treeverse') +const mapWorkspaces = require('@npmcli/map-workspaces') +const log = require('proc-log') + const { saveTypeMap } = require('../add-rm-pkg-deps.js') +const AuditReport = require('../audit-report.js') +const relpath = require('../relpath.js') const mixins = [ require('../tracker.js'), - require('./pruner.js'), - require('./deduper.js'), - require('./audit.js'), require('./build-ideal-tree.js'), - require('./set-workspaces.js'), require('./load-actual.js'), require('./load-virtual.js'), require('./rebuild.js'), @@ -45,9 +46,8 @@ const mixins = [ require('./isolated-reifier.js'), ] -const _workspacesEnabled = Symbol.for('workspacesEnabled') +const _setWorkspaces = Symbol.for('setWorkspaces') const Base = mixins.reduce((a, b) => b(a), require('events')) -const getWorkspaceNodes = require('../get-workspace-nodes.js') // if it's 1, 2, or 3, set it explicitly that. // if undefined or null, set it null @@ -72,20 +72,26 @@ class Arborist extends Base { nodeVersion: process.version, ...options, Arborist: this.constructor, - path: options.path || '.', + binLinks: 'binLinks' in options ? !!options.binLinks : true, cache: options.cache || `${homedir()}/.npm/_cacache`, + force: !!options.force, + global: !!options.global, + ignoreScripts: !!options.ignoreScripts, + installStrategy: options.global ? 'shallow' : (options.installStrategy ? options.installStrategy : 'hoisted'), + lockfileVersion: lockfileVersion(options.lockfileVersion), packumentCache: options.packumentCache || new Map(), - workspacesEnabled: options.workspacesEnabled !== false, + path: options.path || '.', + rebuildBundle: 'rebuildBundle' in options ? !!options.rebuildBundle : true, replaceRegistryHost: options.replaceRegistryHost, - lockfileVersion: lockfileVersion(options.lockfileVersion), - installStrategy: options.global ? 'shallow' : (options.installStrategy ? options.installStrategy : 'hoisted'), + scriptShell: options.scriptShell, + workspaces: options.workspaces || [], + workspacesEnabled: options.workspacesEnabled !== false, } + // TODO is this even used? If not is that a bug? this.replaceRegistryHost = this.options.replaceRegistryHost = (!this.options.replaceRegistryHost || this.options.replaceRegistryHost === 'npmjs') ? 'registry.npmjs.org' : this.options.replaceRegistryHost - this[_workspacesEnabled] = this.options.workspacesEnabled - if (options.saveType && !saveTypeMap.get(options.saveType)) { throw new Error(`Invalid saveType ${options.saveType}`) } @@ -97,12 +103,40 @@ class Arborist extends Base { // TODO: We should change these to static functions instead // of methods for the next major version - // returns an array of the actual nodes for all the workspaces + // Get the actual nodes corresponding to a root node's child workspaces, + // given a list of workspace names. workspaceNodes (tree, workspaces) { - return getWorkspaceNodes(tree, workspaces) + const wsMap = tree.workspaces + if (!wsMap) { + log.warn('workspaces', 'filter set, but no workspaces present') + return [] + } + + const nodes = [] + for (const name of workspaces) { + const path = wsMap.get(name) + if (!path) { + log.warn('workspaces', `${name} in filter set, but not in workspaces`) + continue + } + + const loc = relpath(tree.realpath, path) + const node = tree.inventory.get(loc) + + if (!node) { + log.warn('workspaces', `${name} in filter set, but no workspace folder present`) + continue + } + + nodes.push(node) + } + + return nodes } // returns a set of workspace nodes and all their deps + // TODO why is includeWorkspaceRoot a param? + // TODO why is workspaces a param? workspaceDependencySet (tree, workspaces, includeWorkspaceRoot) { const wsNodes = this.workspaceNodes(tree, workspaces) if (includeWorkspaceRoot) { @@ -162,6 +196,60 @@ class Arborist extends Base { }) return rootDepSet } + + async [_setWorkspaces] (node) { + const workspaces = await mapWorkspaces({ + cwd: node.path, + pkg: node.package, + }) + + if (node && workspaces.size) { + node.workspaces = workspaces + } + + return node + } + + async audit (options = {}) { + this.addTracker('audit') + if (this.options.global) { + throw Object.assign( + new Error('`npm audit` does not support testing globals'), + { code: 'EAUDITGLOBAL' } + ) + } + + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + + process.emit('time', 'audit') + let tree + if (options.packageLock === false) { + // build ideal tree + await this.loadActual(options) + await this.buildIdealTree() + tree = this.idealTree + } else { + tree = await this.loadVirtual() + } + if (this.options.workspaces.length) { + options.filterSet = this.workspaceDependencySet( + tree, + this.options.workspaces, + this.options.includeWorkspaceRoot + ) + } + if (!options.workspacesEnabled) { + options.filterSet = + this.excludeWorkspacesDependencySet(tree) + } + this.auditReport = await AuditReport.load(tree, options) + const ret = options.fix ? this.reify(options) : this.auditReport + process.emit('timeEnd', 'audit') + this.finishTracker('audit') + return ret + } } module.exports = Arborist diff --git a/workspaces/arborist/lib/arborist/load-actual.js b/workspaces/arborist/lib/arborist/load-actual.js index def00dc74f039..3ab5f5983768d 100644 --- a/workspaces/arborist/lib/arborist/load-actual.js +++ b/workspaces/arborist/lib/arborist/load-actual.js @@ -16,7 +16,6 @@ const realpath = require('../realpath.js') // public symbols const _changePath = Symbol.for('_changePath') -const _global = Symbol.for('global') const _setWorkspaces = Symbol.for('setWorkspaces') const _rpcache = Symbol.for('realpathCache') const _stcache = Symbol.for('statCache') @@ -45,8 +44,6 @@ module.exports = cls => class ActualLoader extends cls { constructor (options) { super(options) - this[_global] = !!options.global - // the tree of nodes on disk this.actualTree = options.actualTree @@ -58,6 +55,7 @@ module.exports = cls => class ActualLoader extends cls { } // public method + // TODO remove options param in next semver major async loadActual (options = {}) { // In the past this.actualTree was set as a promise that eventually // resolved, and overwrite this.actualTree with the resolved value. This @@ -100,7 +98,7 @@ module.exports = cls => class ActualLoader extends cls { async #loadActual (options) { // mostly realpath to throw if the root doesn't exist const { - global = false, + global, filter = () => true, root = null, transplantFilter = () => true, diff --git a/workspaces/arborist/lib/arborist/pruner.js b/workspaces/arborist/lib/arborist/pruner.js deleted file mode 100644 index 494114dfa56c5..0000000000000 --- a/workspaces/arborist/lib/arborist/pruner.js +++ /dev/null @@ -1,30 +0,0 @@ -const _idealTreePrune = Symbol.for('idealTreePrune') -const _workspacesEnabled = Symbol.for('workspacesEnabled') -const _addNodeToTrashList = Symbol.for('addNodeToTrashList') - -module.exports = cls => class Pruner extends cls { - async prune (options = {}) { - // allow the user to set options on the ctor as well. - // XXX: deprecate separate method options objects. - options = { ...this.options, ...options } - - await this.buildIdealTree(options) - - this[_idealTreePrune]() - - if (!this[_workspacesEnabled]) { - const excludeNodes = this.excludeWorkspacesDependencySet(this.idealTree) - for (const node of this.idealTree.inventory.values()) { - if ( - node.parent !== null - && !node.isProjectRoot - && !excludeNodes.has(node) - ) { - this[_addNodeToTrashList](node) - } - } - } - - return this.reify(options) - } -} diff --git a/workspaces/arborist/lib/arborist/rebuild.js b/workspaces/arborist/lib/arborist/rebuild.js index 67543b192a057..422819b2104b7 100644 --- a/workspaces/arborist/lib/arborist/rebuild.js +++ b/workspaces/arborist/lib/arborist/rebuild.js @@ -19,67 +19,37 @@ const boolEnv = b => b ? '1' : '' const sortNodes = (a, b) => (a.depth - b.depth) || localeCompare(a.path, b.path) -const _workspaces = Symbol.for('workspaces') -const _build = Symbol('build') -const _loadDefaultNodes = Symbol('loadDefaultNodes') -const _retrieveNodesByType = Symbol('retrieveNodesByType') -const _resetQueues = Symbol('resetQueues') -const _rebuildBundle = Symbol('rebuildBundle') -const _ignoreScripts = Symbol('ignoreScripts') -const _binLinks = Symbol('binLinks') -const _oldMeta = Symbol('oldMeta') -const _createBinLinks = Symbol('createBinLinks') -const _doHandleOptionalFailure = Symbol('doHandleOptionalFailure') -const _linkAllBins = Symbol('linkAllBins') -const _runScripts = Symbol('runScripts') -const _buildQueues = Symbol('buildQueues') -const _addToBuildSet = Symbol('addToBuildSet') const _checkBins = Symbol.for('checkBins') -const _queues = Symbol('queues') -const _scriptShell = Symbol('scriptShell') -const _includeWorkspaceRoot = Symbol.for('includeWorkspaceRoot') -const _workspacesEnabled = Symbol.for('workspacesEnabled') - -const _force = Symbol.for('force') -const _global = Symbol.for('global') // defined by reify mixin const _handleOptionalFailure = Symbol.for('handleOptionalFailure') const _trashList = Symbol.for('trashList') module.exports = cls => class Builder extends cls { + #doHandleOptionalFailure + #oldMeta = null + #queues + constructor (options) { super(options) - const { - ignoreScripts = false, - scriptShell, - binLinks = true, - rebuildBundle = true, - } = options - this.scriptsRun = new Set() - this[_binLinks] = binLinks - this[_ignoreScripts] = !!ignoreScripts - this[_scriptShell] = scriptShell - this[_rebuildBundle] = !!rebuildBundle - this[_resetQueues]() - this[_oldMeta] = null + this.#resetQueues() } async rebuild ({ nodes, handleOptionalFailure = false } = {}) { // nothing to do if we're not building anything! - if (this[_ignoreScripts] && !this[_binLinks]) { + if (this.options.ignoreScripts && !this.options.binLinks) { return } // when building for the first time, as part of reify, we ignore // failures in optional nodes, and just delete them. however, when // running JUST a rebuild, we treat optional failures as real fails - this[_doHandleOptionalFailure] = handleOptionalFailure + this.#doHandleOptionalFailure = handleOptionalFailure if (!nodes) { - nodes = await this[_loadDefaultNodes]() + nodes = await this.#loadDefaultNodes() } // separates links nodes so that it can run @@ -89,15 +59,15 @@ module.exports = cls => class Builder extends cls { const { depNodes, linkNodes, - } = this[_retrieveNodesByType](nodes) + } = this.#retrieveNodesByType(nodes) // build regular deps - await this[_build](depNodes, {}) + await this.#build(depNodes, {}) // build link deps if (linkNodes.size) { - this[_resetQueues]() - await this[_build](linkNodes, { type: 'links' }) + this.#resetQueues() + await this.#build(linkNodes, { type: 'links' }) } process.emit('timeEnd', 'build') @@ -105,20 +75,20 @@ module.exports = cls => class Builder extends cls { // if we don't have a set of nodes, then just rebuild // the actual tree on disk. - async [_loadDefaultNodes] () { + async #loadDefaultNodes () { let nodes const tree = await this.loadActual() let filterSet - if (!this[_workspacesEnabled]) { + if (!this.options.workspacesEnabled) { filterSet = this.excludeWorkspacesDependencySet(tree) nodes = tree.inventory.filter(node => filterSet.has(node) || node.isProjectRoot ) - } else if (this[_workspaces] && this[_workspaces].length) { + } else if (this.options.workspaces.length) { filterSet = this.workspaceDependencySet( tree, - this[_workspaces], - this[_includeWorkspaceRoot] + this.options.workspaces, + this.options.includeWorkspaceRoot ) nodes = tree.inventory.filter(node => filterSet.has(node)) } else { @@ -127,7 +97,7 @@ module.exports = cls => class Builder extends cls { return nodes } - [_retrieveNodesByType] (nodes) { + #retrieveNodesByType (nodes) { const depNodes = new Set() const linkNodes = new Set() const storeNodes = new Set() @@ -154,7 +124,7 @@ module.exports = cls => class Builder extends cls { // // we avoid doing so if global=true since `bin-links` relies // on having the target nodes available in global mode. - if (!this[_global]) { + if (!this.options.global) { for (const node of linkNodes) { depNodes.delete(node.target) } @@ -166,8 +136,8 @@ module.exports = cls => class Builder extends cls { } } - [_resetQueues] () { - this[_queues] = { + #resetQueues () { + this.#queues = { preinstall: [], install: [], postinstall: [], @@ -176,46 +146,46 @@ module.exports = cls => class Builder extends cls { } } - async [_build] (nodes, { type = 'deps' }) { + async #build (nodes, { type = 'deps' }) { process.emit('time', `build:${type}`) - await this[_buildQueues](nodes) + await this.#buildQueues(nodes) - if (!this[_ignoreScripts]) { - await this[_runScripts]('preinstall') + if (!this.options.ignoreScripts) { + await this.#runScripts('preinstall') } // links should run prepare scripts and only link bins after that if (type === 'links') { - await this[_runScripts]('prepare') + await this.#runScripts('prepare') } - if (this[_binLinks]) { - await this[_linkAllBins]() + if (this.options.binLinks) { + await this.#linkAllBins() } - if (!this[_ignoreScripts]) { - await this[_runScripts]('install') - await this[_runScripts]('postinstall') + if (!this.options.ignoreScripts) { + await this.#runScripts('install') + await this.#runScripts('postinstall') } process.emit('timeEnd', `build:${type}`) } - async [_buildQueues] (nodes) { + async #buildQueues (nodes) { process.emit('time', 'build:queue') const set = new Set() const promises = [] for (const node of nodes) { - promises.push(this[_addToBuildSet](node, set)) + promises.push(this.#addToBuildSet(node, set)) // if it has bundle deps, add those too, if rebuildBundle - if (this[_rebuildBundle] !== false) { + if (this.options.rebuildBundle !== false) { const bd = node.package.bundleDependencies if (bd && bd.length) { dfwalk({ tree: node, - leave: node => promises.push(this[_addToBuildSet](node, set)), + leave: node => promises.push(this.#addToBuildSet(node, set)), getChildren: node => [...node.children.values()], filter: node => node.inBundle, }) @@ -236,7 +206,7 @@ module.exports = cls => class Builder extends cls { const tests = { bin, preinstall, install, postinstall, prepare } for (const [key, has] of Object.entries(tests)) { if (has) { - this[_queues][key].push(node) + this.#queues[key].push(node) } } } @@ -249,21 +219,21 @@ module.exports = cls => class Builder extends cls { // the node path. Otherwise a package can have a preinstall script // that unlinks something, to allow them to silently overwrite system // binaries, which is unsafe and insecure. - if (!node.globalTop || this[_force]) { + if (!node.globalTop || this.options.force) { return } const { path, package: pkg } = node await binLinks.checkBins({ pkg, path, top: true, global: true }) } - async [_addToBuildSet] (node, set, refreshed = false) { + async #addToBuildSet (node, set, refreshed = false) { if (set.has(node)) { return } - if (this[_oldMeta] === null) { + if (this.#oldMeta === null) { const { root: { meta } } = node - this[_oldMeta] = meta && meta.loadedFromDisk && + this.#oldMeta = meta && meta.loadedFromDisk && !(meta.originalLockfileVersion >= 2) } @@ -272,7 +242,7 @@ module.exports = cls => class Builder extends cls { const { preinstall, install, postinstall, prepare } = scripts const anyScript = preinstall || install || postinstall || prepare - if (!refreshed && !anyScript && (hasInstallScript || this[_oldMeta])) { + if (!refreshed && !anyScript && (hasInstallScript || this.#oldMeta)) { // we either have an old metadata (and thus might have scripts) // or we have an indication that there's install scripts (but // don't yet know what they are) so we have to load the package.json @@ -286,7 +256,7 @@ module.exports = cls => class Builder extends cls { const { scripts = {} } = pkg node.package.scripts = scripts - return this[_addToBuildSet](node, set, true) + return this.#addToBuildSet(node, set, true) } // Rebuild node-gyp dependencies lacking an install or preinstall script @@ -309,8 +279,8 @@ module.exports = cls => class Builder extends cls { } } - async [_runScripts] (event) { - const queue = this[_queues][event] + async #runScripts (event) { + const queue = this.#queues[event] if (!queue.length) { return @@ -358,7 +328,7 @@ module.exports = cls => class Builder extends cls { pkg, stdio, env, - scriptShell: this[_scriptShell], + scriptShell: this.options.scriptShell, } const p = runScript(runOpts).catch(er => { const { code, signal } = er @@ -382,7 +352,7 @@ module.exports = cls => class Builder extends cls { log.info('run', pkg._id, event, { code, signal }) }) - await (this[_doHandleOptionalFailure] + await (this.#doHandleOptionalFailure ? this[_handleOptionalFailure](node, p) : p) @@ -391,8 +361,8 @@ module.exports = cls => class Builder extends cls { process.emit('timeEnd', `build:run:${event}`) } - async [_linkAllBins] () { - const queue = this[_queues].bin + async #linkAllBins () { + const queue = this.#queues.bin if (!queue.length) { return } @@ -402,14 +372,15 @@ module.exports = cls => class Builder extends cls { // sort the queue by node path, so that the module-local collision // detector in bin-links will always resolve the same way. for (const node of queue.sort(sortNodes)) { - promises.push(this[_createBinLinks](node)) + // TODO these run before they're awaited + promises.push(this.#createBinLinks(node)) } await promiseAllRejectLate(promises) process.emit('timeEnd', 'build:link') } - async [_createBinLinks] (node) { + async #createBinLinks (node) { if (this[_trashList].has(node.path)) { return } @@ -420,11 +391,11 @@ module.exports = cls => class Builder extends cls { pkg: node.package, path: node.path, top: !!(node.isTop || node.globalTop), - force: this[_force], + force: this.options.force, global: !!node.globalTop, }) - await (this[_doHandleOptionalFailure] + await (this.#doHandleOptionalFailure ? this[_handleOptionalFailure](node, p) : p) diff --git a/workspaces/arborist/lib/arborist/reify.js b/workspaces/arborist/lib/arborist/reify.js index 801712c293d51..a70e21821ecb8 100644 --- a/workspaces/arborist/lib/arborist/reify.js +++ b/workspaces/arborist/lib/arborist/reify.js @@ -24,7 +24,6 @@ const PackageJson = require('@npmcli/package-json') const packageContents = require('@npmcli/installed-package-contents') const runScript = require('@npmcli/run-script') const { checkEngine, checkPlatform } = require('npm-install-checks') -const _force = Symbol.for('force') const treeCheck = require('../tree-check.js') const relpath = require('../relpath.js') @@ -48,8 +47,6 @@ const _retireShallowNodes = Symbol.for('retireShallowNodes') const _getBundlesByDepth = Symbol('getBundlesByDepth') const _registryResolved = Symbol('registryResolved') const _addNodeToTrashList = Symbol.for('addNodeToTrashList') -const _workspaces = Symbol.for('workspaces') -const _workspacesEnabled = Symbol.for('workspacesEnabled') // shared by rebuild mixin const _trashList = Symbol.for('trashList') @@ -91,14 +88,11 @@ 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') const _omitPeer = Symbol('omitPeer') -const _global = Symbol.for('global') - const _pruneBundledMetadeps = Symbol('pruneBundledMetadeps') // defined by Ideal mixin @@ -142,7 +136,7 @@ module.exports = cls => class Reifier extends cls { async reify (options = {}) { const linked = (options.installStrategy || this.options.installStrategy) === 'linked' - if (this[_packageLockOnly] && this[_global]) { + if (this[_packageLockOnly] && this.options.global) { const er = new Error('cannot generate lockfile for global packages') er.code = 'ESHRINKWRAPGLOBAL' throw er @@ -287,7 +281,7 @@ module.exports = cls => class Reifier extends cls { .then(() => process.emit('timeEnd', 'reify:loadTrees')) } - const actualOpt = this[_global] ? { + const actualOpt = this.options.global ? { ignoreMissing: true, global: true, filter: (node, kid) => { @@ -314,7 +308,7 @@ module.exports = cls => class Reifier extends cls { }, } : { ignoreMissing: true } - if (!this[_global]) { + if (!this.options.global) { return Promise.all([ this.loadActual(actualOpt), this.buildIdealTree(bitOpt), @@ -341,12 +335,12 @@ module.exports = cls => class Reifier extends cls { // to just invalidate the parts that changed, but avoid walking the // whole tree again. - const includeWorkspaces = this[_workspacesEnabled] - const includeRootDeps = !this[_workspacesEnabled] - || this[_includeWorkspaceRoot] && this[_workspaces].length > 0 + const includeWorkspaces = this.options.workspacesEnabled + const includeRootDeps = !includeWorkspaces + || this.options.includeWorkspaceRoot && this.options.workspaces.length > 0 const filterNodes = [] - if (this[_global] && this.explicitRequests.size) { + if (this.options.global && this.explicitRequests.size) { const idealTree = this.idealTree.target const actualTree = this.actualTree.target // we ONLY are allowed to make changes in the global top-level @@ -364,7 +358,7 @@ module.exports = cls => class Reifier extends cls { } else { if (includeWorkspaces) { // add all ws nodes to filterNodes - for (const ws of this[_workspaces]) { + for (const ws of this.options.workspaces) { const ideal = this.idealTree.children.get(ws) if (ideal) { filterNodes.push(ideal) @@ -656,7 +650,7 @@ module.exports = cls => class Reifier extends cls { // do not allow node_modules to be a symlink async [_validateNodeModules] (nm) { - if (this[_force] || this[_nmValidated].has(nm)) { + if (this.options.force || this[_nmValidated].has(nm)) { return } const st = await lstat(nm).catch(() => null) @@ -992,11 +986,11 @@ module.exports = cls => class Reifier extends cls { const tree = this.idealTree // if we're operating on a workspace, only audit the workspace deps - if (this[_workspaces] && this[_workspaces].length) { + if (this.options.workspaces.length) { options.filterSet = this.workspaceDependencySet( tree, - this[_workspaces], - this[_includeWorkspaceRoot] + this.options.workspaces, + this.options.includeWorkspaceRoot ) } @@ -1220,7 +1214,7 @@ module.exports = cls => class Reifier extends cls { // saveIdealTree to be able to write the lockfile by default. const saveIdealTree = !( (!save && !hasUpdates) - || this[_global] + || this.options.global || this[_dryRun] ) @@ -1566,7 +1560,7 @@ module.exports = cls => class Reifier extends cls { this.actualTree = this.idealTree this.idealTree = null - if (!this[_global]) { + if (!this.options.global) { await this.actualTree.meta.save() const ignoreScripts = !!this.options.ignoreScripts // if we aren't doing a dry run or ignoring scripts and we actually made changes to the dep @@ -1593,4 +1587,22 @@ module.exports = cls => class Reifier extends cls { } } } + + async dedupe (options = {}) { + // allow the user to set options on the ctor as well. + // XXX: deprecate separate method options objects. + options = { ...this.options, ...options } + const tree = await this.loadVirtual().catch(() => this.loadActual()) + const names = [] + for (const name of tree.inventory.query('name')) { + if (tree.inventory.query('name', name).size > 1) { + names.push(name) + } + } + return this.reify({ + ...options, + preferDedupe: true, + update: { names }, + }) + } } diff --git a/workspaces/arborist/lib/arborist/set-workspaces.js b/workspaces/arborist/lib/arborist/set-workspaces.js deleted file mode 100644 index 27a12708a7e82..0000000000000 --- a/workspaces/arborist/lib/arborist/set-workspaces.js +++ /dev/null @@ -1,19 +0,0 @@ -const mapWorkspaces = require('@npmcli/map-workspaces') - -// shared ref used by other mixins/Arborist -const _setWorkspaces = Symbol.for('setWorkspaces') - -module.exports = cls => class MapWorkspaces extends cls { - async [_setWorkspaces] (node) { - const workspaces = await mapWorkspaces({ - cwd: node.path, - pkg: node.package, - }) - - if (node && workspaces.size) { - node.workspaces = workspaces - } - - return node - } -} diff --git a/workspaces/arborist/lib/case-insensitive-map.js b/workspaces/arborist/lib/case-insensitive-map.js index 016ce6017b01e..afc6afbe0f98a 100644 --- a/workspaces/arborist/lib/case-insensitive-map.js +++ b/workspaces/arborist/lib/case-insensitive-map.js @@ -2,49 +2,49 @@ // are case-insensitive and unicode-normalizing, so we need to treat // node.children.get('FOO') and node.children.get('foo') as the same thing. -const _keys = Symbol('keys') -const _normKey = Symbol('normKey') -const normalize = s => s.normalize('NFKD').toLowerCase() -const OGMap = Map -module.exports = class Map extends OGMap { +module.exports = class CIMap extends Map { + #keys = new Map() + constructor (items = []) { super() - this[_keys] = new OGMap() for (const [key, val] of items) { this.set(key, val) } } - [_normKey] (key) { - return typeof key === 'string' ? normalize(key) : key + #normKey (key) { + if (typeof key !== 'string') { + return key + } + return key.normalize('NFKD').toLowerCase() } get (key) { - const normKey = this[_normKey](key) - return this[_keys].has(normKey) ? super.get(this[_keys].get(normKey)) + const normKey = this.#normKey(key) + return this.#keys.has(normKey) ? super.get(this.#keys.get(normKey)) : undefined } set (key, val) { - const normKey = this[_normKey](key) - if (this[_keys].has(normKey)) { - super.delete(this[_keys].get(normKey)) + const normKey = this.#normKey(key) + if (this.#keys.has(normKey)) { + super.delete(this.#keys.get(normKey)) } - this[_keys].set(normKey, key) + this.#keys.set(normKey, key) return super.set(key, val) } delete (key) { - const normKey = this[_normKey](key) - if (this[_keys].has(normKey)) { - const prevKey = this[_keys].get(normKey) - this[_keys].delete(normKey) + const normKey = this.#normKey(key) + if (this.#keys.has(normKey)) { + const prevKey = this.#keys.get(normKey) + this.#keys.delete(normKey) return super.delete(prevKey) } } has (key) { - const normKey = this[_normKey](key) - return this[_keys].has(normKey) && super.has(this[_keys].get(normKey)) + const normKey = this.#normKey(key) + return this.#keys.has(normKey) && super.has(this.#keys.get(normKey)) } } diff --git a/workspaces/arborist/lib/get-workspace-nodes.js b/workspaces/arborist/lib/get-workspace-nodes.js deleted file mode 100644 index 91002dab57085..0000000000000 --- a/workspaces/arborist/lib/get-workspace-nodes.js +++ /dev/null @@ -1,36 +0,0 @@ -// Get the actual nodes corresponding to a root node's child workspaces, -// given a list of workspace names. - -const log = require('proc-log') -const relpath = require('./relpath.js') - -const getWorkspaceNodes = (tree, workspaces) => { - const wsMap = tree.workspaces - if (!wsMap) { - log.warn('workspaces', 'filter set, but no workspaces present') - return [] - } - - const nodes = [] - for (const name of workspaces) { - const path = wsMap.get(name) - if (!path) { - log.warn('workspaces', `${name} in filter set, but not in workspaces`) - continue - } - - const loc = relpath(tree.realpath, path) - const node = tree.inventory.get(loc) - - if (!node) { - log.warn('workspaces', `${name} in filter set, but no workspace folder present`) - continue - } - - nodes.push(node) - } - - return nodes -} - -module.exports = getWorkspaceNodes diff --git a/workspaces/arborist/lib/index.js b/workspaces/arborist/lib/index.js index c7b07ce28e4df..5baaee6ee7c93 100644 --- a/workspaces/arborist/lib/index.js +++ b/workspaces/arborist/lib/index.js @@ -4,5 +4,3 @@ module.exports.Node = require('./node.js') module.exports.Link = require('./link.js') module.exports.Edge = require('./edge.js') module.exports.Shrinkwrap = require('./shrinkwrap.js') -// XXX export the other classes, too. shrinkwrap, diff, etc. -// they're handy! diff --git a/workspaces/arborist/lib/query-selector-all.js b/workspaces/arborist/lib/query-selector-all.js index 0c37ebd46be76..ce49201ce624c 100644 --- a/workspaces/arborist/lib/query-selector-all.js +++ b/workspaces/arborist/lib/query-selector-all.js @@ -919,8 +919,6 @@ const retrieveNodesFromParsedAst = async (opts) => { return results.collect(rootAstNode) } -// We are keeping this async in the event that we do add async operators, we -// won't have to have a breaking change on this function signature. const querySelectorAll = async (targetNode, query, flatOptions) => { // This never changes ever we just pass it around. But we can't scope it to // this whole file if we ever want to support concurrent calls to this diff --git a/workspaces/arborist/lib/tracker.js b/workspaces/arborist/lib/tracker.js index 42c401e8799e8..5acb32a5a7cfd 100644 --- a/workspaces/arborist/lib/tracker.js +++ b/workspaces/arborist/lib/tracker.js @@ -1,47 +1,46 @@ -const _progress = Symbol('_progress') -const _onError = Symbol('_onError') -const _setProgress = Symbol('_setProgess') const npmlog = require('npmlog') module.exports = cls => class Tracker extends cls { + #progress = new Map() + #setProgress + constructor (options = {}) { super(options) - this[_setProgress] = !!options.progress - this[_progress] = new Map() + this.#setProgress = !!options.progress } addTracker (section, subsection = null, key = null) { if (section === null || section === undefined) { - this[_onError](`Tracker can't be null or undefined`) + this.#onError(`Tracker can't be null or undefined`) } if (key === null) { key = subsection } - const hasTracker = this[_progress].has(section) - const hasSubtracker = this[_progress].has(`${section}:${key}`) + const hasTracker = this.#progress.has(section) + const hasSubtracker = this.#progress.has(`${section}:${key}`) if (hasTracker && subsection === null) { // 0. existing tracker, no subsection - this[_onError](`Tracker "${section}" already exists`) + this.#onError(`Tracker "${section}" already exists`) } else if (!hasTracker && subsection === null) { // 1. no existing tracker, no subsection // Create a new tracker from npmlog // starts progress bar - if (this[_setProgress] && this[_progress].size === 0) { + if (this.#setProgress && this.#progress.size === 0) { npmlog.enableProgress() } - this[_progress].set(section, npmlog.newGroup(section)) + this.#progress.set(section, npmlog.newGroup(section)) } else if (!hasTracker && subsection !== null) { // 2. no parent tracker and subsection - this[_onError](`Parent tracker "${section}" does not exist`) + this.#onError(`Parent tracker "${section}" does not exist`) } else if (!hasTracker || !hasSubtracker) { // 3. existing parent tracker, no subsection tracker - // Create a new subtracker in this[_progress] from parent tracker - this[_progress].set(`${section}:${key}`, - this[_progress].get(section).newGroup(`${section}:${subsection}`) + // Create a new subtracker in this.#progress from parent tracker + this.#progress.set(`${section}:${key}`, + this.#progress.get(section).newGroup(`${section}:${subsection}`) ) } // 4. existing parent tracker, existing subsection tracker @@ -50,22 +49,22 @@ module.exports = cls => class Tracker extends cls { finishTracker (section, subsection = null, key = null) { if (section === null || section === undefined) { - this[_onError](`Tracker can't be null or undefined`) + this.#onError(`Tracker can't be null or undefined`) } if (key === null) { key = subsection } - const hasTracker = this[_progress].has(section) - const hasSubtracker = this[_progress].has(`${section}:${key}`) + const hasTracker = this.#progress.has(section) + const hasSubtracker = this.#progress.has(`${section}:${key}`) // 0. parent tracker exists, no subsection - // Finish parent tracker and remove from this[_progress] + // Finish parent tracker and remove from this.#progress if (hasTracker && subsection === null) { // check if parent tracker does // not have any remaining children - const keys = this[_progress].keys() + const keys = this.#progress.keys() for (const key of keys) { if (key.match(new RegExp(section + ':'))) { this.finishTracker(section, key) @@ -73,28 +72,28 @@ module.exports = cls => class Tracker extends cls { } // remove parent tracker - this[_progress].get(section).finish() - this[_progress].delete(section) + this.#progress.get(section).finish() + this.#progress.delete(section) // remove progress bar if all // trackers are finished - if (this[_setProgress] && this[_progress].size === 0) { + if (this.#setProgress && this.#progress.size === 0) { npmlog.disableProgress() } } else if (!hasTracker && subsection === null) { // 1. no existing parent tracker, no subsection - this[_onError](`Tracker "${section}" does not exist`) + this.#onError(`Tracker "${section}" does not exist`) } else if (!hasTracker || hasSubtracker) { // 2. subtracker exists - // Finish subtracker and remove from this[_progress] - this[_progress].get(`${section}:${key}`).finish() - this[_progress].delete(`${section}:${key}`) + // Finish subtracker and remove from this.#progress + this.#progress.get(`${section}:${key}`).finish() + this.#progress.delete(`${section}:${key}`) } // 3. existing parent tracker, no subsection } - [_onError] (msg) { - if (this[_setProgress]) { + #onError (msg) { + if (this.#setProgress) { npmlog.disableProgress() } throw new Error(msg) diff --git a/workspaces/arborist/lib/version-from-tgz.js b/workspaces/arborist/lib/version-from-tgz.js index be4405cee998f..092cdbcbaf132 100644 --- a/workspaces/arborist/lib/version-from-tgz.js +++ b/workspaces/arborist/lib/version-from-tgz.js @@ -1,22 +1,21 @@ -/* eslint node/no-deprecated-api: "off" */ const semver = require('semver') const { basename } = require('path') -const { parse } = require('url') +const { URL } = require('url') module.exports = (name, tgz) => { const base = basename(tgz) if (!base.endsWith('.tgz')) { return null } - const u = parse(tgz) - if (/^https?:/.test(u.protocol)) { + if (tgz.startsWith('http:/') || tgz.startsWith('https:/')) { + const u = new URL(tgz) // registry url? check for most likely pattern. // either /@foo/bar/-/bar-1.2.3.tgz or // /foo/-/foo-1.2.3.tgz, and fall through to // basename checking. Note that registries can // be mounted below the root url, so /a/b/-/x/y/foo/-/foo-1.2.3.tgz // is a potential option. - const tfsplit = u.path.slice(1).split('/-/') + const tfsplit = u.pathname.slice(1).split('/-/') if (tfsplit.length > 1) { const afterTF = tfsplit.pop() if (afterTF === base) { diff --git a/workspaces/arborist/lib/vuln.js b/workspaces/arborist/lib/vuln.js index 81b921db01ad5..2bffe54f2dacd 100644 --- a/workspaces/arborist/lib/vuln.js +++ b/workspaces/arborist/lib/vuln.js @@ -16,24 +16,23 @@ const semverOpt = { loose: true, includePrerelease: true } const localeCompare = require('@isaacs/string-locale-compare')('en') const npa = require('npm-package-arg') -const _range = Symbol('_range') -const _simpleRange = Symbol('_simpleRange') -const _fixAvailable = Symbol('_fixAvailable') const severities = new Map([ - ['info', 0], - ['low', 1], - ['moderate', 2], - ['high', 3], - ['critical', 4], - [null, -1], + ['info', 0], [0, 'info'], + ['low', 1], [1, 'low'], + ['moderate', 2], [2, 'moderate'], + ['high', 3], [3, 'high'], + ['critical', 4], [4, 'critical'], + [null, -1], [-1, null], ]) -for (const [name, val] of severities.entries()) { - severities.set(val, name) -} - class Vuln { + #range = null + #simpleRange = null + // assume a fix is available unless it hits a top node + // that locks it in place, setting this false or {isSemVerMajor, version}. + #fixAvailable = true + constructor ({ name, advisory }) { this.name = name this.via = new Set() @@ -41,23 +40,18 @@ class Vuln { this.severity = null this.effects = new Set() this.topNodes = new Set() - this[_range] = null - this[_simpleRange] = null this.nodes = new Set() - // assume a fix is available unless it hits a top node - // that locks it in place, setting this false or {isSemVerMajor, version}. - this[_fixAvailable] = true this.addAdvisory(advisory) this.packument = advisory.packument this.versions = advisory.versions } get fixAvailable () { - return this[_fixAvailable] + return this.#fixAvailable } set fixAvailable (f) { - this[_fixAvailable] = f + this.#fixAvailable = f // if there's a fix available for this at the top level, it means that // it will also fix the vulns that led to it being there. to get there, // we set the vias to the most "strict" of fix availables. @@ -131,7 +125,7 @@ class Vuln { effects: [...this.effects].map(v => v.name).sort(localeCompare), range: this.simpleRange, nodes: [...this.nodes].map(n => n.location).sort(localeCompare), - fixAvailable: this[_fixAvailable], + fixAvailable: this.#fixAvailable, } } @@ -151,8 +145,8 @@ class Vuln { this.advisories.delete(advisory) // make sure we have the max severity of all the vulns causing this one this.severity = null - this[_range] = null - this[_simpleRange] = null + this.#range = null + this.#simpleRange = null // refresh severity for (const advisory of this.advisories) { this.addAdvisory(advisory) @@ -170,27 +164,30 @@ class Vuln { addAdvisory (advisory) { this.advisories.add(advisory) const sev = severities.get(advisory.severity) - this[_range] = null - this[_simpleRange] = null + this.#range = null + this.#simpleRange = null if (sev > severities.get(this.severity)) { this.severity = advisory.severity } } get range () { - return this[_range] || - (this[_range] = [...this.advisories].map(v => v.range).join(' || ')) + if (!this.#range) { + this.#range = [...this.advisories].map(v => v.range).join(' || ') + } + return this.#range } get simpleRange () { - if (this[_simpleRange] && this[_simpleRange] === this[_range]) { - return this[_simpleRange] + if (this.#simpleRange && this.#simpleRange === this.#range) { + return this.#simpleRange } const versions = [...this.advisories][0].versions const range = this.range - const simple = simplifyRange(versions, range, semverOpt) - return this[_simpleRange] = this[_range] = simple + this.#simpleRange = simplifyRange(versions, range, semverOpt) + this.#range = this.#simpleRange + return this.#simpleRange } isVulnerable (node) { diff --git a/workspaces/arborist/tap-snapshots/test/link.js.test.cjs b/workspaces/arborist/tap-snapshots/test/link.js.test.cjs index 7c921fbbd72bc..1978f7dd6f575 100644 --- a/workspaces/arborist/tap-snapshots/test/link.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/link.js.test.cjs @@ -11,7 +11,7 @@ Link { "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -41,7 +41,7 @@ exports[`test/link.js TAP > instantiate without providing target 1`] = ` "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -51,12 +51,12 @@ exports[`test/link.js TAP > instantiate without providing target 1`] = ` "inventory": Inventory { "../../../../../some/other/path" => <*ref_1>, "" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -95,12 +95,12 @@ exports[`test/link.js TAP > instantiate without providing target 1`] = ` "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, diff --git a/workspaces/arborist/tap-snapshots/test/node.js.test.cjs b/workspaces/arborist/tap-snapshots/test/node.js.test.cjs index 93f1f46628252..c025e3509a150 100644 --- a/workspaces/arborist/tap-snapshots/test/node.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/node.js.test.cjs @@ -7,12 +7,12 @@ 'use strict' exports[`test/node.js TAP basic instantiation > just a lone root node 1`] = ` &ref_1 Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -192,7 +192,7 @@ target:{location:'c'}}}} exports[`test/node.js TAP set workspaces > should setup edges out for each workspace 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "foo" => Link { "dev": true, "devOptional": true, @@ -202,7 +202,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -229,7 +229,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -256,7 +256,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "foo" => Edge { "peerConflicted": false, }, @@ -268,12 +268,12 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -293,7 +293,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -328,12 +328,12 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "tops": Set {}, }, Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -349,7 +349,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -398,7 +398,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -421,12 +421,12 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "tops": Set {}, }, "foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -446,7 +446,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -485,7 +485,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -508,12 +508,12 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "tops": Set {}, }, "unknown" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -529,7 +529,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -578,12 +578,12 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -603,7 +603,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -638,12 +638,12 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "tops": Set {}, }, Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -659,7 +659,7 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -699,17 +699,17 @@ exports[`test/node.js TAP set workspaces > should setup edges out for each works exports[`test/node.js TAP testing with dep tree with meta > add new meta under prod 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -743,7 +743,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -778,7 +778,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -790,12 +790,12 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -841,7 +841,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -853,7 +853,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -880,7 +880,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -889,7 +889,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -912,7 +912,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -921,7 +921,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -944,7 +944,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -953,7 +953,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -976,12 +976,12 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1004,7 +1004,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1013,7 +1013,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -1033,7 +1033,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1072,7 +1072,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -1104,15 +1104,15 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1146,7 +1146,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -1181,7 +1181,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -1193,12 +1193,12 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -1244,12 +1244,12 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -1276,7 +1276,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1288,7 +1288,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -1315,7 +1315,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1324,7 +1324,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1347,7 +1347,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1356,7 +1356,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1379,7 +1379,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1388,7 +1388,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1411,12 +1411,12 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1439,7 +1439,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1448,7 +1448,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -1468,7 +1468,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1503,13 +1503,13 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "tops": Set {}, }, "node_modules/prod/node_modules/meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1543,7 +1543,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -1574,7 +1574,7 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1611,12 +1611,12 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -1648,11 +1648,11 @@ exports[`test/node.js TAP testing with dep tree with meta > add new meta under p exports[`test/node.js TAP testing with dep tree with meta > initial load with some deps 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1664,7 +1664,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -1699,7 +1699,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -1711,12 +1711,12 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -1762,7 +1762,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1774,7 +1774,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -1801,7 +1801,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1810,7 +1810,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1833,7 +1833,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1842,7 +1842,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1865,7 +1865,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1874,7 +1874,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1897,12 +1897,12 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -1929,7 +1929,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -1961,9 +1961,9 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -1975,7 +1975,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -2010,7 +2010,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -2022,12 +2022,12 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2073,12 +2073,12 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2105,7 +2105,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "node_modules/prod/node_modules/meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2117,7 +2117,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -2144,7 +2144,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2156,7 +2156,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2183,7 +2183,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2192,7 +2192,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2215,7 +2215,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2224,7 +2224,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2247,7 +2247,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2256,7 +2256,7 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2279,12 +2279,12 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2321,12 +2321,12 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2358,9 +2358,9 @@ exports[`test/node.js TAP testing with dep tree with meta > initial load with so exports[`test/node.js TAP testing with dep tree with meta > move meta to top level, update stuff 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2369,7 +2369,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -2381,12 +2381,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2432,7 +2432,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2444,7 +2444,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2471,7 +2471,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2480,7 +2480,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2503,7 +2503,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2512,7 +2512,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2535,7 +2535,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2544,7 +2544,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2567,12 +2567,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2595,7 +2595,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2610,7 +2610,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -2641,7 +2641,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -2673,7 +2673,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2682,7 +2682,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -2694,12 +2694,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2745,12 +2745,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2777,7 +2777,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2789,7 +2789,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -2816,7 +2816,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2825,7 +2825,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2848,7 +2848,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2857,7 +2857,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2880,7 +2880,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2889,7 +2889,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2912,12 +2912,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -2940,7 +2940,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -2955,7 +2955,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -2996,12 +2996,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3033,9 +3033,9 @@ exports[`test/node.js TAP testing with dep tree with meta > move meta to top lev exports[`test/node.js TAP testing with dep tree with meta > move new meta to top level 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3044,7 +3044,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -3056,12 +3056,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3107,7 +3107,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3116,7 +3116,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3143,7 +3143,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3152,7 +3152,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3175,7 +3175,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3184,7 +3184,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3207,7 +3207,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3216,7 +3216,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3239,12 +3239,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3267,13 +3267,13 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3310,7 +3310,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -3330,7 +3330,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3369,7 +3369,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -3401,7 +3401,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3410,7 +3410,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -3422,12 +3422,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3473,12 +3473,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3505,7 +3505,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3514,7 +3514,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3541,7 +3541,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3550,7 +3550,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3573,7 +3573,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3582,7 +3582,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3605,7 +3605,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3614,7 +3614,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3637,12 +3637,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3669,7 +3669,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3692,13 +3692,13 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3735,7 +3735,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -3755,7 +3755,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3804,12 +3804,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3841,9 +3841,9 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top exports[`test/node.js TAP testing with dep tree with meta > move new meta to top level second time (no-op) 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3852,7 +3852,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -3864,12 +3864,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3915,7 +3915,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3924,7 +3924,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -3951,7 +3951,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3960,7 +3960,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -3983,7 +3983,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -3992,7 +3992,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4015,7 +4015,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4024,7 +4024,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4047,12 +4047,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4075,13 +4075,13 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4118,7 +4118,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -4138,7 +4138,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4177,7 +4177,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -4209,7 +4209,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4218,7 +4218,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -4230,12 +4230,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -4281,12 +4281,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -4313,7 +4313,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4322,7 +4322,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -4349,7 +4349,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4358,7 +4358,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4381,7 +4381,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4390,7 +4390,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4413,7 +4413,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4422,7 +4422,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4445,12 +4445,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4477,7 +4477,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4500,13 +4500,13 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4543,7 +4543,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -4563,7 +4563,7 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4612,12 +4612,12 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -4649,17 +4649,17 @@ exports[`test/node.js TAP testing with dep tree with meta > move new meta to top exports[`test/node.js TAP testing with dep tree without meta > add new meta under prod 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4693,7 +4693,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -4728,7 +4728,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -4740,12 +4740,12 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -4791,7 +4791,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4803,7 +4803,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -4830,7 +4830,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4839,7 +4839,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4862,7 +4862,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4871,7 +4871,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4894,7 +4894,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4903,7 +4903,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4926,12 +4926,12 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -4954,7 +4954,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -4963,7 +4963,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -4983,7 +4983,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5022,7 +5022,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -5054,15 +5054,15 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5096,7 +5096,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -5131,7 +5131,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -5143,12 +5143,12 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -5194,12 +5194,12 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -5226,7 +5226,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5238,7 +5238,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -5265,7 +5265,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5274,7 +5274,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5297,7 +5297,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5306,7 +5306,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5329,7 +5329,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5338,7 +5338,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5361,12 +5361,12 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5389,7 +5389,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5398,7 +5398,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -5418,7 +5418,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5453,13 +5453,13 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "tops": Set {}, }, "node_modules/prod/node_modules/meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5493,7 +5493,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -5524,7 +5524,7 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5561,12 +5561,12 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -5598,11 +5598,11 @@ exports[`test/node.js TAP testing with dep tree without meta > add new meta unde exports[`test/node.js TAP testing with dep tree without meta > initial load with some deps 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5614,7 +5614,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -5649,7 +5649,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -5661,12 +5661,12 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -5712,7 +5712,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5724,7 +5724,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -5751,7 +5751,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5760,7 +5760,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5783,7 +5783,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5792,7 +5792,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5815,7 +5815,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5824,7 +5824,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5847,12 +5847,12 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -5879,7 +5879,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -5911,9 +5911,9 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map { + "children": CIMap { "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -5925,7 +5925,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -5960,7 +5960,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -5972,12 +5972,12 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6023,12 +6023,12 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6055,7 +6055,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "node_modules/prod/node_modules/meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6067,7 +6067,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -6094,7 +6094,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6106,7 +6106,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6133,7 +6133,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6142,7 +6142,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6165,7 +6165,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6174,7 +6174,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6197,7 +6197,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6206,7 +6206,7 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6229,12 +6229,12 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6271,12 +6271,12 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6308,9 +6308,9 @@ exports[`test/node.js TAP testing with dep tree without meta > initial load with exports[`test/node.js TAP testing with dep tree without meta > move meta to top level, update stuff 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6319,7 +6319,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -6331,12 +6331,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6382,7 +6382,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6394,7 +6394,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6421,7 +6421,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6430,7 +6430,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6453,7 +6453,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6462,7 +6462,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6485,7 +6485,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6494,7 +6494,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6517,12 +6517,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6545,7 +6545,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6560,7 +6560,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -6591,7 +6591,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -6623,7 +6623,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6632,7 +6632,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -6644,12 +6644,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6695,12 +6695,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6727,7 +6727,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6739,7 +6739,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6766,7 +6766,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6775,7 +6775,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6798,7 +6798,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6807,7 +6807,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6830,7 +6830,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6839,7 +6839,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6862,12 +6862,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -6890,7 +6890,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6905,7 +6905,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "bundled" => Edge { "peerConflicted": false, }, @@ -6946,12 +6946,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -6983,9 +6983,9 @@ exports[`test/node.js TAP testing with dep tree without meta > move meta to top exports[`test/node.js TAP testing with dep tree without meta > move new meta to top level 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -6994,7 +6994,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -7006,12 +7006,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7057,7 +7057,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7066,7 +7066,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7093,7 +7093,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7102,7 +7102,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7125,7 +7125,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7134,7 +7134,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7157,7 +7157,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7166,7 +7166,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7189,12 +7189,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7217,13 +7217,13 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7260,7 +7260,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -7280,7 +7280,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7319,7 +7319,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -7351,7 +7351,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7360,7 +7360,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -7372,12 +7372,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7423,12 +7423,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7455,7 +7455,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7464,7 +7464,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7491,7 +7491,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7500,7 +7500,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7523,7 +7523,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7532,7 +7532,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7555,7 +7555,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7564,7 +7564,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7587,12 +7587,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7619,7 +7619,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7642,13 +7642,13 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7685,7 +7685,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -7705,7 +7705,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7754,12 +7754,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7791,9 +7791,9 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to exports[`test/node.js TAP testing with dep tree without meta > move new meta to top level second time (no-op) 1`] = ` &ref_1 Node { - "children": Map { + "children": CIMap { "prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7802,7 +7802,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -7814,12 +7814,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7865,7 +7865,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7874,7 +7874,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -7901,7 +7901,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7910,7 +7910,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7933,7 +7933,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7942,7 +7942,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7965,7 +7965,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -7974,7 +7974,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -7997,12 +7997,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8025,13 +8025,13 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8068,7 +8068,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -8088,7 +8088,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8127,7 +8127,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "prod" => Edge { "peerConflicted": false, }, @@ -8159,7 +8159,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "inventory": Inventory { "" => <*ref_1>, "node_modules/prod" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -8168,7 +8168,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "peer" => Edge { "peerConflicted": false, }, @@ -8180,12 +8180,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "extraneous": true, "fsChildren": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -8231,12 +8231,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/prod/foo" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -8263,7 +8263,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/bundled" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -8272,7 +8272,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, @@ -8299,7 +8299,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/dev" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -8308,7 +8308,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8331,7 +8331,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/optional" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -8340,7 +8340,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8363,7 +8363,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/peer" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, @@ -8372,7 +8372,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8395,12 +8395,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/extraneous" => Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8427,7 +8427,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8450,13 +8450,13 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "tops": Set {}, }, "node_modules/meta" => Node { - "children": Map { + "children": CIMap { "metameta" => Link { "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8493,7 +8493,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "peerConflicted": false, }, }, - "edgesOut": Map { + "edgesOut": CIMap { "asdf" => Edge { "peerConflicted": false, }, @@ -8513,7 +8513,7 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map {}, + "edgesOut": CIMap {}, "errors": Array [], "extraneous": true, "fsChildren": Set {}, @@ -8562,12 +8562,12 @@ exports[`test/node.js TAP testing with dep tree without meta > move new meta to "sourceReference": null, "tops": Set { Node { - "children": Map {}, + "children": CIMap {}, "dev": true, "devOptional": true, "dummy": false, "edgesIn": Set {}, - "edgesOut": Map { + "edgesOut": CIMap { "meta" => Edge { "peerConflicted": false, }, diff --git a/workspaces/arborist/test/get-workspace-nodes.js b/workspaces/arborist/test/get-workspace-nodes.js index 3de4d73da7b9f..851b12061cdef 100644 --- a/workspaces/arborist/test/get-workspace-nodes.js +++ b/workspaces/arborist/test/get-workspace-nodes.js @@ -1,8 +1,8 @@ const t = require('tap') -const getWorkspaceNodes = require('../lib/get-workspace-nodes.js') const Arborist = require('../lib/arborist/index.js') const { resolve } = require('path') const path = resolve(__dirname, './fixtures/workspaces-shared-deps-virtual') +const arb = new Arborist({ path }) const warningTracker = () => { const list = [] @@ -16,12 +16,12 @@ const warningTracker = () => { let tree t.before(async () => { - tree = await new Arborist({ path }).loadVirtual() + tree = await arb.loadVirtual() }) t.test('basic behavior', t => { const getLogs = warningTracker() - const wsNodes = getWorkspaceNodes(tree, ['a']) + const wsNodes = arb.workspaceNodes(tree, ['a']) t.equal(wsNodes.length, 1) t.equal(wsNodes[0], tree.children.get('a').target) t.same(getLogs(), []) @@ -30,7 +30,7 @@ t.test('basic behavior', t => { t.test('filter set, but no workspaces present', t => { const getLogs = warningTracker() - const wsNodes = getWorkspaceNodes(tree.children.get('b').target, ['xyz']) + const wsNodes = arb.workspaceNodes(tree.children.get('b').target, ['xyz']) t.same(wsNodes, []) t.same(getLogs(), [ ['warn', 'workspaces', 'filter set, but no workspaces present'], @@ -40,7 +40,7 @@ t.test('filter set, but no workspaces present', t => { t.test('name in filter set, but not in workspaces', t => { const getLogs = warningTracker() - const wsNodes = getWorkspaceNodes(tree, ['xyz']) + const wsNodes = arb.workspaceNodes(tree, ['xyz']) t.same(wsNodes, []) t.same(getLogs(), [ ['warn', 'workspaces', 'xyz in filter set, but not in workspaces'], @@ -55,7 +55,7 @@ t.test('name in filter set, but no workspace folder present', t => { // but if we start moving things around and make a mistake, it's // possible to get there. tree.children.get('c').target.root = null - const wsNodes = getWorkspaceNodes(tree, ['c']) + const wsNodes = arb.workspaceNodes(tree, ['c']) t.same(wsNodes, []) t.same(getLogs(), [ ['warn', 'workspaces', 'c in filter set, but no workspace folder present'],