Skip to content

Commit 208dd88

Browse files
npm-cli-botrichardlau
authored andcommitted
deps: upgrade npm to 10.5.0
PR-URL: #51913 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
1 parent 55011d2 commit 208dd88

File tree

396 files changed

+8964
-3998
lines changed

Some content is hidden

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

396 files changed

+8964
-3998
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ the order in which omit/include are specified on the command-line.
374374

375375
#### `foreground-scripts`
376376

377-
* Default: false
377+
* Default: `false` unless when using `npm pack` or `npm publish` where it
378+
defaults to `true`
378379
* Type: Boolean
379380

380381
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ this warning is treated as a failure.
169169

170170
#### `foreground-scripts`
171171

172-
* Default: false
172+
* Default: `false` unless when using `npm pack` or `npm publish` where it
173+
defaults to `true`
173174
* Type: Boolean
174175

175176
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ npm config set key=value [key=value...]
4444
npm set key=value [key=value...]
4545
```
4646
47-
Sets each of the config keys to the value provided.
47+
Sets each of the config keys to the value provided. Modifies the user configuration
48+
file unless [`location`](/commands/npm-config#location) is passed.
4849
4950
If value is omitted, the key will be removed from your config file entirely.
5051

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ this warning is treated as a failure.
115115

116116
#### `foreground-scripts`
117117

118-
* Default: false
118+
* Default: `false` unless when using `npm pack` or `npm publish` where it
119+
defaults to `true`
119120
* Type: Boolean
120121

121122
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ For `list` this means the output will be based on the tree described by the
192192

193193
#### `foreground-scripts`
194194

195-
* Default: false
195+
* Default: `false` unless when using `npm pack` or `npm publish` where it
196+
defaults to `true`
196197
* Type: Boolean
197198

198199
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ For `list` this means the output will be based on the tree described by the
582582
583583
#### `foreground-scripts`
584584
585-
* Default: false
585+
* Default: `false` unless when using `npm pack` or `npm publish` where it
586+
defaults to `true`
586587
* Type: Boolean
587588
588589
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ Not supported by all npm commands.
9999

100100
#### `foreground-scripts`
101101

102-
* Default: false
102+
* Default: `false` unless when using `npm pack` or `npm publish` where it
103+
defaults to `true`
103104
* Type: Boolean
104105

105106
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

+41-9
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,32 @@ npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {}
135135
},
136136
...
137137
```
138-
### Package lock only mode
139138

140-
If package-lock-only is enabled, only the information in the package
141-
lock (or shrinkwrap) is loaded. This means that information from the
142-
package.json files of your dependencies will not be included in the
143-
result set (e.g. description, homepage, engines).
139+
### Expecting a certain number of results
140+
141+
One common use of `npm query` is to make sure there is only one version of
142+
a certain dependency in your tree. This is especially common for
143+
ecosystems like that rely on `typescript` where having state split
144+
across two different but identically-named packages causes bugs. You
145+
can use the `--expect-results` or `--expect-result-count` in your setup
146+
to ensure that npm will exit with an exit code if your tree doesn't look
147+
like you want it to.
148+
149+
150+
```sh
151+
$ npm query '#react' --expect-result-count=1
152+
```
153+
154+
Perhaps you want to quickly check if there are any production
155+
dependencies that could be updated:
156+
157+
```sh
158+
$ npm query ':root>:outdated(in-range).prod' --no-expect-results
159+
```
144160

145161
### Package lock only mode
146162

147-
If package-lock-only is enabled, only the information in the package
148-
lock (or shrinkwrap) is loaded. This means that information from the
149-
package.json files of your dependencies will not be included in the
150-
result set (e.g. description, homepage, engines).
163+
If package-lock-only is enabled, only the information in the package lock (or shrinkwrap) is loaded. This means that information from the package.json files of your dependencies will not be included in the result set (e.g. description, homepage, engines).
151164

152165
### Configuration
153166

@@ -235,6 +248,25 @@ For `list` this means the output will be based on the tree described by the
235248
`package-lock.json`, rather than the contents of `node_modules`.
236249

237250

251+
252+
#### `expect-results`
253+
254+
* Default: null
255+
* Type: null or Boolean
256+
257+
Tells npm whether or not to expect results from the command. Can be either
258+
true (expect some results) or false (expect no results).
259+
260+
This config can not be used with: `expect-result-count`
261+
262+
#### `expect-result-count`
263+
264+
* Default: null
265+
* Type: null or Number
266+
267+
Tells to expect a specific number of results from the command.
268+
269+
This config can not be used with: `expect-results`
238270
## See Also
239271

240272
* [dependency selectors](/using-npm/dependency-selectors)

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ systems.
7272

7373
#### `foreground-scripts`
7474

75-
* Default: false
75+
* Default: `false` unless when using `npm pack` or `npm publish` where it
76+
defaults to `true`
7677
* Type: Boolean
7778

7879
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

deps/npm/docs/content/commands/npm-run-script.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ will *not* run any pre- or post-scripts.
220220

221221
#### `foreground-scripts`
222222

223-
* Default: false
223+
* Default: `false` unless when using `npm pack` or `npm publish` where it
224+
defaults to `true`
224225
* Type: Boolean
225226

226227
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ If no package name is specified, all packages in the specified location (global
2828
or local) will be updated.
2929

3030
Note that by default `npm update` will not update the semver values of direct
31-
dependencies in your project `package.json`, if you want to also update
31+
dependencies in your project `package.json`. If you want to also update
3232
values in `package.json` you can run: `npm update --save` (or add the
3333
`save=true` option to a [configuration file](/configuring-npm/npmrc)
3434
to make that the default behavior).
@@ -80,7 +80,7 @@ However, if `app`'s `package.json` contains:
8080
```
8181

8282
In this case, running `npm update` will install `dep1@1.1.2`. Even though the
83-
`latest` tag points to `1.2.2`, this version do not satisfy `~1.1.1`, which is
83+
`latest` tag points to `1.2.2`, this version does not satisfy `~1.1.1`, which is
8484
equivalent to `>=1.1.1 <1.2.0`. So the highest-sorting version that satisfies
8585
`~1.1.1` is used, which is `1.1.2`.
8686

@@ -94,8 +94,7 @@ Suppose `app` has a caret dependency on a version below `1.0.0`, for example:
9494
}
9595
```
9696

97-
`npm update` will install `dep1@0.2.0`, because there are no other
98-
versions which satisfy `^0.2.0`.
97+
`npm update` will install `dep1@0.2.0`.
9998

10099
If the dependence were on `^0.4.0`:
101100

@@ -294,7 +293,8 @@ will also prevent _writing_ `package-lock.json` if `save` is true.
294293

295294
#### `foreground-scripts`
296295

297-
* Default: false
296+
* Default: `false` unless when using `npm pack` or `npm publish` where it
297+
defaults to `true`
298298
* Type: Boolean
299299

300300
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

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

1919
### Description
2020

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ in which case they will be normalized to a relative path and added to your
726726

727727
This feature is helpful for local offline development and creating tests
728728
that require npm installing where you don't want to hit an external server,
729-
but should not be used when publishing packages to the public registry.
729+
but should not be used when publishing your package to the public registry.
730730
731731
*note*: Packages linked by local path will not have their own
732732
dependencies installed when `npm install` is ran in this case. You must

deps/npm/docs/content/using-npm/config.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ description: More than you probably want to know about npm configuration
66

77
### Description
88

9+
This article details npm configuration in general. To learn about the `config` command,
10+
see [`npm config`](/commands/npm-config).
11+
912
npm gets its configuration values from the following sources, sorted by priority:
1013

1114
#### Command Line Flags
@@ -489,6 +492,25 @@ This can be overridden by setting the `--force` flag.
489492

490493

491494

495+
#### `expect-result-count`
496+
497+
* Default: null
498+
* Type: null or Number
499+
500+
Tells to expect a specific number of results from the command.
501+
502+
This config can not be used with: `expect-results`
503+
504+
#### `expect-results`
505+
506+
* Default: null
507+
* Type: null or Boolean
508+
509+
Tells npm whether or not to expect results from the command. Can be either
510+
true (expect some results) or false (expect no results).
511+
512+
This config can not be used with: `expect-result-count`
513+
492514
#### `fetch-retries`
493515

494516
* Default: 2
@@ -570,7 +592,8 @@ recommended that you do not use this option!
570592

571593
#### `foreground-scripts`
572594

573-
* Default: false
595+
* Default: `false` unless when using `npm pack` or `npm publish` where it
596+
defaults to `true`
574597
* Type: Boolean
575598

576599
Run all build scripts (ie, `preinstall`, `install`, and `postinstall`)

deps/npm/docs/content/using-npm/dependency-selectors.md

+21-5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The [`npm query`](/commands/npm-query) command exposes a new dependency selector
1313
- Unlocks the ability to answer complex, multi-faceted questions about dependencies, their relationships & associative metadata
1414
- Consolidates redundant logic of similar query commands in `npm` (ex. `npm fund`, `npm ls`, `npm outdated`, `npm audit` ...)
1515

16-
### Dependency Selector Syntax `v1.0.0`
16+
### Dependency Selector Syntax
1717

1818
#### Overview:
1919

@@ -62,6 +62,7 @@ The [`npm query`](/commands/npm-query) command exposes a new dependency selector
6262
- `:path(<path>)` [glob](https://www.npmjs.com/package/glob) matching based on dependencies path relative to the project
6363
- `:type(<type>)` [based on currently recognized types](https://github.com/npm/npm-package-arg#result-object)
6464
- `:outdated(<type>)` when a dependency is outdated
65+
- `:vuln(<selector>)` when a dependency has a known vulnerability
6566

6667
##### `:semver(<spec>, [selector], [function])`
6768

@@ -84,8 +85,8 @@ Some examples:
8485
The `:outdated` pseudo selector retrieves data from the registry and returns information about which of your dependencies are outdated. The type parameter may be one of the following:
8586

8687
- `any` (default) a version exists that is greater than the current one
87-
- `in-range` a version exists that is greater than the current one, and satisfies at least one if its dependents
88-
- `out-of-range` a version exists that is greater than the current one, does not satisfy at least one of its dependents
88+
- `in-range` a version exists that is greater than the current one, and satisfies at least one if its parent's dependencies
89+
- `out-of-range` a version exists that is greater than the current one, does not satisfy at least one of its parent's dependencies
8990
- `major` a version exists that is a semver major greater than the current one
9091
- `minor` a version exists that is a semver minor greater than the current one
9192
- `patch` a version exists that is a semver patch greater than the current one
@@ -99,14 +100,29 @@ In addition to the filtering performed by the pseudo selector, some extra data i
99100
Some examples:
100101

101102
- `:root > :outdated(major)` returns every direct dependency that has a new semver major release
102-
- `.prod:outdated(in-range)` returns production dependencies that have a new release that satisfies at least one of its edges in
103+
- `.prod:outdated(in-range)` returns production dependencies that have a new release that satisfies at least one of its parent's dependencies
104+
105+
##### `:vuln`
106+
107+
The `:vuln` pseudo selector retrieves data from the registry and returns information about which if your dependencies has a known vulnerability. Only dependencies whose current version matches a vulnerability will be returned. For example if you have `semver@7.6.0` in your tree, a vulnerability for `semver` which affects versions `<=6.3.1` will not match.
108+
109+
You can also filter results by certain attributes in advisories. Currently that includes `severity` and `cwe`. Note that severity filtering is done per severity, it does not include severities "higher" or "lower" than the one specified.
110+
111+
In addition to the filtering performed by the pseudo selector, info about each relevant advisory will be added to the `queryContext` attribute of each node under the `advisories` attribute.
112+
113+
Some examples:
114+
115+
- `:root > .prod:vuln` returns direct production dependencies with any known vulnerability
116+
- `:vuln([severity=high])` returns only dependencies with a vulnerability with a `high` severity.
117+
- `:vuln([severity=high],[severity=moderate])` returns only dependencies with a vulnerability with a `high` or `moderate` severity.
118+
- `:vuln([cwe=1333])` returns only dependencies with a vulnerability that includes CWE-1333 (ReDoS)
103119

104120
#### [Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)
105121

106122
The attribute selector evaluates the key/value pairs in `package.json` if they are `String`s.
107123

108124
- `[]` attribute selector (ie. existence of attribute)
109-
- `[attribute=value]` attribute value is equivalant...
125+
- `[attribute=value]` attribute value is equivalent...
110126
- `[attribute~=value]` attribute value contains word...
111127
- `[attribute*=value]` attribute value contains string...
112128
- `[attribute|=value]` attribute value is equal to or starts with...

deps/npm/docs/content/using-npm/scope.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ host multiple scopes, but a scope only ever points to one registry.
127127
You can also associate a scope with a registry using `npm config`:
128128

129129
```bash
130-
npm config set @myco:registry http://reg.example.com
130+
npm config set @myco:registry=http://reg.example.com
131131
```
132132

133133
Once a scope is associated with a registry, any `npm install` for a package

deps/npm/docs/content/using-npm/scripts.md

+7-12
Original file line numberDiff line numberDiff line change
@@ -294,18 +294,15 @@ For example, if your package.json contains this:
294294
{
295295
"scripts" : {
296296
"install" : "scripts/install.js",
297-
"postinstall" : "scripts/install.js",
298-
"uninstall" : "scripts/uninstall.js"
297+
"postinstall" : "scripts/install.js"
299298
}
300299
}
301300
```
302301

303-
then `scripts/install.js` will be called for the install
304-
and post-install stages of the lifecycle, and `scripts/uninstall.js`
305-
will be called when the package is uninstalled. Since
306-
`scripts/install.js` is running for two different phases, it would
307-
be wise in this case to look at the `npm_lifecycle_event` environment
308-
variable.
302+
then `scripts/install.js` will be called for the install and post-install
303+
stages of the lifecycle. Since `scripts/install.js` is running for two
304+
different phases, it would be wise in this case to look at the
305+
`npm_lifecycle_event` environment variable.
309306

310307
If you want to run a make command, you can do so. This works just
311308
fine:
@@ -334,10 +331,8 @@ file.
334331
### Best Practices
335332

336333
* Don't exit with a non-zero error code unless you *really* mean it.
337-
Except for uninstall scripts, this will cause the npm action to
338-
fail, and potentially be rolled back. If the failure is minor or
339-
only will prevent some optional features, then it's better to just
340-
print a warning and exit successfully.
334+
If the failure is minor or only will prevent some optional features, then
335+
it's better to just print a warning and exit successfully.
341336
* Try not to use scripts to do what npm can do for you. Read through
342337
[`package.json`](/configuring-npm/package-json) to see all the things that you can specify and enable
343338
by simply describing your package appropriately. In general, this

deps/npm/docs/content/using-npm/workspaces.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ description: Working with workspaces
77
### Description
88

99
**Workspaces** is a generic term that refers to the set of features in the
10-
npm cli that provides support to managing multiple packages from your local
10+
npm cli that provides support for managing multiple packages from your local
1111
file system from within a singular top-level, root package.
1212

1313
This set of features makes up for a much more streamlined workflow handling
14-
linked packages from the local file system. Automating the linking process
15-
as part of `npm install` and avoiding manually having to use `npm link` in
14+
linked packages from the local file system. It automates the linking process
15+
as part of `npm install` and removes the need to manually use `npm link` in
1616
order to add references to packages that should be symlinked into the current
1717
`node_modules` folder.
1818

@@ -110,7 +110,7 @@ respect the provided `workspace` configuration.
110110

111111
### Using workspaces
112112

113-
Given the [specifities of how Node.js handles module resolution](https://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_all_together) it's possible to consume any defined workspace
113+
Given the [specifics of how Node.js handles module resolution](https://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_all_together) it's possible to consume any defined workspace
114114
by its declared `package.json` `name`. Continuing from the example defined
115115
above, let's also create a Node.js script that will require the workspace `a`
116116
example module, e.g:

0 commit comments

Comments
 (0)