Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade npm to 10.2.1 #50258

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm-ls.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For
example, running `npm ls promzard` in npm's source tree will show:

```bash
npm@10.2.0 /path/to/npm
npm@10.2.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
```
Expand Down
31 changes: 23 additions & 8 deletions deps/npm/docs/content/commands/npm-rebuild.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,29 @@ alias: rb

### Description

This command runs the `npm build` command on the matched folders. This is
useful when you install a new version of node, and must recompile all your
C++ addons with the new binary. It is also useful when installing with
`--ignore-scripts` and `--no-bin-links`, to explicitly choose which
packages to build and/or link bins.

If one or more package specs are provided, then only packages with a
name and version matching one of the specifiers will be rebuilt.
This command does the following:

1. Execute lifecycle scripts (`preinstall`, `install`, `postinstall`, `prepare`)
2. Links bins depending on whether bin links are enabled

This command is particularly useful in scenarios including but not limited to:

1. Installing a new version of **node.js**, where you need to recompile all your C++ add-ons with the updated binary.
2. Installing with `--ignore-scripts` and `--no-bin-links`, to explicitly choose which packages to build and/or link bins.

If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.

Usually, you should not need to run `npm rebuild` as it is already done for you as part of npm install (unless you suppressed these steps with `--ignore-scripts` or `--no-bin-links`).

If there is a `binding.gyp` file in the root of your package, then npm will use a default install hook:

```
"scripts": {
"install": "node-gyp rebuild"
}
```

This default behavior is suppressed if the `package.json` has its own `install` or `preinstall` scripts. It is also suppressed if the package specifies `"gypfile": false`

### Configuration

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/content/commands/npm.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Note: This command is unaware of workspaces.

### Version

10.2.0
10.2.1

### Description

Expand Down
2 changes: 0 additions & 2 deletions deps/npm/docs/content/using-npm/scripts.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ These are run from the scripts of `<pkg-name>`
* `publish`
* `postpublish`

`prepare` will not run during `--dry-run`

#### [`npm rebuild`](/commands/npm-rebuild)

* `preinstall`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
<pre><code class="language-bash">npm@10.2.0 /path/to/npm
<pre><code class="language-bash">npm@10.2.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
25 changes: 18 additions & 7 deletions deps/npm/docs/output/commands/npm-rebuild.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,24 @@ <h2 id="table-of-contents">Table of contents</h2>
alias: rb
</code></pre>
<h3 id="description">Description</h3>
<p>This command runs the <code>npm build</code> command on the matched folders. This is
useful when you install a new version of node, and must recompile all your
C++ addons with the new binary. It is also useful when installing with
<code>--ignore-scripts</code> and <code>--no-bin-links</code>, to explicitly choose which
packages to build and/or link bins.</p>
<p>If one or more package specs are provided, then only packages with a
name and version matching one of the specifiers will be rebuilt.</p>
<p>This command does the following:</p>
<ol>
<li>Execute lifecycle scripts (<code>preinstall</code>, <code>install</code>, <code>postinstall</code>, <code>prepare</code>)</li>
<li>Links bins depending on whether bin links are enabled</li>
</ol>
<p>This command is particularly useful in scenarios including but not limited to:</p>
<ol>
<li>Installing a new version of <strong>node.js</strong>, where you need to recompile all your C++ add-ons with the updated binary.</li>
<li>Installing with <code>--ignore-scripts</code> and <code>--no-bin-links</code>, to explicitly choose which packages to build and/or link bins.</li>
</ol>
<p>If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.</p>
<p>Usually, you should not need to run <code>npm rebuild</code> as it is already done for you as part of npm install (unless you suppressed these steps with <code>--ignore-scripts</code> or <code>--no-bin-links</code>).</p>
<p>If there is a <code>binding.gyp</code> file in the root of your package, then npm will use a default install hook:</p>
<pre><code>"scripts": {
"install": "node-gyp rebuild"
}
</code></pre>
<p>This default behavior is suppressed if the <code>package.json</code> has its own <code>install</code> or <code>preinstall</code> scripts. It is also suppressed if the package specifies <code>"gypfile": false</code></p>
<h3 id="configuration">Configuration</h3>
<h4 id="global"><code>global</code></h4>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
</code></pre>
<p>Note: This command is unaware of workspaces.</p>
<h3 id="version">Version</h3>
<p>10.2.0</p>
<p>10.2.1</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
1 change: 0 additions & 1 deletion deps/npm/docs/output/using-npm/scripts.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ <h4 id="npm-publish"><a href="../commands/npm-publish.html"><code>npm publish</c
<li><code>publish</code></li>
<li><code>postpublish</code></li>
</ul>
<p><code>prepare</code> will not run during <code>--dry-run</code></p>
<h4 id="npm-rebuild"><a href="../commands/npm-rebuild.html"><code>npm rebuild</code></a></h4>
<ul>
<li><code>preinstall</code></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/commands/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class VerifySignatures {
// Didn't find any dependencies that could be verified, e.g. only local
// deps, missing version, not on a registry etc.
if (!this.auditedWithKeysCount) {
throw new Error('found no dependencies to audit that where installed from ' +
throw new Error('found no dependencies to audit that were installed from ' +
'a supported registry')
}

Expand Down
12 changes: 8 additions & 4 deletions deps/npm/lib/commands/logout.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const getAuth = require('npm-registry-fetch/lib/auth.js')
const npmFetch = require('npm-registry-fetch')
const { getAuth } = npmFetch
const log = require('../utils/log-shim')
const BaseCommand = require('../base-command.js')

Expand All @@ -19,10 +19,14 @@ class Logout extends BaseCommand {

const auth = getAuth(reg, this.npm.flatOptions)

const level = this.npm.config.find(`${auth.regKey}:${auth.authKey}`)

// find the config level and only delete from there
if (auth.token) {
log.verbose('logout', `clearing token for ${reg}`)
await npmFetch(`/-/user/token/${encodeURIComponent(auth.token)}`, {
...this.npm.flatOptions,
registry: reg,
method: 'DELETE',
ignoreBody: true,
})
Expand All @@ -34,12 +38,12 @@ class Logout extends BaseCommand {
}

if (scope) {
this.npm.config.delete(regRef, 'user')
this.npm.config.delete(regRef, level)
}

this.npm.config.clearCredentialsByURI(reg)
this.npm.config.clearCredentialsByURI(reg, level)

await this.npm.config.save('user')
await this.npm.config.save(level)
}
}
module.exports = Logout
6 changes: 1 addition & 5 deletions deps/npm/lib/utils/queryable.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,9 @@ const getter = ({ data, key }) => {
}, {})
return _data
} else {
// if can't find any more values, it means it's just over
// and there's nothing to return
if (!_data[k]) {
if (!Object.hasOwn(_data, k)) {
return undefined
}

// otherwise sets the next value
_data = _data[k]
}

Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ls.1
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Positional arguments are \fBname@version-range\fR identifiers, which will limit
.P
.RS 2
.nf
npm@10.2.0 /path/to/npm
npm@10.2.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
.fi
Expand Down
32 changes: 31 additions & 1 deletion deps/npm/man/man1/npm-rebuild.1
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,39 @@ alias: rb
.RE
.SS "Description"
.P
This command runs the \fBnpm build\fR command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary. It is also useful when installing with \fB--ignore-scripts\fR and \fB--no-bin-links\fR, to explicitly choose which packages to build and/or link bins.
This command does the following:
.RS 0
.IP 1. 4
Execute lifecycle scripts (\fBpreinstall\fR, \fBinstall\fR, \fBpostinstall\fR, \fBprepare\fR)
.IP 2. 4
Links bins depending on whether bin links are enabled
.RE 0

.P
This command is particularly useful in scenarios including but not limited to:
.RS 0
.IP 1. 4
Installing a new version of \fBnode.js\fR, where you need to recompile all your C++ add-ons with the updated binary.
.IP 2. 4
Installing with \fB--ignore-scripts\fR and \fB--no-bin-links\fR, to explicitly choose which packages to build and/or link bins.
.RE 0

.P
If one or more package specs are provided, then only packages with a name and version matching one of the specifiers will be rebuilt.
.P
Usually, you should not need to run \fBnpm rebuild\fR as it is already done for you as part of npm install (unless you suppressed these steps with \fB--ignore-scripts\fR or \fB--no-bin-links\fR).
.P
If there is a \fBbinding.gyp\fR file in the root of your package, then npm will use a default install hook:
.P
.RS 2
.nf
"scripts": {
"install": "node-gyp rebuild"
}
.fi
.RE
.P
This default behavior is suppressed if the \fBpackage.json\fR has its own \fBinstall\fR or \fBpreinstall\fR scripts. It is also suppressed if the package specifies \fB"gypfile": false\fR
.SS "Configuration"
.SS "\fBglobal\fR"
.RS 0
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm.1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ npm
Note: This command is unaware of workspaces.
.SS "Version"
.P
10.2.0
10.2.1
.SS "Description"
.P
npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently.
Expand Down
2 changes: 0 additions & 2 deletions deps/npm/man/man7/scripts.7
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,6 @@ These are run from the scripts of \fB<pkg-name>\fR
\fBpostpublish\fR
.RE 0

.P
\fBprepare\fR will not run during \fB--dry-run\fR
.SS "npm help rebuild"
.RS 0
.IP \(bu 4
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions deps/npm/node_modules/@npmcli/config/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading