From b84d9079feaf9582763356e538c7247383b00e9f Mon Sep 17 00:00:00 2001 From: reggi Date: Wed, 2 Oct 2024 13:26:10 -0400 Subject: [PATCH] deps: update @npmcli/git@6.0.1 --- node_modules/.gitignore | 22 +- .../@npmcli/promise-spawn/lib/escape.js | 68 --- .../@npmcli/promise-spawn/lib/index.js | 206 --------- .../@npmcli/promise-spawn/package.json | 50 --- .../git/node_modules/hosted-git-info/LICENSE | 13 - .../hosted-git-info/lib/from-url.js | 122 ----- .../node_modules/hosted-git-info/lib/hosts.js | 227 ---------- .../node_modules/hosted-git-info/lib/index.js | 179 -------- .../hosted-git-info/lib/parse-url.js | 78 ---- .../node_modules/hosted-git-info/package.json | 60 --- .../@npmcli/git/node_modules/isexe/LICENSE | 15 - .../git/node_modules/isexe/dist/cjs/index.js | 46 -- .../node_modules/isexe/dist/cjs/options.js | 3 - .../node_modules/isexe/dist/cjs/package.json | 3 - .../git/node_modules/isexe/dist/cjs/posix.js | 67 --- .../git/node_modules/isexe/dist/cjs/win32.js | 62 --- .../git/node_modules/isexe/dist/mjs/index.js | 16 - .../node_modules/isexe/dist/mjs/options.js | 2 - .../node_modules/isexe/dist/mjs/package.json | 3 - .../git/node_modules/isexe/dist/mjs/posix.js | 62 --- .../git/node_modules/isexe/dist/mjs/win32.js | 57 --- .../git/node_modules/isexe/package.json | 96 ---- .../node_modules/npm-install-checks/LICENSE | 27 -- .../npm-install-checks/lib/index.js | 101 ----- .../npm-install-checks/package.json | 51 --- .../git/node_modules/npm-package-arg/LICENSE | 15 - .../node_modules/npm-package-arg/lib/npa.js | 415 ------------------ .../node_modules/npm-package-arg/package.json | 61 --- .../node_modules/npm-pick-manifest/LICENSE.md | 16 - .../npm-pick-manifest/lib/index.js | 224 ---------- .../npm-pick-manifest/package.json | 57 --- .../@npmcli/git/node_modules/proc-log/LICENSE | 15 - .../git/node_modules/proc-log/lib/index.js | 153 ------- .../git/node_modules/proc-log/package.json | 45 -- .../validate-npm-package-name/LICENSE | 6 - .../validate-npm-package-name/lib/index.js | 105 ----- .../validate-npm-package-name/package.json | 60 --- .../@npmcli/git/node_modules/which/LICENSE | 15 - .../git/node_modules/which/bin/which.js | 52 --- .../git/node_modules/which/lib/index.js | 111 ----- .../git/node_modules/which/package.json | 57 --- node_modules/@npmcli/git/package.json | 27 +- .../node_modules/@npmcli/git}/LICENSE | 0 .../node_modules/@npmcli/git/lib/clone.js | 0 .../node_modules/@npmcli/git/lib/errors.js | 0 .../node_modules/@npmcli/git/lib/find.js | 0 .../node_modules/@npmcli/git/lib/index.js | 0 .../node_modules/@npmcli/git/lib/is-clean.js | 0 .../node_modules/@npmcli/git/lib/is.js | 0 .../@npmcli/git/lib/lines-to-revs.js | 0 .../@npmcli/git/lib/make-error.js | 0 .../node_modules/@npmcli/git/lib/opts.js | 0 .../node_modules/@npmcli/git/lib/revs.js | 0 .../node_modules/@npmcli/git/lib/spawn.js | 0 .../node_modules/@npmcli/git/lib/utils.js | 0 .../node_modules/@npmcli/git/lib/which.js | 0 .../node_modules/@npmcli/git/package.json | 27 +- .../node_modules/ini/LICENSE | 0 .../node_modules/ini/lib/ini.js | 0 .../node_modules/ini/package.json | 0 .../node_modules/@npmcli/git/LICENSE | 15 - .../pacote/node_modules/@npmcli/git/LICENSE | 15 - .../node_modules/@npmcli/git/lib/clone.js | 172 -------- .../node_modules/@npmcli/git/lib/errors.js | 36 -- .../node_modules/@npmcli/git/lib/find.js | 15 - .../node_modules/@npmcli/git/lib/index.js | 9 - .../node_modules/@npmcli/git/lib/is-clean.js | 6 - .../pacote/node_modules/@npmcli/git/lib/is.js | 4 - .../@npmcli/git/lib/lines-to-revs.js | 147 ------- .../@npmcli/git/lib/make-error.js | 33 -- .../node_modules/@npmcli/git/lib/opts.js | 57 --- .../node_modules/@npmcli/git/lib/revs.js | 28 -- .../node_modules/@npmcli/git/lib/spawn.js | 44 -- .../node_modules/@npmcli/git/lib/utils.js | 3 - .../node_modules/@npmcli/git/lib/which.js | 18 - .../node_modules/@npmcli/git/package.json | 59 --- package-lock.json | 300 ++++++------- package.json | 2 +- workspaces/libnpmversion/package.json | 2 +- 79 files changed, 161 insertions(+), 3901 deletions(-) delete mode 100644 node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/escape.js delete mode 100644 node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/hosted-git-info/LICENSE delete mode 100644 node_modules/@npmcli/git/node_modules/hosted-git-info/lib/from-url.js delete mode 100644 node_modules/@npmcli/git/node_modules/hosted-git-info/lib/hosts.js delete mode 100644 node_modules/@npmcli/git/node_modules/hosted-git-info/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/hosted-git-info/lib/parse-url.js delete mode 100644 node_modules/@npmcli/git/node_modules/hosted-git-info/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/LICENSE delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/cjs/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/cjs/options.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/cjs/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/cjs/posix.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/cjs/win32.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/mjs/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/mjs/options.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/mjs/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/mjs/posix.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/dist/mjs/win32.js delete mode 100644 node_modules/@npmcli/git/node_modules/isexe/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/npm-install-checks/LICENSE delete mode 100644 node_modules/@npmcli/git/node_modules/npm-install-checks/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/npm-install-checks/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/npm-package-arg/LICENSE delete mode 100644 node_modules/@npmcli/git/node_modules/npm-package-arg/lib/npa.js delete mode 100644 node_modules/@npmcli/git/node_modules/npm-package-arg/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/npm-pick-manifest/LICENSE.md delete mode 100644 node_modules/@npmcli/git/node_modules/npm-pick-manifest/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/npm-pick-manifest/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/proc-log/LICENSE delete mode 100644 node_modules/@npmcli/git/node_modules/proc-log/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/proc-log/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/validate-npm-package-name/LICENSE delete mode 100644 node_modules/@npmcli/git/node_modules/validate-npm-package-name/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/validate-npm-package-name/package.json delete mode 100644 node_modules/@npmcli/git/node_modules/which/LICENSE delete mode 100755 node_modules/@npmcli/git/node_modules/which/bin/which.js delete mode 100644 node_modules/@npmcli/git/node_modules/which/lib/index.js delete mode 100644 node_modules/@npmcli/git/node_modules/which/package.json rename node_modules/@npmcli/{git/node_modules/@npmcli/promise-spawn => metavuln-calculator/node_modules/@npmcli/git}/LICENSE (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/clone.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/errors.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/find.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/index.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/is-clean.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/is.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/lines-to-revs.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/make-error.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/opts.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/revs.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/spawn.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/utils.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/lib/which.js (100%) rename node_modules/@npmcli/{package-json => metavuln-calculator}/node_modules/@npmcli/git/package.json (66%) rename node_modules/@npmcli/{git => metavuln-calculator}/node_modules/ini/LICENSE (100%) rename node_modules/@npmcli/{git => metavuln-calculator}/node_modules/ini/lib/ini.js (100%) rename node_modules/@npmcli/{git => metavuln-calculator}/node_modules/ini/package.json (100%) delete mode 100644 node_modules/@npmcli/package-json/node_modules/@npmcli/git/LICENSE delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/LICENSE delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/clone.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/errors.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/find.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/index.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/is-clean.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/is.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/lines-to-revs.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/make-error.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/opts.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/revs.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/spawn.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/utils.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/lib/which.js delete mode 100644 node_modules/pacote/node_modules/@npmcli/git/package.json diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 7e4c7c12c3dea..1445bbe2be8ab 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -19,20 +19,6 @@ !/@npmcli/agent !/@npmcli/fs !/@npmcli/git -!/@npmcli/git/node_modules/ -/@npmcli/git/node_modules/* -!/@npmcli/git/node_modules/@npmcli/ -/@npmcli/git/node_modules/@npmcli/* -!/@npmcli/git/node_modules/@npmcli/promise-spawn -!/@npmcli/git/node_modules/hosted-git-info -!/@npmcli/git/node_modules/ini -!/@npmcli/git/node_modules/isexe -!/@npmcli/git/node_modules/npm-install-checks -!/@npmcli/git/node_modules/npm-package-arg -!/@npmcli/git/node_modules/npm-pick-manifest -!/@npmcli/git/node_modules/proc-log -!/@npmcli/git/node_modules/validate-npm-package-name -!/@npmcli/git/node_modules/which !/@npmcli/installed-package-contents !/@npmcli/map-workspaces !/@npmcli/map-workspaces/node_modules/ @@ -47,12 +33,14 @@ /@npmcli/metavuln-calculator/node_modules/@npmcli/* !/@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/package-json !/@npmcli/metavuln-calculator/node_modules/@npmcli/promise-spawn !/@npmcli/metavuln-calculator/node_modules/@npmcli/redact !/@npmcli/metavuln-calculator/node_modules/@npmcli/run-script !/@npmcli/metavuln-calculator/node_modules/cacache !/@npmcli/metavuln-calculator/node_modules/hosted-git-info +!/@npmcli/metavuln-calculator/node_modules/ini !/@npmcli/metavuln-calculator/node_modules/isexe !/@npmcli/metavuln-calculator/node_modules/json-parse-even-better-errors !/@npmcli/metavuln-calculator/node_modules/make-fetch-happen @@ -71,11 +59,6 @@ !/@npmcli/name-from-folder !/@npmcli/node-gyp !/@npmcli/package-json -!/@npmcli/package-json/node_modules/ -/@npmcli/package-json/node_modules/* -!/@npmcli/package-json/node_modules/@npmcli/ -/@npmcli/package-json/node_modules/@npmcli/* -!/@npmcli/package-json/node_modules/@npmcli/git !/@npmcli/promise-spawn !/@npmcli/query !/@npmcli/redact @@ -265,7 +248,6 @@ /pacote/node_modules/* !/pacote/node_modules/@npmcli/ /pacote/node_modules/@npmcli/* -!/pacote/node_modules/@npmcli/git !/pacote/node_modules/@npmcli/installed-package-contents !/pacote/node_modules/ignore-walk !/pacote/node_modules/npm-bundled diff --git a/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/escape.js b/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/escape.js deleted file mode 100644 index 9aca8bde70a6e..0000000000000 --- a/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/escape.js +++ /dev/null @@ -1,68 +0,0 @@ -'use strict' - -// eslint-disable-next-line max-len -// this code adapted from: https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/ -const cmd = (input, doubleEscape) => { - if (!input.length) { - return '""' - } - - let result - if (!/[ \t\n\v"]/.test(input)) { - result = input - } else { - result = '"' - for (let i = 0; i <= input.length; ++i) { - let slashCount = 0 - while (input[i] === '\\') { - ++i - ++slashCount - } - - if (i === input.length) { - result += '\\'.repeat(slashCount * 2) - break - } - - if (input[i] === '"') { - result += '\\'.repeat(slashCount * 2 + 1) - result += input[i] - } else { - result += '\\'.repeat(slashCount) - result += input[i] - } - } - result += '"' - } - - // and finally, prefix shell meta chars with a ^ - result = result.replace(/[ !%^&()<>|"]/g, '^$&') - if (doubleEscape) { - result = result.replace(/[ !%^&()<>|"]/g, '^$&') - } - - return result -} - -const sh = (input) => { - if (!input.length) { - return `''` - } - - if (!/[\t\n\r "#$&'()*;<>?\\`|~]/.test(input)) { - return input - } - - // replace single quotes with '\'' and wrap the whole result in a fresh set of quotes - const result = `'${input.replace(/'/g, `'\\''`)}'` - // if the input string already had single quotes around it, clean those up - .replace(/^(?:'')+(?!$)/, '') - .replace(/\\'''/g, `\\'`) - - return result -} - -module.exports = { - cmd, - sh, -} diff --git a/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/index.js b/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/index.js deleted file mode 100644 index e147cb8f9c746..0000000000000 --- a/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/lib/index.js +++ /dev/null @@ -1,206 +0,0 @@ -'use strict' - -const { spawn } = require('child_process') -const os = require('os') -const which = require('which') - -const escape = require('./escape.js') - -// 'extra' object is for decorating the error a bit more -const promiseSpawn = (cmd, args, opts = {}, extra = {}) => { - if (opts.shell) { - return spawnWithShell(cmd, args, opts, extra) - } - - let resolve, reject - const promise = new Promise((_resolve, _reject) => { - resolve = _resolve - reject = _reject - }) - - // Create error here so we have a more useful stack trace when rejecting - const closeError = new Error('command failed') - - const stdout = [] - const stderr = [] - - const getResult = (result) => ({ - cmd, - args, - ...result, - ...stdioResult(stdout, stderr, opts), - ...extra, - }) - const rejectWithOpts = (er, erOpts) => { - const resultError = getResult(erOpts) - reject(Object.assign(er, resultError)) - } - - const proc = spawn(cmd, args, opts) - promise.stdin = proc.stdin - promise.process = proc - - proc.on('error', rejectWithOpts) - - if (proc.stdout) { - proc.stdout.on('data', c => stdout.push(c)) - proc.stdout.on('error', rejectWithOpts) - } - - if (proc.stderr) { - proc.stderr.on('data', c => stderr.push(c)) - proc.stderr.on('error', rejectWithOpts) - } - - proc.on('close', (code, signal) => { - if (code || signal) { - rejectWithOpts(closeError, { code, signal }) - } else { - resolve(getResult({ code, signal })) - } - }) - - return promise -} - -const spawnWithShell = (cmd, args, opts, extra) => { - let command = opts.shell - // if shell is set to true, we use a platform default. we can't let the core - // spawn method decide this for us because we need to know what shell is in use - // ahead of time so that we can escape arguments properly. we don't need coverage here. - if (command === true) { - // istanbul ignore next - command = process.platform === 'win32' ? process.env.ComSpec : 'sh' - } - - const options = { ...opts, shell: false } - const realArgs = [] - let script = cmd - - // first, determine if we're in windows because if we are we need to know if we're - // running an .exe or a .cmd/.bat since the latter requires extra escaping - const isCmd = /(?:^|\\)cmd(?:\.exe)?$/i.test(command) - if (isCmd) { - let doubleEscape = false - - // find the actual command we're running - let initialCmd = '' - let insideQuotes = false - for (let i = 0; i < cmd.length; ++i) { - const char = cmd.charAt(i) - if (char === ' ' && !insideQuotes) { - break - } - - initialCmd += char - if (char === '"' || char === "'") { - insideQuotes = !insideQuotes - } - } - - let pathToInitial - try { - pathToInitial = which.sync(initialCmd, { - path: (options.env && findInObject(options.env, 'PATH')) || process.env.PATH, - pathext: (options.env && findInObject(options.env, 'PATHEXT')) || process.env.PATHEXT, - }).toLowerCase() - } catch (err) { - pathToInitial = initialCmd.toLowerCase() - } - - doubleEscape = pathToInitial.endsWith('.cmd') || pathToInitial.endsWith('.bat') - for (const arg of args) { - script += ` ${escape.cmd(arg, doubleEscape)}` - } - realArgs.push('/d', '/s', '/c', script) - options.windowsVerbatimArguments = true - } else { - for (const arg of args) { - script += ` ${escape.sh(arg)}` - } - realArgs.push('-c', script) - } - - return promiseSpawn(command, realArgs, options, extra) -} - -// open a file with the default application as defined by the user's OS -const open = (_args, opts = {}, extra = {}) => { - const options = { ...opts, shell: true } - const args = [].concat(_args) - - let platform = process.platform - // process.platform === 'linux' may actually indicate WSL, if that's the case - // we want to treat things as win32 anyway so the host can open the argument - if (platform === 'linux' && os.release().toLowerCase().includes('microsoft')) { - platform = 'win32' - } - - let command = options.command - if (!command) { - if (platform === 'win32') { - // spawnWithShell does not do the additional os.release() check, so we - // have to force the shell here to make sure we treat WSL as windows. - options.shell = process.env.ComSpec - // also, the start command accepts a title so to make sure that we don't - // accidentally interpret the first arg as the title, we stick an empty - // string immediately after the start command - command = 'start ""' - } else if (platform === 'darwin') { - command = 'open' - } else { - command = 'xdg-open' - } - } - - return spawnWithShell(command, args, options, extra) -} -promiseSpawn.open = open - -const isPipe = (stdio = 'pipe', fd) => { - if (stdio === 'pipe' || stdio === null) { - return true - } - - if (Array.isArray(stdio)) { - return isPipe(stdio[fd], fd) - } - - return false -} - -const stdioResult = (stdout, stderr, { stdioString = true, stdio }) => { - const result = { - stdout: null, - stderr: null, - } - - // stdio is [stdin, stdout, stderr] - if (isPipe(stdio, 1)) { - result.stdout = Buffer.concat(stdout) - if (stdioString) { - result.stdout = result.stdout.toString().trim() - } - } - - if (isPipe(stdio, 2)) { - result.stderr = Buffer.concat(stderr) - if (stdioString) { - result.stderr = result.stderr.toString().trim() - } - } - - return result -} - -// case insensitive lookup in an object -const findInObject = (obj, key) => { - key = key.toLowerCase() - for (const objKey of Object.keys(obj).sort()) { - if (objKey.toLowerCase() === key) { - return obj[objKey] - } - } -} - -module.exports = promiseSpawn diff --git a/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/package.json b/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/package.json deleted file mode 100644 index 1b633f84596d2..0000000000000 --- a/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/package.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "@npmcli/promise-spawn", - "version": "7.0.2", - "files": [ - "bin/", - "lib/" - ], - "main": "./lib/index.js", - "description": "spawn processes the way the npm cli likes to do", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/promise-spawn.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "lintfix": "npm run lint -- --fix", - "posttest": "npm run lint", - "postsnap": "npm run lintfix --", - "postlint": "template-oss-check", - "template-oss-apply": "template-oss-apply --force" - }, - "tap": { - "check-coverage": true, - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.22.0", - "spawk": "^1.7.1", - "tap": "^16.0.1" - }, - "engines": { - "node": "^16.14.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 - }, - "dependencies": { - "which": "^4.0.0" - } -} diff --git a/node_modules/@npmcli/git/node_modules/hosted-git-info/LICENSE b/node_modules/@npmcli/git/node_modules/hosted-git-info/LICENSE deleted file mode 100644 index 45055763dc838..0000000000000 --- a/node_modules/@npmcli/git/node_modules/hosted-git-info/LICENSE +++ /dev/null @@ -1,13 +0,0 @@ -Copyright (c) 2015, Rebecca Turner - -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/@npmcli/git/node_modules/hosted-git-info/lib/from-url.js b/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/from-url.js deleted file mode 100644 index efc1247d59d12..0000000000000 --- a/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/from-url.js +++ /dev/null @@ -1,122 +0,0 @@ -'use strict' - -const parseUrl = require('./parse-url') - -// look for github shorthand inputs, such as npm/cli -const isGitHubShorthand = (arg) => { - // it cannot contain whitespace before the first # - // it cannot start with a / because that's probably an absolute file path - // but it must include a slash since repos are username/repository - // it cannot start with a . because that's probably a relative file path - // it cannot start with an @ because that's a scoped package if it passes the other tests - // it cannot contain a : before a # because that tells us that there's a protocol - // a second / may not exist before a # - const firstHash = arg.indexOf('#') - const firstSlash = arg.indexOf('/') - const secondSlash = arg.indexOf('/', firstSlash + 1) - const firstColon = arg.indexOf(':') - const firstSpace = /\s/.exec(arg) - const firstAt = arg.indexOf('@') - - const spaceOnlyAfterHash = !firstSpace || (firstHash > -1 && firstSpace.index > firstHash) - const atOnlyAfterHash = firstAt === -1 || (firstHash > -1 && firstAt > firstHash) - const colonOnlyAfterHash = firstColon === -1 || (firstHash > -1 && firstColon > firstHash) - const secondSlashOnlyAfterHash = secondSlash === -1 || (firstHash > -1 && secondSlash > firstHash) - const hasSlash = firstSlash > 0 - // if a # is found, what we really want to know is that the character - // immediately before # is not a / - const doesNotEndWithSlash = firstHash > -1 ? arg[firstHash - 1] !== '/' : !arg.endsWith('/') - const doesNotStartWithDot = !arg.startsWith('.') - - return spaceOnlyAfterHash && hasSlash && doesNotEndWithSlash && - doesNotStartWithDot && atOnlyAfterHash && colonOnlyAfterHash && - secondSlashOnlyAfterHash -} - -module.exports = (giturl, opts, { gitHosts, protocols }) => { - if (!giturl) { - return - } - - const correctedUrl = isGitHubShorthand(giturl) ? `github:${giturl}` : giturl - const parsed = parseUrl(correctedUrl, protocols) - if (!parsed) { - return - } - - const gitHostShortcut = gitHosts.byShortcut[parsed.protocol] - const gitHostDomain = gitHosts.byDomain[parsed.hostname.startsWith('www.') - ? parsed.hostname.slice(4) - : parsed.hostname] - const gitHostName = gitHostShortcut || gitHostDomain - if (!gitHostName) { - return - } - - const gitHostInfo = gitHosts[gitHostShortcut || gitHostDomain] - let auth = null - if (protocols[parsed.protocol]?.auth && (parsed.username || parsed.password)) { - auth = `${parsed.username}${parsed.password ? ':' + parsed.password : ''}` - } - - let committish = null - let user = null - let project = null - let defaultRepresentation = null - - try { - if (gitHostShortcut) { - let pathname = parsed.pathname.startsWith('/') ? parsed.pathname.slice(1) : parsed.pathname - const firstAt = pathname.indexOf('@') - // we ignore auth for shortcuts, so just trim it out - if (firstAt > -1) { - pathname = pathname.slice(firstAt + 1) - } - - const lastSlash = pathname.lastIndexOf('/') - if (lastSlash > -1) { - user = decodeURIComponent(pathname.slice(0, lastSlash)) - // we want nulls only, never empty strings - if (!user) { - user = null - } - project = decodeURIComponent(pathname.slice(lastSlash + 1)) - } else { - project = decodeURIComponent(pathname) - } - - if (project.endsWith('.git')) { - project = project.slice(0, -4) - } - - if (parsed.hash) { - committish = decodeURIComponent(parsed.hash.slice(1)) - } - - defaultRepresentation = 'shortcut' - } else { - if (!gitHostInfo.protocols.includes(parsed.protocol)) { - return - } - - const segments = gitHostInfo.extract(parsed) - if (!segments) { - return - } - - user = segments.user && decodeURIComponent(segments.user) - project = decodeURIComponent(segments.project) - committish = decodeURIComponent(segments.committish) - defaultRepresentation = protocols[parsed.protocol]?.name || parsed.protocol.slice(0, -1) - } - } catch (err) { - /* istanbul ignore else */ - if (err instanceof URIError) { - return - } else { - throw err - } - } - - return [gitHostName, user, auth, project, committish, defaultRepresentation, opts] -} diff --git a/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/hosts.js b/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/hosts.js deleted file mode 100644 index 9a08efd1b2d7e..0000000000000 --- a/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/hosts.js +++ /dev/null @@ -1,227 +0,0 @@ -/* eslint-disable max-len */ - -'use strict' - -const maybeJoin = (...args) => args.every(arg => arg) ? args.join('') : '' -const maybeEncode = (arg) => arg ? encodeURIComponent(arg) : '' -const formatHashFragment = (f) => f.toLowerCase().replace(/^\W+|\/|\W+$/g, '').replace(/\W+/g, '-') - -const defaults = { - sshtemplate: ({ domain, user, project, committish }) => - `git@${domain}:${user}/${project}.git${maybeJoin('#', committish)}`, - sshurltemplate: ({ domain, user, project, committish }) => - `git+ssh://git@${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, - edittemplate: ({ domain, user, project, committish, editpath, path }) => - `https://${domain}/${user}/${project}${maybeJoin('/', editpath, '/', maybeEncode(committish || 'HEAD'), '/', path)}`, - browsetemplate: ({ domain, user, project, committish, treepath }) => - `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}`, - browsetreetemplate: ({ domain, user, project, committish, treepath, path, fragment, hashformat }) => - `https://${domain}/${user}/${project}/${treepath}/${maybeEncode(committish || 'HEAD')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`, - browseblobtemplate: ({ domain, user, project, committish, blobpath, path, fragment, hashformat }) => - `https://${domain}/${user}/${project}/${blobpath}/${maybeEncode(committish || 'HEAD')}/${path}${maybeJoin('#', hashformat(fragment || ''))}`, - docstemplate: ({ domain, user, project, treepath, committish }) => - `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish))}#readme`, - httpstemplate: ({ auth, domain, user, project, committish }) => - `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, - filetemplate: ({ domain, user, project, committish, path }) => - `https://${domain}/${user}/${project}/raw/${maybeEncode(committish || 'HEAD')}/${path}`, - shortcuttemplate: ({ type, user, project, committish }) => - `${type}:${user}/${project}${maybeJoin('#', committish)}`, - pathtemplate: ({ user, project, committish }) => - `${user}/${project}${maybeJoin('#', committish)}`, - bugstemplate: ({ domain, user, project }) => - `https://${domain}/${user}/${project}/issues`, - hashformat: formatHashFragment, -} - -const hosts = {} -hosts.github = { - // First two are insecure and generally shouldn't be used any more, but - // they are still supported. - protocols: ['git:', 'http:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], - domain: 'github.com', - treepath: 'tree', - blobpath: 'blob', - editpath: 'edit', - filetemplate: ({ auth, user, project, committish, path }) => - `https://${maybeJoin(auth, '@')}raw.githubusercontent.com/${user}/${project}/${maybeEncode(committish || 'HEAD')}/${path}`, - gittemplate: ({ auth, domain, user, project, committish }) => - `git://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, - tarballtemplate: ({ domain, user, project, committish }) => - `https://codeload.${domain}/${user}/${project}/tar.gz/${maybeEncode(committish || 'HEAD')}`, - extract: (url) => { - let [, user, project, type, committish] = url.pathname.split('/', 5) - if (type && type !== 'tree') { - return - } - - if (!type) { - committish = url.hash.slice(1) - } - - if (project && project.endsWith('.git')) { - project = project.slice(0, -4) - } - - if (!user || !project) { - return - } - - return { user, project, committish } - }, -} - -hosts.bitbucket = { - protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], - domain: 'bitbucket.org', - treepath: 'src', - blobpath: 'src', - editpath: '?mode=edit', - edittemplate: ({ domain, user, project, committish, treepath, path, editpath }) => - `https://${domain}/${user}/${project}${maybeJoin('/', treepath, '/', maybeEncode(committish || 'HEAD'), '/', path, editpath)}`, - tarballtemplate: ({ domain, user, project, committish }) => - `https://${domain}/${user}/${project}/get/${maybeEncode(committish || 'HEAD')}.tar.gz`, - extract: (url) => { - let [, user, project, aux] = url.pathname.split('/', 4) - if (['get'].includes(aux)) { - return - } - - if (project && project.endsWith('.git')) { - project = project.slice(0, -4) - } - - if (!user || !project) { - return - } - - return { user, project, committish: url.hash.slice(1) } - }, -} - -hosts.gitlab = { - protocols: ['git+ssh:', 'git+https:', 'ssh:', 'https:'], - domain: 'gitlab.com', - treepath: 'tree', - blobpath: 'tree', - editpath: '-/edit', - httpstemplate: ({ auth, domain, user, project, committish }) => - `git+https://${maybeJoin(auth, '@')}${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, - tarballtemplate: ({ domain, user, project, committish }) => - `https://${domain}/${user}/${project}/repository/archive.tar.gz?ref=${maybeEncode(committish || 'HEAD')}`, - extract: (url) => { - const path = url.pathname.slice(1) - if (path.includes('/-/') || path.includes('/archive.tar.gz')) { - return - } - - const segments = path.split('/') - let project = segments.pop() - if (project.endsWith('.git')) { - project = project.slice(0, -4) - } - - const user = segments.join('/') - if (!user || !project) { - return - } - - return { user, project, committish: url.hash.slice(1) } - }, -} - -hosts.gist = { - protocols: ['git:', 'git+ssh:', 'git+https:', 'ssh:', 'https:'], - domain: 'gist.github.com', - editpath: 'edit', - sshtemplate: ({ domain, project, committish }) => - `git@${domain}:${project}.git${maybeJoin('#', committish)}`, - sshurltemplate: ({ domain, project, committish }) => - `git+ssh://git@${domain}/${project}.git${maybeJoin('#', committish)}`, - edittemplate: ({ domain, user, project, committish, editpath }) => - `https://${domain}/${user}/${project}${maybeJoin('/', maybeEncode(committish))}/${editpath}`, - browsetemplate: ({ domain, project, committish }) => - `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, - browsetreetemplate: ({ domain, project, committish, path, hashformat }) => - `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`, - browseblobtemplate: ({ domain, project, committish, path, hashformat }) => - `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}${maybeJoin('#', hashformat(path))}`, - docstemplate: ({ domain, project, committish }) => - `https://${domain}/${project}${maybeJoin('/', maybeEncode(committish))}`, - httpstemplate: ({ domain, project, committish }) => - `git+https://${domain}/${project}.git${maybeJoin('#', committish)}`, - filetemplate: ({ user, project, committish, path }) => - `https://gist.githubusercontent.com/${user}/${project}/raw${maybeJoin('/', maybeEncode(committish))}/${path}`, - shortcuttemplate: ({ type, project, committish }) => - `${type}:${project}${maybeJoin('#', committish)}`, - pathtemplate: ({ project, committish }) => - `${project}${maybeJoin('#', committish)}`, - bugstemplate: ({ domain, project }) => - `https://${domain}/${project}`, - gittemplate: ({ domain, project, committish }) => - `git://${domain}/${project}.git${maybeJoin('#', committish)}`, - tarballtemplate: ({ project, committish }) => - `https://codeload.github.com/gist/${project}/tar.gz/${maybeEncode(committish || 'HEAD')}`, - extract: (url) => { - let [, user, project, aux] = url.pathname.split('/', 4) - if (aux === 'raw') { - return - } - - if (!project) { - if (!user) { - return - } - - project = user - user = null - } - - if (project.endsWith('.git')) { - project = project.slice(0, -4) - } - - return { user, project, committish: url.hash.slice(1) } - }, - hashformat: function (fragment) { - return fragment && 'file-' + formatHashFragment(fragment) - }, -} - -hosts.sourcehut = { - protocols: ['git+ssh:', 'https:'], - domain: 'git.sr.ht', - treepath: 'tree', - blobpath: 'tree', - filetemplate: ({ domain, user, project, committish, path }) => - `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || 'HEAD'}/${path}`, - httpstemplate: ({ domain, user, project, committish }) => - `https://${domain}/${user}/${project}.git${maybeJoin('#', committish)}`, - tarballtemplate: ({ domain, user, project, committish }) => - `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || 'HEAD'}.tar.gz`, - bugstemplate: () => null, - extract: (url) => { - let [, user, project, aux] = url.pathname.split('/', 4) - - // tarball url - if (['archive'].includes(aux)) { - return - } - - if (project && project.endsWith('.git')) { - project = project.slice(0, -4) - } - - if (!user || !project) { - return - } - - return { user, project, committish: url.hash.slice(1) } - }, -} - -for (const [name, host] of Object.entries(hosts)) { - hosts[name] = Object.assign({}, defaults, host) -} - -module.exports = hosts diff --git a/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/index.js b/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/index.js deleted file mode 100644 index 0c9d0b08c866b..0000000000000 --- a/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/index.js +++ /dev/null @@ -1,179 +0,0 @@ -'use strict' - -const { LRUCache } = require('lru-cache') -const hosts = require('./hosts.js') -const fromUrl = require('./from-url.js') -const parseUrl = require('./parse-url.js') - -const cache = new LRUCache({ max: 1000 }) - -class GitHost { - constructor (type, user, auth, project, committish, defaultRepresentation, opts = {}) { - Object.assign(this, GitHost.#gitHosts[type], { - type, - user, - auth, - project, - committish, - default: defaultRepresentation, - opts, - }) - } - - static #gitHosts = { byShortcut: {}, byDomain: {} } - static #protocols = { - 'git+ssh:': { name: 'sshurl' }, - 'ssh:': { name: 'sshurl' }, - 'git+https:': { name: 'https', auth: true }, - 'git:': { auth: true }, - 'http:': { auth: true }, - 'https:': { auth: true }, - 'git+http:': { auth: true }, - } - - static addHost (name, host) { - GitHost.#gitHosts[name] = host - GitHost.#gitHosts.byDomain[host.domain] = name - GitHost.#gitHosts.byShortcut[`${name}:`] = name - GitHost.#protocols[`${name}:`] = { name } - } - - static fromUrl (giturl, opts) { - if (typeof giturl !== 'string') { - return - } - - const key = giturl + JSON.stringify(opts || {}) - - if (!cache.has(key)) { - const hostArgs = fromUrl(giturl, opts, { - gitHosts: GitHost.#gitHosts, - protocols: GitHost.#protocols, - }) - cache.set(key, hostArgs ? new GitHost(...hostArgs) : undefined) - } - - return cache.get(key) - } - - static parseUrl (url) { - return parseUrl(url) - } - - #fill (template, opts) { - if (typeof template !== 'function') { - return null - } - - const options = { ...this, ...this.opts, ...opts } - - // the path should always be set so we don't end up with 'undefined' in urls - if (!options.path) { - options.path = '' - } - - // template functions will insert the leading slash themselves - if (options.path.startsWith('/')) { - options.path = options.path.slice(1) - } - - if (options.noCommittish) { - options.committish = null - } - - const result = template(options) - return options.noGitPlus && result.startsWith('git+') ? result.slice(4) : result - } - - hash () { - return this.committish ? `#${this.committish}` : '' - } - - ssh (opts) { - return this.#fill(this.sshtemplate, opts) - } - - sshurl (opts) { - return this.#fill(this.sshurltemplate, opts) - } - - browse (path, ...args) { - // not a string, treat path as opts - if (typeof path !== 'string') { - return this.#fill(this.browsetemplate, path) - } - - if (typeof args[0] !== 'string') { - return this.#fill(this.browsetreetemplate, { ...args[0], path }) - } - - return this.#fill(this.browsetreetemplate, { ...args[1], fragment: args[0], path }) - } - - // If the path is known to be a file, then browseFile should be used. For some hosts - // the url is the same as browse, but for others like GitHub a file can use both `/tree/` - // and `/blob/` in the path. When using a default committish of `HEAD` then the `/tree/` - // path will redirect to a specific commit. Using the `/blob/` path avoids this and - // does not redirect to a different commit. - browseFile (path, ...args) { - if (typeof args[0] !== 'string') { - return this.#fill(this.browseblobtemplate, { ...args[0], path }) - } - - return this.#fill(this.browseblobtemplate, { ...args[1], fragment: args[0], path }) - } - - docs (opts) { - return this.#fill(this.docstemplate, opts) - } - - bugs (opts) { - return this.#fill(this.bugstemplate, opts) - } - - https (opts) { - return this.#fill(this.httpstemplate, opts) - } - - git (opts) { - return this.#fill(this.gittemplate, opts) - } - - shortcut (opts) { - return this.#fill(this.shortcuttemplate, opts) - } - - path (opts) { - return this.#fill(this.pathtemplate, opts) - } - - tarball (opts) { - return this.#fill(this.tarballtemplate, { ...opts, noCommittish: false }) - } - - file (path, opts) { - return this.#fill(this.filetemplate, { ...opts, path }) - } - - edit (path, opts) { - return this.#fill(this.edittemplate, { ...opts, path }) - } - - getDefaultRepresentation () { - return this.default - } - - toString (opts) { - if (this.default && typeof this[this.default] === 'function') { - return this[this.default](opts) - } - - return this.sshurl(opts) - } -} - -for (const [name, host] of Object.entries(hosts)) { - GitHost.addHost(name, host) -} - -module.exports = GitHost diff --git a/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/parse-url.js b/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/parse-url.js deleted file mode 100644 index 7d5489c008ab4..0000000000000 --- a/node_modules/@npmcli/git/node_modules/hosted-git-info/lib/parse-url.js +++ /dev/null @@ -1,78 +0,0 @@ -const url = require('url') - -const lastIndexOfBefore = (str, char, beforeChar) => { - const startPosition = str.indexOf(beforeChar) - return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity) -} - -const safeUrl = (u) => { - try { - return new url.URL(u) - } catch { - // this fn should never throw - } -} - -// accepts input like git:github.com:user/repo and inserts the // after the first : -const correctProtocol = (arg, protocols) => { - const firstColon = arg.indexOf(':') - const proto = arg.slice(0, firstColon + 1) - if (Object.prototype.hasOwnProperty.call(protocols, proto)) { - return arg - } - - const firstAt = arg.indexOf('@') - if (firstAt > -1) { - if (firstAt > firstColon) { - return `git+ssh://${arg}` - } else { - return arg - } - } - - const doubleSlash = arg.indexOf('//') - if (doubleSlash === firstColon + 1) { - return arg - } - - return `${arg.slice(0, firstColon + 1)}//${arg.slice(firstColon + 1)}` -} - -// attempt to correct an scp style url so that it will parse with `new URL()` -const correctUrl = (giturl) => { - // ignore @ that come after the first hash since the denotes the start - // of a committish which can contain @ characters - const firstAt = lastIndexOfBefore(giturl, '@', '#') - // ignore colons that come after the hash since that could include colons such as: - // git@github.com:user/package-2#semver:^1.0.0 - const lastColonBeforeHash = lastIndexOfBefore(giturl, ':', '#') - - if (lastColonBeforeHash > firstAt) { - // the last : comes after the first @ (or there is no @) - // like it would in: - // proto://hostname.com:user/repo - // username@hostname.com:user/repo - // :password@hostname.com:user/repo - // username:password@hostname.com:user/repo - // proto://username@hostname.com:user/repo - // proto://:password@hostname.com:user/repo - // proto://username:password@hostname.com:user/repo - // then we replace the last : with a / to create a valid path - giturl = giturl.slice(0, lastColonBeforeHash) + '/' + giturl.slice(lastColonBeforeHash + 1) - } - - if (lastIndexOfBefore(giturl, ':', '#') === -1 && giturl.indexOf('//') === -1) { - // we have no : at all - // as it would be in: - // username@hostname.com/user/repo - // then we prepend a protocol - giturl = `git+ssh://${giturl}` - } - - return giturl -} - -module.exports = (giturl, protocols) => { - const withProtocol = protocols ? correctProtocol(giturl, protocols) : giturl - return safeUrl(withProtocol) || safeUrl(correctUrl(withProtocol)) -} diff --git a/node_modules/@npmcli/git/node_modules/hosted-git-info/package.json b/node_modules/@npmcli/git/node_modules/hosted-git-info/package.json deleted file mode 100644 index d7eebd474f625..0000000000000 --- a/node_modules/@npmcli/git/node_modules/hosted-git-info/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "hosted-git-info", - "version": "7.0.2", - "description": "Provides metadata and conversions from repository urls for GitHub, Bitbucket and GitLab", - "main": "./lib/index.js", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/hosted-git-info.git" - }, - "keywords": [ - "git", - "github", - "bitbucket", - "gitlab" - ], - "author": "GitHub Inc.", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/hosted-git-info/issues" - }, - "homepage": "https://github.com/npm/hosted-git-info", - "scripts": { - "posttest": "npm run lint", - "snap": "tap", - "test": "tap", - "test:coverage": "tap --coverage-report=html", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" - }, - "dependencies": { - "lru-cache": "^10.0.1" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.22.0", - "tap": "^16.0.1" - }, - "files": [ - "bin/", - "lib/" - ], - "engines": { - "node": "^16.14.0 || >=18.0.0" - }, - "tap": { - "color": 1, - "coverage": true, - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.22.0", - "publish": "true" - } -} diff --git a/node_modules/@npmcli/git/node_modules/isexe/LICENSE b/node_modules/@npmcli/git/node_modules/isexe/LICENSE deleted file mode 100644 index c925dbe826b67..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) 2016-2022 Isaac Z. Schlueter and Contributors - -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/@npmcli/git/node_modules/isexe/dist/cjs/index.js b/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/index.js deleted file mode 100644 index cefcb66b5c543..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/index.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sync = exports.isexe = exports.posix = exports.win32 = void 0; -const posix = __importStar(require("./posix.js")); -exports.posix = posix; -const win32 = __importStar(require("./win32.js")); -exports.win32 = win32; -__exportStar(require("./options.js"), exports); -const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform; -const impl = platform === 'win32' ? win32 : posix; -/** - * Determine whether a path is executable on the current platform. - */ -exports.isexe = impl.isexe; -/** - * Synchronously determine whether a path is executable on the - * current platform. - */ -exports.sync = impl.sync; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/options.js b/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/options.js deleted file mode 100644 index 0dfad0762cc32..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/options.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=options.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/package.json b/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/package.json deleted file mode 100644 index 5bbefffbabee3..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "commonjs" -} diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/posix.js b/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/posix.js deleted file mode 100644 index 3bc5e79d7007e..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/posix.js +++ /dev/null @@ -1,67 +0,0 @@ -"use strict"; -/** - * This is the Posix implementation of isexe, which uses the file - * mode and uid/gid values. - * - * @module - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sync = exports.isexe = void 0; -const fs_1 = require("fs"); -const promises_1 = require("fs/promises"); -/** - * Determine whether a path is executable according to the mode and - * current (or specified) user and group IDs. - */ -const isexe = async (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(await (0, promises_1.stat)(path), options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -exports.isexe = isexe; -/** - * Synchronously determine whether a path is executable according to - * the mode and current (or specified) user and group IDs. - */ -const sync = (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat((0, fs_1.statSync)(path), options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -exports.sync = sync; -const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options); -const checkMode = (stat, options) => { - const myUid = options.uid ?? process.getuid?.(); - const myGroups = options.groups ?? process.getgroups?.() ?? []; - const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]; - if (myUid === undefined || myGid === undefined) { - throw new Error('cannot get uid or gid'); - } - const groups = new Set([myGid, ...myGroups]); - const mod = stat.mode; - const uid = stat.uid; - const gid = stat.gid; - const u = parseInt('100', 8); - const g = parseInt('010', 8); - const o = parseInt('001', 8); - const ug = u | g; - return !!(mod & o || - (mod & g && groups.has(gid)) || - (mod & u && uid === myUid) || - (mod & ug && myUid === 0)); -}; -//# sourceMappingURL=posix.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/win32.js b/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/win32.js deleted file mode 100644 index fa7a4d2f7d240..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/cjs/win32.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -/** - * This is the Windows implementation of isexe, which uses the file - * extension and PATHEXT setting. - * - * @module - */ -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sync = exports.isexe = void 0; -const fs_1 = require("fs"); -const promises_1 = require("fs/promises"); -/** - * Determine whether a path is executable based on the file extension - * and PATHEXT environment variable (or specified pathExt option) - */ -const isexe = async (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(await (0, promises_1.stat)(path), path, options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -exports.isexe = isexe; -/** - * Synchronously determine whether a path is executable based on the file - * extension and PATHEXT environment variable (or specified pathExt option) - */ -const sync = (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat((0, fs_1.statSync)(path), path, options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -exports.sync = sync; -const checkPathExt = (path, options) => { - const { pathExt = process.env.PATHEXT || '' } = options; - const peSplit = pathExt.split(';'); - if (peSplit.indexOf('') !== -1) { - return true; - } - for (let i = 0; i < peSplit.length; i++) { - const p = peSplit[i].toLowerCase(); - const ext = path.substring(path.length - p.length).toLowerCase(); - if (p && ext === p) { - return true; - } - } - return false; -}; -const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options); -//# sourceMappingURL=win32.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/index.js b/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/index.js deleted file mode 100644 index 1e309acd7355e..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/index.js +++ /dev/null @@ -1,16 +0,0 @@ -import * as posix from './posix.js'; -import * as win32 from './win32.js'; -export * from './options.js'; -export { win32, posix }; -const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform; -const impl = platform === 'win32' ? win32 : posix; -/** - * Determine whether a path is executable on the current platform. - */ -export const isexe = impl.isexe; -/** - * Synchronously determine whether a path is executable on the - * current platform. - */ -export const sync = impl.sync; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/options.js b/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/options.js deleted file mode 100644 index e9ded40bd5b2c..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/options.js +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=options.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/package.json b/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/package.json deleted file mode 100644 index 3dbc1ca591c05..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/package.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "type": "module" -} diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/posix.js b/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/posix.js deleted file mode 100644 index c453776c0452f..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/posix.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * This is the Posix implementation of isexe, which uses the file - * mode and uid/gid values. - * - * @module - */ -import { statSync } from 'fs'; -import { stat } from 'fs/promises'; -/** - * Determine whether a path is executable according to the mode and - * current (or specified) user and group IDs. - */ -export const isexe = async (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(await stat(path), options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -/** - * Synchronously determine whether a path is executable according to - * the mode and current (or specified) user and group IDs. - */ -export const sync = (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(statSync(path), options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options); -const checkMode = (stat, options) => { - const myUid = options.uid ?? process.getuid?.(); - const myGroups = options.groups ?? process.getgroups?.() ?? []; - const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]; - if (myUid === undefined || myGid === undefined) { - throw new Error('cannot get uid or gid'); - } - const groups = new Set([myGid, ...myGroups]); - const mod = stat.mode; - const uid = stat.uid; - const gid = stat.gid; - const u = parseInt('100', 8); - const g = parseInt('010', 8); - const o = parseInt('001', 8); - const ug = u | g; - return !!(mod & o || - (mod & g && groups.has(gid)) || - (mod & u && uid === myUid) || - (mod & ug && myUid === 0)); -}; -//# sourceMappingURL=posix.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/win32.js b/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/win32.js deleted file mode 100644 index a354ee2a5115c..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/dist/mjs/win32.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * This is the Windows implementation of isexe, which uses the file - * extension and PATHEXT setting. - * - * @module - */ -import { statSync } from 'fs'; -import { stat } from 'fs/promises'; -/** - * Determine whether a path is executable based on the file extension - * and PATHEXT environment variable (or specified pathExt option) - */ -export const isexe = async (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(await stat(path), path, options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -/** - * Synchronously determine whether a path is executable based on the file - * extension and PATHEXT environment variable (or specified pathExt option) - */ -export const sync = (path, options = {}) => { - const { ignoreErrors = false } = options; - try { - return checkStat(statSync(path), path, options); - } - catch (e) { - const er = e; - if (ignoreErrors || er.code === 'EACCES') - return false; - throw er; - } -}; -const checkPathExt = (path, options) => { - const { pathExt = process.env.PATHEXT || '' } = options; - const peSplit = pathExt.split(';'); - if (peSplit.indexOf('') !== -1) { - return true; - } - for (let i = 0; i < peSplit.length; i++) { - const p = peSplit[i].toLowerCase(); - const ext = path.substring(path.length - p.length).toLowerCase(); - if (p && ext === p) { - return true; - } - } - return false; -}; -const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options); -//# sourceMappingURL=win32.js.map \ No newline at end of file diff --git a/node_modules/@npmcli/git/node_modules/isexe/package.json b/node_modules/@npmcli/git/node_modules/isexe/package.json deleted file mode 100644 index a0e2cd04bfdbf..0000000000000 --- a/node_modules/@npmcli/git/node_modules/isexe/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "name": "isexe", - "version": "3.1.1", - "description": "Minimal module to check if a file is executable.", - "main": "./dist/cjs/index.js", - "module": "./dist/mjs/index.js", - "types": "./dist/cjs/index.js", - "files": [ - "dist" - ], - "exports": { - ".": { - "import": { - "types": "./dist/mjs/index.d.ts", - "default": "./dist/mjs/index.js" - }, - "require": { - "types": "./dist/cjs/index.d.ts", - "default": "./dist/cjs/index.js" - } - }, - "./posix": { - "import": { - "types": "./dist/mjs/posix.d.ts", - "default": "./dist/mjs/posix.js" - }, - "require": { - "types": "./dist/cjs/posix.d.ts", - "default": "./dist/cjs/posix.js" - } - }, - "./win32": { - "import": { - "types": "./dist/mjs/win32.d.ts", - "default": "./dist/mjs/win32.js" - }, - "require": { - "types": "./dist/cjs/win32.d.ts", - "default": "./dist/cjs/win32.js" - } - }, - "./package.json": "./package.json" - }, - "devDependencies": { - "@types/node": "^20.4.5", - "@types/tap": "^15.0.8", - "c8": "^8.0.1", - "mkdirp": "^0.5.1", - "prettier": "^2.8.8", - "rimraf": "^2.5.0", - "sync-content": "^1.0.2", - "tap": "^16.3.8", - "ts-node": "^10.9.1", - "typedoc": "^0.24.8", - "typescript": "^5.1.6" - }, - "scripts": { - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "prepare": "tsc -p tsconfig/cjs.json && tsc -p tsconfig/esm.json && bash ./scripts/fixup.sh", - "pretest": "npm run prepare", - "presnap": "npm run prepare", - "test": "c8 tap", - "snap": "c8 tap", - "format": "prettier --write . --loglevel warn --ignore-path ../../.prettierignore --cache", - "typedoc": "typedoc --tsconfig tsconfig/esm.json ./src/*.ts" - }, - "author": "Isaac Z. Schlueter (http://blog.izs.me/)", - "license": "ISC", - "tap": { - "coverage": false, - "node-arg": [ - "--enable-source-maps", - "--no-warnings", - "--loader", - "ts-node/esm" - ], - "ts": false - }, - "prettier": { - "semi": false, - "printWidth": 75, - "tabWidth": 2, - "useTabs": false, - "singleQuote": true, - "jsxSingleQuote": false, - "bracketSameLine": true, - "arrowParens": "avoid", - "endOfLine": "lf" - }, - "repository": "https://github.com/isaacs/isexe", - "engines": { - "node": ">=16" - } -} diff --git a/node_modules/@npmcli/git/node_modules/npm-install-checks/LICENSE b/node_modules/@npmcli/git/node_modules/npm-install-checks/LICENSE deleted file mode 100644 index 3bed8320c15b2..0000000000000 --- a/node_modules/@npmcli/git/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/@npmcli/git/node_modules/npm-install-checks/lib/index.js b/node_modules/@npmcli/git/node_modules/npm-install-checks/lib/index.js deleted file mode 100644 index 545472b61dc60..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-install-checks/lib/index.js +++ /dev/null @@ -1,101 +0,0 @@ -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 isMusl = (file) => file.includes('libc.musl-') || file.includes('ld-musl-') - -const checkPlatform = (target, force = false, environment = {}) => { - if (force) { - return - } - - const platform = environment.os || process.platform - const arch = environment.cpu || process.arch - const osOk = target.os ? checkList(platform, target.os) : true - const cpuOk = target.cpu ? checkList(arch, target.cpu) : true - - let libcOk = true - let libcFamily = null - if (target.libc) { - // libc checks only work in linux, any value is a failure if we aren't - if (environment.libc) { - libcOk = checkList(environment.libc, target.libc) - } else if (platform !== 'linux') { - libcOk = false - } else { - const report = process.report.getReport() - if (report.header?.glibcVersionRuntime) { - libcFamily = 'glibc' - } else if (Array.isArray(report.sharedObjects) && report.sharedObjects.some(isMusl)) { - libcFamily = 'musl' - } - libcOk = libcFamily ? checkList(libcFamily, target.libc) : false - } - } - - if (!osOk || !cpuOk || !libcOk) { - throw Object.assign(new Error('Unsupported platform'), { - pkgid: target._id, - current: { - os: platform, - cpu: arch, - libc: libcFamily, - }, - required: { - os: target.os, - cpu: target.cpu, - libc: target.libc, - }, - 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/@npmcli/git/node_modules/npm-install-checks/package.json b/node_modules/@npmcli/git/node_modules/npm-install-checks/package.json deleted file mode 100644 index 11a3b87750e25..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-install-checks/package.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "npm-install-checks", - "version": "6.3.0", - "description": "Check the engines and platform fields in package.json", - "main": "lib/index.js", - "dependencies": { - "semver": "^7.1.1" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.19.0", - "tap": "^16.0.1" - }, - "scripts": { - "test": "tap", - "lint": "eslint \"**/*.js\"", - "postlint": "template-oss-check", - "template-oss-apply": "template-oss-apply --force", - "lintfix": "npm run lint -- --fix", - "snap": "tap", - "posttest": "npm run lint" - }, - "repository": { - "type": "git", - "url": "https://github.com/npm/npm-install-checks.git" - }, - "keywords": [ - "npm,", - "install" - ], - "license": "BSD-2-Clause", - "files": [ - "bin/", - "lib/" - ], - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - }, - "author": "GitHub Inc.", - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.19.0", - "publish": "true" - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/@npmcli/git/node_modules/npm-package-arg/LICENSE b/node_modules/@npmcli/git/node_modules/npm-package-arg/LICENSE deleted file mode 100644 index 19cec97b18468..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-package-arg/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -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/@npmcli/git/node_modules/npm-package-arg/lib/npa.js b/node_modules/@npmcli/git/node_modules/npm-package-arg/lib/npa.js deleted file mode 100644 index 8094b3e732cd9..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-package-arg/lib/npa.js +++ /dev/null @@ -1,415 +0,0 @@ -'use strict' -module.exports = npa -module.exports.resolve = resolve -module.exports.toPurl = toPurl -module.exports.Result = Result - -const { URL } = require('url') -const HostedGit = require('hosted-git-info') -const semver = require('semver') -const path = global.FAKE_WINDOWS ? require('path').win32 : require('path') -const validatePackageName = require('validate-npm-package-name') -const { homedir } = require('os') -const { log } = require('proc-log') - -const isWindows = process.platform === 'win32' || global.FAKE_WINDOWS -const hasSlashes = isWindows ? /\\|[/]/ : /[/]/ -const isURL = /^(?:git[+])?[a-z]+:/i -const isGit = /^[^@]+@[^:.]+\.[^:]+:.+$/i -const isFilename = /[.](?:tgz|tar.gz|tar)$/i - -function npa (arg, where) { - let name - let spec - if (typeof arg === 'object') { - if (arg instanceof Result && (!where || where === arg.where)) { - return arg - } else if (arg.name && arg.rawSpec) { - return npa.resolve(arg.name, arg.rawSpec, where || arg.where) - } else { - return npa(arg.raw, where || arg.where) - } - } - const nameEndsAt = arg[0] === '@' ? arg.slice(1).indexOf('@') + 1 : arg.indexOf('@') - const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg - if (isURL.test(arg)) { - spec = arg - } else if (isGit.test(arg)) { - spec = `git+ssh://${arg}` - } else if (namePart[0] !== '@' && (hasSlashes.test(namePart) || isFilename.test(namePart))) { - spec = arg - } else if (nameEndsAt > 0) { - name = namePart - spec = arg.slice(nameEndsAt + 1) || '*' - } else { - const valid = validatePackageName(arg) - if (valid.validForOldPackages) { - name = arg - spec = '*' - } else { - spec = arg - } - } - return resolve(name, spec, where, arg) -} - -const isFilespec = isWindows ? /^(?:[.]|~[/]|[/\\]|[a-zA-Z]:)/ : /^(?:[.]|~[/]|[/]|[a-zA-Z]:)/ - -function resolve (name, spec, where, arg) { - const res = new Result({ - raw: arg, - name: name, - rawSpec: spec, - fromArgument: arg != null, - }) - - if (name) { - res.setName(name) - } - - if (spec && (isFilespec.test(spec) || /^file:/i.test(spec))) { - return fromFile(res, where) - } else if (spec && /^npm:/i.test(spec)) { - return fromAlias(res, where) - } - - const hosted = HostedGit.fromUrl(spec, { - noGitPlus: true, - noCommittish: true, - }) - if (hosted) { - return fromHostedGit(res, hosted) - } else if (spec && isURL.test(spec)) { - return fromURL(res) - } else if (spec && (hasSlashes.test(spec) || isFilename.test(spec))) { - return fromFile(res, where) - } else { - return fromRegistry(res) - } -} - -const defaultRegistry = 'https://registry.npmjs.org' - -function toPurl (arg, reg = defaultRegistry) { - const res = npa(arg) - - if (res.type !== 'version') { - throw invalidPurlType(res.type, res.raw) - } - - // URI-encode leading @ of scoped packages - let purl = 'pkg:npm/' + res.name.replace(/^@/, '%40') + '@' + res.rawSpec - if (reg !== defaultRegistry) { - purl += '?repository_url=' + reg - } - - return purl -} - -function invalidPackageName (name, valid, raw) { - // eslint-disable-next-line max-len - const err = new Error(`Invalid package name "${name}" of package "${raw}": ${valid.errors.join('; ')}.`) - err.code = 'EINVALIDPACKAGENAME' - return err -} - -function invalidTagName (name, raw) { - // eslint-disable-next-line max-len - const err = new Error(`Invalid tag name "${name}" of package "${raw}": Tags may not have any characters that encodeURIComponent encodes.`) - err.code = 'EINVALIDTAGNAME' - return err -} - -function invalidPurlType (type, raw) { - // eslint-disable-next-line max-len - const err = new Error(`Invalid type "${type}" of package "${raw}": Purl can only be generated for "version" types.`) - err.code = 'EINVALIDPURLTYPE' - return err -} - -function Result (opts) { - this.type = opts.type - this.registry = opts.registry - this.where = opts.where - if (opts.raw == null) { - this.raw = opts.name ? opts.name + '@' + opts.rawSpec : opts.rawSpec - } else { - this.raw = opts.raw - } - - this.name = undefined - this.escapedName = undefined - this.scope = undefined - this.rawSpec = opts.rawSpec || '' - this.saveSpec = opts.saveSpec - this.fetchSpec = opts.fetchSpec - if (opts.name) { - this.setName(opts.name) - } - this.gitRange = opts.gitRange - this.gitCommittish = opts.gitCommittish - this.gitSubdir = opts.gitSubdir - this.hosted = opts.hosted -} - -Result.prototype.setName = function (name) { - const valid = validatePackageName(name) - if (!valid.validForOldPackages) { - throw invalidPackageName(name, valid, this.raw) - } - - this.name = name - this.scope = name[0] === '@' ? name.slice(0, name.indexOf('/')) : undefined - // scoped packages in couch must have slash url-encoded, e.g. @foo%2Fbar - this.escapedName = name.replace('/', '%2f') - return this -} - -Result.prototype.toString = function () { - const full = [] - if (this.name != null && this.name !== '') { - full.push(this.name) - } - const spec = this.saveSpec || this.fetchSpec || this.rawSpec - if (spec != null && spec !== '') { - full.push(spec) - } - return full.length ? full.join('@') : this.raw -} - -Result.prototype.toJSON = function () { - const result = Object.assign({}, this) - delete result.hosted - return result -} - -// sets res.gitCommittish, res.gitRange, and res.gitSubdir -function setGitAttrs (res, committish) { - if (!committish) { - res.gitCommittish = null - return - } - - // for each :: separated item: - for (const part of committish.split('::')) { - // if the item has no : the n it is a commit-ish - if (!part.includes(':')) { - if (res.gitRange) { - throw new Error('cannot override existing semver range with a committish') - } - if (res.gitCommittish) { - throw new Error('cannot override existing committish with a second committish') - } - res.gitCommittish = part - continue - } - // split on name:value - const [name, value] = part.split(':') - // if name is semver do semver lookup of ref or tag - if (name === 'semver') { - if (res.gitCommittish) { - throw new Error('cannot override existing committish with a semver range') - } - if (res.gitRange) { - throw new Error('cannot override existing semver range with a second semver range') - } - res.gitRange = decodeURIComponent(value) - continue - } - if (name === 'path') { - if (res.gitSubdir) { - throw new Error('cannot override existing path with a second path') - } - res.gitSubdir = `/${value}` - continue - } - log.warn('npm-package-arg', `ignoring unknown key "${name}"`) - } -} - -function fromFile (res, where) { - if (!where) { - where = process.cwd() - } - res.type = isFilename.test(res.rawSpec) ? 'file' : 'directory' - res.where = where - - // always put the '/' on where when resolving urls, or else - // file:foo from /path/to/bar goes to /path/to/foo, when we want - // it to be /path/to/bar/foo - - let specUrl - let resolvedUrl - const prefix = (!/^file:/.test(res.rawSpec) ? 'file:' : '') - const rawWithPrefix = prefix + res.rawSpec - let rawNoPrefix = rawWithPrefix.replace(/^file:/, '') - try { - resolvedUrl = new URL(rawWithPrefix, `file://${path.resolve(where)}/`) - specUrl = new URL(rawWithPrefix) - } catch (originalError) { - const er = new Error('Invalid file: URL, must comply with RFC 8089') - throw Object.assign(er, { - raw: res.rawSpec, - spec: res, - where, - originalError, - }) - } - - // XXX backwards compatibility lack of compliance with RFC 8089 - if (resolvedUrl.host && resolvedUrl.host !== 'localhost') { - const rawSpec = res.rawSpec.replace(/^file:\/\//, 'file:///') - resolvedUrl = new URL(rawSpec, `file://${path.resolve(where)}/`) - specUrl = new URL(rawSpec) - rawNoPrefix = rawSpec.replace(/^file:/, '') - } - // turn file:/../foo into file:../foo - // for 1, 2 or 3 leading slashes since we attempted - // in the previous step to make it a file protocol url with a leading slash - if (/^\/{1,3}\.\.?(\/|$)/.test(rawNoPrefix)) { - const rawSpec = res.rawSpec.replace(/^file:\/{1,3}/, 'file:') - resolvedUrl = new URL(rawSpec, `file://${path.resolve(where)}/`) - specUrl = new URL(rawSpec) - rawNoPrefix = rawSpec.replace(/^file:/, '') - } - // XXX end RFC 8089 violation backwards compatibility section - - // turn /C:/blah into just C:/blah on windows - let specPath = decodeURIComponent(specUrl.pathname) - let resolvedPath = decodeURIComponent(resolvedUrl.pathname) - if (isWindows) { - specPath = specPath.replace(/^\/+([a-z]:\/)/i, '$1') - resolvedPath = resolvedPath.replace(/^\/+([a-z]:\/)/i, '$1') - } - - // replace ~ with homedir, but keep the ~ in the saveSpec - // otherwise, make it relative to where param - if (/^\/~(\/|$)/.test(specPath)) { - res.saveSpec = `file:${specPath.substr(1)}` - resolvedPath = path.resolve(homedir(), specPath.substr(3)) - } else if (!path.isAbsolute(rawNoPrefix)) { - res.saveSpec = `file:${path.relative(where, resolvedPath)}` - } else { - res.saveSpec = `file:${path.resolve(resolvedPath)}` - } - - res.fetchSpec = path.resolve(where, resolvedPath) - return res -} - -function fromHostedGit (res, hosted) { - res.type = 'git' - res.hosted = hosted - res.saveSpec = hosted.toString({ noGitPlus: false, noCommittish: false }) - res.fetchSpec = hosted.getDefaultRepresentation() === 'shortcut' ? null : hosted.toString() - setGitAttrs(res, hosted.committish) - return res -} - -function unsupportedURLType (protocol, spec) { - const err = new Error(`Unsupported URL Type "${protocol}": ${spec}`) - err.code = 'EUNSUPPORTEDPROTOCOL' - return err -} - -function fromURL (res) { - let rawSpec = res.rawSpec - res.saveSpec = rawSpec - if (rawSpec.startsWith('git+ssh:')) { - // git ssh specifiers are overloaded to also use scp-style git - // specifiers, so we have to parse those out and treat them special. - // They are NOT true URIs, so we can't hand them to URL. - - // This regex looks for things that look like: - // git+ssh://git@my.custom.git.com:username/project.git#deadbeef - // ...and various combinations. The username in the beginning is *required*. - const matched = rawSpec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i) - if (matched && !matched[1].match(/:[0-9]+\/?.*$/i)) { - res.type = 'git' - setGitAttrs(res, matched[2]) - res.fetchSpec = matched[1] - return res - } - } else if (rawSpec.startsWith('git+file://')) { - // URL can't handle windows paths - rawSpec = rawSpec.replace(/\\/g, '/') - } - const parsedUrl = new URL(rawSpec) - // check the protocol, and then see if it's git or not - switch (parsedUrl.protocol) { - case 'git:': - case 'git+http:': - case 'git+https:': - case 'git+rsync:': - case 'git+ftp:': - case 'git+file:': - case 'git+ssh:': - res.type = 'git' - setGitAttrs(res, parsedUrl.hash.slice(1)) - if (parsedUrl.protocol === 'git+file:' && /^git\+file:\/\/[a-z]:/i.test(rawSpec)) { - // URL can't handle drive letters on windows file paths, the host can't contain a : - res.fetchSpec = `git+file://${parsedUrl.host.toLowerCase()}:${parsedUrl.pathname}` - } else { - parsedUrl.hash = '' - res.fetchSpec = parsedUrl.toString() - } - if (res.fetchSpec.startsWith('git+')) { - res.fetchSpec = res.fetchSpec.slice(4) - } - break - case 'http:': - case 'https:': - res.type = 'remote' - res.fetchSpec = res.saveSpec - break - - default: - throw unsupportedURLType(parsedUrl.protocol, rawSpec) - } - - 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') - } - - if (!subSpec.name) { - throw new Error('aliases must have a name') - } - - 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.trim() - // no save spec for registry components as we save based on the fetched - // version, not on the argument so this can't compute that. - res.saveSpec = null - res.fetchSpec = spec - const version = semver.valid(spec, true) - const range = semver.validRange(spec, true) - if (version) { - res.type = 'version' - } else if (range) { - res.type = 'range' - } else { - if (encodeURIComponent(spec) !== spec) { - throw invalidTagName(spec, res.raw) - } - res.type = 'tag' - } - return res -} diff --git a/node_modules/@npmcli/git/node_modules/npm-package-arg/package.json b/node_modules/@npmcli/git/node_modules/npm-package-arg/package.json deleted file mode 100644 index d3f6fd7cf0a05..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-package-arg/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "npm-package-arg", - "version": "11.0.3", - "description": "Parse the things that can be arguments to `npm install`", - "main": "./lib/npa.js", - "directories": { - "test": "test" - }, - "files": [ - "bin/", - "lib/" - ], - "dependencies": { - "hosted-git-info": "^7.0.0", - "proc-log": "^4.0.0", - "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.23.1", - "tap": "^16.0.1" - }, - "scripts": { - "test": "tap", - "snap": "tap", - "npmclilint": "npmcli-lint", - "lint": "npm run eslint", - "lintfix": "npm run eslint -- --fix", - "posttest": "npm run lint", - "postsnap": "npm run lintfix --", - "postlint": "template-oss-check", - "template-oss-apply": "template-oss-apply --force", - "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/npm-package-arg.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/npm-package-arg/issues" - }, - "homepage": "https://github.com/npm/npm-package-arg", - "engines": { - "node": "^16.14.0 || >=18.0.0" - }, - "tap": { - "branches": 97, - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "version": "4.23.1", - "publish": true - } -} diff --git a/node_modules/@npmcli/git/node_modules/npm-pick-manifest/LICENSE.md b/node_modules/@npmcli/git/node_modules/npm-pick-manifest/LICENSE.md deleted file mode 100644 index 8d28acf866d93..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-pick-manifest/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -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 COPYRIGHT HOLDER DISCLAIMS -ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -COPYRIGHT HOLDER 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/@npmcli/git/node_modules/npm-pick-manifest/lib/index.js b/node_modules/@npmcli/git/node_modules/npm-pick-manifest/lib/index.js deleted file mode 100644 index 82807971844bf..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-pick-manifest/lib/index.js +++ /dev/null @@ -1,224 +0,0 @@ -'use strict' - -const npa = require('npm-package-arg') -const semver = require('semver') -const { checkEngine } = require('npm-install-checks') -const normalizeBin = require('npm-normalize-package-bin') - -const engineOk = (manifest, npmVersion, nodeVersion) => { - try { - checkEngine(manifest, npmVersion, nodeVersion) - return true - } catch (_) { - return false - } -} - -const isBefore = (verTimes, ver, time) => - !verTimes || !verTimes[ver] || Date.parse(verTimes[ver]) <= time - -const avoidSemverOpt = { includePrerelease: true, loose: true } -const shouldAvoid = (ver, avoid) => - avoid && semver.satisfies(ver, avoid, avoidSemverOpt) - -const decorateAvoid = (result, avoid) => - result && shouldAvoid(result.version, avoid) - ? { ...result, _shouldAvoid: true } - : result - -const pickManifest = (packument, wanted, opts) => { - const { - defaultTag = 'latest', - before = null, - nodeVersion = process.version, - npmVersion = null, - includeStaged = false, - avoid = null, - avoidStrict = false, - } = opts - - const { name, time: verTimes } = packument - const versions = packument.versions || {} - - if (avoidStrict) { - const looseOpts = { - ...opts, - avoidStrict: false, - } - - const result = pickManifest(packument, wanted, looseOpts) - if (!result || !result._shouldAvoid) { - return result - } - - const caret = pickManifest(packument, `^${result.version}`, looseOpts) - if (!caret || !caret._shouldAvoid) { - return { - ...caret, - _outsideDependencyRange: true, - _isSemVerMajor: false, - } - } - - const star = pickManifest(packument, '*', looseOpts) - if (!star || !star._shouldAvoid) { - return { - ...star, - _outsideDependencyRange: true, - _isSemVerMajor: true, - } - } - - throw Object.assign(new Error(`No avoidable versions for ${name}`), { - code: 'ETARGET', - name, - wanted, - avoid, - before, - versions: Object.keys(versions), - }) - } - - const staged = (includeStaged && packument.stagedVersions && - packument.stagedVersions.versions) || {} - const restricted = (packument.policyRestrictions && - packument.policyRestrictions.versions) || {} - - const time = before && verTimes ? +(new Date(before)) : Infinity - const spec = npa.resolve(name, wanted || defaultTag) - const type = spec.type - const distTags = packument['dist-tags'] || {} - - if (type !== 'tag' && type !== 'version' && type !== 'range') { - throw new Error('Only tag, version, and range are supported') - } - - // if the type is 'tag', and not just the implicit default, then it must - // be that exactly, or nothing else will do. - if (wanted && type === 'tag') { - const ver = distTags[wanted] - // if the version in the dist-tags is before the before date, then - // we use that. Otherwise, we get the highest precedence version - // prior to the dist-tag. - if (isBefore(verTimes, ver, time)) { - return decorateAvoid(versions[ver] || staged[ver] || restricted[ver], avoid) - } else { - return pickManifest(packument, `<=${ver}`, opts) - } - } - - // similarly, if a specific version, then only that version will do - if (wanted && type === 'version') { - const ver = semver.clean(wanted, { loose: true }) - const mani = versions[ver] || staged[ver] || restricted[ver] - return isBefore(verTimes, ver, time) ? decorateAvoid(mani, avoid) : null - } - - // ok, sort based on our heuristics, and pick the best fit - const range = type === 'range' ? wanted : '*' - - // if the range is *, then we prefer the 'latest' if available - // but skip this if it should be avoided, in that case we have - // to try a little harder. - const defaultVer = distTags[defaultTag] - if (defaultVer && - (range === '*' || semver.satisfies(defaultVer, range, { loose: true })) && - !restricted[defaultVer] && - !shouldAvoid(defaultVer, avoid)) { - const mani = versions[defaultVer] - const ok = mani && - isBefore(verTimes, defaultVer, time) && - engineOk(mani, npmVersion, nodeVersion) && - !mani.deprecated && - !staged[defaultVer] - if (ok) { - return mani - } - } - - // ok, actually have to sort the list and take the winner - const allEntries = Object.entries(versions) - .concat(Object.entries(staged)) - .concat(Object.entries(restricted)) - .filter(([ver]) => isBefore(verTimes, ver, time)) - - if (!allEntries.length) { - throw Object.assign(new Error(`No versions available for ${name}`), { - code: 'ENOVERSIONS', - name, - type, - wanted, - before, - versions: Object.keys(versions), - }) - } - - const sortSemverOpt = { loose: true } - const entries = allEntries.filter(([ver]) => - semver.satisfies(ver, range, { loose: true })) - .sort((a, b) => { - const [vera, mania] = a - const [verb, manib] = b - const notavoida = !shouldAvoid(vera, avoid) - const notavoidb = !shouldAvoid(verb, avoid) - const notrestra = !restricted[vera] - const notrestrb = !restricted[verb] - const notstagea = !staged[vera] - const notstageb = !staged[verb] - const notdepra = !mania.deprecated - const notdeprb = !manib.deprecated - const enginea = engineOk(mania, npmVersion, nodeVersion) - const engineb = engineOk(manib, npmVersion, nodeVersion) - // sort by: - // - not an avoided version - // - not restricted - // - not staged - // - not deprecated and engine ok - // - engine ok - // - not deprecated - // - semver - return (notavoidb - notavoida) || - (notrestrb - notrestra) || - (notstageb - notstagea) || - ((notdeprb && engineb) - (notdepra && enginea)) || - (engineb - enginea) || - (notdeprb - notdepra) || - semver.rcompare(vera, verb, sortSemverOpt) - }) - - return decorateAvoid(entries[0] && entries[0][1], avoid) -} - -module.exports = (packument, wanted, opts = {}) => { - const mani = pickManifest(packument, wanted, opts) - const picked = mani && normalizeBin(mani) - const policyRestrictions = packument.policyRestrictions - const restricted = (policyRestrictions && policyRestrictions.versions) || {} - - if (picked && !restricted[picked.version]) { - return picked - } - - const { before = null, defaultTag = 'latest' } = opts - const bstr = before ? new Date(before).toLocaleString() : '' - const { name } = packument - const pckg = `${name}@${wanted}` + - (before ? ` with a date before ${bstr}` : '') - - const isForbidden = picked && !!restricted[picked.version] - const polMsg = isForbidden ? policyRestrictions.message : '' - - const msg = !isForbidden ? `No matching version found for ${pckg}.` - : `Could not download ${pckg} due to policy violations:\n${polMsg}` - - const code = isForbidden ? 'E403' : 'ETARGET' - throw Object.assign(new Error(msg), { - code, - type: npa.resolve(packument.name, wanted).type, - wanted, - versions: Object.keys(packument.versions ?? {}), - name, - distTags: packument['dist-tags'], - defaultTag, - }) -} diff --git a/node_modules/@npmcli/git/node_modules/npm-pick-manifest/package.json b/node_modules/@npmcli/git/node_modules/npm-pick-manifest/package.json deleted file mode 100644 index 4c0dd50630def..0000000000000 --- a/node_modules/@npmcli/git/node_modules/npm-pick-manifest/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "npm-pick-manifest", - "version": "9.1.0", - "description": "Resolves a matching manifest from a package metadata document according to standard npm semver resolution rules.", - "main": "./lib", - "files": [ - "bin/", - "lib/" - ], - "scripts": { - "coverage": "tap", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "test": "tap", - "posttest": "npm run lint", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "snap": "tap", - "template-oss-apply": "template-oss-apply --force" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/npm-pick-manifest.git" - }, - "keywords": [ - "npm", - "semver", - "package manager" - ], - "author": "GitHub Inc.", - "license": "ISC", - "dependencies": { - "npm-install-checks": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^11.0.0", - "semver": "^7.3.5" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.22.0", - "tap": "^16.0.1" - }, - "tap": { - "check-coverage": true, - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "engines": { - "node": "^16.14.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 - } -} diff --git a/node_modules/@npmcli/git/node_modules/proc-log/LICENSE b/node_modules/@npmcli/git/node_modules/proc-log/LICENSE deleted file mode 100644 index 83837797202b7..0000000000000 --- a/node_modules/@npmcli/git/node_modules/proc-log/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) GitHub, 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/@npmcli/git/node_modules/proc-log/lib/index.js b/node_modules/@npmcli/git/node_modules/proc-log/lib/index.js deleted file mode 100644 index 86d90861078da..0000000000000 --- a/node_modules/@npmcli/git/node_modules/proc-log/lib/index.js +++ /dev/null @@ -1,153 +0,0 @@ -const META = Symbol('proc-log.meta') -module.exports = { - META: META, - output: { - LEVELS: [ - 'standard', - 'error', - 'buffer', - 'flush', - ], - KEYS: { - standard: 'standard', - error: 'error', - buffer: 'buffer', - flush: 'flush', - }, - standard: function (...args) { - return process.emit('output', 'standard', ...args) - }, - error: function (...args) { - return process.emit('output', 'error', ...args) - }, - buffer: function (...args) { - return process.emit('output', 'buffer', ...args) - }, - flush: function (...args) { - return process.emit('output', 'flush', ...args) - }, - }, - log: { - LEVELS: [ - 'notice', - 'error', - 'warn', - 'info', - 'verbose', - 'http', - 'silly', - 'timing', - 'pause', - 'resume', - ], - KEYS: { - notice: 'notice', - error: 'error', - warn: 'warn', - info: 'info', - verbose: 'verbose', - http: 'http', - silly: 'silly', - timing: 'timing', - pause: 'pause', - resume: 'resume', - }, - error: function (...args) { - return process.emit('log', 'error', ...args) - }, - notice: function (...args) { - return process.emit('log', 'notice', ...args) - }, - warn: function (...args) { - return process.emit('log', 'warn', ...args) - }, - info: function (...args) { - return process.emit('log', 'info', ...args) - }, - verbose: function (...args) { - return process.emit('log', 'verbose', ...args) - }, - http: function (...args) { - return process.emit('log', 'http', ...args) - }, - silly: function (...args) { - return process.emit('log', 'silly', ...args) - }, - timing: function (...args) { - return process.emit('log', 'timing', ...args) - }, - pause: function () { - return process.emit('log', 'pause') - }, - resume: function () { - return process.emit('log', 'resume') - }, - }, - time: { - LEVELS: [ - 'start', - 'end', - ], - KEYS: { - start: 'start', - end: 'end', - }, - start: function (name, fn) { - process.emit('time', 'start', name) - function end () { - return process.emit('time', 'end', name) - } - if (typeof fn === 'function') { - const res = fn() - if (res && res.finally) { - return res.finally(end) - } - end() - return res - } - return end - }, - end: function (name) { - return process.emit('time', 'end', name) - }, - }, - input: { - LEVELS: [ - 'start', - 'end', - 'read', - ], - KEYS: { - start: 'start', - end: 'end', - read: 'read', - }, - start: function (fn) { - process.emit('input', 'start') - function end () { - return process.emit('input', 'end') - } - if (typeof fn === 'function') { - const res = fn() - if (res && res.finally) { - return res.finally(end) - } - end() - return res - } - return end - }, - end: function () { - return process.emit('input', 'end') - }, - read: function (...args) { - let resolve, reject - const promise = new Promise((_resolve, _reject) => { - resolve = _resolve - reject = _reject - }) - process.emit('input', 'read', resolve, reject, ...args) - return promise - }, - }, -} diff --git a/node_modules/@npmcli/git/node_modules/proc-log/package.json b/node_modules/@npmcli/git/node_modules/proc-log/package.json deleted file mode 100644 index 4ab89102ecc9b..0000000000000 --- a/node_modules/@npmcli/git/node_modules/proc-log/package.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "proc-log", - "version": "4.2.0", - "files": [ - "bin/", - "lib/" - ], - "main": "lib/index.js", - "description": "just emit 'log' events on the process object", - "repository": { - "type": "git", - "url": "https://github.com/npm/proc-log.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "posttest": "npm run lint", - "postsnap": "eslint index.js test/*.js --fix", - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", - "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.21.3", - "tap": "^16.0.1" - }, - "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.21.3", - "publish": true - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - } -} diff --git a/node_modules/@npmcli/git/node_modules/validate-npm-package-name/LICENSE b/node_modules/@npmcli/git/node_modules/validate-npm-package-name/LICENSE deleted file mode 100644 index fdcd63b302308..0000000000000 --- a/node_modules/@npmcli/git/node_modules/validate-npm-package-name/LICENSE +++ /dev/null @@ -1,6 +0,0 @@ -Copyright (c) 2015, 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/@npmcli/git/node_modules/validate-npm-package-name/lib/index.js b/node_modules/@npmcli/git/node_modules/validate-npm-package-name/lib/index.js deleted file mode 100644 index fd800d5a5eae1..0000000000000 --- a/node_modules/@npmcli/git/node_modules/validate-npm-package-name/lib/index.js +++ /dev/null @@ -1,105 +0,0 @@ -'use strict' -const { builtinModules: builtins } = require('module') - -var scopedPackagePattern = new RegExp('^(?:@([^/]+?)[/])?([^/]+?)$') -var blacklist = [ - 'node_modules', - 'favicon.ico', -] - -function validate (name) { - var warnings = [] - var errors = [] - - if (name === null) { - errors.push('name cannot be null') - return done(warnings, errors) - } - - if (name === undefined) { - errors.push('name cannot be undefined') - return done(warnings, errors) - } - - if (typeof name !== 'string') { - errors.push('name must be a string') - return done(warnings, errors) - } - - if (!name.length) { - errors.push('name length must be greater than zero') - } - - if (name.match(/^\./)) { - errors.push('name cannot start with a period') - } - - if (name.match(/^_/)) { - errors.push('name cannot start with an underscore') - } - - if (name.trim() !== name) { - errors.push('name cannot contain leading or trailing spaces') - } - - // No funny business - blacklist.forEach(function (blacklistedName) { - if (name.toLowerCase() === blacklistedName) { - errors.push(blacklistedName + ' is a blacklisted name') - } - }) - - // Generate warnings for stuff that used to be allowed - - // core module names like http, events, util, etc - if (builtins.includes(name.toLowerCase())) { - warnings.push(name + ' is a core module name') - } - - if (name.length > 214) { - warnings.push('name can no longer contain more than 214 characters') - } - - // mIxeD CaSe nAMEs - if (name.toLowerCase() !== name) { - warnings.push('name can no longer contain capital letters') - } - - if (/[~'!()*]/.test(name.split('/').slice(-1)[0])) { - warnings.push('name can no longer contain special characters ("~\'!()*")') - } - - if (encodeURIComponent(name) !== name) { - // Maybe it's a scoped package name, like @user/package - var nameMatch = name.match(scopedPackagePattern) - if (nameMatch) { - var user = nameMatch[1] - var pkg = nameMatch[2] - if (encodeURIComponent(user) === user && encodeURIComponent(pkg) === pkg) { - return done(warnings, errors) - } - } - - errors.push('name can only contain URL-friendly characters') - } - - return done(warnings, errors) -} - -var done = function (warnings, errors) { - var result = { - validForNewPackages: errors.length === 0 && warnings.length === 0, - validForOldPackages: errors.length === 0, - warnings: warnings, - errors: errors, - } - if (!result.warnings.length) { - delete result.warnings - } - if (!result.errors.length) { - delete result.errors - } - return result -} - -module.exports = validate diff --git a/node_modules/@npmcli/git/node_modules/validate-npm-package-name/package.json b/node_modules/@npmcli/git/node_modules/validate-npm-package-name/package.json deleted file mode 100644 index 8a38b66e1d3e4..0000000000000 --- a/node_modules/@npmcli/git/node_modules/validate-npm-package-name/package.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "validate-npm-package-name", - "version": "5.0.1", - "description": "Give me a string and I'll tell you if it's a valid npm package name", - "main": "lib/", - "directories": { - "test": "test" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.22.0", - "tap": "^16.0.1" - }, - "scripts": { - "cov:test": "TAP_FLAGS='--cov' npm run test:code", - "test:code": "tap ${TAP_FLAGS:-'--'} test/*.js", - "test:style": "standard", - "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" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/npm/validate-npm-package-name.git" - }, - "keywords": [ - "npm", - "package", - "names", - "validation" - ], - "author": "GitHub Inc.", - "license": "ISC", - "bugs": { - "url": "https://github.com/npm/validate-npm-package-name/issues" - }, - "homepage": "https://github.com/npm/validate-npm-package-name", - "files": [ - "bin/", - "lib/" - ], - "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/**" - ] - } -} diff --git a/node_modules/@npmcli/git/node_modules/which/LICENSE b/node_modules/@npmcli/git/node_modules/which/LICENSE deleted file mode 100644 index 19129e315fe59..0000000000000 --- a/node_modules/@npmcli/git/node_modules/which/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -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/@npmcli/git/node_modules/which/bin/which.js b/node_modules/@npmcli/git/node_modules/which/bin/which.js deleted file mode 100755 index 6df16f21acf93..0000000000000 --- a/node_modules/@npmcli/git/node_modules/which/bin/which.js +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env node - -const which = require('../lib') -const argv = process.argv.slice(2) - -const usage = (err) => { - if (err) { - console.error(`which: ${err}`) - } - console.error('usage: which [-as] program ...') - process.exit(1) -} - -if (!argv.length) { - return usage() -} - -let dashdash = false -const [commands, flags] = argv.reduce((acc, arg) => { - if (dashdash || arg === '--') { - dashdash = true - return acc - } - - if (!/^-/.test(arg)) { - acc[0].push(arg) - return acc - } - - for (const flag of arg.slice(1).split('')) { - if (flag === 's') { - acc[1].silent = true - } else if (flag === 'a') { - acc[1].all = true - } else { - usage(`illegal option -- ${flag}`) - } - } - - return acc -}, [[], {}]) - -for (const command of commands) { - try { - const res = which.sync(command, { all: flags.all }) - if (!flags.silent) { - console.log([].concat(res).join('\n')) - } - } catch (err) { - process.exitCode = 1 - } -} diff --git a/node_modules/@npmcli/git/node_modules/which/lib/index.js b/node_modules/@npmcli/git/node_modules/which/lib/index.js deleted file mode 100644 index 2fd358baf888f..0000000000000 --- a/node_modules/@npmcli/git/node_modules/which/lib/index.js +++ /dev/null @@ -1,111 +0,0 @@ -const { isexe, sync: isexeSync } = require('isexe') -const { join, delimiter, sep, posix } = require('path') - -const isWindows = process.platform === 'win32' - -// used to check for slashed in commands passed in. always checks for the posix -// seperator on all platforms, and checks for the current separator when not on -// a posix platform. don't use the isWindows check for this since that is mocked -// in tests but we still need the code to actually work when called. that is also -// why it is ignored from coverage. -/* istanbul ignore next */ -const rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\)/g, '\\$1')) -const rRel = new RegExp(`^\\.${rSlash.source}`) - -const getNotFoundError = (cmd) => - Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) - -const getPathInfo = (cmd, { - path: optPath = process.env.PATH, - pathExt: optPathExt = process.env.PATHEXT, - delimiter: optDelimiter = delimiter, -}) => { - // If it has a slash, then we don't bother searching the pathenv. - // just check the file itself, and that's it. - const pathEnv = cmd.match(rSlash) ? [''] : [ - // windows always checks the cwd first - ...(isWindows ? [process.cwd()] : []), - ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter), - ] - - if (isWindows) { - const pathExtExe = optPathExt || - ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter) - const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()]) - if (cmd.includes('.') && pathExt[0] !== '') { - pathExt.unshift('') - } - return { pathEnv, pathExt, pathExtExe } - } - - return { pathEnv, pathExt: [''] } -} - -const getPathPart = (raw, cmd) => { - const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw - const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : '' - return prefix + join(pathPart, cmd) -} - -const which = async (cmd, opt = {}) => { - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) - const found = [] - - for (const envPart of pathEnv) { - const p = getPathPart(envPart, cmd) - - for (const ext of pathExt) { - const withExt = p + ext - const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true }) - if (is) { - if (!opt.all) { - return withExt - } - found.push(withExt) - } - } - } - - if (opt.all && found.length) { - return found - } - - if (opt.nothrow) { - return null - } - - throw getNotFoundError(cmd) -} - -const whichSync = (cmd, opt = {}) => { - const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) - const found = [] - - for (const pathEnvPart of pathEnv) { - const p = getPathPart(pathEnvPart, cmd) - - for (const ext of pathExt) { - const withExt = p + ext - const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true }) - if (is) { - if (!opt.all) { - return withExt - } - found.push(withExt) - } - } - } - - if (opt.all && found.length) { - return found - } - - if (opt.nothrow) { - return null - } - - throw getNotFoundError(cmd) -} - -module.exports = which -which.sync = whichSync diff --git a/node_modules/@npmcli/git/node_modules/which/package.json b/node_modules/@npmcli/git/node_modules/which/package.json deleted file mode 100644 index 515bfb22ca0e1..0000000000000 --- a/node_modules/@npmcli/git/node_modules/which/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "author": "GitHub Inc.", - "name": "which", - "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", - "version": "4.0.0", - "repository": { - "type": "git", - "url": "https://github.com/npm/node-which.git" - }, - "main": "lib/index.js", - "bin": { - "node-which": "./bin/which.js" - }, - "license": "ISC", - "dependencies": { - "isexe": "^3.1.1" - }, - "devDependencies": { - "@npmcli/eslint-config": "^4.0.0", - "@npmcli/template-oss": "4.18.0", - "tap": "^16.3.0" - }, - "scripts": { - "test": "tap", - "lint": "eslint \"**/*.js\"", - "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/" - ], - "tap": { - "check-coverage": true, - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "engines": { - "node": "^16.13.0 || >=18.0.0" - }, - "templateOSS": { - "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", - "ciVersions": [ - "16.13.0", - "16.x", - "18.0.0", - "18.x" - ], - "version": "4.18.0", - "publish": "true" - } -} diff --git a/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/git/package.json index b6aa4a282cc0f..2bc6730ba2151 100644 --- a/node_modules/@npmcli/git/package.json +++ b/node_modules/@npmcli/git/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/git", - "version": "5.0.8", + "version": "6.0.1", "main": "lib/index.js", "files": [ "bin/", @@ -14,13 +14,14 @@ "author": "GitHub Inc.", "license": "ISC", "scripts": { - "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "lint": "npm run eslint", "snap": "tap", "test": "tap", "posttest": "npm run lint", "postlint": "template-oss-check", - "lintfix": "npm run lint -- --fix", - "template-oss-apply": "template-oss-apply --force" + "lintfix": "npm run eslint -- --fix", + "template-oss-apply": "template-oss-apply --force", + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" }, "tap": { "timeout": 600, @@ -30,29 +31,29 @@ ] }, "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", "npm-package-arg": "^11.0.0", "slash": "^3.0.0", "tap": "^16.0.1" }, "dependencies": { - "@npmcli/promise-spawn": "^7.0.0", - "ini": "^4.1.3", + "@npmcli/promise-spawn": "^8.0.0", + "ini": "^5.0.0", "lru-cache": "^10.0.1", - "npm-pick-manifest": "^9.0.0", - "proc-log": "^4.0.0", + "npm-pick-manifest": "^10.0.0", + "proc-log": "^5.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^4.0.0" + "which": "^5.0.0" }, "engines": { - "node": "^16.14.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 } } diff --git a/node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/LICENSE b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/LICENSE similarity index 100% rename from node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn/LICENSE rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/LICENSE diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/clone.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/clone.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/clone.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/clone.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/errors.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/errors.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/errors.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/errors.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/find.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/find.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/find.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/find.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/index.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/index.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/index.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/index.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/is-clean.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/is-clean.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/is-clean.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/is-clean.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/is.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/is.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/is.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/is.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/lines-to-revs.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/lines-to-revs.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/lines-to-revs.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/lines-to-revs.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/make-error.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/make-error.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/make-error.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/make-error.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/opts.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/opts.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/opts.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/opts.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/revs.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/revs.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/revs.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/revs.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/spawn.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/spawn.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/spawn.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/spawn.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/utils.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/utils.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/utils.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/utils.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/which.js b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/which.js similarity index 100% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/lib/which.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/lib/which.js diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/package.json b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/package.json similarity index 66% rename from node_modules/@npmcli/package-json/node_modules/@npmcli/git/package.json rename to node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/package.json index 2bc6730ba2151..b6aa4a282cc0f 100644 --- a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/package.json +++ b/node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/git", - "version": "6.0.1", + "version": "5.0.8", "main": "lib/index.js", "files": [ "bin/", @@ -14,14 +14,13 @@ "author": "GitHub Inc.", "license": "ISC", "scripts": { - "lint": "npm run eslint", + "lint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", "snap": "tap", "test": "tap", "posttest": "npm run lint", "postlint": "template-oss-check", - "lintfix": "npm run eslint -- --fix", - "template-oss-apply": "template-oss-apply --force", - "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + "lintfix": "npm run lint -- --fix", + "template-oss-apply": "template-oss-apply --force" }, "tap": { "timeout": 600, @@ -31,29 +30,29 @@ ] }, "devDependencies": { - "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.23.3", + "@npmcli/eslint-config": "^4.0.0", + "@npmcli/template-oss": "4.22.0", "npm-package-arg": "^11.0.0", "slash": "^3.0.0", "tap": "^16.0.1" }, "dependencies": { - "@npmcli/promise-spawn": "^8.0.0", - "ini": "^5.0.0", + "@npmcli/promise-spawn": "^7.0.0", + "ini": "^4.1.3", "lru-cache": "^10.0.1", - "npm-pick-manifest": "^10.0.0", - "proc-log": "^5.0.0", + "npm-pick-manifest": "^9.0.0", + "proc-log": "^4.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^5.0.0" + "which": "^4.0.0" }, "engines": { - "node": "^18.17.0 || >=20.5.0" + "node": "^16.14.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.22.0", "publish": true } } diff --git a/node_modules/@npmcli/git/node_modules/ini/LICENSE b/node_modules/@npmcli/metavuln-calculator/node_modules/ini/LICENSE similarity index 100% rename from node_modules/@npmcli/git/node_modules/ini/LICENSE rename to node_modules/@npmcli/metavuln-calculator/node_modules/ini/LICENSE diff --git a/node_modules/@npmcli/git/node_modules/ini/lib/ini.js b/node_modules/@npmcli/metavuln-calculator/node_modules/ini/lib/ini.js similarity index 100% rename from node_modules/@npmcli/git/node_modules/ini/lib/ini.js rename to node_modules/@npmcli/metavuln-calculator/node_modules/ini/lib/ini.js diff --git a/node_modules/@npmcli/git/node_modules/ini/package.json b/node_modules/@npmcli/metavuln-calculator/node_modules/ini/package.json similarity index 100% rename from node_modules/@npmcli/git/node_modules/ini/package.json rename to node_modules/@npmcli/metavuln-calculator/node_modules/ini/package.json diff --git a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/LICENSE b/node_modules/@npmcli/package-json/node_modules/@npmcli/git/LICENSE deleted file mode 100644 index 8f90f96f4c6c5..0000000000000 --- a/node_modules/@npmcli/package-json/node_modules/@npmcli/git/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -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 NPM DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE NPM 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/pacote/node_modules/@npmcli/git/LICENSE b/node_modules/pacote/node_modules/@npmcli/git/LICENSE deleted file mode 100644 index 8f90f96f4c6c5..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -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 NPM DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE NPM 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/pacote/node_modules/@npmcli/git/lib/clone.js b/node_modules/pacote/node_modules/@npmcli/git/lib/clone.js deleted file mode 100644 index e25a4d1426821..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/clone.js +++ /dev/null @@ -1,172 +0,0 @@ -// The goal here is to minimize both git workload and -// the number of refs we download over the network. -// -// Every method ends up with the checked out working dir -// at the specified ref, and resolves with the git sha. - -// Only certain whitelisted hosts get shallow cloning. -// Many hosts (including GHE) don't always support it. -// A failed shallow fetch takes a LOT longer than a full -// fetch in most cases, so we skip it entirely. -// Set opts.gitShallow = true/false to force this behavior -// one way or the other. -const shallowHosts = new Set([ - 'github.com', - 'gist.github.com', - 'gitlab.com', - 'bitbucket.com', - 'bitbucket.org', -]) -// we have to use url.parse until we add the same shim that hosted-git-info has -// to handle scp:// urls -const { parse } = require('url') // eslint-disable-line node/no-deprecated-api -const path = require('path') - -const getRevs = require('./revs.js') -const spawn = require('./spawn.js') -const { isWindows } = require('./utils.js') - -const pickManifest = require('npm-pick-manifest') -const fs = require('fs/promises') - -module.exports = (repo, ref = 'HEAD', target = null, opts = {}) => - getRevs(repo, opts).then(revs => clone( - repo, - revs, - ref, - resolveRef(revs, ref, opts), - target || defaultTarget(repo, opts.cwd), - opts - )) - -const maybeShallow = (repo, opts) => { - if (opts.gitShallow === false || opts.gitShallow) { - return opts.gitShallow - } - return shallowHosts.has(parse(repo).host) -} - -const defaultTarget = (repo, /* istanbul ignore next */ cwd = process.cwd()) => - path.resolve(cwd, path.basename(repo.replace(/[/\\]?\.git$/, ''))) - -const clone = (repo, revs, ref, revDoc, target, opts) => { - if (!revDoc) { - return unresolved(repo, ref, target, opts) - } - if (revDoc.sha === revs.refs.HEAD.sha) { - return plain(repo, revDoc, target, opts) - } - if (revDoc.type === 'tag' || revDoc.type === 'branch') { - return branch(repo, revDoc, target, opts) - } - return other(repo, revDoc, target, opts) -} - -const resolveRef = (revs, ref, opts) => { - const { spec = {} } = opts - ref = spec.gitCommittish || ref - /* istanbul ignore next - will fail anyway, can't pull */ - if (!revs) { - return null - } - if (spec.gitRange) { - return pickManifest(revs, spec.gitRange, opts) - } - if (!ref) { - return revs.refs.HEAD - } - if (revs.refs[ref]) { - return revs.refs[ref] - } - if (revs.shas[ref]) { - return revs.refs[revs.shas[ref][0]] - } - return null -} - -// pull request or some other kind of advertised ref -const other = (repo, revDoc, target, opts) => { - const shallow = maybeShallow(repo, opts) - - const fetchOrigin = ['fetch', 'origin', revDoc.rawRef] - .concat(shallow ? ['--depth=1'] : []) - - const git = (args) => spawn(args, { ...opts, cwd: target }) - return fs.mkdir(target, { recursive: true }) - .then(() => git(['init'])) - .then(() => isWindows(opts) - ? git(['config', '--local', '--add', 'core.longpaths', 'true']) - : null) - .then(() => git(['remote', 'add', 'origin', repo])) - .then(() => git(fetchOrigin)) - .then(() => git(['checkout', revDoc.sha])) - .then(() => updateSubmodules(target, opts)) - .then(() => revDoc.sha) -} - -// tag or branches. use -b -const branch = (repo, revDoc, target, opts) => { - const args = [ - 'clone', - '-b', - revDoc.ref, - repo, - target, - '--recurse-submodules', - ] - if (maybeShallow(repo, opts)) { - args.push('--depth=1') - } - if (isWindows(opts)) { - args.push('--config', 'core.longpaths=true') - } - return spawn(args, opts).then(() => revDoc.sha) -} - -// just the head. clone it -const plain = (repo, revDoc, target, opts) => { - const args = [ - 'clone', - repo, - target, - '--recurse-submodules', - ] - if (maybeShallow(repo, opts)) { - args.push('--depth=1') - } - if (isWindows(opts)) { - args.push('--config', 'core.longpaths=true') - } - return spawn(args, opts).then(() => revDoc.sha) -} - -const updateSubmodules = async (target, opts) => { - const hasSubmodules = await fs.stat(`${target}/.gitmodules`) - .then(() => true) - .catch(() => false) - if (!hasSubmodules) { - return null - } - return spawn([ - 'submodule', - 'update', - '-q', - '--init', - '--recursive', - ], { ...opts, cwd: target }) -} - -const unresolved = (repo, ref, target, opts) => { - // can't do this one shallowly, because the ref isn't advertised - // but we can avoid checking out the working dir twice, at least - const lp = isWindows(opts) ? ['--config', 'core.longpaths=true'] : [] - const cloneArgs = ['clone', '--mirror', '-q', repo, target + '/.git'] - const git = (args) => spawn(args, { ...opts, cwd: target }) - return fs.mkdir(target, { recursive: true }) - .then(() => git(cloneArgs.concat(lp))) - .then(() => git(['init'])) - .then(() => git(['checkout', ref])) - .then(() => updateSubmodules(target, opts)) - .then(() => git(['rev-parse', '--revs-only', 'HEAD'])) - .then(({ stdout }) => stdout.trim()) -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/errors.js b/node_modules/pacote/node_modules/@npmcli/git/lib/errors.js deleted file mode 100644 index 3ceaa45811669..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/errors.js +++ /dev/null @@ -1,36 +0,0 @@ - -const maxRetry = 3 - -class GitError extends Error { - shouldRetry () { - return false - } -} - -class GitConnectionError extends GitError { - constructor () { - super('A git connection error occurred') - } - - shouldRetry (number) { - return number < maxRetry - } -} - -class GitPathspecError extends GitError { - constructor () { - super('The git reference could not be found') - } -} - -class GitUnknownError extends GitError { - constructor () { - super('An unknown git error occurred') - } -} - -module.exports = { - GitConnectionError, - GitPathspecError, - GitUnknownError, -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/find.js b/node_modules/pacote/node_modules/@npmcli/git/lib/find.js deleted file mode 100644 index 34bd310b88e5d..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/find.js +++ /dev/null @@ -1,15 +0,0 @@ -const is = require('./is.js') -const { dirname } = require('path') - -module.exports = async ({ cwd = process.cwd(), root } = {}) => { - while (true) { - if (await is({ cwd })) { - return cwd - } - const next = dirname(cwd) - if (cwd === root || cwd === next) { - return null - } - cwd = next - } -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/index.js b/node_modules/pacote/node_modules/@npmcli/git/lib/index.js deleted file mode 100644 index 10a65f782e6da..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/index.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - clone: require('./clone.js'), - revs: require('./revs.js'), - spawn: require('./spawn.js'), - is: require('./is.js'), - find: require('./find.js'), - isClean: require('./is-clean.js'), - errors: require('./errors.js'), -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/is-clean.js b/node_modules/pacote/node_modules/@npmcli/git/lib/is-clean.js deleted file mode 100644 index 182373be94193..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/is-clean.js +++ /dev/null @@ -1,6 +0,0 @@ -const spawn = require('./spawn.js') - -module.exports = (opts = {}) => - spawn(['status', '--porcelain=v1', '-uno'], opts) - .then(res => !res.stdout.trim().split(/\r?\n+/) - .map(l => l.trim()).filter(l => l).length) diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/is.js b/node_modules/pacote/node_modules/@npmcli/git/lib/is.js deleted file mode 100644 index f5a0e8754f10d..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/is.js +++ /dev/null @@ -1,4 +0,0 @@ -// not an airtight indicator, but a good gut-check to even bother trying -const { stat } = require('fs/promises') -module.exports = ({ cwd = process.cwd() } = {}) => - stat(cwd + '/.git').then(() => true, () => false) diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/lines-to-revs.js b/node_modules/pacote/node_modules/@npmcli/git/lib/lines-to-revs.js deleted file mode 100644 index 6bd7e7a4c1531..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/lines-to-revs.js +++ /dev/null @@ -1,147 +0,0 @@ -// turn an array of lines from `git ls-remote` into a thing -// vaguely resembling a packument, where docs are a resolved ref - -const semver = require('semver') - -module.exports = lines => finish(lines.reduce(linesToRevsReducer, { - versions: {}, - 'dist-tags': {}, - refs: {}, - shas: {}, -})) - -const finish = revs => distTags(shaList(peelTags(revs))) - -// We can check out shallow clones on specific SHAs if we have a ref -const shaList = revs => { - Object.keys(revs.refs).forEach(ref => { - const doc = revs.refs[ref] - if (!revs.shas[doc.sha]) { - revs.shas[doc.sha] = [ref] - } else { - revs.shas[doc.sha].push(ref) - } - }) - return revs -} - -// Replace any tags with their ^{} counterparts, if those exist -const peelTags = revs => { - Object.keys(revs.refs).filter(ref => ref.endsWith('^{}')).forEach(ref => { - const peeled = revs.refs[ref] - const unpeeled = revs.refs[ref.replace(/\^\{\}$/, '')] - if (unpeeled) { - unpeeled.sha = peeled.sha - delete revs.refs[ref] - } - }) - return revs -} - -const distTags = revs => { - // not entirely sure what situations would result in an - // ichabod repo, but best to be careful in Sleepy Hollow anyway - const HEAD = revs.refs.HEAD || /* istanbul ignore next */ {} - const versions = Object.keys(revs.versions) - versions.forEach(v => { - // simulate a dist-tags with latest pointing at the - // 'latest' branch if one exists and is a version, - // or HEAD if not. - const ver = revs.versions[v] - if (revs.refs.latest && ver.sha === revs.refs.latest.sha) { - revs['dist-tags'].latest = v - } else if (ver.sha === HEAD.sha) { - revs['dist-tags'].HEAD = v - if (!revs.refs.latest) { - revs['dist-tags'].latest = v - } - } - }) - return revs -} - -const refType = ref => { - if (ref.startsWith('refs/tags/')) { - return 'tag' - } - if (ref.startsWith('refs/heads/')) { - return 'branch' - } - if (ref.startsWith('refs/pull/')) { - return 'pull' - } - if (ref === 'HEAD') { - return 'head' - } - // Could be anything, ignore for now - /* istanbul ignore next */ - return 'other' -} - -// return the doc, or null if we should ignore it. -const lineToRevDoc = line => { - const split = line.trim().split(/\s+/, 2) - if (split.length < 2) { - return null - } - - const sha = split[0].trim() - const rawRef = split[1].trim() - const type = refType(rawRef) - - if (type === 'tag') { - // refs/tags/foo^{} is the 'peeled tag', ie the commit - // that is tagged by refs/tags/foo they resolve to the same - // content, just different objects in git's data structure. - // But, we care about the thing the tag POINTS to, not the tag - // object itself, so we only look at the peeled tag refs, and - // ignore the pointer. - // For now, though, we have to save both, because some tags - // don't have peels, if they were not annotated. - const ref = rawRef.slice('refs/tags/'.length) - return { sha, ref, rawRef, type } - } - - if (type === 'branch') { - const ref = rawRef.slice('refs/heads/'.length) - return { sha, ref, rawRef, type } - } - - if (type === 'pull') { - // NB: merged pull requests installable with #pull/123/merge - // for the merged pr, or #pull/123 for the PR head - const ref = rawRef.slice('refs/'.length).replace(/\/head$/, '') - return { sha, ref, rawRef, type } - } - - if (type === 'head') { - const ref = 'HEAD' - return { sha, ref, rawRef, type } - } - - // at this point, all we can do is leave the ref un-munged - return { sha, ref: rawRef, rawRef, type } -} - -const linesToRevsReducer = (revs, line) => { - const doc = lineToRevDoc(line) - - if (!doc) { - return revs - } - - revs.refs[doc.ref] = doc - revs.refs[doc.rawRef] = doc - - if (doc.type === 'tag') { - // try to pull a semver value out of tags like `release-v1.2.3` - // which is a pretty common pattern. - const match = !doc.ref.endsWith('^{}') && - doc.ref.match(/v?(\d+\.\d+\.\d+(?:[-+].+)?)$/) - if (match && semver.valid(match[1], true)) { - revs.versions[semver.clean(match[1], true)] = doc - } - } - - return revs -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/make-error.js b/node_modules/pacote/node_modules/@npmcli/git/lib/make-error.js deleted file mode 100644 index 7540ec7c8b9f7..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/make-error.js +++ /dev/null @@ -1,33 +0,0 @@ -const { - GitConnectionError, - GitPathspecError, - GitUnknownError, -} = require('./errors.js') - -const connectionErrorRe = new RegExp([ - 'remote error: Internal Server Error', - 'The remote end hung up unexpectedly', - 'Connection timed out', - 'Operation timed out', - 'Failed to connect to .* Timed out', - 'Connection reset by peer', - 'SSL_ERROR_SYSCALL', - 'The requested URL returned error: 503', -].join('|')) - -const missingPathspecRe = /pathspec .* did not match any file\(s\) known to git/ - -function makeError (er) { - const message = er.stderr - let gitEr - if (connectionErrorRe.test(message)) { - gitEr = new GitConnectionError(message) - } else if (missingPathspecRe.test(message)) { - gitEr = new GitPathspecError(message) - } else { - gitEr = new GitUnknownError(message) - } - return Object.assign(gitEr, er) -} - -module.exports = makeError diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/opts.js b/node_modules/pacote/node_modules/@npmcli/git/lib/opts.js deleted file mode 100644 index 1e80e9efe4989..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/opts.js +++ /dev/null @@ -1,57 +0,0 @@ -const fs = require('node:fs') -const os = require('node:os') -const path = require('node:path') -const ini = require('ini') - -const gitConfigPath = path.join(os.homedir(), '.gitconfig') - -let cachedConfig = null - -// Function to load and cache the git config -const loadGitConfig = () => { - if (cachedConfig === null) { - try { - cachedConfig = {} - if (fs.existsSync(gitConfigPath)) { - const configContent = fs.readFileSync(gitConfigPath, 'utf-8') - cachedConfig = ini.parse(configContent) - } - } catch (error) { - cachedConfig = {} - } - } - return cachedConfig -} - -const checkGitConfigs = () => { - const config = loadGitConfig() - return { - sshCommandSetInConfig: config?.core?.sshCommand !== undefined, - askPassSetInConfig: config?.core?.askpass !== undefined, - } -} - -const sshCommandSetInEnv = process.env.GIT_SSH_COMMAND !== undefined -const askPassSetInEnv = process.env.GIT_ASKPASS !== undefined -const { sshCommandSetInConfig, askPassSetInConfig } = checkGitConfigs() - -// Values we want to set if they're not already defined by the end user -// This defaults to accepting new ssh host key fingerprints -const finalGitEnv = { - ...(askPassSetInEnv || askPassSetInConfig ? {} : { - GIT_ASKPASS: 'echo', - }), - ...(sshCommandSetInEnv || sshCommandSetInConfig ? {} : { - GIT_SSH_COMMAND: 'ssh -oStrictHostKeyChecking=accept-new', - }), -} - -module.exports = (opts = {}) => ({ - stdioString: true, - ...opts, - shell: false, - env: opts.env || { ...finalGitEnv, ...process.env }, -}) - -// Export the loadGitConfig function for testing -module.exports.loadGitConfig = loadGitConfig diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/revs.js b/node_modules/pacote/node_modules/@npmcli/git/lib/revs.js deleted file mode 100644 index ca14837de1b87..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/revs.js +++ /dev/null @@ -1,28 +0,0 @@ -const pinflight = require('promise-inflight') -const spawn = require('./spawn.js') -const { LRUCache } = require('lru-cache') - -const revsCache = new LRUCache({ - max: 100, - ttl: 5 * 60 * 1000, -}) - -const linesToRevs = require('./lines-to-revs.js') - -module.exports = async (repo, opts = {}) => { - if (!opts.noGitRevCache) { - const cached = revsCache.get(repo) - if (cached) { - return cached - } - } - - return pinflight(`ls-remote:${repo}`, () => - spawn(['ls-remote', repo], opts) - .then(({ stdout }) => linesToRevs(stdout.trim().split('\n'))) - .then(revs => { - revsCache.set(repo, revs) - return revs - }) - ) -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/spawn.js b/node_modules/pacote/node_modules/@npmcli/git/lib/spawn.js deleted file mode 100644 index 03c1cbde21547..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/spawn.js +++ /dev/null @@ -1,44 +0,0 @@ -const spawn = require('@npmcli/promise-spawn') -const promiseRetry = require('promise-retry') -const { log } = require('proc-log') -const makeError = require('./make-error.js') -const makeOpts = require('./opts.js') - -module.exports = (gitArgs, opts = {}) => { - const whichGit = require('./which.js') - const gitPath = whichGit(opts) - - if (gitPath instanceof Error) { - return Promise.reject(gitPath) - } - - // undocumented option, mostly only here for tests - const args = opts.allowReplace || gitArgs[0] === '--no-replace-objects' - ? gitArgs - : ['--no-replace-objects', ...gitArgs] - - let retryOpts = opts.retry - if (retryOpts === null || retryOpts === undefined) { - retryOpts = { - retries: opts.fetchRetries || 2, - factor: opts.fetchRetryFactor || 10, - maxTimeout: opts.fetchRetryMaxtimeout || 60000, - minTimeout: opts.fetchRetryMintimeout || 1000, - } - } - return promiseRetry((retryFn, number) => { - if (number !== 1) { - log.silly('git', `Retrying git command: ${ - args.join(' ')} attempt # ${number}`) - } - - return spawn(gitPath, args, makeOpts(opts)) - .catch(er => { - const gitError = makeError(er) - if (!gitError.shouldRetry(number)) { - throw gitError - } - retryFn(gitError) - }) - }, retryOpts) -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/utils.js b/node_modules/pacote/node_modules/@npmcli/git/lib/utils.js deleted file mode 100644 index fcd9578a19597..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/utils.js +++ /dev/null @@ -1,3 +0,0 @@ -const isWindows = opts => (opts.fakePlatform || process.platform) === 'win32' - -exports.isWindows = isWindows diff --git a/node_modules/pacote/node_modules/@npmcli/git/lib/which.js b/node_modules/pacote/node_modules/@npmcli/git/lib/which.js deleted file mode 100644 index dc2a1ad212166..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/lib/which.js +++ /dev/null @@ -1,18 +0,0 @@ -const which = require('which') - -let gitPath -try { - gitPath = which.sync('git') -} catch { - // ignore errors -} - -module.exports = (opts = {}) => { - if (opts.git) { - return opts.git - } - if (!gitPath || opts.git === false) { - return Object.assign(new Error('No git binary found in $PATH'), { code: 'ENOGIT' }) - } - return gitPath -} diff --git a/node_modules/pacote/node_modules/@npmcli/git/package.json b/node_modules/pacote/node_modules/@npmcli/git/package.json deleted file mode 100644 index 2bc6730ba2151..0000000000000 --- a/node_modules/pacote/node_modules/@npmcli/git/package.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "name": "@npmcli/git", - "version": "6.0.1", - "main": "lib/index.js", - "files": [ - "bin/", - "lib/" - ], - "description": "a util for spawning git from npm CLI contexts", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/git.git" - }, - "author": "GitHub Inc.", - "license": "ISC", - "scripts": { - "lint": "npm run eslint", - "snap": "tap", - "test": "tap", - "posttest": "npm run lint", - "postlint": "template-oss-check", - "lintfix": "npm run eslint -- --fix", - "template-oss-apply": "template-oss-apply --force", - "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" - }, - "tap": { - "timeout": 600, - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] - }, - "devDependencies": { - "@npmcli/eslint-config": "^5.0.0", - "@npmcli/template-oss": "4.23.3", - "npm-package-arg": "^11.0.0", - "slash": "^3.0.0", - "tap": "^16.0.1" - }, - "dependencies": { - "@npmcli/promise-spawn": "^8.0.0", - "ini": "^5.0.0", - "lru-cache": "^10.0.1", - "npm-pick-manifest": "^10.0.0", - "proc-log": "^5.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^5.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 - } -} diff --git a/package-lock.json b/package-lock.json index 3dfb26af2ab8c..908a5705ac55a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -162,7 +162,7 @@ "devDependencies": { "@npmcli/docs": "^1.0.0", "@npmcli/eslint-config": "^4.0.2", - "@npmcli/git": "^5.0.8", + "@npmcli/git": "^6.0.1", "@npmcli/mock-globals": "^1.0.0", "@npmcli/mock-registry": "^1.0.0", "@npmcli/template-oss": "4.23.3", @@ -1585,140 +1585,24 @@ } }, "node_modules/@npmcli/git": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-5.0.8.tgz", - "integrity": "sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ==", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-6.0.1.tgz", + "integrity": "sha512-BBWMMxeQzalmKadyimwb2/VVQyJB01PH0HhVSNLHNBDZN/M/h/02P6f8fxedIiFhpMj11SO9Ep5tKTBE7zL2nw==", + "inBundle": true, "license": "ISC", "dependencies": { - "@npmcli/promise-spawn": "^7.0.0", - "ini": "^4.1.3", + "@npmcli/promise-spawn": "^8.0.0", + "ini": "^5.0.0", "lru-cache": "^10.0.1", - "npm-pick-manifest": "^9.0.0", - "proc-log": "^4.0.0", + "npm-pick-manifest": "^10.0.0", + "proc-log": "^5.0.0", "promise-inflight": "^1.0.1", "promise-retry": "^2.0.1", "semver": "^7.3.5", - "which": "^4.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/@npmcli/promise-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.2.tgz", - "integrity": "sha512-xhfYPXoV5Dy4UkY0D+v2KkwvnDfiA/8Mt3sWCGI/hM03NsYIH8ZaG6QzS9x7pje5vHZBZJ2v6VRFVTWACnqcmQ==", - "license": "ISC", - "dependencies": { - "which": "^4.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/hosted-git-info": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.2.tgz", - "integrity": "sha512-puUZAUKT5m8Zzvs72XWy3HtvVbTWljRE66cP60bxJzAqf2DgICo7lYTY2IHUmLnNpjYvw5bvmoHvPc0QO2a62w==", - "license": "ISC", - "dependencies": { - "lru-cache": "^10.0.1" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/ini": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", - "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/isexe": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", - "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", - "license": "ISC", - "engines": { - "node": ">=16" - } - }, - "node_modules/@npmcli/git/node_modules/npm-install-checks": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.3.0.tgz", - "integrity": "sha512-W29RiK/xtpCGqn6f3ixfRYGk+zRyr+Ew9F2E20BfXxT5/euLdA/Nm7fO7OeTGuAmTs30cpgInyJ0cYe708YTZw==", - "license": "BSD-2-Clause", - "dependencies": { - "semver": "^7.1.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/npm-package-arg": { - "version": "11.0.3", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-11.0.3.tgz", - "integrity": "sha512-sHGJy8sOC1YraBywpzQlIKBE4pBbGbiF95U6Auspzyem956E0+FtDtsx1ZxlOJkQCZ1AFXAY/yuvtFYrOxF+Bw==", - "license": "ISC", - "dependencies": { - "hosted-git-info": "^7.0.0", - "proc-log": "^4.0.0", - "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/npm-pick-manifest": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-9.1.0.tgz", - "integrity": "sha512-nkc+3pIIhqHVQr085X9d2JzPzLyjzQS96zbruppqC9aZRm/x8xx6xhI98gHtsfELP2bE+loHq8ZaHFHhe+NauA==", - "license": "ISC", - "dependencies": { - "npm-install-checks": "^6.0.0", - "npm-normalize-package-bin": "^3.0.0", - "npm-package-arg": "^11.0.0", - "semver": "^7.3.5" - }, - "engines": { - "node": "^16.14.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/proc-log": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz", - "integrity": "sha512-g8+OnU/L2v+wyiVK+D5fA34J7EH8jZ8DDlvwhRCMxmMj7UCBvxiO1mGeN+36JXIKF4zevU4kRBd8lVgG9vLelA==", - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/validate-npm-package-name": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.1.tgz", - "integrity": "sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==", - "license": "ISC", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/@npmcli/git/node_modules/which": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", - "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", - "license": "ISC", - "dependencies": { - "isexe": "^3.1.1" - }, - "bin": { - "node-which": "bin/which.js" + "which": "^5.0.0" }, "engines": { - "node": "^16.13.0 || >=18.0.0" + "node": "^18.17.0 || >=20.5.0" } }, "node_modules/@npmcli/installed-package-contents": { @@ -1807,6 +1691,26 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/git": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-5.0.8.tgz", + "integrity": "sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ==", + "license": "ISC", + "dependencies": { + "@npmcli/promise-spawn": "^7.0.0", + "ini": "^4.1.3", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", + "proc-log": "^4.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@npmcli/metavuln-calculator/node_modules/@npmcli/package-json": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.2.1.tgz", @@ -1898,6 +1802,15 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/metavuln-calculator/node_modules/ini": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ini/-/ini-4.1.3.tgz", + "integrity": "sha512-X7rqawQBvfdjS10YU1y1YVreA3SsLrW9dX2CewP2EbBJM4ypVNLDkO5y04gejPwKIY9lR+7r9gn3rFPt/kmWFg==", + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@npmcli/metavuln-calculator/node_modules/isexe": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", @@ -2159,27 +2072,6 @@ "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/@npmcli/package-json/node_modules/@npmcli/git": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-6.0.1.tgz", - "integrity": "sha512-BBWMMxeQzalmKadyimwb2/VVQyJB01PH0HhVSNLHNBDZN/M/h/02P6f8fxedIiFhpMj11SO9Ep5tKTBE7zL2nw==", - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/promise-spawn": "^8.0.0", - "ini": "^5.0.0", - "lru-cache": "^10.0.1", - "npm-pick-manifest": "^10.0.0", - "proc-log": "^5.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^5.0.0" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, "node_modules/@npmcli/promise-spawn": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-8.0.1.tgz", @@ -2296,6 +2188,27 @@ "node": "^18.17.0 || >=20.5.0" } }, + "node_modules/@npmcli/template-oss/node_modules/@npmcli/git": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-5.0.8.tgz", + "integrity": "sha512-liASfw5cqhjNW9UFd+ruwwdEf/lbOAQjLL2XY2dFW/bkJheXDYZgOyul/4gVvEV4BWkTXjYGmDqMw9uegdbJNQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "@npmcli/promise-spawn": "^7.0.0", + "ini": "^4.1.3", + "lru-cache": "^10.0.1", + "npm-pick-manifest": "^9.0.0", + "proc-log": "^4.0.0", + "promise-inflight": "^1.0.1", + "promise-retry": "^2.0.1", + "semver": "^7.3.5", + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@npmcli/template-oss/node_modules/@npmcli/map-workspaces": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@npmcli/map-workspaces/-/map-workspaces-3.0.6.tgz", @@ -2331,6 +2244,19 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/template-oss/node_modules/@npmcli/promise-spawn": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@npmcli/promise-spawn/-/promise-spawn-7.0.2.tgz", + "integrity": "sha512-xhfYPXoV5Dy4UkY0D+v2KkwvnDfiA/8Mt3sWCGI/hM03NsYIH8ZaG6QzS9x7pje5vHZBZJ2v6VRFVTWACnqcmQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "which": "^4.0.0" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@npmcli/template-oss/node_modules/hosted-git-info": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-7.0.2.tgz", @@ -2354,6 +2280,16 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@npmcli/template-oss/node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16" + } + }, "node_modules/@npmcli/template-oss/node_modules/json-parse-even-better-errors": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-3.0.2.tgz", @@ -2379,6 +2315,19 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/template-oss/node_modules/npm-install-checks": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-6.3.0.tgz", + "integrity": "sha512-W29RiK/xtpCGqn6f3ixfRYGk+zRyr+Ew9F2E20BfXxT5/euLdA/Nm7fO7OeTGuAmTs30cpgInyJ0cYe708YTZw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "semver": "^7.1.1" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/@npmcli/template-oss/node_modules/npm-package-arg": { "version": "11.0.3", "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-11.0.3.tgz", @@ -2395,6 +2344,22 @@ "node": "^16.14.0 || >=18.0.0" } }, + "node_modules/@npmcli/template-oss/node_modules/npm-pick-manifest": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-9.1.0.tgz", + "integrity": "sha512-nkc+3pIIhqHVQr085X9d2JzPzLyjzQS96zbruppqC9aZRm/x8xx6xhI98gHtsfELP2bE+loHq8ZaHFHhe+NauA==", + "dev": true, + "license": "ISC", + "dependencies": { + "npm-install-checks": "^6.0.0", + "npm-normalize-package-bin": "^3.0.0", + "npm-package-arg": "^11.0.0", + "semver": "^7.3.5" + }, + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/@npmcli/template-oss/node_modules/proc-log": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz", @@ -2415,6 +2380,22 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/@npmcli/template-oss/node_modules/which": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/which/-/which-4.0.0.tgz", + "integrity": "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^3.1.1" + }, + "bin": { + "node-which": "bin/which.js" + }, + "engines": { + "node": "^16.13.0 || >=18.0.0" + } + }, "node_modules/@octokit/auth-token": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.4.tgz", @@ -11267,27 +11248,6 @@ "node": "^18.17.0 || >=20.5.0" } }, - "node_modules/pacote/node_modules/@npmcli/git": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/@npmcli/git/-/git-6.0.1.tgz", - "integrity": "sha512-BBWMMxeQzalmKadyimwb2/VVQyJB01PH0HhVSNLHNBDZN/M/h/02P6f8fxedIiFhpMj11SO9Ep5tKTBE7zL2nw==", - "inBundle": true, - "license": "ISC", - "dependencies": { - "@npmcli/promise-spawn": "^8.0.0", - "ini": "^5.0.0", - "lru-cache": "^10.0.1", - "npm-pick-manifest": "^10.0.0", - "proc-log": "^5.0.0", - "promise-inflight": "^1.0.1", - "promise-retry": "^2.0.1", - "semver": "^7.3.5", - "which": "^5.0.0" - }, - "engines": { - "node": "^18.17.0 || >=20.5.0" - } - }, "node_modules/pacote/node_modules/@npmcli/installed-package-contents": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@npmcli/installed-package-contents/-/installed-package-contents-3.0.0.tgz", @@ -17357,7 +17317,7 @@ "version": "6.0.3", "license": "ISC", "dependencies": { - "@npmcli/git": "^5.0.7", + "@npmcli/git": "^6.0.1", "@npmcli/run-script": "^9.0.1", "json-parse-even-better-errors": "^4.0.0", "proc-log": "^5.0.0", diff --git a/package.json b/package.json index bedda07e3a311..2cebd74f9a7c5 100644 --- a/package.json +++ b/package.json @@ -193,7 +193,7 @@ "devDependencies": { "@npmcli/docs": "^1.0.0", "@npmcli/eslint-config": "^4.0.2", - "@npmcli/git": "^5.0.8", + "@npmcli/git": "^6.0.1", "@npmcli/mock-globals": "^1.0.0", "@npmcli/mock-registry": "^1.0.0", "@npmcli/template-oss": "4.23.3", diff --git a/workspaces/libnpmversion/package.json b/workspaces/libnpmversion/package.json index 1b044f42fb6bf..c1ba95d928e7b 100644 --- a/workspaces/libnpmversion/package.json +++ b/workspaces/libnpmversion/package.json @@ -38,7 +38,7 @@ "tap": "^16.3.8" }, "dependencies": { - "@npmcli/git": "^5.0.7", + "@npmcli/git": "^6.0.1", "@npmcli/run-script": "^9.0.1", "json-parse-even-better-errors": "^4.0.0", "proc-log": "^5.0.0",