diff --git a/node_modules/.gitignore b/node_modules/.gitignore index 46fb60f2516f1..73e6061171200 100644 --- a/node_modules/.gitignore +++ b/node_modules/.gitignore @@ -101,6 +101,7 @@ !/https-proxy-agent !/humanize-ms !/iconv-lite +!/ignore-walk !/imurmurhash !/indent-string !/infer-owner @@ -164,6 +165,10 @@ !/npm-install-checks !/npm-normalize-package-bin !/npm-package-arg +!/npm-packlist +!/npm-packlist/node_modules/ +/npm-packlist/node_modules/* +!/npm-packlist/node_modules/npm-normalize-package-bin !/npm-pick-manifest !/npm-pick-manifest/node_modules/ /npm-pick-manifest/node_modules/* @@ -176,11 +181,6 @@ !/opener !/p-map !/pacote -!/pacote/node_modules/ -/pacote/node_modules/* -!/pacote/node_modules/ignore-walk -!/pacote/node_modules/npm-normalize-package-bin -!/pacote/node_modules/npm-packlist !/parse-conflict-json !/path-is-absolute !/postcss-selector-parser diff --git a/node_modules/pacote/node_modules/ignore-walk/LICENSE b/node_modules/ignore-walk/LICENSE similarity index 100% rename from node_modules/pacote/node_modules/ignore-walk/LICENSE rename to node_modules/ignore-walk/LICENSE diff --git a/node_modules/pacote/node_modules/ignore-walk/lib/index.js b/node_modules/ignore-walk/lib/index.js similarity index 100% rename from node_modules/pacote/node_modules/ignore-walk/lib/index.js rename to node_modules/ignore-walk/lib/index.js diff --git a/node_modules/pacote/node_modules/ignore-walk/package.json b/node_modules/ignore-walk/package.json similarity index 100% rename from node_modules/pacote/node_modules/ignore-walk/package.json rename to node_modules/ignore-walk/package.json diff --git a/node_modules/pacote/node_modules/npm-packlist/LICENSE b/node_modules/npm-packlist/LICENSE similarity index 100% rename from node_modules/pacote/node_modules/npm-packlist/LICENSE rename to node_modules/npm-packlist/LICENSE diff --git a/node_modules/pacote/node_modules/npm-packlist/bin/index.js b/node_modules/npm-packlist/bin/index.js similarity index 100% rename from node_modules/pacote/node_modules/npm-packlist/bin/index.js rename to node_modules/npm-packlist/bin/index.js diff --git a/node_modules/pacote/node_modules/npm-packlist/lib/index.js b/node_modules/npm-packlist/lib/index.js similarity index 100% rename from node_modules/pacote/node_modules/npm-packlist/lib/index.js rename to node_modules/npm-packlist/lib/index.js diff --git a/node_modules/pacote/node_modules/npm-normalize-package-bin/LICENSE b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/LICENSE similarity index 100% rename from node_modules/pacote/node_modules/npm-normalize-package-bin/LICENSE rename to node_modules/npm-packlist/node_modules/npm-normalize-package-bin/LICENSE diff --git a/node_modules/pacote/node_modules/npm-normalize-package-bin/lib/index.js b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/lib/index.js similarity index 100% rename from node_modules/pacote/node_modules/npm-normalize-package-bin/lib/index.js rename to node_modules/npm-packlist/node_modules/npm-normalize-package-bin/lib/index.js diff --git a/node_modules/pacote/node_modules/npm-normalize-package-bin/package.json b/node_modules/npm-packlist/node_modules/npm-normalize-package-bin/package.json similarity index 100% rename from node_modules/pacote/node_modules/npm-normalize-package-bin/package.json rename to node_modules/npm-packlist/node_modules/npm-normalize-package-bin/package.json diff --git a/node_modules/pacote/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json similarity index 100% rename from node_modules/pacote/node_modules/npm-packlist/package.json rename to node_modules/npm-packlist/package.json diff --git a/package-lock.json b/package-lock.json index a408722e9c829..77ac6423ee1c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -175,7 +175,7 @@ "@npmcli/template-oss": "4.7.1", "licensee": "^8.2.0", "nock": "^13.2.4", - "npm-packlist": "^7.0.1", + "npm-packlist": "^5.1.3", "spawk": "^1.7.1", "tap": "^16.0.1" }, @@ -208,17 +208,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "docs/node_modules/ignore-walk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", - "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", - "dependencies": { - "minimatch": "^5.0.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/@actions/core": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", @@ -6138,15 +6127,15 @@ } }, "node_modules/ignore-walk": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-6.0.0.tgz", - "integrity": "sha512-bTf9UWe/UP1yxG3QUrj/KOvEhTAUWPcv+WvbFZ28LcqznXabp7Xu6o9y1JEC18+oqODuS7VhTpekV5XvFwsxJg==", - "dev": true, + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", + "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", + "inBundle": true, "dependencies": { "minimatch": "^5.0.1" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/import-fresh": { @@ -8031,15 +8020,30 @@ } }, "node_modules/npm-packlist": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.1.tgz", - "integrity": "sha512-XddbYutimy7hdmP7S1tHMjFwghn64lvgdnhYG0KLGFBWjEvMt1/jg95OR3vPNNCjkakHS+k4a//3XOO8JOGI2A==", - "dev": true, + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.3.tgz", + "integrity": "sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==", + "inBundle": true, "dependencies": { - "ignore-walk": "^6.0.0" + "glob": "^8.0.1", + "ignore-walk": "^5.0.1", + "npm-bundled": "^2.0.0", + "npm-normalize-package-bin": "^2.0.0" + }, + "bin": { + "npm-packlist": "bin/index.js" }, "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/npm-packlist/node_modules/npm-normalize-package-bin": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", + "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", + "inBundle": true, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, "node_modules/npm-pick-manifest": { @@ -8609,45 +8613,6 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/pacote/node_modules/ignore-walk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", - "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", - "inBundle": true, - "dependencies": { - "minimatch": "^5.0.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/pacote/node_modules/npm-normalize-package-bin": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-2.0.0.tgz", - "integrity": "sha512-awzfKUO7v0FscrSpRoogyNm0sajikhBWpU0QMrW09AMi9n1PoKU6WaIqUzuJSQnpciZZmJ/jMZ2Egfmb/9LiWQ==", - "inBundle": true, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/pacote/node_modules/npm-packlist": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.3.tgz", - "integrity": "sha512-263/0NGrn32YFYi4J533qzrQ/krmmrWwhKkzwTuM4f/07ug51odoaNjUexxO4vxlzURHcmYMH1QjvHjsNDKLVg==", - "inBundle": true, - "dependencies": { - "glob": "^8.0.1", - "ignore-walk": "^5.0.1", - "npm-bundled": "^2.0.0", - "npm-normalize-package-bin": "^2.0.0" - }, - "bin": { - "npm-packlist": "bin/index.js" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", diff --git a/package.json b/package.json index 3c4ee7decff03..0f3e63abd7921 100644 --- a/package.json +++ b/package.json @@ -212,7 +212,7 @@ "@npmcli/template-oss": "4.7.1", "licensee": "^8.2.0", "nock": "^13.2.4", - "npm-packlist": "^7.0.1", + "npm-packlist": "^5.1.3", "spawk": "^1.7.1", "tap": "^16.0.1" }, diff --git a/scripts/create-node-pr.js b/scripts/create-node-pr.js index 26d4c07a793e6..0bde6d755f059 100644 --- a/scripts/create-node-pr.js +++ b/scripts/create-node-pr.js @@ -1,11 +1,10 @@ const { join } = require('path') -const fsp = require('fs/promises') const hgi = require('hosted-git-info') const semver = require('semver') const pacote = require('pacote') const log = require('proc-log') const tar = require('tar') -const { cp, withTempDir } = require('@npmcli/fs') +const { cp, withTempDir, access, constants } = require('@npmcli/fs') const { CWD, run, spawn, git, fs, gh } = require('./util.js') // this script expects node to already be cloned to a directory at the cli root named "node" @@ -65,7 +64,7 @@ const main = async (spec, opts) => withTempDir(CWD, async (tmpDir) => { tag: skipCheckout ? null : head.tag, }) - await fsp.access(NODE_DIR, fsp.constants.F_OK).catch(() => { + await access(NODE_DIR, constants.F_OK).catch(() => { throw new Error(`node repo must be checked out to \`${NODE_DIR}\` to continue`) }) diff --git a/scripts/publish.js b/scripts/publish.js index 9f79ec6a4ca0b..536c5d764371f 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -84,7 +84,7 @@ const main = async (opts) => { await npm('run', 'test-all', '--ignore-scripts') } - await npm('prune', '--omit-dev', '--no-save', '--no-audit', '--no-fund') + await npm('prune', '--omit=dev', '--no-save', '--no-audit', '--no-fund') await git.dirty() for (const p of publishes) { diff --git a/scripts/util.js b/scripts/util.js index 91611bcf91be2..a1c75a736ec26 100644 --- a/scripts/util.js +++ b/scripts/util.js @@ -1,4 +1,4 @@ -const fsp = require('fs/promises') +const fsp = require('@npmcli/fs') const { resolve, join, relative } = require('path') const { formatWithOptions } = require('util') const log = require('proc-log') @@ -73,14 +73,14 @@ const spawn = async (cmd, ...allArgs) => { log.info('suppressed error', err.message) } - if (res?.stdout) { + if (res && res.stdout) { res.stdout = res.stdout.toString().trim() if (res.stdout) { log.silly('stdout', res.stdout) } } - if (res?.stderr) { + if (res && res.stderr) { res.stderr = res.stderr.toString().trim() if (res.stderr) { log.silly('stderr', res.stderr) @@ -88,14 +88,14 @@ const spawn = async (cmd, ...allArgs) => { } if (lines) { - return (res?.stdout || '') + return ((res && res.stdout) || '') .split('\n') .map(l => l.trim()) .filter(Boolean) } if (out) { - return res?.stdout || '' + return (res && res.stdout) || '' } return res diff --git a/test/lib/docs.js b/test/lib/docs.js index 0a913c4357ee2..94d63ca430865 100644 --- a/test/lib/docs.js +++ b/test/lib/docs.js @@ -1,6 +1,6 @@ const t = require('tap') const { join, resolve, basename, extname, dirname } = require('path') -const fs = require('fs/promises') +const fs = require('fs').promises const localeCompare = require('@isaacs/string-locale-compare')('en') const docs = require('@npmcli/docs')