diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-02-27 05:39:59 -0800 |
---|---|---|
committer | cjihrig <cjihrig@gmail.com> | 2015-02-27 13:39:37 -0500 |
commit | 2a2fe5c4f21149ae4de66e373e1a09d94b3b6bdc (patch) | |
tree | db3251b147618da9a5f3629afabccc8c4d9b0d58 /deps/npm/lib | |
parent | f83d380647bd95fffd4944d371366e5b6b24d97c (diff) | |
download | android-node-v8-2a2fe5c4f21149ae4de66e373e1a09d94b3b6bdc.tar.gz android-node-v8-2a2fe5c4f21149ae4de66e373e1a09d94b3b6bdc.tar.bz2 android-node-v8-2a2fe5c4f21149ae4de66e373e1a09d94b3b6bdc.zip |
deps: upgrade npm to 2.6.1
PR-URL: https://github.com/iojs/io.js/pull/990
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/npm/lib')
-rw-r--r-- | deps/npm/lib/cache/add-named.js | 8 | ||||
-rw-r--r-- | deps/npm/lib/install.js | 19 | ||||
-rw-r--r-- | deps/npm/lib/outdated.js | 4 | ||||
-rw-r--r-- | deps/npm/lib/utils/warn-deprecated.js | 24 |
4 files changed, 46 insertions, 9 deletions
diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js index 08354dc75f..d81b7b0da6 100644 --- a/deps/npm/lib/cache/add-named.js +++ b/deps/npm/lib/cache/add-named.js @@ -12,6 +12,7 @@ var path = require("path") , addRemoteTarball = require("./add-remote-tarball.js") , cachedPackageRoot = require("./cached-package-root.js") , mapToRegistry = require("../utils/map-to-registry.js") + , warnStrict = require("../utils/warn-deprecated.js")("engineStrict") module.exports = addNamed @@ -92,9 +93,10 @@ function engineFilter (data) { var eng = data.versions[v].engines if (!eng) return if (data.versions[v].engineStrict) { - log.warn("deprecation", "Per-package engineStrict will no longer be used") - log.warn("deprecation", "in upcoming versions of npm. Use the config") - log.warn("deprecation", "setting `engine-strict` instead.") + warnStrict([ + "Per-package engineStrict (found in package.json for "+data.name+")", + "won't be used in npm 3+. Use the config setting `engine-strict` instead." + ], data.name) } if (!strict && !data.versions[v].engineStrict) return if (eng.node && !semver.satisfies(nodev, eng.node, true) diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 87a5b0bb95..7fa9058f3e 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -89,6 +89,7 @@ var npm = require("./npm.js") , locker = require("./utils/locker.js") , lock = locker.lock , unlock = locker.unlock + , warnPeers = require("./utils/warn-deprecated.js")("peerDependencies") function install (args, cb_) { var hasArguments = !!args.length @@ -159,15 +160,14 @@ function install (args, cb_) { "install", "peerDependency", dep, "wasn't going to be installed; adding" ) + warnPeers([ + "The peer dependency "+dep+" included from "+data.name+" will no", + "longer be automatically installed to fulfill the peerDependency ", + "in npm 3+. Your application will need to depend on it explicitly." + ], dep+","+data.name) peers.push(dep) } }) - if (peers.length) { - log.warn("deprecation", "peerDependencies will no longer be") - log.warn("deprecation", "installed implicitly in the next major") - log.warn("deprecation", "version of npm (npm@3). You will need to") - log.warn("deprecation", "switch to depending on them explicitly.") - } log.verbose("install", "where, peers", [where, peers]) var context = { family: {} @@ -1042,6 +1042,13 @@ function write (target, targetFolder, context, cb_) { // favor of killing implicit peerDependency installs with fire. var peerDeps = prepareForInstallMany(data, "peerDependencies", bundled, wrap, family) + peerDeps.forEach(function (pd) { + warnPeers([ + "The peer dependency "+pd+" included from "+data.name+" will no", + "longer be automatically installed to fulfill the peerDependency ", + "in npm 3+. Your application will need to depend on it explicitly." + ], pd+","+data.name) + }) var pdTargetFolder = path.resolve(targetFolder, "..", "..") var pdContext = context if (peerDeps.length > 0) { diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index 9c0623ef12..4963b096ef 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -40,6 +40,10 @@ var path = require("path") function outdated (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false var dir = path.resolve(npm.dir, "..") + + // default depth for `outdated` is 0 (cf. `ls`) + if (npm.config.get("depth") === Infinity) npm.config.set("depth", 0) + outdated_(args, dir, {}, 0, function (er, list) { if (!list) list = [] if (er || silent || list.length === 0) return cb(er, list) diff --git a/deps/npm/lib/utils/warn-deprecated.js b/deps/npm/lib/utils/warn-deprecated.js new file mode 100644 index 0000000000..ec821b9bd4 --- /dev/null +++ b/deps/npm/lib/utils/warn-deprecated.js @@ -0,0 +1,24 @@ +module.exports = warnDeprecated + +var log = require("npmlog") + +var deprecations = {} + +function warnDeprecated (type) { + return function warn (messages, instance) { + if (!instance) { + if (!deprecations[type]) { + deprecations[type] = {} + messages.forEach(function (m) { log.warn(type, m) }) + } + } + else { + if (!deprecations[type]) deprecations[type] = {} + + if (!deprecations[type][instance]) { + deprecations[type][instance] = true + messages.forEach(function (m) { log.warn(type, m) }) + } + } + } +} |