X Tutup
The Wayback Machine - https://web.archive.org/web/20220419150215/https://github.com/nodejs/node/commit/649e04c4a5
Skip to content
Permalink
Browse files
deps: upgrade npm to 7.7.4
PR-URL: #37897
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
ruyadorno committed Mar 30, 2021
1 parent 3ab223d commit 649e04c4a5eb2d62c76003f4e3e5e045419a0d59
Showing with 1,001 additions and 2,204 deletions.
  1. +2 −0 deps/npm/AUTHORS
  2. +77 −0 deps/npm/CHANGELOG.md
  3. +1 −0 deps/npm/docs/content/commands/npm-find-dupes.md
  4. +11 −3 deps/npm/docs/content/using-npm/config.md
  5. +1 −1 deps/npm/docs/output/commands/npm-ls.html
  6. +1 −1 deps/npm/docs/output/commands/npm.html
  7. +11 −4 deps/npm/docs/output/using-npm/config.html
  8. +1 −0 deps/npm/lib/audit.js
  9. +8 −3 deps/npm/lib/ci.js
  10. +5 −0 deps/npm/lib/config.js
  11. +1 −0 deps/npm/lib/dedupe.js
  12. +10 −2 deps/npm/lib/exec.js
  13. +7 −6 deps/npm/lib/install.js
  14. +8 −1 deps/npm/lib/link.js
  15. +5 −3 deps/npm/lib/prune.js
  16. +11 −0 deps/npm/lib/set-script.js
  17. +10 −6 deps/npm/lib/uninstall.js
  18. +1 −0 deps/npm/lib/update.js
  19. +50 −36 deps/npm/lib/utils/config/definitions.js
  20. +1 −1 deps/npm/man/man1/npm-ls.1
  21. +1 −1 deps/npm/man/man1/npm.1
  22. +15 −3 deps/npm/man/man7/config.7
  23. +1 −0 deps/npm/node_modules/@npmcli/disparity-colors/CHANGELOG.md
  24. +2 −1 deps/npm/node_modules/@npmcli/disparity-colors/README.md
  25. +6 −2 deps/npm/node_modules/cli-table3/node_modules/string-width/index.js
  26. +1 −1 deps/npm/node_modules/cli-table3/node_modules/string-width/package.json
  27. +1 −1 deps/npm/node_modules/cli-table3/node_modules/string-width/readme.md
  28. +1 −1 deps/npm/node_modules/diff/README.md
  29. +32 −0 deps/npm/node_modules/env-paths/index.d.ts
  30. +1 −1 deps/npm/node_modules/env-paths/package.json
  31. +44 −5 deps/npm/node_modules/env-paths/readme.md
  32. +1 −1 deps/npm/node_modules/hosted-git-info/git-host-info.js
  33. +1 −1 deps/npm/node_modules/hosted-git-info/package.json
  34. +1 −0 deps/npm/node_modules/libnpmdiff/CHANGELOG.md
  35. +3 −2 deps/npm/node_modules/libnpmdiff/README.md
  36. +8 −0 deps/npm/node_modules/mime-db/HISTORY.md
  37. +3 −3 deps/npm/node_modules/mime-db/README.md
  38. +74 −3 deps/npm/node_modules/mime-db/db.json
  39. +9 −9 deps/npm/node_modules/mime-db/package.json
  40. +9 −0 deps/npm/node_modules/mime-types/HISTORY.md
  41. +0 −10 deps/npm/node_modules/mime-types/README.md
  42. +7 −7 deps/npm/node_modules/mime-types/package.json
  43. +0 −185 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/CHANGELOG.md
  44. +0 −13 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/LICENSE
  45. +0 −133 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/README.md
  46. +0 −154 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host-info.js
  47. +0 −110 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/git-host.js
  48. +0 −237 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/index.js
  49. +0 −52 deps/npm/node_modules/normalize-package-data/node_modules/hosted-git-info/package.json
  50. +0 −185 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/CHANGELOG.md
  51. +0 −13 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/LICENSE
  52. +0 −133 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/README.md
  53. +0 −154 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host-info.js
  54. +0 −110 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/git-host.js
  55. +0 −237 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/index.js
  56. +0 −52 deps/npm/node_modules/npm-package-arg/node_modules/hosted-git-info/package.json
  57. +1 −1 deps/npm/node_modules/npm-pick-manifest/CHANGELOG.md
  58. +1 −0 deps/npm/node_modules/resolve/test/mock_sync.js
  59. +1 −1 deps/npm/node_modules/retry/Readme.md
  60. +20 −6 deps/npm/node_modules/socks/README.md
  61. +68 −22 deps/npm/node_modules/socks/build/client/socksclient.js
  62. +1 −1 deps/npm/node_modules/socks/build/client/socksclient.js.map
  63. +10 −2 deps/npm/node_modules/socks/build/common/constants.js
  64. +1 −1 deps/npm/node_modules/socks/build/common/constants.js.map
  65. +27 −0 deps/npm/node_modules/socks/build/common/helpers.js
  66. +1 −1 deps/npm/node_modules/socks/build/common/helpers.js.map
  67. +8 −8 deps/npm/node_modules/socks/package.json
  68. +5 −0 deps/npm/node_modules/socks/typings/client/socksclient.d.ts
  69. +10 −1 deps/npm/node_modules/socks/typings/common/constants.d.ts
  70. +4 −4 deps/npm/node_modules/uuid/README.md
  71. +2 −2 deps/npm/package.json
  72. +1 −0 deps/npm/tap-snapshots/test-lib-utils-config-definitions.js-TAP.test.js
  73. +11 −3 deps/npm/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js
  74. +241 −241 deps/npm/tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
  75. +1 −1 deps/npm/tap-snapshots/test-lib-utils-tar.js-TAP.test.js
  76. +18 −1 deps/npm/test/lib/config.js
  77. +4 −2 deps/npm/test/lib/install.js
  78. +37 −0 deps/npm/test/lib/set-script.js
  79. +3 −3 deps/npm/test/lib/uninstall.js
  80. +4 −3 deps/npm/test/lib/update.js
  81. +72 −13 deps/npm/test/lib/utils/config/definitions.js
  82. +6 −0 deps/npm/test/lib/utils/config/flatten.js
@@ -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>
@@ -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
@@ -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)

@@ -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.
@@ -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: ""
@@ -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`
@@ -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>
@@ -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

Large diffs are not rendered by default.

@@ -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',
@@ -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)
@@ -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.
@@ -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 {
@@ -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,
}
@@ -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
@@ -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'))
}
@@ -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 = [
@@ -66,6 +66,7 @@ class Link extends BaseCommand {
const globalOpts = {
...this.npm.flatOptions,
path: globalTop,
log: this.npm.log,
global: true,
prune: false,
}
@@ -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,
})
@@ -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)
}

@@ -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)
}
}
@@ -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 {
@@ -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)
}
@@ -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)
@@ -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)
}
}
@@ -51,6 +51,7 @@ class Update extends BaseCommand {

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

0 comments on commit 649e04c

Please sign in to comment.
X Tutup