Skip to content

Commit 649e04c

Browse files
committed
deps: upgrade npm to 7.7.4
PR-URL: #37897 Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 3ab223d commit 649e04c

Some content is hidden

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

82 files changed

+1001
-2204
lines changed

deps/npm/AUTHORS

+2
Original file line numberDiff line numberDiff line change
@@ -765,3 +765,5 @@ Jan Sepke <[email protected]>
765765
Augusto Moura <[email protected]>
766766
Eric Chow <[email protected]>
767767
kbayrhammer <[email protected]>
768+
James Chen-Smith <[email protected]>
769+
Yash Singh <[email protected]>

deps/npm/CHANGELOG.md

+77
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,80 @@
1+
## v7.7.4 (2021-03-24)
2+
3+
### BUG FIXES
4+
5+
* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
6+
[#2951](https://github.com/npm/cli/issues/2951)
7+
fix(config): accept explicit `production=false`
8+
([@wraithgar](https://github.com/wraithgar))
9+
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
10+
[#2950](https://github.com/npm/cli/issues/2950)
11+
warn if using workspaces config options in `npm config`
12+
([@ruyadorno](https://github.com/ruyadorno))
13+
14+
## v7.7.3 (2021-03-24)
15+
16+
### BUG FIXES
17+
18+
* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
19+
[#2925](https://github.com/npm/cli/issues/2925)
20+
fix(set-script): add completion
21+
([@Yash-Singh1](https://github.com/Yash-Singh1))
22+
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
23+
[#2929](https://github.com/npm/cli/issues/2929)
24+
fix(install): ignore auditLevel
25+
`npm install` should not be affected by the `auditLevel` config, as the
26+
results of audit do not change its exit status.
27+
([@wraithgar](https://github.com/wraithgar))
28+
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
29+
[#2923](https://github.com/npm/cli/issues/2923)
30+
fix(audit-level): add `info` audit level
31+
This is a valid level but wasn't configured to be allowed.
32+
Also added this param to the usage output for `npm audit`
33+
([@wraithgar](https://github.com/wraithgar))
34+
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
35+
[#2945](https://github.com/npm/cli/issues/2945)
36+
config should not error when workspaces are configured
37+
([@nlf](https://github.com/nlf))
38+
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
39+
[#2944](https://github.com/npm/cli/issues/2944)
40+
fix(progress): re-add progress bar to reify
41+
The logger was no longer in flatOptions, we pass it in explicitly now
42+
([@wraithgar](https://github.com/wraithgar))
43+
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
44+
[#2946](https://github.com/npm/cli/issues/2946)
45+
fix(flatOptions): re-add `_auth`
46+
This was not being added to flatOptions, and things like
47+
`npm-registry-fetch` are looking for it.
48+
([@wraithgar](https://github.com/wraithgar))
49+
50+
## v7.7.2 (2021-03-24)
51+
52+
### BUG FIXES
53+
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
54+
[#2942](https://github.com/npm/cli/issues/2942)
55+
Restore --dev flag, unify --omit flatteners
56+
([@isaacs](https://github.com/isaacs))
57+
58+
### DEPENDENCIES
59+
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
60+
61+
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
62+
urls for gitlab
63+
([@nlf](https://github.com/nlf))
64+
65+
## v7.7.1 (2021-03-24)
66+
67+
### BUG FIXES
68+
69+
* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
70+
[#2930](https://github.com/npm/cli/issues/2930)
71+
fix(uninstall): use correct local prefix
72+
([@jameschensmith](https://github.com/jameschensmith))
73+
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
74+
[#2932](https://github.com/npm/cli/issues/2932)
75+
fix(config): flatten savePrefix properly
76+
([@wraithgar](https://github.com/wraithgar))
77+
178
## v7.7.0 (2021-03-23)
279

380
### FEATURES

deps/npm/docs/content/commands/npm-find-dupes.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
2121
* [npm ls](/cli-commands/ls)
2222
* [npm update](/cli-commands/update)
2323
* [npm install](/cli-commands/install)
24+

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

+11-3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
185185
#### `audit-level`
186186

187187
* Default: null
188-
* Type: "low", "moderate", "high", "critical", "none", or null
188+
* Type: "info", "low", "moderate", "high", "critical", "none", or null
189189

190190
The minimum level of vulnerability for `npm audit` to exit with a non-zero
191191
exit code.
@@ -1382,6 +1382,14 @@ What authentication strategy to use with `adduser`/`login`.
13821382

13831383
`--cache-min=9999 (or bigger)` is an alias for `--prefer-offline`.
13841384

1385+
#### `dev`
1386+
1387+
* Default: false
1388+
* Type: Boolean
1389+
* DEPRECATED: Please use --include=dev instead.
1390+
1391+
Alias for `--include=dev`.
1392+
13851393
#### `init.author.email`
13861394

13871395
* Default: ""
@@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional
14511459

14521460
#### `production`
14531461

1454-
* Default: false
1455-
* Type: Boolean
1462+
* Default: null
1463+
* Type: null or Boolean
14561464
* DEPRECATED: Use `--omit=dev` instead.
14571465

14581466
Alias for `--omit=dev`

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
159159
the results to only the paths to the packages named. Note that nested
160160
packages will <em>also</em> show the paths to the specified packages. For
161161
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
162-
<pre lang="bash"><code>[email protected].0 /path/to/npm
162+
<pre lang="bash"><code>[email protected].4 /path/to/npm
163163
164164
165165
</code></pre>

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

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

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

+11-4
Large diffs are not rendered by default.

deps/npm/lib/audit.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Audit extends BaseCommand {
1818
/* istanbul ignore next - see test/lib/load-all-commands.js */
1919
static get params () {
2020
return [
21+
'audit-level',
2122
'dry-run',
2223
'force',
2324
'json',

deps/npm/lib/ci.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,14 @@ class CI extends BaseCommand {
4242
}
4343

4444
const where = this.npm.prefix
45-
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
45+
const opts = {
46+
...this.npm.flatOptions,
47+
path: where,
48+
log: this.npm.log,
49+
save: false, // npm ci should never modify the lockfile or package.json
50+
}
4651

52+
const arb = new Arborist(opts)
4753
await Promise.all([
4854
arb.loadVirtual().catch(er => {
4955
log.verbose('loadVirtual', er.stack)
@@ -55,8 +61,7 @@ class CI extends BaseCommand {
5561
}),
5662
removeNodeModules(where),
5763
])
58-
// npm ci should never modify the lockfile or package.json
59-
await arb.reify({ ...this.npm.flatOptions, save: false })
64+
await arb.reify(opts)
6065

6166
const ignoreScripts = this.npm.config.get('ignore-scripts')
6267
// run the same set of scripts that `npm install` runs.

deps/npm/lib/config.js

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ class Config extends BaseCommand {
8888
this.config(args).then(() => cb()).catch(cb)
8989
}
9090

91+
execWorkspaces (args, filters, cb) {
92+
this.npm.log.warn('config', 'This command does not support workspaces.')
93+
this.exec(args, cb)
94+
}
95+
9196
async config ([action, ...args]) {
9297
this.npm.log.disableProgress()
9398
try {

deps/npm/lib/dedupe.js

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
3030
const where = this.npm.prefix
3131
const opts = {
3232
...this.npm.flatOptions,
33+
log: this.npm.log,
3334
path: where,
3435
dryRun,
3536
}

deps/npm/lib/exec.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ class Exec extends BaseCommand {
175175
if (needInstall) {
176176
const installDir = this.cacheInstallDir(packages)
177177
await mkdirp(installDir)
178-
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
178+
const arb = new Arborist({
179+
...this.npm.flatOptions,
180+
log: this.npm.log,
181+
path: installDir,
182+
})
179183
const tree = await arb.loadActual()
180184

181185
// at this point, we have to ensure that we get the exact same
@@ -212,7 +216,11 @@ class Exec extends BaseCommand {
212216
throw new Error('canceled')
213217
}
214218
}
215-
await arb.reify({ ...this.npm.flatOptions, add })
219+
await arb.reify({
220+
...this.npm.flatOptions,
221+
log: this.npm.log,
222+
add,
223+
})
216224
}
217225
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
218226
}

deps/npm/lib/install.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,16 @@ class Install extends BaseCommand {
126126
if (this.npm.config.get('dev'))
127127
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')
128128

129-
const arb = new Arborist({
129+
const opts = {
130130
...this.npm.flatOptions,
131+
log: this.npm.log,
132+
auditLevel: null,
131133
path: where,
132-
})
133-
134-
await arb.reify({
135-
...this.npm.flatOptions,
136134
add: args,
137-
})
135+
}
136+
const arb = new Arborist(opts)
137+
await arb.reify(opts)
138+
138139
if (!args.length && !isGlobalInstall && !ignoreScripts) {
139140
const scriptShell = this.npm.config.get('script-shell') || undefined
140141
const scripts = [

deps/npm/lib/link.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class Link extends BaseCommand {
6666
const globalOpts = {
6767
...this.npm.flatOptions,
6868
path: globalTop,
69+
log: this.npm.log,
6970
global: true,
7071
prune: false,
7172
}
@@ -113,12 +114,14 @@ class Link extends BaseCommand {
113114
// reify all the pending names as symlinks there
114115
const localArb = new Arborist({
115116
...this.npm.flatOptions,
117+
log: this.npm.log,
116118
path: this.npm.prefix,
117119
save,
118120
})
119121
await localArb.reify({
120122
...this.npm.flatOptions,
121123
path: this.npm.prefix,
124+
log: this.npm.log,
122125
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
123126
save,
124127
})
@@ -131,9 +134,13 @@ class Link extends BaseCommand {
131134
const arb = new Arborist({
132135
...this.npm.flatOptions,
133136
path: globalTop,
137+
log: this.npm.log,
134138
global: true,
135139
})
136-
await arb.reify({ add: [`file:${this.npm.prefix}`] })
140+
await arb.reify({
141+
add: [`file:${this.npm.prefix}`],
142+
log: this.npm.log,
143+
})
137144
await reifyFinish(this.npm, arb)
138145
}
139146

deps/npm/lib/prune.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ class Prune extends BaseCommand {
3030

3131
async prune () {
3232
const where = this.npm.prefix
33-
const arb = new Arborist({
33+
const opts = {
3434
...this.npm.flatOptions,
3535
path: where,
36-
})
37-
await arb.prune(this.npm.flatOptions)
36+
log: this.npm.log,
37+
}
38+
const arb = new Arborist(opts)
39+
await arb.prune(opts)
3840
await reifyFinish(this.npm, arb)
3941
}
4042
}

deps/npm/lib/set-script.js

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const log = require('npmlog')
22
const fs = require('fs')
33
const parseJSON = require('json-parse-even-better-errors')
44
const rpj = require('read-package-json-fast')
5+
const { resolve } = require('path')
56

67
const BaseCommand = require('./base-command.js')
78
class SetScript extends BaseCommand {
@@ -20,6 +21,16 @@ class SetScript extends BaseCommand {
2021
return ['[<script>] [<command>]']
2122
}
2223

24+
async completion (opts) {
25+
const argv = opts.conf.argv.remain
26+
if (argv.length === 2) {
27+
// find the script name
28+
const json = resolve(this.npm.localPrefix, 'package.json')
29+
const { scripts = {} } = await rpj(json).catch(er => ({}))
30+
return Object.keys(scripts)
31+
}
32+
}
33+
2334
exec (args, cb) {
2435
this.set(args).then(() => cb()).catch(cb)
2536
}

deps/npm/lib/uninstall.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
3838
async uninstall (args) {
3939
// the /path/to/node_modules/..
4040
const global = this.npm.config.get('global')
41-
const prefix = this.npm.config.get('prefix')
42-
const path = global ? resolve(this.npm.globalDir, '..') : prefix
41+
const path = global
42+
? resolve(this.npm.globalDir, '..')
43+
: this.npm.localPrefix
4344

4445
if (!args.length) {
4546
if (!global)
@@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
6061
}
6162
}
6263

63-
const arb = new Arborist({ ...this.npm.flatOptions, path })
64-
65-
await arb.reify({
64+
const opts = {
6665
...this.npm.flatOptions,
66+
path,
67+
log: this.npm.log,
6768
rm: args,
68-
})
69+
70+
}
71+
const arb = new Arborist(opts)
72+
await arb.reify(opts)
6973
await reifyFinish(this.npm, arb)
7074
}
7175
}

deps/npm/lib/update.js

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class Update extends BaseCommand {
5151

5252
const arb = new Arborist({
5353
...this.npm.flatOptions,
54+
log: this.npm.log,
5455
path: where,
5556
})
5657

0 commit comments

Comments
 (0)