From 918f671a9d5d350c62a9b73481391f19afe8391c Mon Sep 17 00:00:00 2001 From: Rebecca Turner Date: Thu, 27 Apr 2017 15:54:42 -0700 Subject: 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 --- lib/ls.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/ls.js') diff --git a/lib/ls.js b/lib/ls.js index 478b914bb..b993dd623 100644 --- a/lib/ls.js +++ b/lib/ls.js @@ -9,7 +9,6 @@ module.exports = exports = ls var path = require('path') var url = require('url') var readPackageTree = require('read-package-tree') -var log = require('npmlog') var archy = require('archy') var semver = require('semver') var color = require('ansicolors') @@ -19,7 +18,7 @@ var sortedObject = require('sorted-object') var extend = Object.assign || require('util')._extend var npm = require('./npm.js') var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') -var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var computeMetadata = require('./install/deps.js').computeMetadata var packageId = require('./utils/package-id.js') var usage = require('./utils/usage') var output = require('./utils/output.js') @@ -37,14 +36,14 @@ function ls (args, silent, cb) { silent = false } var dir = path.resolve(npm.dir, '..') - readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (physicalTree) { + readPackageTree(dir, andComputeMetadata(iferr(cb, function (physicalTree) { lsFromTree(dir, physicalTree, args, silent, cb) }))) } -function andRecalculateMetadata (next) { +function andComputeMetadata (next) { return function (er, tree) { - recalculateMetadata(tree || {}, log, next) + next(null, computeMetadata(tree || {})) } } -- cgit v1.2.3