Skip to content

Commit 071e46a

Browse files
npm-cli-bottargos
authored andcommitted
deps: upgrade npm to 10.2.4
PR-URL: #50751 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent dee8039 commit 071e46a

File tree

143 files changed

+2417
-1013
lines changed

Some content is hidden

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

143 files changed

+2417
-1013
lines changed

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

Lines changed: 1 addition & 1 deletion
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-
[email protected].3 /path/to/npm
30+
[email protected].4 /path/to/npm
3131
3232
3333
```

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ then only packages matching one of the supplied names are removed.
1818
Extraneous packages are those present in the `node_modules` folder that are
1919
not listed as any package's dependency list.
2020

21-
If the `--production` flag is specified or the `NODE_ENV` environment
21+
If the `--omit=dev` flag is specified or the `NODE_ENV` environment
2222
variable is set to `production`, this command will remove the packages
23-
specified in your `devDependencies`. Setting `--no-production` will negate
24-
`NODE_ENV` being set to `production`.
23+
specified in your `devDependencies`.
2524

2625
If the `--dry-run` flag is used then no changes will actually be made.
2726

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ For example, to show the dependencies of the `ronn` package at version
3232
npm view [email protected] dependencies
3333
```
3434

35+
By default, `npm view` shows data about the current project context (by looking for a `package.json`).
36+
To show field data for the current project use a file path (i.e. `.`):
37+
38+
```bash
39+
npm view . dependencies
40+
```
41+
3542
You can view child fields by separating them with a period.
3643
To view the git repository URL for the latest version of `npm`, you would run the following command:
3744

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

Lines changed: 1 addition & 1 deletion
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.2.3
17+
10.2.4
1818

1919
### Description
2020

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

Lines changed: 1 addition & 1 deletion
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">[email protected].3 /path/to/npm
163+
<pre><code class="language-bash">[email protected].4 /path/to/npm
164164
165165
166166
</code></pre>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,9 @@ <h3 id="description">Description</h3>
153153
then only packages matching one of the supplied names are removed.</p>
154154
<p>Extraneous packages are those present in the <code>node_modules</code> folder that are
155155
not listed as any package's dependency list.</p>
156-
<p>If the <code>--production</code> flag is specified or the <code>NODE_ENV</code> environment
156+
<p>If the <code>--omit=dev</code> flag is specified or the <code>NODE_ENV</code> environment
157157
variable is set to <code>production</code>, this command will remove the packages
158-
specified in your <code>devDependencies</code>. Setting <code>--no-production</code> will negate
159-
<code>NODE_ENV</code> being set to <code>production</code>.</p>
158+
specified in your <code>devDependencies</code>.</p>
160159
<p>If the <code>--dry-run</code> flag is used then no changes will actually be made.</p>
161160
<p>If the <code>--json</code> flag is used, then the changes <code>npm prune</code> made (or would
162161
have made with <code>--dry-run</code>) are printed as a JSON object.</p>

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ <h3 id="description">Description</h3>
161161
<code>0.3.5</code>, you could do the following:</p>
162162
<pre><code class="language-bash">npm view [email protected] dependencies
163163
</code></pre>
164+
<p>By default, <code>npm view</code> shows data about the current project context (by looking for a <code>package.json</code>).
165+
To show field data for the current project use a file path (i.e. <code>.</code>):</p>
166+
<pre><code class="language-bash">npm view . dependencies
167+
</code></pre>
164168
<p>You can view child fields by separating them with a period.
165169
To view the git repository URL for the latest version of <code>npm</code>, you would run the following command:</p>
166170
<pre><code class="language-bash">npm view npm repository.url

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

Lines changed: 1 addition & 1 deletion
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.2.3</p>
153+
<p>10.2.4</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/lib/commands/exec.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,33 @@ class Exec extends BaseCommand {
3434
for (const [name, path] of this.workspaces) {
3535
const locationMsg =
3636
`in workspace ${this.npm.chalk.green(name)} at location:\n${this.npm.chalk.dim(path)}`
37-
await this.callExec(args, { locationMsg, runPath: path })
37+
await this.callExec(args, { name, locationMsg, runPath: path })
3838
}
3939
}
4040

41-
async callExec (args, { locationMsg, runPath } = {}) {
42-
// This is where libnpmexec will look for locally installed packages
41+
async callExec (args, { name, locationMsg, runPath } = {}) {
42+
// This is where libnpmexec will look for locally installed packages at the project level
4343
const localPrefix = this.npm.localPrefix
44+
// This is where libnpmexec will look for locally installed packages at the workspace level
45+
let localBin = this.npm.localBin
46+
let path = localPrefix
4447

4548
// This is where libnpmexec will actually run the scripts from
4649
if (!runPath) {
4750
runPath = process.cwd()
51+
} else {
52+
// We have to consider if the workspace has its own separate versions
53+
// libnpmexec will walk up to localDir after looking here
54+
localBin = resolve(this.npm.localDir, name, 'node_modules', '.bin')
55+
// We also need to look for `bin` entries in the workspace package.json
56+
// libnpmexec will NOT look in the project root for the bin entry
57+
path = runPath
4858
}
4959

5060
const call = this.npm.config.get('call')
5161
let globalPath
5262
const {
5363
flatOptions,
54-
localBin,
5564
globalBin,
5665
globalDir,
5766
chalk,
@@ -79,14 +88,14 @@ class Exec extends BaseCommand {
7988
// copy args so they dont get mutated
8089
args: [...args],
8190
call,
82-
localBin,
83-
locationMsg,
91+
chalk,
8492
globalBin,
8593
globalPath,
94+
localBin,
95+
locationMsg,
8696
output,
87-
chalk,
8897
packages,
89-
path: localPrefix,
98+
path,
9099
runPath,
91100
scriptShell,
92101
yes,

deps/npm/lib/commands/outdated.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const npa = require('npm-package-arg')
66
const pickManifest = require('npm-pick-manifest')
77
const localeCompare = require('@isaacs/string-locale-compare')('en')
88

9-
const ansiTrim = require('strip-ansi')
109
const ArboristWorkspaceCmd = require('../arborist-cmd.js')
1110

1211
class Outdated extends ArboristWorkspaceCmd {
@@ -23,6 +22,7 @@ class Outdated extends ArboristWorkspaceCmd {
2322
]
2423

2524
async exec (args) {
25+
const { default: stripAnsi } = await import('strip-ansi')
2626
const global = resolve(this.npm.globalDir, '..')
2727
const where = this.npm.global
2828
? global
@@ -106,7 +106,7 @@ class Outdated extends ArboristWorkspaceCmd {
106106

107107
const tableOpts = {
108108
align: ['l', 'r', 'r', 'r', 'l'],
109-
stringLength: s => ansiTrim(s).length,
109+
stringLength: s => stripAnsi(s).length,
110110
}
111111
this.npm.output(table(outTable, tableOpts))
112112
}

0 commit comments

Comments
 (0)