aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npm-pick-manifest
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/npm-pick-manifest')
-rw-r--r--deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md82
-rw-r--r--deps/npm/node_modules/npm-pick-manifest/README.md4
-rw-r--r--deps/npm/node_modules/npm-pick-manifest/index.js37
-rw-r--r--deps/npm/node_modules/npm-pick-manifest/package.json31
4 files changed, 102 insertions, 52 deletions
diff --git a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md
index 2112665f75..c594ba140f 100644
--- a/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md
+++ b/deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md
@@ -2,73 +2,107 @@
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="3.0.2"></a>
+## [3.0.2](https://github.com/npm/npm-pick-manifest/compare/v3.0.1...v3.0.2) (2019-08-30)
+
+
+
+<a name="3.0.1"></a>
+## [3.0.1](https://github.com/npm/npm-pick-manifest/compare/v3.0.0...v3.0.1) (2019-08-28)
+
+
+### Bug Fixes
+
+* throw 403 for forbidden major/minor versions ([003286e](https://github.com/npm/npm-pick-manifest/commit/003286e)), closes [#2](https://github.com/npm/npm-pick-manifest/issues/2)
+
+
+
+<a name="3.0.0"></a>
+# [3.0.0](https://github.com/npm/npm-pick-manifest/compare/v2.2.3...v3.0.0) (2019-08-20)
+
+
+### Features
+
+* throw forbidden error when package is blocked by policy ([ad2a962](https://github.com/npm/npm-pick-manifest/commit/ad2a962)), closes [#1](https://github.com/npm/npm-pick-manifest/issues/1)
+
+
+### BREAKING CHANGES
+
+* This adds a new error code when package versions are
+blocked.
+
+PR-URL: https://github.com/npm/npm-pick-manifest/pull/1
+Credit: @claudiahdz
+
+
+
<a name="2.2.3"></a>
-## [2.2.3](https://github.com/zkat/npm-pick-manifest/compare/v2.2.2...v2.2.3) (2018-10-31)
+## [2.2.3](https://github.com/npm/npm-pick-manifest/compare/v2.2.2...v2.2.3) (2018-10-31)
### Bug Fixes
-* **enjoyBy:** rework semantics for enjoyBy again ([5e89b62](https://github.com/zkat/npm-pick-manifest/commit/5e89b62))
+* **enjoyBy:** rework semantics for enjoyBy again ([5e89b62](https://github.com/npm/npm-pick-manifest/commit/5e89b62))
<a name="2.2.2"></a>
-## [2.2.2](https://github.com/zkat/npm-pick-manifest/compare/v2.2.1...v2.2.2) (2018-10-31)
+## [2.2.2](https://github.com/npm/npm-pick-manifest/compare/v2.2.1...v2.2.2) (2018-10-31)
### Bug Fixes
-* **enjoyBy:** rework semantics for enjoyBy ([5684f45](https://github.com/zkat/npm-pick-manifest/commit/5684f45))
+* **enjoyBy:** rework semantics for enjoyBy ([5684f45](https://github.com/npm/npm-pick-manifest/commit/5684f45))
<a name="2.2.1"></a>
-## [2.2.1](https://github.com/zkat/npm-pick-manifest/compare/v2.2.0...v2.2.1) (2018-10-30)
+## [2.2.1](https://github.com/npm/npm-pick-manifest/compare/v2.2.0...v2.2.1) (2018-10-30)
<a name="2.2.0"></a>
-# [2.2.0](https://github.com/zkat/npm-pick-manifest/compare/v2.1.0...v2.2.0) (2018-10-30)
+# [2.2.0](https://github.com/npm/npm-pick-manifest/compare/v2.1.0...v2.2.0) (2018-10-30)
### Bug Fixes
-* **audit:** npm audit fix --force ([d5ae6c4](https://github.com/zkat/npm-pick-manifest/commit/d5ae6c4))
+* **audit:** npm audit fix --force ([d5ae6c4](https://github.com/npm/npm-pick-manifest/commit/d5ae6c4))
### Features
-* **enjoyBy:** add opts.enjoyBy option to filter versions by date ([0b8a790](https://github.com/zkat/npm-pick-manifest/commit/0b8a790))
+* **enjoyBy:** add opts.enjoyBy option to filter versions by date ([0b8a790](https://github.com/npm/npm-pick-manifest/commit/0b8a790))
<a name="2.1.0"></a>
-# [2.1.0](https://github.com/zkat/npm-pick-manifest/compare/v2.0.1...v2.1.0) (2017-10-18)
+# [2.1.0](https://github.com/npm/npm-pick-manifest/compare/v2.0.1...v2.1.0) (2017-10-18)
### Features
-* **selection:** allow manually disabling deprecation skipping ([0d239d3](https://github.com/zkat/npm-pick-manifest/commit/0d239d3))
+* **selection:** allow manually disabling deprecation skipping ([0d239d3](https://github.com/npm/npm-pick-manifest/commit/0d239d3))
<a name="2.0.1"></a>
-## [2.0.1](https://github.com/zkat/npm-pick-manifest/compare/v2.0.0...v2.0.1) (2017-10-18)
+## [2.0.1](https://github.com/npm/npm-pick-manifest/compare/v2.0.0...v2.0.1) (2017-10-18)
<a name="2.0.0"></a>
-# [2.0.0](https://github.com/zkat/npm-pick-manifest/compare/v1.0.4...v2.0.0) (2017-10-03)
+# [2.0.0](https://github.com/npm/npm-pick-manifest/compare/v1.0.4...v2.0.0) (2017-10-03)
### Bug Fixes
-* **license:** relicense project according to npm policy (#3) ([ed743a0](https://github.com/zkat/npm-pick-manifest/commit/ed743a0))
+* **license:** relicense project according to npm policy (#3) ([ed743a0](https://github.com/npm/npm-pick-manifest/commit/ed743a0))
### Features
-* **selection:** Avoid matching deprecated packages if possible ([3fc6c3a](https://github.com/zkat/npm-pick-manifest/commit/3fc6c3a))
+* **selection:** Avoid matching deprecated packages if possible ([3fc6c3a](https://github.com/npm/npm-pick-manifest/commit/3fc6c3a))
### BREAKING CHANGES
@@ -79,43 +113,43 @@ All notable changes to this project will be documented in this file. See [standa
<a name="1.0.4"></a>
-## [1.0.4](https://github.com/zkat/npm-pick-manifest/compare/v1.0.3...v1.0.4) (2017-06-29)
+## [1.0.4](https://github.com/npm/npm-pick-manifest/compare/v1.0.3...v1.0.4) (2017-06-29)
### Bug Fixes
-* **npa:** bump npa version for bugfixes ([7cdaca7](https://github.com/zkat/npm-pick-manifest/commit/7cdaca7))
-* **semver:** use loose semver parsing for *all* ops ([bbc0daa](https://github.com/zkat/npm-pick-manifest/commit/bbc0daa))
+* **npa:** bump npa version for bugfixes ([7cdaca7](https://github.com/npm/npm-pick-manifest/commit/7cdaca7))
+* **semver:** use loose semver parsing for *all* ops ([bbc0daa](https://github.com/npm/npm-pick-manifest/commit/bbc0daa))
<a name="1.0.3"></a>
-## [1.0.3](https://github.com/zkat/npm-pick-manifest/compare/v1.0.2...v1.0.3) (2017-05-04)
+## [1.0.3](https://github.com/npm/npm-pick-manifest/compare/v1.0.2...v1.0.3) (2017-05-04)
### Bug Fixes
-* **semver:** use semver.clean() instead ([f4133b5](https://github.com/zkat/npm-pick-manifest/commit/f4133b5))
+* **semver:** use semver.clean() instead ([f4133b5](https://github.com/npm/npm-pick-manifest/commit/f4133b5))
<a name="1.0.2"></a>
-## [1.0.2](https://github.com/zkat/npm-pick-manifest/compare/v1.0.1...v1.0.2) (2017-05-04)
+## [1.0.2](https://github.com/npm/npm-pick-manifest/compare/v1.0.1...v1.0.2) (2017-05-04)
### Bug Fixes
-* **picker:** spaces in `wanted` prevented match ([97a7d0a](https://github.com/zkat/npm-pick-manifest/commit/97a7d0a))
+* **picker:** spaces in `wanted` prevented match ([97a7d0a](https://github.com/npm/npm-pick-manifest/commit/97a7d0a))
<a name="1.0.1"></a>
-## [1.0.1](https://github.com/zkat/npm-pick-manifest/compare/v1.0.0...v1.0.1) (2017-04-24)
+## [1.0.1](https://github.com/npm/npm-pick-manifest/compare/v1.0.0...v1.0.1) (2017-04-24)
### Bug Fixes
-* **deps:** forgot to add semver ([1876f4f](https://github.com/zkat/npm-pick-manifest/commit/1876f4f))
+* **deps:** forgot to add semver ([1876f4f](https://github.com/npm/npm-pick-manifest/commit/1876f4f))
@@ -125,7 +159,7 @@ All notable changes to this project will be documented in this file. See [standa
### Features
-* **api:** initial implementation. ([b086912](https://github.com/zkat/npm-pick-manifest/commit/b086912))
+* **api:** initial implementation. ([b086912](https://github.com/npm/npm-pick-manifest/commit/b086912))
### BREAKING CHANGES
diff --git a/deps/npm/node_modules/npm-pick-manifest/README.md b/deps/npm/node_modules/npm-pick-manifest/README.md
index a9a027bfcb..d32d47af19 100644
--- a/deps/npm/node_modules/npm-pick-manifest/README.md
+++ b/deps/npm/node_modules/npm-pick-manifest/README.md
@@ -1,6 +1,6 @@
-# npm-pick-manifest [![npm version](https://img.shields.io/npm/v/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![license](https://img.shields.io/npm/l/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![Travis](https://img.shields.io/travis/zkat/npm-pick-manifest.svg)](https://travis-ci.org/zkat/npm-pick-manifest) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/zkat/npm-pick-manifest?svg=true)](https://ci.appveyor.com/project/zkat/npm-pick-manifest) [![Coverage Status](https://coveralls.io/repos/github/zkat/npm-pick-manifest/badge.svg?branch=latest)](https://coveralls.io/github/zkat/npm-pick-manifest?branch=latest)
+# npm-pick-manifest [![npm version](https://img.shields.io/npm/v/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![license](https://img.shields.io/npm/l/npm-pick-manifest.svg)](https://npm.im/npm-pick-manifest) [![Travis](https://img.shields.io/travis/npm/npm-pick-manifest.svg)](https://travis-ci.org/npm/npm-pick-manifest) [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/npm/npm-pick-manifest?svg=true)](https://ci.appveyor.com/project/npm/npm-pick-manifest) [![Coverage Status](https://coveralls.io/repos/github/npm/npm-pick-manifest/badge.svg?branch=latest)](https://coveralls.io/github/npm/npm-pick-manifest?branch=latest)
-[`npm-pick-manifest`](https://github.com/zkat/npm-pick-manifest) is a standalone
+[`npm-pick-manifest`](https://github.com/npm/npm-pick-manifest) is a standalone
implementation of [npm](https://npmjs.com)'s semver range resolution algorithm.
## Install
diff --git a/deps/npm/node_modules/npm-pick-manifest/index.js b/deps/npm/node_modules/npm-pick-manifest/index.js
index d9a8373e57..9eb2d82d10 100644
--- a/deps/npm/node_modules/npm-pick-manifest/index.js
+++ b/deps/npm/node_modules/npm-pick-manifest/index.js
@@ -23,6 +23,9 @@ function pickManifest (packument, wanted, opts) {
const versions = Object.keys(packument.versions || {}).filter(v => {
return semver.valid(v, true)
})
+ const policyRestrictions = packument.policyRestrictions
+ const restrictedVersions = policyRestrictions
+ ? Object.keys(policyRestrictions.versions) : []
function enjoyableBy (v) {
return !time || (
@@ -32,7 +35,7 @@ function pickManifest (packument, wanted, opts) {
let err
- if (!versions.length) {
+ if (!versions.length && !restrictedVersions.length) {
err = new Error(`No valid versions available for ${packument.name}`)
err.code = 'ENOVERSIONS'
err.name = packument.name
@@ -93,21 +96,33 @@ function pickManifest (packument, wanted, opts) {
target = stillFresh[0]
}
+ if (!target && restrictedVersions) {
+ target = semver.maxSatisfying(restrictedVersions, wanted, true)
+ }
+
const manifest = (
target &&
packument.versions[target]
)
if (!manifest) {
- err = new Error(
- `No matching version found for ${packument.name}@${wanted}${
- opts.enjoyBy
- ? ` with an Enjoy By date of ${
- new Date(opts.enjoyBy).toLocaleString()
- }. Maybe try a different date?`
- : ''
- }`
- )
- err.code = 'ETARGET'
+ // Check if target is forbidden
+ const isForbidden = target && policyRestrictions && policyRestrictions.versions[target]
+ const pckg = `${packument.name}@${wanted}${
+ opts.enjoyBy
+ ? ` with an Enjoy By date of ${
+ new Date(opts.enjoyBy).toLocaleString()
+ }. Maybe try a different date?`
+ : ''
+ }`
+
+ if (isForbidden) {
+ err = new Error(`Could not download ${pckg} due to policy violations.\n${policyRestrictions.message}\n`)
+ err.code = 'E403'
+ } else {
+ err = new Error(`No matching version found for ${pckg}.`)
+ err.code = 'ETARGET'
+ }
+
err.name = packument.name
err.type = type
err.wanted = wanted
diff --git a/deps/npm/node_modules/npm-pick-manifest/package.json b/deps/npm/node_modules/npm-pick-manifest/package.json
index a80c76d372..5adbc26957 100644
--- a/deps/npm/node_modules/npm-pick-manifest/package.json
+++ b/deps/npm/node_modules/npm-pick-manifest/package.json
@@ -1,34 +1,35 @@
{
- "_from": "npm-pick-manifest@2.2.3",
- "_id": "npm-pick-manifest@2.2.3",
+ "_from": "npm-pick-manifest@3.0.2",
+ "_id": "npm-pick-manifest@3.0.2",
"_inBundle": false,
- "_integrity": "sha512-+IluBC5K201+gRU85vFlUwX3PFShZAbAgDNp2ewJdWMVSppdo/Zih0ul2Ecky/X7b51J7LrrUAP+XOmOCvYZqA==",
+ "_integrity": "sha512-wNprTNg+X5nf+tDi+hbjdHhM4bX+mKqv6XmPh7B5eG+QY9VARfQPfCEH013H5GqfNj6ee8Ij2fg8yk0mzps1Vw==",
"_location": "/npm-pick-manifest",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
- "raw": "npm-pick-manifest@2.2.3",
+ "raw": "npm-pick-manifest@3.0.2",
"name": "npm-pick-manifest",
"escapedName": "npm-pick-manifest",
- "rawSpec": "2.2.3",
+ "rawSpec": "3.0.2",
"saveSpec": null,
- "fetchSpec": "2.2.3"
+ "fetchSpec": "3.0.2"
},
"_requiredBy": [
"#USER",
- "/"
+ "/",
+ "/pacote"
],
- "_resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-2.2.3.tgz",
- "_shasum": "32111d2a9562638bb2c8f2bf27f7f3092c8fae40",
- "_spec": "npm-pick-manifest@2.2.3",
- "_where": "/Users/aeschright/code/cli",
+ "_resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-3.0.2.tgz",
+ "_shasum": "f4d9e5fd4be2153e5f4e5f9b7be8dc419a99abb7",
+ "_spec": "npm-pick-manifest@3.0.2",
+ "_where": "/Users/claudiahdz/npm/cli",
"author": {
"name": "Kat Marchán",
"email": "kzm@sykosomatic.org"
},
"bugs": {
- "url": "https://github.com/zkat/npm-pick-manifest/issues"
+ "url": "https://github.com/npm/npm-pick-manifest/issues"
},
"bundleDependencies": false,
"config": {
@@ -57,7 +58,7 @@
"files": [
"*.js"
],
- "homepage": "https://github.com/zkat/npm-pick-manifest#readme",
+ "homepage": "https://github.com/npm/npm-pick-manifest#readme",
"keywords": [
"npm",
"semver",
@@ -68,7 +69,7 @@
"name": "npm-pick-manifest",
"repository": {
"type": "git",
- "url": "git+https://github.com/zkat/npm-pick-manifest.git"
+ "url": "git+https://github.com/npm/npm-pick-manifest.git"
},
"scripts": {
"postrelease": "npm publish && git push --follow-tags",
@@ -79,5 +80,5 @@
"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": "2.2.3"
+ "version": "3.0.2"
}