From: isaacs Date: Thu, 1 May 2014 23:30:33 +0000 (-0700) Subject: npm: upgrade to v1.4.9 X-Git-Tag: v0.10.28~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dbec0a0cd8a76974c06a8965765e2790c6fd4ccb;p=platform%2Fupstream%2Fnodejs.git npm: upgrade to v1.4.9 * Send referer header (with any potentially private stuff redacted) * Fix critical typo bug in previous npm release --- diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 792ce47..5a82afc 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -260,5 +260,5 @@ will no doubt tell you to put the output in a gist or email.
npm.bin
member.
man 3 npm-<command>
for programmatic usage.
npm rebuild <pkg>
if you make any changes.
packages
parameter.
packages
parameter.
packages
parameter.
packages
parameter.
1.4.8
+1.4.9
npm.deref
method to find the real name.
package.json
in the current folder and use the name
package.json
file in its root.
name
property.
"notepad"
on Windows.node_modules
folder.npm ls promzard
in npm's source tree will show:
-npm@1.4.8 /path/to/npm
+npm@1.4.9 /path/to/npm
ââ⬠init-package-json@0.0.4
âââ promzard@0.1.5
@@ -87,5 +87,5 @@ project.
-
+
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index ee938ac..61f8b73 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -71,5 +71,5 @@ project.
-
+
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index 2fba0e0..e485fbb 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -47,5 +47,5 @@ that is not implemented at this time.
-
+
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index 323da3e..c890226 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -42,5 +42,5 @@ overwritten the second time.
-
+
diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html
index fce8f43..449901a 100644
--- a/deps/npm/html/doc/cli/npm-prefix.html
+++ b/deps/npm/html/doc/cli/npm-prefix.html
@@ -33,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html
index e7ee0ee..e6d981b 100644
--- a/deps/npm/html/doc/cli/npm-prune.html
+++ b/deps/npm/html/doc/cli/npm-prune.html
@@ -42,5 +42,5 @@ packages specified in your devDependencies
.
-
+
diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html
index 14572af..caef746 100644
--- a/deps/npm/html/doc/cli/npm-publish.html
+++ b/deps/npm/html/doc/cli/npm-publish.html
@@ -49,5 +49,5 @@ it is removed with npm-unpublish(1).
-
+
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index bc4061b..5da83bd 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -39,5 +39,5 @@ the new binary.
-
+
diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html
index 1785142..fb53224 100644
--- a/deps/npm/html/doc/cli/npm-repo.html
+++ b/deps/npm/html/doc/cli/npm-repo.html
@@ -45,5 +45,5 @@ a package.json
in the current folder and use the name
-
+
diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html
index df666ff..7cfa2ae 100644
--- a/deps/npm/html/doc/cli/npm-restart.html
+++ b/deps/npm/html/doc/cli/npm-restart.html
@@ -37,5 +37,5 @@ the "start" script.
-
+
diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html
index 5a66704..9d5106f 100644
--- a/deps/npm/html/doc/cli/npm-rm.html
+++ b/deps/npm/html/doc/cli/npm-rm.html
@@ -37,5 +37,5 @@ on its behalf.
-
+
diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html
index 527667f..2e7b205 100644
--- a/deps/npm/html/doc/cli/npm-root.html
+++ b/deps/npm/html/doc/cli/npm-root.html
@@ -33,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html
index c602aeb..1704806 100644
--- a/deps/npm/html/doc/cli/npm-run-script.html
+++ b/deps/npm/html/doc/cli/npm-run-script.html
@@ -38,5 +38,5 @@ called directly, as well.
-
+
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index 7df4e26..1c2a51d 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -50,5 +50,5 @@ fall on multiple lines.
-
+
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index 1f0464e..f4334d4 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -196,5 +196,5 @@ contents rather than versions.
-
+
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index a02ba32..5edee59 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -39,5 +39,5 @@ a vaguely positive way to show that you care.
-
+
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index 9f1568f..4148cf6 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -38,5 +38,5 @@ you will most certainly enjoy this command.
-
+
diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html
index c8e4864..ec10f71 100644
--- a/deps/npm/html/doc/cli/npm-start.html
+++ b/deps/npm/html/doc/cli/npm-start.html
@@ -33,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html
index b746a61..50316ab 100644
--- a/deps/npm/html/doc/cli/npm-stop.html
+++ b/deps/npm/html/doc/cli/npm-stop.html
@@ -33,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-submodule.html
index f435828..10915be 100644
--- a/deps/npm/html/doc/cli/npm-submodule.html
+++ b/deps/npm/html/doc/cli/npm-submodule.html
@@ -46,5 +46,5 @@ dependencies into the submodule folder.
-
+
diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html
index 26c36d4..da180a5 100644
--- a/deps/npm/html/doc/cli/npm-tag.html
+++ b/deps/npm/html/doc/cli/npm-tag.html
@@ -47,5 +47,5 @@ of using a specific version number:
-
+
diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html
index d36b4df..9b43d62 100644
--- a/deps/npm/html/doc/cli/npm-test.html
+++ b/deps/npm/html/doc/cli/npm-test.html
@@ -37,5 +37,5 @@ true.
-
+
diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html
index f77e270..297a26d 100644
--- a/deps/npm/html/doc/cli/npm-uninstall.html
+++ b/deps/npm/html/doc/cli/npm-uninstall.html
@@ -53,5 +53,5 @@ npm uninstall dtrace-provider --save-optional
1.4.8
+1.4.9
packa
-
+
diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html
index eb9606b..c5e50d2 100644
--- a/deps/npm/html/doc/files/npm-global.html
+++ b/deps/npm/html/doc/files/npm-global.html
@@ -218,5 +218,5 @@ cannot be found elsewhere. See packa
-
+
diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html
index bcb0a56..fd4c35e 100644
--- a/deps/npm/html/doc/files/npm-json.html
+++ b/deps/npm/html/doc/files/npm-json.html
@@ -589,5 +589,5 @@ ignored.
-
+
diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html
index 10dff0f..24351e1 100644
--- a/deps/npm/html/doc/files/npmrc.html
+++ b/deps/npm/html/doc/files/npmrc.html
@@ -72,5 +72,5 @@ manner.
-
+
diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html
index bcb0a56..fd4c35e 100644
--- a/deps/npm/html/doc/files/package.json.html
+++ b/deps/npm/html/doc/files/package.json.html
@@ -589,5 +589,5 @@ ignored.
-
+
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index 8ddfe68..b989a25 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -429,5 +429,5 @@
-
+
diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html
index 718683c..dfe693f 100644
--- a/deps/npm/html/doc/misc/npm-coding-style.html
+++ b/deps/npm/html/doc/misc/npm-coding-style.html
@@ -195,5 +195,5 @@ set to anything."
-
+
diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html
index 54ff62e..bbdd96c 100644
--- a/deps/npm/html/doc/misc/npm-config.html
+++ b/deps/npm/html/doc/misc/npm-config.html
@@ -743,5 +743,5 @@ hash, and exit successfully.
-
+
diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html
index c079166..129aeb4 100644
--- a/deps/npm/html/doc/misc/npm-developers.html
+++ b/deps/npm/html/doc/misc/npm-developers.html
@@ -187,5 +187,5 @@ from a fresh checkout.
-
+
diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html
index b6fa662..89127a3 100644
--- a/deps/npm/html/doc/misc/npm-disputes.html
+++ b/deps/npm/html/doc/misc/npm-disputes.html
@@ -105,5 +105,5 @@ things into it.
-
+
diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html
index 556f1cb..40500b6 100644
--- a/deps/npm/html/doc/misc/npm-faq.html
+++ b/deps/npm/html/doc/misc/npm-faq.html
@@ -361,5 +361,5 @@ good folks at npm, Inc.
-
+
diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html
index b4892a7..1bed387 100644
--- a/deps/npm/html/doc/misc/npm-index.html
+++ b/deps/npm/html/doc/misc/npm-index.html
@@ -429,5 +429,5 @@
-
+
diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html
index 0828d93..b1f8819 100644
--- a/deps/npm/html/doc/misc/npm-registry.html
+++ b/deps/npm/html/doc/misc/npm-registry.html
@@ -84,5 +84,5 @@ effectively implement the entire CouchDB API anyway.
-
+
diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html
index c1e77d6..1877799 100644
--- a/deps/npm/html/doc/misc/npm-scripts.html
+++ b/deps/npm/html/doc/misc/npm-scripts.html
@@ -236,5 +236,5 @@ the user will sudo the npm command in question.
-
+
diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html
index 08d7a4f..8e20ad8 100644
--- a/deps/npm/html/doc/misc/removing-npm.html
+++ b/deps/npm/html/doc/misc/removing-npm.html
@@ -71,5 +71,5 @@ modules. To track those down, you can do the following:
-
+
diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html
index 3dae36b..dc075b1 100644
--- a/deps/npm/html/doc/misc/semver.html
+++ b/deps/npm/html/doc/misc/semver.html
@@ -130,5 +130,5 @@ range, use the satisfies(version, range)
function.
-
+
diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js
index 5c2d078..32fb9f8 100644
--- a/deps/npm/lib/cache.js
+++ b/deps/npm/lib/cache.js
@@ -711,7 +711,7 @@ function addNameTag (name, tag, data, cb_) {
registry.get(name, function (er, data, json, response) {
if (!er) {
- er = errorResponse(name, resp)
+ er = errorResponse(name, response)
}
if (er) return cb(er)
engineFilter(data)
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index a529862..63f9be3 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -191,20 +191,38 @@ Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) {
if (c === "la" || c === "ll") {
npm.config.set("long", true)
}
+
npm.command = c
if (commandCache[a]) return commandCache[a]
+
var cmd = require(__dirname+"/"+a+".js")
+
commandCache[a] = function () {
var args = Array.prototype.slice.call(arguments, 0)
if (typeof args[args.length - 1] !== "function") {
args.push(defaultCb)
}
if (args.length === 1) args.unshift([])
+
+ npm.registry.refer = [a].concat(args[0]).map(function (arg) {
+ // exclude anything that might be a URL, path, or private module
+ // Those things will always have a slash in them somewhere
+ if (arg && arg.match && arg.match(/\/|\\/)) {
+ return "[REDACTED]"
+ } else {
+ return arg
+ }
+ }).filter(function (arg) {
+ return arg && arg.match
+ }).join(" ")
+
cmd.apply(npm, args)
}
+
Object.keys(cmd).forEach(function (k) {
commandCache[a][k] = cmd[k]
})
+
return commandCache[a]
}, enumerable: fullList.indexOf(c) !== -1 })
diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1
index ddd00f5..977bd02 100644
--- a/deps/npm/man/man1/npm-ls.1
+++ b/deps/npm/man/man1/npm-ls.1
@@ -29,7 +29,7 @@ For example, running \fBnpm ls promzard\fR in npm\'s source tree will show:
.IP "" 4
.
.nf
-npm@1.4.8 /path/to/npm
+npm@1.4.9 /path/to/npm
ââ⬠init\-package\-json@0\.0\.4
âââ promzard@0\.1\.5
.
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index 64edebf..562ae36 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -14,7 +14,7 @@ npm [args]
.fi
.
.SH "VERSION"
-1.4.8
+1.4.9
.
.SH "DESCRIPTION"
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3
index 562ae4b..93850f5 100644
--- a/deps/npm/man/man3/npm.3
+++ b/deps/npm/man/man3/npm.3
@@ -21,7 +21,7 @@ npm\.load([configObject, ]function (er, npm) {
.fi
.
.SH "VERSION"
-1.4.8
+1.4.9
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js
index 3cbb072..72401e6 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/request.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/request.js
@@ -8,12 +8,17 @@ var url = require("url")
, Stream = require("stream").Stream
, request = require("request")
, retry = require("retry")
+ , crypto = require("crypto")
function regRequest (method, where, what, etag, nofollow, cb_) {
if (typeof cb_ !== "function") cb_ = nofollow, nofollow = false
if (typeof cb_ !== "function") cb_ = etag, etag = null
if (typeof cb_ !== "function") cb_ = what, what = null
+ if (!this.sessionToken) {
+ this.sessionToken = crypto.randomBytes(8).toString("hex")
+ }
+
var registry = this.conf.get('registry')
if (!registry) return cb(new Error(
"No registry url provided: " + method + " " + where))
@@ -143,6 +148,12 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb_) {
headers[method === "GET" ? "if-none-match" : "if-match"] = etag
}
+ headers['npm-session'] = this.sessionToken
+
+ if (this.refer) {
+ headers.referer = this.refer
+ }
+
headers.accept = "application/json"
headers['accept-encoding'] = 'gzip'
diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json
index 0a9d731..f7e876e 100644
--- a/deps/npm/node_modules/npm-registry-client/package.json
+++ b/deps/npm/node_modules/npm-registry-client/package.json
@@ -6,7 +6,7 @@
},
"name": "npm-registry-client",
"description": "Client for the npm registry",
- "version": "0.4.7",
+ "version": "0.4.8",
"repository": {
"url": "git://github.com/isaacs/npm-registry-client"
},
@@ -38,6 +38,7 @@
"url": "https://github.com/isaacs/npm-registry-client/issues"
},
"homepage": "https://github.com/isaacs/npm-registry-client",
- "_id": "npm-registry-client@0.4.7",
- "_from": "npm-registry-client@latest"
+ "_id": "npm-registry-client@0.4.8",
+ "_shasum": "a6685a161033101be6064b7af887ab440e8695d0",
+ "_from": "npm-registry-client@~0.4.7"
}
diff --git a/deps/npm/package.json b/deps/npm/package.json
index a11bace..e10263e 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -1,5 +1,5 @@
{
- "version": "1.4.8",
+ "version": "1.4.9",
"name": "npm",
"publishConfig": {
"proprietary-attribs": false
@@ -61,7 +61,7 @@
"node-gyp": "~0.13.0",
"nopt": "~2.2.1",
"npm-install-checks": "~1.0.0",
- "npm-registry-client": "~0.4.7",
+ "npm-registry-client": "~0.4.8",
"npm-user-validate": "0.0.3",
"npmconf": "~0.1.15",
"npmlog": "0.0.6",
diff --git a/deps/npm/test/tap/install-save-prefix.js b/deps/npm/test/tap/install-save-prefix.js
index 0ce6e02..9cb6bd9 100644
--- a/deps/npm/test/tap/install-save-prefix.js
+++ b/deps/npm/test/tap/install-save-prefix.js
@@ -25,13 +25,13 @@ test('"npm install --save with default save-prefix should install local pkg vers
registry: common.registry }, function(err) {
t.ifError(err)
npm.config.set('save', true)
- npm.commands.install(['underscore@1.3.1'], function(err) {
+ npm.commands.install(['underscore@latest'], function(err) {
t.ifError(err)
var p = path.resolve(pkg, 'node_modules/underscore/package.json')
t.ok(JSON.parse(fs.readFileSync(p)))
var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
t.deepEqual(pkgJson.dependencies, {
- 'underscore': '^1.3.1'
+ 'underscore': '^1.5.1'
}, 'Underscore dependency should specify ^1.3.1')
npm.config.set('save', undefined)
s.close()
diff --git a/deps/npm/test/tap/referer.js b/deps/npm/test/tap/referer.js
new file mode 100644
index 0000000..1b55ab0
--- /dev/null
+++ b/deps/npm/test/tap/referer.js
@@ -0,0 +1,24 @@
+var common = require("../common-tap.js")
+var test = require("tap").test
+var http = require("http")
+var server
+
+test("should send referer http header", function (t) {
+ var server = http.createServer(function (q, s) {
+ t.equal(q.headers.referer, "install foo")
+ s.statusCode = 404
+ s.end(JSON.stringify({error: "whatever"}))
+ this.close()
+ }).listen(common.port, function () {
+ var reg = "--registry=http://localhost:" + common.port
+ var args = [ "install", "foo", reg ]
+ common.npm(args, {}, function (er, code, so, se) {
+ if (er) {
+ throw er
+ }
+ // should not have ended nicely, since we returned an error
+ t.ok(code)
+ t.end()
+ })
+ })
+})