diff options
author | Rebecca Turner <me@re-becca.org> | 2018-04-13 00:12:01 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2018-04-13 00:12:02 +0300 |
commit | 7bdbaeea61853280f00c8443a3b2d6e6b893ada9 (patch) | |
tree | 52157c404b0ec5f9ca243dc4fd7da140cb56be4d /node_modules | |
parent | 4781b64bcc47d4e7fb7025fd6517cde044f6b5e1 (diff) |
npm-package-arg@6.1.0
Credit: @zkat
Diffstat (limited to 'node_modules')
-rw-r--r-- | node_modules/npm-package-arg/CHANGELOG.md | 16 | ||||
-rw-r--r-- | node_modules/npm-package-arg/npa.js | 20 | ||||
-rw-r--r-- | node_modules/npm-package-arg/package.json | 54 |
3 files changed, 70 insertions, 20 deletions
diff --git a/node_modules/npm-package-arg/CHANGELOG.md b/node_modules/npm-package-arg/CHANGELOG.md new file mode 100644 index 000000000..83e5763f4 --- /dev/null +++ b/node_modules/npm-package-arg/CHANGELOG.md @@ -0,0 +1,16 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +<a name="6.1.0"></a> +# [6.1.0](https://github.com/npm/npm-package-arg/compare/v6.0.0...v6.1.0) (2018-04-10) + + +### Bug Fixes + +* **git:** Fix gitRange for git+ssh for private git ([#33](https://github.com/npm/npm-package-arg/issues/33)) ([647a0b3](https://github.com/npm/npm-package-arg/commit/647a0b3)) + + +### Features + +* **alias:** add `npm:` registry alias spec ([#34](https://github.com/npm/npm-package-arg/issues/34)) ([ab99f8e](https://github.com/npm/npm-package-arg/commit/ab99f8e)) diff --git a/node_modules/npm-package-arg/npa.js b/node_modules/npm-package-arg/npa.js index dc885b1ff..4d56237a5 100644 --- a/node_modules/npm-package-arg/npa.js +++ b/node_modules/npm-package-arg/npa.js @@ -62,6 +62,8 @@ function resolve (name, spec, where, arg) { if (spec && (isFilespec.test(spec) || /^file:/i.test(spec))) { return fromFile(res, where) + } else if (spec && /^npm:/i.test(spec)) { + return fromAlias(res, where) } if (!HostedGit) HostedGit = require('hosted-git-info') const hosted = HostedGit.fromUrl(spec, {noGitPlus: true, noCommittish: true}) @@ -231,8 +233,8 @@ function fromURL (res) { res.type = 'git' const match = urlparse.protocol === 'git+ssh:' && matchGitScp(res.rawSpec) if (match) { + setGitCommittish(res, match.gitCommittish) res.fetchSpec = match.fetchSpec - res.gitCommittish = match.gitCommittish } else { setGitCommittish(res, urlparse.hash != null ? urlparse.hash.slice(1) : '') urlparse.protocol = urlparse.protocol.replace(/^git[+]/, '') @@ -253,6 +255,22 @@ function fromURL (res) { return res } +function fromAlias (res, where) { + const subSpec = npa(res.rawSpec.substr(4), where) + if (subSpec.type === 'alias') { + throw new Error('nested aliases not supported') + } + if (!subSpec.registry) { + throw new Error('aliases only work for registry deps') + } + res.subSpec = subSpec + res.registry = true + res.type = 'alias' + res.saveSpec = null + res.fetchSpec = null + return res +} + function fromRegistry (res) { res.registry = true const spec = res.rawSpec === '' ? 'latest' : res.rawSpec diff --git a/node_modules/npm-package-arg/package.json b/node_modules/npm-package-arg/package.json index 383688514..afbe68b18 100644 --- a/node_modules/npm-package-arg/package.json +++ b/node_modules/npm-package-arg/package.json @@ -1,28 +1,35 @@ { - "_from": "npm-package-arg@latest", - "_id": "npm-package-arg@6.0.0", + "_from": "npm-package-arg@6.1.0", + "_id": "npm-package-arg@6.1.0", "_inBundle": false, - "_integrity": "sha512-hwC7g81KLgRmchv9ol6f3Fx4Yyc9ARX5X5niDHVILgpuvf08JRIgOZcEfpFXli3BgESoTrkauqorXm6UbvSgSg==", + "_integrity": "sha512-zYbhP2k9DbJhA0Z3HKUePUgdB1x7MfIfKssC+WLPFMKTBZKpZh5m13PgexJjCq6KW7j17r0jHWcCpxEqnnncSA==", "_location": "/npm-package-arg", "_phantomChildren": {}, "_requested": { - "type": "tag", + "type": "version", "registry": true, - "raw": "npm-package-arg@latest", + "raw": "npm-package-arg@6.1.0", "name": "npm-package-arg", "escapedName": "npm-package-arg", - "rawSpec": "latest", + "rawSpec": "6.1.0", "saveSpec": null, - "fetchSpec": "latest" + "fetchSpec": "6.1.0" }, "_requiredBy": [ "#USER", - "/" + "/", + "/init-package-json", + "/libcipm", + "/libcipm/pacote", + "/libnpmhook/npm-registry-fetch", + "/libnpx", + "/npm-pick-manifest", + "/npm-registry-client" ], - "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.0.0.tgz", - "_shasum": "8cce04b49d3f9faec3f56b0fe5f4391aeb9d2fac", - "_spec": "npm-package-arg@latest", - "_where": "/Users/zkat/Documents/code/npm", + "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-6.1.0.tgz", + "_shasum": "15ae1e2758a5027efb4c250554b85a737db7fcc1", + "_spec": "npm-package-arg@6.1.0", + "_where": "/Users/rebecca/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -33,16 +40,19 @@ }, "bundleDependencies": false, "dependencies": { - "hosted-git-info": "^2.5.0", - "osenv": "^0.1.4", - "semver": "^5.4.1", + "hosted-git-info": "^2.6.0", + "osenv": "^0.1.5", + "semver": "^5.5.0", "validate-npm-package-name": "^3.0.0" }, "deprecated": false, "description": "Parse the things that can be arguments to `npm install`", "devDependencies": { - "standard": "9.0.2", - "tap": "^10.3.0" + "standard": "^11.0.1", + "standard-version": "^4.3.0", + "tap": "^11.1.3", + "weallbehave": "^1.2.0", + "weallcontribute": "^1.0.8" }, "directories": { "test": "test" @@ -59,7 +69,13 @@ "url": "git+https://github.com/npm/npm-package-arg.git" }, "scripts": { - "test": "standard && tap -J --coverage test/*.js" + "postrelease": "npm publish && git push --follow-tags", + "prerelease": "npm t", + "pretest": "standard", + "release": "standard-version -s", + "test": "tap -J --coverage test/*.js", + "update-coc": "weallbehave -o . && git add CODE_OF_CONDUCT.md && git commit -m 'docs(coc): updated CODE_OF_CONDUCT.md'", + "update-contrib": "weallcontribute -o . && git add CONTRIBUTING.md && git commit -m 'docs(contributing): updated CONTRIBUTING.md'" }, - "version": "6.0.0" + "version": "6.1.0" } |