diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-03-20 03:18:04 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-03-20 03:18:04 +0300 |
commit | 89ce829a00b526d0518f5cd855c323bffe182af0 (patch) | |
tree | 50b4ed1ad38f5fe8712d084a3b9359a4e9a8cd06 /node_modules/npm-registry-client | |
parent | 63313eb0c37891c355546fd1093010c8a0c3cd81 (diff) |
hosted-git-info@1.5.3
Use `hosted-git-info` directly to ensure that all GitHub URLs are being
run through the same cloning strategy for caching. Fixes #7630.
Diffstat (limited to 'node_modules/npm-registry-client')
20 files changed, 0 insertions, 1360 deletions
diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/LICENSE b/node_modules/npm-registry-client/node_modules/npm-package-arg/LICENSE deleted file mode 100644 index 05eeeb88c..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -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/node_modules/npm-registry-client/node_modules/npm-package-arg/README.md b/node_modules/npm-registry-client/node_modules/npm-package-arg/README.md deleted file mode 100644 index d37b35533..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/README.md +++ /dev/null @@ -1,101 +0,0 @@ -# npm-package-arg - -Parse package name and specifier passed to commands like `npm install` or -`npm cache add`. This just parses the text given-- it's worth noting that -`npm` has further logic it applies by looking at your disk to figure out -what ambiguous specifiers are. If you want that logic, please see -[realize-package-specifier]. - -[realize-package-specifier]: https://www.npmjs.org/package/realize-package-specifier - -Arguments look like: `foo@1.2`, `@bar/foo@1.2`, `foo@user/foo`, `http://x.com/foo.tgz`, -`git+https://github.com/user/foo`, `bitbucket:user/foo`, `foo.tar.gz` or `bar` - -## EXAMPLES - -```javascript -var assert = require("assert") -var npa = require("npm-package-arg") - -// Pass in the descriptor, and it'll return an object -var parsed = npa("@bar/foo@1.2") - -// Returns an object like: -{ - raw: '@bar/foo@1.2', // what was passed in - name: "@bar/foo", // the name of the package - scope: "@bar", // the private scope of the package, or null - type: "range", // the type of specifier this is - spec: ">=1.2.0 <1.3.0" // the expanded specifier - rawSpec: "1.2" // the specifier as passed in - } - -// Parsing urls pointing at hosted git services produces a variation: -var parsed = npa("git+https://github.com/user/foo") - -// Returns an object like: -{ - raw: 'git+https://github.com/user/foo', - scope: null, - name: null, - rawSpec: 'git+https://github.com/user/foo', - spec: 'user/foo', - type: 'hosted', - hosted: { - type: 'github', - ssh: 'git@github.com:user/foo.git', - sshurl: 'git+ssh://git@github.com/user/foo.git', - https: 'https://github.com/user/foo.git', - directUrl: 'https://raw.githubusercontent.com/user/foo/master/package.json' - } -} - -// 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") -}) -``` - -## USING - -`var npa = require('npm-package-arg')` - -* var result = npa(*arg*) - -Parses *arg* and returns a result object detailing what *arg* is. - -*arg* -- a package descriptor, like: `foo@1.2`, or `foo@user/foo`, or -`http://x.com/foo.tgz`, or `git+https://github.com/user/foo` - -## RESULT OBJECT - -The objects that are returned by npm-package-arg contain the following -keys: - -* `name` - If known, the `name` field expected in the resulting pkg. -* `type` - One of the following strings: - * `git` - A git repo - * `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"` - * `local` - A local file or folder path - * `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 - * `httpsUrl` - 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. -* `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/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/.npmignore b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/.npmignore deleted file mode 100644 index 58e97a787..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -*~ -.# -node_modules diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/.travis.yml b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/.travis.yml deleted file mode 100644 index 7dc661917..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - "0.11" - - "0.10" -script: "npm test" diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md deleted file mode 100644 index ebf40a2ab..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# hosted-git-info - -This will let you identify and transform various git hosts URLs between -protocols. It also can tell you what the URL is for the raw path for -particular file for direct access without git. - -## Usage - -```javascript -var hostedGitInfo = require("hosted-git-info") -var info = hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git") -/* info looks like: -{ - type: "github", - domain: "github.com", - user: "npm", - project: "hosted-git-info" -} -*/ -``` - -If the URL can't be matched with a git host, `null` will be returned. We -can match git, ssh and https urls. Additionally, we can match ssh connect -strings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg, -`github:npm/hosted-git-info`). Github specifically, is detected in the case -of a third, unprefixed, form: `npm/hosted-git-info`. - -If it does match, the returned object has properties of: - -* info.type -- The short name of the service -* info.domain -- The domain for git protocol use -* info.user -- The name of the user/org on the git host -* info.project -- The name of the project on the git host - -And methods of: - -* info.file(path) - -Given the path of a file relative to the repository, returns a URL for -directly fetching it from the githost. If no comittish was set then -`master` will be used as the default. - -For example `hostedGitInfo.fromUrl("git@github.com:npm/hosted-git-info.git#v1.0.0").file("package.json")` -would return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json` - -* info.shortcut() - -eg, `github:npm/hosted-git-info` - -* info.browse() - -eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0` - -* info.bugs() - -eg, `https://github.com/npm/hosted-git-info/issues` - -* info.docs() - -eg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme` - -* info.https() - -eg, `https://github.com/npm/hosted-git-info.git` - -* info.sshurl() - -eg, `git+ssh://git@github.com/npm/hosted-git-info.git` - -* info.ssh() - -eg, `git@github.com:npm/hosted-git-info.git` - -* info.path() - -eg, `npm/hosted-git-info` - -## Supported hosts - -Currently this supports Github, Bitbucket and Gitlab. Pull requests for -additional hosts welcome. - diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js deleted file mode 100644 index c2ad10a3b..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js +++ /dev/null @@ -1,208 +0,0 @@ -"use strict" -var url = require("url") - -var GitHost = exports = module.exports = function (type, user, project, comittish) { - this.type = type - this.domain = gitHosts[type].domain - this.filetemplate = gitHosts[type].filetemplate - this.sshtemplate = gitHosts[type].sshtemplate - this.sshurltemplate = gitHosts[type].sshurltemplate - this.browsetemplate = gitHosts[type].browsetemplate - this.docstemplate = gitHosts[type].docstemplate - this.bugstemplate = gitHosts[type].bugstemplate - this.gittemplate = gitHosts[type].gittemplate - this.httpstemplate = gitHosts[type].httpstemplate - this.treepath = gitHosts[type].treepath - this.user = user - this.project = project - this.comittish = comittish -} -GitHost.prototype = {} - -exports.fromUrl = function (giturl) { - if (giturl == null || giturl == "") return - var parsed = parseGitUrl(maybeGitHubShorthand(giturl) ? "github:" + giturl : giturl) - var matches = Object.keys(gitHosts).map(function(V) { - var gitHost = gitHosts[V] - var comittish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null - if (parsed.protocol == V + ":") { - return new GitHost(V, - decodeURIComponent(parsed.host), decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, "$1")), comittish) - } - if (parsed.host != gitHost.domain) return - if (! gitHost.protocols_re.test(parsed.protocol)) return - var matched = parsed.path.match(gitHost.pathmatch) - if (! matched) return - return new GitHost( - V, - matched[1]!=null && decodeURIComponent(matched[1]), - matched[2]!=null && decodeURIComponent(matched[2]), - comittish) - }).filter(function(V){ return V }) - if (matches.length != 1) return - return matches[0] -} - -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) -} - -var parseGitUrl = function (giturl) { - if (typeof giturl != "string") giturl = "" + giturl - var matched = giturl.match(/^([^@]+)@([^:]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/) - if (! matched) return url.parse(giturl) - return { - protocol: "git+ssh:", - slashes: true, - auth: matched[1], - host: matched[2], - port: null, - hostname: matched[2], - hash: matched[4], - search: null, - query: null, - pathname: "/" + matched[3], - path: "/" + matched[3], - href: "git+ssh://" + matched[1] + "@" + matched[2] + "/" + matched[3] + (matched[4]||"") - } -} - -var gitHostDefaults = { - "sshtemplate": "git@{domain}:{user}/{project}.git{#comittish}", - "sshurltemplate": "git+ssh://git@{domain}/{user}/{project}.git{#comittish}", - "browsetemplate": "https://{domain}/{user}/{project}{/tree/comittish}", - "docstemplate": "https://{domain}/{user}/{project}{/tree/comittish}#readme", - "httpstemplate": "https://{domain}/{user}/{project}.git{#comittish}", - "filetemplate": "https://{domain}/{user}/{project}/raw/{comittish}/{path}" -} -var gitHosts = { - github: { - // First two are insecure and generally shouldn't be used any more, but - // they are still supported. - "protocols": [ "git", "http", "git+ssh", "git+https", "ssh", "https" ], - "domain": "github.com", - "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/, - "treepath": "tree", - "filetemplate": "https://raw.githubusercontent.com/{user}/{project}/{comittish}/{path}", - "bugstemplate": "https://{domain}/{user}/{project}/issues", - "gittemplate": "git://{domain}/{user}/{project}.git{#comittish}" - }, - bitbucket: { - "protocols": [ "git+ssh", "git+https", "ssh", "https" ], - "domain": "bitbucket.org", - "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/, - "treepath": "src" - }, - gitlab: { - "protocols": [ "git+ssh", "git+https", "ssh", "https" ], - "domain": "gitlab.com", - "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/, - "treepath": "tree", - "docstemplate": "https://{domain}/{user}/{project}{/tree/comittish}#README", - "bugstemplate": "https://{domain}/{user}/{project}/issues" - }, - gist: { - "protocols": [ "git", "git+ssh", "git+https", "ssh", "https" ], - "domain": "gist.github.com", - "pathmatch": /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/, - "filetemplate": "https://gist.githubusercontent.com/{user}/{project}/raw{/comittish}/{path}", - "bugstemplate": "https://{domain}/{project}", - "gittemplate": "git://{domain}/{project}.git{#comittish}", - "sshtemplate": "git@{domain}:/{project}.git{#comittish}", - "sshurltemplate": "git+ssh://git@{domain}/{project}.git{#comittish}", - "browsetemplate": "https://{domain}/{project}{/comittish}", - "docstemplate": "https://{domain}/{project}{/comittish}", - "httpstemplate": "https://{domain}/{project}.git{#comittish}", - }, -} - -Object.keys(gitHosts).forEach(function(host) { - gitHosts[host].protocols_re = RegExp("^(" + - gitHosts[host].protocols.map(function(P){ - return P.replace(/([\\+*{}()\[\]$^|])/g, "\\$1") - }).join("|") + "):$") -}) - -GitHost.prototype.shortcut = function () { - return this.type + ":" + this.path() -} - -GitHost.prototype.hash = function () { - return this.comittish ? "#" + this.comittish : "" -} - -GitHost.prototype.path = function () { - return this.user + "/" + this.project + this.hash() -} - -GitHost.prototype._fill = function (template, vars) { - if (!template) throw new Error("Tried to fill without template") - if (!vars) vars = {} - var self = this - Object.keys(this).forEach(function(K){ if (self[K]!=null && vars[K]==null) vars[K] = self[K] }) - var rawComittish = vars.comittish - Object.keys(vars).forEach(function(K){ (K[0]!='#') && (vars[K] = encodeURIComponent(vars[K])) }) - vars["#comittish"] = rawComittish ? "#" + rawComittish : "" - vars["/tree/comittish"] = vars.comittish ? "/"+vars.treepath+"/" + vars.comittish : "", - vars["/comittish"] = vars.comittish ? "/" + vars.comittish : "" - vars.comittish = vars.comittish || "master" - var res = template - Object.keys(vars).forEach(function(K){ - res = res.replace(new RegExp("[{]" + K + "[}]", "g"), vars[K]) - }) - return res -} - -GitHost.prototype.ssh = function () { - var sshtemplate = this.sshtemplate || gitHostDefaults.sshtemplate - return this._fill(sshtemplate) -} - -GitHost.prototype.sshurl = function () { - var sshurltemplate = this.sshurltemplate || gitHostDefaults.sshurltemplate - return this._fill(sshurltemplate) -} - -GitHost.prototype.browse = function () { - var browsetemplate = this.browsetemplate || gitHostDefaults.browsetemplate - return this._fill(browsetemplate) -} - -GitHost.prototype.docs = function () { - var docstemplate = this.docstemplate || gitHostDefaults.docstemplate - return this._fill(docstemplate) -} - -GitHost.prototype.bugs = function() { - if (! this.bugstemplate) return - return this._fill(this.bugstemplate) -} - -GitHost.prototype.https = function () { - var httpstemplate = this.httpstemplate || gitHostDefaults.httpstemplate - return this._fill(httpstemplate) -} - -GitHost.prototype.git = function () { - if (! this.gittemplate) return - return this._fill(this.gittemplate) -} - -GitHost.prototype.file = function (P) { - var filetemplate = this.filetemplate || gitHostDefaults.filetemplate - return this._fill(filetemplate, { - path: P.replace(/^[/]+/g, "") - }) -} - -GitHost.prototype.toString = function () { - return this[this.default||"sshurl"]() -} diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json deleted file mode 100644 index 00606f6a4..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "hosted-git-info", - "version": "1.5.3", - "description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab", - "main": "index.js", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/hosted-git-info.git" - }, - "keywords": [ - "git", - "github", - "bitbucket", - "gitlab" - ], - "author": { - "name": "Rebecca Turner", - "email": "me@re-becca.org", - "url": "http://re-becca.org" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/hosted-git-info/issues" - }, - "homepage": "https://github.com/npm/hosted-git-info", - "scripts": { - "test": "tap test/*.js" - }, - "devDependencies": { - "tap": "^0.4.13" - }, - "gitHead": "153325f997813ebf8a7ae07b322b4fa89aa25f7d", - "_id": "hosted-git-info@1.5.3", - "_shasum": "1f46e25e9c0e207852fb7a4b94422ed5f09a03f5", - "_from": "hosted-git-info@>=1.5.3 <2.0.0", - "_npmVersion": "2.4.0", - "_nodeVersion": "0.10.33", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "dist": { - "shasum": "1f46e25e9c0e207852fb7a4b94422ed5f09a03f5", - "tarball": "http://registry.npmjs.org/hosted-git-info/-/hosted-git-info-1.5.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-1.5.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/basic.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/basic.js deleted file mode 100644 index e56ef9a05..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/basic.js +++ /dev/null @@ -1,9 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - -test("basic", function (t) { - t.is(HostedGit.fromUrl("https://google.com"), undefined, "null on failure") - - t.end() -}) diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/bitbucket.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/bitbucket.js deleted file mode 100644 index 089cb2819..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/bitbucket.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - -test("fromUrl(bitbucket url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://bitbucket.org/111/222.git" + hash, label + " -> https" ) - t.is( hostinfo.browse(), "https://bitbucket.org/111/222" + (branch ? "/src/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.docs(), "https://bitbucket.org/111/222" + (branch ? "/src/" + branch : "") + "#readme", label + " -> docs" ) - t.is( hostinfo.ssh(), "git@bitbucket.org:111/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@bitbucket.org/111/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@bitbucket.org/111/222.git" + hash, label + " -> stringify" ) - t.is( hostinfo.file("C"), "https://bitbucket.org/111/222/raw/"+(branch||"master")+"/C", label + " -> file" ) - } - - require('./lib/standard-tests')(verify, "bitbucket.org", "bitbucket") - - t.end() -}) - diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gist.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gist.js deleted file mode 100644 index a316048cb..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gist.js +++ /dev/null @@ -1,40 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - - -test("fromUrl(gist url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://gist.github.com/222.git" + hash, label + " -> https" ) - t.is( hostinfo.git(), "git://gist.github.com/222.git" + hash, label + " -> git" ) - t.is( hostinfo.browse(), "https://gist.github.com/222" + (branch ? "/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.bugs(), "https://gist.github.com/222", label + " -> bugs" ) - t.is( hostinfo.docs(), "https://gist.github.com/222" + (branch ? "/" + branch : ""), label + " -> docs" ) - t.is( hostinfo.ssh(), "git@gist.github.com:/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@gist.github.com/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@gist.github.com/222.git" + hash, label + " -> stringify" ) - if (hostinfo.user) { - t.is( hostinfo.file("C"), "https://gist.githubusercontent.com/111/222/raw/"+(branch?branch+"/":"")+"C", label + " -> file" ) - } - } - - verify("git@gist.github.com:222.git", "git@") - var hostinfo = HostedGit.fromUrl("git@gist.github.com:/ef860c7z5e0de3179341.git") - if (t.ok(hostinfo, "git@hex")) { - t.is( hostinfo.https(), "https://gist.github.com/ef860c7z5e0de3179341.git", "git@hex -> https" ) - } - verify("git@gist.github.com:/222.git", "git@/") - verify("git://gist.github.com/222", "git") - verify("git://gist.github.com/222.git", "git.git") - verify("git://gist.github.com/222#branch", "git#branch", "branch") - verify("git://gist.github.com/222.git#branch", "git.git#branch", "branch") - - require('./lib/standard-tests')(verify, "gist.github.com", "gist") - - t.end() -}) - diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/github.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/github.js deleted file mode 100644 index e551c45d7..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/github.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - - -test("fromUrl(github url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://github.com/111/222.git" + hash, label + " -> https" ) - t.is( hostinfo.git(), "git://github.com/111/222.git" + hash, label + " -> git" ) - t.is( hostinfo.browse(), "https://github.com/111/222" + (branch ? "/tree/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.bugs(), "https://github.com/111/222/issues", label + " -> bugs" ) - t.is( hostinfo.docs(), "https://github.com/111/222" + (branch ? "/tree/" + branch : "") + "#readme", label + " -> docs" ) - t.is( hostinfo.ssh(), "git@github.com:111/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@github.com/111/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@github.com/111/222.git" + hash, label + " -> stringify" ) - t.is( hostinfo.file("C"), "https://raw.githubusercontent.com/111/222/"+(branch||"master")+"/C", label + " -> file" ) - } - - // github shorturls - verify("111/222", "github-short") - verify("111/222#branch", "github-short#branch", "branch") - - // insecure protocols - verify("git://github.com/111/222", "git") - verify("git://github.com/111/222.git", "git.git") - verify("git://github.com/111/222#branch", "git#branch", "branch") - verify("git://github.com/111/222.git#branch", "git.git#branch", "branch") - - verify("http://github.com/111/222", "http") - verify("http://github.com/111/222.git", "http.git") - verify("http://github.com/111/222#branch", "http#branch", "branch") - verify("http://github.com/111/222.git#branch", "http.git#branch", "branch") - - require('./lib/standard-tests')(verify, "github.com", "github") - - t.end() -}) - diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gitlab.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gitlab.js deleted file mode 100644 index 1a4e07096..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/gitlab.js +++ /dev/null @@ -1,25 +0,0 @@ -"use strict" -var HostedGit = require("../index") -var test = require("tap").test - - -test("fromUrl(gitlab url)", function (t) { - function verify(host, label, branch) { - var hostinfo = HostedGit.fromUrl(host) - var hash = branch ? "#" + branch : "" - t.ok(hostinfo, label) - if (! hostinfo) return - t.is( hostinfo.https(), "https://gitlab.com/111/222.git" + hash, label + " -> https" ) - t.is( hostinfo.browse(), "https://gitlab.com/111/222" + (branch ? "/tree/" + branch : ""), label + " -> browse" ) - t.is( hostinfo.docs(), "https://gitlab.com/111/222" + (branch ? "/tree/" + branch : "") + "#README", label + " -> docs" ) - t.is( hostinfo.ssh(), "git@gitlab.com:111/222.git" + hash, label + " -> ssh" ) - t.is( hostinfo.sshurl(), "git+ssh://git@gitlab.com/111/222.git" + hash, label + " -> sshurl" ) - t.is( (""+hostinfo), "git+ssh://git@gitlab.com/111/222.git" + hash, label + " -> stringify" ) - t.is( hostinfo.file("C"), "https://gitlab.com/111/222/raw/"+(branch||"master")+"/C", label + " -> file" ) - } - - require('./lib/standard-tests')(verify, "gitlab.com", "gitlab") - - t.end() -}) - diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/lib/standard-tests.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/lib/standard-tests.js deleted file mode 100644 index c505342fa..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/node_modules/hosted-git-info/test/lib/standard-tests.js +++ /dev/null @@ -1,28 +0,0 @@ -"use strict" -module.exports = function (verify, domain, shortname) { - verify("https://" + domain + "/111/222", "https") - verify("https://" + domain + "/111/222.git", "https.git") - verify("https://" + domain + "/111/222#branch", "https#branch", "branch") - verify("https://" + domain + "/111/222.git#branch", "https.git#branch", "branch") - - verify("git+https://" + domain + "/111/222", "git+https") - verify("git+https://" + domain + "/111/222.git", "git+https.git") - verify("git+https://" + domain + "/111/222#branch", "git+https#branch", "branch") - verify("git+https://" + domain + "/111/222.git#branch", "git+https.git#branch", "branch") - - verify("git@" + domain + ":111/222", "ssh") - verify("git@" + domain + ":111/222.git", "ssh.git") - verify("git@" + domain + ":111/222#branch", "ssh", "branch") - verify("git@" + domain + ":111/222.git#branch", "ssh.git", "branch") - - - verify("git+ssh://git@" + domain + "/111/222", "ssh url") - verify("git+ssh://git@" + domain + "/111/222.git", "ssh url.git") - verify("git+ssh://git@" + domain + "/111/222#branch", "ssh url#branch", "branch") - verify("git+ssh://git@" + domain + "/111/222.git#branch", "ssh url.git#branch", "branch") - - verify(shortname + ":111/222", "shortcut") - verify(shortname + ":111/222.git", "shortcut.git") - verify(shortname + ":111/222#branch", "shortcut#branch", "branch") - verify(shortname + ":111/222.git#branch", "shortcut.git#branch", "branch") -} diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/npa.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/npa.js deleted file mode 100644 index 883c5401b..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/npa.js +++ /dev/null @@ -1,181 +0,0 @@ -var url = require("url") -var assert = require("assert") -var util = require("util") -var semver = require("semver") -var path = require("path") -var HostedGit = require("hosted-git-info") - -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 || HostedGit.fromUrl(arg)) { - return parseUrl(res, arg, urlparse) - } - - // at this point, it's not a url, and not hosted - // 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 parseUrl (res, arg, urlparse) { - var gitHost = HostedGit.fromUrl(arg) - if (gitHost) { - res.type = "hosted" - res.spec = gitHost.toString(), - res.hosted = { - type: gitHost.type, - ssh: gitHost.ssh(), - sshUrl: gitHost.sshurl(), - httpsUrl: gitHost.https(), - directUrl: gitHost.file("package.json") - } - return res - } - // 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 -Result.prototype.hosted = null diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/package.json b/node_modules/npm-registry-client/node_modules/npm-package-arg/package.json deleted file mode 100644 index ebfc8918e..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "npm-package-arg", - "version": "3.1.1", - "description": "Parse the things that can be arguments to `npm install`", - "main": "npa.js", - "directories": { - "test": "test" - }, - "dependencies": { - "hosted-git-info": "^1.5.3", - "semver": "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", - "gitHead": "1dc802d4b449f1599c7275bb948c6ecd265c23a8", - "_id": "npm-package-arg@3.1.1", - "_shasum": "c9e5f7587f8484d1372a9b386fbf8b2443fc1bdb", - "_from": "npm-package-arg@>=3.0.0 <4.0.0", - "_npmVersion": "2.6.1", - "_nodeVersion": "1.1.0", - "_npmUser": { - "name": "iarna", - "email": "me@re-becca.org" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "dist": { - "shasum": "c9e5f7587f8484d1372a9b386fbf8b2443fc1bdb", - "tarball": "http://registry.npmjs.org/npm-package-arg/-/npm-package-arg-3.1.1.tgz" - }, - "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-3.1.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/basic.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/test/basic.js deleted file mode 100644 index 4991ffcd3..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/basic.js +++ /dev/null @@ -1,168 +0,0 @@ -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 <1.3.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@notgithub.com/user/foo#1.2.3": { - name: null, - type: "git", - 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": { - name: null, - type: "git", - spec: "file://path/to/repo#1.2.3", - raw: "git+file://path/to/repo#1.2.3" - }, - - "git://notgithub.com/user/foo": { - name: null, - type: "git", - spec: "git://notgithub.com/user/foo", - raw: "git://notgithub.com/user/foo" - }, - - "@foo/bar@git+ssh://notgithub.com/user/foo": { - name: "@foo/bar", - scope: "@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": { - 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" - }, - - "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", arg + " is result") - t.has(res, tests[arg], arg + " matches expectations") - }) - - // 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/node_modules/npm-registry-client/node_modules/npm-package-arg/test/bitbucket.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/test/bitbucket.js deleted file mode 100644 index 48bbdbcf9..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/bitbucket.js +++ /dev/null @@ -1,82 +0,0 @@ -var npa = require("../npa.js") -var path = require("path") - -require("tap").test("basic", 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" - } - } - - Object.keys(tests).forEach(function (arg) { - var res = npa(arg) - t.type(res, "Result", arg + " is a result") - t.has(res, tests[arg], arg + " matches expectations") - }) - - t.end() -}) diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/github.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/test/github.js deleted file mode 100644 index 63fd26c10..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/github.js +++ /dev/null @@ -1,106 +0,0 @@ -var npa = require("../npa.js") -var path = require("path") - -require("tap").test("basic", 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" - } - } - - Object.keys(tests).forEach(function (arg) { - var res = npa(arg) - t.type(res, "Result", arg + " is a result") - t.has(res, tests[arg], arg + " matches expectations") - }) - - t.end() -}) diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/gitlab.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/test/gitlab.js deleted file mode 100644 index 36ea016db..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/gitlab.js +++ /dev/null @@ -1,82 +0,0 @@ -var npa = require("../npa.js") -var path = require("path") - -require("tap").test("basic", 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" - } - } - - Object.keys(tests).forEach(function (arg) { - var res = npa(arg) - t.type(res, "Result", arg + " is a result") - t.has(res, tests[arg], arg + " matches expectations") - }) - - t.end() -}) diff --git a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/windows.js b/node_modules/npm-registry-client/node_modules/npm-package-arg/test/windows.js deleted file mode 100644 index e3c8ba6b5..000000000 --- a/node_modules/npm-registry-client/node_modules/npm-package-arg/test/windows.js +++ /dev/null @@ -1,41 +0,0 @@ -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() -}) |