Skip to content

Commit 4b174ce

Browse files
npm-robotBethGriggs
authored andcommitted
deps: upgrade npm to 8.3.2
PR-URL: #41621 Reviewed-By: Ruy Adorno <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Richard Lau <[email protected]>
1 parent 5fe7cfa commit 4b174ce

Some content is hidden

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

53 files changed

+450
-288
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ result in new modules being installed.
7272

7373
Using `npm find-dupes` will run the command in `--dry-run` mode.
7474

75+
Note that by default `npm dedupe` will not update the semver values of direct
76+
dependencies in your project `package.json`, if you want to also update
77+
values in `package.json` you can run: `npm dedupe --save` (or add the
78+
`save=true` option to a [configuration file](/configuring-npm/npmrc)
79+
to make that the default behavior).
80+
7581
### Configuration
7682

7783
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ packages.
2727
If no package name is specified, all packages in the specified location (global
2828
or local) will be updated.
2929

30+
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
32+
values in `package.json` you can run: `npm update --save` (or add the
33+
`save=true` option to a [configuration file](/configuring-npm/npmrc)
34+
to make that the default behavior).
35+
3036
### Example
3137

3238
For the examples below, assume that the current package is `app` and it depends

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,13 +1326,16 @@ The base URL of the npm registry.
13261326

13271327
#### `save`
13281328

1329-
* Default: true
1329+
* Default: `true` unless when using `npm update` or `npm dedupe` where it
1330+
defaults to `false`
13301331
* Type: Boolean
13311332

1332-
Save installed packages to a package.json file as dependencies.
1333+
Save installed packages to a `package.json` file as dependencies.
13331334

13341335
When used with the `npm rm` command, removes the dependency from
1335-
package.json.
1336+
`package.json`.
1337+
1338+
Will also prevent writing to `package-lock.json` if set to `false`.
13361339

13371340
<!-- automatically generated, do not edit manually -->
13381341
<!-- see lib/utils/config/definitions.js -->

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ <h3 id="description">Description</h3>
192192
<p>Note that this operation transforms the dependency tree, but will never
193193
result in new modules being installed.</p>
194194
<p>Using <code>npm find-dupes</code> will run the command in <code>--dry-run</code> mode.</p>
195+
<p>Note that by default <code>npm dedupe</code> will not update the semver values of direct
196+
dependencies in your project <code>package.json</code>, if you want to also update
197+
values in <code>package.json</code> you can run: <code>npm dedupe --save</code> (or add the
198+
<code>save=true</code> option to a <a href="../configuring-npm/npmrc.html">configuration file</a>
199+
to make that the default behavior).</p>
195200
<h3 id="configuration">Configuration</h3>
196201
<!-- raw HTML omitted -->
197202
<!-- raw HTML omitted -->

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 lang="bash"><code>[email protected].1 /path/to/npm
163+
<pre lang="bash"><code>[email protected].2 /path/to/npm
164164
165165
166166
</code></pre>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ <h3 id="description">Description</h3>
160160
packages.</p>
161161
<p>If no package name is specified, all packages in the specified location (global
162162
or local) will be updated.</p>
163+
<p>Note that by default <code>npm update</code> will not update the semver values of direct
164+
dependencies in your project <code>package.json</code>, if you want to also update
165+
values in <code>package.json</code> you can run: <code>npm update --save</code> (or add the
166+
<code>save=true</code> option to a <a href="../configuring-npm/npmrc.html">configuration file</a>
167+
to make that the default behavior).</p>
163168
<h3 id="example">Example</h3>
164169
<p>For the examples below, assume that the current package is <code>app</code> and it depends
165170
on dependencies, <code>dep1</code> (<code>dep2</code>, .. etc.). The published versions of <code>dep1</code>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ <h2 id="table-of-contents">Table of contents</h2>
149149
<pre lang="bash"><code>npm &lt;command&gt; [args]
150150
</code></pre>
151151
<h3 id="version">Version</h3>
152-
<p>8.3.1</p>
152+
<p>8.3.2</p>
153153
<h3 id="description">Description</h3>
154154
<p>npm is the package manager for the Node JavaScript platform. It puts
155155
modules in place so that node can find them, and manages dependency

deps/npm/docs/output/using-npm/config.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,12 +1210,14 @@ <h4 id="registry"><code>registry</code></h4>
12101210
<!-- raw HTML omitted -->
12111211
<h4 id="save"><code>save</code></h4>
12121212
<ul>
1213-
<li>Default: true</li>
1213+
<li>Default: <code>true</code> unless when using <code>npm update</code> or <code>npm dedupe</code> where it
1214+
defaults to <code>false</code></li>
12141215
<li>Type: Boolean</li>
12151216
</ul>
1216-
<p>Save installed packages to a package.json file as dependencies.</p>
1217+
<p>Save installed packages to a <code>package.json</code> file as dependencies.</p>
12171218
<p>When used with the <code>npm rm</code> command, removes the dependency from
1218-
package.json.</p>
1219+
<code>package.json</code>.</p>
1220+
<p>Will also prevent writing to <code>package-lock.json</code> if set to <code>false</code>.</p>
12191221
<!-- raw HTML omitted -->
12201222
<!-- raw HTML omitted -->
12211223
<h4 id="save-bundle"><code>save-bundle</code></h4>

deps/npm/lib/base-command.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
// Base class for npm commands
2+
3+
const { relative } = require('path')
4+
25
const usageUtil = require('./utils/usage.js')
36
const ConfigDefinitions = require('./utils/config/definitions.js')
47
const getWorkspaces = require('./workspaces/get-workspaces.js')
@@ -78,9 +81,14 @@ class BaseCommand {
7881
this.includeWorkspaceRoot = false
7982
}
8083

84+
const relativeFrom = relative(this.npm.localPrefix, process.cwd()).startsWith('..')
85+
? this.npm.localPrefix
86+
: process.cwd()
87+
8188
const ws = await getWorkspaces(filters, {
8289
path: this.npm.localPrefix,
8390
includeWorkspaceRoot: this.includeWorkspaceRoot,
91+
relativeFrom,
8492
})
8593
this.workspaces = ws
8694
this.workspaceNames = [...ws.keys()]

deps/npm/lib/commands/dedupe.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Dedupe extends ArboristWorkspaceCmd {
1313
'legacy-bundling',
1414
'strict-peer-deps',
1515
'package-lock',
16+
'save',
1617
'omit',
1718
'ignore-scripts',
1819
'audit',
@@ -29,13 +30,20 @@ class Dedupe extends ArboristWorkspaceCmd {
2930
throw er
3031
}
3132

33+
// In the context of `npm dedupe` the save
34+
// config value should default to `false`
35+
const save = this.npm.config.isDefault('save')
36+
? false
37+
: this.npm.config.get('save')
38+
3239
const dryRun = this.npm.config.get('dry-run')
3340
const where = this.npm.prefix
3441
const opts = {
3542
...this.npm.flatOptions,
3643
log,
3744
path: where,
3845
dryRun,
46+
save,
3947
workspaces: this.workspaceNames,
4048
}
4149
const arb = new Arborist(opts)

0 commit comments

Comments
 (0)