diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-03-27 03:56:05 -0700 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2015-03-30 14:34:39 -0700 |
commit | f166cdecf161dd3feb2870dd7f022f046dca2ed2 (patch) | |
tree | 9227c6b8f729cf090ab726bdfa77c2d203f75497 /deps/npm/node_modules/realize-package-specifier | |
parent | 73de13511d2cccec6852579b8a5beeb5aa423e1b (diff) | |
download | node-new-f166cdecf161dd3feb2870dd7f022f046dca2ed2.tar.gz |
deps: upgrade npm to 2.7.4
Diffstat (limited to 'deps/npm/node_modules/realize-package-specifier')
7 files changed, 339 insertions, 72 deletions
diff --git a/deps/npm/node_modules/realize-package-specifier/README.md b/deps/npm/node_modules/realize-package-specifier/README.md index 577014a48c..dac3b64c51 100644 --- a/deps/npm/node_modules/realize-package-specifier/README.md +++ b/deps/npm/node_modules/realize-package-specifier/README.md @@ -13,6 +13,8 @@ realizePackageSpecifier("foo.tar.gz", ".", function (err, package) { }) ``` +## Using + * realizePackageSpecifier(*spec*, [*where*,] *callback*) Parses *spec* using `npm-package-arg` and then uses stat to check to see if @@ -34,14 +36,17 @@ new type of `directory`. 2) The `local` type only refers to tarballs. 2) For all `local` and `directory` type results spec will contain the full path of the local package. -## Result Objects +## Result Object The full definition of the result object is: * `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` + * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally + either a full url pointing at one of these services or a shorthand like + `user/project` or `github:user/project` for github or `bitbucket:user/project` + for bitbucket. * `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"` @@ -49,6 +54,12 @@ The full definition of the result object is: * `directory` - A local package directory * `remote` - An http url (presumably to a tgz) * `spec` - The "thing". URL, the range, git repo, etc. +* `hosted` - If type=hosted this will be an object with the following keys: + * `type` - github, bitbucket or gitlab + * `ssh` - The ssh path for this git repo + * `sshurl` - The ssh URL for this git repo + * `https` - The HTTPS URL for this git repo + * `directUrl` - The URL for the package.json in this git repo * `raw` - The original un-modified string that was provided. * `rawSpec` - The part after the `name@...`, as it was originally provided. diff --git a/deps/npm/node_modules/realize-package-specifier/package.json b/deps/npm/node_modules/realize-package-specifier/package.json index b04c49a35e..0353dd96aa 100644 --- a/deps/npm/node_modules/realize-package-specifier/package.json +++ b/deps/npm/node_modules/realize-package-specifier/package.json @@ -1,6 +1,6 @@ { "name": "realize-package-specifier", - "version": "1.3.0", + "version": "2.2.0", "description": "Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.", "main": "index.js", "scripts": { @@ -19,19 +19,36 @@ "homepage": "https://github.com/npm/realize-package-specifier", "dependencies": { "dezalgo": "^1.0.1", - "npm-package-arg": "^2.1.3" + "npm-package-arg": "^3.1.0" }, "devDependencies": { "require-inject": "^1.1.0", "tap": "^0.4.12" }, - "gitHead": "d05d49409e28404473a292cf99df05642a24c08f", - "readme": "realize-package-specifier\n-------------------------\n\nParse a package specifier, peeking at the disk to differentiate between\nlocal tarballs, directories and named modules. This implements the logic\nused by `npm install` and `npm cache` to determine where to get packages\nfrom.\n\n```javascript\nvar realizePackageSpecifier = require(\"realize-package-specifier\")\nrealizePackageSpecifier(\"foo.tar.gz\", \".\", function (err, package) {\n …\n})\n```\n\n* realizePackageSpecifier(*spec*, [*where*,] *callback*)\n\nParses *spec* using `npm-package-arg` and then uses stat to check to see if\nit refers to a local tarball or package directory. Stats are done relative\nto *where*. If it does then the local module is loaded. If it doesn't then\ntarget is left as a remote package specifier. Package directories are\nrecognized by the presence of a package.json in them.\n\n*spec* -- a package specifier, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n*where* (optional, default: .) -- The directory in which we should look for\nlocal tarballs or package directories.\n\n*callback* function(*err*, *result*) -- Called once we've determined what\nkind of specifier this is. The *result* object will be very like the one\nreturned by `npm-package-arg` except with three differences: 1) There's a\nnew type of `directory`. 2) The `local` type only refers to tarballs. 2)\nFor all `local` and `directory` type results spec will contain the full path of\nthe local package.\n\n## Result Objects\n\nThe full definition of the result object is:\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 path\n * `directory` - A local package directory\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\n", - "readmeFilename": "README.md", + "gitHead": "8810720d191647f06a505fc5da8d0634a21526b8", "bugs": { "url": "https://github.com/npm/realize-package-specifier/issues" }, - "_id": "realize-package-specifier@1.3.0", - "_shasum": "23374a84e6a9188483f346cc939eb58eec85efa5", - "_from": "realize-package-specifier@~1.3.0" + "_id": "realize-package-specifier@2.2.0", + "_shasum": "95278b6021a39158f284e15756e827fc2998ed9c", + "_from": "realize-package-specifier@>=2.2.0 <2.3.0", + "_npmVersion": "2.4.1", + "_nodeVersion": "1.0.4", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "dist": { + "shasum": "95278b6021a39158f284e15756e827fc2998ed9c", + "tarball": "http://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-2.2.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-2.2.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/realize-package-specifier/test/basic.js b/deps/npm/node_modules/realize-package-specifier/test/basic.js index b371826e7d..7fe659fbf6 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/basic.js +++ b/deps/npm/node_modules/realize-package-specifier/test/basic.js @@ -61,7 +61,7 @@ var rps = requireInject("../index", { }) test("realize-package-specifier", function (t) { - t.plan(12) + t.plan(13) rps("a.tar.gz", function (err, result) { t.is(result.type, "local", "local tarball") }) @@ -90,7 +90,8 @@ test("realize-package-specifier", function (t) { t.is(result.type, "directory", "local package directory") }) rps("e/2", function (err, result) { - t.is(result.type, "github", "github package dependency") + t.is(result.type, "hosted", "hosted package dependency") + t.is(result.hosted.type, "github", "github package dependency") }) rps("1", function (err, result) { t.is(result.type, "local", "range like local file is still a local file") @@ -100,7 +101,7 @@ test("realize-package-specifier", function (t) { }) }) test("named realize-package-specifier", function (t) { - t.plan(12) + t.plan(13) rps("a@a.tar.gz", function (err, result) { t.is(result.type, "local", "named local tarball") @@ -130,7 +131,8 @@ test("named realize-package-specifier", function (t) { t.is(result.type, "directory", "local package directory") }) rps("e@e/2", function (err, result) { - t.is(result.type, "github", "github package dependency") + t.is(result.type, "hosted", "hosted package dependency") + t.is(result.hosted.type, "github", "github package dependency") }) rps("e@1", function (err, result) { t.is(result.type, "range", "range like specifier is never a local file") diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js b/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js index be07aa56a3..bd7ab4aec3 100644 --- a/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-basic.js @@ -64,11 +64,11 @@ test("npa-basic", function (t) { rawSpec: "=v1.2.3" }, - "git+ssh://git@github.com/user/foo#1.2.3": { + "git+ssh://git@notgithub.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" + spec: "ssh://git@notgithub.com/user/foo#1.2.3", + raw: "git+ssh://git@notgithub.com/user/foo#1.2.3" }, "git+file://path/to/repo#1.2.3": { @@ -78,19 +78,19 @@ test("npa-basic", function (t) { raw: "git+file://path/to/repo#1.2.3" }, - "git://github.com/user/foo": { + "git://notgithub.com/user/foo": { name: null, type: "git", - spec: "git://github.com/user/foo", - raw: "git://github.com/user/foo" + spec: "git://notgithub.com/user/foo", + raw: "git://notgithub.com/user/foo" }, - "@foo/bar@git+ssh://github.com/user/foo": { + "@foo/bar@git+ssh://notgithub.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" + spec: "ssh://notgithub.com/user/foo", + rawSpec: "git+ssh://notgithub.com/user/foo", + raw: "@foo/bar@git+ssh://notgithub.com/user/foo" }, "/path/to/foo": { @@ -99,28 +99,18 @@ test("npa-basic", function (t) { spec: "/path/to/foo", raw: "/path/to/foo" }, - "file:path/to/foo": { name: null, type: "local", spec: path.resolve(__dirname,"..","path/to/foo"), raw: "file:path/to/foo" }, - - "file:~/path/to/foo": { - name: null, - type: "local", - spec: path.resolve(__dirname,"..","~/path/to/foo"), - raw: "file:~/path/to/foo" - }, - "file:../path/to/foo": { name: null, type: "local", spec: path.resolve(__dirname,"..","../path/to/foo"), raw: "file:../path/to/foo" }, - "file:///path/to/foo": { name: null, type: "local", @@ -135,41 +125,6 @@ test("npa-basic", function (t) { 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", @@ -189,9 +144,9 @@ test("npa-basic", function (t) { Object.keys(tests).forEach(function (arg) { rps(arg, path.resolve(__dirname,'..'), function(err, res) { - t.notOk(err, "No error") - t.type(res, "Result") - t.has(res, tests[arg]) + t.notOk(err, arg + " no error") + t.type(res, "Result", arg + " got right result time") + t.has(res, tests[arg], arg + " result has correct values") }) }) diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js b/deps/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js new file mode 100644 index 0000000000..7cc95d5589 --- /dev/null +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-bitbucket.js @@ -0,0 +1,86 @@ +var test = require("tap").test; +var rps = require("../index.js") +var path = require("path") + +test("npa-bitbucket", function (t) { + t.setMaxListeners(999) + + var tests = { + "bitbucket:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo-js.git", + raw: "bitbucket:user/foo-js" + }, + + "bitbucket:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo-js.git#bar/baz", + raw: "bitbucket:user/foo-js#bar/baz" + }, + + "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user..blerg--/..foo-js.git# . . . . . some . tags / / /", + raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "bitbucket:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo-js.git#bar/baz/bin", + raw: "bitbucket:user/foo-js#bar/baz/bin" + }, + + "foo@bitbucket:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo-js.git", + raw: "foo@bitbucket:user/foo-js" + }, + + "git+ssh://git@bitbucket.org/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git#1.2.3", + raw: "git+ssh://git@bitbucket.org/user/foo#1.2.3" + }, + + "https://bitbucket.org/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git", + raw: "https://bitbucket.org/user/foo.git" + }, + + "@foo/bar@git+ssh://bitbucket.org/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "bitbucket" }, + spec: "git+ssh://git@bitbucket.org/user/foo.git", + rawSpec: "git+ssh://bitbucket.org/user/foo", + raw: "@foo/bar@git+ssh://bitbucket.org/user/foo" + } + } + + t.plan( Object.keys(tests).length * 3 ) + + Object.keys(tests).forEach(function (arg) { + rps(arg, path.resolve(__dirname,'..'), function(err, res) { + t.notOk(err, "No error") + t.type(res, "Result") + t.has(res, tests[arg]) + }) + }) + +}) diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-github.js b/deps/npm/node_modules/realize-package-specifier/test/npa-github.js new file mode 100644 index 0000000000..1e6b72e1e3 --- /dev/null +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-github.js @@ -0,0 +1,110 @@ +var test = require("tap").test; +var rps = require("../index.js") +var path = require("path") + +test("npa-github", function (t) { + t.setMaxListeners(999) + + var tests = { + "user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo-js.git", + raw: "user/foo-js" + }, + + "user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo-js.git#bar/baz", + raw: "user/foo-js#bar/baz" + }, + + "user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user..blerg--/..foo-js.git# . . . . . some . tags / / /", + raw: "user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo-js.git#bar/baz/bin", + raw: "user/foo-js#bar/baz/bin" + }, + + "foo@user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo-js.git", + raw: "foo@user/foo-js" + }, + + "github:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo-js.git", + raw: "github:user/foo-js" + }, + + "git+ssh://git@github.com/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git#1.2.3", + raw: "git+ssh://git@github.com/user/foo#1.2.3" + }, + + "git://github.com/user/foo": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git", + raw: "git://github.com/user/foo" + }, + + "https://github.com/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git", + raw: "https://github.com/user/foo.git" + }, + + "@foo/bar@git+ssh://github.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/user/foo.git", + rawSpec: "git+ssh://github.com/user/foo", + raw: "@foo/bar@git+ssh://github.com/user/foo" + }, + + "foo@bar/foo": { + name: "foo", + type: "hosted", + hosted: { type: "github" }, + spec: "git+ssh://git@github.com/bar/foo.git", + raw: "foo@bar/foo" + } + } + + t.plan( Object.keys(tests).length * 3 ) + + Object.keys(tests).forEach(function (arg) { + rps(arg, path.resolve(__dirname,'..'), function(err, res) { + t.notOk(err, "No error") + t.type(res, "Result") + t.has(res, tests[arg]) + }) + }) + +}) diff --git a/deps/npm/node_modules/realize-package-specifier/test/npa-gitlab.js b/deps/npm/node_modules/realize-package-specifier/test/npa-gitlab.js new file mode 100644 index 0000000000..b6efb29a39 --- /dev/null +++ b/deps/npm/node_modules/realize-package-specifier/test/npa-gitlab.js @@ -0,0 +1,86 @@ +var test = require("tap").test; +var rps = require("../index.js") +var path = require("path") + +test("npa-gitlab", function (t) { + t.setMaxListeners(999) + + var tests = { + "gitlab:user/foo-js": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo-js.git", + raw: "gitlab:user/foo-js" + }, + + "gitlab:user/foo-js#bar/baz": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo-js.git#bar/baz", + raw: "gitlab:user/foo-js#bar/baz" + }, + + "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user..blerg--/..foo-js.git# . . . . . some . tags / / /", + raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "gitlab:user/foo-js#bar/baz/bin": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo-js.git#bar/baz/bin", + raw: "gitlab:user/foo-js#bar/baz/bin" + }, + + "foo@gitlab:user/foo-js": { + name: "foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo-js.git", + raw: "foo@gitlab:user/foo-js" + }, + + "git+ssh://git@gitlab.com/user/foo#1.2.3": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git#1.2.3", + raw: "git+ssh://git@gitlab.com/user/foo#1.2.3" + }, + + "https://gitlab.com/user/foo.git": { + name: null, + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git", + raw: "https://gitlab.com/user/foo.git" + }, + + "@foo/bar@git+ssh://gitlab.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + type: "hosted", + hosted: { type: "gitlab" }, + spec: "git+ssh://git@gitlab.com/user/foo.git", + rawSpec: "git+ssh://gitlab.com/user/foo", + raw: "@foo/bar@git+ssh://gitlab.com/user/foo" + } + } + + t.plan( Object.keys(tests).length * 3 ) + + Object.keys(tests).forEach(function (arg) { + rps(arg, path.resolve(__dirname,'..'), function(err, res) { + t.notOk(err, "No error") + t.type(res, "Result") + t.has(res, tests[arg]) + }) + }) + +}) |