Skip to content

Commit ad86a12

Browse files
authored
deps: upgrade npm to 10.5.1
PR-URL: #52351 Reviewed-By: Luke Karrys <luke@lukekarrys.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 893e2cf commit ad86a12

File tree

219 files changed

+1600
-1081
lines changed

Some content is hidden

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

219 files changed

+1600
-1081
lines changed

deps/npm/bin/npm

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ if [ $? -ne 0 ]; then
4141
fi
4242
no_node_dir
4343
fi
44+
NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js"
4445
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
45-
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
46+
NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"`
4647
if [ $? -ne 0 ]; then
4748
no_node_dir
4849
fi

deps/npm/bin/npm-prefix.js

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env node
2+
// This is a single-use bin to help windows discover the proper prefix for npm
3+
// without having to load all of npm first
4+
// It does not accept argv params
5+
6+
const path = require('path')
7+
const Config = require('@npmcli/config')
8+
const { definitions, flatten, shorthands } = require('@npmcli/config/lib/definitions')
9+
const config = new Config({
10+
npmPath: path.dirname(__dirname),
11+
// argv is explicitly not looked at since prefix is not something that can be changed via argv
12+
argv: [],
13+
definitions,
14+
flatten,
15+
shorthands,
16+
excludeNpmCwd: false,
17+
})
18+
19+
async function main () {
20+
try {
21+
await config.load()
22+
// eslint-disable-next-line no-console
23+
console.log(config.globalPrefix)
24+
} catch (err) {
25+
// eslint-disable-next-line no-console
26+
console.error(err)
27+
process.exit(1)
28+
}
29+
}
30+
main()

deps/npm/bin/npm.cmd

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ IF NOT EXIST "%NODE_EXE%" (
88
SET "NODE_EXE=node"
99
)
1010

11+
SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js"
1112
SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js"
12-
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO (
13+
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO (
1314
SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js"
1415
)
1516
IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" (

deps/npm/bin/npm.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if ($nodebin -eq $null) {
1717
}
1818
$nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path
1919

20-
$npmclijs="$nodedir/node_modules/npm/bin/npm-cli.js"
21-
$npmprefix=(& $nodeexe $npmclijs prefix -g)
20+
$npmprefixjs="$nodedir/node_modules/npm/bin/npm-prefix.js"
21+
$npmprefix=(& $nodeexe $npmprefixjs)
2222
if ($LASTEXITCODE -ne 0) {
2323
Write-Host "Could not determine Node.js install directory"
2424
exit 1

deps/npm/bin/npx

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ if [ $? -ne 0 ]; then
4141
fi
4242
no_node_dir
4343
fi
44-
NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js"
44+
NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js"
4545
NPX_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npx-cli.js"
46-
NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g`
46+
NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"`
4747
if [ $? -ne 0 ]; then
4848
no_node_dir
4949
fi

deps/npm/bin/npx.cmd

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ IF NOT EXIST "%NODE_EXE%" (
88
SET "NODE_EXE=node"
99
)
1010

11-
SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js"
11+
SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js"
1212
SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js"
13-
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO (
13+
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO (
1414
SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js"
1515
)
1616
IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" (

deps/npm/bin/npx.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ if ($nodebin -eq $null) {
1717
}
1818
$nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path
1919

20-
$npmclijs="$nodedir/node_modules/npm/bin/npm-cli.js"
21-
$npmprefix=(& $nodeexe $npmclijs prefix -g)
20+
$npmprefixjs="$nodedir/node_modules/npm/bin/npm-prefix.js"
21+
$npmprefix=(& $nodeexe $npmprefixjs)
2222
if ($LASTEXITCODE -ne 0) {
2323
Write-Host "Could not determine Node.js install directory"
2424
exit 1

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ Registry signatures can be verified using the following `audit` command:
4949
$ npm audit signatures
5050
```
5151

52+
The `audit signatures` command will also verify the provenance attestations of
53+
downloaded packages. Because provenance attestations are such a new feature,
54+
security features may be added to (or changed in) the attestation format over
55+
time. To ensure that you're always able to verify attestation signatures check
56+
that you're running the latest version of the npm CLI. Please note this often
57+
means updating npm beyond the version that ships with Node.js.
58+
5259
The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed:
5360

5461
1. Signatures are provided in the package's `packument` in each published version within the `dist` object:
@@ -89,7 +96,7 @@ Keys response:
8996
- `scheme`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI
9097
- `key`: base64 encoded public key
9198

92-
See this [example key's response from the public npm registry](https://registry.npmjs.org/-/npm/v1/keys").
99+
See this [example key's response from the public npm registry](https://registry.npmjs.org/-/npm/v1/keys).
93100

94101
### Audit Endpoints
95102

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@10.5.0 /path/to/npm
30+
npm@10.5.1 /path/to/npm
3131
└─┬ init-package-json@0.0.4
3232
└── promzard@0.1.5
3333
```

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

+10
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ Show the description in `npm search`
9191

9292

9393

94+
#### `searchlimit`
95+
96+
* Default: 20
97+
* Type: Number
98+
99+
Number of items to limit search results to. Will not apply at all to legacy
100+
searches.
101+
102+
103+
94104
#### `searchopts`
95105

96106
* Default: ""

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-
10.5.0
17+
10.5.1
1818

1919
### Description
2020

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Some tips:
4040
* Don't use the same name as a core Node module.
4141
* Don't put "js" or "node" in the name. It's assumed that it's js, since
4242
you're writing a package.json file, and you can specify the engine using
43-
the "engines" field. (See below.)
43+
the "[engines](#engines)" field. (See below.)
4444
* The name will probably be passed as an argument to require(), so it
4545
should be something short, but also reasonably descriptive.
4646
* You may want to check the npm registry to see if there's something by
@@ -75,7 +75,7 @@ your package as it's listed in `npm search`.
7575

7676
### homepage
7777

78-
The url to the project homepage.
78+
The URL to the project homepage.
7979

8080
Example:
8181

@@ -85,7 +85,7 @@ Example:
8585

8686
### bugs
8787

88-
The url to your project's issue tracker and / or the email address to which
88+
The URL to your project's issue tracker and / or the email address to which
8989
issues should be reported. These are helpful for people who encounter
9090
issues with your package.
9191

@@ -101,10 +101,10 @@ It should look like this:
101101
```
102102

103103
You can specify either one or both values. If you want to provide only a
104-
url, you can specify the value for "bugs" as a simple string instead of an
104+
URL, you can specify the value for "bugs" as a simple string instead of an
105105
object.
106106

107-
If a url is provided, it will be used by the `npm bugs` command.
107+
If a URL is provided, it will be used by the `npm bugs` command.
108108

109109
### license
110110

@@ -511,9 +511,9 @@ Do it like this:
511511
}
512512
```
513513

514-
The URL should be a publicly available (perhaps read-only) url that can be
514+
The URL should be a publicly available (perhaps read-only) URL that can be
515515
handed directly to a VCS program without any modification. It should not
516-
be a url to an html project page that you put in your browser. It's for
516+
be a URL to an html project page that you put in your browser. It's for
517517
computers.
518518

519519
For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the
@@ -636,7 +636,7 @@ install time.
636636

637637
#### Git URLs as Dependencies
638638

639-
Git urls are of the form:
639+
Git URLs are of the form:
640640

641641
```bash
642642
<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
@@ -683,7 +683,7 @@ will be rebuilt for every installation.
683683

684684
#### GitHub URLs
685685

686-
As of version 1.1.65, you can refer to GitHub urls as just "foo":
686+
As of version 1.1.65, you can refer to GitHub URLs as just "foo":
687687
"user/foo-project". Just as with git URLs, a `commit-ish` suffix can be
688688
included. For example:
689689

@@ -889,7 +889,7 @@ none.
889889
If a dependency can be used, but you would like npm to proceed if it cannot
890890
be found or fails to install, then you may put it in the
891891
`optionalDependencies` object. This is a map of package name to version or
892-
url, just like the `dependencies` object. The difference is that build
892+
URL, just like the `dependencies` object. The difference is that build
893893
failures do not cause installation to fail. Running `npm install
894894
--omit=optional` will prevent these dependencies from being installed.
895895

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ <h3 id="audit-signatures">Audit Signatures</h3>
174174
<p>Registry signatures can be verified using the following <code>audit</code> command:</p>
175175
<pre><code class="language-bash">$ npm audit signatures
176176
</code></pre>
177+
<p>The <code>audit signatures</code> command will also verify the provenance attestations of
178+
downloaded packages. Because provenance attestations are such a new feature,
179+
security features may be added to (or changed in) the attestation format over
180+
time. To ensure that you're always able to verify attestation signatures check
181+
that you're running the latest version of the npm CLI. Please note this often
182+
means updating npm beyond the version that ships with Node.js.</p>
177183
<p>The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed:</p>
178184
<ol>
179185
<li>Signatures are provided in the package's <code>packument</code> in each published version within the <code>dist</code> object:</li>
@@ -209,7 +215,7 @@ <h3 id="audit-signatures">Audit Signatures</h3>
209215
<li><code>scheme</code>: only <code>ecdsa-sha2-nistp256</code> is currently supported by the npm CLI</li>
210216
<li><code>key</code>: base64 encoded public key</li>
211217
</ul>
212-
<p>See this <a href="https://registry.npmjs.org/-/npm/v1/keys%22">example key's response from the public npm registry</a>.</p>
218+
<p>See this <a href="https://registry.npmjs.org/-/npm/v1/keys">example key's response from the public npm registry</a>.</p>
213219
<h3 id="audit-endpoints">Audit Endpoints</h3>
214220
<p>There are two audit endpoints that npm may use to fetch vulnerability
215221
information: the <code>Bulk Advisory</code> endpoint and the <code>Quick Audit</code> endpoint.</p>

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@10.5.0 /path/to/npm
163+
<pre><code class="language-bash">npm@10.5.1 /path/to/npm
164164
└─┬ init-package-json@0.0.4
165165
└── promzard@0.1.5
166166
</code></pre>

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ <h1 id="npm-search">npm-search</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="#long"><code>long</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#color"><code>color</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#description2"><code>description</code></a></li><li><a href="#searchopts"><code>searchopts</code></a></li><li><a href="#searchexclude"><code>searchexclude</code></a></li><li><a href="#registry"><code>registry</code></a></li><li><a href="#prefer-online"><code>prefer-online</code></a></li><li><a href="#prefer-offline"><code>prefer-offline</code></a></li><li><a href="#offline"><code>offline</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="#long"><code>long</code></a></li><li><a href="#json"><code>json</code></a></li><li><a href="#color"><code>color</code></a></li><li><a href="#parseable"><code>parseable</code></a></li><li><a href="#description2"><code>description</code></a></li><li><a href="#searchlimit"><code>searchlimit</code></a></li><li><a href="#searchopts"><code>searchopts</code></a></li><li><a href="#searchexclude"><code>searchexclude</code></a></li><li><a href="#registry"><code>registry</code></a></li><li><a href="#prefer-online"><code>prefer-online</code></a></li><li><a href="#prefer-offline"><code>prefer-offline</code></a></li><li><a href="#offline"><code>offline</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>
@@ -207,6 +207,13 @@ <h4 id="description2"><code>description</code></h4>
207207
<li>Type: Boolean</li>
208208
</ul>
209209
<p>Show the description in <code>npm search</code></p>
210+
<h4 id="searchlimit"><code>searchlimit</code></h4>
211+
<ul>
212+
<li>Default: 20</li>
213+
<li>Type: Number</li>
214+
</ul>
215+
<p>Number of items to limit search results to. Will not apply at all to legacy
216+
searches.</p>
210217
<h4 id="searchopts"><code>searchopts</code></h4>
211218
<ul>
212219
<li>Default: ""</li>

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>10.5.0</p>
153+
<p>10.5.1</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

+10-10
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ <h3 id="name">name</h3>
175175
<li>Don't use the same name as a core Node module.</li>
176176
<li>Don't put "js" or "node" in the name. It's assumed that it's js, since
177177
you're writing a package.json file, and you can specify the engine using
178-
the "engines" field. (See below.)</li>
178+
the "<a href="#engines">engines</a>" field. (See below.)</li>
179179
<li>The name will probably be passed as an argument to require(), so it
180180
should be something short, but also reasonably descriptive.</li>
181181
<li>You may want to check the npm registry to see if there's something by
@@ -201,12 +201,12 @@ <h3 id="keywords">keywords</h3>
201201
<p>Put keywords in it. It's an array of strings. This helps people discover
202202
your package as it's listed in <code>npm search</code>.</p>
203203
<h3 id="homepage">homepage</h3>
204-
<p>The url to the project homepage.</p>
204+
<p>The URL to the project homepage.</p>
205205
<p>Example:</p>
206206
<pre><code class="language-json">"homepage": "https://github.com/owner/project#readme"
207207
</code></pre>
208208
<h3 id="bugs">bugs</h3>
209-
<p>The url to your project's issue tracker and / or the email address to which
209+
<p>The URL to your project's issue tracker and / or the email address to which
210210
issues should be reported. These are helpful for people who encounter
211211
issues with your package.</p>
212212
<p>It should look like this:</p>
@@ -218,9 +218,9 @@ <h3 id="bugs">bugs</h3>
218218
}
219219
</code></pre>
220220
<p>You can specify either one or both values. If you want to provide only a
221-
url, you can specify the value for "bugs" as a simple string instead of an
221+
URL, you can specify the value for "bugs" as a simple string instead of an
222222
object.</p>
223-
<p>If a url is provided, it will be used by the <code>npm bugs</code> command.</p>
223+
<p>If a URL is provided, it will be used by the <code>npm bugs</code> command.</p>
224224
<h3 id="license">license</h3>
225225
<p>You should specify a license for your package so that people know how they
226226
are permitted to use it, and any restrictions you're placing on it.</p>
@@ -531,9 +531,9 @@ <h3 id="repository">repository</h3>
531531
}
532532
}
533533
</code></pre>
534-
<p>The URL should be a publicly available (perhaps read-only) url that can be
534+
<p>The URL should be a publicly available (perhaps read-only) URL that can be
535535
handed directly to a VCS program without any modification. It should not
536-
be a url to an html project page that you put in your browser. It's for
536+
be a URL to an html project page that you put in your browser. It's for
537537
computers.</p>
538538
<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the
539539
same shortcut syntax you use for <code>npm install</code>:</p>
@@ -630,7 +630,7 @@ <h4 id="urls-as-dependencies">URLs as Dependencies</h4>
630630
<p>This tarball will be downloaded and installed locally to your package at
631631
install time.</p>
632632
<h4 id="git-urls-as-dependencies">Git URLs as Dependencies</h4>
633-
<p>Git urls are of the form:</p>
633+
<p>Git URLs are of the form:</p>
634634
<pre><code class="language-bash">&lt;protocol&gt;://[&lt;user&gt;[:&lt;password&gt;]@]&lt;hostname&gt;[:&lt;port&gt;][:][/]&lt;path&gt;[#&lt;commit-ish&gt; | #semver:&lt;semver&gt;]
635635
</code></pre>
636636
<p><code>&lt;protocol&gt;</code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, <code>git+https</code>, or
@@ -666,7 +666,7 @@ <h4 id="git-urls-as-dependencies">Git URLs as Dependencies</h4>
666666
make sure that none of the above scripts are defined, or your dependency
667667
will be rebuilt for every installation.</p>
668668
<h4 id="github-urls">GitHub URLs</h4>
669-
<p>As of version 1.1.65, you can refer to GitHub urls as just "foo":
669+
<p>As of version 1.1.65, you can refer to GitHub URLs as just "foo":
670670
"user/foo-project". Just as with git URLs, a <code>commit-ish</code> suffix can be
671671
included. For example:</p>
672672
<pre><code class="language-json">{
@@ -820,7 +820,7 @@ <h3 id="optionaldependencies">optionalDependencies</h3>
820820
<p>If a dependency can be used, but you would like npm to proceed if it cannot
821821
be found or fails to install, then you may put it in the
822822
<code>optionalDependencies</code> object. This is a map of package name to version or
823-
url, just like the <code>dependencies</code> object. The difference is that build
823+
URL, just like the <code>dependencies</code> object. The difference is that build
824824
failures do not cause installation to fail. Running <code>npm install --omit=optional</code> will prevent these dependencies from being installed.</p>
825825
<p>It is still your program's responsibility to handle the lack of the
826826
dependency. For example, something like this:</p>

deps/npm/lib/commands/adduser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const log = require('../utils/log-shim.js')
2-
const replaceInfo = require('../utils/replace-info.js')
2+
const { redactLog: replaceInfo } = require('@npmcli/redact')
33
const auth = require('../utils/auth.js')
44

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

0 commit comments

Comments
 (0)