summaryrefslogtreecommitdiff
path: root/deps/npm/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2014-03-19 09:25:40 -0700
committerisaacs <i@izs.me>2014-03-25 17:42:22 -0700
commitbd547d65983c190eb69ca44d633ea31aca2b7c98 (patch)
tree01ff3b4e40cb9fc3ed5a42abc4d44cb65d5c7dec /deps/npm/lib
parent7989f42f866699b726f596add387fb19fa39bc55 (diff)
downloadandroid-node-v8-bd547d65983c190eb69ca44d633ea31aca2b7c98.tar.gz
android-node-v8-bd547d65983c190eb69ca44d633ea31aca2b7c98.tar.bz2
android-node-v8-bd547d65983c190eb69ca44d633ea31aca2b7c98.zip
npm: upgrade to 1.4.6
* Documentation upgrades * Fix glob bug which prevents proper README publishing * node-gyp upgrade to 0.13 * Documentation updates * Add --save-exact to save an exact dep (instead of a range) * alias 't' to 'test'
Diffstat (limited to 'deps/npm/lib')
-rw-r--r--deps/npm/lib/install.js10
-rw-r--r--deps/npm/lib/ls.js2
-rw-r--r--deps/npm/lib/npm.js1
-rw-r--r--deps/npm/lib/prune.js5
-rw-r--r--deps/npm/lib/rebuild.js2
-rw-r--r--deps/npm/lib/shrinkwrap.js12
-rw-r--r--deps/npm/lib/utils/completion/installed-deep.js2
7 files changed, 17 insertions, 17 deletions
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index 92a4907857..39c98ecff2 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -74,6 +74,7 @@ var npm = require("./npm.js")
, archy = require("archy")
, isGitUrl = require("./utils/is-git-url.js")
, npmInstallChecks = require("npm-install-checks")
+ , sortedObject = require("sorted-object")
function install (args, cb_) {
var hasArguments = !!args.length
@@ -187,7 +188,7 @@ function install (args, cb_) {
}
function findPeerInvalid (where, cb) {
- readInstalled(where, { log: log.warn }, function (er, data) {
+ readInstalled(where, { log: log.warn, dev: true }, function (er, data) {
if (er) return cb(er)
cb(null, findPeerInvalid_(data.dependencies, []))
@@ -350,7 +351,8 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
return w
}).reduce(function (set, k) {
var rangeDescriptor = semver.valid(k[1], true) &&
- semver.gte(k[1], "0.1.0", true)
+ semver.gte(k[1], "0.1.0", true) &&
+ !npm.config.get("save-exact")
? "^" : ""
set[k[0]] = rangeDescriptor + k[1]
return set
@@ -378,7 +380,7 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
var bundle = data.bundleDependencies || data.bundledDependencies
delete data.bundledDependencies
if (!Array.isArray(bundle)) bundle = []
- data.bundleDependencies = bundle
+ data.bundleDependencies = bundle.sort()
}
log.verbose('saving', things)
@@ -391,6 +393,8 @@ function save (where, installed, tree, pretty, hasArguments, cb) {
}
})
+ data[deps] = sortedObject(data[deps])
+
data = JSON.stringify(data, null, 2) + "\n"
fs.writeFile(saveTarget, data, function (er) {
cb(er, installed, tree, pretty)
diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js
index dc56b0ef28..efe503b626 100644
--- a/deps/npm/lib/ls.js
+++ b/deps/npm/lib/ls.js
@@ -36,7 +36,7 @@ function ls (args, silent, cb) {
})
var depth = npm.config.get("depth")
- var opt = { depth: depth, log: log.warn }
+ var opt = { depth: depth, log: log.warn, dev: true }
readInstalled(dir, opt, function (er, data) {
var bfs = bfsify(data, args)
, lite = getLite(bfs)
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index 7b3826290d..c443b64998 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -112,6 +112,7 @@ var commandCache = {}
, "login": "adduser"
, "add-user": "adduser"
, "tst": "test"
+ , "t": "test"
, "find-dupes": "dedupe"
, "ddp": "dedupe"
, "v": "view"
diff --git a/deps/npm/lib/prune.js b/deps/npm/lib/prune.js
index 8fa3e5d508..eb58c7f646 100644
--- a/deps/npm/lib/prune.js
+++ b/deps/npm/lib/prune.js
@@ -21,7 +21,10 @@ function prune (args, cb) {
})
function next() {
- var opt = { depth: npm.config.get("depth"), dev: npm.config.get("production") }
+ var opt = {
+ depth: npm.config.get("depth"),
+ dev: !npm.config.get("production") || npm.config.get("dev")
+ }
readInstalled(npm.prefix, opt, function (er, data) {
if (er) return cb(er)
prune_(args, data, cb)
diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js
index a156acccfc..bd0d33b65b 100644
--- a/deps/npm/lib/rebuild.js
+++ b/deps/npm/lib/rebuild.js
@@ -14,7 +14,7 @@ rebuild.usage = "npm rebuild [<name>[@<version>] [name[@<version>] ...]]"
rebuild.completion = require("./utils/completion/installed-deep.js")
function rebuild (args, cb) {
- var opt = { depth: npm.config.get("depth") }
+ var opt = { depth: npm.config.get("depth"), dev: true }
readInstalled(npm.prefix, opt, function (er, data) {
log.info("readInstalled", typeof data)
if (er) return cb(er)
diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js
index 4aed5964e7..48a3e4ae12 100644
--- a/deps/npm/lib/shrinkwrap.js
+++ b/deps/npm/lib/shrinkwrap.js
@@ -8,6 +8,7 @@ var npm = require("./npm.js")
, fs = require("fs")
, path = require("path")
, readJson = require("read-package-json")
+ , sortedObject = require("sorted-object")
shrinkwrap.usage = "npm shrinkwrap"
@@ -58,7 +59,7 @@ function shrinkwrap_ (pkginfo, silent, dev, cb) {
function save (pkginfo, silent, cb) {
// copy the keys over in a well defined order
// because javascript objects serialize arbitrarily
- pkginfo.dependencies = copyOrder(pkginfo.dependencies)
+ pkginfo.dependencies = sortedObject(pkginfo.dependencies)
try {
var swdata = JSON.stringify(pkginfo, null, 2) + "\n"
} catch (er) {
@@ -75,12 +76,3 @@ function save (pkginfo, silent, cb) {
cb(null, pkginfo)
})
}
-
-function copyOrder(obj) {
- var result = {}
- var keys = Object.keys(obj).sort()
- keys.forEach(function (key) {
- result[key] = obj[key]
- })
- return result
-}
diff --git a/deps/npm/lib/utils/completion/installed-deep.js b/deps/npm/lib/utils/completion/installed-deep.js
index 99e3207888..5fb67d263f 100644
--- a/deps/npm/lib/utils/completion/installed-deep.js
+++ b/deps/npm/lib/utils/completion/installed-deep.js
@@ -7,7 +7,7 @@ function installedDeep (opts, cb) {
var local
, global
, depth = npm.config.get("depth")
- , opt = { depth: depth }
+ , opt = { depth: depth, dev: true }
if (npm.config.get("global")) local = [], next()
else readInstalled(npm.prefix, opt, function (er, data) {