Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--node_modules/npm-package-arg/npa.js5
-rw-r--r--node_modules/npm-package-arg/package.json33
-rw-r--r--node_modules/npm-package-arg/test/basic.js35
-rw-r--r--package.json4
4 files changed, 49 insertions, 28 deletions
diff --git a/node_modules/npm-package-arg/npa.js b/node_modules/npm-package-arg/npa.js
index 7c6b4254e..ff4db85a1 100644
--- a/node_modules/npm-package-arg/npa.js
+++ b/node_modules/npm-package-arg/npa.js
@@ -163,6 +163,11 @@ function parseUrl (res, arg, urlparse) {
res.spec = arg
break
+ case 'file:':
+ res.type = 'local'
+ res.spec = urlparse.pathname
+ break;
+
default:
throw new Error('Unsupported URL Type: ' + arg)
break
diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json
index 2eb973440..b887ee7bf 100644
--- a/node_modules/npm-package-arg/package.json
+++ b/node_modules/npm-package-arg/package.json
@@ -1,6 +1,6 @@
{
"name": "npm-package-arg",
- "version": "2.0.4",
+ "version": "2.1.0",
"description": "Parse the things that can be arguments to `npm install`",
"main": "npa.js",
"directories": {
@@ -29,29 +29,10 @@
"url": "https://github.com/npm/npm-package-arg/issues"
},
"homepage": "https://github.com/npm/npm-package-arg",
- "gitHead": "b630a290e12ea7c83b389b7582067ddca052d357",
- "_id": "npm-package-arg@2.0.4",
- "_shasum": "15647a2d5bb3b673e7a76644d43ddce929b9f84a",
- "_from": "npm-package-arg@2.0.4",
- "_npmVersion": "2.0.0-beta.0",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- }
- ],
- "dist": {
- "shasum": "15647a2d5bb3b673e7a76644d43ddce929b9f84a",
- "tarball": "http://registry.npmjs.org/npm-package-arg/-/npm-package-arg-2.0.4.tgz"
- },
- "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-2.0.4.tgz",
- "readme": "ERROR: No README data found!"
+ "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": "9e46839145b953ee14ad489958c6466e59c4a874",
+ "_id": "npm-package-arg@2.1.0",
+ "_shasum": "ed0c544e2fb07403491edb3bb85aca995f0454fa",
+ "_from": "npm-package-arg@>=2.1.0-0 <3.0.0-0"
}
diff --git a/node_modules/npm-package-arg/test/basic.js b/node_modules/npm-package-arg/test/basic.js
index 6dddc6378..87478a03b 100644
--- a/node_modules/npm-package-arg/test/basic.js
+++ b/node_modules/npm-package-arg/test/basic.js
@@ -63,6 +63,13 @@ require("tap").test("basic", function (t) {
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://github.com/user/foo": {
name: null,
type: "git",
@@ -85,6 +92,34 @@ require("tap").test("basic", function (t) {
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",
diff --git a/package.json b/package.json
index bfae9d67b..8569ab2bc 100644
--- a/package.json
+++ b/package.json
@@ -49,7 +49,7 @@
"fstream": "~1.0.2",
"fstream-npm": "~1.0.0",
"github-url-from-git": "~1.4.0",
- "github-url-from-username-repo": "~1.0.1",
+ "github-url-from-username-repo": "~1.0.2",
"glob": "~4.0.5",
"graceful-fs": "~3.0.0",
"inflight": "~1.0.1",
@@ -64,7 +64,7 @@
"normalize-package-data": "~1.0.1",
"npm-cache-filename": "~1.0.1",
"npm-install-checks": "~1.0.2",
- "npm-package-arg": "~2.0.4",
+ "npm-package-arg": "~2.1.0",
"npm-registry-client": "~3.1.7",
"npm-user-validate": "~0.1.0",
"npmconf": "~2.0.8",