Skip to content

Commit 4a6177d

Browse files
npm-cli-botruyadorno
authored andcommitted
deps: upgrade npm to 9.7.2
PR-URL: #48514 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
1 parent 104b58f commit 4a6177d

File tree

298 files changed

+5385
-16299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

298 files changed

+5385
-16299
lines changed

deps/npm/bin/node-gyp-bin/node-gyp

-6
This file was deleted.

deps/npm/bin/node-gyp-bin/node-gyp.cmd

-5
This file was deleted.

deps/npm/bin/npm

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env bash
2+
3+
# This is used by the Node.js installer, which expects the cygwin/mingw
4+
# shell script to already be present in the npm dependency folder.
5+
26
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
37

48
basedir=`dirname "$0"`
@@ -19,7 +23,6 @@ fi
1923
# kind of paths Node.js thinks it's using, typically win32 paths.
2024
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)')"
2125
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
22-
2326
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
2427
if [ $? -ne 0 ]; then
2528
# if this didn't work, then everything else below will fail

deps/npm/bin/npx

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,17 @@ if ! [ -x "$NODE_EXE" ]; then
1919
NODE_EXE=node
2020
fi
2121

22-
# these paths are passed to node.exe, so they need to match whatever
22+
# this path is passed to node.exe, so it needs to match whatever
2323
# kind of paths Node.js thinks it's using, typically win32 paths.
2424
CLI_BASEDIR="$("$NODE_EXE" -p 'require("path").dirname(process.execPath)')"
25+
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
26+
NPX_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npx-cli.js"
27+
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
2528
if [ $? -ne 0 ]; then
2629
# if this didn't work, then everything else below will fail
2730
echo "Could not determine Node.js install directory" >&2
2831
exit 1
2932
fi
30-
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
31-
NPX_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npx-cli.js"
32-
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
3333
NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js"
3434

3535
# a path that will fail -f test on any posix bash

deps/npm/bin/npx-cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const removed = new Set([
2424
...removedOpts,
2525
])
2626

27-
const { definitions, shorthands } = require('../lib/utils/config/index.js')
27+
const { definitions, shorthands } = require('@npmcli/config/lib/definitions')
2828
const npmSwitches = Object.entries(definitions)
2929
.filter(([key, { type }]) => type === Boolean ||
3030
(Array.isArray(type) && type.includes(Boolean)))

deps/npm/docs/content/commands/npm-install-test.md

+16
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,22 @@ will also prevent _writing_ `package-lock.json` if `save` is true.
160160

161161

162162

163+
#### `package-lock-only`
164+
165+
* Default: false
166+
* Type: Boolean
167+
168+
If set to true, the current operation will only use the `package-lock.json`,
169+
ignoring `node_modules`.
170+
171+
For `update` this means only the `package-lock.json` will be updated,
172+
instead of checking `node_modules` and downloading dependencies.
173+
174+
For `list` this means the output will be based on the tree described by the
175+
`package-lock.json`, rather than the contents of `node_modules`.
176+
177+
178+
163179
#### `foreground-scripts`
164180

165181
* Default: false

deps/npm/docs/content/commands/npm-install.md

+16
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,22 @@ will also prevent _writing_ `package-lock.json` if `save` is true.
550550
551551
552552
553+
#### `package-lock-only`
554+
555+
* Default: false
556+
* Type: Boolean
557+
558+
If set to true, the current operation will only use the `package-lock.json`,
559+
ignoring `node_modules`.
560+
561+
For `update` this means only the `package-lock.json` will be updated,
562+
instead of checking `node_modules` and downloading dependencies.
563+
564+
For `list` this means the output will be based on the tree described by the
565+
`package-lock.json`, rather than the contents of `node_modules`.
566+
567+
568+
553569
#### `foreground-scripts`
554570
555571
* Default: false

deps/npm/docs/content/commands/npm-ls.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
2727
example, running `npm ls promzard` in npm's source tree will show:
2828

2929
```bash
30-
npm@9.7.1 /path/to/npm
30+
npm@9.7.2 /path/to/npm
3131
└─┬ init-package-json@0.0.4
3232
└── promzard@0.1.5
3333
```

deps/npm/docs/content/commands/npm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.
1414

1515
### Version
1616

17-
9.7.1
17+
9.7.2
1818

1919
### Description
2020

deps/npm/docs/content/configuring-npm/package-json.md

-3
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,6 @@ it will. The `.npmignore` file works just like a `.gitignore`. If there is
279279
a `.gitignore` file, and `.npmignore` is missing, `.gitignore`'s contents
280280
will be used instead.
281281

282-
Files included with the "package.json#files" field _cannot_ be excluded
283-
through `.npmignore` or `.gitignore`.
284-
285282
Certain files are always included, regardless of settings:
286283

287284
* `package.json`

deps/npm/docs/output/commands/npm-install-test.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <h1 id="npm-install-test">npm-install-test</h1>
142142

143143
<section id="table_of_contents">
144144
<h2 id="table-of-contents">Table of contents</h2>
145-
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
145+
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
146146
</section>
147147

148148
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -259,6 +259,17 @@ <h4 id="package-lock"><code>package-lock</code></h4>
259259
</ul>
260260
<p>If set to false, then ignore <code>package-lock.json</code> files when installing. This
261261
will also prevent <em>writing</em> <code>package-lock.json</code> if <code>save</code> is true.</p>
262+
<h4 id="package-lock-only"><code>package-lock-only</code></h4>
263+
<ul>
264+
<li>Default: false</li>
265+
<li>Type: Boolean</li>
266+
</ul>
267+
<p>If set to true, the current operation will only use the <code>package-lock.json</code>,
268+
ignoring <code>node_modules</code>.</p>
269+
<p>For <code>update</code> this means only the <code>package-lock.json</code> will be updated,
270+
instead of checking <code>node_modules</code> and downloading dependencies.</p>
271+
<p>For <code>list</code> this means the output will be based on the tree described by the
272+
<code>package-lock.json</code>, rather than the contents of <code>node_modules</code>.</p>
262273
<h4 id="foreground-scripts"><code>foreground-scripts</code></h4>
263274
<ul>
264275
<li>Default: false</li>

deps/npm/docs/output/commands/npm-install.html

+12-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <h1 id="npm-install">npm-install</h1>
142142

143143
<section id="table_of_contents">
144144
<h2 id="table-of-contents">Table of contents</h2>
145-
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#algorithm">Algorithm</a></li><li><a href="#see-also">See Also</a></li></ul></div>
145+
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#save"><code>save</code></a></li><li><a href="#save-exact"><code>save-exact</code></a></li><li><a href="#global"><code>global</code></a></li><li><a href="#install-strategy"><code>install-strategy</code></a></li><li><a href="#legacy-bundling"><code>legacy-bundling</code></a></li><li><a href="#global-style"><code>global-style</code></a></li><li><a href="#omit"><code>omit</code></a></li><li><a href="#strict-peer-deps"><code>strict-peer-deps</code></a></li><li><a href="#prefer-dedupe"><code>prefer-dedupe</code></a></li><li><a href="#package-lock"><code>package-lock</code></a></li><li><a href="#package-lock-only"><code>package-lock-only</code></a></li><li><a href="#foreground-scripts"><code>foreground-scripts</code></a></li><li><a href="#ignore-scripts"><code>ignore-scripts</code></a></li><li><a href="#audit"><code>audit</code></a></li><li><a href="#bin-links"><code>bin-links</code></a></li><li><a href="#fund"><code>fund</code></a></li><li><a href="#dry-run"><code>dry-run</code></a></li><li><a href="#workspace"><code>workspace</code></a></li><li><a href="#workspaces"><code>workspaces</code></a></li><li><a href="#include-workspace-root"><code>include-workspace-root</code></a></li><li><a href="#install-links"><code>install-links</code></a></li></ul><li><a href="#algorithm">Algorithm</a></li><li><a href="#see-also">See Also</a></li></ul></div>
146146
</section>
147147

148148
<div id="_content"><h3 id="synopsis">Synopsis</h3>
@@ -585,6 +585,17 @@ <h4 id="package-lock"><code>package-lock</code></h4>
585585
</ul>
586586
<p>If set to false, then ignore <code>package-lock.json</code> files when installing. This
587587
will also prevent <em>writing</em> <code>package-lock.json</code> if <code>save</code> is true.</p>
588+
<h4 id="package-lock-only"><code>package-lock-only</code></h4>
589+
<ul>
590+
<li>Default: false</li>
591+
<li>Type: Boolean</li>
592+
</ul>
593+
<p>If set to true, the current operation will only use the <code>package-lock.json</code>,
594+
ignoring <code>node_modules</code>.</p>
595+
<p>For <code>update</code> this means only the <code>package-lock.json</code> will be updated,
596+
instead of checking <code>node_modules</code> and downloading dependencies.</p>
597+
<p>For <code>list</code> this means the output will be based on the tree described by the
598+
<code>package-lock.json</code>, rather than the contents of <code>node_modules</code>.</p>
588599
<h4 id="foreground-scripts"><code>foreground-scripts</code></h4>
589600
<ul>
590601
<li>Default: false</li>

deps/npm/docs/output/commands/npm-ls.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
160160
the results to only the paths to the packages named. Note that nested
161161
packages will <em>also</em> show the paths to the specified packages. For
162162
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
163-
<pre><code class="language-bash">npm@9.7.1 /path/to/npm
163+
<pre><code class="language-bash">npm@9.7.2 /path/to/npm
164164
└─┬ init-package-json@0.0.4
165165
└── promzard@0.1.5
166166
</code></pre>

deps/npm/docs/output/commands/npm.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
150150
</code></pre>
151151
<p>Note: This command is unaware of workspaces.</p>
152152
<h3 id="version">Version</h3>
153-
<p>9.7.1</p>
153+
<p>9.7.2</p>
154154
<h3 id="description">Description</h3>
155155
<p>npm is the package manager for the Node JavaScript platform. It puts
156156
modules in place so that node can find them, and manages dependency

deps/npm/docs/output/configuring-npm/package-json.html

-2
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,6 @@ <h3 id="files">files</h3>
353353
it will. The <code>.npmignore</code> file works just like a <code>.gitignore</code>. If there is
354354
a <code>.gitignore</code> file, and <code>.npmignore</code> is missing, <code>.gitignore</code>'s contents
355355
will be used instead.</p>
356-
<p>Files included with the "package.json#files" field <em>cannot</em> be excluded
357-
through <code>.npmignore</code> or <code>.gitignore</code>.</p>
358356
<p>Certain files are always included, regardless of settings:</p>
359357
<ul>
360358
<li><code>package.json</code></li>

deps/npm/lib/base-command.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const { relative } = require('path')
44

5-
const definitions = require('./utils/config/definitions.js')
5+
const { definitions } = require('@npmcli/config/lib/definitions')
66
const getWorkspaces = require('./workspaces/get-workspaces.js')
77
const { aliases: cmdAliases } = require('./utils/cmd-list')
88

deps/npm/lib/commands/completion.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const nopt = require('nopt')
3434
const { resolve } = require('path')
3535

3636
const Npm = require('../npm.js')
37-
const { definitions, shorthands } = require('../utils/config/index.js')
37+
const { definitions, shorthands } = require('@npmcli/config/lib/definitions')
3838
const { commands, aliases, deref } = require('../utils/cmd-list.js')
3939
const configNames = Object.keys(definitions)
4040
const shorthandNames = Object.keys(shorthands)

deps/npm/lib/commands/config.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
// don't expand so that we only assemble the set of defaults when needed
2-
const configDefs = require('../utils/config/index.js')
3-
41
const { mkdir, readFile, writeFile } = require('fs/promises')
52
const { dirname, resolve } = require('path')
63
const { spawn } = require('child_process')
74
const { EOL } = require('os')
85
const ini = require('ini')
96
const localeCompare = require('@isaacs/string-locale-compare')('en')
107
const pkgJson = require('@npmcli/package-json')
8+
const { defaults, definitions } = require('@npmcli/config/lib/definitions')
119
const log = require('../utils/log-shim.js')
1210

1311
// These are the configs that we can nerf-dart. Not all of them currently even
@@ -102,7 +100,7 @@ class Config extends BaseCommand {
102100
case 'get':
103101
case 'delete':
104102
case 'rm':
105-
return Object.keys(configDefs.definitions)
103+
return Object.keys(definitions)
106104
case 'edit':
107105
case 'list':
108106
case 'ls':
@@ -219,7 +217,7 @@ class Config extends BaseCommand {
219217
const data = (
220218
await readFile(file, 'utf8').catch(() => '')
221219
).replace(/\r\n/g, '\n')
222-
const entries = Object.entries(configDefs.defaults)
220+
const entries = Object.entries(defaults)
223221
const defData = entries.reduce((str, [key, val]) => {
224222
const obj = { [key]: val }
225223
const i = ini.stringify(obj)

deps/npm/lib/commands/doctor.js

+17-9
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ const semver = require('semver')
99
const { promisify } = require('util')
1010
const log = require('../utils/log-shim.js')
1111
const ping = require('../utils/ping.js')
12-
const {
13-
registry: { default: defaultRegistry },
14-
} = require('../utils/config/definitions.js')
12+
const { defaults } = require('@npmcli/config/lib/definitions')
1513
const lstat = promisify(fs.lstat)
1614
const readdir = promisify(fs.readdir)
1715
const access = promisify(fs.access)
@@ -364,16 +362,17 @@ class Doctor extends BaseCommand {
364362
}
365363

366364
async checkNpmRegistry () {
367-
if (this.npm.flatOptions.registry !== defaultRegistry) {
368-
throw `Try \`npm config set registry=${defaultRegistry}\``
365+
if (this.npm.flatOptions.registry !== defaults.registry) {
366+
throw `Try \`npm config set registry=${defaults.registry}\``
369367
} else {
370-
return `using default registry (${defaultRegistry})`
368+
return `using default registry (${defaults.registry})`
371369
}
372370
}
373371

374372
output (row) {
375373
const t = new Table({
376-
chars: { top: '',
374+
chars: {
375+
top: '',
377376
'top-mid': '',
378377
'top-left': '',
379378
'top-right': '',
@@ -387,8 +386,17 @@ class Doctor extends BaseCommand {
387386
'mid-mid': '',
388387
right: '',
389388
'right-mid': '',
390-
middle: ' ' },
391-
style: { 'padding-left': 0, 'padding-right': 0 },
389+
middle: ' ',
390+
},
391+
style: {
392+
'padding-left': 0,
393+
'padding-right': 0,
394+
// setting border here is not necessary visually since we've already
395+
// zeroed out all the chars above, but without it cli-table3 will wrap
396+
// some of the separator spaces with ansi codes which show up in
397+
// snapshots.
398+
border: 0,
399+
},
392400
colWidths: [this.#checkWidth, 6],
393401
})
394402
t.push(row)

deps/npm/lib/commands/install.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ class Install extends ArboristWorkspaceCmd {
2727
'strict-peer-deps',
2828
'prefer-dedupe',
2929
'package-lock',
30+
'package-lock-only',
3031
'foreground-scripts',
3132
'ignore-scripts',
3233
'audit',

deps/npm/lib/commands/publish.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { getContents, logTar } = require('../utils/tar.js')
1515
// keys that npm supports in .npmrc files and elsewhere. We *may* want to
1616
// revisit this at some point, and have a minimal set that's a SemVer-major
1717
// change that ought to get a RFC written on it.
18-
const { flatten } = require('../utils/config/index.js')
18+
const { flatten } = require('@npmcli/config/lib/definitions')
1919
const pkgJson = require('@npmcli/package-json')
2020

2121
const BaseCommand = require('../base-command.js')

deps/npm/lib/commands/unpublish.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const npa = require('npm-package-arg')
44
const npmFetch = require('npm-registry-fetch')
55
const pkgJson = require('@npmcli/package-json')
66

7-
const { flatten } = require('../utils/config/index.js')
7+
const { flatten } = require('@npmcli/config/lib/definitions')
88
const getIdentity = require('../utils/get-identity.js')
99
const log = require('../utils/log-shim')
1010
const otplease = require('../utils/otplease.js')

deps/npm/lib/es6/validate-engines.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { engines: { node: engines }, version } = require('../../package.json')
99
const npm = `v${version}`
1010

1111
module.exports = (process, getCli) => {
12-
const node = process.version.replace(/-.*$/, '')
12+
const node = process.version
1313

1414
/* eslint-disable-next-line max-len */
1515
const unsupportedMessage = `npm ${npm} does not support Node.js ${node}. This version of npm supports the following node versions: \`${engines}\`. You can find the latest version at https://nodejs.org/.`

0 commit comments

Comments
 (0)