diff options
author | isaacs <i@izs.me> | 2020-07-14 21:53:17 +0300 |
---|---|---|
committer | isaacs <i@izs.me> | 2020-07-29 21:53:10 +0300 |
commit | 523c7e4c782db181e6dd9b52b068c4af8ab6e7c1 (patch) | |
tree | c73a4337cde4d6a0468613f4a8dda79e34179d84 /node_modules/npm-pick-manifest | |
parent | 45e5b0db601ffa4538ba09ac8ffaacd5e3762ee1 (diff) |
remove direct dep on npm-install-checks
This module is only used via arborist and npm-pick-manifest
Diffstat (limited to 'node_modules/npm-pick-manifest')
6 files changed, 2 insertions, 216 deletions
diff --git a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/CHANGELOG.md b/node_modules/npm-pick-manifest/node_modules/npm-install-checks/CHANGELOG.md deleted file mode 100644 index ae4f22fcf..000000000 --- a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/CHANGELOG.md +++ /dev/null @@ -1,18 +0,0 @@ -# Change Log - -## v4.0 - -* Remove `checkCycle` and `checkGit`, as they are no longer used in npm v7 -* Synchronous throw-or-return API instead of taking a callback needlessly -* Modernize code and drop support for node versions less than 10 - -## v3 2016-01-12 - -* Change error messages to be more informative. -* checkEngine, when not in strict mode, now calls back with the error - object as the second argument instead of warning. -* checkCycle no longer logs when cycle errors are found. - -## v2 2015-01-20 - -* Remove checking of engineStrict in the package.json diff --git a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/LICENSE b/node_modules/npm-pick-manifest/node_modules/npm-install-checks/LICENSE deleted file mode 100644 index 3bed8320c..000000000 --- a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Robert Kowalski and Isaac Z. Schlueter ("Authors") -All rights reserved. - -The BSD License - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: - -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS -BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR -BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE -OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN -IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/README.md b/node_modules/npm-pick-manifest/node_modules/npm-install-checks/README.md deleted file mode 100644 index e83356c1d..000000000 --- a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# npm-install-checks - -Check the engines and platform fields in package.json - -## API - -Both functions will throw an error if the check fails, or return -`undefined` if everything is ok. - -Errors have a `required` and `current` fields. - -### .checkEngine(pkg, npmVer, nodeVer, force = false) - -Check if node/npm version is supported by the package. If it isn't -supported, an error is thrown. - -`force` argument will override the node version check, but not the npm -version check, as this typically would indicate that the current version of -npm is unable to install the package properly for some reason. - -Error code: 'EBADENGINE' - -### .checkPlatform(pkg, force) - -Check if OS/Arch is supported by the package. - -Error code: 'EBADPLATFORM' diff --git a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/index.js b/node_modules/npm-pick-manifest/node_modules/npm-install-checks/index.js deleted file mode 100644 index 732888ef5..000000000 --- a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/index.js +++ /dev/null @@ -1,79 +0,0 @@ -const {format} = require('util') -const semver = require('semver') - -const checkEngine = (target, npmVer, nodeVer, force = false) => { - const nodev = force ? null : nodeVer - const eng = target.engines - const opt = { includePrerelease: true } - if (!eng) { - return - } - - const nodeFail = nodev && eng.node && !semver.satisfies(nodev, eng.node, opt) - const npmFail = npmVer && eng.npm && !semver.satisfies(npmVer, eng.npm, opt) - if (nodeFail || npmFail) { - throw Object.assign(new Error('Unsupported engine'), { - pkgid: target._id, - current: { node: nodeVer, npm: npmVer }, - required: eng, - code: 'EBADENGINE' - }) - } -} - -const checkPlatform = (target, force = false) => { - if (force) { - return - } - - const platform = process.platform - const arch = process.arch - const osOk = target.os ? checkList(platform, target.os) : true - const cpuOk = target.cpu ? checkList(arch, target.cpu) : true - - if (!osOk || !cpuOk) { - throw Object.assign(new Error('Unsupported platform'), { - pkgid: target._id, - current: { - os: platform, - cpu: arch - }, - required: { - os: target.os, - cpu: target.cpu - }, - code: 'EBADPLATFORM' - }) - } -} - -const checkList = (value, list) => { - if (typeof list === 'string') { - list = [list] - } - if (list.length === 1 && list[0] === 'any') { - return true - } - // match none of the negated values, and at least one of the - // non-negated values, if any are present. - let negated = 0 - let match = false - for (const entry of list) { - const negate = entry.charAt(0) === '!' - const test = negate ? entry.slice(1) : entry - if (negate) { - negated ++ - if (value === test) { - return false - } - } else { - match = match || value === test - } - } - return match || negated === list.length -} - -module.exports = { - checkEngine, - checkPlatform -} diff --git a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/package.json b/node_modules/npm-pick-manifest/node_modules/npm-install-checks/package.json deleted file mode 100644 index 3b7b43f9c..000000000 --- a/node_modules/npm-pick-manifest/node_modules/npm-install-checks/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "_from": "npm-install-checks@^4.0.0", - "_id": "npm-install-checks@4.0.0", - "_inBundle": false, - "_integrity": "sha512-09OmyDkNLYwqKPOnbI8exiOZU2GVVmQp7tgez2BPi5OZC8M82elDAps7sxC4l//uSUtotWqoEIDwjRvWH4qz8w==", - "_location": "/npm-pick-manifest/npm-install-checks", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "npm-install-checks@^4.0.0", - "name": "npm-install-checks", - "escapedName": "npm-install-checks", - "rawSpec": "^4.0.0", - "saveSpec": null, - "fetchSpec": "^4.0.0" - }, - "_requiredBy": [ - "/npm-pick-manifest" - ], - "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-4.0.0.tgz", - "_shasum": "a37facc763a2fde0497ef2c6d0ac7c3fbe00d7b4", - "_spec": "npm-install-checks@^4.0.0", - "_where": "/Users/claudiahdz/npm/cli/node_modules/npm-pick-manifest", - "bugs": { - "url": "https://github.com/npm/npm-install-checks/issues" - }, - "bundleDependencies": false, - "dependencies": { - "semver": "^7.1.1" - }, - "deprecated": false, - "description": "Check the engines and platform fields in package.json", - "devDependencies": { - "tap": "^14.10.6" - }, - "engines": { - "node": ">=10" - }, - "files": [ - "index.js" - ], - "homepage": "https://github.com/npm/npm-install-checks#readme", - "keywords": [ - "npm,", - "install" - ], - "license": "BSD-2-Clause", - "main": "index.js", - "name": "npm-install-checks", - "repository": { - "type": "git", - "url": "git://github.com/npm/npm-install-checks.git" - }, - "scripts": { - "postpublish": "git push origin --follow-tags", - "postversion": "npm publish", - "preversion": "npm test", - "test": "tap" - }, - "version": "4.0.0" -} diff --git a/node_modules/npm-pick-manifest/package.json b/node_modules/npm-pick-manifest/package.json index 0dc131d97..3ea14b5c4 100644 --- a/node_modules/npm-pick-manifest/package.json +++ b/node_modules/npm-pick-manifest/package.json @@ -4,9 +4,7 @@ "_inBundle": false, "_integrity": "sha512-ygs4k6f54ZxJXrzT0x34NybRlLeZ4+6nECAIbr2i0foTnijtS1TJiyzpqtuUAJOps/hO0tNDr8fRV5g+BtRlTw==", "_location": "/npm-pick-manifest", - "_phantomChildren": { - "semver": "7.3.2" - }, + "_phantomChildren": {}, "_requested": { "type": "tag", "registry": true, @@ -20,6 +18,7 @@ "_requiredBy": [ "#USER", "/", + "/@npmcli/arborist", "/@npmcli/git", "/pacote" ], |