Skip to content

Commit

Permalink
deps: upgrade npm to 7.16.0
Browse files Browse the repository at this point in the history
PR-URL: #38920
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
  • Loading branch information
npm-robot authored and targos committed Jun 11, 2021
1 parent 336571f commit 70af146
Show file tree
Hide file tree
Showing 175 changed files with 2,906 additions and 2,470 deletions.
4 changes: 4 additions & 0 deletions deps/npm/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ docs/nav.yml
docs/config.json
docs/dockhand.js
docs/template.html
docs/package.json
docs/node_modules
# docs source files are required by `npm help-search` do not exclude those
!docs/content/

# don't ignore .npmignore files
# these are used in some tests.
Expand Down
64 changes: 64 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
## v7.16.0 (2021-06-03)

## FEATURES

* [`e92b5f2ba`](https://github.com/npm/cli/commit/e92b5f2ba07746ae07646566f3dc73c9e004a2fc)
`npm-registry-fetch@11.0.0`
* feat: improved logging of cache status

## BUG FIXES

* [`e864bd3ce`](https://github.com/npm/cli/commit/e864bd3ce8e8467e0f8ebb499dc2daf06143bc33)
[#3345](https://github.com/npm/cli/issues/3345)
fix(update-notifier): do not update notify when installing npm@spec
([@isaacs](https://github.com/isaacs))
* [`aafe23572`](https://github.com/npm/cli/commit/aafe2357279230e333d3342752a28fce6b9cd152)
[#3348](https://github.com/npm/cli/issues/3348)
fix(update-notifier): parallelize check for updates
([@isaacs](https://github.com/isaacs))

## DOCUMENTATION

* [`bc9c57dda`](https://github.com/npm/cli/commit/bc9c57dda7cf3abcdee17550205daf1a82e90438)
[#3353](https://github.com/npm/cli/issues/3353)
fix(docs): remove documentation for '--scripts-prepend-node-path' as it was removed in npm@7
([@gimli01](https://github.com/gimli01))
* [`ca2822110`](https://github.com/npm/cli/commit/ca28221103aa0e9ccba7043ac515a541b625c53a)
[#3360](https://github.com/npm/cli/issues/3360)
fix(docs): link foreground-scripts w/ loglevel
([@wraithgar](https://github.com/wraithgar))
* [`fb630b5a9`](https://github.com/npm/cli/commit/fb630b5a9af86c71602803297634ec291eeedee0)
[#3342](https://github.com/npm/cli/issues/3342)
chore(docs): manage docs as a workspace
([@ruyadorno](https://github.com/ruyadorno))

## DEPENDENCIES

* [`54de5c6a4`](https://github.com/npm/cli/commit/54de5c6a4cd593bbbe364132f3f7348586441b31)
`npm-package-arg@8.1.4`:
* fix: trim whitespace from fetchSpec
* fix: handle file: when root directory begins with a special character
* [`e92b5f2ba`](https://github.com/npm/cli/commit/e92b5f2ba07746ae07646566f3dc73c9e004a2fc)
`make-fetch-happen@9.0.1`
* breaking: complete refactor of caching. drops warning headers,
prevents cache indexes from growing for every request, correctly
handles varied requests to the same url, and now caches redirects.
* fix: support url-encoded proxy authorization
* fix: do not lazy-load proxy agents or agentkeepalive. fixes the
intermittent failures to update npm on slower connections.
`npm-registry-fetch@11.0.0`
* breaking: drop handling of deprecated warning headers
* docs: fix header type for npm-command
* docs: update registry param
* feat: improved logging of cache status
* [`23c50a45f`](https://github.com/npm/cli/commit/23c50a45f59ea3ed4c36f35df15e54adc5603034)
`make-fetch-happen@9.0.2`:
* fix: work around negotiator's lazy loading

## AUTOMATION

* [`c4ef78b08`](https://github.com/npm/cli/commit/c4ef78b08e6859fc191cabbe58c8d88c070e0612)
[#3344](https://github.com/npm/cli/issues/3344)
fix(automation): update incorrect variable name in create-cli-deps-pr workflow
([@gimli01](https://github.com/gimli01))

## v7.15.1 (2021-05-31)

### BUG FIXES
Expand Down
7 changes: 1 addition & 6 deletions deps/npm/docs/content/commands/npm-run-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,7 @@ can use the `INIT_CWD` environment variable, which holds the full path you
were in when you ran `npm run`.

`npm run` sets the `NODE` environment variable to the `node` executable
with which `npm` is executed. Also, if the `--scripts-prepend-node-path` is
passed, the directory within which `node` resides is added to the `PATH`.
If `--scripts-prepend-node-path=auto` is passed (which has been the default
in `npm` v3), this is only performed when that `node` executable is not
found in the `PATH`.
with which `npm` is executed.

If you try to run a script without having a `node_modules` directory and it
fails, you will be given a warning to run `npm install`, just in case you've
Expand Down Expand Up @@ -138,7 +134,6 @@ npm test -w a -w b
This last command will run `test` in both `./packages/a` and `./packages/b`
packages.


### Configuration

<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
Expand Down
2 changes: 2 additions & 0 deletions deps/npm/docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,8 @@ What level of logs to report. On failure, *all* logs are written to
Any logs of a higher level than the setting are shown. The default is
"notice".

See also the `foreground-scripts` config.

#### `logs-max`

* Default: 10
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/docs/output/commands/npm-ls.html
Original file line number Diff line number Diff line change
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.15.1 /path/to/npm
<pre lang="bash"><code>npm@7.16.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre>
Expand Down Expand Up @@ -337,4 +337,4 @@ <h3 id="see-also">See Also</h3>



</body></html>
</body></html>
6 changes: 1 addition & 5 deletions deps/npm/docs/output/commands/npm-run-script.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,7 @@ <h3 id="description">Description</h3>
can use the <code>INIT_CWD</code> environment variable, which holds the full path you
were in when you ran <code>npm run</code>.</p>
<p><code>npm run</code> sets the <code>NODE</code> environment variable to the <code>node</code> executable
with which <code>npm</code> is executed. Also, if the <code>--scripts-prepend-node-path</code> is
passed, the directory within which <code>node</code> resides is added to the <code>PATH</code>.
If <code>--scripts-prepend-node-path=auto</code> is passed (which has been the default
in <code>npm</code> v3), this is only performed when that <code>node</code> executable is not
found in the <code>PATH</code>.</p>
with which <code>npm</code> is executed.</p>
<p>If you try to run a script without having a <code>node_modules</code> directory and it
fails, you will be given a warning to run <code>npm install</code>, just in case you’ve
forgotten.</p>
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/docs/output/commands/npm.html
Original file line number Diff line number Diff line change
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.15.1</p>
<p>7.16.0</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 Expand Up @@ -292,4 +292,4 @@ <h3 id="see-also">See Also</h3>



</body></html>
</body></html>
1 change: 1 addition & 0 deletions deps/npm/docs/output/using-npm/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ <h4 id="loglevel"><code>loglevel</code></h4>
<code>npm-debug.log</code> in the current working directory.</p>
<p>Any logs of a higher level than the setting are shown. The default is
“notice”.</p>
<p>See also the <code>foreground-scripts</code> config.</p>
<h4 id="logs-max"><code>logs-max</code></h4>
<ul>
<li>Default: 10</li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = (process) => {
npm.config.set('usage', false, 'cli')
}

npm.updateNotification = await updateNotifier(npm)
updateNotifier(npm)

const cmd = npm.argv.shift()
const impl = npm.commands[cmd]
Expand Down
2 changes: 2 additions & 0 deletions deps/npm/lib/utils/config/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1128,6 +1128,8 @@ define('loglevel', {
Any logs of a higher level than the setting are shown. The default is
"notice".
See also the \`foreground-scripts\` config.
`,
})

Expand Down
4 changes: 3 additions & 1 deletion deps/npm/lib/utils/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ const errorHandler = (er) => {
if (cbCalled)
er = er || new Error('Callback called more than once.')

if (npm.updateNotification) {
// only show the notification if it finished before the other stuff we
// were doing. no need to hang on `npm -v` or something.
if (typeof npm.updateNotification === 'string') {
const { level } = log
log.level = log.levels.notice
log.notice('', npm.updateNotification)
Expand Down
36 changes: 23 additions & 13 deletions deps/npm/lib/utils/update-notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,32 @@ const { resolve } = require('path')
const isGlobalNpmUpdate = npm => {
return npm.flatOptions.global &&
['install', 'update'].includes(npm.command) &&
npm.argv.includes('npm')
npm.argv.some(arg => /^npm(@|$)/.test(arg))
}

// update check frequency
const DAILY = 1000 * 60 * 60 * 24
const WEEKLY = DAILY * 7

const updateTimeout = async (npm, duration) => {
// don't put it in the _cacache folder, just in npm's cache
const lastCheckedFile = npm =>
resolve(npm.flatOptions.cache, '../_update-notifier-last-checked')

const checkTimeout = async (npm, duration) => {
const t = new Date(Date.now() - duration)
// don't put it in the _cacache folder, just in npm's cache
const f = resolve(npm.flatOptions.cache, '../_update-notifier-last-checked')
const f = lastCheckedFile(npm)
// if we don't have a file, then definitely check it.
const st = await stat(f).catch(() => ({ mtime: t - 1 }))
return t > st.mtime
}

if (t > st.mtime) {
// best effort, if this fails, it's ok.
// might be using /dev/null as the cache or something weird like that.
await writeFile(f, '').catch(() => {})
return true
} else
return false
const updateTimeout = async npm => {
// best effort, if this fails, it's ok.
// might be using /dev/null as the cache or something weird like that.
await writeFile(lastCheckedFile(npm), '').catch(() => {})
}

const updateNotifier = module.exports = async (npm, spec = 'latest') => {
const updateNotifier = async (npm, spec = 'latest') => {
// never check for updates in CI, when updating npm already, or opted out
if (!npm.config.get('update-notifier') ||
isGlobalNpmUpdate(npm) ||
Expand All @@ -57,7 +59,7 @@ const updateNotifier = module.exports = async (npm, spec = 'latest') => {
const duration = spec !== 'latest' ? DAILY : WEEKLY

// if we've already checked within the specified duration, don't check again
if (!(await updateTimeout(npm, duration)))
if (!(await checkTimeout(npm, duration)))
return null

// if they're currently using a prerelease, nudge to the next prerelease
Expand Down Expand Up @@ -113,3 +115,11 @@ const updateNotifier = module.exports = async (npm, spec = 'latest') => {

return messagec
}

// only update the notification timeout if we actually finished checking
module.exports = async npm => {
const notification = await updateNotifier(npm)
// intentional. do not await this. it's a best-effort update.
updateTimeout(npm)
npm.updateNotification = notification
}
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-access.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-ACCESS" "1" "May 2021" "" ""
.TH "NPM\-ACCESS" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-adduser.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-ADDUSER" "1" "May 2021" "" ""
.TH "NPM\-ADDUSER" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-audit.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-AUDIT" "1" "May 2021" "" ""
.TH "NPM\-AUDIT" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-audit\fR \- Run a security audit
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bin.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "1" "May 2021" "" ""
.TH "NPM\-BIN" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-bugs.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "1" "May 2021" "" ""
.TH "NPM\-BUGS" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Report bugs for a package in a web browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-cache.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "1" "May 2021" "" ""
.TH "NPM\-CACHE" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-ci.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-CI" "1" "May 2021" "" ""
.TH "NPM\-CI" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-ci\fR \- Install a project with a clean slate
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-completion.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-COMPLETION" "1" "May 2021" "" ""
.TH "NPM\-COMPLETION" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-config.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "1" "May 2021" "" ""
.TH "NPM\-CONFIG" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-dedupe.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-DEDUPE" "1" "May 2021" "" ""
.TH "NPM\-DEDUPE" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication in the package tree
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-deprecate.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-DEPRECATE" "1" "May 2021" "" ""
.TH "NPM\-DEPRECATE" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-diff.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-DIFF" "1" "May 2021" "" ""
.TH "NPM\-DIFF" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-diff\fR \- The registry diff command
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-dist-tag.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-DIST\-TAG" "1" "May 2021" "" ""
.TH "NPM\-DIST\-TAG" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-docs.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-DOCS" "1" "May 2021" "" ""
.TH "NPM\-DOCS" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Open documentation for a package in a web browser
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-doctor.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-DOCTOR" "1" "May 2021" "" ""
.TH "NPM\-DOCTOR" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-doctor\fR \- Check your npm environment
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-edit.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-EDIT" "1" "May 2021" "" ""
.TH "NPM\-EDIT" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-exec.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-EXEC" "1" "May 2021" "" ""
.TH "NPM\-EXEC" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-exec\fR \- Run a command from a local or remote npm package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-explain.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLAIN" "1" "May 2021" "" ""
.TH "NPM\-EXPLAIN" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-explain\fR \- Explain installed packages
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-explore.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLORE" "1" "May 2021" "" ""
.TH "NPM\-EXPLORE" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-find-dupes.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-FIND\-DUPES" "1" "May 2021" "" ""
.TH "NPM\-FIND\-DUPES" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-find-dupes\fR \- Find duplication in the package tree
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-fund.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-FUND" "1" "May 2021" "" ""
.TH "NPM\-FUND" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-fund\fR \- Retrieve funding information
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-help-search.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-HELP\-SEARCH" "1" "May 2021" "" ""
.TH "NPM\-HELP\-SEARCH" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SS Synopsis
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/man/man1/npm-help.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH "NPM\-HELP" "1" "May 2021" "" ""
.TH "NPM\-HELP" "1" "June 2021" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SS Synopsis
Expand Down
Loading

0 comments on commit 70af146

Please sign in to comment.