diff options
author | Rebecca Turner <me@re-becca.org> | 2017-04-28 01:54:42 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2017-05-26 04:55:03 +0300 |
commit | 918f671a9d5d350c62a9b73481391f19afe8391c (patch) | |
tree | f237ff8810e1beab83c838a8d1d5eb908c298a3d /lib/prune.js | |
parent | c0a30c0725070dc49ac9e004f9e33bac68c69e20 (diff) |
filespecs: Implement new file: specifier behavior
PR-URL: https://github.com/npm/npm/pull/15900
Credit: @iarna
actions: Allow actions to return promises
extract: Eliminate extra callback
finalize: Rewrite finalize as promises
update-linked: Remove update-linked action
install: Remove obsolete invalid action filtering
fetch-package-metadata: Error on installing windows paths on non-windows systems
fetch-package-metadata: Read in modules installed inside of new links
finalize: Act on realpaths because we may be installing inside a link prior to the symlink being made
finalize: Create symlinks of directory deps
deps: Resolve ambiguity for file specifiers in the traditional way
deps: Set link and realpath properties for directory deps
inflate-bundled: Distinguish published bundles from lined modules
node: Add new fromLink attribute to track sourced-to-symlinks deps
diff-trees: Don't try to install deps that are already inside a link
fetch-package-metadata: Improve error messages for link failures
install: Run preinstall lifecycle after finalize
finalize: Start reading package.json files here
decompose-actions: Don't fetch or extract links
deps: Determine if a link matches spec based on where it points
deps: Compute correct save specifier for file spec
deps: Set the isInLink property on new children
deps: When finding the install location, don't walk up out of a symlink unless PRESERVE_SYMLINKS is on
diff-trees: Stop setting isInLink, this is now a first class property
diff-trees: Only exclude children of links from adding if they were already there behind the symlink
inflate-bundled: We are using isInLink now not fromLink
inflate-bundled: realpaths should be built on realpaths
node: Eliminate fromLink as a thing
node: Fill in values for inLink, isInLink & fromBundle
save: When updating a lock/shrinkwrap don't read the damn tree again
shrinkwrap: Fill in version per the new shrinkwrap spec
install: Make _inBundle purely a debugging artifact
inflate-shrinkwrap: Fix how bundle deps are inflated
save: Detect dependency type when saving
recalculateMetadata: Rewrite as simpler and synchronous
prune: Work off computed metadata
refreshPackageJson: Copy all of the in memory version over the on-disk version except empty items
install: Reduce normalize tree function to minimum
realize-package-specifier: Bring into closer alignment with spec
read-shrinkwrap: Use child.isTop not !child.parent
copy-tree: Don't crash of requires or requiredBy are missing
copy-tree: Initialize copied nodes
dedupe: use getRequested instead of child.package._requested
install: recompute the pkg relationships after finalize
Neccessary to align behavior with shrinkwraps where relationship information
isn't available until we read the module off disk.
install: Prune the tree after building it
install: Only save deps if we made changes
inflate-shrinkwrap: Better metadata while inflating
Diffstat (limited to 'lib/prune.js')
-rw-r--r-- | lib/prune.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/prune.js b/lib/prune.js index a590457a1..39d1c8ffb 100644 --- a/lib/prune.js +++ b/lib/prune.js @@ -15,6 +15,7 @@ var isDev = require('./install/is-dev-dep.js') var removeDeps = require('./install/deps.js').removeDeps var loadExtraneous = require('./install/deps.js').loadExtraneous var chain = require('slide').chain +var computeMetadata = require('./install/deps.js').computeMetadata prune.completion = require('./utils/completion/installed-deep.js') @@ -34,6 +35,7 @@ Pruner.prototype.loadAllDepsIntoIdealTree = function (cb) { var cg = this.progress['loadIdealTree:loadAllDepsIntoIdealTree'] var steps = [] + computeMetadata(this.idealTree) var self = this var excludeDev = npm.config.get('production') || /^prod(uction)?$/.test(npm.config.get('only')) function shouldPrune (child) { @@ -54,7 +56,7 @@ Pruner.prototype.loadAllDepsIntoIdealTree = function (cb) { function nameObj (name) { return {name: name} } - var toPrune = this.currentTree.children.filter(shouldPrune).map(getModuleName).filter(matchesArg).map(nameObj) + var toPrune = this.idealTree.children.filter(shouldPrune).map(getModuleName).filter(matchesArg).map(nameObj) steps.push( [removeDeps, toPrune, this.idealTree, null, cg.newGroup('removeDeps')], |