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:
authorLuke Karrys <luke@lukekarrys.com>2022-08-25 22:46:33 +0300
committerLuke Karrys <luke@lukekarrys.com>2022-08-26 01:02:40 +0300
commitb12ac013226b7d86b5b1847d58eabbac2846b153 (patch)
treedb1061a5f75995998551430712318603626ee852
parent7fbf6f7825f76906ecdec79ab15595f9e2f7b784 (diff)
deps: npm-pick-manifest@7.0.2
-rw-r--r--node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE15
-rw-r--r--node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js64
-rw-r--r--node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json41
-rw-r--r--node_modules/npm-pick-manifest/package.json4
-rw-r--r--package-lock.json21
-rw-r--r--package.json2
-rw-r--r--workspaces/arborist/package.json2
7 files changed, 139 insertions, 10 deletions
diff --git a/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE
new file mode 100644
index 000000000..19cec97b1
--- /dev/null
+++ b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/LICENSE
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) npm, Inc.
+
+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-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js
new file mode 100644
index 000000000..d6f0a581b
--- /dev/null
+++ b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/lib/index.js
@@ -0,0 +1,64 @@
+// pass in a manifest with a 'bin' field here, and it'll turn it
+// into a properly santized bin object
+const { join, basename } = require('path')
+
+const normalize = pkg =>
+ !pkg.bin ? removeBin(pkg)
+ : typeof pkg.bin === 'string' ? normalizeString(pkg)
+ : Array.isArray(pkg.bin) ? normalizeArray(pkg)
+ : typeof pkg.bin === 'object' ? normalizeObject(pkg)
+ : removeBin(pkg)
+
+const normalizeString = pkg => {
+ if (!pkg.name) {
+ return removeBin(pkg)
+ }
+ pkg.bin = { [pkg.name]: pkg.bin }
+ return normalizeObject(pkg)
+}
+
+const normalizeArray = pkg => {
+ pkg.bin = pkg.bin.reduce((acc, k) => {
+ acc[basename(k)] = k
+ return acc
+ }, {})
+ return normalizeObject(pkg)
+}
+
+const removeBin = pkg => {
+ delete pkg.bin
+ return pkg
+}
+
+const normalizeObject = pkg => {
+ const orig = pkg.bin
+ const clean = {}
+ let hasBins = false
+ Object.keys(orig).forEach(binKey => {
+ const base = join('/', basename(binKey.replace(/\\|:/g, '/'))).slice(1)
+
+ if (typeof orig[binKey] !== 'string' || !base) {
+ return
+ }
+
+ const binTarget = join('/', orig[binKey])
+ .replace(/\\/g, '/').slice(1)
+
+ if (!binTarget) {
+ return
+ }
+
+ clean[base] = binTarget
+ hasBins = true
+ })
+
+ if (hasBins) {
+ pkg.bin = clean
+ } else {
+ delete pkg.bin
+ }
+
+ return pkg
+}
+
+module.exports = normalize
diff --git a/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json
new file mode 100644
index 000000000..02de808d9
--- /dev/null
+++ b/node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin/package.json
@@ -0,0 +1,41 @@
+{
+ "name": "npm-normalize-package-bin",
+ "version": "2.0.0",
+ "description": "Turn any flavor of allowable package.json bin into a normalized object",
+ "main": "lib/index.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/npm/npm-normalize-package-bin.git"
+ },
+ "author": "GitHub Inc.",
+ "license": "ISC",
+ "scripts": {
+ "test": "tap",
+ "snap": "tap",
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "postpublish": "git push origin --follow-tags",
+ "lint": "eslint \"**/*.js\"",
+ "postlint": "template-oss-check",
+ "template-oss-apply": "template-oss-apply --force",
+ "lintfix": "npm run lint -- --fix",
+ "prepublishOnly": "git push origin --follow-tags",
+ "posttest": "npm run lint"
+ },
+ "devDependencies": {
+ "@npmcli/eslint-config": "^3.1.0",
+ "@npmcli/template-oss": "3.5.0",
+ "tap": "^16.3.0"
+ },
+ "files": [
+ "bin/",
+ "lib/"
+ ],
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
+ },
+ "templateOSS": {
+ "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
+ "version": "3.5.0"
+ }
+}
diff --git a/node_modules/npm-pick-manifest/package.json b/node_modules/npm-pick-manifest/package.json
index 79867d9ce..b3ebc9f8d 100644
--- a/node_modules/npm-pick-manifest/package.json
+++ b/node_modules/npm-pick-manifest/package.json
@@ -1,6 +1,6 @@
{
"name": "npm-pick-manifest",
- "version": "7.0.1",
+ "version": "7.0.2",
"description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.",
"main": "./lib",
"files": [
@@ -33,7 +33,7 @@
"license": "ISC",
"dependencies": {
"npm-install-checks": "^5.0.0",
- "npm-normalize-package-bin": "^1.0.1",
+ "npm-normalize-package-bin": "^2.0.0",
"npm-package-arg": "^9.0.0",
"semver": "^7.3.5"
},
diff --git a/package-lock.json b/package-lock.json
index 4046930c9..63159b716 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -136,7 +136,7 @@
"npm-audit-report": "^3.0.0",
"npm-install-checks": "^5.0.0",
"npm-package-arg": "^9.1.0",
- "npm-pick-manifest": "^7.0.1",
+ "npm-pick-manifest": "^7.0.2",
"npm-profile": "^6.2.0",
"npm-registry-fetch": "^13.3.1",
"npm-user-validate": "^1.0.1",
@@ -5516,13 +5516,13 @@
}
},
"node_modules/npm-pick-manifest": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.1.tgz",
- "integrity": "sha512-IA8+tuv8KujbsbLQvselW2XQgmXWS47t3CB0ZrzsRZ82DbDfkcFunOaPm4X7qNuhMfq+FmV7hQT4iFVpHqV7mg==",
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-7.0.2.tgz",
+ "integrity": "sha512-gk37SyRmlIjvTfcYl6RzDbSmS9Y4TOBXfsPnoYqTHARNgWbyDiCSMLUpmALDj4jjcTZpURiEfsSHJj9k7EV4Rw==",
"inBundle": true,
"dependencies": {
"npm-install-checks": "^5.0.0",
- "npm-normalize-package-bin": "^1.0.1",
+ "npm-normalize-package-bin": "^2.0.0",
"npm-package-arg": "^9.0.0",
"semver": "^7.3.5"
},
@@ -5530,6 +5530,15 @@
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
}
},
+ "node_modules/npm-pick-manifest/node_modules/npm-normalize-package-bin": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz",
+ "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==",
+ "inBundle": true,
+ "engines": {
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
+ }
+ },
"node_modules/npm-profile": {
"version": "6.2.1",
"resolved": "https://registry.npmjs.org/npm-profile/-/npm-profile-6.2.1.tgz",
@@ -10529,7 +10538,7 @@
"nopt": "^6.0.0",
"npm-install-checks": "^5.0.0",
"npm-package-arg": "^9.0.0",
- "npm-pick-manifest": "^7.0.0",
+ "npm-pick-manifest": "^7.0.2",
"npm-registry-fetch": "^13.0.0",
"npmlog": "^6.0.2",
"pacote": "^13.6.1",
diff --git a/package.json b/package.json
index 38873d0de..03984d906 100644
--- a/package.json
+++ b/package.json
@@ -101,7 +101,7 @@
"npm-audit-report": "^3.0.0",
"npm-install-checks": "^5.0.0",
"npm-package-arg": "^9.1.0",
- "npm-pick-manifest": "^7.0.1",
+ "npm-pick-manifest": "^7.0.2",
"npm-profile": "^6.2.0",
"npm-registry-fetch": "^13.3.1",
"npm-user-validate": "^1.0.1",
diff --git a/workspaces/arborist/package.json b/workspaces/arborist/package.json
index db997e1fa..0b9638771 100644
--- a/workspaces/arborist/package.json
+++ b/workspaces/arborist/package.json
@@ -24,7 +24,7 @@
"nopt": "^6.0.0",
"npm-install-checks": "^5.0.0",
"npm-package-arg": "^9.0.0",
- "npm-pick-manifest": "^7.0.0",
+ "npm-pick-manifest": "^7.0.2",
"npm-registry-fetch": "^13.0.0",
"npmlog": "^6.0.2",
"pacote": "^13.6.1",