diff options
Diffstat (limited to 'deps/npm/node_modules')
226 files changed, 5026 insertions, 1124 deletions
diff --git a/deps/npm/node_modules/async-some/.eslintrc b/deps/npm/node_modules/async-some/.eslintrc new file mode 100644 index 0000000000..5c39c67eca --- /dev/null +++ b/deps/npm/node_modules/async-some/.eslintrc @@ -0,0 +1,18 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "curly" : 0, + "no-lonely-if" : 1, + "no-mixed-requires" : 0, + "no-underscore-dangle" : 0, + "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], + "no-use-before-define" : [2, "nofunc"], + "quotes" : [1, "double", "avoid-escape"], + "semi" : [2, "never"], + "space-after-keywords" : 1, + "space-infix-ops" : 0, + "strict" : 0 + } +} diff --git a/deps/npm/node_modules/async-some/.npmignore b/deps/npm/node_modules/async-some/.npmignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/deps/npm/node_modules/async-some/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/deps/npm/node_modules/async-some/README.md b/deps/npm/node_modules/async-some/README.md new file mode 100644 index 0000000000..bb502ee060 --- /dev/null +++ b/deps/npm/node_modules/async-some/README.md @@ -0,0 +1,62 @@ +# some + +Short-circuited async Array.prototype.some implementation. + +Serially evaluates a list of values from a JS array or arraylike +against an asynchronous predicate, terminating on the first truthy +value. If the predicate encounters an error, pass it to the completion +callback. Otherwise, pass the truthy value passed by the predicate, or +`false` if no truthy value was passed. + +Is +[Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)-proof, +browser-safe, and pretty efficient. + +## Usage + +```javascript +var some = require("async-some"); +var resolve = require("path").resolve; +var stat = require("fs").stat; +var readFileSync = require("fs").readFileSync; + +some(["apple", "seaweed", "ham", "quince"], porkDetector, function (error, match) { + if (error) return console.error(error); + + if (match) return console.dir(JSON.parse(readFileSync(match))); + + console.error("time to buy more Sporkle™!"); +}); + +var PREFIX = resolve(__dirname, "../pork_store"); +function porkDetector(value, cb) { + var path = resolve(PREFIX, value + ".json"); + stat(path, function (er, stat) { + if (er) { + if (er.code === "ENOENT") return cb(null, false); + + return cb(er); + } + + cb(er, path); + }); +} +``` + +### some(list, test, callback) + +* `list` {Object} An arraylike (either an Array or the arguments arraylike) to + be checked. +* `test` {Function} The predicate against which the elements of `list` will be + tested. Takes two parameters: + * `element` {any} The element of the list to be tested. + * `callback` {Function} The continuation to be called once the test is + complete. Takes (again) two values: + * `error` {Error} Any errors that the predicate encountered. + * `value` {any} A truthy value. A non-falsy result terminates checking the + entire list. +* `callback` {Function} The callback to invoke when either a value has been + found or the entire input list has been processed with no result. Is invoked + with the traditional two parameters: + * `error` {Error} Errors that were encountered during the evaluation of some(). + * `match` {any} Value successfully matched by `test`, if any. diff --git a/deps/npm/node_modules/async-some/package.json b/deps/npm/node_modules/async-some/package.json new file mode 100644 index 0000000000..d32ae73fb2 --- /dev/null +++ b/deps/npm/node_modules/async-some/package.json @@ -0,0 +1,57 @@ +{ + "name": "async-some", + "version": "1.0.1", + "description": "short-circuited, asynchronous version of Array.protototype.some", + "main": "some.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/othiym23/async-some.git" + }, + "keywords": [ + "async", + "some", + "array", + "collections", + "fp" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/othiym23/async-some/issues" + }, + "homepage": "https://github.com/othiym23/async-some", + "dependencies": { + "dezalgo": "^1.0.0" + }, + "devDependencies": { + "tap": "^0.4.11" + }, + "gitHead": "e73d6d1fbc03cca5a0d54f456f39bab294a4c7b7", + "_id": "async-some@1.0.1", + "_shasum": "8b54f08d46f0f9babc72ea9d646c245d23a4d9e5", + "_from": "async-some@>=1.0.1-0 <2.0.0-0", + "_npmVersion": "1.5.0-pre", + "_npmUser": { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "8b54f08d46f0f9babc72ea9d646c245d23a4d9e5", + "tarball": "http://registry.npmjs.org/async-some/-/async-some-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/async-some/-/async-some-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/async-some/some.js b/deps/npm/node_modules/async-some/some.js new file mode 100644 index 0000000000..0419709f76 --- /dev/null +++ b/deps/npm/node_modules/async-some/some.js @@ -0,0 +1,47 @@ +var assert = require("assert") +var dezalgoify = require("dezalgo") + +module.exports = some + +/** + * short-circuited async Array.prototype.some implementation + * + * Serially evaluates a list of values from a JS array or arraylike + * against an asynchronous predicate, terminating on the first truthy + * value. If the predicate encounters an error, pass it to the completion + * callback. Otherwise, pass the truthy value passed by the predicate, or + * `false` if no truthy value was passed. + */ +function some (list, test, cb) { + assert("length" in list, "array must be arraylike") + assert.equal(typeof test, "function", "predicate must be callable") + assert.equal(typeof cb, "function", "callback must be callable") + + var array = slice(list) + , index = 0 + , length = array.length + , hecomes = dezalgoify(cb) + + map() + + function map () { + if (index >= length) return hecomes(null, false) + + test(array[index], reduce) + } + + function reduce (er, result) { + if (er) return hecomes(er, false) + if (result) return hecomes(null, result) + + index++ + map() + } +} + +// Array.prototype.slice on arguments arraylike is expensive +function slice(args) { + var l = args.length, a = [], i + for (i = 0; i < l; i++) a[i] = args[i] + return a +} diff --git a/deps/npm/node_modules/async-some/test/base-case.js b/deps/npm/node_modules/async-some/test/base-case.js new file mode 100644 index 0000000000..356890521d --- /dev/null +++ b/deps/npm/node_modules/async-some/test/base-case.js @@ -0,0 +1,35 @@ +var test = require("tap").test + +var some = require("../some.js") + +test("some() array base case", function (t) { + some([], failer, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function failer(value, cb) { + cb(new Error("test should never have been called")) + } +}) + +test("some() arguments arraylike base case", function (t) { + go() + + function go() { + some(arguments, failer, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function failer(value, cb) { + cb(new Error("test should never have been called")) + } + } +}) diff --git a/deps/npm/node_modules/async-some/test/parameters.js b/deps/npm/node_modules/async-some/test/parameters.js new file mode 100644 index 0000000000..0706d1da6f --- /dev/null +++ b/deps/npm/node_modules/async-some/test/parameters.js @@ -0,0 +1,37 @@ +var test = require("tap").test + +var some = require("../some.js") + +var NOP = function () {} + +test("some() called with bogus parameters", function (t) { + t.throws(function () { + some() + }, "throws when called with no parameters") + + t.throws(function () { + some(null, NOP, NOP) + }, "throws when called with no list") + + t.throws(function () { + some([], null, NOP) + }, "throws when called with no predicate") + + t.throws(function () { + some([], NOP, null) + }, "throws when called with no callback") + + t.throws(function () { + some({}, NOP, NOP) + }, "throws when called with wrong list type") + + t.throws(function () { + some([], "ham", NOP) + }, "throws when called with wrong test type") + + t.throws(function () { + some([], NOP, "ham") + }, "throws when called with wrong test type") + + t.end() +}) diff --git a/deps/npm/node_modules/async-some/test/simple.js b/deps/npm/node_modules/async-some/test/simple.js new file mode 100644 index 0000000000..3d68e1e507 --- /dev/null +++ b/deps/npm/node_modules/async-some/test/simple.js @@ -0,0 +1,60 @@ +var test = require("tap").test + +var some = require("../some.js") + +test("some() doesn't find anything asynchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function predicate(value, cb) { + // dezalgo ensures it's safe to not do this, but just in case + setTimeout(function () { cb(null, value > "j" && value) }) + } +}) + +test("some() doesn't find anything synchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function predicate(value, cb) { + cb(null, value > "j" && value) + } +}) + +test("some() doesn't find anything asynchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.equals(match, "d", "found expected element") + + t.end() + }) + + function predicate(value, cb) { + setTimeout(function () { cb(null, value > "c" && value) }) + } +}) + +test("some() doesn't find anything synchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.equals(match, "d", "found expected") + + t.end() + }) + + function predicate(value, cb) { + cb(null, value > "c" && value) + } +}) diff --git a/deps/npm/node_modules/cmd-shim/index.js b/deps/npm/node_modules/cmd-shim/index.js index 7853e8605d..59a1f6cbd6 100644 --- a/deps/npm/node_modules/cmd-shim/index.js +++ b/deps/npm/node_modules/cmd-shim/index.js @@ -11,11 +11,7 @@ module.exports = cmdShim cmdShim.ifExists = cmdShimIfExists -try { - var fs = require("graceful-fs") -} catch (e) { - var fs = require("fs") -} +var fs = require("graceful-fs") var mkdir = require("mkdirp") , path = require("path") diff --git a/deps/npm/node_modules/cmd-shim/package.json b/deps/npm/node_modules/cmd-shim/package.json index 09f0c48a4d..e1f4f543ea 100644 --- a/deps/npm/node_modules/cmd-shim/package.json +++ b/deps/npm/node_modules/cmd-shim/package.json @@ -1,6 +1,6 @@ { "name": "cmd-shim", - "version": "2.0.0", + "version": "2.0.1", "description": "Used in npm for command line application support", "scripts": { "test": "tap test/*.js" @@ -10,26 +10,37 @@ "url": "https://github.com/ForbesLindesay/cmd-shim.git" }, "license": "BSD", - "optionalDependencies": { - "graceful-fs": "^3.0.2" - }, "dependencies": { - "mkdirp": "~0.5.0", - "graceful-fs": "^3.0.2" + "graceful-fs": ">3.0.1 <4.0.0-0", + "mkdirp": "~0.5.0" }, "devDependencies": { "tap": "~0.4.11", "rimraf": "~2.2.8" }, - "readme": "# cmd-shim\n\nThe cmd-shim used in npm to create executable scripts on Windows,\nsince symlinks are not suitable for this purpose there.\n\nOn Unix systems, you should use a symbolic link instead.\n\n[](https://travis-ci.org/ForbesLindesay/cmd-shim)\n[](https://gemnasium.com/ForbesLindesay/cmd-shim)\n[](http://badge.fury.io/js/cmd-shim)\n\n## Installation\n\n```\nnpm install cmd-shim\n```\n\n## API\n\n### cmdShim(from, to, cb)\n\nCreate a cmd shim at `to` for the command line program at `from`.\ne.g.\n\n```javascript\nvar cmdShim = require('cmd-shim');\ncmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {\n if (err) throw err;\n});\n```\n\n### cmdShim.ifExists(from, to, cb)\n\nThe same as above, but will just continue if the file does not exist.\nSource:\n\n```javascript\nfunction cmdShimIfExists (from, to, cb) {\n fs.stat(from, function (er) {\n if (er) return cb()\n cmdShim(from, to, cb)\n })\n}\n```\n", - "readmeFilename": "README.md", + "gitHead": "6f53d506be590fe9ac20c9801512cd1a3aad5974", "bugs": { "url": "https://github.com/ForbesLindesay/cmd-shim/issues" }, "homepage": "https://github.com/ForbesLindesay/cmd-shim", - "_id": "cmd-shim@2.0.0", - "_shasum": "64fd5859110051571406f61821bf37d366bc3cb3", - "_resolved": "git://github.com/othiym23/cmd-shim#12de64ca97f45ac600910092f19afacc3d5376dd", - "_from": "git://github.com/othiym23/cmd-shim", - "_fromGithub": true + "_id": "cmd-shim@2.0.1", + "_shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", + "_from": "cmd-shim@>=2.0.1-0 <3.0.0-0", + "_npmVersion": "1.5.0-alpha-4", + "_npmUser": { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + }, + "maintainers": [ + { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + } + ], + "dist": { + "shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", + "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json index 716ae00899..ca610250c9 100644 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json @@ -57,7 +57,7 @@ "homepage": "https://github.com/sindresorhus/ansi-regex", "_id": "ansi-regex@0.2.1", "_shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", - "_from": "ansi-regex@^0.2.1", + "_from": "ansi-regex@0.2.1", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", @@ -74,6 +74,5 @@ "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json index 0fd180b6f2..64c4dee52c 100644 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json @@ -63,7 +63,7 @@ "homepage": "https://github.com/sindresorhus/strip-ansi", "_id": "strip-ansi@1.0.0", "_shasum": "6c021321d6ece161a3c608fbab268c7328901c73", - "_from": "strip-ansi@^1.0.0", + "_from": "strip-ansi@>=1.0.0-0 <2.0.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "sindresorhus", @@ -84,6 +84,5 @@ "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json index ee00ac7e54..3c6b776470 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json @@ -100,7 +100,7 @@ "homepage": "https://github.com/pvorb/node-clone", "_id": "clone@0.1.18", "_shasum": "64a0d5d57eaa85a1a8af380cd1db8c7b3a895f66", - "_from": "clone@~0.1.5", + "_from": "clone@>=0.1.5-0 <0.2.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "pvorb", @@ -117,6 +117,5 @@ "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.18.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.18.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.18.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json index ba00482142..f9243a1200 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json @@ -45,10 +45,6 @@ ], "directories": {}, "_shasum": "3ae25f44416c6c01f9809a25fcdd285912d2a6b1", - "_from": "defaults@^1.0.0", - "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz", - "bugs": { - "url": "https://github.com/tmpvar/defaults/issues" - }, - "homepage": "https://github.com/tmpvar/defaults" + "_from": "defaults@>=1.0.0-0 <2.0.0-0", + "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json index 0045c3cdba..f12d49b789 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json @@ -40,7 +40,7 @@ "gitHead": "5bc3aafd45c89f233c27b9479c18a23ca91ba660", "_id": "wcwidth@1.0.0", "_shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", - "_from": "wcwidth@^1.0.0", + "_from": "wcwidth@>=1.0.0-0 <2.0.0-0", "_npmVersion": "1.4.23", "_npmUser": { "name": "timoxley", @@ -56,6 +56,5 @@ "shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", "tarball": "http://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" }, - "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" } diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json index 01ac64bb21..ef307b5092 100644 --- a/deps/npm/node_modules/columnify/package.json +++ b/deps/npm/node_modules/columnify/package.json @@ -43,7 +43,7 @@ "gitHead": "14e77bef3f57acaa3f390145915a9f2d2a4f882c", "_id": "columnify@1.2.1", "_shasum": "921ec51c178f4126d3c07e9acecd67a55c7953e4", - "_from": "columnify@^1.2.1", + "_from": "columnify@>=1.2.1-0 <2.0.0-0", "_npmVersion": "1.4.23", "_npmUser": { "name": "timoxley", @@ -59,6 +59,5 @@ "shasum": "921ec51c178f4126d3c07e9acecd67a55c7953e4", "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz" }, - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz" } diff --git a/deps/npm/node_modules/dezalgo/README.md b/deps/npm/node_modules/dezalgo/README.md new file mode 100644 index 0000000000..bdfc8ba80d --- /dev/null +++ b/deps/npm/node_modules/dezalgo/README.md @@ -0,0 +1,29 @@ +# dezalgo + +Contain async insanity so that the dark pony lord doesn't eat souls + +See [this blog +post](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). + +## USAGE + +Pass a callback to `dezalgo` and it will ensure that it is *always* +called in a future tick, and never in this tick. + +```javascript +var dz = require('dezalgo') + +var cache = {} +function maybeSync(arg, cb) { + cb = dz(cb) + + // this will actually defer to nextTick + if (cache[arg]) cb(null, cache[arg]) + + fs.readFile(arg, function (er, data) { + // since this is *already* defered, it will call immediately + if (er) cb(er) + cb(null, cache[arg] = data) + }) +} +``` diff --git a/deps/npm/node_modules/dezalgo/dezalgo.js b/deps/npm/node_modules/dezalgo/dezalgo.js new file mode 100644 index 0000000000..cdc48aec8c --- /dev/null +++ b/deps/npm/node_modules/dezalgo/dezalgo.js @@ -0,0 +1,21 @@ +module.exports = dezalgo + +var asap = require('asap') + +function dezalgo (cb) { + var sync = true + asap(function () { + sync = false + }) + + return function zalgoSafe() { + var args = arguments + var me = this + if (sync) + asap(function() { + cb.apply(me, args) + }) + else + cb.apply(me, args) + } +} diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md new file mode 100644 index 0000000000..5d98ad8fe9 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md @@ -0,0 +1,20 @@ + +Copyright 2009–2013 Contributors. All rights reserved. +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/README.md b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md new file mode 100644 index 0000000000..9a42759761 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md @@ -0,0 +1,81 @@ + +# ASAP + +This `asap` CommonJS package contains a single `asap` module that +exports a single `asap` function that executes a function **as soon as +possible**. + +```javascript +asap(function () { + // ... +}); +``` + +More formally, ASAP provides a fast event queue that will execute tasks +until it is empty before yielding to the JavaScript engine's underlying +event-loop. When the event queue becomes non-empty, ASAP schedules a +flush event, preferring for that event to occur before the JavaScript +engine has an opportunity to perform IO tasks or rendering, thus making +the first task and subsequent tasks semantically indistinguishable. +ASAP uses a variety of techniques to preserve this invariant on +different versions of browsers and NodeJS. + +By design, ASAP can starve the event loop on the theory that, if there +is enough work to be done synchronously, albeit in separate events, long +enough to starve input or output, it is a strong indicator that the +program needs to push back on scheduling more work. + +Take care. ASAP can sustain infinite recursive calls indefinitely +without warning. This is behaviorally equivalent to an infinite loop. +It will not halt from a stack overflow, but it *will* chew through +memory (which is an oddity I cannot explain at this time). Just as with +infinite loops, you can monitor a Node process for this behavior with a +heart-beat signal. As with infinite loops, a very small amount of +caution goes a long way to avoiding problems. + +```javascript +function loop() { + asap(loop); +} +loop(); +``` + +ASAP is distinct from `setImmediate` in that it does not suffer the +overhead of returning a handle and being possible to cancel. For a +`setImmediate` shim, consider [setImmediate][]. + +[setImmediate]: https://github.com/noblejs/setimmediate + +If a task throws an exception, it will not interrupt the flushing of +high-priority tasks. The exception will be postponed to a later, +low-priority event to avoid slow-downs, when the underlying JavaScript +engine will treat it as it does any unhandled exception. + +## Heritage + +ASAP has been factored out of the [Q][] asynchronous promise library. +It originally had a naïve implementation in terms of `setTimeout`, but +[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be +useful for creating a high-priority, no-delay event dispatch hack. +Since then, Internet Explorer proposed and implemented `setImmediate`. +Robert Kratić began contributing to Q by measuring the performance of +the internal implementation of `asap`, paying particular attention to +error recovery. Domenic, Robert, and I collectively settled on the +current strategy of unrolling the high-priority event queue internally +regardless of what strategy we used to dispatch the potentially +lower-priority flush event. Domenic went on to make ASAP cooperate with +NodeJS domains. + +[Q]: https://github.com/kriskowal/q +[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html + +For further reading, Nicholas Zakas provided a thorough article on [The +Case for setImmediate][NCZ]. + +[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/ + +## License + +Copyright 2009-2013 by Contributors +MIT License (enclosed) + diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js new file mode 100644 index 0000000000..2f85516cde --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js @@ -0,0 +1,113 @@ + +// Use the fastest possible means to execute a task in a future turn +// of the event loop. + +// linked list of tasks (single, with head node) +var head = {task: void 0, next: null}; +var tail = head; +var flushing = false; +var requestFlush = void 0; +var isNodeJS = false; + +function flush() { + /* jshint loopfunc: true */ + + while (head.next) { + head = head.next; + var task = head.task; + head.task = void 0; + var domain = head.domain; + + if (domain) { + head.domain = void 0; + domain.enter(); + } + + try { + task(); + + } catch (e) { + if (isNodeJS) { + // In node, uncaught exceptions are considered fatal errors. + // Re-throw them synchronously to interrupt flushing! + + // Ensure continuation if the uncaught exception is suppressed + // listening "uncaughtException" events (as domains does). + // Continue in next event to avoid tick recursion. + if (domain) { + domain.exit(); + } + setTimeout(flush, 0); + if (domain) { + domain.enter(); + } + + throw e; + + } else { + // In browsers, uncaught exceptions are not fatal. + // Re-throw them asynchronously to avoid slow-downs. + setTimeout(function() { + throw e; + }, 0); + } + } + + if (domain) { + domain.exit(); + } + } + + flushing = false; +} + +if (typeof process !== "undefined" && process.nextTick) { + // Node.js before 0.9. Note that some fake-Node environments, like the + // Mocha test runner, introduce a `process` global without a `nextTick`. + isNodeJS = true; + + requestFlush = function () { + process.nextTick(flush); + }; + +} else if (typeof setImmediate === "function") { + // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate + if (typeof window !== "undefined") { + requestFlush = setImmediate.bind(window, flush); + } else { + requestFlush = function () { + setImmediate(flush); + }; + } + +} else if (typeof MessageChannel !== "undefined") { + // modern browsers + // http://www.nonblocking.io/2011/06/windownexttick.html + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + requestFlush = function () { + channel.port2.postMessage(0); + }; + +} else { + // old browsers + requestFlush = function () { + setTimeout(flush, 0); + }; +} + +function asap(task) { + tail = tail.next = { + task: task, + domain: isNodeJS && process.domain, + next: null + }; + + if (!flushing) { + flushing = true; + requestFlush(); + } +}; + +module.exports = asap; + diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json new file mode 100644 index 0000000000..1237784d41 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json @@ -0,0 +1,39 @@ +{ + "name": "asap", + "version": "1.0.0", + "description": "High-priority task queue for Node.js and browsers", + "keywords": [ + "event", + "task", + "queue" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/kriskowal/asap/raw/master/LICENSE.md" + } + ], + "main": "asap", + "readme": "\n# ASAP\n\nThis `asap` CommonJS package contains a single `asap` module that\nexports a single `asap` function that executes a function **as soon as\npossible**.\n\n```javascript\nasap(function () {\n // ...\n});\n```\n\nMore formally, ASAP provides a fast event queue that will execute tasks\nuntil it is empty before yielding to the JavaScript engine's underlying\nevent-loop. When the event queue becomes non-empty, ASAP schedules a\nflush event, preferring for that event to occur before the JavaScript\nengine has an opportunity to perform IO tasks or rendering, thus making\nthe first task and subsequent tasks semantically indistinguishable.\nASAP uses a variety of techniques to preserve this invariant on\ndifferent versions of browsers and NodeJS.\n\nBy design, ASAP can starve the event loop on the theory that, if there\nis enough work to be done synchronously, albeit in separate events, long\nenough to starve input or output, it is a strong indicator that the\nprogram needs to push back on scheduling more work.\n\nTake care. ASAP can sustain infinite recursive calls indefinitely\nwithout warning. This is behaviorally equivalent to an infinite loop.\nIt will not halt from a stack overflow, but it *will* chew through\nmemory (which is an oddity I cannot explain at this time). Just as with\ninfinite loops, you can monitor a Node process for this behavior with a\nheart-beat signal. As with infinite loops, a very small amount of\ncaution goes a long way to avoiding problems.\n\n```javascript\nfunction loop() {\n asap(loop);\n}\nloop();\n```\n\nASAP is distinct from `setImmediate` in that it does not suffer the\noverhead of returning a handle and being possible to cancel. For a\n`setImmediate` shim, consider [setImmediate][].\n\n[setImmediate]: https://github.com/noblejs/setimmediate\n\nIf a task throws an exception, it will not interrupt the flushing of\nhigh-priority tasks. The exception will be postponed to a later,\nlow-priority event to avoid slow-downs, when the underlying JavaScript\nengine will treat it as it does any unhandled exception.\n\n## Heritage\n\nASAP has been factored out of the [Q][] asynchronous promise library.\nIt originally had a naïve implementation in terms of `setTimeout`, but\n[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be\nuseful for creating a high-priority, no-delay event dispatch hack.\nSince then, Internet Explorer proposed and implemented `setImmediate`.\nRobert Kratić began contributing to Q by measuring the performance of\nthe internal implementation of `asap`, paying particular attention to\nerror recovery. Domenic, Robert, and I collectively settled on the\ncurrent strategy of unrolling the high-priority event queue internally\nregardless of what strategy we used to dispatch the potentially\nlower-priority flush event. Domenic went on to make ASAP cooperate with\nNodeJS domains.\n\n[Q]: https://github.com/kriskowal/q\n[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html\n\nFor further reading, Nicholas Zakas provided a thorough article on [The\nCase for setImmediate][NCZ].\n\n[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/\n\n## License\n\nCopyright 2009-2013 by Contributors\nMIT License (enclosed)\n\n", + "readmeFilename": "README.md", + "_id": "asap@1.0.0", + "dist": { + "shasum": "b2a45da5fdfa20b0496fc3768cc27c12fa916a7d", + "tarball": "http://registry.npmjs.org/asap/-/asap-1.0.0.tgz" + }, + "_from": "asap@>=1.0.0-0 <2.0.0-0", + "_npmVersion": "1.2.15", + "_npmUser": { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + }, + "maintainers": [ + { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + } + ], + "directories": {}, + "_shasum": "b2a45da5fdfa20b0496fc3768cc27c12fa916a7d", + "_resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz" +} diff --git a/deps/npm/node_modules/dezalgo/package.json b/deps/npm/node_modules/dezalgo/package.json new file mode 100644 index 0000000000..072e2ad6f4 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/package.json @@ -0,0 +1,66 @@ +{ + "name": "dezalgo", + "version": "1.0.0", + "description": "Contain async insanity so that the dark pony lord doesn't eat souls", + "main": "dezalgo.js", + "directories": { + "test": "test" + }, + "dependencies": { + "asap": "^1.0.0" + }, + "devDependencies": { + "tap": "^0.4.11" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/dezalgo" + }, + "keywords": [ + "async", + "zalgo", + "the dark pony", + "he comes", + "asynchrony of all holy and good", + "T̯̪ͅo̯͖̹ ̻̮̖̲͢i̥̖n̢͈͇̝͍v͏͉ok̭̬̝ͅe̞͍̩̫͍̩͝ ̩̮̖̟͇͉́t͔͔͎̗h͏̗̟e̘͉̰̦̠̞͓ ͕h͉̟͎̪̠̱͠ḭ̮̩v̺͉͇̩e̵͖-̺̪m͍i̜n̪̲̲̲̮d̷ ̢r̠̼̯̹̦̦͘ͅe͓̳͓̙p̺̗̫͙͘ͅr͔̰͜e̴͓̞s͉̩̩͟ͅe͏̣n͚͇̗̭̺͍tì͙̣n͏̖̥̗͎̰̪g̞͓̭̱̯̫̕ ̣̱͜ͅc̦̰̰̠̮͎͙̀hao̺̜̻͍͙ͅs͉͓̘.͎̼̺̼͕̹͘", + "̠̞̱̰I͖͇̝̻n̦̰͍̰̟v̤̺̫̳̭̼̗͘ò̹̟̩̩͚k̢̥̠͍͉̦̬i̖͓͔̮̱̻͘n̶̳͙̫͎g̖̯̣̲̪͉ ̞͎̗͕͚ͅt̲͕̘̺̯̗̦h̘̦̲̜̻e̳͎͉̬͙ ̴̞̪̲̥f̜̯͓͓̭̭͢e̱̘͔̮e̜̤l̺̱͖̯͓͙͈͢i̵̦̬͉͔̫͚͕n͉g̨͖̙̙̹̹̟̤ ͉̪o̞̠͍̪̰͙ͅf̬̲̺ ͔͕̲͕͕̲̕c̙͉h̝͔̩̙̕ͅa̲͖̻̗̹o̥̼̫s̝̖̜̝͚̫̟.̺͚ ̸̱̲W̶̥̣͖̦i͏̤̬̱̳̣ͅt͉h̗̪̪ ̷̱͚̹̪ǫ͕̗̣̳̦͎u̼̦͔̥̮̕ţ͖͎̻͔͉ ̴͎̩òr̹̰̖͉͈͝d̷̲̦̖͓e̲͓̠r", + "̧͚̜͓̰̭̭Ṯ̫̹̜̮̟̮͝h͚̘̩̘̖̰́e ̥̘͓͉͔͙̼N̟̜̣̘͔̪e̞̞̤͢z̰̖̘͇p̠͟e̺̱̣͍͙̝ṛ̘̬͔̙͇̠d͝ḭ̯̱̥̗̩a̛ͅn͏̦ ̷̥hi̥v̖̳̹͉̮̱͝e̹̪̘̖̰̟-̴͙͓͚̜̻mi̗̺̻͙̺ͅn̪̯͈d ͏̘͓̫̳ͅơ̹͔̳̖̣͓f͈̹̘ ͕ͅc̗̤̠̜̮̥̥h̡͍̩̭̫͚̱a̤͉̤͔͜os͕̤̼͍̲̀ͅ.̡̱ ̦Za̯̱̗̭͍̣͚l̗͉̰̤g͏̣̭̬̗̲͖ͅo̶̭̩̳̟͈.̪̦̰̳", + "H̴̱̦̗̬̣͓̺e̮ ͉̠̰̞͎̖͟ẁh̛̺̯ͅo̖̫͡ ̢Ẁa̡̗i̸t͖̣͉̀ş͔̯̩ ̤̦̮͇̞̦̲B͎̭͇̦̼e̢hin͏͙̟̪d̴̰͓̻̣̮͕ͅ T͖̮̕h͖e̘̺̰̙͘ ̥Ẁ̦͔̻͚a̞͖̪͉l̪̠̻̰̣̠l̲͎͞", + "Z̘͍̼͎̣͔͝Ą̲̜̱̱̹̤͇L̶̝̰̭͔G͍̖͍O̫͜ͅ!̼̤ͅ", + "H̝̪̜͓̀̌̂̒E̢̙̠̣ ̴̳͇̥̟̠͍̐C̹̓̑̐̆͝Ó̶̭͓̚M̬̼Ĕ̖̤͔͔̟̹̽̿̊ͥ̍ͫS̻̰̦̻̖̘̱̒ͪ͌̅͟" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/dezalgo/issues" + }, + "homepage": "https://github.com/npm/dezalgo", + "gitHead": "b10ea8ae0096d0e60c1acaa88d5334a9b372e4b0", + "_id": "dezalgo@1.0.0", + "_shasum": "050bb723f18b5617b309f26c2dc8fe6f2573b6fc", + "_from": "dezalgo@1.0.0", + "_npmVersion": "1.4.18", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "050bb723f18b5617b309f26c2dc8fe6f2573b6fc", + "tarball": "http://registry.npmjs.org/dezalgo/-/dezalgo-1.0.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/dezalgo/test/basic.js b/deps/npm/node_modules/dezalgo/test/basic.js new file mode 100644 index 0000000000..cc10336e03 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/test/basic.js @@ -0,0 +1,25 @@ +var test = require('tap').test +var dz = require('../dezalgo.js') + +test('the dark pony', function(t) { + + var n = 0 + function foo(cb) { + cb = dz(cb) + if (++n % 2) cb() + else process.nextTick(cb) + } + + var called = 0 + for (var i = 0; i < 10; i++) { + foo(function() { + called++ + }) + t.equal(called, 0) + } + + setTimeout(function() { + t.equal(called, 10) + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/.eslintrc b/deps/npm/node_modules/fs-vacuum/.eslintrc new file mode 100644 index 0000000000..5c39c67eca --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/.eslintrc @@ -0,0 +1,18 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "curly" : 0, + "no-lonely-if" : 1, + "no-mixed-requires" : 0, + "no-underscore-dangle" : 0, + "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], + "no-use-before-define" : [2, "nofunc"], + "quotes" : [1, "double", "avoid-escape"], + "semi" : [2, "never"], + "space-after-keywords" : 1, + "space-infix-ops" : 0, + "strict" : 0 + } +} diff --git a/deps/npm/node_modules/fs-vacuum/.npmignore b/deps/npm/node_modules/fs-vacuum/.npmignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/deps/npm/node_modules/fs-vacuum/README.md b/deps/npm/node_modules/fs-vacuum/README.md new file mode 100644 index 0000000000..df31243df5 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/README.md @@ -0,0 +1,33 @@ +# fs-vacuum + +Remove the empty branches of a directory tree, optionally up to (but not +including) a specified base directory. Optionally nukes the leaf directory. + +## Usage + +```javascript +var logger = require("npmlog"); +var vacuum = require("fs-vacuum"); + +var options = { + base : "/path/to/my/tree/root", + purge : true, + log : logger.silly.bind(logger, "myCleanup") +}; + +/* Assuming there are no other files or directories in "out", "to", or "my", + * the final path will just be "/path/to/my/tree/root". + */ +vacuum("/path/to/my/tree/root/out/to/my/files", function (error) { + if (error) console.error("Unable to cleanly vacuum:", error.message); +}); +``` +# vacuum(directory, options, callback) + +* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.** +* `options` {Object} + * `base` {String} No directories at or above this level of the filesystem will be removed. + * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents. + * `log` {Function} A logging function that takes `npmlog`-compatible argument lists. +* `callback` {Function} Function to call once vacuuming is complete. + * `error` {Error} What went wrong along the way, if anything. diff --git a/deps/npm/node_modules/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json new file mode 100644 index 0000000000..140536797f --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/package.json @@ -0,0 +1,42 @@ +{ + "name": "fs-vacuum", + "version": "1.2.1", + "description": "recursively remove empty directories -- to a point", + "main": "vacuum.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/fs-vacuum.git" + }, + "keywords": [ + "rm", + "rimraf", + "clean" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/fs-vacuum/issues" + }, + "homepage": "https://github.com/npm/fs-vacuum", + "devDependencies": { + "mkdirp": "^0.5.0", + "tap": "^0.4.11", + "tmp": "0.0.23" + }, + "dependencies": { + "graceful-fs": "^3.0.2", + "rimraf": "^2.2.8" + }, + "readme": "# fs-vacuum\n\nRemove the empty branches of a directory tree, optionally up to (but not\nincluding) a specified base directory. Optionally nukes the leaf directory.\n\n## Usage\n\n```javascript\nvar logger = require(\"npmlog\");\nvar vacuum = require(\"fs-vacuum\");\n\nvar options = {\n base : \"/path/to/my/tree/root\",\n purge : true,\n log : logger.silly.bind(logger, \"myCleanup\")\n};\n\n/* Assuming there are no other files or directories in \"out\", \"to\", or \"my\",\n * the final path will just be \"/path/to/my/tree/root\".\n */\nvacuum(\"/path/to/my/tree/root/out/to/my/files\", function (error) {\n if (error) console.error(\"Unable to cleanly vacuum:\", error.message);\n});\n```\n# vacuum(directory, options, callback)\n\n* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.**\n* `options` {Object}\n * `base` {String} No directories at or above this level of the filesystem will be removed.\n * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents.\n * `log` {Function} A logging function that takes `npmlog`-compatible argument lists.\n* `callback` {Function} Function to call once vacuuming is complete.\n * `error` {Error} What went wrong along the way, if anything.\n", + "readmeFilename": "README.md", + "gitHead": "bad24b21c45d86b3da991f2c3d058ef03546d83e", + "_id": "fs-vacuum@1.2.1", + "_shasum": "1bc3c62da30d6272569b8b9089c9811abb0a600b", + "_from": "fs-vacuum@>=1.2.1-0 <1.3.0-0" +} diff --git a/deps/npm/node_modules/fs-vacuum/test/arguments.js b/deps/npm/node_modules/fs-vacuum/test/arguments.js new file mode 100644 index 0000000000..d77ce0627d --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/arguments.js @@ -0,0 +1,24 @@ +var test = require("tap").test + +var vacuum = require("../vacuum.js") + +test("vacuum throws on missing parameters", function (t) { + t.throws(vacuum, "called with no parameters") + t.throws(function () { vacuum("directory", {}) }, "called with no callback") + + t.end() +}) + +test('vacuum throws on incorrect types ("Forrest is pedantic" section)', function (t) { + t.throws(function () { + vacuum({}, {}, function () {}) + }, "called with path parameter of incorrect type") + t.throws(function () { + vacuum("directory", "directory", function () {}) + }, "called with options of wrong type") + t.throws(function () { + vacuum("directory", {}, "whoops") + }, "called with callback that isn't callable") + + t.end() +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js b/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js new file mode 100644 index 0000000000..cfdf074fe4 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js @@ -0,0 +1,16 @@ +var test = require("tap").test + +var vacuum = require("../vacuum.js") + +test("vacuum errors when base is set and path is not under it", function (t) { + vacuum("/a/made/up/path", {base : "/root/elsewhere"}, function (er) { + t.ok(er, "got an error") + t.equal( + er.message, + "/a/made/up/path is not a child of /root/elsewhere", + "got the expected error message" + ) + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js new file mode 100644 index 0000000000..6a6e51bcab --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js @@ -0,0 +1,78 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var writeFile = require("graceful-fs").writeFile +var readdirSync = require("graceful-fs").readdirSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var PARTIAL_PATH = path.join(SHORT_PATH, "that", "ends", "at", "a") +var FULL_PATH = path.join(PARTIAL_PATH, "file") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, partialPath, fullPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, "made test path") + + writeFile(fullPath, new Buffer("hi"), function (er) { + t.ifError(er, "made file") + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(fullPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 6, "got 5 removal & 1 finish message") + t.equal(messages[5], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = fullPath + + function verify() { stat = statSync(verifyPath) } + + // handle the file separately + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isFile(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + var files = readdirSync(testBase) + t.equal(files.length, 0, "nothing left in base directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js new file mode 100644 index 0000000000..087c039d61 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js @@ -0,0 +1,78 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var symlinkSync = require("graceful-fs").symlinkSync +var readdirSync = require("graceful-fs").readdirSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var TARGET_PATH = path.join("target-link", "in", "the", "middle") +var PARTIAL_PATH = path.join(SHORT_PATH, "with", "a") +var FULL_PATH = path.join(PARTIAL_PATH, "link") +var EXPANDO_PATH = path.join(SHORT_PATH, "with", "a", "link", "in", "the", "middle") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, targetPath, partialPath, fullPath, expandoPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + targetPath = path.resolve(tmpdir, TARGET_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + expandoPath = path.resolve(tmpdir, EXPANDO_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, "made test path") + + mkdirp(targetPath, function (er) { + t.ifError(er, "made target path") + + symlinkSync(path.join(tmpdir, "target-link"), fullPath) + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(expandoPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 7, "got 6 removal & 1 finish message") + t.equal(messages[6], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = expandoPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 6; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + var files = readdirSync(testBase) + t.equal(files.length, 0, "nothing left in base directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js new file mode 100644 index 0000000000..346ab56697 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js @@ -0,0 +1,61 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var LONG_PATH = path.join(SHORT_PATH, "of", "a", "certain", "length") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testPath, testBase +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, LONG_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, "made test path") + + t.end() + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(testPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 5, "got 4 removal & 1 finish message") + t.equal(messages[4], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = testPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js new file mode 100644 index 0000000000..4ed1a39397 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js @@ -0,0 +1,78 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var writeFileSync = require("graceful-fs").writeFileSync +var symlinkSync = require("graceful-fs").symlinkSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var TARGET_PATH = "link-target" +var FIRST_FILE = path.join(TARGET_PATH, "monsieurs") +var SECOND_FILE = path.join(TARGET_PATH, "mesdames") +var PARTIAL_PATH = path.join(SHORT_PATH, "with", "a", "definite") +var FULL_PATH = path.join(PARTIAL_PATH, "target") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, partialPath, fullPath, targetPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + targetPath = path.resolve(tmpdir, TARGET_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, "made test path") + + mkdirp(targetPath, function (er) { + t.ifError(er, "made target path") + + writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) + writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer("oui oui")) + symlinkSync(targetPath, fullPath) + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(fullPath, {purge : true, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 5, "got 4 removal & 1 finish message") + t.equal(messages[0], "purging " + fullPath) + t.equal(messages[4], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = fullPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js new file mode 100644 index 0000000000..10fa558552 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js @@ -0,0 +1,67 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var writeFileSync = require("graceful-fs").writeFileSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var LONG_PATH = path.join(SHORT_PATH, "of", "a", "certain", "kind") +var FIRST_FILE = path.join(LONG_PATH, "monsieurs") +var SECOND_FILE = path.join(LONG_PATH, "mesdames") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testPath, testBase +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, LONG_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, "made test path") + + writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) + writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer("oui oui")) + t.end() + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(testPath, {purge : true, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 5, "got 4 removal & 1 finish message") + t.equal(messages[0], "purging " + testPath) + t.equal(messages[4], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = testPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js new file mode 100644 index 0000000000..dce785623e --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js @@ -0,0 +1,76 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var REMOVE_PATH = path.join(SHORT_PATH, "of", "a", "certain", "length") +var OTHER_PATH = path.join(SHORT_PATH, "of", "no", "qualities") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, testPath, otherPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, REMOVE_PATH) + otherPath = path.resolve(tmpdir, OTHER_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, "made test path") + + mkdirp(otherPath, function (er) { + t.ifError(er, "made other path") + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(testPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 4, "got 3 removal & 1 finish message") + t.equal( + messages[3], "quitting because other entries in " + testBase + "/of", + "got expected final message" + ) + + var stat + var verifyPath = testPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 3; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(otherPath) + }, otherPath + " can be statted") + t.ok(stat && stat.isDirectory(), otherPath + " is still a directory") + + var intersection = path.join(testBase, "of") + t.doesNotThrow(function () { + stat = statSync(intersection) + }, intersection + " can be statted") + t.ok(stat && stat.isDirectory(), intersection + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/vacuum.js b/deps/npm/node_modules/fs-vacuum/vacuum.js new file mode 100644 index 0000000000..f706a4be68 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/vacuum.js @@ -0,0 +1,104 @@ +var assert = require("assert") +var dirname = require("path").dirname +var resolve = require("path").resolve + +var rimraf = require("rimraf") +var lstat = require("graceful-fs").lstat +var readdir = require("graceful-fs").readdir +var rmdir = require("graceful-fs").rmdir +var unlink = require("graceful-fs").unlink + +module.exports = vacuum + +function vacuum(leaf, options, cb) { + assert(typeof leaf === "string", "must pass in path to remove") + assert(typeof cb === "function", "must pass in callback") + + if (!options) options = {} + assert(typeof options === "object", "options must be an object") + + var log = options.log ? options.log : function () {} + + var base = options.base + if (base && resolve(leaf).indexOf(resolve(base)) !== 0) { + return cb(new Error(resolve(leaf) + " is not a child of " + resolve(base))) + } + + lstat(leaf, function (error, stat) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log(error.stack) + return cb(error) + } + + if (!(stat && (stat.isDirectory() || stat.isSymbolicLink() || stat.isFile()))) { + log(leaf, "is not a directory, file, or link") + return cb(new Error(leaf + " is not a directory, file, or link")) + } + + if (options.purge) { + log("purging", leaf) + rimraf(leaf, function (error) { + if (error) return cb(error) + + next(dirname(leaf)) + }) + } + else if (!stat.isDirectory()) { + log("removing", leaf) + unlink(leaf, function (error) { + if (error) return cb(error) + + next(dirname(leaf)) + }) + } + else { + next(leaf) + } + }) + + function next(branch) { + // either we've reached the base or we've reached the root + if ((base && resolve(branch) === resolve(base)) || branch === dirname(branch)) { + log("finished vacuuming up to", branch) + return cb(null) + } + + readdir(branch, function (error, files) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log("unable to check directory", branch, "due to", error.message) + return cb(error) + } + + if (files.length > 0) { + log("quitting because other entries in", branch) + return cb(null) + } + + log("removing", branch) + lstat(branch, function (error, stat) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log("unable to lstat", branch, "due to", error.message) + return cb(error) + } + + var remove = stat.isDirectory() ? rmdir : unlink + remove(branch, function (error) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log("unable to remove", branch, "due to", error.message) + return cb(error) + } + + next(dirname(branch)) + }) + }) + }) + } +} diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json index de7f7bc14f..d0ac58243a 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -28,8 +28,6 @@ "test": "tap examples/*.js" }, "license": "BSD", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", "gitHead": "b3b74e92ef4a91ae206fab90b7998c7cd2e4290d", "bugs": { "url": "https://github.com/isaacs/fstream/issues" @@ -37,5 +35,23 @@ "homepage": "https://github.com/isaacs/fstream", "_id": "fstream@1.0.2", "_shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", - "_from": "fstream@latest" + "_from": "fstream@1.0.2", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", + "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/github-url-from-git/package.json b/deps/npm/node_modules/github-url-from-git/package.json index 978435c7da..229af333ca 100644 --- a/deps/npm/node_modules/github-url-from-git/package.json +++ b/deps/npm/node_modules/github-url-from-git/package.json @@ -32,7 +32,7 @@ "homepage": "https://github.com/visionmedia/node-github-url-from-git", "_id": "github-url-from-git@1.4.0", "_shasum": "285e6b520819001bde128674704379e4ff03e0de", - "_from": "github-url-from-git@^1.4.0", + "_from": "github-url-from-git@>=1.4.0-0 <2.0.0-0", "_npmVersion": "2.0.0-alpha.7", "_npmUser": { "name": "bcoe", @@ -53,6 +53,5 @@ "tarball": "http://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" } diff --git a/deps/npm/node_modules/github-url-from-username-repo/index.js b/deps/npm/node_modules/github-url-from-username-repo/index.js index 794daabf3b..f9d77f952f 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/index.js +++ b/deps/npm/node_modules/github-url-from-username-repo/index.js @@ -2,7 +2,16 @@ module.exports = getUrl function getUrl (r, forBrowser) { if (!r) return null - if (/^[\w-]+\/[\w\.-]+(#[a-z0-9]*)?$/.test(r)) { + // Regex taken from https://github.com/npm/npm-package-arg/commit/01dce583c64afae07b66a2a8a6033aeba871c3cd + // Note: This does not fully test the git ref format. + // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + if (/^[^@%\/\s\.-][^:@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(r)) { if (forBrowser) r = r.replace("#", "/tree/") return "https://github.com/" + r diff --git a/deps/npm/node_modules/github-url-from-username-repo/package.json b/deps/npm/node_modules/github-url-from-username-repo/package.json index 8b6be10115..f8aa80d5b6 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/package.json +++ b/deps/npm/node_modules/github-url-from-username-repo/package.json @@ -1,6 +1,6 @@ { "name": "github-url-from-username-repo", - "version": "1.0.0", + "version": "1.0.2", "description": "Create urls from username/repo", "main": "index.js", "scripts": { @@ -26,34 +26,11 @@ "github", "repo" ], - "gitHead": "d5b3c01193504d67b3ecc030e93d5c58c9b0df63", + "readme": "[](https://travis-ci.org/robertkowalski/github-url-from-username-repo)\n[](https://gemnasium.com/robertkowalski/github-url-from-username-repo)\n\n\n# github-url-from-username-repo\n\n## API\n\n### getUrl(url, [forBrowser])\n\nGet's the url normalized for npm.\nIf `forBrowser` is true, return a GitHub url that is usable in a webbrowser.\n\n## Usage\n\n```javascript\n\nvar getUrl = require(\"github-url-from-username-repo\")\ngetUrl(\"visionmedia/express\") // https://github.com/visionmedia/express\n\n```\n", + "readmeFilename": "README.md", + "gitHead": "d404a13f7f04edaed0e2f068a43b81230b8c7aee", "homepage": "https://github.com/robertkowalski/github-url-from-username-repo", - "_id": "github-url-from-username-repo@1.0.0", - "_shasum": "848d4f19bc838dc428484ce0dc33da593e8400ed", - "_from": "github-url-from-username-repo@^1.0.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "robertkowalski", - "email": "rok@kowalski.gd" - }, - "maintainers": [ - { - "name": "robertkowalski", - "email": "rok@kowalski.gd" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "forbeslindesay", - "email": "forbes@lindesay.co.uk" - } - ], - "dist": { - "shasum": "848d4f19bc838dc428484ce0dc33da593e8400ed", - "tarball": "http://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-1.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-1.0.0.tgz" + "_id": "github-url-from-username-repo@1.0.2", + "_shasum": "7dd79330d2abe69c10c2cef79714c97215791dfa", + "_from": "github-url-from-username-repo@>=1.0.2-0 <2.0.0-0" } diff --git a/deps/npm/node_modules/github-url-from-username-repo/test/index.js b/deps/npm/node_modules/github-url-from-username-repo/test/index.js index 935bb439d3..10fe3a34cc 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/test/index.js +++ b/deps/npm/node_modules/github-url-from-username-repo/test/index.js @@ -17,6 +17,11 @@ describe("github url from username/repo", function () { assert.deepEqual(null, url) }) + it("returns null for something that's already a URI", function () { + var url = getUrl("file:../relative") + assert.deepEqual(null, url) + }) + it("works with .", function () { var url = getUrl("component/.download.er.js.") assert.equal("https://github.com/component/.download.er.js.", url) @@ -40,6 +45,13 @@ describe("github url from username/repo", function () { "4b477f04d947bd53c473799b277", url) }) + it("can handle branches with slashes", function () { + var url = getUrl( + "component/entejs#some/branch/name") + + assert.equal("https://github.com/component/entejs#some/branch/name", url) + }) + describe("browser mode", function () { it("is able to return urls for branches", function () { var url = getUrl( diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json index bba3057d99..703b34ac42 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json @@ -27,7 +27,7 @@ "homepage": "https://github.com/isaacs/promzard", "_id": "promzard@0.2.2", "_shasum": "918b9f2b29458cb001781a8856502e4a79b016e0", - "_from": "promzard@~0.2.0", + "_from": "promzard@>=0.2.0-0 <0.3.0-0", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", @@ -44,6 +44,5 @@ "tarball": "http://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz" } diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index ff9f926fc9..c716cd6e87 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -1,6 +1,6 @@ { "name": "init-package-json", - "version": "1.0.0", + "version": "1.0.1", "main": "init-package-json.js", "scripts": { "test": "tap test/*.js" @@ -21,7 +21,7 @@ "promzard": "~0.2.0", "read": "~1.0.1", "read-package-json": "1", - "semver": "2.x || 3.x" + "semver": "2.x || 3.x || 4" }, "devDependencies": { "tap": "~0.2.5", @@ -37,15 +37,15 @@ "prompt", "start" ], - "gitHead": "e8c42e4be8877195e0ef2cd0b50d806afd2eec08", + "gitHead": "e1a5917ba1723ab5dcedacbffb5b10208d203e2f", "bugs": { "url": "https://github.com/isaacs/init-package-json/issues" }, "homepage": "https://github.com/isaacs/init-package-json", - "_id": "init-package-json@1.0.0", - "_shasum": "8985a99ef11589695d6d3a5d03300b1eab0dd47a", - "_from": "init-package-json@1.0.0", - "_npmVersion": "1.4.21", + "_id": "init-package-json@1.0.1", + "_shasum": "c01b08cc90504ebc448d57b468e66fc08293e8a8", + "_from": "init-package-json@>=1.0.0-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -57,9 +57,9 @@ } ], "dist": { - "shasum": "8985a99ef11589695d6d3a5d03300b1eab0dd47a", - "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.0.0.tgz" + "shasum": "c01b08cc90504ebc448d57b468e66fc08293e8a8", + "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.0.1.tgz" } diff --git a/deps/npm/node_modules/lockfile/package.json b/deps/npm/node_modules/lockfile/package.json index bf4a90dcfb..27bd23777d 100644 --- a/deps/npm/node_modules/lockfile/package.json +++ b/deps/npm/node_modules/lockfile/package.json @@ -31,8 +31,6 @@ }, "license": "BSD", "description": "A very polite lock file utility, which endeavors to not litter, and to wait patiently for others.", - "readme": "# lockfile\n\nA very polite lock file utility, which endeavors to not litter, and to\nwait patiently for others.\n\n## Usage\n\n```javascript\nvar lockFile = require('lockfile')\n\n// opts is optional, and defaults to {}\nlockFile.lock('some-file.lock', opts, function (er) {\n // if the er happens, then it failed to acquire a lock.\n // if there was not an error, then the file was created,\n // and won't be deleted until we unlock it.\n\n // do my stuff, free of interruptions\n // then, some time later, do:\n lockFile.unlock('some-file.lock', function (er) {\n // er means that an error happened, and is probably bad.\n })\n})\n```\n\n## Methods\n\nSync methods return the value/throw the error, others don't. Standard\nnode fs stuff.\n\nAll known locks are removed when the process exits. Of course, it's\npossible for certain types of failures to cause this to fail, but a best\neffort is made to not be a litterbug.\n\n### lockFile.lock(path, [opts], cb)\n\nAcquire a file lock on the specified path\n\n### lockFile.lockSync(path, [opts])\n\nAcquire a file lock on the specified path\n\n### lockFile.unlock(path, cb)\n\nClose and unlink the lockfile.\n\n### lockFile.unlockSync(path)\n\nClose and unlink the lockfile.\n\n### lockFile.check(path, [opts], cb)\n\nCheck if the lockfile is locked and not stale.\n\nReturns boolean.\n\n### lockFile.checkSync(path, [opts], cb)\n\nCheck if the lockfile is locked and not stale.\n\nCallback is called with `cb(error, isLocked)`.\n\n## Options\n\n### opts.wait\n\nA number of milliseconds to wait for locks to expire before giving up.\nOnly used by lockFile.lock. Poll for `opts.wait` ms. If the lock is\nnot cleared by the time the wait expires, then it returns with the\noriginal error.\n\n### opts.pollPeriod\n\nWhen using `opts.wait`, this is the period in ms in which it polls to\ncheck if the lock has expired. Defaults to `100`.\n\n### opts.stale\n\nA number of milliseconds before locks are considered to have expired.\n\n### opts.retries\n\nUsed by lock and lockSync. Retry `n` number of times before giving up.\n\n### opts.retryWait\n\nUsed by lock. Wait `n` milliseconds before retrying.\n", - "readmeFilename": "README.md", "gitHead": "9590c6f02521eb1bb154ddc3ca9a7e84ce770c45", "bugs": { "url": "https://github.com/isaacs/lockfile/issues" @@ -40,5 +38,26 @@ "homepage": "https://github.com/isaacs/lockfile", "_id": "lockfile@1.0.0", "_shasum": "b3a7609dda6012060083bacb0ab0ecbca58e9203", - "_from": "lockfile@latest" + "_from": "lockfile@1.0.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "trevorburnham", + "email": "trevorburnham@gmail.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "b3a7609dda6012060083bacb0ab0ecbca58e9203", + "tarball": "http://registry.npmjs.org/lockfile/-/lockfile-1.0.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 8ee9869518..2e2e47c7a3 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -10,7 +10,7 @@ "bindings", "gyp" ], - "version": "1.0.1", + "version": "1.0.2", "installVersion": 9, "author": { "name": "Nathan Rajlich", @@ -37,22 +37,45 @@ "osenv": "0", "request": "2", "rimraf": "2", - "semver": "2.x || 3.x", + "semver": "2.x || 3.x || 4", "tar": "^1.0.0", "which": "1" }, "engines": { "node": ">= 0.8.0" }, - "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js. It bundles the [gyp](https://code.google.com/p/gyp/)\nproject used by the Chromium team and takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.8`, `0.9`, `0.10`, ..., `1.0`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)\n * `make`\n * A proper C/C++ compiler toolchain, like GCC\n * On Windows:\n * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported)\n * Windows XP/Vista/7:\n * Microsoft Visual Studio C++ 2010 ([Express][msvc2010] version works well)\n * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk]\n * If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.\n * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]\n * Windows 7/8:\n * Microsoft Visual Studio C++ 2012 for Windows Desktop ([Express][msvc2012] version works well)\n\nIf you have multiple Python versions installed, you can identify which Python\nversion `node-gyp` uses by setting the '--python' variable:\n\n``` bash\n$ node-gyp --python /path/to/python2.7\n```\n\nIf `node-gyp` is called by way of `npm` *and* you have multiple versions of\nPython installed, then you can set `npm`'s 'python' config key to the appropriate\nvalue:\n\n``` bash\n$ npm config set python /path/to/executable/python2.7\n```\n\nNote that OS X is just a flavour of Unix and so needs `python`, `make`, and C/C++.\nAn easy way to obtain these is to install XCode from Apple,\nand then use it to install the command line tools (under Preferences -> Downloads).\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to processs. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running the either `configure` or `build` command.\n\n\nThe \"binding.gyp\" file\n----------------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. This file gets placed in the root of\nyour package, alongside the `package.json` file.\n\nA barebones `gyp` file appropriate for building a node addon looks like:\n\n``` python\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources for writing `gyp` files:\n\n * [\"Hello World\" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)\n * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)\n * [*\"binding.gyp\" files out in the wild* wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n| **Command** | **Description**\n|:--------------|:---------------------------------------------------------------\n| `build` | Invokes `make`/`msbuild.exe` and builds the native addon\n| `clean` | Removes any the `build` dir if it exists\n| `configure` | Generates project build files for the current platform\n| `rebuild` | Runs \"clean\", \"configure\" and \"build\" all in a row\n| `install` | Installs node development header files for the given version\n| `list` | Lists the currently installed node development file versions\n| `remove` | Removes the node development header files for the given version\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[windows-python]: http://www.python.org/getit/windows\n[windows-python-v2.7.3]: http://www.python.org/download/releases/2.7.3#download\n[msvc2010]: http://go.microsoft.com/?linkid=9709949\n[msvc2012]: http://go.microsoft.com/?linkid=9816758\n[win7sdk]: http://www.microsoft.com/en-us/download/details.aspx?id=8279\n[compiler update for the Windows SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=4422\n", - "readmeFilename": "README.md", - "gitHead": "b2abd70377c356483c98509b14a01d71f1eaa17f", + "gitHead": "1e399b471945b35f3bfbca4a10fba31a6739b5db", "bugs": { "url": "https://github.com/TooTallNate/node-gyp/issues" }, "homepage": "https://github.com/TooTallNate/node-gyp", - "_id": "node-gyp@1.0.1", + "_id": "node-gyp@1.0.2", "scripts": {}, - "_shasum": "d5e364145ff10b259be9986855c83b5a76a2d975", - "_from": "node-gyp@latest" + "_shasum": "b0bb6d2d762271408dd904853e7aa3000ed2eb57", + "_from": "node-gyp@>=1.0.1-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "TooTallNate", + "email": "nathan@tootallnate.net" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "b0bb6d2d762271408dd904853e7aa3000ed2eb57", + "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-1.0.2.tgz" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.npmignore b/deps/npm/node_modules/normalize-package-data/.npmignore index 096746c148..096746c148 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.npmignore +++ b/deps/npm/node_modules/normalize-package-data/.npmignore diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml b/deps/npm/node_modules/normalize-package-data/.travis.yml index 6e5919de39..6e5919de39 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml +++ b/deps/npm/node_modules/normalize-package-data/.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/AUTHORS b/deps/npm/node_modules/normalize-package-data/AUTHORS index 10860f72bc..10860f72bc 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/AUTHORS +++ b/deps/npm/node_modules/normalize-package-data/AUTHORS diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/LICENSE b/deps/npm/node_modules/normalize-package-data/LICENSE index 9cea2e3c96..9cea2e3c96 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/LICENSE +++ b/deps/npm/node_modules/normalize-package-data/LICENSE diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/README.md b/deps/npm/node_modules/normalize-package-data/README.md index bdcc8b04db..bdcc8b04db 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/README.md +++ b/deps/npm/node_modules/normalize-package-data/README.md diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/core_module_names.json b/deps/npm/node_modules/normalize-package-data/lib/core_module_names.json index 637c2f0734..637c2f0734 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/core_module_names.json +++ b/deps/npm/node_modules/normalize-package-data/lib/core_module_names.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/extract_description.js b/deps/npm/node_modules/normalize-package-data/lib/extract_description.js index 83f10aa0a7..83f10aa0a7 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/extract_description.js +++ b/deps/npm/node_modules/normalize-package-data/lib/extract_description.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js b/deps/npm/node_modules/normalize-package-data/lib/fixer.js index 72836002fe..72836002fe 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js +++ b/deps/npm/node_modules/normalize-package-data/lib/fixer.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/make_warning.js b/deps/npm/node_modules/normalize-package-data/lib/make_warning.js index 0f3aad5f55..0f3aad5f55 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/make_warning.js +++ b/deps/npm/node_modules/normalize-package-data/lib/make_warning.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js b/deps/npm/node_modules/normalize-package-data/lib/normalize.js index 7e6beefdae..7e6beefdae 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js +++ b/deps/npm/node_modules/normalize-package-data/lib/normalize.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/safe_format.js b/deps/npm/node_modules/normalize-package-data/lib/safe_format.js index 08517f1421..08517f1421 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/safe_format.js +++ b/deps/npm/node_modules/normalize-package-data/lib/safe_format.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json b/deps/npm/node_modules/normalize-package-data/lib/typos.json index 73590c0a26..73590c0a26 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json +++ b/deps/npm/node_modules/normalize-package-data/lib/typos.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/warning_messages.json b/deps/npm/node_modules/normalize-package-data/lib/warning_messages.json index 9605f5cc64..9605f5cc64 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/warning_messages.json +++ b/deps/npm/node_modules/normalize-package-data/lib/warning_messages.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json index 084068ead7..0471bcd6e0 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/normalize-package-data/package.json @@ -1,6 +1,6 @@ { "name": "normalize-package-data", - "version": "1.0.1", + "version": "1.0.2", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -17,7 +17,7 @@ "dependencies": { "github-url-from-git": "^1.3.0", "github-url-from-username-repo": "^1.0.0", - "semver": "2 || 3" + "semver": "2 || 3 || 4" }, "devDependencies": { "tap": "~0.2.5", @@ -38,18 +38,18 @@ "email": "rok@kowalski.gd" } ], - "gitHead": "d260644f514672cc84f1cc471024679cccc4fd65", + "gitHead": "05fafb91466ac634fa7d591d0796d64b0b432dc0", "bugs": { "url": "https://github.com/meryn/normalize-package-data/issues" }, "homepage": "https://github.com/meryn/normalize-package-data", - "_id": "normalize-package-data@1.0.1", - "_shasum": "2a4b5200c82cc47bb91c8c9cf47d645499d200bf", - "_from": "normalize-package-data@^1.0.0", - "_npmVersion": "2.0.0-beta.0", + "_id": "normalize-package-data@1.0.2", + "_shasum": "32a902ad3cad3286f1106b9b9550062f44ee2118", + "_from": "normalize-package-data@>=1.0.1-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" + "name": "isaacs", + "email": "i@izs.me" }, "maintainers": [ { @@ -66,9 +66,9 @@ } ], "dist": { - "shasum": "2a4b5200c82cc47bb91c8c9cf47d645499d200bf", - "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.1.tgz" + "shasum": "32a902ad3cad3286f1106b9b9550062f44ee2118", + "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.2.tgz" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/basic.js b/deps/npm/node_modules/normalize-package-data/test/basic.js index 12c403ec71..12c403ec71 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/basic.js +++ b/deps/npm/node_modules/normalize-package-data/test/basic.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/consistency.js b/deps/npm/node_modules/normalize-package-data/test/consistency.js index 4082be25cc..4082be25cc 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/consistency.js +++ b/deps/npm/node_modules/normalize-package-data/test/consistency.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/dependencies.js b/deps/npm/node_modules/normalize-package-data/test/dependencies.js index dda24dc4f9..dda24dc4f9 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/dependencies.js +++ b/deps/npm/node_modules/normalize-package-data/test/dependencies.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/async.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/async.json index 5e652a6c6f..5e652a6c6f 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/async.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/async.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/bcrypt.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json index 56e6d81b3d..56e6d81b3d 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/bcrypt.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/coffee-script.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json index a0b60a9d38..a0b60a9d38 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/coffee-script.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/http-server.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json index 90c28863a2..90c28863a2 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/http-server.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/movefile.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json index 5933875702..5933875702 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/movefile.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/no-description.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json index 9ea70b6bf8..9ea70b6bf8 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/no-description.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/node-module_exist.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json index acc0538252..acc0538252 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/node-module_exist.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/npm.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json index 2262b3139d..2262b3139d 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/npm.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/read-package-json.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/read-package-json.json index f4a2b96f47..f4a2b96f47 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/read-package-json.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/read-package-json.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/request.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/request.json index 24189a551a..24189a551a 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/request.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/request.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/underscore.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json index bfc8b3d26a..bfc8b3d26a 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/underscore.json +++ b/deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/github-urls.js b/deps/npm/node_modules/normalize-package-data/test/github-urls.js index da78160a00..da78160a00 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/github-urls.js +++ b/deps/npm/node_modules/normalize-package-data/test/github-urls.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js b/deps/npm/node_modules/normalize-package-data/test/normalize.js index b35eed7659..b35eed7659 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js +++ b/deps/npm/node_modules/normalize-package-data/test/normalize.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/scoped.js b/deps/npm/node_modules/normalize-package-data/test/scoped.js index 31bbf4f7fc..31bbf4f7fc 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/scoped.js +++ b/deps/npm/node_modules/normalize-package-data/test/scoped.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/strict.js b/deps/npm/node_modules/normalize-package-data/test/strict.js index 40e09dcf2f..40e09dcf2f 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/strict.js +++ b/deps/npm/node_modules/normalize-package-data/test/strict.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js b/deps/npm/node_modules/normalize-package-data/test/typo.js index eda75545e9..eda75545e9 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js +++ b/deps/npm/node_modules/normalize-package-data/test/typo.js diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index 9457df0b5c..06ca052e41 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,11 +1,11 @@ { "name": "npm-install-checks", - "version": "1.0.2", + "version": "1.0.4", "description": "checks that npm runs during the installation of a module", "main": "index.js", "dependencies": { "npmlog": "0.1", - "semver": "^2.3.0" + "semver": "^2.3.0 || 3.x || 4" }, "devDependencies": { "tap": "~0.4.8", @@ -32,10 +32,29 @@ "bugs": { "url": "https://github.com/npm/npm-install-checks/issues" }, - "readme": "# npm-install-checks\n\nA package that contains checks that npm runs during the installation.\n\n## API\n\n### .checkEngine(target, npmVer, nodeVer, force, strict, cb)\nCheck if node/npm version is supported by the package.\n\nError type: `ENOTSUP`\n\n### .checkPlatform(target, force, cb)\nCheck if OS/Arch is supported by the package.\n\nError type: `EBADPLATFORM`\n\n### .checkCycle(target, ancestors, cb)\nCheck for cyclic dependencies.\n\nError type: `ECYCLE`\n\n### .checkGit(folder, cb)\nCheck if a folder is a .git folder.\n\nError type: `EISGIT`\n", - "readmeFilename": "README.md", - "gitHead": "056ade7c5e3a6b3c720ca6a743c1b99a0705d29e", - "_id": "npm-install-checks@1.0.2", - "_shasum": "ebba769753fc8551308333ef411920743a6809f6", - "_from": "npm-install-checks@latest" + "gitHead": "05944f95860b0ac3769667551c4b7aa3d3fcdc32", + "_id": "npm-install-checks@1.0.4", + "_shasum": "9757c6f9d4d493c2489465da6d07a8ed416d44c8", + "_from": "npm-install-checks@>=1.0.2-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "9757c6f9d4d493c2489465da6d07a8ed416d44c8", + "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.4.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.4.tgz" } diff --git a/deps/npm/node_modules/npm-package-arg/LICENSE b/deps/npm/node_modules/npm-package-arg/LICENSE new file mode 100644 index 0000000000..05eeeb88c2 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-package-arg/README.md b/deps/npm/node_modules/npm-package-arg/README.md new file mode 100644 index 0000000000..602277a378 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/README.md @@ -0,0 +1,55 @@ +# npm-package-arg + +Parse the things that can be arguments to `npm install` + +Takes an argument like `foo@1.2`, or `foo@user/foo`, or +`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`, and +figures out what type of thing it is. + +## USAGE + +```javascript +var assert = require("assert") +var npa = require("npm-package-arg") + +// Pass in the descriptor, and it'll return an object +var parsed = npa("foo@1.2") + +// Returns an object like: +// { +// name: "foo", // The bit in front of the @ +// type: "range", // the type of descriptor this is +// spec: "1.2" // the specifier for this descriptor +// } + +// Completely unreasonable invalid garbage throws an error +// Make sure you wrap this in a try/catch if you have not +// already sanitized the inputs! +assert.throws(function() { + npa("this is not \0 a valid package name or url") +}) +``` + +For more examples, see the test file. + +## Result Objects + +The objects that are returned by npm-package-arg contain the following +fields: + +* `name` - If known, the `name` field expected in the resulting pkg. +* `type` - One of the following strings: + * `git` - A git repo + * `github` - A github shorthand, like `user/project` + * `tag` - A tagged version, like `"foo@latest"` + * `version` - A specific version number, like `"foo@1.2.3"` + * `range` - A version range, like `"foo@2.x"` + * `local` - A local file or folder path + * `remote` - An http url (presumably to a tgz) +* `spec` - The "thing". URL, the range, git repo, etc. +* `raw` - The original un-modified string that was provided. +* `rawSpec` - The part after the `name@...`, as it was originally + provided. +* `scope` - If a name is something like `@org/module` then the `scope` + field will be set to `org`. If it doesn't have a scoped name, then + scope is `null`. diff --git a/deps/npm/node_modules/npm-package-arg/npa.js b/deps/npm/node_modules/npm-package-arg/npa.js new file mode 100644 index 0000000000..8333c75f44 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/npa.js @@ -0,0 +1,187 @@ +var url = require("url") +var assert = require("assert") +var util = require("util") +var semver = require("semver") +var path = require("path") + +module.exports = npa + +var isWindows = process.platform === "win32" || global.FAKE_WINDOWS +var slashRe = isWindows ? /\\|\// : /\// + +var parseName = /^(?:@([^\/]+?)\/)?([^\/]+?)$/ +var nameAt = /^(@([^\/]+?)\/)?([^\/]+?)@/ +var debug = util.debuglog ? util.debuglog("npa") + : /\bnpa\b/i.test(process.env.NODE_DEBUG || "") + ? function () { + console.error("NPA: " + util.format.apply(util, arguments).split("\n").join("\nNPA: ")) + } : function () {} + +function validName (name) { + if (!name) { + debug("not a name %j", name) + return false + } + var n = name.trim() + if (!n || n.charAt(0) === "." + || !n.match(/^[a-zA-Z0-9]/) + || n.match(/[\/\(\)&\?#\|<>@:%\s\\\*'"!~`]/) + || n.toLowerCase() === "node_modules" + || n !== encodeURIComponent(n) + || n.toLowerCase() === "favicon.ico") { + debug("not a valid name %j", name) + return false + } + return n +} + +function npa (arg) { + assert.equal(typeof arg, "string") + arg = arg.trim() + + var res = new Result + res.raw = arg + res.scope = null + + // See if it's something like foo@... + var nameparse = arg.match(nameAt) + debug("nameparse", nameparse) + if (nameparse && validName(nameparse[3]) && + (!nameparse[2] || validName(nameparse[2]))) { + res.name = (nameparse[1] || "") + nameparse[3] + if (nameparse[2]) + res.scope = "@" + nameparse[2] + arg = arg.substr(nameparse[0].length) + } else { + res.name = null + } + + res.rawSpec = arg + res.spec = arg + + var urlparse = url.parse(arg) + debug("urlparse", urlparse) + + // windows paths look like urls + // don't be fooled! + if (isWindows && urlparse && urlparse.protocol && + urlparse.protocol.match(/^[a-zA-Z]:$/)) { + debug("windows url-ish local path", urlparse) + urlparse = {} + } + + if (urlparse.protocol) { + return parseUrl(res, arg, urlparse) + } + + // parse git stuff + // parse tag/range/local/remote + + if (maybeGitHubShorthand(arg)) { + res.type = "github" + res.spec = arg + return res + } + + // at this point, it's not a url, and not github + // If it's a valid name, and doesn't already have a name, then assume + // $name@"" range + // + // if it's got / chars in it, then assume that it's local. + + if (res.name) { + var version = semver.valid(arg, true) + var range = semver.validRange(arg, true) + // foo@... + if (version) { + res.spec = version + res.type = "version" + } else if (range) { + res.spec = range + res.type = "range" + } else if (slashRe.test(arg)) { + parseLocal(res, arg) + } else { + res.type = "tag" + res.spec = arg + } + } else { + var p = arg.match(parseName) + if (p && validName(p[2]) && + (!p[1] || validName(p[1]))) { + res.type = "range" + res.spec = "*" + res.rawSpec = "" + res.name = arg + if (p[1]) + res.scope = "@" + p[1] + } else { + parseLocal(res, arg) + } + } + + return res +} + +function parseLocal (res, arg) { + // turns out nearly every character is allowed in fs paths + if (/\0/.test(arg)) { + throw new Error("Invalid Path: " + JSON.stringify(arg)) + } + res.type = "local" + res.spec = path.resolve(arg) +} + +function maybeGitHubShorthand (arg) { + // Note: This does not fully test the git ref format. + // See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + return /^[^@%\/\s\.-][^@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(arg) +} + +function parseUrl (res, arg, urlparse) { + // check the protocol, and then see if it's git or not + switch (urlparse.protocol) { + case "git:": + case "git+http:": + case "git+https:": + case "git+rsync:": + case "git+ftp:": + case "git+ssh:": + case "git+file:": + res.type = 'git' + res.spec = arg.replace(/^git\+/, '') + break + + case 'http:': + case 'https:': + res.type = 'remote' + res.spec = arg + break + + case 'file:': + res.type = 'local' + res.spec = urlparse.pathname + break; + + default: + throw new Error('Unsupported URL Type: ' + arg) + break + } + + return res +} + + +function Result () { + if (!(this instanceof Result)) return new Result +} +Result.prototype.name = null +Result.prototype.type = null +Result.prototype.spec = null +Result.prototype.raw = null diff --git a/deps/npm/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/npm-package-arg/package.json new file mode 100644 index 0000000000..45604cb086 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -0,0 +1,38 @@ +{ + "name": "npm-package-arg", + "version": "2.1.2", + "description": "Parse the things that can be arguments to `npm install`", + "main": "npa.js", + "directories": { + "test": "test" + }, + "dependencies": { + "semver": "^2.3.0 || 3.x || 4" + }, + "devDependencies": { + "tap": "^0.4.9" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-package-arg" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/npm-package-arg/issues" + }, + "homepage": "https://github.com/npm/npm-package-arg", + "readme": "# npm-package-arg\n\nParse the things that can be arguments to `npm install`\n\nTakes an argument like `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`, and\nfigures out what type of thing it is.\n\n## USAGE\n\n```javascript\nvar assert = require(\"assert\")\nvar npa = require(\"npm-package-arg\")\n\n// Pass in the descriptor, and it'll return an object\nvar parsed = npa(\"foo@1.2\")\n\n// Returns an object like:\n// {\n// name: \"foo\", // The bit in front of the @\n// type: \"range\", // the type of descriptor this is\n// spec: \"1.2\" // the specifier for this descriptor\n// }\n\n// Completely unreasonable invalid garbage throws an error\n// Make sure you wrap this in a try/catch if you have not\n// already sanitized the inputs!\nassert.throws(function() {\n npa(\"this is not \\0 a valid package name or url\")\n})\n```\n\nFor more examples, see the test file.\n\n## Result Objects\n\nThe objects that are returned by npm-package-arg contain the following\nfields:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n * `git` - A git repo\n * `github` - A github shorthand, like `user/project`\n * `tag` - A tagged version, like `\"foo@latest\"`\n * `version` - A specific version number, like `\"foo@1.2.3\"`\n * `range` - A version range, like `\"foo@2.x\"`\n * `local` - A local file or folder path\n * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\". URL, the range, git repo, etc.\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n provided.\n* `scope` - If a name is something like `@org/module` then the `scope`\n field will be set to `org`. If it doesn't have a scoped name, then\n scope is `null`.\n", + "readmeFilename": "README.md", + "gitHead": "ebb3c5ee4c362aca5722cf805adf871f86b5c4f2", + "_id": "npm-package-arg@2.1.2", + "_shasum": "14f9be32e203a77977dd8120cf749d0db8c93761", + "_from": "npm-package-arg@>=2.1.2 <2.2.0" +} diff --git a/deps/npm/node_modules/npm-package-arg/test/basic.js b/deps/npm/node_modules/npm-package-arg/test/basic.js new file mode 100644 index 0000000000..3bc984e9d7 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/test/basic.js @@ -0,0 +1,203 @@ +var npa = require("../npa.js") +var path = require("path") + +require("tap").test("basic", function (t) { + t.setMaxListeners(999) + + var tests = { + "foo@1.2": { + name: "foo", + type: "range", + spec: ">=1.2.0-0 <1.3.0-0", + raw: "foo@1.2", + rawSpec: "1.2" + }, + + "@foo/bar": { + raw: "@foo/bar", + name: "@foo/bar", + scope: "@foo", + rawSpec: "", + spec: "*", + type: "range" + }, + + "@foo/bar@": { + raw: "@foo/bar@", + name: "@foo/bar", + scope: "@foo", + rawSpec: "", + spec: "*", + type: "range" + }, + + "@foo/bar@baz": { + raw: "@foo/bar@baz", + name: "@foo/bar", + scope: "@foo", + rawSpec: "baz", + spec: "baz", + type: "tag" + }, + + "@f fo o al/ a d s ;f ": { + raw: "@f fo o al/ a d s ;f", + name: null, + rawSpec: "@f fo o al/ a d s ;f", + spec: path.resolve("@f fo o al/ a d s ;f"), + type: "local" + }, + + "foo@1.2.3": { + name: "foo", + type: "version", + spec: "1.2.3", + raw: "foo@1.2.3" + }, + + "foo@=v1.2.3": { + name: "foo", + type: "version", + spec: "1.2.3", + raw: "foo@=v1.2.3", + rawSpec: "=v1.2.3" + }, + + "git+ssh://git@github.com/user/foo#1.2.3": { + name: null, + type: "git", + spec: "ssh://git@github.com/user/foo#1.2.3", + raw: "git+ssh://git@github.com/user/foo#1.2.3" + }, + + "git+file://path/to/repo#1.2.3": { + name: null, + type: "git", + spec: "file://path/to/repo#1.2.3", + raw: "git+file://path/to/repo#1.2.3" + }, + + "git://github.com/user/foo": { + name: null, + type: "git", + spec: "git://github.com/user/foo", + raw: "git://github.com/user/foo" + }, + + "@foo/bar@git+ssh://github.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + spec: "ssh://github.com/user/foo", + rawSpec: "git+ssh://github.com/user/foo", + raw: "@foo/bar@git+ssh://github.com/user/foo" + }, + + "/path/to/foo": { + name: null, + type: "local", + spec: "/path/to/foo", + raw: "/path/to/foo" + }, + + "file:path/to/foo": { + name: null, + type: "local", + spec: "path/to/foo", + raw: "file:path/to/foo" + }, + + "file:~/path/to/foo": { + name: null, + type: "local", + spec: "~/path/to/foo", + raw: "file:~/path/to/foo" + }, + + "file:../path/to/foo": { + name: null, + type: "local", + spec: "../path/to/foo", + raw: "file:../path/to/foo" + }, + + "file:///path/to/foo": { + name: null, + type: "local", + spec: "/path/to/foo", + raw: "file:///path/to/foo" + }, + + "https://server.com/foo.tgz": { + name: null, + type: "remote", + spec: "https://server.com/foo.tgz", + raw: "https://server.com/foo.tgz" + }, + + "user/foo-js": { + name: null, + type: "github", + spec: "user/foo-js", + raw: "user/foo-js" + }, + + "user/foo-js#bar/baz": { + name: null, + type: "github", + spec: "user/foo-js#bar/baz", + raw: "user/foo-js#bar/baz" + }, + + "user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "github", + spec: "user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "user/foo-js#bar/baz/bin": { + name: null, + type: "github", + spec: "user/foo-js#bar/baz/bin", + raw: "user/foo-js#bar/baz/bin" + }, + + "foo@user/foo-js": { + name: "foo", + type: "github", + spec: "user/foo-js", + raw: "foo@user/foo-js" + }, + + "foo@latest": { + name: "foo", + type: "tag", + spec: "latest", + raw: "foo@latest" + }, + + "foo": { + name: "foo", + type: "range", + spec: "*", + raw: "foo" + } + } + + Object.keys(tests).forEach(function (arg) { + var res = npa(arg) + t.type(res, "Result") + t.has(res, tests[arg]) + }) + + // Completely unreasonable invalid garbage throws an error + t.throws(function() { + npa("this is not a \0 valid package name or url") + }) + + t.throws(function() { + npa("gopher://yea right") + }, "Unsupported URL Type: gopher://yea right") + + t.end() +}) diff --git a/deps/npm/node_modules/npm-package-arg/test/windows.js b/deps/npm/node_modules/npm-package-arg/test/windows.js new file mode 100644 index 0000000000..51629fe075 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/test/windows.js @@ -0,0 +1,41 @@ +global.FAKE_WINDOWS = true + +var npa = require("../npa.js") +var test = require("tap").test +var path = require("path") + +var cases = { + "C:\\x\\y\\z": { + raw: 'C:\\x\\y\\z', + scope: null, + name: null, + rawSpec: 'C:\\x\\y\\z', + spec: path.resolve('C:\\x\\y\\z'), + type: 'local' + }, + "foo@C:\\x\\y\\z": { + raw: 'foo@C:\\x\\y\\z', + scope: null, + name: 'foo', + rawSpec: 'C:\\x\\y\\z', + spec: path.resolve('C:\\x\\y\\z'), + type: 'local' + }, + "foo@/foo/bar/baz": { + raw: 'foo@/foo/bar/baz', + scope: null, + name: 'foo', + rawSpec: '/foo/bar/baz', + spec: path.resolve('/foo/bar/baz'), + type: 'local' + } +} + +test("parse a windows path", function (t) { + Object.keys(cases).forEach(function (c) { + var expect = cases[c] + var actual = npa(c) + t.same(actual, expect, c) + }) + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/.npmignore b/deps/npm/node_modules/npm-registry-client/.npmignore index 187ab67953..bea2db6203 100644 --- a/deps/npm/node_modules/npm-registry-client/.npmignore +++ b/deps/npm/node_modules/npm-registry-client/.npmignore @@ -1,3 +1,5 @@ test/fixtures/cache node_modules npm-debug.log +.eslintrc +.jshintrc diff --git a/deps/npm/node_modules/npm-registry-client/lib/adduser.js b/deps/npm/node_modules/npm-registry-client/lib/adduser.js index d1fcac8e91..e449c25808 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js +++ b/deps/npm/node_modules/npm-registry-client/lib/adduser.js @@ -29,15 +29,13 @@ function adduser (base, username, password, email, cb) { // pluck off any other username/password/token. it needs to be the // same as the user we're becoming now. replace them on error. - var pre = { username: this.conf.get('username') - , password: this.conf.get('_password') - , auth: this.conf.get('_auth') + var c = this.conf.getCredentialsByURI(base) + var pre = { username: c.username + , password: c.password + , email: c.email , token: this.conf.get('_token') } this.conf.del('_token') - this.conf.del('username') - this.conf.del('_auth') - this.conf.del('_password') if (this.couchLogin) { this.couchLogin.token = null } @@ -61,13 +59,15 @@ function adduser (base, username, password, email, cb) { , function (error, data, json, response) { // if it worked, then we just created a new user, and all is well. // but if we're updating a current record, then it'll 409 first - if (error && !this.conf.get('_auth')) { + var c = this.conf.getCredentialsByURI(base) + if (error && !c.auth) { // must be trying to re-auth on a new machine. // use this info as auth - var b = new Buffer(username + ":" + password) - this.conf.set('_auth', b.toString("base64")) - this.conf.set('username', username) - this.conf.set('_password', password) + this.conf.setCredentialsByURI(base, { + username : username, + password : password, + email : email + }) } if (!error || !response || response.statusCode !== 409) { @@ -94,39 +94,43 @@ function adduser (base, username, password, email, cb) { , cb) }.bind(this)) }.bind(this)) -} -function done (cb, pre) { - return function (error, data, json, response) { - if (!error && (!response || response.statusCode === 201)) { - return cb(error, data, json, response) - } - - // there was some kind of error, re-instate previous auth/token/etc. - this.conf.set('_token', pre.token) - if (this.couchLogin) { - this.couchLogin.token = pre.token - if (this.couchLogin.tokenSet) { - this.couchLogin.tokenSet(pre.token) + function done (cb, pre) { + return function (error, data, json, response) { + if (!error && (!response || response.statusCode === 201)) { + return cb(error, data, json, response) + } + + // there was some kind of error, re-instate previous auth/token/etc. + this.conf.set('_token', pre.token) + if (this.couchLogin) { + this.couchLogin.token = pre.token + if (this.couchLogin.tokenSet) { + this.couchLogin.tokenSet(pre.token) + } + } + this.conf.setCredentialsByURI(base, { + username : pre.username, + password : pre.password, + email : pre.email + }) + + this.log.verbose("adduser", "back", [error, data, json]) + if (!error) { + error = new Error( + (response && response.statusCode || "") + " " + + "Could not create user\n" + JSON.stringify(data) + ) } - } - this.conf.set('username', pre.username) - this.conf.set('_password', pre.password) - this.conf.set('_auth', pre.auth) - - this.log.verbose("adduser", "back", [error, data, json]) - if (!error) { - error = new Error( (response && response.statusCode || "") + " "+ - "Could not create user\n"+JSON.stringify(data)) - } - if (response - && (response.statusCode === 401 || response.statusCode === 403)) { - this.log.warn("adduser", "Incorrect username or password\n" - +"You can reset your account by visiting:\n" - +"\n" - +" https://npmjs.org/forgot\n") - } - - return cb(error) - }.bind(this) + + if (response && (response.statusCode === 401 || response.statusCode === 403)) { + this.log.warn("adduser", "Incorrect username or password\n" + + "You can reset your account by visiting:\n" + + "\n" + + " https://npmjs.org/forgot\n") + } + + return cb(error) + }.bind(this) + } } diff --git a/deps/npm/node_modules/npm-registry-client/lib/attempt.js b/deps/npm/node_modules/npm-registry-client/lib/attempt.js new file mode 100644 index 0000000000..0794fdc3bf --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/attempt.js @@ -0,0 +1,22 @@ +var retry = require("retry") + +module.exports = attempt + +function attempt(cb) { + // Tuned to spread 3 attempts over about a minute. + // See formula at <https://github.com/tim-kos/node-retry>. + var operation = retry.operation({ + retries : this.conf.get("fetch-retries") || 2, + factor : this.conf.get("fetch-retry-factor"), + minTimeout : this.conf.get("fetch-retry-mintimeout") || 10000, + maxTimeout : this.conf.get("fetch-retry-maxtimeout") || 60000 + }) + + var client = this + operation.attempt(function (currentAttempt) { + client.log.info("attempt", "registry request try #"+currentAttempt+ + " at "+(new Date()).toLocaleTimeString()) + + cb(operation) + }) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/authify.js b/deps/npm/node_modules/npm-registry-client/lib/authify.js new file mode 100644 index 0000000000..2b0c7a2a33 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/authify.js @@ -0,0 +1,27 @@ +var url = require("url") + +module.exports = authify + +function authify (authed, parsed, headers) { + var c = this.conf.getCredentialsByURI(url.format(parsed)) + + if (c && c.token) { + this.log.verbose("request", "using bearer token for auth") + headers.authorization = "Bearer " + c.token + + return null + } + + if (authed) { + if (c && c.username && c.password) { + var username = encodeURIComponent(c.username) + var password = encodeURIComponent(c.password) + parsed.auth = username + ":" + password + } + else { + return new Error( + "This request requires auth credentials. Run `npm login` and repeat the request." + ) + } + } +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js index 078968dd32..f5fd597047 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js @@ -4,7 +4,8 @@ var url = require("url") var semver = require("semver") function deprecate (uri, ver, message, cb) { - if (!this.conf.get('username')) { + var c = this.conf.getCredentialsByURI(uri) + if (!(c.token || c.auth)) { return cb(new Error("Must be logged in to deprecate a package")) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/fetch.js b/deps/npm/node_modules/npm-registry-client/lib/fetch.js new file mode 100644 index 0000000000..8dd6b28b07 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/fetch.js @@ -0,0 +1,85 @@ +var assert = require("assert") + , url = require("url") + +var request = require("request") + , once = require("once") + +module.exports = fetch + +function fetch (uri, headers, cb) { + assert(uri, "must pass resource to fetch") + assert(cb, "must pass callback") + + if (!headers) headers = {} + + cb = once(cb) + + var client = this + this.attempt(function (operation) { + makeRequest.call(client, uri, headers, function (er, req) { + if (er) return cb(er) + + req.on("error", function (er) { + if (operation.retry(er)) { + client.log.info("retry", "will retry, error on last attempt: " + er) + } + }) + + req.on("response", function (res) { + client.log.http("fetch", "" + res.statusCode, uri) + + var er + var statusCode = res && res.statusCode + if (statusCode === 200) { + // Work around bug in node v0.10.0 where the CryptoStream + // gets stuck and never starts reading again. + res.resume() + if (process.version === "v0.10.0") unstick(res) + + return cb(null, res) + } + // Only retry on 408, 5xx or no `response`. + else if (statusCode === 408) { + er = new Error("request timed out") + } + else if (statusCode >= 500) { + er = new Error("server error " + statusCode) + } + + if (er && operation.retry(er)) { + client.log.info("retry", "will retry, error on last attempt: " + er) + } + else { + cb(new Error("fetch failed with status code " + statusCode)) + } + }) + }) + }) +} + +function unstick(response) { + response.resume = function (orig) { return function() { + var ret = orig.apply(response, arguments) + if (response.socket.encrypted) response.socket.encrypted.read(0) + return ret + }}(response.resume) +} + +function makeRequest (remote, headers, cb) { + var parsed = url.parse(remote) + this.log.http("fetch", "GET", parsed.href) + + var er = this.authify(this.conf.get("always-auth"), parsed, headers) + if (er) return cb(er) + + var opts = this.initialize( + parsed, + "GET", + "application/x-tar", + headers + ) + // always want to follow redirects for fetch + opts.followRedirect = true + + cb(null, request(opts)) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/initialize.js b/deps/npm/node_modules/npm-registry-client/lib/initialize.js new file mode 100644 index 0000000000..b6e89ffe95 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/initialize.js @@ -0,0 +1,41 @@ +var crypto = require("crypto") + +var pkg = require("../package.json") + +module.exports = initialize + +function initialize (uri, method, accept, headers) { + if (!this.sessionToken) { + this.sessionToken = crypto.randomBytes(8).toString("hex") + this.log.verbose("request id", this.sessionToken) + } + + var strict = this.conf.get("strict-ssl") + if (strict === undefined) strict = true + + var p = this.conf.get("proxy") + var sp = this.conf.get("https-proxy") || p + + var opts = { + url : uri, + method : method, + headers : headers, + proxy : uri.protocol === "https:" ? sp : p, + localAddress : this.conf.get("local-address"), + strictSSL : strict, + cert : this.conf.get("cert"), + key : this.conf.get("key"), + ca : this.conf.get("ca") + } + + headers.version = this.version || pkg.version + headers.accept = accept + + if (this.refer) headers.referer = this.refer + + headers["npm-session"] = this.sessionToken + headers["user-agent"] = this.conf.get("user-agent") || + "node/" + process.version + + return opts +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js index 5504658d33..c3b2f3e1f2 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js @@ -5,20 +5,26 @@ var url = require("url") , semver = require("semver") , crypto = require("crypto") , fs = require("fs") + , fixNameField = require("normalize-package-data/lib/fixer.js").fixNameField -function publish (uri, data, tarball, cb) { - var email = this.conf.get('email') - var auth = this.conf.get('_auth') - var username = this.conf.get('username') +function escaped(name) { + return name.replace("/", "%2f") +} - if (!email || !auth || !username) { +function publish (uri, data, tarball, cb) { + var c = this.conf.getCredentialsByURI(uri) + if (!(c.token || (c.auth && c.username && c.email))) { var er = new Error("auth and email required for publishing") er.code = 'ENEEDAUTH' return cb(er) } - if (data.name !== encodeURIComponent(data.name)) - return cb(new Error('invalid name: must be url-safe')) + try { + fixNameField(data, true) + } + catch (er) { + return cb(er) + } var ver = semver.clean(data.version) if (!ver) @@ -30,12 +36,12 @@ function publish (uri, data, tarball, cb) { if (er) return cb(er) fs.readFile(tarball, function(er, tarbuffer) { if (er) return cb(er) - putFirst.call(self, uri, data, tarbuffer, s, username, email, cb) + putFirst.call(self, uri, data, tarbuffer, s, c, cb) }) }) } -function putFirst (registry, data, tarbuffer, stat, username, email, cb) { +function putFirst (registry, data, tarbuffer, stat, creds, cb) { // optimistically try to PUT all in one single atomic thing. // If 409, then GET and merge, try again. // If other error, then fail. @@ -47,15 +53,14 @@ function putFirst (registry, data, tarbuffer, stat, username, email, cb) { , "dist-tags" : {} , versions : {} , readme: data.readme || "" - , maintainers : - [ { name : username - , email : email - } - ] } + if (!creds.token) { + root.maintainers = [{name : creds.username, email : creds.email}] + data.maintainers = JSON.parse(JSON.stringify(root.maintainers)) + } + root.versions[ data.version ] = data - data.maintainers = JSON.parse(JSON.stringify(root.maintainers)) var tag = data.tag || this.conf.get('tag') || "latest" root["dist-tags"][tag] = data.version @@ -70,12 +75,12 @@ function putFirst (registry, data, tarbuffer, stat, username, email, cb) { root._attachments = {} root._attachments[ tbName ] = { - content_type: 'application/octet-stream', - data: tarbuffer.toString('base64'), - length: stat.size - }; + "content_type": "application/octet-stream", + "data": tarbuffer.toString("base64"), + "length": stat.size + } - var fixed = url.resolve(registry, data.name) + var fixed = url.resolve(registry, escaped(data.name)) this.request("PUT", fixed, { body : root }, function (er, parsed, json, res) { var r409 = "must supply latest _rev to update existing package" var r409b = "Document update conflict." @@ -94,8 +99,7 @@ function putFirst (registry, data, tarbuffer, stat, username, email, cb) { return cb(er, parsed, json, res) // let's see what versions are already published. - var getUrl = url.resolve(registry, data.name + "?write=true") - this.request("GET", getUrl, null, function (er, current) { + this.request("GET", fixed + "?write=true", null, function (er, current) { if (er) return cb(er) putNext.call(this, registry, data.version, root, current, cb) @@ -133,7 +137,7 @@ function putNext(registry, newVersion, root, current, cb) { // ignore these case 'maintainers': - break; + break // copy default: @@ -143,7 +147,8 @@ function putNext(registry, newVersion, root, current, cb) { var maint = JSON.parse(JSON.stringify(root.maintainers)) root.versions[newVersion].maintainers = maint - this.request("PUT", url.resolve(registry, root.name), { body : current }, cb) + var uri = url.resolve(registry, escaped(root.name)) + this.request("PUT", uri, { body : current }, cb) } function conflictError (pkgid, version) { 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 7a770a6d22..498b326f28 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -1,15 +1,13 @@ -module.exports = regRequest - -var url = require("url") +var assert = require("assert") + , url = require("url") , zlib = require("zlib") - , assert = require("assert") - , rm = require("rimraf") , Stream = require("stream").Stream + +var rm = require("rimraf") , request = require("request") - , retry = require("retry") - , crypto = require("crypto") - , pkg = require("../package.json") + , once = require("once") +module.exports = regRequest // npm: means // 1. https @@ -20,59 +18,43 @@ function regRequest (method, uri, options, cb_) { assert(cb_, "must pass callback") options = options || {} - var nofollow = (typeof options.follow === 'boolean' ? !options.follow : false) - var etag = options.etag - var what = options.body var parsed = url.parse(uri) - - var authThis = false - if (parsed.protocol === "npm") { - parsed.protocol = "https" - authThis = true - } - var where = parsed.pathname + var what = options.body + var follow = (typeof options.follow === "boolean" ? options.follow : true) + this.log.verbose("request", "on initialization, where is", where) + if (parsed.search) { where = where + parsed.search parsed.search = "" } parsed.pathname = "/" - this.log.verbose("request", "where is", where) - - var registry = url.format(parsed) - this.log.verbose("request", "registry", registry) - - if (!this.sessionToken) { - this.sessionToken = crypto.randomBytes(8).toString("hex") - this.log.verbose("request id", this.sessionToken) - } + this.log.verbose("request", "after pass 1, where is", where) // Since there are multiple places where an error could occur, // don't let the cb be called more than once. - var errState = null - function cb (er) { - if (errState) return - if (er) errState = er - cb_.apply(null, arguments) - } + var cb = once(cb_) if (where.match(/^\/?favicon.ico/)) { return cb(new Error("favicon.ico isn't a package, it's a picture.")) } var adduserChange = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)\/-rev/ - , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)/ - , nu = where.match(adduserNew) - , uc = where.match(adduserChange) - , alwaysAuth = this.conf.get('always-auth') - , isDel = method === "DELETE" - , isWrite = what || isDel - , authRequired = (authThis || alwaysAuth || isWrite) && !nu || uc || isDel + , isUserChange = where.match(adduserChange) + , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)$/ + , isNewUser = where.match(adduserNew) + , alwaysAuth = this.conf.get("always-auth") + , isDelete = method === "DELETE" + , isWrite = what || isDelete + + if (isUserChange && !isWrite) { + return cb(new Error("trying to change user document without writing(?!)")) + } // resolve to a full url on the registry if (!where.match(/^https?:\/\//)) { - this.log.verbose("url raw", where) + this.log.verbose("request", "url raw", where) var q = where.split("?") where = q.shift() @@ -84,56 +66,44 @@ function regRequest (method, uri, options, cb_) { if (p.match(/^org.couchdb.user/)) { return p.replace(/\//g, encodeURIComponent("/")) } - return encodeURIComponent(p) + return p }).join("/") if (q) where += "?" + q - this.log.verbose("url resolving", [registry, where]) - where = url.resolve(registry, where) - this.log.verbose("url resolved", where) - } - this.log.verbose("request", "where is", where) - var remote = url.parse(where) - , auth = this.conf.get('_auth') + var registry = url.format(parsed) + this.log.verbose("request", "resolving registry", [registry, where]) - if (authRequired && !auth) { - var un = this.conf.get('username') - var pw = this.conf.get('_password') - if (un && pw) - auth = new Buffer(un + ':' + pw).toString('base64') + where = url.resolve(registry, where) + this.log.verbose("request", "after pass 2, where is", where) } - if (authRequired && !auth) { - return cb(new Error( - "This request requires auth credentials. Run `npm login` and repeat the request.")) + var authed + // new users can *not* use auth, because they don't *have* auth yet + if (isNewUser) { + this.log.verbose("request", "new user, so can't send auth") + authed = false } - - if (auth && authRequired) { - // Escape any weird characters that might be in the auth string - // TODO(isaacs) Clean up this awful back and forth mess. - var remoteAuth = new Buffer(auth, "base64").toString("utf8") - remoteAuth = encodeURIComponent(remoteAuth).replace(/%3A/, ":") - remote.auth = remoteAuth + else if (alwaysAuth) { + this.log.verbose("request", "always-auth set; sending authorization") + authed = true + } + else if (isWrite) { + this.log.verbose("request", "sending authorization for write operation") + authed = true + } + else { + // most of the time we don't want to auth + this.log.verbose("request", "no auth needed") + authed = false } - - // Tuned to spread 3 attempts over about a minute. - // See formula at <https://github.com/tim-kos/node-retry>. - var operation = retry.operation({ - retries: this.conf.get('fetch-retries') || 2, - factor: this.conf.get('fetch-retry-factor'), - minTimeout: this.conf.get('fetch-retry-mintimeout') || 10000, - maxTimeout: this.conf.get('fetch-retry-maxtimeout') || 60000 - }) var self = this - operation.attempt(function (currentAttempt) { - self.log.info("trying", "registry request attempt " + currentAttempt - + " at " + (new Date()).toLocaleTimeString()) - makeRequest.call(self, method, remote, where, what, etag, nofollow + this.attempt(function (operation) { + makeRequest.call(self, method, where, what, options.etag, follow, authed , function (er, parsed, raw, response) { if (!er || (er.message && er.message.match(/^SSL Error/))) { if (er) - er.code = 'ESSL' + er.code = "ESSL" return cb(er, parsed, raw, response) } @@ -145,61 +115,47 @@ function regRequest (method, uri, options, cb_) { var statusRetry = !statusCode || timeout || serverError if (er && statusRetry && operation.retry(er)) { self.log.info("retry", "will retry, error on last attempt: " + er) - return + return undefined } if (response) { - this.log.verbose("headers", response.headers) + self.log.verbose("headers", response.headers) if (response.headers["npm-notice"]) { - this.log.warn("notice", response.headers["npm-notice"]) + self.log.warn("notice", response.headers["npm-notice"]) } } cb.apply(null, arguments) - }.bind(this)) - }.bind(this)) + }) + }) } -function makeRequest (method, remote, where, what, etag, nofollow, cb_) { - var cbCalled = false - function cb () { - if (cbCalled) return - cbCalled = true - cb_.apply(null, arguments) - } +function makeRequest (method, where, what, etag, follow, authed, cb_) { + var cb = once(cb_) - var strict = this.conf.get('strict-ssl') - if (strict === undefined) strict = true - var opts = { url: remote - , method: method - , encoding: null // tell request let body be Buffer instance - , ca: this.conf.get('ca') - , localAddress: this.conf.get('local-address') - , cert: this.conf.get('cert') - , key: this.conf.get('key') - , strictSSL: strict } - , headers = opts.headers = {} - if (etag) { - this.log.verbose("etag", etag) - headers[method === "GET" ? "if-none-match" : "if-match"] = etag - } + var parsed = url.parse(where) + var headers = {} - headers['npm-session'] = this.sessionToken - headers.version = this.version || pkg.version + // metadata should be compressed + headers["accept-encoding"] = "gzip" - if (this.refer) { - headers.referer = this.refer - } + var er = this.authify(authed, parsed, headers) + if (er) return cb_(er) - headers.accept = "application/json" - headers['accept-encoding'] = 'gzip' + var opts = this.initialize( + parsed, + method, + "application/json", + headers + ) - headers["user-agent"] = this.conf.get('user-agent') || - 'node/' + process.version + opts.followRedirect = follow + opts.encoding = null // tell request let body be Buffer instance - var p = this.conf.get('proxy') - var sp = this.conf.get('https-proxy') || p - opts.proxy = remote.protocol === "https:" ? sp : p + if (etag) { + this.log.verbose("etag", etag) + headers[method === "GET" ? "if-none-match" : "if-match"] = etag + } - // figure out wth 'what' is + // figure out wth "what" is if (what) { if (Buffer.isBuffer(what) || typeof what === "string") { opts.body = what @@ -214,11 +170,7 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb_) { } } - if (nofollow) { - opts.followRedirect = false - } - - this.log.http(method, remote.href || "/") + this.log.http("request", method, parsed.href || "/") var done = requestDone.call(this, method, where, cb) var req = request(opts, decodeResponseBody(done)) @@ -243,7 +195,7 @@ function decodeResponseBody(cb) { response.socket.destroy() } - if (response.headers['content-encoding'] !== 'gzip') return cb(er, response, data) + if (response.headers["content-encoding"] !== "gzip") return cb(er, response, data) zlib.gunzip(data, function (er, buf) { if (er) return cb(er, response, data) @@ -260,7 +212,7 @@ function requestDone (method, where, cb) { var urlObj = url.parse(where) if (urlObj.auth) - urlObj.auth = '***' + urlObj.auth = "***" this.log.http(response.statusCode, url.format(urlObj)) var parsed @@ -298,16 +250,21 @@ function requestDone (method, where, cb) { if (parsed && parsed.error && response.statusCode >= 400) { var w = url.parse(where).pathname.substr(1) var name - if (!w.match(/^-/) && parsed.error === "not_found") { + if (!w.match(/^-/)) { w = w.split("/") name = w[w.indexOf("_rewrite") + 1] - er = new Error("404 Not Found: "+name) - er.code = "E404" - er.pkgid = name + } + + if (name && parsed.error === "not_found") { + er = new Error("404 Not Found: " + name) } else { er = new Error( parsed.error + " " + (parsed.reason || "") + ": " + w) } + if (name) er.pkgid = name + er.statusCode = response.statusCode + er.code = "E" + er.statusCode + } else if (method !== "HEAD" && method !== "GET") { // invalidate cache // This is irrelevant for commands that do etag caching, but diff --git a/deps/npm/node_modules/npm-registry-client/lib/star.js b/deps/npm/node_modules/npm-registry-client/lib/star.js index c0590f1e2e..97745851ea 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/star.js +++ b/deps/npm/node_modules/npm-registry-client/lib/star.js @@ -2,10 +2,15 @@ module.exports = star function star (uri, starred, cb) { - if (!this.conf.get('username')) return cb(new Error( - "Must be logged in to star/unstar packages")) + var c = this.conf.getCredentialsByURI(uri) + if (c.token) { + return cb(new Error("This operation is unsupported for token-based auth")) + } + else if (!c.auth) { + return cb(new Error("Must be logged in to star/unstar packages")) + } - this.request("GET", uri+"?write=true", null, function (er, fullData) { + this.request("GET", uri + "?write=true", null, function (er, fullData) { if (er) return cb(er) fullData = { _id: fullData._id @@ -14,10 +19,10 @@ function star (uri, starred, cb) { if (starred) { this.log.info("starring", fullData._id) - fullData.users[this.conf.get('username')] = true + fullData.users[c.username] = true this.log.verbose("starring", fullData) } else { - delete fullData.users[this.conf.get('username')] + delete fullData.users[c.username] this.log.info("unstarring", fullData._id) this.log.verbose("unstarring", fullData) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js index 6a4ac8a191..346d537fe6 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js @@ -22,7 +22,7 @@ function unpublish (uri, ver, cb) { // remove all if no version specified if (!ver) { this.log.info("unpublish", "No version specified, removing all") - return this.request("DELETE", uri+'/-rev/'+data._rev, null, cb) + return this.request("DELETE", uri+"/-rev/"+data._rev, null, cb) } var versions = data.versions || {} @@ -72,7 +72,7 @@ function unpublish (uri, ver, cb) { function detacher (uri, data, dist, cb) { return function (er) { if (er) return cb(er) - this.get(url.resolve(uri, data.name), null, function (er, data) { + this.get(escape(uri, data.name), null, function (er, data) { if (er) return cb(er) var tb = url.parse(dist.tarball) @@ -96,10 +96,15 @@ function detach (uri, data, path, rev, cb) { this.log.info("detach", path) return this.request("DELETE", url.resolve(uri, path), null, cb) } - this.get(url.resolve(uri, data.name), null, function (er, data) { + this.get(escape(uri, data.name), null, function (er, data) { rev = data._rev if (!rev) return cb(new Error( "No _rev found in "+data._id)) detach.call(this, data, path, rev, cb) }.bind(this)) } + +function escape (base, name) { + var escaped = name.replace(/\//, "%2f") + return url.resolve(base, escaped) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js b/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js new file mode 100644 index 0000000000..3b26a56c65 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js @@ -0,0 +1,21 @@ +var url = require("url") + +module.exports = toNerfDart + +/** + * Maps a URL to an identifier. + * + * Name courtesy schiffertronix media LLC, a New Jersey corporation + * + * @param {String} uri The URL to be nerfed. + * + * @returns {String} A nerfed URL. + */ +function toNerfDart(uri) { + var parsed = url.parse(uri) + parsed.pathname = "/" + delete parsed.protocol + delete parsed.auth + + return url.format(parsed) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/whoami.js b/deps/npm/node_modules/npm-registry-client/lib/whoami.js new file mode 100644 index 0000000000..ffa7bd704e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/whoami.js @@ -0,0 +1,15 @@ +module.exports = whoami + +var url = require("url") + +function whoami (uri, cb) { + if (!this.conf.getCredentialsByURI(uri)) { + return cb(new Error("Must be logged in to see who you are")) + } + + this.request("GET", url.resolve(uri, "whoami"), null, function (er, userdata) { + if (er) return cb(er) + + cb(null, userdata.username) + }) +} diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index 6d29da9ddf..5de4bd2aa3 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": "2.0.7", + "version": "3.2.1", "repository": { "url": "git://github.com/isaacs/npm-registry-client" }, @@ -18,15 +18,18 @@ "chownr": "0", "graceful-fs": "^3.0.0", "mkdirp": "^0.5.0", + "normalize-package-data": "~1.0.1", "npm-cache-filename": "^1.0.0", + "once": "^1.3.0", "request": "2 >=2.25.0", "retry": "0.6.0", - "rimraf": "~2", - "semver": "2 >=2.2.1", - "slide": "~1.1.3", + "rimraf": "2", + "semver": "2 >=2.2.1 || 3.x || 4", + "slide": "^1.1.3", "npmlog": "" }, "devDependencies": { + "concat-stream": "^1.4.6", "tap": "" }, "optionalDependencies": { @@ -35,12 +38,12 @@ "license": "ISC", "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"npm://registry.npmjs.org/npm\"\nvar options = {timeout: 1000}\n\nclient.get(uri, options, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (for the base URL, any path\nwill be ignored). In addition to `http` and `https`, `npm` URLs are allowed.\n`npm` URLs are `https` URLs with the additional restrictions that they will\nalways include authorization credentials, and the response is always registry\nmetadata (and not tarballs or other attachments).\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you. Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `cert` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates\n* `key` {String} Private key (PEM encoded) for client certificate 'cert'\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n certificates. Default = `true`\n* `user-agent` {String} User agent header to send. Default =\n `\"node/{process.version} {process.platform} {process.arch}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n `_auth` if not supplied.\n* `_token` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, uri, options, cb)\n\n* `method` {String} HTTP method\n* `uri` {String} URI pointing to the resource to request\n* `options` {Object} Object containing optional per-request properties.\n * `what` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON.\n * `etag` {String} The cached ETag\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a request to the registry. All the other methods are wrappers around\n`request`.\n\n# client.adduser(base, username, password, email, cb)\n\n* `base` {String} Base registry URL\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.deprecate(uri, version, message, cb)\n\n* `uri` {String} Full registry URI for the deprecated package\n* `version` {String} Semver version range\n* `message` {String} The message to use as a deprecation warning\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n# client.bugs(uri, cb)\n\n* `uri` {String} Full registry URI for the package\n* `cb` {Function}\n\nGet the url for bugs of a package\n\n# client.get(uri, options, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `options` {Object} Object containing optional per-request properties.\n * `timeout` {Number} Duration before the request times out.\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\n * `staleOk` {Boolean} If there's cached data available, then return that\n to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag.\n\n# client.publish(uri, data, tarball, cb)\n\n* `uri` {String} The registry URI to publish to\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder. However, it can\naccept a gzipped tar stream or a filename to a tarball.\n\n# client.star(uri, starred, cb)\n\n* `uri` {String} The complete registry URI to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n# client.stars(base, username, cb)\n\n* `base` {String} The base URL for the registry\n* `username` {String} Name of user to fetch starred packages for.\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n# client.tag(uri, version, tag, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n# client.unpublish(uri, [ver], cb)\n\n* `uri` {String} The complete registry URI to unpublish\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n# client.upload(uri, file, [etag], [nofollow], cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment. Mostly used by `client.publish()`.\n", "readmeFilename": "README.md", - "gitHead": "bb534a209f9a36d77aff57cd4318ba3985501360", + "gitHead": "c60d91b1e8dceba21e33ec40eeaf1b0d02cac8c6", "bugs": { "url": "https://github.com/isaacs/npm-registry-client/issues" }, "homepage": "https://github.com/isaacs/npm-registry-client", - "_id": "npm-registry-client@2.0.7", - "_shasum": "97a2cdca5aba753b4b5b334b4ae65669c6641085", - "_from": "npm-registry-client@^2.0.7" + "_id": "npm-registry-client@3.2.1", + "_shasum": "a502a818de273085e8e1a931ff7beac6e3fe2a7a", + "_from": "npm-registry-client@>=3.2.1-0 <3.3.0-0" } diff --git a/deps/npm/node_modules/npm-registry-client/test/bugs.js b/deps/npm/node_modules/npm-registry-client/test/bugs.js index a7336b4a58..799445295d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/bugs.js +++ b/deps/npm/node_modules/npm-registry-client/test/bugs.js @@ -2,13 +2,7 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) +var client = common.freshClient() tap.test("get the URL for the bugs page on a package", function (t) { server.expect("GET", "/sample/latest", function (req, res) { @@ -23,7 +17,8 @@ tap.test("get the URL for the bugs page on a package", function (t) { }) client.bugs("http://localhost:1337/sample", function (error, info) { - t.notOk(error, "no errors") + t.ifError(error) + t.ok(info.url, "got the URL") t.ok(info.email, "got the email address") diff --git a/deps/npm/node_modules/npm-registry-client/test/deprecate.js b/deps/npm/node_modules/npm-registry-client/test/deprecate.js index 29d33742c7..76a5ba128d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/test/deprecate.js @@ -2,13 +2,13 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "not-bad-meaning-bad-but-bad-meaning-wombat" + +var client = common.freshClient(configuration) var cache = require("./fixtures/underscore/cache.json") @@ -57,8 +57,8 @@ tap.test("deprecate a package", function (t) { }) }) - client.deprecate("http://localhost:1337/underscore", VERSION, MESSAGE, function (error, data) { - t.notOk(error, "no errors") + client.deprecate(common.registry + "/underscore", VERSION, MESSAGE, function (er, data) { + t.ifError(er) t.ok(data.deprecated, "was deprecated") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js new file mode 100644 index 0000000000..2ce3b212b0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js @@ -0,0 +1,44 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("basic fetch", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + null, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js new file mode 100644 index 0000000000..bdd8bf0703 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js @@ -0,0 +1,52 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("fetch with retry on timeout", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(408) + res.end() + }) + + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.conf.set("fetch-retry-mintimeout", 100) + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + {}, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js new file mode 100644 index 0000000000..91cd6754da --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js @@ -0,0 +1,52 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("fetch with retry on server error", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(503) + res.end() + }) + + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.conf.set("fetch-retry-mintimeout", 100) + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + {}, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js new file mode 100644 index 0000000000..2ce3b212b0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js @@ -0,0 +1,44 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("basic fetch", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + null, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-all.js b/deps/npm/node_modules/npm-registry-client/test/get-all.js index 86978b2670..75570fcbb6 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-all.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-all.js @@ -10,7 +10,7 @@ tap.test("basic request", function (t) { }) client.get("http://localhost:1337/-/all", null, function (er) { - t.notOk(er, "no error") + t.ifError(er, "no error") t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-basic.js b/deps/npm/node_modules/npm-registry-client/test/get-basic.js index 10c48b0b87..240dc87622 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-basic.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-basic.js @@ -16,7 +16,11 @@ tap.test("basic request", function (t) { res.json(usroot) }) - t.plan(2) + server.expect("/@bigco%2funderscore", function (req, res) { + res.json(usroot) + }) + + t.plan(3) client.get("http://localhost:1337/underscore/1.3.3", null, function (er, data) { t.deepEqual(data, us) }) @@ -24,4 +28,8 @@ tap.test("basic request", function (t) { client.get("http://localhost:1337/underscore", null, function (er, data) { t.deepEqual(data, usroot) }) + + client.get("http://localhost:1337/@bigco%2funderscore", null, function (er, data) { + t.deepEqual(data, usroot) + }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js new file mode 100644 index 0000000000..27406b1680 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js @@ -0,0 +1,33 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +tap.test("get fails with 403", function (t) { + server.expect("/habanero", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(403) + res.end("{\"error\":\"get that cat out of the toilet that's gross omg\"}") + }) + + var client = common.freshClient() + client.conf.set("fetch-retry-mintimeout", 100) + client.get( + "http://localhost:1337/habanero", + {}, + function (er) { + t.ok(er, "failed as expected") + + t.equal(er.statusCode, 403, "status code was attached as expected") + t.equal(er.code, "E403", "error code was formatted as expected") + t.equal( + er.message, + "get that cat out of the toilet that's gross omg : habanero", + "got error message" + ) + + t.end() + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js index f9048c0945..bbf55ca302 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/common.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/common.js @@ -1,16 +1,76 @@ var resolve = require("path").resolve -var server = require('./server.js') -var RC = require('../../') + +var server = require("./server.js") +var RC = require("../../") +var toNerfDart = require("../../lib/util/nerf-dart.js") + +var REGISTRY = "http://localhost:" + server.port module.exports = { + port : server.port, + registry : REGISTRY, freshClient : function freshClient(config) { config = config || {} - config.cache = resolve(__dirname, '../fixtures/cache') - config.registry = 'http://localhost:' + server.port + config.cache = resolve(__dirname, "../fixtures/cache") + config.registry = REGISTRY + var container = { + get: function (k) { return config[k] }, + set: function (k, v) { config[k] = v }, + del: function (k) { delete config[k] }, + getCredentialsByURI: function(uri) { + var nerfed = toNerfDart(uri) + var c = {scope : nerfed} + + if (this.get(nerfed + ":_authToken")) { + c.token = this.get(nerfed + ":_authToken") + // the bearer token is enough, don't confuse things + return c + } + + if (this.get(nerfed + ":_password")) { + c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") + } + + if (this.get(nerfed + ":username")) { + c.username = this.get(nerfed + ":username") + } + + if (this.get(nerfed + ":email")) { + c.email = this.get(nerfed + ":email") + } + + if (c.username && c.password) { + c.auth = new Buffer(c.username + ":" + c.password).toString("base64") + } + + return c + }, + setCredentialsByURI: function (uri, c) { + var nerfed = toNerfDart(uri) + + if (c.token) { + this.set(nerfed + ":_authToken", c.token, "user") + this.del(nerfed + ":_password", "user") + this.del(nerfed + ":username", "user") + this.del(nerfed + ":email", "user") + } + else if (c.username || c.password || c.email) { + this.del(nerfed + ":_authToken", "user") + + var encoded = new Buffer(c.password, "utf8").toString("base64") + this.set(nerfed + ":_password", encoded, "user") + this.set(nerfed + ":username", c.username, "user") + this.set(nerfed + ":email", c.email, "user") + } + else { + throw new Error("No credentials to set.") + } + } + } - var client = new RC(config) + var client = new RC(container) server.log = client.log - client.log.level = 'silent' + client.log.level = "silent" return client } diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/server.js b/deps/npm/node_modules/npm-registry-client/test/lib/server.js index b195d9a9b3..37cfae0417 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/server.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/server.js @@ -14,7 +14,7 @@ function handler (req, res) { req.connection.setTimeout(1000) // If we got authorization, make sure it's the right password. - if (req.headers.authorization) { + if (req.headers.authorization && req.headers.authorization.match(/^Basic/)) { var auth = req.headers.authorization.replace(/^Basic /, "") auth = new Buffer(auth, "base64").toString("utf8") assert.equal(auth, "username:%1234@asdf%") diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js new file mode 100644 index 0000000000..97838ca44d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js @@ -0,0 +1,82 @@ +var tap = require("tap") +var fs = require("fs") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) + +tap.test("publish again", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + var lastTime = null + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var o = lastTime = JSON.parse(b) + t.equal(o._id, "@npm/npm-registry-client") + t.equal(o["dist-tags"].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: "username", email: "i@izs.me" } ]) + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] + t.same(att.data, pd) + res.statusCode = 409 + res.json({reason: "must supply latest _rev to update existing package"}) + }) + }) + + server.expect("/@npm%2fnpm-registry-client?write=true", function (req, res) { + t.equal(req.method, "GET") + t.ok(lastTime) + for (var i in lastTime.versions) { + var v = lastTime.versions[i] + delete lastTime.versions[i] + lastTime.versions["0.0.2"] = v + lastTime["dist-tags"] = { latest: "0.0.2" } + } + lastTime._rev = "asdf" + res.json(lastTime) + }) + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + t.ok(lastTime) + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function() { + var o = JSON.parse(b) + t.equal(o._rev, "asdf") + t.deepEqual(o.versions["0.0.2"], o.versions[pkg.version]) + res.statusCode = 201 + res.json({created: true}) + }) + }) + + pkg.name = "@npm/npm-registry-client" + client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js index 6d286fb7eb..39c368fd35 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again.js @@ -3,16 +3,23 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username: "username", - password: "%1234@asdf%", - email: "i@izs.me", - _auth: new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth": true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) tap.test("publish again", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") var lastTime = null + server.expect("/npm-registry-client", function (req, res) { t.equal(req.method, "PUT") var b = "" @@ -66,11 +73,6 @@ tap.test("publish again", function (t) { }) }) - - // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") - var pkg = require("../package.json") client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js new file mode 100644 index 0000000000..e1bb7dd1ee --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js @@ -0,0 +1,52 @@ +var tap = require("tap") +var crypto = require("crypto") +var fs = require("fs") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) + +tap.test("publish", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + pkg.name = "@npm/npm-registry-client" + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + t.equal(req.headers.authorization, "Bearer of-glad-tidings") + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var o = JSON.parse(b) + t.equal(o._id, "@npm/npm-registry-client") + t.equal(o["dist-tags"].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, o.versions[pkg.version].maintainers) + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] + t.same(att.data, pd) + var hash = crypto.createHash("sha1").update(pd, "base64").digest("hex") + t.equal(o.versions[pkg.version].dist.shasum, hash) + res.statusCode = 201 + res.json({created:true}) + }) + }) + + client.publish(common.registry, pkg, tarball, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js new file mode 100644 index 0000000000..b5dea3649c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js @@ -0,0 +1,57 @@ +var tap = require("tap") +var crypto = require("crypto") +var fs = require("fs") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "ogd@aoaioxxysz.net" + +var client = common.freshClient(configuration) + +var _auth = new Buffer("username:%1234@asdf%").toString("base64") + +tap.test("publish", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + pkg.name = "@npm/npm-registry-client" + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + t.equal(req.headers.authorization, "Basic " + _auth) + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var o = JSON.parse(b) + t.equal(o._id, "@npm/npm-registry-client") + t.equal(o["dist-tags"].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: "username", email: "ogd@aoaioxxysz.net" } ]) + t.same(o.maintainers, o.versions[pkg.version].maintainers) + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] + t.same(att.data, pd) + var hash = crypto.createHash("sha1").update(pd, "base64").digest("hex") + t.equal(o.versions[pkg.version].dist.shasum, hash) + res.statusCode = 201 + res.json({created:true}) + }) + }) + + client.publish(common.registry, pkg, tarball, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish.js b/deps/npm/node_modules/npm-registry-client/test/publish.js index c34bf6c534..2d76dfae20 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish.js @@ -4,16 +4,22 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username: "username", - password: "%1234@asdf%", - email: "i@izs.me", - _auth: new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth": true -}) +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) tap.test("publish", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + server.expect("/npm-registry-client", function (req, res) { t.equal(req.method, "PUT") var b = "" @@ -38,10 +44,6 @@ tap.test("publish", function (t) { }) }) - // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") - var pkg = require("../package.json") client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) diff --git a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js index 79c2e8dc02..1085bfaca2 100644 --- a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js +++ b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js @@ -19,10 +19,12 @@ var pkg = { zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { tap.test("request gzip package content", function (t) { + t.ifError(err, "example package compressed") + server.expect("GET", "/some-package-gzip/1.2.3", function (req, res) { res.statusCode = 200 - res.setHeader("Content-Encoding", "gzip"); - res.setHeader("Content-Type", "application/json"); + res.setHeader("Content-Encoding", "gzip") + res.setHeader("Content-Type", "application/json") res.end(pkgGzip) }) @@ -46,4 +48,4 @@ zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { t.end() }) }) -}); +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/star.js b/deps/npm/node_modules/npm-registry-client/test/star.js index 0e43e10d76..43c8888ef2 100644 --- a/deps/npm/node_modules/npm-registry-client/test/star.js +++ b/deps/npm/node_modules/npm-registry-client/test/star.js @@ -2,18 +2,20 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) - -var cache = require("./fixtures/underscore/cache.json") var DEP_USER = "username" +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = DEP_USER +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) + +var cache = require("./fixtures/underscore/cache.json") + tap.test("star a package", function (t) { server.expect("GET", "/underscore?write=true", function (req, res) { t.equal(req.method, "GET") @@ -52,7 +54,7 @@ tap.test("star a package", function (t) { }) client.star("http://localhost:1337/underscore", true, function (error, data) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.ok(data.starred, "was starred") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/stars.js b/deps/npm/node_modules/npm-registry-client/test/stars.js index ae1ddbb49d..28f8a98d76 100644 --- a/deps/npm/node_modules/npm-registry-client/test/stars.js +++ b/deps/npm/node_modules/npm-registry-client/test/stars.js @@ -2,13 +2,7 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) +var client = common.freshClient() var users = [ "benjamincoe", @@ -24,7 +18,7 @@ tap.test("get the URL for the bugs page on a package", function (t) { }) client.stars("http://localhost:1337/", "sample", function (error, info) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.deepEqual(info, users, "got the list of users") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/tag.js b/deps/npm/node_modules/npm-registry-client/test/tag.js index 216ac6c520..7551569307 100644 --- a/deps/npm/node_modules/npm-registry-client/test/tag.js +++ b/deps/npm/node_modules/npm-registry-client/test/tag.js @@ -2,13 +2,15 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) tap.test("tag a package", function (t) { server.expect("PUT", "/underscore/not-lodash", function (req, res) { @@ -31,7 +33,7 @@ tap.test("tag a package", function (t) { }) client.tag("http://localhost:1337/underscore", {"1.3.2":{}}, "not-lodash", function (error, data) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.ok(data.tagged, "was tagged") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js new file mode 100644 index 0000000000..0e5cb8606d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js @@ -0,0 +1,59 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) + +var cache = require("./fixtures/@npm/npm-registry-client/cache.json") + +var REV = "/-rev/213-0a1049cf56172b7d9a1184742c6477b9" +var VERSION = "3.0.6" + +tap.test("unpublish a package", function (t) { + server.expect("GET", "/@npm%2fnpm-registry-client?write=true", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("PUT", "/@npm%2fnpm-registry-client" + REV, function (req, res) { + t.equal(req.method, "PUT") + + var b = "" + req.setEncoding("utf-8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var updated = JSON.parse(b) + t.notOk(updated.versions[VERSION]) + }) + + res.json(cache) + }) + + server.expect("GET", "/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("DELETE", "/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-" + VERSION + ".tgz" + REV, function (req, res) { + t.equal(req.method, "DELETE") + + res.json({unpublished:true}) + }) + + client.unpublish("http://localhost:1337/@npm%2fnpm-registry-client", VERSION, function (error) { + t.ifError(error, "no errors") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish.js b/deps/npm/node_modules/npm-registry-client/test/unpublish.js index 47c5617c8a..7a60431fac 100644 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish.js @@ -2,13 +2,13 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) var cache = require("./fixtures/underscore/cache.json") @@ -52,7 +52,7 @@ tap.test("unpublish a package", function (t) { }) client.unpublish("http://localhost:1337/underscore", VERSION, function (error) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/upload.js b/deps/npm/node_modules/npm-registry-client/test/upload.js index 434ad36f01..fa197e3681 100644 --- a/deps/npm/node_modules/npm-registry-client/test/upload.js +++ b/deps/npm/node_modules/npm-registry-client/test/upload.js @@ -7,13 +7,12 @@ var server = require("./lib/server.js") var cache = require("./fixtures/underscore/cache.json") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) function OneA() { Readable.call(this) @@ -22,7 +21,7 @@ function OneA() { } inherits(OneA, Readable) -tap.test("unpublish a package", function (t) { +tap.test("uploading a tarball", function (t) { server.expect("PUT", "/underscore", function (req, res) { t.equal(req.method, "PUT") @@ -30,7 +29,7 @@ tap.test("unpublish a package", function (t) { }) client.upload("http://localhost:1337/underscore", new OneA(), "daedabeefa", true, function (error) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/whoami.js b/deps/npm/node_modules/npm-registry-client/test/whoami.js new file mode 100644 index 0000000000..f9c817684f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/whoami.js @@ -0,0 +1,30 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "not-bad-meaning-bad-but-bad-meaning-wombat" + +var client = common.freshClient(configuration) + +var WHOIAM = "wombat" + +tap.test("whoami", function (t) { + server.expect("GET", "/whoami", function (req, res) { + t.equal(req.method, "GET") + // only available for token-based auth for now + t.equal(req.headers.authorization, "Bearer not-bad-meaning-bad-but-bad-meaning-wombat") + + res.json({username : WHOIAM}) + }) + + client.whoami(common.registry, function (error, wombat) { + t.ifError(error, "no errors") + t.equal(wombat, WHOIAM, "im a wombat") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npmconf/.npmignore b/deps/npm/node_modules/npmconf/.npmignore index baa471ca80..485007791f 100644 --- a/deps/npm/node_modules/npmconf/.npmignore +++ b/deps/npm/node_modules/npmconf/.npmignore @@ -1 +1,3 @@ /test/fixtures/userconfig-with-gc +.eslintrc +.jshintrc diff --git a/deps/npm/node_modules/npmconf/LICENSE b/deps/npm/node_modules/npmconf/LICENSE index 19129e315f..0c44ae716d 100644 --- a/deps/npm/node_modules/npmconf/LICENSE +++ b/deps/npm/node_modules/npmconf/LICENSE @@ -1,15 +1,27 @@ -The ISC License +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. -Copyright (c) Isaac Z. Schlueter and Contributors +The BSD License -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/npmconf/config-defs.js b/deps/npm/node_modules/npmconf/config-defs.js index 31522fb643..b0b4acf22d 100644 --- a/deps/npm/node_modules/npmconf/config-defs.js +++ b/deps/npm/node_modules/npmconf/config-defs.js @@ -16,7 +16,7 @@ try { } catch (er) { var util = require("util") log = { warn: function (m) { - console.warn(m + util.format.apply(util, [].slice.call(arguments, 1))) + console.warn(m + ' ' + util.format.apply(util, [].slice.call(arguments, 1))) } } } @@ -40,6 +40,12 @@ function validateSemver (data, k, val) { data[k] = semver.valid(val) } +function validateTag (data, k, val) { + val = ('' + val).trim() + if (!val || semver.validRange(val)) return false + data[k] = val +} + function validateStream (data, k, val) { if (!(val instanceof Stream)) return false data[k] = val @@ -49,6 +55,10 @@ nopt.typeDefs.semver = { type: semver, validate: validateSemver } nopt.typeDefs.Octal = { type: Octal, validate: validateOctal } nopt.typeDefs.Stream = { type: Stream, validate: validateStream } +// Don't let --tag=1.2.3 ever be a thing +var tag = {} +nopt.typeDefs.tag = { type: tag, validate: validateTag } + nopt.invalidHandler = function (k, val, type) { log.warn("invalid config", k + "=" + JSON.stringify(val)) @@ -58,6 +68,9 @@ nopt.invalidHandler = function (k, val, type) { } switch (type) { + case tag: + log.warn("invalid config", "Tag must not be a SemVer range") + break case Octal: log.warn("invalid config", "Must be octal number, starting with 0") break @@ -137,7 +150,6 @@ Object.defineProperty(exports, "defaults", {get: function () { , description : true , dev : false , editor : osenv.editor() - , email: "" , "engine-strict": false , force : false @@ -159,6 +171,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , "init.author.name" : "" , "init.author.email" : "" , "init.author.url" : "" + , "init.version": "1.0.0" , "init.license": "ISC" , json: false , key: null @@ -192,6 +205,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , "save-exact" : false , "save-optional" : false , "save-prefix": "^" + , scope : "" , searchopts: "" , searchexclude: null , searchsort: "name" @@ -210,7 +224,6 @@ Object.defineProperty(exports, "defaults", {get: function () { || process.getuid() !== 0 , usage : false , user : process.platform === "win32" ? 0 : "nobody" - , username : "" , userconfig : path.resolve(home, ".npmrc") , umask: process.umask ? process.umask() : parseInt("022", 8) , version : false @@ -239,7 +252,6 @@ exports.types = , description : Boolean , dev : Boolean , editor : String - , email: [null, String] , "engine-strict": Boolean , force : Boolean , "fetch-retries": Number @@ -260,13 +272,14 @@ exports.types = , "init.author.email" : String , "init.author.url" : ["", url] , "init.license": String + , "init.version": semver , json: Boolean , key: [null, String] , link: Boolean // local-address must be listed as an IP for a local network interface // must be IPv4 due to node bug , "local-address" : getLocalAddresses() - , loglevel : ["silent","win","error","warn","http","info","verbose","silly"] + , loglevel : ["silent","error","warn","http","info","verbose","silly"] , logstream : Stream , long : Boolean , message: String @@ -288,6 +301,7 @@ exports.types = , "save-exact" : Boolean , "save-optional" : Boolean , "save-prefix": String + , scope : String , searchopts : String , searchexclude: [null, String] , searchsort: [ "name", "-name" @@ -300,20 +314,18 @@ exports.types = , "sign-git-tag": Boolean , spin: ["always", Boolean] , "strict-ssl": Boolean - , tag : String + , tag : tag , tmp : path , unicode : Boolean , "unsafe-perm" : Boolean , usage : Boolean , user : [Number, String] - , username : String , userconfig : path , umask: Octal , version : Boolean , versions : Boolean , viewer: String , _exit : Boolean - , _password: String } function getLocalAddresses() { @@ -365,4 +377,5 @@ exports.shorthands = , y : ["--yes"] , n : ["--no-yes"] , B : ["--save-bundle"] + , C : ["--prefix"] } diff --git a/deps/npm/node_modules/npmconf/lib/get-credentials-by-uri.js b/deps/npm/node_modules/npmconf/lib/get-credentials-by-uri.js new file mode 100644 index 0000000000..6fb8f31707 --- /dev/null +++ b/deps/npm/node_modules/npmconf/lib/get-credentials-by-uri.js @@ -0,0 +1,57 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = getCredentialsByURI + +function getCredentialsByURI (uri) { + assert(uri && typeof uri === "string", "registry URL is required") + var nerfed = toNerfDart(uri) + var defnerf = toNerfDart(this.get("registry")) + + var c = {scope : nerfed} + + if (this.get(nerfed + ":_authToken")) { + c.token = this.get(nerfed + ":_authToken") + // the bearer token is enough, don't confuse things + return c + } + + // Handle the old-style _auth=<base64> style for the default + // registry, if set. + // + // XXX(isaacs): Remove when npm 1.4 is no longer relevant + var authDef = this.get("_auth") + var userDef = this.get("username") + var passDef = this.get("_password") + if (authDef && !(userDef && passDef)) { + authDef = new Buffer(authDef, "base64").toString() + authDef = authDef.split(":") + userDef = authDef.shift() + passDef = authDef.join(":") + } + + if (this.get(nerfed + ":_password")) { + c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") + } else if (nerfed === defnerf && passDef) { + c.password = passDef + } + + if (this.get(nerfed + ":username")) { + c.username = this.get(nerfed + ":username") + } else if (nerfed === defnerf && userDef) { + c.username = userDef + } + + if (this.get(nerfed + ":email")) { + c.email = this.get(nerfed + ":email") + } else if (this.get("email")) { + c.email = this.get("email") + } + + if (c.username && c.password) { + c.auth = new Buffer(c.username + ":" + c.password).toString("base64") + } + + return c +} diff --git a/deps/npm/node_modules/npmconf/lib/nerf-dart.js b/deps/npm/node_modules/npmconf/lib/nerf-dart.js new file mode 100644 index 0000000000..3b26a56c65 --- /dev/null +++ b/deps/npm/node_modules/npmconf/lib/nerf-dart.js @@ -0,0 +1,21 @@ +var url = require("url") + +module.exports = toNerfDart + +/** + * Maps a URL to an identifier. + * + * Name courtesy schiffertronix media LLC, a New Jersey corporation + * + * @param {String} uri The URL to be nerfed. + * + * @returns {String} A nerfed URL. + */ +function toNerfDart(uri) { + var parsed = url.parse(uri) + parsed.pathname = "/" + delete parsed.protocol + delete parsed.auth + + return url.format(parsed) +} diff --git a/deps/npm/node_modules/npmconf/lib/set-credentials-by-uri.js b/deps/npm/node_modules/npmconf/lib/set-credentials-by-uri.js new file mode 100644 index 0000000000..2fa0d19e36 --- /dev/null +++ b/deps/npm/node_modules/npmconf/lib/set-credentials-by-uri.js @@ -0,0 +1,34 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = setCredentialsByURI + +function setCredentialsByURI (uri, c) { + assert(uri && typeof uri === "string", "registry URL is required") + assert(c && typeof c === "object", "credentials are required") + + var nerfed = toNerfDart(uri) + + if (c.token) { + this.set(nerfed + ":_authToken", c.token, "user") + this.del(nerfed + ":_password", "user") + this.del(nerfed + ":username", "user") + this.del(nerfed + ":email", "user") + } + else if (c.username || c.password || c.email) { + assert(c.username, "must include username") + assert(c.password, "must include password") + assert(c.email, "must include email address") + + this.del(nerfed + ":_authToken", "user") + + var encoded = new Buffer(c.password, "utf8").toString("base64") + this.set(nerfed + ":_password", encoded, "user") + this.set(nerfed + ":username", c.username, "user") + this.set(nerfed + ":email", c.email, "user") + } + else { + throw new Error("No credentials to set.") + } +} diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json index 2dff2917c0..391d876d2f 100644 --- a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json +++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json @@ -29,7 +29,7 @@ "homepage": "https://github.com/isaacs/proto-list", "_id": "proto-list@1.2.3", "_shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9", - "_from": "proto-list@~1.2.1", + "_from": "proto-list@>=1.2.1-0 <1.3.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "isaacs", @@ -46,6 +46,5 @@ "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz" } diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json index c59f5ceeb6..bec4626e6d 100644 --- a/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json +++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json @@ -32,7 +32,7 @@ "shasum": "0943d0b7227213a20d4eaff4434f4a1c0a052cad", "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.8.tgz" }, - "_from": "config-chain@~1.1.8", + "_from": "config-chain@>=1.1.8-0 <1.2.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "dominictarr", diff --git a/deps/npm/node_modules/npmconf/npmconf.js b/deps/npm/node_modules/npmconf/npmconf.js index a17705447a..7607b50f82 100644 --- a/deps/npm/node_modules/npmconf/npmconf.js +++ b/deps/npm/node_modules/npmconf/npmconf.js @@ -10,7 +10,6 @@ var nopt = require('nopt') var ini = require('ini') var Octal = configDefs.Octal var mkdirp = require('mkdirp') -var path = require('path') exports.load = load exports.Conf = Conf @@ -181,7 +180,7 @@ function load_(builtin, rc, cli, cb) { finalize() } - function finalize(er, cadata) { + function finalize(er) { if (er) { return cb(er) } @@ -217,6 +216,8 @@ Conf.prototype.loadCAFile = require('./lib/load-cafile.js') Conf.prototype.loadUid = require('./lib/load-uid.js') Conf.prototype.setUser = require('./lib/set-user.js') Conf.prototype.findPrefix = require('./lib/find-prefix.js') +Conf.prototype.getCredentialsByURI = require('./lib/get-credentials-by-uri.js') +Conf.prototype.setCredentialsByURI = require('./lib/set-credentials-by-uri.js') Conf.prototype.loadExtras = function(cb) { this.setUser(function(er) { @@ -235,7 +236,7 @@ Conf.prototype.save = function (where, cb) { var target = this.sources[where] if (!target || !(target.path || target.source) || !target.data) { if (where !== 'builtin') - var er = new Error('bad save target: '+where) + var er = new Error('bad save target: ' + where) if (cb) { process.nextTick(cb.bind(null, er)) return this @@ -252,28 +253,13 @@ Conf.prototype.save = function (where, cb) { return this } - var data = target.data - - if (typeof data._password === 'string' && - typeof data.username === 'string') { - var auth = data.username + ':' + data._password - data = Object.keys(data).reduce(function (c, k) { - if (k === 'username' || k === '_password') - return c - c[k] = data[k] - return c - }, { _auth: new Buffer(auth, 'utf8').toString('base64') }) - delete data.username - delete data._password - } - - data = ini.stringify(data) + var data = ini.stringify(target.data) then = then.bind(this) done = done.bind(this) this._saving ++ - var mode = where === 'user' ? 0600 : 0666 + var mode = where === 'user' ? "0600" : "0666" if (!data.trim()) { fs.unlink(target.path, function (er) { // ignore the possible error (e.g. the file doesn't exist) @@ -338,13 +324,6 @@ Conf.prototype.add = function (data, marker) { Object.keys(data).forEach(function (k) { data[k] = parseField(data[k], k) }) - if (Object.prototype.hasOwnProperty.call(data, '_auth')) { - var auth = new Buffer(data._auth, 'base64').toString('utf8').split(':') - var username = auth.shift() - var password = auth.join(':') - data.username = username - data._password = password - } return CC.prototype.add.call(this, data, marker) } @@ -367,7 +346,7 @@ Conf.prototype.addEnv = function (env) { return CC.prototype.addEnv.call(this, '', conf, 'env') } -function parseField (f, k, emptyIsFalse) { +function parseField (f, k) { if (typeof f !== 'string' && !(f instanceof String)) return f @@ -415,7 +394,7 @@ function envReplace (f) { // replace any ${ENV} values with the appropriate environ. var envExpr = /(\\*)\$\{([^}]+)\}/g - return f.replace(envExpr, function (orig, esc, name, i, s) { + return f.replace(envExpr, function (orig, esc, name) { esc = esc.length && esc.length % 2 if (esc) return orig @@ -427,7 +406,7 @@ function envReplace (f) { function validate (cl) { // warn about invalid configs at every level. - cl.list.forEach(function (conf, level) { + cl.list.forEach(function (conf) { nopt.clean(conf, configDefs.types) }) diff --git a/deps/npm/node_modules/npmconf/package.json b/deps/npm/node_modules/npmconf/package.json index 55daab66e1..2699e90b83 100644 --- a/deps/npm/node_modules/npmconf/package.json +++ b/deps/npm/node_modules/npmconf/package.json @@ -1,6 +1,6 @@ { "name": "npmconf", - "version": "1.1.8", + "version": "2.0.9", "description": "The config thing npm uses", "main": "npmconf.js", "directories": { @@ -14,7 +14,7 @@ "nopt": "~3.0.1", "once": "~1.3.0", "osenv": "^0.1.0", - "semver": "2", + "semver": "2 || 3 || 4", "uid-number": "0.0.5" }, "devDependencies": { @@ -39,15 +39,33 @@ "email": "i@izs.me", "url": "http://blog.izs.me" }, - "license": "ISC", - "readme": "# npmconf\n\nThe config thing npm uses\n\nIf you are interested in interacting with the config settings that npm\nuses, then use this module.\n\nHowever, if you are writing a new Node.js program, and want\nconfiguration functionality similar to what npm has, but for your\nown thing, then I'd recommend using [rc](https://github.com/dominictarr/rc),\nwhich is probably what you want.\n\nIf I were to do it all over again, that's what I'd do for npm. But,\nalas, there are many systems depending on many of the particulars of\nnpm's configuration setup, so it's not worth the cost of changing.\n\n## USAGE\n\n```javascript\nvar npmconf = require('npmconf')\n\n// pass in the cli options that you read from the cli\n// or whatever top-level configs you want npm to use for now.\nnpmconf.load({some:'configs'}, function (er, conf) {\n // do stuff with conf\n conf.get('some', 'cli') // 'configs'\n conf.get('username') // 'joebobwhatevers'\n conf.set('foo', 'bar', 'user')\n conf.save('user', function (er) {\n // foo = bar is now saved to ~/.npmrc or wherever\n })\n})\n```\n", - "readmeFilename": "README.md", - "gitHead": "98e8ed0e2a307470f8db14d2727a165d8524b567", + "license": "BSD", + "gitHead": "1f07a91b86f3bbba00967d7079dc6a456e746734", "bugs": { "url": "https://github.com/isaacs/npmconf/issues" }, "homepage": "https://github.com/isaacs/npmconf", - "_id": "npmconf@1.1.8", - "_shasum": "350e3d7a4da8e4958dfd0391c81e9a750b01cde2", - "_from": "npmconf@^1.1.8" + "_id": "npmconf@2.0.9", + "_shasum": "5c87e5fb308104eceeca781e3d9115d216351ef2", + "_from": "npmconf@>=2.0.8-0 <2.1.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "5c87e5fb308104eceeca781e3d9115d216351ef2", + "tarball": "http://registry.npmjs.org/npmconf/-/npmconf-2.0.9.tgz" + }, + "_resolved": "https://registry.npmjs.org/npmconf/-/npmconf-2.0.9.tgz" } diff --git a/deps/npm/node_modules/npmconf/test/00-setup.js b/deps/npm/node_modules/npmconf/test/00-setup.js index d009e81eb6..3f5109f043 100644 --- a/deps/npm/node_modules/npmconf/test/00-setup.js +++ b/deps/npm/node_modules/npmconf/test/00-setup.js @@ -3,6 +3,30 @@ var userconfigSrc = path.resolve(__dirname, 'fixtures', 'userconfig') exports.userconfig = userconfigSrc + '-with-gc' exports.globalconfig = path.resolve(__dirname, 'fixtures', 'globalconfig') exports.builtin = path.resolve(__dirname, 'fixtures', 'builtin') +exports.ucData = + { globalconfig: exports.globalconfig, + email: 'i@izs.me', + 'env-thing': 'asdf', + 'init.author.name': 'Isaac Z. Schlueter', + 'init.author.email': 'i@izs.me', + 'init.author.url': 'http://blog.izs.me/', + 'init.version': '1.2.3', + 'proprietary-attribs': false, + 'npm:publishtest': true, + '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', + 'npm-www:nocache': '1', + nodedir: '/Users/isaacs/dev/js/node-v0.8', + 'sign-git-tag': true, + message: 'v%s', + 'strict-ssl': false, + 'tmp': process.env.HOME + '/.tmp', + _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + _token: + { AuthSession: 'yabba-dabba-doodle', + version: '1', + expires: '1345001053415', + path: '/', + httponly: true } } // set the userconfig in the env // unset anything else that npm might be trying to foist on us diff --git a/deps/npm/node_modules/npmconf/test/basic.js b/deps/npm/node_modules/npmconf/test/basic.js index 29d708b3a6..e3a684f947 100644 --- a/deps/npm/node_modules/npmconf/test/basic.js +++ b/deps/npm/node_modules/npmconf/test/basic.js @@ -5,32 +5,7 @@ var path = require('path') var projectData = {} -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - +var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix diff --git a/deps/npm/node_modules/npmconf/test/builtin.js b/deps/npm/node_modules/npmconf/test/builtin.js index 15cb9083aa..c94de8abdc 100644 --- a/deps/npm/node_modules/npmconf/test/builtin.js +++ b/deps/npm/node_modules/npmconf/test/builtin.js @@ -3,31 +3,7 @@ var npmconf = require('../npmconf.js') var common = require('./00-setup.js') var path = require('path') -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } +var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix diff --git a/deps/npm/node_modules/npmconf/test/credentials.js b/deps/npm/node_modules/npmconf/test/credentials.js new file mode 100644 index 0000000000..85632f9f11 --- /dev/null +++ b/deps/npm/node_modules/npmconf/test/credentials.js @@ -0,0 +1,166 @@ +var test = require("tap").test + +var npmconf = require("../npmconf.js") +var common = require("./00-setup.js") + +var URI = "https://registry.lvh.me:8661/" + +test("getting scope with no credentials set", function (t) { + npmconf.load({}, function (er, conf) { + t.ifError(er, "configuration loaded") + + var basic = conf.getCredentialsByURI(URI) + t.equal(basic.scope, "//registry.lvh.me:8661/", "nerfed URL extracted") + + t.end() + }) +}) + +test("trying to set credentials with no URI", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI() + }, "enforced missing URI") + + t.end() + }) +}) + +test("set with missing credentials object", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI(URI) + }, "enforced missing credentials") + + t.end() + }) +}) + +test("set with empty credentials object", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI(URI, {}) + }, "enforced missing credentials") + + t.end() + }) +}) + +test("set with token", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, {token : "simple-token"}) + }, "needs only token") + + var expected = { + scope : "//registry.lvh.me:8661/", + token : "simple-token" + } + + t.same(conf.getCredentialsByURI(URI), expected, "got bearer token and scope") + + t.end() + }) +}) + +test("set with missing username", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + password : "password", + email : "ogd@aoaioxxysz.net" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with missing password", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + email : "ogd@aoaioxxysz.net" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with missing email", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with old-style credentials", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net" + } + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, credentials) + }, "requires all of username, password, and email") + + var expected = { + scope : "//registry.lvh.me:8661/", + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=" + } + + t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + + t.end() + }) +}) + +test("get old-style credentials for default registry", function (t) { + npmconf.load(common.builtin, function (er, conf) { + var actual = conf.getCredentialsByURI(conf.get("registry")) + var expected = { + scope: '//registry.npmjs.org/', + password: 'password', + username: 'username', + email: 'i@izs.me', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=' + } + t.same(actual, expected) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npmconf/test/fixtures/userconfig b/deps/npm/node_modules/npmconf/test/fixtures/userconfig index bda1eb82ae..d600c0664e 100644 --- a/deps/npm/node_modules/npmconf/test/fixtures/userconfig +++ b/deps/npm/node_modules/npmconf/test/fixtures/userconfig @@ -3,16 +3,17 @@ env-thing = ${random_env_var} init.author.name = Isaac Z. Schlueter init.author.email = i@izs.me init.author.url = http://blog.izs.me/ +init.version = 1.2.3 proprietary-attribs = false npm:publishtest = true _npmjs.org:couch = https://admin:password@localhost:5984/registry -_auth = dXNlcm5hbWU6cGFzc3dvcmQ= npm-www:nocache = 1 nodedir = /Users/isaacs/dev/js/node-v0.8 sign-git-tag = true message = v%s strict-ssl = false tmp = ~/.tmp +_auth = dXNlcm5hbWU6cGFzc3dvcmQ= [_token] AuthSession = yabba-dabba-doodle diff --git a/deps/npm/node_modules/npmconf/test/project.js b/deps/npm/node_modules/npmconf/test/project.js index fa21e43d22..d9a0bdbcc5 100644 --- a/deps/npm/node_modules/npmconf/test/project.js +++ b/deps/npm/node_modules/npmconf/test/project.js @@ -7,32 +7,7 @@ var projectRc = path.resolve(fix, '.npmrc') var projectData = { just: 'testing' } -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - +var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix diff --git a/deps/npm/node_modules/npmconf/test/save.js b/deps/npm/node_modules/npmconf/test/save.js index 64b114449e..0d2f1978f9 100644 --- a/deps/npm/node_modules/npmconf/test/save.js +++ b/deps/npm/node_modules/npmconf/test/save.js @@ -10,16 +10,15 @@ var expectConf = 'init.author.name = Isaac Z. Schlueter', 'init.author.email = i@izs.me', 'init.author.url = http://blog.izs.me/', + 'init.version = 1.2.3', 'proprietary-attribs = false', 'npm:publishtest = true', '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', 'npm-www:nocache = 1', 'sign-git-tag = false', 'message = v%s', 'strict-ssl = false', - 'username = username', - '_password = password', + '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', '', '[_token]', 'AuthSession = yabba-dabba-doodle', @@ -35,14 +34,15 @@ var expectFile = 'init.author.name = Isaac Z. Schlueter', 'init.author.email = i@izs.me', 'init.author.url = http://blog.izs.me/', + 'init.version = 1.2.3', 'proprietary-attribs = false', 'npm:publishtest = true', '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', 'npm-www:nocache = 1', 'sign-git-tag = false', 'message = v%s', 'strict-ssl = false', + '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', '', '[_token]', 'AuthSession = yabba-dabba-doodle', diff --git a/deps/npm/node_modules/npmconf/test/semver-tag.js b/deps/npm/node_modules/npmconf/test/semver-tag.js new file mode 100644 index 0000000000..b0ce27f1b3 --- /dev/null +++ b/deps/npm/node_modules/npmconf/test/semver-tag.js @@ -0,0 +1,65 @@ +var test = require('tap').test +var npmconf = require('../npmconf.js') +var common = require('./00-setup.js') +var path = require('path') + +var ucData = common.ucData + +var envData = common.envData +var envDataFix = common.envDataFix + +var gcData = { 'package-config:foo': 'boo' } + +var biData = { 'builtin-config': true } + +var cli = { tag: 'v2.x' } + +var projectData = {} + +var expectList = +[ cli, + envDataFix, + projectData, + ucData, + gcData, + biData ] + + +var expectSources = +{ cli: { data: cli }, + env: + { data: envDataFix, + source: envData, + prefix: '' }, + project: + { path: path.resolve(__dirname, '..', '.npmrc'), + type: 'ini', + data: projectData }, + user: + { path: common.userconfig, + type: 'ini', + data: ucData }, + global: + { path: common.globalconfig, + type: 'ini', + data: gcData }, + builtin: { data: biData } } + +test('tag cannot be a SemVer', function (t) { + var messages = [] + console.warn = function (m) { + messages.push(m) + } + + var expect = [ + 'invalid config tag="v2.x"', + 'invalid config Tag must not be a SemVer range' + ] + + npmconf.load(cli, common.builtin, function (er, conf) { + if (er) throw er + t.equal(conf.get('tag'), 'latest') + t.same(messages, expect) + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE b/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE new file mode 100644 index 0000000000..a3187cc100 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE @@ -0,0 +1,19 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md b/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md new file mode 100644 index 0000000000..dc6fccecc3 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md @@ -0,0 +1,40 @@ +# debuglog - backport of util.debuglog() from node v0.11 + +To facilitate using the `util.debuglog()` function that will be available when +node v0.12 is released now, this is a copy extracted from the source. + +## require('debuglog') + +Return `util.debuglog`, if it exists, otherwise it will return an internal copy +of the implementation from node v0.11. + +## debuglog(section) + +* `section` {String} The section of the program to be debugged +* Returns: {Function} The logging function + +This is used to create a function which conditionally writes to stderr +based on the existence of a `NODE_DEBUG` environment variable. If the +`section` name appears in that environment variable, then the returned +function will be similar to `console.error()`. If not, then the +returned function is a no-op. + +For example: + +```javascript +var debuglog = util.debuglog('foo'); + +var bar = 123; +debuglog('hello from foo [%d]', bar); +``` + +If this program is run with `NODE_DEBUG=foo` in the environment, then +it will output something like: + + FOO 3245: hello from foo [123] + +where `3245` is the process id. If it is not run with that +environment variable set, then it will not print anything. + +You may separate multiple `NODE_DEBUG` environment variables with a +comma. For example, `NODE_DEBUG=fs,net,tls`. diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js b/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js new file mode 100644 index 0000000000..748fd72a1a --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js @@ -0,0 +1,22 @@ +var util = require('util'); + +module.exports = (util && util.debuglog) || debuglog; + +var debugs = {}; +var debugEnviron = process.env.NODE_DEBUG || ''; + +function debuglog(set) { + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = util.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json new file mode 100644 index 0000000000..3966625621 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json @@ -0,0 +1,45 @@ +{ + "name": "debuglog", + "version": "1.0.1", + "description": "backport of util.debuglog from node v0.11", + "license": "MIT", + "main": "debuglog.js", + "repository": { + "type": "git", + "url": "https://github.com/sam-github/node-debuglog.git" + }, + "author": { + "name": "Sam Roberts", + "email": "sam@strongloop.com" + }, + "engines": { + "node": "*" + }, + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/sam-github/node-debuglog/issues" + }, + "homepage": "https://github.com/sam-github/node-debuglog", + "_id": "debuglog@1.0.1", + "dist": { + "shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "tarball": "http://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" + }, + "_from": "debuglog@>=1.0.1-0 <2.0.0-0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "octet", + "email": "sam@strongloop.com" + }, + "maintainers": [ + { + "name": "octet", + "email": "sam@strongloop.com" + } + ], + "directories": {}, + "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" +} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE new file mode 100644 index 0000000000..19129e315f --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md new file mode 100644 index 0000000000..ade57a186d --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md @@ -0,0 +1,17 @@ +# readdir-scoped-modules + +Like `fs.readdir` but handling `@org/module` dirs as if they were +a single entry. + +Used by npm. + +## USAGE + +```javascript +var readdir = require('readdir-scoped-modules') + +readdir('node_modules', function (er, entries) { + // entries will be something like + // ['a', '@org/foo', '@org/bar'] +}) +``` diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json new file mode 100644 index 0000000000..84b91e75a5 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json @@ -0,0 +1,54 @@ +{ + "name": "readdir-scoped-modules", + "version": "1.0.0", + "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", + "main": "readdir.js", + "directories": { + "test": "test" + }, + "dependencies": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "once": "^1.3.0" + }, + "devDependencies": { + "tap": "0.4" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/readdir-scoped-modules" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/readdir-scoped-modules/issues" + }, + "homepage": "https://github.com/npm/readdir-scoped-modules", + "gitHead": "35a4a7a2325d12ed25ed322cd61f976b740f7fb7", + "_id": "readdir-scoped-modules@1.0.0", + "_shasum": "e939de969b38b3e7dfaa14fbcfe7a2fd15a4ea37", + "_from": "readdir-scoped-modules@>=1.0.0-0 <2.0.0-0", + "_npmVersion": "2.0.0-alpha.6.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "e939de969b38b3e7dfaa14fbcfe7a2fd15a4ea37", + "tarball": "http://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.0.tgz" +} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js new file mode 100644 index 0000000000..91978a739d --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js @@ -0,0 +1,71 @@ +var fs = require ('fs') +var dz = require ('dezalgo') +var once = require ('once') +var path = require ('path') +var debug = require ('debuglog') ('rds') + +module . exports = readdir + +function readdir (dir, cb) { + fs . readdir (dir, function (er, kids) { + if (er) + return cb (er) + + debug ('dir=%j, kids=%j', dir, kids) + readScopes (dir, kids, function (er, data) { + if (er) + return cb (er) + + // Sort for bonus consistency points + data = data . sort (function (a, b) { + return a > b ? 1 : -1 + }) + + return cb (null, data) + }) + }) +} + +// Turn [ 'a', '@scope' ] into +// ['a', '@scope/foo', '@scope/bar'] +function readScopes (root, kids, cb) { + var scopes = kids . filter (function (kid) { + return kid . charAt (0) === '@' + }) + + kids = kids . filter (function (kid) { + return kid . charAt (0) !== '@' + }) + + debug ('scopes=%j', scopes) + + if (scopes . length === 0) + dz (cb) (null, kids) // prevent maybe-sync zalgo release + + cb = once (cb) + var l = scopes . length + scopes . forEach (function (scope) { + var scopedir = path . resolve (root, scope) + debug ('root=%j scope=%j scopedir=%j', root, scope, scopedir) + fs . readdir (scopedir, then . bind (null, scope)) + }) + + function then (scope, er, scopekids) { + if (er) + return cb (er) + + // XXX: Not sure how old this node bug is. Maybe superstition? + scopekids = scopekids . filter (function (scopekid) { + return !(scopekid === '.' || scopekid === '..' || !scopekid) + }) + + kids . push . apply (kids, scopekids . map (function (scopekid) { + return scope + '/' + scopekid + })) + + debug ('scope=%j scopekids=%j kids=%j', scope, scopekids, kids) + + if (--l === 0) + cb (null, kids) + } +} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js new file mode 100644 index 0000000000..715c40d584 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js @@ -0,0 +1,14 @@ +var test = require ('tap') . test +var readdir = require ('../readdir.js') + +test ('basic', function (t) { + // should not get {a,b}/{x,y}, but SHOULD get @org/ and @scope children + var expect = [ '@org/x', '@org/y', '@scope/x', '@scope/y', 'a', 'b' ] + + readdir (__dirname + '/fixtures', function (er, kids) { + if (er) + throw er + t.same(kids, expect) + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json index 96f5a3f51b..0bab48d329 100644 --- a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json @@ -22,7 +22,7 @@ "shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", "tarball": "http://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz" }, - "_from": "util-extend@^1.0.1", + "_from": "util-extend@>=1.0.1-0 <2.0.0-0", "_npmVersion": "1.3.4", "_npmUser": { "name": "isaacs", diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index de958a544e..2c50225534 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -1,7 +1,7 @@ { "name": "read-installed", "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "2.0.5", + "version": "3.1.3", "repository": { "type": "git", "url": "git://github.com/isaacs/read-installed" @@ -11,8 +11,10 @@ "test": "tap ./test/*.js" }, "dependencies": { + "debuglog": "^1.0.1", "read-package-json": "1", - "semver": "2", + "readdir-scoped-modules": "^1.0.0", + "semver": "2 || 3 || 4", "slide": "~1.1.3", "util-extend": "^1.0.1", "graceful-fs": "2 || 3" @@ -27,16 +29,37 @@ }, "license": "ISC", "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", "tap": "~0.4.8" }, - "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 2.0.0\n\nBreaking changes in `2.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, default false, set to true to include devDependencies\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// optional options\nvar options = { dev: false, log: fn, depth: 2 }\nreadInstalled(folder, options, function (er, data) {\n ...\n})\n```\n", - "readmeFilename": "README.md", - "gitHead": "2595631e4d3cbd64b26cee63dc3b5ce9f53e3533", + "gitHead": "50e45af7581b1a879c62146fafbfa1b92842f7df", "bugs": { "url": "https://github.com/isaacs/read-installed/issues" }, "homepage": "https://github.com/isaacs/read-installed", - "_id": "read-installed@2.0.5", - "_shasum": "761eda1fd2dc322f8e77844a8bf1ddedbcfc754b", - "_from": "read-installed@latest" + "_id": "read-installed@3.1.3", + "_shasum": "c09092a13c2117f22842cad16804f3b059129d11", + "_from": "read-installed@>=3.1.2-0 <3.2.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "c09092a13c2117f22842cad16804f3b059129d11", + "tarball": "http://registry.npmjs.org/read-installed/-/read-installed-3.1.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-installed/-/read-installed-3.1.3.tgz" } diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js index 9b5a479622..a92ed3fbee 100644 --- a/deps/npm/node_modules/read-installed/read-installed.js +++ b/deps/npm/node_modules/read-installed/read-installed.js @@ -101,6 +101,10 @@ var url = require("url") var util = require("util") var extend = require("util-extend") +var debug = require("debuglog")("read-installed") + +var readdir = require("readdir-scoped-modules") + module.exports = readInstalled function readInstalled (folder, opts, cb) { @@ -120,25 +124,29 @@ function readInstalled (folder, opts, cb) { opts.log = function () {} opts.dev = !!opts.dev + opts.realpathSeen = {} + opts.findUnmetSeen = [] + readInstalled_(folder, null, null, null, 0, opts, function (er, obj) { if (er) return cb(er) // now obj has all the installed things, where they're installed // figure out the inheritance links, now that the object is built. resolveInheritance(obj, opts) - markExtraneous(obj) + obj.root = true + unmarkExtraneous(obj, opts) cb(null, obj) }) } -var rpSeen = {} function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { var installed , obj , real , link + , realpathSeen = opts.realpathSeen - fs.readdir(path.resolve(folder, "node_modules"), function (er, i) { + readdir(path.resolve(folder, "node_modules"), function (er, i) { // error indicates that nothing is installed here if (er) i = [] installed = i.filter(function (f) { return f.charAt(0) !== "." }) @@ -161,7 +169,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { return next(er) } fs.realpath(folder, function (er, rp) { - //console.error("realpath(%j) = %j", folder, rp) + debug("realpath(%j) = %j", folder, rp) real = rp if (st.isSymbolicLink()) link = rp next(er) @@ -176,10 +184,10 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { errState = er return cb(null, []) } - //console.error('next', installed, obj && typeof obj, name, real) + debug('next', installed, obj && typeof obj, name, real) if (!installed || !obj || !real || called) return called = true - if (rpSeen[real]) return cb(null, rpSeen[real]) + if (realpathSeen[real]) return cb(null, realpathSeen[real]) if (obj === true) { obj = {dependencies:{}, path:folder} installed.forEach(function (i) { obj.dependencies[i] = "*" }) @@ -188,6 +196,9 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { obj.realName = name || obj.name obj.dependencies = obj.dependencies || {} + // At this point, figure out what dependencies we NEED to get met + obj._dependencies = copy(obj.dependencies) + // "foo":"http://blah" and "foo":"latest" are always presumed valid if (reqver && semver.validRange(reqver, true) @@ -195,21 +206,17 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { obj.invalid = true } - if (parent) { - var deps = parent.dependencies || {} - var inDeps = name in deps - var devDeps = parent.devDependencies || {} - var inDev = opts.dev && (name in devDeps) - if (!inDeps && !inDev) { - obj.extraneous = true - } - } + // Mark as extraneous at this point. + // This will be un-marked in unmarkExtraneous, where we mark as + // not-extraneous everything that is required in some way from + // the root object. + obj.extraneous = true obj.path = obj.path || folder obj.realPath = real obj.link = link if (parent && !obj.link) obj.parent = parent - rpSeen[real] = obj + realpathSeen[real] = obj obj.depth = depth //if (depth >= opts.depth) return cb(null, obj) asyncMap(installed, function (pkg, cb) { @@ -259,50 +266,45 @@ function resolveInheritance (obj, opts) { findUnmet(obj.dependencies[dep], opts) }) Object.keys(obj.dependencies).forEach(function (dep) { - resolveInheritance(obj.dependencies[dep], opts) + if (typeof obj.dependencies[dep] === "object") { + resolveInheritance(obj.dependencies[dep], opts) + } else { + debug("unmet dep! %s %s@%s", obj.name, dep, obj.dependencies[dep]) + } }) findUnmet(obj, opts) } // find unmet deps by walking up the tree object. // No I/O -var fuSeen = [] function findUnmet (obj, opts) { - if (fuSeen.indexOf(obj) !== -1) return - fuSeen.push(obj) - //console.error("find unmet", obj.name, obj.parent && obj.parent.name) + var findUnmetSeen = opts.findUnmetSeen + if (findUnmetSeen.indexOf(obj) !== -1) return + findUnmetSeen.push(obj) + debug("find unmet parent=%s obj=", obj.parent && obj.parent.name, obj.name || obj) var deps = obj.dependencies = obj.dependencies || {} - //console.error(deps) + debug(deps) Object.keys(deps) .filter(function (d) { return typeof deps[d] === "string" }) .forEach(function (d) { - //console.error("find unmet", obj.name, d, deps[d]) - var r = obj.parent - , found = null - while (r && !found && typeof deps[d] === "string") { - // if r is a valid choice, then use that. - found = r.dependencies[d] - if (!found && r.realName === d) found = r - - if (!found) { - r = r.link ? null : r.parent - continue - } - // "foo":"http://blah" and "foo":"latest" are always presumed valid - if ( typeof deps[d] === "string" - && semver.validRange(deps[d], true) - && !semver.satisfies(found.version, deps[d], true)) { - // the bad thing will happen - opts.log("unmet dependency", obj.path + " requires "+d+"@'"+deps[d] - +"' but will load\n" - +found.path+",\nwhich is version "+found.version - ) - found.invalid = true - } + var found = findDep(obj, d) + debug("finding dep %j", d, found && found.name || found) + // "foo":"http://blah" and "foo":"latest" are always presumed valid + if (typeof deps[d] === "string" && + semver.validRange(deps[d], true) && + found && + !semver.satisfies(found.version, deps[d], true)) { + // the bad thing will happen + opts.log( "unmet dependency" + , obj.path + " requires "+d+"@'"+deps[d] + + "' but will load\n" + + found.path+",\nwhich is version "+found.version ) + found.invalid = true + } + if (found) { deps[d] = found } - }) var peerDeps = obj.peerDependencies = obj.peerDependencies || {} @@ -329,34 +331,58 @@ function findUnmet (obj, opts) { obj.dependencies[d] = peerDeps[d] } else if (!semver.satisfies(dependency.version, peerDeps[d], true)) { dependency.peerInvalid = true - } else { - dependency.extraneous = false } }) return obj } -function recursivelyMarkExtraneous (obj, extraneous) { - // stop recursion if we're not changing anything - if (obj.extraneous === extraneous) return +function unmarkExtraneous (obj, opts) { + // Mark all non-required deps as extraneous. + // start from the root object and mark as non-extraneous all modules + // that haven't been previously flagged as extraneous then propagate + // to all their dependencies - obj.extraneous = extraneous - var deps = obj.dependencies = obj.dependencies || {} - Object.keys(deps).forEach(function(d){ - recursivelyMarkExtraneous(deps[d], extraneous) - }); + obj.extraneous = false + + var deps = obj._dependencies + if (opts.dev && obj.devDependencies && (obj.root || obj.link)) { + Object.keys(obj.devDependencies).forEach(function (k) { + deps[k] = obj.devDependencies[k] + }) + } + + if (obj.peerDependencies) { + Object.keys(obj.peerDependencies).forEach(function (k) { + deps[k] = obj.peerDependencies[k] + }) + } + + debug("not extraneous", obj._id, deps) + Object.keys(deps).forEach(function (d) { + var dep = findDep(obj, d) + if (dep && dep.extraneous) { + unmarkExtraneous(dep, opts) + } + }) } -function markExtraneous (obj) { - // start from the root object and mark as non-extraneous all modules that haven't been previously flagged as - // extraneous then propagate to all their dependencies - var deps = obj.dependencies = obj.dependencies || {} - Object.keys(deps).forEach(function(d){ - if (!deps[d].extraneous){ - recursivelyMarkExtraneous(deps[d], false); +// Find the one that will actually be loaded by require() +// so we can make sure it's valid etc. +function findDep (obj, d) { + var r = obj + , found = null + while (r && !found) { + // if r is a valid choice, then use that. + // kinda weird if a pkg depends on itself, but after the first + // iteration of this loop, it indicates a dep cycle. + if (typeof r.dependencies[d] === "object") { + found = r.dependencies[d] } - }); + if (!found && r.realName === d) found = r + r = r.link ? null : r.parent + } + return found } function copy (obj) { diff --git a/deps/npm/node_modules/read-installed/test/basic.js b/deps/npm/node_modules/read-installed/test/basic.js index 4d83cd0ca5..f497848879 100644 --- a/deps/npm/node_modules/read-installed/test/basic.js +++ b/deps/npm/node_modules/read-installed/test/basic.js @@ -1,8 +1,9 @@ var readInstalled = require("../read-installed.js") -var json = require("./fixtures/package.json") -var known = [].concat(Object.keys(json.dependencies) - , Object.keys(json.optionalDependencies) - , Object.keys(json.devDependencies)).sort() +var json = require("../package.json") +var d = Object.keys(json.dependencies) +var dd = Object.keys(json.devDependencies) +var od = Object.keys(json.optionalDependencies) +var known = d.concat(dd).concat(od).sort() var test = require("tap").test var path = require("path") @@ -36,9 +37,7 @@ function cleanup (map) { default: delete map[i] } var dep = map.dependencies -// delete map.dependencies if (dep) { -// map.dependencies = dep for (var i in dep) if (typeof dep[i] === "object") { cleanup(dep[i]) } diff --git a/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js b/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js new file mode 100644 index 0000000000..58bf6a649a --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js @@ -0,0 +1,81 @@ +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var fs = require("fs") +var path = require("path") +var readInstalled = require("../read-installed.js") + +var parent = { + name: "parent", + version: "1.2.3", + dependencies: {}, + devDependencies: { + "child1":"*" + }, + readme:"." +} + +var child1 = { + name: "child1", + version: "1.2.3", + peerDependencies: { + child2: "*" + }, + readme:"." +} + +var child2 = { + name: "child2", + version: "1.2.3", + peerDependencies: { + child1: "*" + }, + readme:"." +} + + +var root = path.resolve(__dirname, "cyclic-extraneous-peer-deps") +var parentjson = path.resolve(root, "package.json") +var child1root = path.resolve(root, "node_modules/child1") +var child1json = path.resolve(child1root, "package.json") +var child2root = path.resolve(root, "node_modules/child2") +var child2json = path.resolve(child2root, "package.json") + +test("setup", function (t) { + rimraf.sync(root) + mkdirp.sync(child1root) + mkdirp.sync(child2root) + fs.writeFileSync(parentjson, JSON.stringify(parent, null, 2) + "\n", "utf8") + fs.writeFileSync(child1json, JSON.stringify(child1, null, 2) + "\n", "utf8") + fs.writeFileSync(child2json, JSON.stringify(child2, null, 2) + "\n", "utf8") + t.pass("setup done") + t.end() +}) + +test("dev mode", function (t) { + // peer dev deps should both be not extraneous. + readInstalled(root, { dev: true }, function (er, data) { + if (er) + throw er + t.notOk(data.dependencies.child1.extraneous, "c1 not extra") + t.notOk(data.dependencies.child2.extraneous, "c2 not extra") + t.end() + }) +}) + +test("prod mode", function (t) { + readInstalled(root, { dev: false }, function (er, data) { + if (er) + throw er + t.ok(data.dependencies.child1.extraneous, "c1 extra") + t.ok(data.dependencies.child2.extraneous, "c2 extra") + t.end() + }) +}) + + +test("cleanup", function (t) { + rimraf.sync(root) + t.pass("cleanup done") + t.end() +}) diff --git a/deps/npm/node_modules/read-installed/test/dev.js b/deps/npm/node_modules/read-installed/test/dev.js index f6f4857bb0..5e5a994a88 100644 --- a/deps/npm/node_modules/read-installed/test/dev.js +++ b/deps/npm/node_modules/read-installed/test/dev.js @@ -1,6 +1,6 @@ var readInstalled = require("../read-installed.js") var test = require("tap").test -var json = require("./fixtures/package.json") +var json = require("../package.json") var path = require("path") var known = [].concat(Object.keys(json.dependencies) , Object.keys(json.optionalDependencies) @@ -17,7 +17,7 @@ test("make sure that it works without dev deps", function (t) { var deps = Object.keys(map.dependencies).sort() t.equal(deps.length, known.length, "array lengths are equal") t.deepEqual(deps, known, "arrays should be equal") - t.ok(map.dependencies.tap.extraneous, 'extraneous is set on devDep') + t.ok(map.dependencies.tap.extraneous, "extraneous is set on devDep") t.end() }) }) diff --git a/deps/npm/node_modules/read-installed/test/extraneous-dev.js b/deps/npm/node_modules/read-installed/test/extraneous-dev.js new file mode 100644 index 0000000000..2f9012d548 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/extraneous-dev.js @@ -0,0 +1,20 @@ +var readInstalled = require("../read-installed.js") +var test = require("tap").test +var path = require("path") + +test("extraneous detected", function(t) { + // This test verifies read-installed#16 + readInstalled( + path.join(__dirname, "fixtures/extraneous-dev-dep"), + { + log: console.error, + dev: true + }, + function (err, map) { + t.ifError(err, "read-installed made it") + + t.notOk(map.dependencies.d.extraneous, "d is not extraneous, it's required by root") + t.ok(map.dependencies.x.extraneous, "x is extraneous, it's only a dev dep of d") + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/test/extraneous.js b/deps/npm/node_modules/read-installed/test/extraneous.js index 2cc0d04e7a..e999c9b4fc 100644 --- a/deps/npm/node_modules/read-installed/test/extraneous.js +++ b/deps/npm/node_modules/read-installed/test/extraneous.js @@ -1,6 +1,6 @@ var readInstalled = require('../read-installed.js') var test = require('tap').test -var path = require('path'); +var path = require('path') test('extraneous detected', function(t) { // This test verifies read-installed#16 @@ -12,6 +12,6 @@ test('extraneous detected', function(t) { t.ok(map.dependencies.bar.extraneous, 'bar is extraneous, it\'s not required by any module') t.notOk(map.dependencies.asdf.extraneous, 'asdf is not extraneous, it\'s required by ghjk') t.notOk(map.dependencies.ghjk.extraneous, 'ghjk is not extraneous, it\'s required by our root module') - t.end(); + t.end() }) }) diff --git a/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json b/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json new file mode 100644 index 0000000000..9bfa7ce8f5 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json @@ -0,0 +1,7 @@ +{ + "name": "extraneous-dev-dep", + "version": "0.0.0", + "dependencies": { + "d": "1.0.0" + } +} diff --git a/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json b/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json new file mode 100644 index 0000000000..1a229c1cff --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json @@ -0,0 +1,8 @@ +{ + "name": "example", + "version": "0.0.0", + "devDependencies": { + "plugin-wrapper": "0.0.0", + "framework": "0.0.0" + } +} diff --git a/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js b/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js new file mode 100644 index 0000000000..fd7c2d2bc9 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js @@ -0,0 +1,20 @@ +var readInstalled = require('../read-installed.js') +var test = require('tap').test +var path = require('path'); + +function allValid(t, map) { + var deps = Object.keys(map.dependencies || {}) + deps.forEach(function (dep) { + t.ok(map.dependencies[dep].extraneous, 'dependency ' + dep + ' of ' + map.name + ' is extraneous') + }) +} + +test('grandparent dev peer dependencies should be extraneous', function(t) { + readInstalled( + path.join(__dirname, 'fixtures/grandparent-peer-dev'), + { log: console.error }, + function(err, map) { + allValid(t, map) + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js b/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js new file mode 100644 index 0000000000..6560513304 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js @@ -0,0 +1,59 @@ +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var readInstalled = require('../') + +var root = path.resolve(__dirname, 'root') +var pkg = path.resolve(root, 'pkg') +var pkgnm = path.resolve(pkg, 'node_modules') +var linkdepSrc = path.resolve(root, 'linkdep') +var linkdepLink = path.resolve(pkgnm, 'linkdep') +var devdep = path.resolve(linkdepSrc, 'node_modules', 'devdep') + +function pjson (dir, data) { + mkdirp.sync(dir) + var d = path.resolve(dir, 'package.json') + fs.writeFileSync(d, JSON.stringify(data)) +} + +test('setup', function (t) { + rimraf.sync(root) + pjson(pkg, { + name: 'root', + version: '1.2.3', + dependencies: { + linkdep: '' + } + }) + pjson(linkdepSrc, { + name: 'linkdep', + version: '1.2.3', + devDependencies: { + devdep: '' + } + }) + pjson(devdep, { + name: 'devdep', + version: '1.2.3' + }) + + mkdirp.sync(pkgnm) + fs.symlinkSync(linkdepSrc, linkdepLink, 'dir') + + t.end() +}) + +test('basic', function (t) { + readInstalled(pkg, { dev: true }, function (er, data) { + var dd = data.dependencies.linkdep.dependencies.devdep + t.notOk(dd.extraneous, 'linked dev dep should not be extraneous') + t.end() + }) +}) + +test('cleanup', function (t) { + rimraf.sync(root) + t.end() +}) diff --git a/deps/npm/node_modules/read-installed/test/noargs.js b/deps/npm/node_modules/read-installed/test/noargs.js index a84a8f4cfa..66fabeb74e 100644 --- a/deps/npm/node_modules/read-installed/test/noargs.js +++ b/deps/npm/node_modules/read-installed/test/noargs.js @@ -1,6 +1,6 @@ var readInstalled = require("../read-installed.js") var test = require("tap").test -var json = require("./fixtures/package.json") +var json = require("../package.json") var path = require("path") var known = [].concat(Object.keys(json.dependencies) , Object.keys(json.optionalDependencies) diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index 8b67330c1d..1fd2f674f7 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -37,7 +37,7 @@ "homepage": "https://github.com/isaacs/read-package-json", "_id": "read-package-json@1.2.7", "_shasum": "f0b440c461a218f4dbf48b094e80fc65c5248502", - "_from": "read-package-json@^1.2.7", + "_from": "read-package-json@>=1.2.7-0 <1.3.0-0", "_npmVersion": "2.0.0-beta.0", "_npmUser": { "name": "othiym23", diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json index 719d488706..d04010d603 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json @@ -27,7 +27,7 @@ "shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" }, - "_from": "aws-sign2@~0.5.0", + "_from": "aws-sign2@>=0.5.0-0 <0.6.0-0", "_npmVersion": "1.3.2", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/bl/.jshintrc b/deps/npm/node_modules/request/node_modules/bl/.jshintrc deleted file mode 100644 index c8ef3ca409..0000000000 --- a/deps/npm/node_modules/request/node_modules/bl/.jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - "predef": [ ] - , "bitwise": false - , "camelcase": false - , "curly": false - , "eqeqeq": false - , "forin": false - , "immed": false - , "latedef": false - , "noarg": true - , "noempty": true - , "nonew": true - , "plusplus": false - , "quotmark": true - , "regexp": false - , "undef": true - , "unused": true - , "strict": false - , "trailing": true - , "maxlen": 120 - , "asi": true - , "boss": true - , "debug": true - , "eqnull": true - , "esnext": true - , "evil": true - , "expr": true - , "funcscope": false - , "globalstrict": false - , "iterator": false - , "lastsemic": true - , "laxbreak": true - , "laxcomma": true - , "loopfunc": true - , "multistr": false - , "onecase": false - , "proto": false - , "regexdash": false - , "scripturl": true - , "smarttabs": false - , "shadow": false - , "sub": true - , "supernew": false - , "validthis": true - , "browser": true - , "couch": false - , "devel": false - , "dojo": false - , "mootools": false - , "node": true - , "nonstandard": true - , "prototypejs": false - , "rhino": false - , "worker": true - , "wsh": false - , "nomen": false - , "onevar": false - , "passfail": false -}
\ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json index add87edf58..8e79c3a748 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -35,7 +35,7 @@ "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" }, - "_from": "core-util-is@~1.0.0", + "_from": "core-util-is@>=1.0.0-0 <1.1.0-0", "_npmVersion": "1.3.23", "_npmUser": { "name": "isaacs", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json index a8c586bfb9..752eab63cc 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -28,7 +28,7 @@ }, "_id": "string_decoder@0.10.31", "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@~0.10.x", + "_from": "string_decoder@>=0.10.0-0 <0.11.0-0", "_npmVersion": "1.4.23", "_npmUser": { "name": "rvagg", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json index 1448587013..6c73ab3765 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -39,7 +39,7 @@ "homepage": "https://github.com/isaacs/readable-stream", "_id": "readable-stream@1.0.31", "_shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae", - "_from": "readable-stream@~1.0.26", + "_from": "readable-stream@>=1.0.26-0 <1.1.0-0", "_npmVersion": "1.4.9", "_npmUser": { "name": "rvagg", diff --git a/deps/npm/node_modules/request/node_modules/bl/package.json b/deps/npm/node_modules/request/node_modules/bl/package.json index 19c4ac079f..e94473d36c 100644 --- a/deps/npm/node_modules/request/node_modules/bl/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/package.json @@ -38,7 +38,7 @@ }, "_id": "bl@0.9.1", "_shasum": "d262c5b83aa5cf4386cea1d998c82b36d7ae2942", - "_from": "bl@~0.9.0", + "_from": "bl@>=0.9.0-0 <0.10.0-0", "_npmVersion": "1.4.21", "_npmUser": { "name": "rvagg", diff --git a/deps/npm/node_modules/request/node_modules/caseless/package.json b/deps/npm/node_modules/request/node_modules/caseless/package.json index 62d467544d..e3cd409c78 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/package.json +++ b/deps/npm/node_modules/request/node_modules/caseless/package.json @@ -30,7 +30,7 @@ "homepage": "https://github.com/mikeal/caseless", "_id": "caseless@0.6.0", "_shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4", - "_from": "caseless@~0.6.0", + "_from": "caseless@>=0.6.0-0 <0.7.0-0", "_npmVersion": "1.4.9", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/package.json b/deps/npm/node_modules/request/node_modules/forever-agent/package.json index 764ca1e2c4..65a6c55f26 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/forever-agent/package.json @@ -26,7 +26,7 @@ "shasum": "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130", "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz" }, - "_from": "forever-agent@~0.5.0", + "_from": "forever-agent@>=0.5.0-0 <0.6.0-0", "_npmVersion": "1.3.21", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json index bdbe740109..3b921537e7 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json @@ -41,7 +41,7 @@ "shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7", "tarball": "http://registry.npmjs.org/async/-/async-0.9.0.tgz" }, - "_from": "async@~0.9.0", + "_from": "async@>=0.9.0-0 <0.10.0-0", "_npmVersion": "1.4.3", "_npmUser": { "name": "caolan", diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json index 37c37314cc..fd82201d20 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json @@ -31,7 +31,7 @@ }, "_id": "combined-stream@0.0.5", "_shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2", - "_from": "combined-stream@~0.0.4", + "_from": "combined-stream@>=0.0.4-0 <0.1.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "alexindigo", diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json index 259822b788..8f4c392662 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json @@ -35,7 +35,7 @@ "shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", "tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz" }, - "_from": "mime@~1.2.11", + "_from": "mime@>=1.2.11-0 <1.3.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "broofa", diff --git a/deps/npm/node_modules/request/node_modules/form-data/package.json b/deps/npm/node_modules/request/node_modules/form-data/package.json index afda8b6c30..04d7ec69dd 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/felixge/node-form-data", "_id": "form-data@0.1.4", "_shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12", - "_from": "form-data@~0.1.0", + "_from": "form-data@>=0.1.0-0 <0.2.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "alexindigo", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json index 2406a49a5d..c95faa9e27 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json @@ -41,7 +41,7 @@ "shasum": "7a636e9ded4efcefb19cef4947a3c67dfaee911b", "tarball": "http://registry.npmjs.org/boom/-/boom-0.4.2.tgz" }, - "_from": "boom@0.4.x", + "_from": "boom@>=0.4.0-0 <0.5.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json index c4cd1b2342..3ed098bea5 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json @@ -45,7 +45,7 @@ "shasum": "ed91ff1f17ad13d3748288594f8a48a0d26f325c", "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz" }, - "_from": "cryptiles@0.2.x", + "_from": "cryptiles@>=0.2.0-0 <0.3.0-0", "_npmVersion": "1.2.24", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json index 4e4eb74b7a..bbc7031133 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json @@ -43,7 +43,7 @@ "shasum": "3d322462badf07716ea7eb85baf88079cddce505", "tarball": "http://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz" }, - "_from": "hoek@0.9.x", + "_from": "hoek@>=0.9.0-0 <0.10.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json index c96e8482ac..ff73fbc12a 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json @@ -42,7 +42,7 @@ "shasum": "fb885f18b0f3aad189f824862536bceeec750900", "tarball": "http://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz" }, - "_from": "sntp@0.2.x", + "_from": "sntp@>=0.2.0-0 <0.3.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/package.json b/deps/npm/node_modules/request/node_modules/http-signature/package.json index 6d646d4ad0..270f9891bf 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/package.json @@ -32,7 +32,7 @@ "shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582", "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz" }, - "_from": "http-signature@~0.10.0", + "_from": "http-signature@>=0.10.0-0 <0.11.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "mcavage", diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json index 3ddf83680c..2e415ac660 100644 --- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json +++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json @@ -32,7 +32,7 @@ "shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e", "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz" }, - "_from": "json-stringify-safe@~5.0.0", + "_from": "json-stringify-safe@>=5.0.0-0 <5.1.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "isaacs", diff --git a/deps/npm/node_modules/request/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/mime-types/package.json index baa79a956c..9d59fb8d9d 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/package.json @@ -39,7 +39,7 @@ "homepage": "https://github.com/expressjs/mime-types", "_id": "mime-types@1.0.2", "_shasum": "995ae1392ab8affcbfcb2641dd054e943c0d5dce", - "_from": "mime-types@~1.0.1", + "_from": "mime-types@>=1.0.1-0 <1.1.0-0", "_npmVersion": "1.4.21", "_npmUser": { "name": "dougwilson", diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/package.json b/deps/npm/node_modules/request/node_modules/node-uuid/package.json index ee93121fc3..491d93ad4a 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/package.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/package.json @@ -34,7 +34,7 @@ "shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" }, - "_from": "node-uuid@~1.4.0", + "_from": "node-uuid@>=1.4.0-0 <1.5.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "broofa", diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json index d0e82fecb0..16a7645861 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json @@ -30,7 +30,7 @@ "shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69", "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz" }, - "_from": "oauth-sign@~0.4.0", + "_from": "oauth-sign@>=0.4.0-0 <0.5.0-0", "_npmVersion": "1.3.2", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/qs/.jshintrc b/deps/npm/node_modules/request/node_modules/qs/.jshintrc deleted file mode 100644 index 997b3f7d45..0000000000 --- a/deps/npm/node_modules/request/node_modules/qs/.jshintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "node": true, - - "curly": true, - "latedef": true, - "quotmark": true, - "undef": true, - "unused": true, - "trailing": true -} diff --git a/deps/npm/node_modules/request/node_modules/qs/package.json b/deps/npm/node_modules/request/node_modules/qs/package.json index 7b1917023f..51be52c711 100755 --- a/deps/npm/node_modules/request/node_modules/qs/package.json +++ b/deps/npm/node_modules/request/node_modules/qs/package.json @@ -35,7 +35,7 @@ }, "_id": "qs@1.2.2", "_shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88", - "_from": "qs@~1.2.0", + "_from": "qs@>=1.2.0-0 <1.3.0-0", "_npmVersion": "1.4.21", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/stringstream/package.json b/deps/npm/node_modules/request/node_modules/stringstream/package.json index f9caf4b843..980932c18b 100644 --- a/deps/npm/node_modules/request/node_modules/stringstream/package.json +++ b/deps/npm/node_modules/request/node_modules/stringstream/package.json @@ -39,7 +39,7 @@ ], "directories": {}, "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", - "_from": "stringstream@~0.0.4", + "_from": "stringstream@>=0.0.4-0 <0.1.0-0", "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz", "bugs": { "url": "https://github.com/mhart/StringStream/issues" diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc b/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc deleted file mode 100644 index 4c1c8d4972..0000000000 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "node": true, - "asi": true, - "laxcomma": true -} diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json index 59c7f5cb50..12e2407c09 100644 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json @@ -26,7 +26,7 @@ "shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550", "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz" }, - "_from": "tunnel-agent@~0.4.0", + "_from": "tunnel-agent@>=0.4.0-0 <0.5.0-0", "_npmVersion": "1.3.21", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json index 0e94d8d149..d2db65f595 100755 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -59,7 +59,7 @@ "homepage": "https://github.com/mikeal/request", "_id": "request@2.42.0", "_shasum": "572bd0148938564040ac7ab148b96423a063304a", - "_from": "request@^2.42.0", + "_from": "request@>=2.42.0-0 <3.0.0-0", "_npmVersion": "1.4.9", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/semver/Makefile b/deps/npm/node_modules/semver/Makefile index 5717ccf42b..71af0e9750 100644 --- a/deps/npm/node_modules/semver/Makefile +++ b/deps/npm/node_modules/semver/Makefile @@ -8,12 +8,12 @@ all: $(files) clean: rm -f $(files) -semver.browser.js: head.js semver.js foot.js - ( cat head.js; \ +semver.browser.js: head.js.txt semver.js foot.js.txt + ( cat head.js.txt; \ cat semver.js | \ egrep -v '^ *\/\* nomin \*\/' | \ perl -pi -e 's/debug\([^\)]+\)//g'; \ - cat foot.js ) > semver.browser.js + cat foot.js.txt ) > semver.browser.js semver.min.js: semver.browser.js uglifyjs -m <semver.browser.js >semver.min.js diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index 4e95b84656..0f8a755a4c 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -41,53 +41,170 @@ A leading `"="` or `"v"` character is stripped off and ignored. ## Ranges -The following range styles are supported: - -* `1.2.3` A specific version. When nothing else will do. Must be a full - version number, with major, minor, and patch versions specified. - Note that build metadata is still ignored, so `1.2.3+build2012` will - satisfy this range. -* `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than a specific version. If there is no prerelease - tag on the version range, then no prerelease version will be allowed - either, even though these are technically "less than". -* `>=1.2.3` Greater than or equal to. Note that prerelease versions - are NOT equal to their "normal" equivalents, so `1.2.3-beta` will - not satisfy this range, but `2.3.0-beta` will. -* `<=1.2.3` Less than or equal to. In this case, prerelease versions - ARE allowed, so `1.2.3-beta` would satisfy. +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to `1.2.3`". When - using tilde operators, prerelease versions are supported as well, - but a prerelease of the next significant digit will NOT be - satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. -* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` "Compatible with `1.2.3`". When - using caret operators, anything from the specified version (including - prerelease) will be supported up to, but not including, the next - major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`, - while `1.2.2` and `2.0.0-beta` will not. -* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` "Compatible with `0.1.3`". `0.x.x` versions are - special: the first non-zero component indicates potentially breaking changes, - meaning the caret operator matches any version with the same first non-zero - component starting at the specified version. -* `^0.0.2` := `=0.0.2` "Only the version `0.0.2` is considered compatible" -* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" -* `^1.2` := `>=1.2.0-0 <2.0.0-0` "Any version compatible with `1.2`" -* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" -* `1.2.*` Same as `1.2.x`. -* `1.2` Same as `1.2.x`. -* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" -* `^1` := `>=1.0.0-0 <2.0.0-0` "Any version compatible with `1`" -* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" -* `1.*` Same as `1.x`. -* `1` Same as `1.x`. -* `*` Any version whatsoever. -* `x` Same as `*`. -* `""` (just an empty string) Same as `*`. - - -Ranges can be joined with either a space (which implies "and") or a -`||` (which implies "or"). + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +Note: this is the same as the `~>` operator in rubygems. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` ## Functions diff --git a/deps/npm/node_modules/semver/bin/semver b/deps/npm/node_modules/semver/bin/semver index 848420630b..41c148fb86 100755 --- a/deps/npm/node_modules/semver/bin/semver +++ b/deps/npm/node_modules/semver/bin/semver @@ -107,8 +107,8 @@ function help () { ,"" ,"-i --increment [<level>]" ," Increment a version by the specified level. Level can" - ," be one of: major, minor, patch, or prerelease" - ," Default level is 'patch'." + ," be one of: major, minor, patch, premajor, preminor," + ," prepatch, or prerelease. Default level is 'patch'." ," Only one version may be specified." ,"" ,"-l --loose" diff --git a/deps/npm/node_modules/semver/foot.js b/deps/npm/node_modules/semver/foot.js.txt index 8f83c20f8e..8f83c20f8e 100644 --- a/deps/npm/node_modules/semver/foot.js +++ b/deps/npm/node_modules/semver/foot.js.txt diff --git a/deps/npm/node_modules/semver/head.js b/deps/npm/node_modules/semver/head.js.txt index 6536865177..6536865177 100644 --- a/deps/npm/node_modules/semver/head.js +++ b/deps/npm/node_modules/semver/head.js.txt diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index b65d866c30..a575f0ebd4 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "2.3.0", + "version": "4.0.0", "description": "The semantic version parser used by npm.", "main": "semver.js", "browser": "semver.browser.js", @@ -21,13 +21,30 @@ "bin": { "semver": "./bin/semver" }, - "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | -d <dec>]\n Test if version(s) satisfy the supplied range(s), and sort them.\n\n Multiple versions or ranges may be supplied, unless increment\n or decrement options are specified. In that case, only a single\n version may be used, and it is incremented by the specified level\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the `v2.0.0` specification found at\n<http://semver.org/>.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Must be a full\n version number, with major, minor, and patch versions specified.\n Note that build metadata is still ignored, so `1.2.3+build2012` will\n satisfy this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to `1.2.3`\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` \"Compatible with `1.2.3`\". When\n using caret operators, anything from the specified version (including\n prerelease) will be supported up to, but not including, the next\n major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`,\n while `1.2.2` and `2.0.0-beta` will not.\n* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` \"Compatible with `0.1.3`\". `0.x.x` versions are\n special: the first non-zero component indicates potentially breaking changes,\n meaning the caret operator matches any version with the same first non-zero\n component starting at the specified version.\n* `^0.0.2` := `=0.0.2` \"Only the version `0.0.2` is considered compatible\"\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with `1.2`\"\n* `^1.2` := `>=1.2.0-0 <2.0.0-0` \"Any version compatible with `1.2`\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with `1.2`\"\n* `1.2.*` Same as `1.2.x`.\n* `1.2` Same as `1.2.x`.\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with `1`\"\n* `^1` := `>=1.0.0-0 <2.0.0-0` \"Any version compatible with `1`\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with `1`\"\n* `1.*` Same as `1.x`.\n* `1` Same as `1.x`.\n* `*` Any version whatsoever.\n* `x` Same as `*`.\n* `\"\"` (just an empty string) Same as `*`.\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* `valid(v)`: Return the parsed version, or null if it's not valid.\n* `inc(v, release)`: Return the version incremented by the release\n type (`major`, `premajor`, `minor`, `preminor`, `patch`,\n `prepatch`, or `prerelease`), or null if it's not valid\n * `premajor` in one call will bump the version up to the next major\n version and down to a prerelease of that major version.\n `preminor`, and `prepatch` work the same way.\n * If called from a non-prerelease version, the `prerelease` will work the\n same as `prepatch`. It increments the patch version, then makes a\n prerelease. If the input version is already a prerelease it simply\n increments it.\n\n### Comparison\n\n* `gt(v1, v2)`: `v1 > v2`\n* `gte(v1, v2)`: `v1 >= v2`\n* `lt(v1, v2)`: `v1 < v2`\n* `lte(v1, v2)`: `v1 <= v2`\n* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.\n* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if\n `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.\n* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions\n in descending order when passed to `Array.sort()`.\n\n\n### Ranges\n\n* `validRange(range)`: Return the valid range or null if it's not valid\n* `satisfies(version, range)`: Return true if the version satisfies the\n range.\n* `maxSatisfying(versions, range)`: Return the highest version in the list\n that satisfies the range, or `null` if none of them do.\n* `gtr(version, range)`: Return `true` if version is greater than all the\n versions possible in the range.\n* `ltr(version, range)`: Return `true` if version is less than all the\n versions possible in the range.\n* `outside(version, range, hilo)`: Return true if the version is outside\n the bounds of the range in either the high or low direction. The\n `hilo` argument must be either the string `'>'` or `'<'`. (This is\n the function called by `gtr` and `ltr`.)\n\nNote that, since ranges may be non-contiguous, a version might not be\ngreater than a range, less than a range, *or* satisfy a range! For\nexample, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`\nuntil `2.0.0`, so the version `1.2.10` would not be greater than the\nrange (because `2.0.1` satisfies, which is higher), nor less than the\nrange (since `1.2.8` satisfies, which is lower), and it also does not\nsatisfy the range.\n\nIf you want to know if a version satisfies or does not satisfy a\nrange, use the `satisfies(version, range)` function.\n", - "readmeFilename": "README.md", + "gitHead": "f71a46b52f5d413aff1cb3afa7d2f940b23ab1a0", "bugs": { "url": "https://github.com/isaacs/node-semver/issues" }, "homepage": "https://github.com/isaacs/node-semver", - "_id": "semver@2.3.0", - "_shasum": "d31b2903ebe2a1806c05b8e763916a7183108a15", - "_from": "semver@latest" + "_id": "semver@4.0.0", + "_shasum": "7be868416a5e669923a8e3af8bafa5faf62a151a", + "_from": "semver@>=4.0.0-0 <5.0.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "7be868416a5e669923a8e3af8bafa5faf62a151a", + "tarball": "http://registry.npmjs.org/semver/-/semver-4.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/semver/-/semver-4.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/semver/semver.browser.js b/deps/npm/node_modules/semver/semver.browser.js index 0f414c3d8d..afb68ac0c4 100644 --- a/deps/npm/node_modules/semver/semver.browser.js +++ b/deps/npm/node_modules/semver/semver.browser.js @@ -128,18 +128,18 @@ var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:(' + src[PRERELEASE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:(' + src[PRERELEASELOOSE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; -// >=2.x, for example, means >=2.0.0-0 -// <1.x would be the same as "<1.0.0-0", though. var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; @@ -236,7 +236,7 @@ function valid(version, loose) { exports.clean = clean; function clean(version, loose) { - var s = parse(version, loose); + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } @@ -348,14 +348,23 @@ SemVer.prototype.comparePre = function(other) { SemVer.prototype.inc = function(release) { switch (release) { case 'premajor': - this.inc('major'); + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; this.inc('pre'); break; case 'preminor': - this.inc('minor'); + this.prerelease.length = 0; + this.patch = 0; + this.minor++; this.inc('pre'); break; case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; this.inc('patch'); this.inc('pre'); break; @@ -366,11 +375,25 @@ SemVer.prototype.inc = function(release) { this.inc('patch'); this.inc('pre'); break; + case 'major': - this.major++; - this.minor = -1; + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; case 'minor': - this.minor++; + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; this.patch = 0; this.prerelease = []; break; @@ -383,8 +406,8 @@ SemVer.prototype.inc = function(release) { this.patch++; this.prerelease = []; break; - // This probably shouldn't be used publically. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; @@ -504,8 +527,16 @@ exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { - case '===': ret = a === b; break; - case '!==': ret = a !== b; break; + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; @@ -537,6 +568,8 @@ function Comparator(comp, loose) { this.value = ''; else this.value = this.operator + this.semver.version; + + ; } var ANY = {}; @@ -548,24 +581,14 @@ Comparator.prototype.parse = function(comp) { throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; - else { + else this.semver = new SemVer(m[2], this.loose); - - // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) - // >=1.2.3 DOES NOT allow 1.2.3-beta - // <=1.2.3 DOES allow 1.2.3-beta - // However, <1.2.3 does NOT allow 1.2.3-beta, - // even though `1.2.3-beta < 1.2.3` - // The assumption is that the 1.2.3 version has something you - // *don't* want, so we push the prerelease down to the minimum. - if (this.operator === '<' && !this.semver.prerelease.length) { - this.semver.prerelease = ['0']; - this.semver.format(); - } - } }; Comparator.prototype.inspect = function() { @@ -578,8 +601,14 @@ Comparator.prototype.toString = function() { Comparator.prototype.test = function(version) { ; - return (this.semver === ANY) ? true : - cmp(version, this.operator, this.semver, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); }; @@ -716,20 +745,20 @@ function replaceTilde(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { ; if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else - // ~1.2.3 == >=1.2.3-0 <1.3.0-0 - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; ; return ret; @@ -749,6 +778,7 @@ function replaceCarets(comp, loose) { } function replaceCaret(comp, loose) { + ; var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { ; @@ -757,35 +787,38 @@ function replaceCaret(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else - ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { ; if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0-0'; + ' <' + (+M + 1) + '.0.0'; } else { + ; if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; } else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; } ; @@ -814,7 +847,7 @@ function replaceXRange(comp, loose) { gtlt = ''; if (gtlt && anyX) { - // replace X with 0, and then append the -0 min-prerelease + // replace X with 0 if (xM) M = 0; if (xm) @@ -823,9 +856,9 @@ function replaceXRange(comp, loose) { p = 0; if (gtlt === '>') { - // >1 => >=2.0.0-0 - // >1.2 => >=1.3.0-0 - // >1.2.3 => >= 1.2.4-0 + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xM) { // no change @@ -840,17 +873,14 @@ function replaceXRange(comp, loose) { } - ret = gtlt + M + '.' + m + '.' + p + '-0'; + ret = gtlt + M + '.' + m + '.' + p; } else if (xM) { // allow any ret = '*'; } else if (xm) { - // append '-0' onto the version, otherwise - // '1.x.x' matches '2.0.0-beta', since the tag - // *lowers* the version value - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } ; @@ -869,9 +899,9 @@ function replaceStars(comp, loose) { // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { @@ -879,18 +909,18 @@ function hyphenReplace($0, if (isX(fM)) from = ''; else if (isX(fm)) - from = '>=' + fM + '.0.0-0'; + from = '>=' + fM + '.0.0'; else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0-0'; + from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0-0'; + to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else @@ -904,6 +934,10 @@ function hyphenReplace($0, Range.prototype.test = function(version) { if (!version) return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; @@ -916,6 +950,31 @@ function testSet(set, version) { if (!set[i].test(version)) return false; } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + ; + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + return true; } diff --git a/deps/npm/node_modules/semver/semver.browser.js.gz b/deps/npm/node_modules/semver/semver.browser.js.gz Binary files differindex 2b07bae519..2d01ad972b 100644 --- a/deps/npm/node_modules/semver/semver.browser.js.gz +++ b/deps/npm/node_modules/semver/semver.browser.js.gz diff --git a/deps/npm/node_modules/semver/semver.js b/deps/npm/node_modules/semver/semver.js index a7385b41c5..8b5b93f96d 100644 --- a/deps/npm/node_modules/semver/semver.js +++ b/deps/npm/node_modules/semver/semver.js @@ -138,18 +138,18 @@ var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:(' + src[PRERELEASE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:(' + src[PRERELEASELOOSE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; -// >=2.x, for example, means >=2.0.0-0 -// <1.x would be the same as "<1.0.0-0", though. var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; @@ -246,7 +246,7 @@ function valid(version, loose) { exports.clean = clean; function clean(version, loose) { - var s = parse(version, loose); + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } @@ -358,14 +358,23 @@ SemVer.prototype.comparePre = function(other) { SemVer.prototype.inc = function(release) { switch (release) { case 'premajor': - this.inc('major'); + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; this.inc('pre'); break; case 'preminor': - this.inc('minor'); + this.prerelease.length = 0; + this.patch = 0; + this.minor++; this.inc('pre'); break; case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; this.inc('patch'); this.inc('pre'); break; @@ -376,11 +385,25 @@ SemVer.prototype.inc = function(release) { this.inc('patch'); this.inc('pre'); break; + case 'major': - this.major++; - this.minor = -1; + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; case 'minor': - this.minor++; + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; this.patch = 0; this.prerelease = []; break; @@ -393,8 +416,8 @@ SemVer.prototype.inc = function(release) { this.patch++; this.prerelease = []; break; - // This probably shouldn't be used publically. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; @@ -514,8 +537,16 @@ exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { - case '===': ret = a === b; break; - case '!==': ret = a !== b; break; + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; @@ -547,6 +578,8 @@ function Comparator(comp, loose) { this.value = ''; else this.value = this.operator + this.semver.version; + + debug('comp', this); } var ANY = {}; @@ -558,24 +591,14 @@ Comparator.prototype.parse = function(comp) { throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; - else { + else this.semver = new SemVer(m[2], this.loose); - - // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) - // >=1.2.3 DOES NOT allow 1.2.3-beta - // <=1.2.3 DOES allow 1.2.3-beta - // However, <1.2.3 does NOT allow 1.2.3-beta, - // even though `1.2.3-beta < 1.2.3` - // The assumption is that the 1.2.3 version has something you - // *don't* want, so we push the prerelease down to the minimum. - if (this.operator === '<' && !this.semver.prerelease.length) { - this.semver.prerelease = ['0']; - this.semver.format(); - } - } }; Comparator.prototype.inspect = function() { @@ -588,8 +611,14 @@ Comparator.prototype.toString = function() { Comparator.prototype.test = function(version) { debug('Comparator.test', version, this.loose); - return (this.semver === ANY) ? true : - cmp(version, this.operator, this.semver, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); }; @@ -726,20 +755,20 @@ function replaceTilde(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else - // ~1.2.3 == >=1.2.3-0 <1.3.0-0 - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; debug('tilde return', ret); return ret; @@ -759,6 +788,7 @@ function replaceCarets(comp, loose) { } function replaceCaret(comp, loose) { + debug('caret', comp, loose); var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr); @@ -767,35 +797,38 @@ function replaceCaret(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else - ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { debug('replaceCaret pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0-0'; + ' <' + (+M + 1) + '.0.0'; } else { + debug('no pr'); if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; } else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; } debug('caret return', ret); @@ -824,7 +857,7 @@ function replaceXRange(comp, loose) { gtlt = ''; if (gtlt && anyX) { - // replace X with 0, and then append the -0 min-prerelease + // replace X with 0 if (xM) M = 0; if (xm) @@ -833,9 +866,9 @@ function replaceXRange(comp, loose) { p = 0; if (gtlt === '>') { - // >1 => >=2.0.0-0 - // >1.2 => >=1.3.0-0 - // >1.2.3 => >= 1.2.4-0 + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xM) { // no change @@ -850,17 +883,14 @@ function replaceXRange(comp, loose) { } - ret = gtlt + M + '.' + m + '.' + p + '-0'; + ret = gtlt + M + '.' + m + '.' + p; } else if (xM) { // allow any ret = '*'; } else if (xm) { - // append '-0' onto the version, otherwise - // '1.x.x' matches '2.0.0-beta', since the tag - // *lowers* the version value - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } debug('xRange return', ret); @@ -879,9 +909,9 @@ function replaceStars(comp, loose) { // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { @@ -889,18 +919,18 @@ function hyphenReplace($0, if (isX(fM)) from = ''; else if (isX(fm)) - from = '>=' + fM + '.0.0-0'; + from = '>=' + fM + '.0.0'; else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0-0'; + from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0-0'; + to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else @@ -914,6 +944,10 @@ function hyphenReplace($0, Range.prototype.test = function(version) { if (!version) return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; @@ -926,6 +960,31 @@ function testSet(set, version) { if (!set[i].test(version)) return false; } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + return true; } diff --git a/deps/npm/node_modules/semver/semver.min.js b/deps/npm/node_modules/semver/semver.min.js index 66e13b8633..0dd841cb4e 100644 --- a/deps/npm/node_modules/semver/semver.min.js +++ b/deps/npm/node_modules/semver/semver.min.js @@ -1 +1 @@ -(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[a]+")";var l=n++;t[l]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[p]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var $=n++;t[$]=t[i]+"|x|X|\\*";var j=n++;t[j]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[l]+")"+")?)?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:("+t[p]+")"+")?)?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[j]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[j]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[j]+"$";var P=n++;t[P]="^"+t[A]+t[k]+"$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[y]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[j]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[j]+")"+"\\s+-\\s+"+"("+t[j]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B<n;B++){if(!r[B])r[B]=new RegExp(t[B])}e.parse=D;function D(e,t){var n=t?r[d]:r[m];return n.test(e)?new H(e,t):null}e.valid=F;function F(e,r){var t=D(e,r);return t?t.version:null}e.clean=G;function G(e,r){var t=D(e,r);return t?t.version:null}e.SemVer=H;function H(e,t){if(e instanceof H){if(e.loose===t)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(!(this instanceof H))return new H(e,t);this.loose=t;var n=e.trim().match(t?r[d]:r[m]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e});this.build=n[5]?n[5].split("."):[];this.format()}H.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};H.prototype.inspect=function(){return'<SemVer "'+this+'">'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"premajor":this.inc("major");this.inc("pre");break;case"preminor":this.inc("minor");this.inc("pre");break;case"prepatch":this.inc("patch");this.inc("pre");break;case"prerelease":if(this.prerelease.length===0)this.inc("patch");this.inc("pre");break;case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:e<r?-1:e>r?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=ar;function ar(e,r,t){return W(e,r,t)!==0}e.gte=or;function or(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=ar(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=or(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=cr;function cr(e,r){if(e instanceof cr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.parse(e);if(this.semver===lr)this.value="";else this.value=this.operator+this.semver.version}var lr={};cr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(!n[2])this.semver=lr;else{this.semver=new H(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};cr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'};cr.prototype.toString=function(){return this.value};cr.prototype.test=function(e){return this.semver===lr?true:ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,kr);e=e.replace(r[L],X);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new cr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=br(e,r);e=jr(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[P]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+".0-0 <"+(+r+1)+".0.0-0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s="="+r+"."+t+"."+n+i;else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0-0"}else{if(r==="0"){if(t==="0")s="="+r+"."+t+"."+n;else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+(+r+1)+".0.0-0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=mr(t);var o=a||mr(n);var f=o||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(a)t=0;if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(a){}else if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(a){e="*"}else if(o){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(f){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function jr(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,a,o,f,u,c,l,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0-0";else if(mr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(mr(f))o="";else if(mr(u))o="<"+(+f+1)+".0.0-0";else if(mr(c))o="<"+f+"."+(+u+1)+".0-0";else if(l)o="<="+f+"."+u+"."+c+"-"+l;else o="<="+o;return(r+" "+o).trim()}pr.prototype.test=function(e){if(!e)return false;for(var r=0;r<this.set.length;r++){if(Er(this.set[r],e))return true}return false};function Er(e,r){for(var t=0;t<e.length;t++){if(!e[t].test(r))return false}return true}e.satisfies=xr;function xr(e,r,t){try{r=new pr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Rr;function Rr(e,r,t){return e.filter(function(e){return xr(e,r,t)}).sort(function(e,r){return er(e,r,t)})[0]||null}e.validRange=Sr;function Sr(e,r){try{return new pr(e,r).range||"*"}catch(t){return null}}e.ltr=Vr;function Vr(e,r,t){return Tr(e,r,"<",t)}e.gtr=Ir;function Ir(e,r,t){return Tr(e,r,">",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new pr(r,n);var i,s,a,o,f;switch(t){case">":i=nr;s=fr;a=ir;o=">";f=">=";break;case"<":i=ir;s=or;a=nr;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u<r.set.length;++u){var c=r.set[u];var l=null;var p=null;c.forEach(function(e){l=l||e;p=p||e;if(i(e.semver,l.semver,n)){l=e}else if(a(e.semver,p.semver,n)){p=e}});if(l.operator===o||l.operator===f){return false}if((!p.operator||p.operator===o)&&s(e,p.semver)){return false}else if(p.operator===f&&a(e,p.semver)){return false}}return true}if(typeof define==="function"&&define.amd)define(e)})(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={});
\ No newline at end of file +(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var o=n++;t[o]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var a=n++;t[a]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[o]+")";var l=n++;t[l]="(?:"+t[s]+"|"+t[o]+")";var c=n++;t[c]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var p=n++;t[p]="(?:-?("+t[l]+"(?:\\."+t[l]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[a]+t[c]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[p]+"?"+t[v]+"?";var y=n++;t[y]="^"+w+"$";var d=n++;t[d]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var $=n++;t[$]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:"+t[c]+")?"+t[v]+"?"+")?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:"+t[p]+")?"+t[v]+"?"+")?)?";var E=n++;t[E]="^"+t[d]+"\\s*"+t[$]+"$";var x=n++;t[x]="^"+t[d]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[$]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[$]+"$";var P=n++;t[P]="^"+t[A]+t[k]+"$";var Z=n++;t[Z]="^"+t[d]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[d]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[d]+"\\s*("+w+"|"+t[$]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[$]+")"+"\\s+-\\s+"+"("+t[$]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B<n;B++){if(!r[B])r[B]=new RegExp(t[B])}e.parse=D;function D(e,t){var n=t?r[y]:r[m];return n.test(e)?new H(e,t):null}e.valid=F;function F(e,r){var t=D(e,r);return t?t.version:null}e.clean=G;function G(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=H;function H(e,t){if(e instanceof H){if(e.loose===t)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(!(this instanceof H))return new H(e,t);this.loose=t;var n=e.trim().match(t?r[y]:r[m]);if(!n)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(!n[4])this.prerelease=[];else this.prerelease=n[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e});this.build=n[5]?n[5].split("."):[];this.format()}H.prototype.format=function(){this.version=this.major+"."+this.minor+"."+this.patch;if(this.prerelease.length)this.version+="-"+this.prerelease.join(".");return this.version};H.prototype.inspect=function(){return'<SemVer "'+this+'">'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre");break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre");break;case"prepatch":this.prerelease.length=0;this.inc("patch");this.inc("pre");break;case"prerelease":if(this.prerelease.length===0)this.inc("patch");this.inc("pre");break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:e<r?-1:e>r?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=or;function or(e,r,t){return W(e,r,t)!==0}e.gte=ar;function ar(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=or(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=ar(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=lr;function lr(e,r){if(e instanceof lr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof lr))return new lr(e,r);this.loose=r;this.parse(e);if(this.semver===cr)this.value="";else this.value=this.operator+this.semver.version}var cr={};lr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=cr;else this.semver=new H(n[2],this.loose)};lr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'};lr.prototype.toString=function(){return this.value};lr.prototype.test=function(e){if(this.semver===cr)return true;if(typeof e==="string")e=new H(e,this.loose);return ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,kr);e=e.replace(r[L],X);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new lr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=yr(e,r);e=gr(e,r);e=br(e,r);e=$r(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function yr(e,r){return e.trim().split(/\s+/).map(function(e){return dr(e,r)}).join(" ")}function dr(e,t){var n=t?r[P]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var o=mr(t);var a=o||mr(n);var f=a||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(o)t=0;if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(o){}else if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i}else if(o){e="*"}else if(a){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function $r(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,o,a,f,u,l,c,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0";else if(mr(i))r=">="+t+"."+n+".0";else r=">="+r;if(mr(f))a="";else if(mr(u))a="<"+(+f+1)+".0.0";else if(mr(l))a="<"+f+"."+(+u+1)+".0";else if(c)a="<="+f+"."+u+"."+l+"-"+c;else a="<="+a;return(r+" "+a).trim()}pr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new H(e,this.loose);for(var r=0;r<this.set.length;r++){if(Er(this.set[r],e))return true}return false};function Er(e,r){for(var t=0;t<e.length;t++){if(!e[t].test(r))return false}if(r.prerelease.length){for(var t=0;t<e.length;t++){if(e[t].semver===cr)return true;if(e[t].semver.prerelease.length>0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=xr;function xr(e,r,t){try{r=new pr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Rr;function Rr(e,r,t){return e.filter(function(e){return xr(e,r,t)}).sort(function(e,r){return er(e,r,t)})[0]||null}e.validRange=Sr;function Sr(e,r){try{return new pr(e,r).range||"*"}catch(t){return null}}e.ltr=Vr;function Vr(e,r,t){return Tr(e,r,"<",t)}e.gtr=Ir;function Ir(e,r,t){return Tr(e,r,">",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new pr(r,n);var i,s,o,a,f;switch(t){case">":i=nr;s=fr;o=ir;a=">";f=">=";break;case"<":i=ir;s=ar;o=nr;a="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u<r.set.length;++u){var l=r.set[u];var c=null;var p=null;l.forEach(function(e){c=c||e;p=p||e;if(i(e.semver,c.semver,n)){c=e}else if(o(e.semver,p.semver,n)){p=e}});if(c.operator===a||c.operator===f){return false}if((!p.operator||p.operator===a)&&s(e,p.semver)){return false}else if(p.operator===f&&o(e,p.semver)){return false}}return true}if(typeof define==="function"&&define.amd)define(e)})(typeof exports==="object"?exports:typeof define==="function"&&define.amd?{}:semver={});
\ No newline at end of file diff --git a/deps/npm/node_modules/semver/semver.min.js.gz b/deps/npm/node_modules/semver/semver.min.js.gz Binary files differindex cc05248ffd..2c327af0d2 100644 --- a/deps/npm/node_modules/semver/semver.min.js.gz +++ b/deps/npm/node_modules/semver/semver.min.js.gz diff --git a/deps/npm/node_modules/semver/test/clean.js b/deps/npm/node_modules/semver/test/clean.js new file mode 100644 index 0000000000..1ab13e416f --- /dev/null +++ b/deps/npm/node_modules/semver/test/clean.js @@ -0,0 +1,25 @@ +var tap = require('tap'); +var test = tap.test; +var semver = require('../semver.js'); +var clean = semver.clean; + +test('\nclean tests', function(t) { + // [range, version] + // Version should be detectable despite extra characters + [ + ['1.2.3', '1.2.3'], + [' 1.2.3 ', '1.2.3'], + [' 1.2.3-4 ', '1.2.3-4'], + [' 1.2.3-pre ', '1.2.3-pre'], + [' =v1.2.3 ', '1.2.3'], + ['v1.2.3', '1.2.3'], + [' v1.2.3 ', '1.2.3'], + ['\t1.2.3', '1.2.3'] + ].forEach(function(tuple) { + var range = tuple[0]; + var version = tuple[1]; + var msg = 'clean(' + range + ') = ' + version; + t.equal(clean(range), version, msg); + }); + t.end(); +}); diff --git a/deps/npm/node_modules/semver/test/gtr.js b/deps/npm/node_modules/semver/test/gtr.js index cb6199efcf..8537fac0be 100644 --- a/deps/npm/node_modules/semver/test/gtr.js +++ b/deps/npm/node_modules/semver/test/gtr.js @@ -39,7 +39,7 @@ test('\ngtr tests', function(t) { ['~v0.5.4-pre', '0.6.1-pre'], ['=0.7.x', '0.8.0'], ['=0.7.x', '0.8.0-asdf'], - ['<=0.7.x', '0.7.0'], + ['<0.7.x', '0.7.0'], ['~1.2.2', '1.3.0'], ['1.0.0 - 2.0.0', '2.2.3'], ['1.0.0', '1.0.1'], diff --git a/deps/npm/node_modules/semver/test/index.js b/deps/npm/node_modules/semver/test/index.js index 6285b693f9..9f9a36d98f 100644 --- a/deps/npm/node_modules/semver/test/index.js +++ b/deps/npm/node_modules/semver/test/index.js @@ -1,3 +1,5 @@ +'use strict'; + var tap = require('tap'); var test = tap.test; var semver = require('../semver.js'); @@ -130,6 +132,15 @@ test('\nrange tests', function(t) { // [range, version] // version should be included by range [['1.0.0 - 2.0.0', '1.2.3'], + ['^1.2.3+build', '1.2.3'], + ['^1.2.3+build', '1.3.0'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], + ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], + ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], ['1.0.0', '1.0.0'], ['>=*', '0.2.4'], ['', '1.0.0'], @@ -187,13 +198,10 @@ test('\nrange tests', function(t) { ['>= 1', '1.0.0'], ['<1.2', '1.1.1'], ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], ['~v0.5.4-pre', '0.5.5'], ['~v0.5.4-pre', '0.5.4'], ['=0.7.x', '0.7.2'], ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], ['<=0.7.x', '0.6.2'], ['~1.2.1 >=1.2.3', '1.2.3'], ['~1.2.1 =1.2.3', '1.2.3'], @@ -205,17 +213,15 @@ test('\nrange tests', function(t) { ['1.2.3 >=1.2.1', '1.2.3'], ['>=1.2.3 >=1.2.1', '1.2.3'], ['>=1.2.1 >=1.2.3', '1.2.3'], - ['<=1.2.3', '1.2.3-beta'], - ['>1.2', '1.3.0-beta'], ['>=1.2', '1.2.8'], ['^1.2.3', '1.8.1'], - ['^1.2.3', '1.2.3-beta'], ['^0.1.2', '0.1.2'], ['^0.1', '0.1.2'], ['^1.2', '1.4.2'], ['^1.2 ^1', '1.4.2'], - ['^1.2', '1.2.0-pre'], - ['^1.2.3', '1.2.3-pre'] + ['^1.2.3-alpha', '1.2.3-pre'], + ['^1.2.0-alpha', '1.2.0-pre'], + ['^0.0.1-alpha', '0.0.1-beta'] ].forEach(function(v) { var range = v[0]; var ver = v[1]; @@ -229,6 +235,20 @@ test('\nnegative range tests', function(t) { // [range, version] // version should not be included by range [['1.0.0 - 2.0.0', '2.2.3'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], + ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], + ['^1.2.3+build', '2.0.0'], + ['^1.2.3+build', '1.2.0'], + ['^1.2.3', '1.2.3-pre'], + ['^1.2', '1.2.0-pre'], + ['>1.2', '1.3.0-beta'], + ['<=1.2.3', '1.2.3-beta'], + ['^1.2.3', '1.2.3-beta'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], ['1.0.0', '1.0.1'], ['>=1.0.0', '0.0.0'], ['>=1.0.0', '0.0.1'], @@ -268,8 +288,6 @@ test('\nnegative range tests', function(t) { ['>=1.2', '1.1.1'], ['1', '2.0.0beta', true], ['~v0.5.4-beta', '0.5.4-alpha'], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], ['=0.7.x', '0.8.2'], ['>=0.7.x', '0.6.2'], ['<=0.7.x', '0.7.2'], @@ -327,12 +345,14 @@ test('\nincrement versions test', function(t) { ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], + ['1.2.0', 'prepatch', '1.2.1-0'], + ['1.2.0-1', 'prepatch', '1.2.1-0'], ['1.2.0', 'preminor', '1.3.0-0'], + ['1.2.3-1', 'preminor', '1.3.0-0'], ['1.2.0', 'premajor', '2.0.0-0'], - ['1.2.0', 'preminor', '1.3.0-0'], - ['1.2.0', 'premajor', '2.0.0-0'] - - + ['1.2.3-1', 'premajor', '2.0.0-0'], + ['1.2.0-1', 'minor', '1.2.0'], + ['1.0.0-1', 'major', '1.0.0'] ].forEach(function(v) { var pre = v[0]; var what = v[1]; @@ -351,18 +371,18 @@ test('\nvalid range test', function(t) { // translate ranges into their canonical form [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], ['1.0.0', '1.0.0'], - ['>=*', '>=0.0.0-0'], + ['>=*', '>=0.0.0'], ['', '*'], ['*', '*'], ['*', '*'], ['>=1.0.0', '>=1.0.0'], ['>1.0.0', '>1.0.0'], ['<=2.0.0', '<=2.0.0'], - ['1', '>=1.0.0-0 <2.0.0-0'], + ['1', '>=1.0.0 <2.0.0'], ['<=2.0.0', '<=2.0.0'], ['<=2.0.0', '<=2.0.0'], - ['<2.0.0', '<2.0.0-0'], - ['<2.0.0', '<2.0.0-0'], + ['<2.0.0', '<2.0.0'], + ['<2.0.0', '<2.0.0'], ['>= 1.0.0', '>=1.0.0'], ['>= 1.0.0', '>=1.0.0'], ['>= 1.0.0', '>=1.0.0'], @@ -371,56 +391,56 @@ test('\nvalid range test', function(t) { ['<= 2.0.0', '<=2.0.0'], ['<= 2.0.0', '<=2.0.0'], ['<= 2.0.0', '<=2.0.0'], - ['< 2.0.0', '<2.0.0-0'], - ['< 2.0.0', '<2.0.0-0'], + ['< 2.0.0', '<2.0.0'], + ['< 2.0.0', '<2.0.0'], ['>=0.1.97', '>=0.1.97'], ['>=0.1.97', '>=0.1.97'], ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], ['||', '||'], - ['2.x.x', '>=2.0.0-0 <3.0.0-0'], - ['1.2.x', '>=1.2.0-0 <1.3.0-0'], - ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], - ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['2.x.x', '>=2.0.0 <3.0.0'], + ['1.2.x', '>=1.2.0 <1.3.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], ['x', '*'], - ['2.*.*', '>=2.0.0-0 <3.0.0-0'], - ['1.2.*', '>=1.2.0-0 <1.3.0-0'], - ['1.2.* || 2.*', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['2.*.*', '>=2.0.0 <3.0.0'], + ['1.2.*', '>=1.2.0 <1.3.0'], + ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], ['*', '*'], - ['2', '>=2.0.0-0 <3.0.0-0'], - ['2.3', '>=2.3.0-0 <2.4.0-0'], - ['~2.4', '>=2.4.0-0 <2.5.0-0'], - ['~2.4', '>=2.4.0-0 <2.5.0-0'], - ['~>3.2.1', '>=3.2.1-0 <3.3.0-0'], - ['~1', '>=1.0.0-0 <2.0.0-0'], - ['~>1', '>=1.0.0-0 <2.0.0-0'], - ['~> 1', '>=1.0.0-0 <2.0.0-0'], - ['~1.0', '>=1.0.0-0 <1.1.0-0'], - ['~ 1.0', '>=1.0.0-0 <1.1.0-0'], - ['^0', '>=0.0.0-0 <1.0.0-0'], - ['^ 1', '>=1.0.0-0 <2.0.0-0'], - ['^0.1', '>=0.1.0-0 <0.2.0-0'], - ['^1.0', '>=1.0.0-0 <2.0.0-0'], - ['^1.2', '>=1.2.0-0 <2.0.0-0'], - ['^0.0.1', '=0.0.1'], - ['^0.0.1-beta', '=0.0.1-beta'], - ['^0.1.2', '>=0.1.2-0 <0.2.0-0'], - ['^1.2.3', '>=1.2.3-0 <2.0.0-0'], - ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0-0'], - ['<1', '<1.0.0-0'], - ['< 1', '<1.0.0-0'], - ['>=1', '>=1.0.0-0'], - ['>= 1', '>=1.0.0-0'], - ['<1.2', '<1.2.0-0'], - ['< 1.2', '<1.2.0-0'], - ['1', '>=1.0.0-0 <2.0.0-0'], + ['2', '>=2.0.0 <3.0.0'], + ['2.3', '>=2.3.0 <2.4.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~>3.2.1', '>=3.2.1 <3.3.0'], + ['~1', '>=1.0.0 <2.0.0'], + ['~>1', '>=1.0.0 <2.0.0'], + ['~> 1', '>=1.0.0 <2.0.0'], + ['~1.0', '>=1.0.0 <1.1.0'], + ['~ 1.0', '>=1.0.0 <1.1.0'], + ['^0', '>=0.0.0 <1.0.0'], + ['^ 1', '>=1.0.0 <2.0.0'], + ['^0.1', '>=0.1.0 <0.2.0'], + ['^1.0', '>=1.0.0 <2.0.0'], + ['^1.2', '>=1.2.0 <2.0.0'], + ['^0.0.1', '>=0.0.1 <0.0.2'], + ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], + ['^0.1.2', '>=0.1.2 <0.2.0'], + ['^1.2.3', '>=1.2.3 <2.0.0'], + ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], + ['<1', '<1.0.0'], + ['< 1', '<1.0.0'], + ['>=1', '>=1.0.0'], + ['>= 1', '>=1.0.0'], + ['<1.2', '<1.2.0'], + ['< 1.2', '<1.2.0'], + ['1', '>=1.0.0 <2.0.0'], ['>01.02.03', '>1.2.3', true], ['>01.02.03', null], - ['~1.2.3beta', '>=1.2.3-beta <1.3.0-0', true], + ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], ['~1.2.3beta', null], - ['^ 1.2 ^ 1', '>=1.2.0-0 <2.0.0-0 >=1.0.0-0 <2.0.0-0'] + ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] ].forEach(function(v) { var pre = v[0]; var wanted = v[1]; @@ -438,7 +458,7 @@ test('\ncomparators test', function(t) { // turn range into a set of individual comparators [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], ['1.0.0', [['1.0.0']]], - ['>=*', [['>=0.0.0-0']]], + ['>=*', [['>=0.0.0']]], ['', [['']]], ['*', [['']]], ['*', [['']]], @@ -448,11 +468,11 @@ test('\ncomparators test', function(t) { ['>1.0.0', [['>1.0.0']]], ['>1.0.0', [['>1.0.0']]], ['<=2.0.0', [['<=2.0.0']]], - ['1', [['>=1.0.0-0', '<2.0.0-0']]], + ['1', [['>=1.0.0', '<2.0.0']]], ['<=2.0.0', [['<=2.0.0']]], ['<=2.0.0', [['<=2.0.0']]], - ['<2.0.0', [['<2.0.0-0']]], - ['<2.0.0', [['<2.0.0-0']]], + ['<2.0.0', [['<2.0.0']]], + ['<2.0.0', [['<2.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], @@ -461,47 +481,48 @@ test('\ncomparators test', function(t) { ['<= 2.0.0', [['<=2.0.0']]], ['<= 2.0.0', [['<=2.0.0']]], ['<= 2.0.0', [['<=2.0.0']]], - ['< 2.0.0', [['<2.0.0-0']]], - ['<\t2.0.0', [['<2.0.0-0']]], + ['< 2.0.0', [['<2.0.0']]], + ['<\t2.0.0', [['<2.0.0']]], ['>=0.1.97', [['>=0.1.97']]], ['>=0.1.97', [['>=0.1.97']]], ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], ['||', [[''], ['']]], - ['2.x.x', [['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.x', [['>=1.2.0-0', '<1.3.0-0']]], - ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['2.x.x', [['>=2.0.0', '<3.0.0']]], + ['1.2.x', [['>=1.2.0', '<1.3.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['x', [['']]], - ['2.*.*', [['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.*', [['>=1.2.0-0', '<1.3.0-0']]], - ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['2.*.*', [['>=2.0.0', '<3.0.0']]], + ['1.2.*', [['>=1.2.0', '<1.3.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['*', [['']]], - ['2', [['>=2.0.0-0', '<3.0.0-0']]], - ['2.3', [['>=2.3.0-0', '<2.4.0-0']]], - ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], - ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], - ['~>3.2.1', [['>=3.2.1-0', '<3.3.0-0']]], - ['~1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~>1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~> 1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~1.0', [['>=1.0.0-0', '<1.1.0-0']]], - ['~ 1.0', [['>=1.0.0-0', '<1.1.0-0']]], - ['~ 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], - ['~> 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], - ['<1', [['<1.0.0-0']]], - ['< 1', [['<1.0.0-0']]], - ['>=1', [['>=1.0.0-0']]], - ['>= 1', [['>=1.0.0-0']]], - ['<1.2', [['<1.2.0-0']]], - ['< 1.2', [['<1.2.0-0']]], - ['1', [['>=1.0.0-0', '<2.0.0-0']]], - ['1 2', [['>=1.0.0-0', '<2.0.0-0', '>=2.0.0-0', '<3.0.0-0']]], - ['1.2 - 3.4.5', [['>=1.2.0-0', '<=3.4.5']]], - ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0-0']]] + ['2', [['>=2.0.0', '<3.0.0']]], + ['2.3', [['>=2.3.0', '<2.4.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], + ['~1', [['>=1.0.0', '<2.0.0']]], + ['~>1', [['>=1.0.0', '<2.0.0']]], + ['~> 1', [['>=1.0.0', '<2.0.0']]], + ['~1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['<1', [['<1.0.0']]], + ['< 1', [['<1.0.0']]], + ['>=1', [['>=1.0.0']]], + ['>= 1', [['>=1.0.0']]], + ['<1.2', [['<1.2.0']]], + ['< 1.2', [['<1.2.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], + ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], + ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], + ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]] ].forEach(function(v) { var pre = v[0]; var wanted = v[1]; @@ -555,7 +576,7 @@ test('\nstrict vs loose version numbers', function(t) { test('\nstrict vs loose ranges', function(t) { [['>=01.02.03', '>=1.2.3'], - ['~1.02.03beta', '>=1.2.3-beta <1.3.0-0'] + ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] ].forEach(function(v) { var loose = v[0]; var comps = v[1]; diff --git a/deps/npm/node_modules/semver/test/ltr.js b/deps/npm/node_modules/semver/test/ltr.js index a4f503a3c4..ecd1387ddf 100644 --- a/deps/npm/node_modules/semver/test/ltr.js +++ b/deps/npm/node_modules/semver/test/ltr.js @@ -66,6 +66,10 @@ test('\nltr tests', function(t) { ['>1', '1.0.0beta', true], ['> 1', '1.0.0beta', true], ['=0.7.x', '0.6.2'], + ['=0.7.x', '0.7.0-asdf'], + ['^1', '1.0.0-0'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], ['>=0.7.x', '0.6.2'] ].forEach(function(tuple) { var range = tuple[0]; @@ -145,24 +149,27 @@ test('\nnegative ltr tests', function(t) { ['>= 1', '1.0.0'], ['<1.2', '1.1.1'], ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], ['~v0.5.4-pre', '0.5.5'], ['~v0.5.4-pre', '0.5.4'], ['=0.7.x', '0.7.2'], ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], ['<=0.7.x', '0.6.2'], ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], ['>=0.2.3 <=0.2.4', '0.2.4'], ['1.0.0 - 2.0.0', '2.0.0'], - ['^1', '1.0.0-0'], ['^3.0.0', '4.0.0'], ['^1.0.0 || ~2.0.1', '2.0.0'], ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], + ['^1.0.0alpha', '1.0.0beta', true], + ['~1.0.0alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0beta', true], + ['~1.0.0-alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0-beta'], + ['~1.0.0-alpha', '1.0.0-beta'], + ['=0.1.0', '1.0.0'] ].forEach(function(tuple) { var range = tuple[0]; var version = tuple[1]; diff --git a/deps/npm/node_modules/semver/test/no-module.js b/deps/npm/node_modules/semver/test/no-module.js index 96d1cd1fc5..8b50873f13 100644 --- a/deps/npm/node_modules/semver/test/no-module.js +++ b/deps/npm/node_modules/semver/test/no-module.js @@ -4,9 +4,9 @@ var test = tap.test; test('no module system', function(t) { var fs = require('fs'); var vm = require('vm'); - var head = fs.readFileSync(require.resolve('../head.js'), 'utf8'); + var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); var src = fs.readFileSync(require.resolve('../'), 'utf8'); - var foot = fs.readFileSync(require.resolve('../foot.js'), 'utf8'); + var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); vm.runInThisContext(head + src + foot, 'semver.js'); // just some basic poking to see if it did some stuff diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js index 0ca7705284..630722099e 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js @@ -240,7 +240,7 @@ function howMuchToRead(n, state) { if (state.objectMode) return n === 0 ? 0 : 1; - if (isNaN(n) || n === null) { + if (n === null || isNaN(n)) { // only flow one buffer at a time if (state.flowing && state.buffer.length) return state.buffer[0].length; @@ -275,6 +275,7 @@ Readable.prototype.read = function(n) { var state = this._readableState; state.calledRead = true; var nOrig = n; + var ret; if (typeof n !== 'number' || n > 0) state.emittedReadable = false; @@ -293,9 +294,28 @@ Readable.prototype.read = function(n) { // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { + ret = null; + + // In cases where the decoder did not receive enough data + // to produce a full chunk, then immediately received an + // EOF, state.buffer will contain [<Buffer >, <Buffer 00 ...>]. + // howMuchToRead will see this and coerce the amount to + // read to zero (because it's looking at the length of the + // first <Buffer > in state.buffer), and we'll end up here. + // + // This can only happen via state.decoder -- no other venue + // exists for pushing a zero-length chunk into state.buffer + // and triggering this behavior. In this case, we return our + // remaining data and end the stream, if appropriate. + if (state.length > 0 && state.decoder) { + ret = fromList(n, state); + state.length -= ret.length; + } + if (state.length === 0) endReadable(this); - return null; + + return ret; } // All the actual chunk generation logic needs to be @@ -349,7 +369,6 @@ Readable.prototype.read = function(n) { if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - var ret; if (n > 0) ret = fromList(n, state); else @@ -382,8 +401,7 @@ function chunkInvalid(state, chunk) { 'string' !== typeof chunk && chunk !== null && chunk !== undefined && - !state.objectMode && - !er) { + !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; @@ -814,7 +832,12 @@ Readable.prototype.wrap = function(stream) { stream.on('data', function(chunk) { if (state.decoder) chunk = state.decoder.write(chunk); - if (!chunk || !state.objectMode && !chunk.length) + + // don't skip over falsy values in objectMode + //if (state.objectMode && util.isNullOrUndefined(chunk)) + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = self.push(chunk); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js index d0254d5a71..4bdaa4fa49 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js @@ -37,7 +37,6 @@ var util = require('core-util-is'); util.inherits = require('inherits'); /*</replacement>*/ - var Stream = require('stream'); util.inherits(Writable, Stream); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json index 2b7593c193..2155d11c62 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -35,7 +35,7 @@ "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" }, - "_from": "core-util-is@~1.0.0", + "_from": "core-util-is@>=1.0.0 <1.1.0", "_npmVersion": "1.3.23", "_npmUser": { "name": "isaacs", @@ -49,6 +49,5 @@ ], "directories": {}, "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", - "scripts": {} + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json index fc7904b67b..04d6a3fd31 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json @@ -47,8 +47,5 @@ ], "directories": {}, "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - } + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js index 2e44a03e15..b00e54fb79 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -36,6 +36,14 @@ function assertEncoding(encoding) { } } +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. var StringDecoder = exports.StringDecoder = function(encoding) { this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); assertEncoding(encoding); @@ -60,37 +68,50 @@ var StringDecoder = exports.StringDecoder = function(encoding) { return; } + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. this.charLength = 0; }; +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . StringDecoder.prototype.write = function(buffer) { var charStr = ''; - var offset = 0; - // if our last write ended with an incomplete multibyte character while (this.charLength) { // determine how many remaining bytes this buffer has to offer for this char - var i = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, offset, i); - this.charReceived += (i - offset); - offset = i; + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; if (this.charReceived < this.charLength) { // still not enough chars in this buffer? wait for more ... return ''; } + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + // get the character that was split charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - // lead surrogate (D800-DBFF) is also the incomplete character + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character var charCode = charStr.charCodeAt(charStr.length - 1); if (charCode >= 0xD800 && charCode <= 0xDBFF) { this.charLength += this.surrogateSize; @@ -100,34 +121,33 @@ StringDecoder.prototype.write = function(buffer) { this.charReceived = this.charLength = 0; // if there are no more bytes in this buffer, just emit our char - if (i == buffer.length) return charStr; - - // otherwise cut off the characters end from the beginning of this buffer - buffer = buffer.slice(i, buffer.length); + if (buffer.length === 0) { + return charStr; + } break; } - var lenIncomplete = this.detectIncompleteChar(buffer); + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); var end = buffer.length; if (this.charLength) { // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end); - this.charReceived = lenIncomplete; - end -= lenIncomplete; + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; } charStr += buffer.toString(this.encoding, 0, end); var end = charStr.length - 1; var charCode = charStr.charCodeAt(end); - // lead surrogate (D800-DBFF) is also the incomplete character + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character if (charCode >= 0xD800 && charCode <= 0xDBFF) { var size = this.surrogateSize; this.charLength += size; this.charReceived += size; this.charBuffer.copy(this.charBuffer, size, 0, size); - this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding); + buffer.copy(this.charBuffer, 0, 0, size); return charStr.substring(0, end); } @@ -135,6 +155,10 @@ StringDecoder.prototype.write = function(buffer) { return charStr; }; +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. StringDecoder.prototype.detectIncompleteChar = function(buffer) { // determine how many bytes we have to check at the end of this buffer var i = (buffer.length >= 3) ? 3 : buffer.length; @@ -164,8 +188,7 @@ StringDecoder.prototype.detectIncompleteChar = function(buffer) { break; } } - - return i; + this.charReceived = i; }; StringDecoder.prototype.end = function(buffer) { @@ -188,13 +211,11 @@ function passThroughWrite(buffer) { } function utf16DetectIncompleteChar(buffer) { - var incomplete = this.charReceived = buffer.length % 2; - this.charLength = incomplete ? 2 : 0; - return incomplete; + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; } function base64DetectIncompleteChar(buffer) { - var incomplete = this.charReceived = buffer.length % 3; - this.charLength = incomplete ? 3 : 0; - return incomplete; + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json index 2e827f5921..21c9cd535c 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -1,6 +1,6 @@ { "name": "string_decoder", - "version": "0.10.25-1", + "version": "0.10.31", "description": "The string_decoder module from Node core", "main": "index.js", "dependencies": {}, @@ -22,16 +22,14 @@ "browserify" ], "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", "bugs": { "url": "https://github.com/rvagg/string_decoder/issues" }, - "_id": "string_decoder@0.10.25-1", - "dist": { - "shasum": "f387babd95d23a2bb73b1fbf2cb3efab6f78baab", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz" - }, - "_from": "string_decoder@~0.10.x", - "_npmVersion": "1.3.24", + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_npmVersion": "1.4.23", "_npmUser": { "name": "rvagg", "email": "rod@vagg.org" @@ -46,8 +44,10 @@ "email": "rod@vagg.org" } ], + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, "directories": {}, - "_shasum": "f387babd95d23a2bb73b1fbf2cb3efab6f78baab", - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json index 8d8961b95a..7483ebbecf 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json @@ -1,6 +1,6 @@ { "name": "readable-stream", - "version": "1.0.27-1", + "version": "1.0.31", "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", "main": "readable.js", "dependencies": { @@ -37,13 +37,10 @@ "url": "https://github.com/isaacs/readable-stream/issues" }, "homepage": "https://github.com/isaacs/readable-stream", - "_id": "readable-stream@1.0.27-1", - "dist": { - "shasum": "6b67983c20357cefd07f0165001a16d710d91078", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz" - }, - "_from": "readable-stream@1.0", - "_npmVersion": "1.4.3", + "_id": "readable-stream@1.0.31", + "_shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae", + "_from": "readable-stream@>=1.0.0 <1.1.0", + "_npmVersion": "1.4.9", "_npmUser": { "name": "rvagg", "email": "rod@vagg.org" @@ -62,8 +59,10 @@ "email": "rod@vagg.org" } ], + "dist": { + "shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz" + }, "directories": {}, - "_shasum": "6b67983c20357cefd07f0165001a16d710d91078", - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz" } diff --git a/deps/npm/node_modules/sha/package.json b/deps/npm/node_modules/sha/package.json index 091919964a..1b8b2aa7ff 100644 --- a/deps/npm/node_modules/sha/package.json +++ b/deps/npm/node_modules/sha/package.json @@ -30,7 +30,7 @@ "shasum": "1f9a377f27b6fdee409b9b858e43da702be48a4d", "tarball": "http://registry.npmjs.org/sha/-/sha-1.2.4.tgz" }, - "_from": "sha@latest", + "_from": "sha@>=1.2.1 <1.3.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "forbeslindesay", diff --git a/deps/npm/node_modules/slide/package.json b/deps/npm/node_modules/slide/package.json index 481ff52656..1c0b30bf2a 100644 --- a/deps/npm/node_modules/slide/package.json +++ b/deps/npm/node_modules/slide/package.json @@ -33,7 +33,7 @@ "_id": "slide@1.1.6", "scripts": {}, "_shasum": "56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707", - "_from": "slide@~1.1.6", + "_from": "slide@>=1.1.6 <1.2.0", "_npmVersion": "2.0.0-beta.3", "_npmUser": { "name": "isaacs", @@ -50,6 +50,5 @@ "tarball": "http://registry.npmjs.org/slide/-/slide-1.1.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" } diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index 4f66030350..207eaa1fdd 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -26,8 +26,6 @@ "tap": "0.x" }, "license": "BSD", - "readme": "# node-tar\n\nTar for Node.js.\n\n[](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThis only works with directories, it does not work with individual files.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", - "readmeFilename": "README.md", "gitHead": "476bf6f5882b9c33d1cbf66f175d0f25e3981044", "bugs": { "url": "https://github.com/isaacs/node-tar/issues" @@ -35,5 +33,23 @@ "homepage": "https://github.com/isaacs/node-tar", "_id": "tar@1.0.1", "_shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a", - "_from": "tar@latest" + "_from": "tar@1.0.1", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a", + "tarball": "http://registry.npmjs.org/tar/-/tar-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.1.tgz", + "readme": "ERROR: No README data found!" } |