Skip to content

Commit

Permalink
deps: update @npmcli/[email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
reggi committed Oct 2, 2024
1 parent 9cd6603 commit 820e983
Show file tree
Hide file tree
Showing 19 changed files with 243 additions and 106 deletions.
13 changes: 8 additions & 5 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
!/@npmcli/fs
!/@npmcli/git
!/@npmcli/installed-package-contents
!/@npmcli/installed-package-contents/node_modules/
/@npmcli/installed-package-contents/node_modules/*
!/@npmcli/installed-package-contents/node_modules/npm-normalize-package-bin
!/@npmcli/map-workspaces
!/@npmcli/map-workspaces/node_modules/
/@npmcli/map-workspaces/node_modules/*
Expand All @@ -34,6 +37,7 @@
!/@npmcli/metavuln-calculator/node_modules/@npmcli/agent
!/@npmcli/metavuln-calculator/node_modules/@npmcli/fs
!/@npmcli/metavuln-calculator/node_modules/@npmcli/git
!/@npmcli/metavuln-calculator/node_modules/@npmcli/installed-package-contents
!/@npmcli/metavuln-calculator/node_modules/@npmcli/package-json
!/@npmcli/metavuln-calculator/node_modules/@npmcli/promise-spawn
!/@npmcli/metavuln-calculator/node_modules/@npmcli/redact
Expand All @@ -45,6 +49,7 @@
!/@npmcli/metavuln-calculator/node_modules/json-parse-even-better-errors
!/@npmcli/metavuln-calculator/node_modules/make-fetch-happen
!/@npmcli/metavuln-calculator/node_modules/normalize-package-data
!/@npmcli/metavuln-calculator/node_modules/npm-bundled
!/@npmcli/metavuln-calculator/node_modules/npm-install-checks
!/@npmcli/metavuln-calculator/node_modules/npm-package-arg
!/@npmcli/metavuln-calculator/node_modules/npm-pick-manifest
Expand Down Expand Up @@ -226,6 +231,9 @@
!/normalize-package-data
!/npm-audit-report
!/npm-bundled
!/npm-bundled/node_modules/
/npm-bundled/node_modules/*
!/npm-bundled/node_modules/npm-normalize-package-bin
!/npm-install-checks
!/npm-normalize-package-bin
!/npm-package-arg
Expand All @@ -246,12 +254,7 @@
!/pacote
!/pacote/node_modules/
/pacote/node_modules/*
!/pacote/node_modules/@npmcli/
/pacote/node_modules/@npmcli/*
!/pacote/node_modules/@npmcli/installed-package-contents
!/pacote/node_modules/ignore-walk
!/pacote/node_modules/npm-bundled
!/pacote/node_modules/npm-normalize-package-bin
!/pacote/node_modules/npm-packlist
!/parse-conflict-json
!/path-key
Expand Down
23 changes: 12 additions & 11 deletions node_modules/@npmcli/installed-package-contents/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/installed-package-contents",
"version": "2.1.0",
"version": "3.0.0",
"description": "Get the list of files installed in a package in node_modules, including bundled dependencies",
"author": "GitHub Inc.",
"main": "lib/index.js",
Expand All @@ -11,35 +11,36 @@
"scripts": {
"test": "tap",
"snap": "tap",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"lint": "npm run eslint",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint"
"lintfix": "npm run eslint -- --fix",
"posttest": "npm run lint",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
},
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.21.4",
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.23.3",
"tap": "^16.3.0"
},
"dependencies": {
"npm-bundled": "^3.0.0",
"npm-normalize-package-bin": "^3.0.0"
"npm-bundled": "^4.0.0",
"npm-normalize-package-bin": "^4.0.0"
},
"repository": {
"type": "git",
"url": "https://github.com/npm/installed-package-contents.git"
"url": "git+https://github.com/npm/installed-package-contents.git"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
"node": "^18.17.0 || >=20.5.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.21.4",
"version": "4.23.3",
"publish": true
},
"tap": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@npmcli/installed-package-contents",
"version": "3.0.0",
"version": "2.1.0",
"description": "Get the list of files installed in a package in node_modules, including bundled dependencies",
"author": "GitHub Inc.",
"main": "lib/index.js",
Expand All @@ -11,36 +11,35 @@
"scripts": {
"test": "tap",
"snap": "tap",
"lint": "npm run eslint",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run eslint -- --fix",
"posttest": "npm run lint",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
"lintfix": "npm run lint -- --fix",
"posttest": "npm run lint"
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.23.3",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.21.4",
"tap": "^16.3.0"
},
"dependencies": {
"npm-bundled": "^4.0.0",
"npm-normalize-package-bin": "^4.0.0"
"npm-bundled": "^3.0.0",
"npm-normalize-package-bin": "^3.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm/installed-package-contents.git"
"url": "https://github.com/npm/installed-package-contents.git"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^18.17.0 || >=20.5.0"
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.23.3",
"version": "4.21.4",
"publish": true
},
"tap": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "npm-bundled",
"version": "3.0.1",
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/npm-bundled.git"
},
"author": "GitHub Inc.",
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.22.0",
"mutate-fs": "^2.1.1",
"tap": "^16.3.0"
},
"scripts": {
"test": "tap",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap",
"posttest": "npm run lint"
},
"files": [
"bin/",
"lib/"
],
"dependencies": {
"npm-normalize-package-bin": "^3.0.0"
},
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.22.0",
"publish": true
},
"tap": {
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
}
}
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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, '/'))
.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
Original file line number Diff line number Diff line change
@@ -1,44 +1,40 @@
{
"name": "npm-bundled",
"name": "npm-normalize-package-bin",
"version": "4.0.0",
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
"description": "Turn any flavor of allowable package.json bin into a normalized object",
"main": "lib/index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/npm/npm-bundled.git"
"url": "git+https://github.com/npm/npm-normalize-package-bin.git"
},
"author": "GitHub Inc.",
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.23.3",
"mutate-fs": "^2.1.1",
"tap": "^16.3.0"
},
"scripts": {
"test": "tap",
"snap": "tap",
"lint": "npm run eslint",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run eslint -- --fix",
"snap": "tap",
"posttest": "npm run lint",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
},
"devDependencies": {
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.23.3",
"tap": "^16.3.0"
},
"files": [
"bin/",
"lib/"
],
"dependencies": {
"npm-normalize-package-bin": "^4.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.23.3",
"publish": true
"publish": "true"
},
"tap": {
"nyc-arg": [
Expand Down
19 changes: 10 additions & 9 deletions node_modules/npm-bundled/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "npm-bundled",
"version": "3.0.1",
"version": "4.0.0",
"description": "list things in node_modules that are bundledDependencies, or transitive dependencies thereof",
"main": "lib/index.js",
"repository": {
Expand All @@ -10,33 +10,34 @@
"author": "GitHub Inc.",
"license": "ISC",
"devDependencies": {
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.22.0",
"@npmcli/eslint-config": "^5.0.0",
"@npmcli/template-oss": "4.23.3",
"mutate-fs": "^2.1.1",
"tap": "^16.3.0"
},
"scripts": {
"test": "tap",
"lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"lint": "npm run eslint",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"lintfix": "npm run eslint -- --fix",
"snap": "tap",
"posttest": "npm run lint"
"posttest": "npm run lint",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
},
"files": [
"bin/",
"lib/"
],
"dependencies": {
"npm-normalize-package-bin": "^3.0.0"
"npm-normalize-package-bin": "^4.0.0"
},
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
"node": "^18.17.0 || >=20.5.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.22.0",
"version": "4.23.3",
"publish": true
},
"tap": {
Expand Down
Loading

0 comments on commit 820e983

Please sign in to comment.