Skip to content

Commit b578328

Browse files
npm-robotMylesBorins
authored andcommitted
deps: upgrade npm to 8.4.1
PR-URL: #41836 Reviewed-By: Ruy Adorno <[email protected]> Reviewed-By: Mohammed Keyvanzadeh <[email protected]> Reviewed-By: Beth Griggs <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Mestery <[email protected]>
1 parent 2b7c4b4 commit b578328

File tree

229 files changed

+3692
-830
lines changed

Some content is hidden

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

229 files changed

+3692
-830
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,10 @@ include any versions, as that information is specified in `dependencies`.
838838

839839
If this is spelled `"bundleDependencies"`, then that is also honored.
840840

841+
Alternatively, `"bundledDependencies"` can be defined as a boolean value. A
842+
value of `true` will bundle all dependencies, a value of `false` will bundle
843+
none.
844+
841845
### optionalDependencies
842846

843847
If a dependency can be used, but you would like npm to proceed if it cannot

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,8 @@ When package package-locks are disabled, automatic pruning of extraneous
11901190
modules will also be disabled. To remove extraneous modules with
11911191
package-locks disabled use `npm prune`.
11921192

1193+
This configuration does not affect `npm ci`.
1194+
11931195
<!-- automatically generated, do not edit manually -->
11941196
<!-- see lib/utils/config/definitions.js -->
11951197

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>npm@8.3.2 /path/to/npm
163+
<pre lang="bash"><code>npm@8.4.1 /path/to/npm
164164
165165
166166
</code></pre>

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.2</p>
152+
<p>8.4.1</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/configuring-npm/package-json.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,9 @@ <h3 id="bundleddependencies">bundledDependencies</h3>
774774
can be installed in a new project by executing <code>npm install awesome-web-framework-1.0.0.tgz</code>. Note that the package names do not
775775
include any versions, as that information is specified in <code>dependencies</code>.</p>
776776
<p>If this is spelled <code>"bundleDependencies"</code>, then that is also honored.</p>
777+
<p>Alternatively, <code>"bundledDependencies"</code> can be defined as a boolean value. A
778+
value of <code>true</code> will bundle all dependencies, a value of <code>false</code> will bundle
779+
none.</p>
777780
<h3 id="optionaldependencies">optionalDependencies</h3>
778781
<p>If a dependency can be used, but you would like npm to proceed if it cannot
779782
be found or fails to install, then you may put it in the

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,6 +1100,7 @@ <h4 id="package-lock"><code>package-lock</code></h4>
11001100
<p>When package package-locks are disabled, automatic pruning of extraneous
11011101
modules will also be disabled. To remove extraneous modules with
11021102
package-locks disabled use <code>npm prune</code>.</p>
1103+
<p>This configuration does not affect <code>npm ci</code>.</p>
11031104
<!-- raw HTML omitted -->
11041105
<!-- raw HTML omitted -->
11051106
<h4 id="package-lock-only"><code>package-lock-only</code></h4>

deps/npm/lib/commands/access.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const path = require('path')
33
const libaccess = require('libnpmaccess')
44
const readPackageJson = require('read-package-json-fast')
55

6+
const log = require('../utils/log-shim.js')
67
const otplease = require('../utils/otplease.js')
78
const getIdentity = require('../utils/get-identity.js')
89
const BaseCommand = require('../base-command.js')
@@ -76,7 +77,10 @@ class Access extends BaseCommand {
7677
throw this.usageError(`${cmd} is not a recognized subcommand.`)
7778
}
7879

79-
return this[cmd](args, this.npm.flatOptions)
80+
return this[cmd](args, {
81+
...this.npm.flatOptions,
82+
log,
83+
})
8084
}
8185

8286
public ([pkg], opts) {

deps/npm/lib/commands/ci.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const runScript = require('@npmcli/run-script')
66
const fs = require('fs')
77
const readdir = util.promisify(fs.readdir)
88
const log = require('../utils/log-shim.js')
9+
const validateLockfile = require('../utils/validate-lockfile.js')
910

1011
const removeNodeModules = async where => {
1112
const rimrafOpts = { glob: false }
@@ -37,6 +38,7 @@ class CI extends ArboristWorkspaceCmd {
3738
const where = this.npm.prefix
3839
const opts = {
3940
...this.npm.flatOptions,
41+
packageLock: true, // npm ci should never skip lock files
4042
path: where,
4143
log,
4244
save: false, // npm ci should never modify the lockfile or package.json
@@ -55,6 +57,28 @@ class CI extends ArboristWorkspaceCmd {
5557
}),
5658
removeNodeModules(where),
5759
])
60+
61+
// retrieves inventory of packages from loaded virtual tree (lock file)
62+
const virtualInventory = new Map(arb.virtualTree.inventory)
63+
64+
// build ideal tree step needs to come right after retrieving the virtual
65+
// inventory since it's going to erase the previous ref to virtualTree
66+
await arb.buildIdealTree()
67+
68+
// verifies that the packages from the ideal tree will match
69+
// the same versions that are present in the virtual tree (lock file)
70+
// throws a validation error in case of mismatches
71+
const errors = validateLockfile(virtualInventory, arb.idealTree.inventory)
72+
if (errors.length) {
73+
throw new Error(
74+
'`npm ci` can only install packages when your package.json and ' +
75+
'package-lock.json or npm-shrinkwrap.json are in sync. Please ' +
76+
'update your lock file with `npm install` ' +
77+
'before continuing.\n\n' +
78+
errors.join('\n') + '\n'
79+
)
80+
}
81+
5882
await arb.reify(opts)
5983

6084
const ignoreScripts = this.npm.config.get('ignore-scripts')

deps/npm/lib/commands/deprecate.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const fetch = require('npm-registry-fetch')
2+
const log = require('../utils/log-shim.js')
23
const otplease = require('../utils/otplease.js')
34
const npa = require('npm-package-arg')
45
const semver = require('semver')
@@ -50,6 +51,7 @@ class Deprecate extends BaseCommand {
5051
...this.npm.flatOptions,
5152
spec: p,
5253
query: { write: true },
54+
log,
5355
})
5456

5557
Object.keys(packument.versions)
@@ -64,6 +66,7 @@ class Deprecate extends BaseCommand {
6466
method: 'PUT',
6567
body: packument,
6668
ignoreBody: true,
69+
log,
6770
}))
6871
}
6972
}

deps/npm/lib/commands/diff.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class Diff extends BaseCommand {
6161
...this.npm.flatOptions,
6262
diffFiles: args,
6363
where: this.top,
64+
log,
6465
})
6566
return this.npm.output(res)
6667
}
@@ -193,6 +194,7 @@ class Diff extends BaseCommand {
193194
const packument = await pacote.packument(spec, {
194195
...this.npm.flatOptions,
195196
preferOnline: true,
197+
log,
196198
})
197199
bSpec = pickManifest(
198200
packument,

0 commit comments

Comments
 (0)