Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: upgrade npm to 7.7.4 #37897

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions deps/npm/AUTHORS
Expand Up @@ -765,3 +765,5 @@ Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
77 changes: 77 additions & 0 deletions deps/npm/CHANGELOG.md
@@ -1,3 +1,80 @@
## v7.7.4 (2021-03-24)

### BUG FIXES

* [`200bee74b`](https://github.com/npm/cli/commit/200bee74b31a738687446b7b535cac67b1c582fd)
[#2951](https://github.com/npm/cli/issues/2951)
fix(config): accept explicit `production=false`
([@wraithgar](https://github.com/wraithgar))
* [`7b45e9df6`](https://github.com/npm/cli/commit/7b45e9df6102c7bd6e403d1fdc9939581c38f546)
[#2950](https://github.com/npm/cli/issues/2950)
warn if using workspaces config options in `npm config`
([@ruyadorno](https://github.com/ruyadorno))

## v7.7.3 (2021-03-24)

### BUG FIXES

* [`c76f04ac2`](https://github.com/npm/cli/commit/c76f04ac28ddf2ae4df4b3ce0aec684a118de1b5)
[#2925](https://github.com/npm/cli/issues/2925)
fix(set-script): add completion
([@Yash-Singh1](https://github.com/Yash-Singh1))
* [`0379eab69`](https://github.com/npm/cli/commit/0379eab698b78ae4aa89bbe2043607f420e52f11)
[#2929](https://github.com/npm/cli/issues/2929)
fix(install): ignore auditLevel
`npm install` should not be affected by the `auditLevel` config, as the
results of audit do not change its exit status.
([@wraithgar](https://github.com/wraithgar))
* [`98efadeb4`](https://github.com/npm/cli/commit/98efadeb4b2ae9289f14ed6f42a169230faf7239)
[#2923](https://github.com/npm/cli/issues/2923)
fix(audit-level): add `info` audit level
This is a valid level but wasn't configured to be allowed.
Also added this param to the usage output for `npm audit`
([@wraithgar](https://github.com/wraithgar))
* [`e8d2adcf4`](https://github.com/npm/cli/commit/e8d2adcf40ad63030f844c9aa44c6d16e2146797)
[#2945](https://github.com/npm/cli/issues/2945)
config should not error when workspaces are configured
([@nlf](https://github.com/nlf))
* [`aba2bc623`](https://github.com/npm/cli/commit/aba2bc623ea99e563b1b15b81dbb4ba94f86fe4c)
[#2944](https://github.com/npm/cli/issues/2944)
fix(progress): re-add progress bar to reify
The logger was no longer in flatOptions, we pass it in explicitly now
([@wraithgar](https://github.com/wraithgar))
* [`877b4ed29`](https://github.com/npm/cli/commit/877b4ed2925c97b5249a4d33575420dda64f7339)
[#2946](https://github.com/npm/cli/issues/2946)
fix(flatOptions): re-add `_auth`
This was not being added to flatOptions, and things like
`npm-registry-fetch` are looking for it.
([@wraithgar](https://github.com/wraithgar))

## v7.7.2 (2021-03-24)

### BUG FIXES
* [`a4df2b98d`](https://github.com/npm/cli/commit/a4df2b98d89429b19cd29b5fc895cdbfc0a6bd78)
[#2942](https://github.com/npm/cli/issues/2942)
Restore --dev flag, unify --omit flatteners
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES
* [`2cbfaac0e`](https://github.com/npm/cli/commit/2cbfaac0ecd5810316f6d76168ed9618bd11bf3a)
`hosted-git-info@4.0.2`
* [#83](https://github.com/npm/hosted-git-info/pull/83) Do not parse
urls for gitlab
([@nlf](https://github.com/nlf))

## v7.7.1 (2021-03-24)

### BUG FIXES

* [`543b0e39b`](https://github.com/npm/cli/commit/543b0e39bcb94fc408804b01ca9c0d7b960b2681)
[#2930](https://github.com/npm/cli/issues/2930)
fix(uninstall): use correct local prefix
([@jameschensmith](https://github.com/jameschensmith))
* [`dce4960ef`](https://github.com/npm/cli/commit/dce4960ef6d52af128affe7755b2ca72de913b6c)
[#2932](https://github.com/npm/cli/issues/2932)
fix(config): flatten savePrefix properly
([@wraithgar](https://github.com/wraithgar))

## v7.7.0 (2021-03-23)

### FEATURES
Expand Down
1 change: 1 addition & 0 deletions deps/npm/docs/content/commands/npm-find-dupes.md
Expand Up @@ -21,3 +21,4 @@ duplications, without actually changing the package tree.
* [npm ls](/cli-commands/ls)
* [npm update](/cli-commands/update)
* [npm install](/cli-commands/install)

14 changes: 11 additions & 3 deletions deps/npm/docs/content/using-npm/config.md
Expand Up @@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "low", "moderate", "high", "critical", "none", or null
* Type: "info", "low", "moderate", "high", "critical", "none", or null

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

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

#### `dev`

* Default: false
* Type: Boolean
* DEPRECATED: Please use --include=dev instead.

Alias for `--include=dev`.

#### `init.author.email`

* Default: ""
Expand Down Expand Up @@ -1451,8 +1459,8 @@ Alias for --include=optional or --omit=optional

#### `production`

* Default: false
* Type: Boolean
* Default: null
* Type: null or Boolean
* DEPRECATED: Use `--omit=dev` instead.

Alias for `--omit=dev`
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Expand Up @@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.7.0 /path/to/npm
<pre lang="bash"><code>npm@7.7.4 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Expand Up @@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.7.0</p>
<p>7.7.4</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
15 changes: 11 additions & 4 deletions deps/npm/docs/output/using-npm/config.html

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions deps/npm/lib/audit.js
Expand Up @@ -18,6 +18,7 @@ class Audit extends BaseCommand {
/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return [
'audit-level',
'dry-run',
'force',
'json',
Expand Down
11 changes: 8 additions & 3 deletions deps/npm/lib/ci.js
Expand Up @@ -42,8 +42,14 @@ class CI extends BaseCommand {
}

const where = this.npm.prefix
const arb = new Arborist({ ...this.npm.flatOptions, path: where })
const opts = {
...this.npm.flatOptions,
path: where,
log: this.npm.log,
save: false, // npm ci should never modify the lockfile or package.json
}

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

const ignoreScripts = this.npm.config.get('ignore-scripts')
// run the same set of scripts that `npm install` runs.
Expand Down
5 changes: 5 additions & 0 deletions deps/npm/lib/config.js
Expand Up @@ -88,6 +88,11 @@ class Config extends BaseCommand {
this.config(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.npm.log.warn('config', 'This command does not support workspaces.')
this.exec(args, cb)
}

async config ([action, ...args]) {
this.npm.log.disableProgress()
try {
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/dedupe.js
Expand Up @@ -30,6 +30,7 @@ class Dedupe extends BaseCommand {
const where = this.npm.prefix
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
path: where,
dryRun,
}
Expand Down
12 changes: 10 additions & 2 deletions deps/npm/lib/exec.js
Expand Up @@ -175,7 +175,11 @@ class Exec extends BaseCommand {
if (needInstall) {
const installDir = this.cacheInstallDir(packages)
await mkdirp(installDir)
const arb = new Arborist({ ...this.npm.flatOptions, path: installDir })
const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: installDir,
})
const tree = await arb.loadActual()

// at this point, we have to ensure that we get the exact same
Expand Down Expand Up @@ -212,7 +216,11 @@ class Exec extends BaseCommand {
throw new Error('canceled')
}
}
await arb.reify({ ...this.npm.flatOptions, add })
await arb.reify({
...this.npm.flatOptions,
log: this.npm.log,
add,
})
}
pathArr.unshift(resolve(installDir, 'node_modules/.bin'))
}
Expand Down
13 changes: 7 additions & 6 deletions deps/npm/lib/install.js
Expand Up @@ -126,15 +126,16 @@ class Install extends BaseCommand {
if (this.npm.config.get('dev'))
log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.')

const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
log: this.npm.log,
auditLevel: null,
path: where,
})

await arb.reify({
...this.npm.flatOptions,
add: args,
})
}
const arb = new Arborist(opts)
await arb.reify(opts)

if (!args.length && !isGlobalInstall && !ignoreScripts) {
const scriptShell = this.npm.config.get('script-shell') || undefined
const scripts = [
Expand Down
9 changes: 8 additions & 1 deletion deps/npm/lib/link.js
Expand Up @@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
Expand Down Expand Up @@ -113,12 +114,14 @@ class Link extends BaseCommand {
// reify all the pending names as symlinks there
const localArb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: this.npm.prefix,
save,
})
await localArb.reify({
...this.npm.flatOptions,
path: this.npm.prefix,
log: this.npm.log,
add: names.map(l => `file:${resolve(globalTop, 'node_modules', l)}`),
save,
})
Expand All @@ -131,9 +134,13 @@ class Link extends BaseCommand {
const arb = new Arborist({
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
})
await arb.reify({ add: [`file:${this.npm.prefix}`] })
await arb.reify({
add: [`file:${this.npm.prefix}`],
log: this.npm.log,
})
await reifyFinish(this.npm, arb)
}

Expand Down
8 changes: 5 additions & 3 deletions deps/npm/lib/prune.js
Expand Up @@ -30,11 +30,13 @@ class Prune extends BaseCommand {

async prune () {
const where = this.npm.prefix
const arb = new Arborist({
const opts = {
...this.npm.flatOptions,
path: where,
})
await arb.prune(this.npm.flatOptions)
log: this.npm.log,
}
const arb = new Arborist(opts)
await arb.prune(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
11 changes: 11 additions & 0 deletions deps/npm/lib/set-script.js
Expand Up @@ -2,6 +2,7 @@ const log = require('npmlog')
const fs = require('fs')
const parseJSON = require('json-parse-even-better-errors')
const rpj = require('read-package-json-fast')
const { resolve } = require('path')

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

async completion (opts) {
const argv = opts.conf.argv.remain
if (argv.length === 2) {
// find the script name
const json = resolve(this.npm.localPrefix, 'package.json')
const { scripts = {} } = await rpj(json).catch(er => ({}))
return Object.keys(scripts)
}
}

exec (args, cb) {
this.set(args).then(() => cb()).catch(cb)
}
Expand Down
16 changes: 10 additions & 6 deletions deps/npm/lib/uninstall.js
Expand Up @@ -38,8 +38,9 @@ class Uninstall extends BaseCommand {
async uninstall (args) {
// the /path/to/node_modules/..
const global = this.npm.config.get('global')
const prefix = this.npm.config.get('prefix')
const path = global ? resolve(this.npm.globalDir, '..') : prefix
const path = global
? resolve(this.npm.globalDir, '..')
: this.npm.localPrefix

if (!args.length) {
if (!global)
Expand All @@ -60,12 +61,15 @@ class Uninstall extends BaseCommand {
}
}

const arb = new Arborist({ ...this.npm.flatOptions, path })

await arb.reify({
const opts = {
...this.npm.flatOptions,
path,
log: this.npm.log,
rm: args,
})

}
const arb = new Arborist(opts)
await arb.reify(opts)
await reifyFinish(this.npm, arb)
}
}
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/update.js
Expand Up @@ -51,6 +51,7 @@ class Update extends BaseCommand {

const arb = new Arborist({
...this.npm.flatOptions,
log: this.npm.log,
path: where,
})

Expand Down