diff options
author | npm-robot <ops+robot@npmjs.com> | 2021-06-03 20:17:35 +0000 |
---|---|---|
committer | Ruy Adorno <ruyadorno@hotmail.com> | 2021-06-08 13:57:12 -0400 |
commit | 306a57d33191d171bc148c0d06254730b6faa28e (patch) | |
tree | 0063635a2e73f60b64aa8315a4796d3a1a498128 /deps | |
parent | f504c9c6b897f14891f147ad4a05e743133a0d35 (diff) | |
download | node-new-306a57d33191d171bc148c0d06254730b6faa28e.tar.gz |
deps: upgrade npm to 7.16.0
PR-URL: https://github.com/nodejs/node/pull/38920
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps')
175 files changed, 2906 insertions, 2470 deletions
diff --git a/deps/npm/.npmignore b/deps/npm/.npmignore index 9d02b99f91..ae91e64827 100644 --- a/deps/npm/.npmignore +++ b/deps/npm/.npmignore @@ -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. diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index c86373bcde..027731cbe2 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -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 diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 1d11a74faa..5e3828c407 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -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 @@ -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 --> diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index 25b4d424e8..44b79a801f 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -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 diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index f87185539d..1b33d79cc1 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -159,7 +159,7 @@ tree at all, use <a href="../commands/npm-explain.html"><code>npm explain</code> 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> @@ -337,4 +337,4 @@ Edit this page on GitHub -</body></html>
\ No newline at end of file +</body></html> diff --git a/deps/npm/docs/output/commands/npm-run-script.html b/deps/npm/docs/output/commands/npm-run-script.html index 54afe9f240..cbae66c280 100644 --- a/deps/npm/docs/output/commands/npm-run-script.html +++ b/deps/npm/docs/output/commands/npm-run-script.html @@ -190,11 +190,7 @@ script to use different behavior based on what subdirectory you’re in, you 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> diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 6469e96933..c3ca080469 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -148,7 +148,7 @@ npm command-line interface <pre lang="bash"><code>npm <command> [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 @@ -292,4 +292,4 @@ Edit this page on GitHub -</body></html>
\ No newline at end of file +</body></html> diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index 7e722bdc18..e11eb0eec4 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -793,6 +793,7 @@ npm registry. Must be IPv4 in versions of Node prior to 0.12.</p> <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> diff --git a/deps/npm/lib/cli.js b/deps/npm/lib/cli.js index f42132f944..d4a6764585 100644 --- a/deps/npm/lib/cli.js +++ b/deps/npm/lib/cli.js @@ -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] diff --git a/deps/npm/lib/utils/config/definitions.js b/deps/npm/lib/utils/config/definitions.js index 22fff38787..ea9665b543 100644 --- a/deps/npm/lib/utils/config/definitions.js +++ b/deps/npm/lib/utils/config/definitions.js @@ -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. `, }) diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index 1fc31df44f..da716679d2 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -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) diff --git a/deps/npm/lib/utils/update-notifier.js b/deps/npm/lib/utils/update-notifier.js index 0a19be94e6..ed5806ced2 100644 --- a/deps/npm/lib/utils/update-notifier.js +++ b/deps/npm/lib/utils/update-notifier.js @@ -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) || @@ -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 @@ -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 +} diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 9d6faac7a3..75b1e990e5 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -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 diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index de7c5424d3..213191e296 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -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 diff --git a/deps/npm/man/man1/npm-audit.1 b/deps/npm/man/man1/npm-audit.1 index a012de1608..dfd4f7ec87 100644 --- a/deps/npm/man/man1/npm-audit.1 +++ b/deps/npm/man/man1/npm-audit.1 @@ -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 diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 957732cb94..5206fc0ece 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -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 diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 72a1e2d511..d07e7e35f5 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -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 diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index a2e140c935..02a4f6888f 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -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 diff --git a/deps/npm/man/man1/npm-ci.1 b/deps/npm/man/man1/npm-ci.1 index ebbf853078..cdbc318d30 100644 --- a/deps/npm/man/man1/npm-ci.1 +++ b/deps/npm/man/man1/npm-ci.1 @@ -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 diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index dffedb6b63..d853c9bbe3 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -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 diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index a2a357f861..4eb04f2f00 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -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 diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 4dc5896b2d..741e613b1c 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -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 diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index d705787d73..81ef20ada5 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -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 diff --git a/deps/npm/man/man1/npm-diff.1 b/deps/npm/man/man1/npm-diff.1 index fb32b06868..d2251146e7 100644 --- a/deps/npm/man/man1/npm-diff.1 +++ b/deps/npm/man/man1/npm-diff.1 @@ -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 diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 5f52ff5604..edb31fad15 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -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 diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index aff1d30424..f181d676c9 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -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 diff --git a/deps/npm/man/man1/npm-doctor.1 b/deps/npm/man/man1/npm-doctor.1 index 6c2fe5684d..3cb8003339 100644 --- a/deps/npm/man/man1/npm-doctor.1 +++ b/deps/npm/man/man1/npm-doctor.1 @@ -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 diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 231a43afbb..a6d045db8a 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -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 diff --git a/deps/npm/man/man1/npm-exec.1 b/deps/npm/man/man1/npm-exec.1 index 92d81795ad..f3b991a333 100644 --- a/deps/npm/man/man1/npm-exec.1 +++ b/deps/npm/man/man1/npm-exec.1 @@ -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 diff --git a/deps/npm/man/man1/npm-explain.1 b/deps/npm/man/man1/npm-explain.1 index 6c8df53652..507a68074f 100644 --- a/deps/npm/man/man1/npm-explain.1 +++ b/deps/npm/man/man1/npm-explain.1 @@ -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 diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 606776e29f..b4ca707a09 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -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 diff --git a/deps/npm/man/man1/npm-find-dupes.1 b/deps/npm/man/man1/npm-find-dupes.1 index fe8ead43e8..e3ecfe15cd 100644 --- a/deps/npm/man/man1/npm-find-dupes.1 +++ b/deps/npm/man/man1/npm-find-dupes.1 @@ -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 diff --git a/deps/npm/man/man1/npm-fund.1 b/deps/npm/man/man1/npm-fund.1 index 09b43ace17..6d098b8804 100644 --- a/deps/npm/man/man1/npm-fund.1 +++ b/deps/npm/man/man1/npm-fund.1 @@ -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 diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index f99582872b..3554328daa 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -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 diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 9835fa8943..db9639e94e 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -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 diff --git a/deps/npm/man/man1/npm-hook.1 b/deps/npm/man/man1/npm-hook.1 index e615148ef5..08b52f2c4c 100644 --- a/deps/npm/man/man1/npm-hook.1 +++ b/deps/npm/man/man1/npm-hook.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HOOK" "1" "May 2021" "" "" +.TH "NPM\-HOOK" "1" "June 2021" "" "" .SH "NAME" \fBnpm-hook\fR \- Manage registry hooks .SS Synopsis diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index fab1b127dd..970201eba3 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "May 2021" "" "" +.TH "NPM\-INIT" "1" "June 2021" "" "" .SH "NAME" \fBnpm-init\fR \- Create a package\.json file .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-ci-test.1 b/deps/npm/man/man1/npm-install-ci-test.1 index ef7ee7c8cb..1267c08672 100644 --- a/deps/npm/man/man1/npm-install-ci-test.1 +++ b/deps/npm/man/man1/npm-install-ci-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-CI\-TEST" "1" "May 2021" "" "" +.TH "NPM\-INSTALL\-CI\-TEST" "1" "June 2021" "" "" .SH "NAME" \fBnpm-install-ci-test\fR \- Install a project with a clean slate and run tests .SS Synopsis diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index ed77750516..969054201c 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL\-TEST" "1" "May 2021" "" "" +.TH "NPM\-INSTALL\-TEST" "1" "June 2021" "" "" .SH "NAME" \fBnpm-install-test\fR \- Install package(s) and run tests .SS Synopsis diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 37ede56814..94cd6d88a6 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "May 2021" "" "" +.TH "NPM\-INSTALL" "1" "June 2021" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 822e885163..4eea5bef55 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "May 2021" "" "" +.TH "NPM\-LINK" "1" "June 2021" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SS Synopsis diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index ca61850bc2..aaa6c7667c 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "May 2021" "" "" +.TH "NPM\-LOGOUT" "1" "June 2021" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 4821c0d977..450704f45d 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "May 2021" "" "" +.TH "NPM\-LS" "1" "June 2021" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SS Synopsis @@ -26,7 +26,7 @@ example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@7\.15\.1 /path/to/npm +npm@7\.16\.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-org.1 b/deps/npm/man/man1/npm-org.1 index 04c7ea35e7..12b3ffa648 100644 --- a/deps/npm/man/man1/npm-org.1 +++ b/deps/npm/man/man1/npm-org.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ORG" "1" "May 2021" "" "" +.TH "NPM\-ORG" "1" "June 2021" "" "" .SH "NAME" \fBnpm-org\fR \- Manage orgs .SS Synopsis diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 0df4e2b352..b7760dcc27 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "May 2021" "" "" +.TH "NPM\-OUTDATED" "1" "June 2021" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 151d4f50a9..65cce149d8 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "May 2021" "" "" +.TH "NPM\-OWNER" "1" "June 2021" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SS Synopsis diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index f94c048239..541a8a8bd8 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "May 2021" "" "" +.TH "NPM\-PACK" "1" "June 2021" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index f6375b9b2d..22a3448196 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "May 2021" "" "" +.TH "NPM\-PING" "1" "June 2021" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index bc9aaf9101..e8ed7409ac 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "May 2021" "" "" +.TH "NPM\-PREFIX" "1" "June 2021" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SS Synopsis diff --git a/deps/npm/man/man1/npm-profile.1 b/deps/npm/man/man1/npm-profile.1 index 6e9bf429a0..ec658fd327 100644 --- a/deps/npm/man/man1/npm-profile.1 +++ b/deps/npm/man/man1/npm-profile.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PROFILE" "1" "May 2021" "" "" +.TH "NPM\-PROFILE" "1" "June 2021" "" "" .SH "NAME" \fBnpm-profile\fR \- Change settings on your registry profile .SS Synopsis diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 39a186810d..4c599a58ce 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "May 2021" "" "" +.TH "NPM\-PRUNE" "1" "June 2021" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index bb619a2249..ad6a10cd38 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "May 2021" "" "" +.TH "NPM\-PUBLISH" "1" "June 2021" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 8d065b423b..ee52e5b1a1 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "May 2021" "" "" +.TH "NPM\-REBUILD" "1" "June 2021" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 3273f89d14..d251b87e07 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "May 2021" "" "" +.TH "NPM\-REPO" "1" "June 2021" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SS Synopsis diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index cae1f9946e..80bd67acff 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "May 2021" "" "" +.TH "NPM\-RESTART" "1" "June 2021" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 267d18c69d..6ff177e7f7 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "May 2021" "" "" +.TH "NPM\-ROOT" "1" "June 2021" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SS Synopsis diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 9168963943..a38b2a3937 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "May 2021" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "June 2021" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SS Synopsis @@ -74,11 +74,7 @@ can use the \fBINIT_CWD\fP environment variable, which holds the full path you were in when you ran \fBnpm run\fP\|\. .P \fBnpm run\fP sets the \fBNODE\fP environment variable to the \fBnode\fP executable -with which \fBnpm\fP is executed\. Also, if the \fB\-\-scripts\-prepend\-node\-path\fP is -passed, the directory within which \fBnode\fP resides is added to the \fBPATH\fP\|\. -If \fB\-\-scripts\-prepend\-node\-path=auto\fP is passed (which has been the default -in \fBnpm\fP v3), this is only performed when that \fBnode\fP executable is not -found in the \fBPATH\fP\|\. +with which \fBnpm\fP is executed\. .P If you try to run a script without having a \fBnode_modules\fP directory and it fails, you will be given a warning to run \fBnpm install\fP, just in case you've diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index f383ff5614..1373531e85 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "May 2021" "" "" +.TH "NPM\-SEARCH" "1" "June 2021" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-set-script.1 b/deps/npm/man/man1/npm-set-script.1 index 2a9c3e3f14..5bec7da192 100644 --- a/deps/npm/man/man1/npm-set-script.1 +++ b/deps/npm/man/man1/npm-set-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SET\-SCRIPT" "1" "May 2021" "" "" +.TH "NPM\-SET\-SCRIPT" "1" "June 2021" "" "" .SH "NAME" \fBnpm-set-script\fR \- Set tasks in the scripts section of package\.json .SS Synopsis diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index a57ffb1818..a7d3ac9926 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "May 2021" "" "" +.TH "NPM\-SHRINKWRAP" "1" "June 2021" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions for publication .SS Synopsis diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index ab2c3c1f6c..7fdba87d17 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "May 2021" "" "" +.TH "NPM\-STAR" "1" "June 2021" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 5255f99033..cf3bf307cc 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "May 2021" "" "" +.TH "NPM\-STARS" "1" "June 2021" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SS Synopsis diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 2fecb53f87..7f958afc6b 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "May 2021" "" "" +.TH "NPM\-START" "1" "June 2021" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 56f89c9285..161a6062c7 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "May 2021" "" "" +.TH "NPM\-STOP" "1" "June 2021" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index 834d5d1ae3..fadd28e528 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "May 2021" "" "" +.TH "NPM\-TEAM" "1" "June 2021" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SS Synopsis diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index bb9436cfe5..431e3ac85c 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "May 2021" "" "" +.TH "NPM\-TEST" "1" "June 2021" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-token.1 b/deps/npm/man/man1/npm-token.1 index a86dd41e83..623963089f 100644 --- a/deps/npm/man/man1/npm-token.1 +++ b/deps/npm/man/man1/npm-token.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TOKEN" "1" "May 2021" "" "" +.TH "NPM\-TOKEN" "1" "June 2021" "" "" .SH "NAME" \fBnpm-token\fR \- Manage your authentication tokens .SS Synopsis diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index d5f8c66d04..0e11d67d5c 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "May 2021" "" "" +.TH "NPM\-UNINSTALL" "1" "June 2021" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SS Synopsis diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index e30a2a5aef..dbabcca7ce 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "May 2021" "" "" +.TH "NPM\-UNPUBLISH" "1" "June 2021" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SS Synopsis diff --git a/deps/npm/man/man1/npm-unstar.1 b/deps/npm/man/man1/npm-unstar.1 index 90a28b2ca6..24fbacccb7 100644 --- a/deps/npm/man/man1/npm-unstar.1 +++ b/deps/npm/man/man1/npm-unstar.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNSTAR" "1" "May 2021" "" "" +.TH "NPM\-UNSTAR" "1" "June 2021" "" "" .SH "NAME" \fBnpm-unstar\fR \- Remove an item from your favorite packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 09d5239f41..965869d3f8 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "May 2021" "" "" +.TH "NPM\-UPDATE" "1" "June 2021" "" "" .SH "NAME" \fBnpm-update\fR \- Update packages .SS Synopsis diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 148e89566d..a44af8a8c4 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "May 2021" "" "" +.TH "NPM\-VERSION" "1" "June 2021" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SS Synopsis diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index f4d9be3363..aad352a7ab 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "May 2021" "" "" +.TH "NPM\-VIEW" "1" "June 2021" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SS Synopsis diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index dd54af9678..34ea971dea 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "May 2021" "" "" +.TH "NPM\-WHOAMI" "1" "June 2021" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SS Synopsis diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 17b8d38663..fd5e1dba6c 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "May 2021" "" "" +.TH "NPM" "1" "June 2021" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SS Synopsis @@ -10,7 +10,7 @@ npm <command> [args] .RE .SS Version .P -7\.15\.1 +7\.16\.0 .SS Description .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man1/npx.1 b/deps/npm/man/man1/npx.1 index 76305688fb..234f746787 100644 --- a/deps/npm/man/man1/npx.1 +++ b/deps/npm/man/man1/npx.1 @@ -1,4 +1,4 @@ -.TH "NPX" "1" "May 2021" "" "" +.TH "NPX" "1" "June 2021" "" "" .SH "NAME" \fBnpx\fR \- Run a command from a local or remote npm package .SS Synopsis diff --git a/deps/npm/man/man5/folders.5 b/deps/npm/man/man5/folders.5 index ccf0c4f6e8..3360a8410e 100644 --- a/deps/npm/man/man5/folders.5 +++ b/deps/npm/man/man5/folders.5 @@ -1,4 +1,4 @@ -.TH "FOLDERS" "5" "May 2021" "" "" +.TH "FOLDERS" "5" "June 2021" "" "" .SH "NAME" \fBfolders\fR \- Folder Structures Used by npm .SS Description diff --git a/deps/npm/man/man5/install.5 b/deps/npm/man/man5/install.5 index 5fc6f442a9..3d2db70800 100644 --- a/deps/npm/man/man5/install.5 +++ b/deps/npm/man/man5/install.5 @@ -1,4 +1,4 @@ -.TH "INSTALL" "5" "May 2021" "" "" +.TH "INSTALL" "5" "June 2021" "" "" .SH "NAME" \fBinstall\fR \- Download and install node and npm .SS Description diff --git a/deps/npm/man/man5/npm-shrinkwrap-json.5 b/deps/npm/man/man5/npm-shrinkwrap-json.5 index 2fdbdd139a..c2122976c3 100644 --- a/deps/npm/man/man5/npm-shrinkwrap-json.5 +++ b/deps/npm/man/man5/npm-shrinkwrap-json.5 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP\.JSON" "5" "May 2021" "" "" +.TH "NPM\-SHRINKWRAP\.JSON" "5" "June 2021" "" "" .SH "NAME" \fBnpm-shrinkwrap.json\fR \- A publishable lockfile .SS Description diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 1ecd71ff21..2f01620f99 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "May 2021" "" "" +.TH "NPMRC" "5" "June 2021" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SS Description diff --git a/deps/npm/man/man5/package-json.5 b/deps/npm/man/man5/package-json.5 index 8b5b12e038..cb8a99e041 100644 --- a/deps/npm/man/man5/package-json.5 +++ b/deps/npm/man/man5/package-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "May 2021" "" "" +.TH "PACKAGE\.JSON" "5" "June 2021" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SS Description diff --git a/deps/npm/man/man5/package-lock-json.5 b/deps/npm/man/man5/package-lock-json.5 index 610c0aa5fd..231093a569 100644 --- a/deps/npm/man/man5/package-lock-json.5 +++ b/deps/npm/man/man5/package-lock-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\-LOCK\.JSON" "5" "May 2021" "" "" +.TH "PACKAGE\-LOCK\.JSON" "5" "June 2021" "" "" .SH "NAME" \fBpackage-lock.json\fR \- A manifestation of the manifest .SS Description diff --git a/deps/npm/man/man7/config.7 b/deps/npm/man/man7/config.7 index c4d5246987..43a9a41cd0 100644 --- a/deps/npm/man/man7/config.7 +++ b/deps/npm/man/man7/config.7 @@ -1,4 +1,4 @@ -.TH "CONFIG" "7" "May 2021" "" "" +.TH "CONFIG" "7" "June 2021" "" "" .SH "NAME" \fBconfig\fR \- More than you probably want to know about npm configuration .SS Description @@ -1037,6 +1037,8 @@ What level of logs to report\. On failure, \fIall\fR logs are written to .P Any logs of a higher level than the setting are shown\. The default is "notice"\. +.P +See also the \fBforeground\-scripts\fP config\. .SS \fBlogs\-max\fP .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man7/developers.7 b/deps/npm/man/man7/developers.7 index 0935fea65f..61a19ab37f 100644 --- a/deps/npm/man/man7/developers.7 +++ b/deps/npm/man/man7/developers.7 @@ -1,4 +1,4 @@ -.TH "DEVELOPERS" "7" "May 2021" "" "" +.TH "DEVELOPERS" "7" "June 2021" "" "" .SH "NAME" \fBdevelopers\fR \- Developer Guide .SS Description diff --git a/deps/npm/man/man7/orgs.7 b/deps/npm/man/man7/orgs.7 index 13c9b9dbad..1d0a1cd254 100644 --- a/deps/npm/man/man7/orgs.7 +++ b/deps/npm/man/man7/orgs.7 @@ -1,4 +1,4 @@ -.TH "ORGS" "7" "May 2021" "" "" +.TH "ORGS" "7" "June 2021" "" "" .SH "NAME" \fBorgs\fR \- Working with Teams & Orgs .SS Description diff --git a/deps/npm/man/man7/registry.7 b/deps/npm/man/man7/registry.7 index 941a145007..becb565a79 100644 --- a/deps/npm/man/man7/registry.7 +++ b/deps/npm/man/man7/registry.7 @@ -1,4 +1,4 @@ -.TH "REGISTRY" "7" "May 2021" "" "" +.TH "REGISTRY" "7" "June 2021" "" "" .SH "NAME" \fBregistry\fR \- The JavaScript Package Registry .SS Description diff --git a/deps/npm/man/man7/removal.7 b/deps/npm/man/man7/removal.7 index ead032bfdf..ea41c7b133 100644 --- a/deps/npm/man/man7/removal.7 +++ b/deps/npm/man/man7/removal.7 @@ -1,4 +1,4 @@ -.TH "REMOVAL" "7" "May 2021" "" "" +.TH "REMOVAL" "7" "June 2021" "" "" .SH "NAME" \fBremoval\fR \- Cleaning the Slate .SS Synopsis diff --git a/deps/npm/man/man7/scope.7 b/deps/npm/man/man7/scope.7 index 716946d732..29a64a4982 100644 --- a/deps/npm/man/man7/scope.7 +++ b/deps/npm/man/man7/scope.7 @@ -1,4 +1,4 @@ -.TH "SCOPE" "7" "May 2021" "" "" +.TH "SCOPE" "7" "June 2021" "" "" .SH "NAME" \fBscope\fR \- Scoped packages .SS Description diff --git a/deps/npm/man/man7/scripts.7 b/deps/npm/man/man7/scripts.7 index c514b2979d..adef22da5e 100644 --- a/deps/npm/man/man7/scripts.7 +++ b/deps/npm/man/man7/scripts.7 @@ -1,4 +1,4 @@ -.TH "SCRIPTS" "7" "May 2021" "" "" +.TH "SCRIPTS" "7" "June 2021" "" "" .SH "NAME" \fBscripts\fR \- How npm handles the "scripts" field .SS Description diff --git a/deps/npm/man/man7/workspaces.7 b/deps/npm/man/man7/workspaces.7 index dbb63528d6..9da673cb14 100644 --- a/deps/npm/man/man7/workspaces.7 +++ b/deps/npm/man/man7/workspaces.7 @@ -1,4 +1,4 @@ -.TH "WORKSPACES" "7" "May 2021" "" "" +.TH "WORKSPACES" "7" "June 2021" "" "" .SH "NAME" \fBworkspaces\fR \- Working with workspaces .SS Description diff --git a/deps/npm/node_modules/@npmcli/arborist/package.json b/deps/npm/node_modules/@npmcli/arborist/package.json index 8aaa8ecdb7..7c2622f49e 100644 --- a/deps/npm/node_modules/@npmcli/arborist/package.json +++ b/deps/npm/node_modules/@npmcli/arborist/package.json @@ -1,6 +1,6 @@ { "name": "@npmcli/arborist", - "version": "2.6.1", + "version": "2.6.2", "description": "Manage node_modules trees", "dependencies": { "@npmcli/installed-package-contents": "^1.0.7", @@ -19,7 +19,7 @@ "npm-install-checks": "^4.0.0", "npm-package-arg": "^8.1.0", "npm-pick-manifest": "^6.1.0", - "npm-registry-fetch": "^10.0.0", + "npm-registry-fetch": "^11.0.0", "pacote": "^11.2.6", "parse-conflict-json": "^1.1.1", "promise-all-reject-late": "^1.0.0", diff --git a/deps/npm/node_modules/iconv-lite/.idea/codeStyles/Project.xml b/deps/npm/node_modules/iconv-lite/.idea/codeStyles/Project.xml new file mode 100644 index 0000000000..3f2688cb57 --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/.idea/codeStyles/Project.xml @@ -0,0 +1,47 @@ +<component name="ProjectCodeStyleConfiguration"> + <code_scheme name="Project" version="173"> + <HTMLCodeStyleSettings> + <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" /> + <option name="HTML_ENFORCE_QUOTES" value="true" /> + </HTMLCodeStyleSettings> + <JSCodeStyleSettings version="0"> + <option name="FORCE_SEMICOLON_STYLE" value="true" /> + <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" /> + <option name="FORCE_QUOTE_STYlE" value="true" /> + <option name="ENFORCE_TRAILING_COMMA" value="Remove" /> + <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" /> + <option name="SPACES_WITHIN_IMPORTS" value="true" /> + </JSCodeStyleSettings> + <TypeScriptCodeStyleSettings version="0"> + <option name="FORCE_SEMICOLON_STYLE" value="true" /> + <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" /> + <option name="FORCE_QUOTE_STYlE" value="true" /> + <option name="ENFORCE_TRAILING_COMMA" value="Remove" /> + <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" /> + <option name="SPACES_WITHIN_IMPORTS" value="true" /> + </TypeScriptCodeStyleSettings> + <VueCodeStyleSettings> + <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" /> + <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" /> + </VueCodeStyleSettings> + <codeStyleSettings language="HTML"> + <option name="SOFT_MARGINS" value="100" /> + <indentOptions> + <option name="CONTINUATION_INDENT_SIZE" value="4" /> + </indentOptions> + </codeStyleSettings> + <codeStyleSettings language="JavaScript"> + <option name="SOFT_MARGINS" value="100" /> + </codeStyleSettings> + <codeStyleSettings language="TypeScript"> + <option name="SOFT_MARGINS" value="100" /> + </codeStyleSettings> + <codeStyleSettings language="Vue"> + <option name="SOFT_MARGINS" value="100" /> + <indentOptions> + <option name="INDENT_SIZE" value="4" /> + <option name="TAB_SIZE" value="4" /> + </indentOptions> + </codeStyleSettings> + </code_scheme> +</component>
\ No newline at end of file diff --git a/deps/npm/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml b/deps/npm/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000000..79ee123c2b --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ +<component name="ProjectCodeStyleConfiguration"> + <state> + <option name="USE_PER_PROJECT_SETTINGS" value="true" /> + </state> +</component>
\ No newline at end of file diff --git a/deps/npm/node_modules/iconv-lite/.idea/iconv-lite.iml b/deps/npm/node_modules/iconv-lite/.idea/iconv-lite.iml new file mode 100644 index 0000000000..0c8867d7e1 --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/.idea/iconv-lite.iml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="WEB_MODULE" version="4"> + <component name="NewModuleRootManager"> + <content url="file://$MODULE_DIR$"> + <excludeFolder url="file://$MODULE_DIR$/temp" /> + <excludeFolder url="file://$MODULE_DIR$/.tmp" /> + <excludeFolder url="file://$MODULE_DIR$/tmp" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module>
\ No newline at end of file diff --git a/deps/npm/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml b/deps/npm/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000..03d9549ea8 --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ +<component name="InspectionProjectProfileManager"> + <profile version="1.0"> + <option name="myName" value="Project Default" /> + <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" /> + </profile> +</component>
\ No newline at end of file diff --git a/deps/npm/node_modules/iconv-lite/.idea/modules.xml b/deps/npm/node_modules/iconv-lite/.idea/modules.xml new file mode 100644 index 0000000000..5d24f2e1ec --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/.idea/iconv-lite.iml" filepath="$PROJECT_DIR$/.idea/iconv-lite.iml" /> + </modules> + </component> +</project>
\ No newline at end of file diff --git a/deps/npm/node_modules/iconv-lite/.idea/vcs.xml b/deps/npm/node_modules/iconv-lite/.idea/vcs.xml new file mode 100644 index 0000000000..94a25f7f4c --- /dev/null +++ b/deps/npm/node_modules/iconv-lite/.idea/vcs.xml @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="VcsDirectoryMappings"> + <mapping directory="$PROJECT_DIR$" vcs="Git" /> + </component> +</project>
\ No newline at end of file diff --git a/deps/npm/node_modules/iconv-lite/Changelog.md b/deps/npm/node_modules/iconv-lite/Changelog.md index c299cc06a2..464549b148 100644 --- a/deps/npm/node_modules/iconv-lite/Changelog.md +++ b/deps/npm/node_modules/iconv-lite/Changelog.md @@ -1,3 +1,7 @@ +## 0.6.3 / 2021-05-23 + * Fix HKSCS encoding to prefer Big5 codes if both Big5 and HKSCS codes are possible (#264) + + ## 0.6.2 / 2020-07-08 * Support Uint8Array-s decoding without conversion to Buffers, plus fix an edge case. diff --git a/deps/npm/node_modules/iconv-lite/encodings/dbcs-data.js b/deps/npm/node_modules/iconv-lite/encodings/dbcs-data.js index 4b61914341..0d17e5821b 100644 --- a/deps/npm/node_modules/iconv-lite/encodings/dbcs-data.js +++ b/deps/npm/node_modules/iconv-lite/encodings/dbcs-data.js @@ -167,7 +167,19 @@ module.exports = { 'big5hkscs': { type: '_dbcs', table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, - encodeSkipVals: [0xa2cc], + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, + ], }, 'cnbig5': 'big5hkscs', diff --git a/deps/npm/node_modules/iconv-lite/package.json b/deps/npm/node_modules/iconv-lite/package.json index 8f86f9c9bc..d351115a83 100644 --- a/deps/npm/node_modules/iconv-lite/package.json +++ b/deps/npm/node_modules/iconv-lite/package.json @@ -1,7 +1,7 @@ { "name": "iconv-lite", "description": "Convert character encodings in pure javascript.", - "version": "0.6.2", + "version": "0.6.3", "license": "MIT", "keywords": [ "iconv", diff --git a/deps/npm/node_modules/libnpmaccess/package.json b/deps/npm/node_modules/libnpmaccess/package.json index 69b7a0dc25..23d4b444ca 100644 --- a/deps/npm/node_modules/libnpmaccess/package.json +++ b/deps/npm/node_modules/libnpmaccess/package.json @@ -1,6 +1,6 @@ { "name": "libnpmaccess", - "version": "4.0.2", + "version": "4.0.3", "description": "programmatic library for `npm access` commands", "author": "Kat Marchán <kzm@sykosomatic.org>", "license": "ISC", @@ -26,7 +26,7 @@ "aproba": "^2.0.0", "minipass": "^3.1.1", "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^10.0.0" + "npm-registry-fetch": "^11.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/libnpmhook/CHANGELOG.md b/deps/npm/node_modules/libnpmhook/CHANGELOG.md deleted file mode 100644 index 0557274972..0000000000 --- a/deps/npm/node_modules/libnpmhook/CHANGELOG.md +++ /dev/null @@ -1,110 +0,0 @@ -# Change Log - -<a name="6.0.0"></a> -# [6.0.0](https://github.com/npm/libnpmhook/compare/v5.0.2...v6.0.0) (2020-02-26) - -### Breaking Changes - -* [`aa629b4`](https://github.com/npm/libnpmhook/commit/aa629b4) fix: remove figgy-pudding ([@claudiahdz](https://github.com/claudiahdz)) - -### Miscellaneuous - -* [`ea795fb`](https://github.com/npm/libnpmhook/commit/ea795fb) chore: basic project updates ([@claudiahdz](https://github.com/claudiahdz)) -* [`a0fdf7e`](https://github.com/npm/libnpmhook/commit/a0fdf7e) chore: cleanup badges, contrib, readme ([@ruyadorno](https://github.com/ruyadorno)) - ---- - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -<a name="5.0.2"></a> -## [5.0.2](https://github.com/npm/libnpmhook/compare/v5.0.1...v5.0.2) (2018-08-24) - - - -<a name="5.0.1"></a> -## [5.0.1](https://github.com/npm/libnpmhook/compare/v5.0.0...v5.0.1) (2018-08-23) - - -### Bug Fixes - -* **deps:** move JSONStream to prod deps ([bb63594](https://github.com/npm/libnpmhook/commit/bb63594)) - - - -<a name="5.0.0"></a> -# [5.0.0](https://github.com/npm/libnpmhook/compare/v4.0.1...v5.0.0) (2018-08-21) - - -### Features - -* **api:** overhauled API ([46b271b](https://github.com/npm/libnpmhook/commit/46b271b)) - - -### BREAKING CHANGES - -* **api:** the API for ls() has changed, and rm() no longer errors on 404 - - - -<a name="4.0.1"></a> -## [4.0.1](https://github.com/npm/libnpmhook/compare/v4.0.0...v4.0.1) (2018-04-09) - - - -<a name="4.0.0"></a> -# [4.0.0](https://github.com/npm/libnpmhook/compare/v3.0.1...v4.0.0) (2018-04-08) - - -### meta - -* drop support for node 4 and 7 ([f2a301e](https://github.com/npm/libnpmhook/commit/f2a301e)) - - -### BREAKING CHANGES - -* node@4 and node@7 are no longer supported - - - -<a name="3.0.1"></a> -## [3.0.1](https://github.com/npm/libnpmhook/compare/v3.0.0...v3.0.1) (2018-04-08) - - - -<a name="3.0.0"></a> -# [3.0.0](https://github.com/npm/libnpmhook/compare/v2.0.1...v3.0.0) (2018-04-04) - - -### add - -* guess type based on name ([9418224](https://github.com/npm/libnpmhook/commit/9418224)) - - -### BREAKING CHANGES - -* hook type is now based on name prefix - - - -<a name="2.0.1"></a> -## [2.0.1](https://github.com/npm/libnpmhook/compare/v2.0.0...v2.0.1) (2018-03-16) - - -### Bug Fixes - -* **urls:** was hitting the wrong URL endpoints ([10171a9](https://github.com/npm/libnpmhook/commit/10171a9)) - - - -<a name="2.0.0"></a> -# [2.0.0](https://github.com/npm/libnpmhook/compare/v1.0.0...v2.0.0) (2018-03-16) - - - -<a name="1.0.0"></a> -# 1.0.0 (2018-03-16) - - -### Features - -* **api:** baseline working api ([122658e](https://github.com/npm/npm-hooks/commit/122658e)) diff --git a/deps/npm/node_modules/libnpmhook/package.json b/deps/npm/node_modules/libnpmhook/package.json index c2a3b2a3b8..40951245a9 100644 --- a/deps/npm/node_modules/libnpmhook/package.json +++ b/deps/npm/node_modules/libnpmhook/package.json @@ -1,6 +1,6 @@ { "name": "libnpmhook", - "version": "6.0.2", + "version": "6.0.3", "description": "programmatic API for managing npm registry hooks", "main": "index.js", "files": [ @@ -28,7 +28,7 @@ "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^10.0.0" + "npm-registry-fetch": "^11.0.0" }, "devDependencies": { "nock": "^9.6.1", diff --git a/deps/npm/node_modules/libnpmorg/CHANGELOG.md b/deps/npm/node_modules/libnpmorg/CHANGELOG.md deleted file mode 100644 index 4cd5cd1cd6..0000000000 --- a/deps/npm/node_modules/libnpmorg/CHANGELOG.md +++ /dev/null @@ -1,33 +0,0 @@ -# Change Log - -## 2.0.0 (2020-03-02) - -### BREAKING CHANGE -- Removed `figgy-pudding` as a dependecy -- Using native promises -- Require node >= v10 - -### Feature -- Updated stream interface to `minipass` type stream - ---- - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -<a name="1.0.1"></a> -## [1.0.1](https://github.com/npm/libnpmorg/compare/v1.0.0...v1.0.1) (2019-07-16) - - -### Bug Fixes - -* **standard:** standard --fix ([5118358](https://github.com/npm/libnpmorg/commit/5118358)) - - - -<a name="1.0.0"></a> -# 1.0.0 (2018-08-23) - - -### Features - -* **API:** implement org api ([731b9c6](https://github.com/npm/libnpmorg/commit/731b9c6)) diff --git a/deps/npm/node_modules/libnpmorg/package.json b/deps/npm/node_modules/libnpmorg/package.json index d7e76f1d32..0e82a207b7 100644 --- a/deps/npm/node_modules/libnpmorg/package.json +++ b/deps/npm/node_modules/libnpmorg/package.json @@ -1,6 +1,6 @@ { "name": "libnpmorg", - "version": "2.0.2", + "version": "2.0.3", "description": "Programmatic api for `npm org` commands", "author": "Kat Marchán <kzm@sykosomatic.org>", "keywords": [ @@ -40,7 +40,7 @@ "homepage": "https://npmjs.com/package/libnpmorg", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^10.0.0" + "npm-registry-fetch": "^11.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/libnpmpublish/CHANGELOG.md b/deps/npm/node_modules/libnpmpublish/CHANGELOG.md deleted file mode 100644 index 57d21f8400..0000000000 --- a/deps/npm/node_modules/libnpmpublish/CHANGELOG.md +++ /dev/null @@ -1,91 +0,0 @@ -# Change Log - -<a name="3.0.1"></a> -# [3.0.1](https://github.com/npm/libnpmpublish/compare/v3.0.0...v3.0.1) (2020-03-27) - -### Features - -* [`3e02307`](https://github.com/npm/libnpmpublish/commit/3e02307) chore: pack tarballs using libnpmpack ([@claudiahdz](https://github.com/claudiahdz)) - -<a name="3.0.0"></a> -# [3.0.0](https://github.com/npm/libnpmpublish/compare/v2.0.0...v3.0.0) (2020-03-09) - -### Breaking Changes - -* [`ecaeb0b`](https://github.com/npm/libnpmpublish/commit/ecaeb0b) feat: pack tarballs from source code using pacote v10 ([@claudiahdz](https://github.com/claudiahdz)) - -* [`f6bf2b8`](https://github.com/npm/libnpmpublish/commit/f6bf2b8) feat: unpublish code refactor ([@claudiahdz](https://github.com/claudiahdz)) - -### Miscellaneuous - -* [`5cea10f`](https://github.com/npm/libnpmpublish/commit/5cea10f) chore: basic project updates ([@claudiahdz](https://github.com/claudiahdz)) -* [`3010b93`](https://github.com/npm/libnpmpublish/commit/3010b93) chore: cleanup badges + contributing ([@ruyadorno](https://github.com/ruyadorno)) - ---- - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -## [2.0.0](https://github.com/npm/libnpmpublish/compare/v1.1.3...v2.0.0) (2019-09-18) - - -### ⚠ BREAKING CHANGES - -* This drops support for Node.js version 6. - -### Bug Fixes - -* audit warnings, drop support for Node.js v6 ([d9a1fb6](https://github.com/npm/libnpmpublish/commit/d9a1fb6)) - -### [1.1.3](https://github.com/npm/libnpmpublish/compare/v1.1.2...v1.1.3) (2019-09-18) - -<a name="1.1.2"></a> -## [1.1.2](https://github.com/npm/libnpmpublish/compare/v1.1.1...v1.1.2) (2019-07-16) - - - -<a name="1.1.1"></a> -## [1.1.1](https://github.com/npm/libnpmpublish/compare/v1.1.0...v1.1.1) (2019-01-22) - - -### Bug Fixes - -* **auth:** send username in correct key ([#3](https://github.com/npm/libnpmpublish/issues/3)) ([38422d0](https://github.com/npm/libnpmpublish/commit/38422d0)) - - - -<a name="1.1.0"></a> -# [1.1.0](https://github.com/npm/libnpmpublish/compare/v1.0.1...v1.1.0) (2018-08-31) - - -### Features - -* **publish:** add support for publishConfig on manifests ([161723b](https://github.com/npm/libnpmpublish/commit/161723b)) - - - -<a name="1.0.1"></a> -## [1.0.1](https://github.com/npm/libnpmpublish/compare/v1.0.0...v1.0.1) (2018-08-31) - - -### Bug Fixes - -* **opts:** remove unused opts ([2837098](https://github.com/npm/libnpmpublish/commit/2837098)) - - - -<a name="1.0.0"></a> -# 1.0.0 (2018-08-31) - - -### Bug Fixes - -* **api:** use opts.algorithms, return true on success ([80fe34b](https://github.com/npm/libnpmpublish/commit/80fe34b)) -* **publish:** first test pass w/ bugfixes ([74135c9](https://github.com/npm/libnpmpublish/commit/74135c9)) -* **publish:** full coverage test and related fixes ([b5a3446](https://github.com/npm/libnpmpublish/commit/b5a3446)) - - -### Features - -* **docs:** add README with api docs ([553c13d](https://github.com/npm/libnpmpublish/commit/553c13d)) -* **publish:** add initial publish support. tests tbd ([5b3fe94](https://github.com/npm/libnpmpublish/commit/5b3fe94)) -* **unpublish:** add new api with unpublish support ([1c9d594](https://github.com/npm/libnpmpublish/commit/1c9d594)) diff --git a/deps/npm/node_modules/libnpmpublish/package.json b/deps/npm/node_modules/libnpmpublish/package.json index 30bc4fda25..ac0d632f7d 100644 --- a/deps/npm/node_modules/libnpmpublish/package.json +++ b/deps/npm/node_modules/libnpmpublish/package.json @@ -1,6 +1,6 @@ { "name": "libnpmpublish", - "version": "4.0.1", + "version": "4.0.2", "description": "Programmatic API for the bits behind npm publish and unpublish", "author": "npm Inc. <support@npmjs.com>", "contributors": [ @@ -46,7 +46,7 @@ "dependencies": { "normalize-package-data": "^3.0.2", "npm-package-arg": "^8.1.2", - "npm-registry-fetch": "^10.0.0", + "npm-registry-fetch": "^11.0.0", "semver": "^7.1.3", "ssri": "^8.0.1" }, diff --git a/deps/npm/node_modules/libnpmsearch/CHANGELOG.md b/deps/npm/node_modules/libnpmsearch/CHANGELOG.md deleted file mode 100644 index 03b7fedc5b..0000000000 --- a/deps/npm/node_modules/libnpmsearch/CHANGELOG.md +++ /dev/null @@ -1,57 +0,0 @@ -# Change Log - -<a name="3.0.0"></a> -# [3.0.0](https://github.com/npm/libnpmhook/compare/v2.0.2...v3.0.0) (2020-02-26) - -### Breaking Changes - -* [`45f4db1`](https://github.com/npm/libnpmsearch/commit/45f4db1) fix: remove figgy-pudding ([@claudiahdz](https://github.com/claudiahdz)) - -### Miscellaneuous - -* [`b413aae`](https://github.com/npm/libnpmsearch/commit/b413aae) chore: basic project updates ([@claudiahdz](https://github.com/claudiahdz)) -* [`534983c`](https://github.com/npm/libnpmsearch/commit/534983c) chore: remove pr temmsearch ([@ruyadorno](https://github.com/ruyadorno)) -* [`c503a89`](https://github.com/npm/libnpmsearch/commit/c503a89) chore: cleanup badges + contributing ([@ruyadorno](https://github.com/ruyadorno)) - ---- - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -<a name="2.0.2"></a> -## [2.0.2](https://github.com/npm/libnpmsearch/compare/v2.0.1...v2.0.2) (2019-07-16) - - - -<a name="2.0.1"></a> -## [2.0.1](https://github.com/npm/libnpmsearch/compare/v2.0.0...v2.0.1) (2019-06-10) - - -### Bug Fixes - -* **opts:** support `opts.from` properly ([#2](https://github.com/npm/libnpmsearch/issues/2)) ([da6636c](https://github.com/npm/libnpmsearch/commit/da6636c)) -* **standard:** standard --fix ([beca19c](https://github.com/npm/libnpmsearch/commit/beca19c)) - - - -<a name="2.0.0"></a> -# [2.0.0](https://github.com/npm/libnpmsearch/compare/v1.0.0...v2.0.0) (2018-08-28) - - -### Features - -* **opts:** added options for pagination, details, and sorting weights ([ff97eb5](https://github.com/npm/libnpmsearch/commit/ff97eb5)) - - -### BREAKING CHANGES - -* **opts:** this changes default requests and makes libnpmsearch return more complete data for individual packages, without null-defaulting - - - -<a name="1.0.0"></a> -# 1.0.0 (2018-08-27) - - -### Features - -* **api:** got API working ([fe90008](https://github.com/npm/libnpmsearch/commit/fe90008)) diff --git a/deps/npm/node_modules/libnpmsearch/package.json b/deps/npm/node_modules/libnpmsearch/package.json index 35e4a05557..88179b8d6f 100644 --- a/deps/npm/node_modules/libnpmsearch/package.json +++ b/deps/npm/node_modules/libnpmsearch/package.json @@ -1,6 +1,6 @@ { "name": "libnpmsearch", - "version": "3.1.1", + "version": "3.1.2", "description": "Programmatic API for searching in npm and compatible registries.", "author": "Kat Marchán <kzm@sykosomatic.org>", "files": [ @@ -36,7 +36,7 @@ "bugs": "https://github.com/npm/libnpmsearch/issues", "homepage": "https://npmjs.com/package/libnpmsearch", "dependencies": { - "npm-registry-fetch": "^10.0.0" + "npm-registry-fetch": "^11.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/libnpmteam/CHANGELOG.md b/deps/npm/node_modules/libnpmteam/CHANGELOG.md deleted file mode 100644 index ba472cfcc5..0000000000 --- a/deps/npm/node_modules/libnpmteam/CHANGELOG.md +++ /dev/null @@ -1,40 +0,0 @@ -# Change Log - -## [2.0.0](https://github.com/npm/libnpmteam/compare/v1.0.2...v2.0.0) (2020-03-02) - -### BREAKING CHANGE -- Removed `figgy-pudding` as a dependecy -- Using native promises -- Require node >= v10 - -### Feature -- Updated stream interface to `minipass` type stream - ---- - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -<a name="1.0.2"></a> -## [1.0.2](https://github.com/npm/libnpmteam/compare/v1.0.1...v1.0.2) (2019-07-16) - - -### Bug Fixes - -* **standard:** standard --fix ([3dc9144](https://github.com/npm/libnpmteam/commit/3dc9144)) - - - -<a name="1.0.1"></a> -## [1.0.1](https://github.com/npm/libnpmteam/compare/v1.0.0...v1.0.1) (2018-08-24) - - - -<a name="1.0.0"></a> -# 1.0.0 (2018-08-22) - - -### Features - -* **api:** implement team api ([50dd0e1](https://github.com/npm/libnpmteam/commit/50dd0e1)) -* **docs:** add fully-documented readme ([b1370f3](https://github.com/npm/libnpmteam/commit/b1370f3)) -* **test:** test --100 ftw ([9d3bdc3](https://github.com/npm/libnpmteam/commit/9d3bdc3)) diff --git a/deps/npm/node_modules/libnpmteam/package.json b/deps/npm/node_modules/libnpmteam/package.json index b51f60a327..09837ad2dd 100644 --- a/deps/npm/node_modules/libnpmteam/package.json +++ b/deps/npm/node_modules/libnpmteam/package.json @@ -1,7 +1,7 @@ { "name": "libnpmteam", "description": "npm Team management APIs", - "version": "2.0.3", + "version": "2.0.4", "author": "Kat Marchán <kzm@zkat.tech>", "license": "ISC", "scripts": { @@ -27,7 +27,7 @@ "homepage": "https://npmjs.com/package/libnpmteam", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^10.0.0" + "npm-registry-fetch": "^11.0.0" }, "engines": { "node": ">=10" diff --git a/deps/npm/node_modules/make-fetch-happen/CHANGELOG.md b/deps/npm/node_modules/make-fetch-happen/CHANGELOG.md deleted file mode 100644 index 324dfc1058..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/CHANGELOG.md +++ /dev/null @@ -1,654 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -### [8.0.3](https://github.com/npm/make-fetch-happen/compare/v8.0.2...v8.0.3) (2020-03-03) - - -### Bug Fixes - -* remoteFetch takes instance of fetch.Headers ([6e0de7b](https://github.com/npm/make-fetch-happen/commit/6e0de7b10b8597eaff69fea06a266914766cf5ab)), closes [#22](https://github.com/npm/make-fetch-happen/issues/22) - -### [8.0.1](https://github.com/npm/make-fetch-happen/compare/v8.0.0...v8.0.1) (2020-02-18) - -## [8.0.0](https://github.com/npm/make-fetch-happen/compare/v7.1.1...v8.0.0) (2020-02-18) - - -### ⚠ BREAKING CHANGES - -* this module now only supports taking a plain JavaScript -options object, not a figgy pudding config object. - -* update cacache and ssri ([09e4f97](https://github.com/npm/make-fetch-happen/commit/09e4f9794a6f134d3f1d8e65eb9bd940e38e5bfc)) - -### [7.1.1](https://github.com/npm/make-fetch-happen/compare/v7.1.0...v7.1.1) (2020-01-28) - -## [7.1.0](https://github.com/npm/make-fetch-happen/compare/v7.0.0...v7.1.0) (2019-12-17) - - -### Features - -* use globalAgent when in lambda ([bd9409d](https://github.com/npm/make-fetch-happen/commit/bd9409da246a979b665ebd23967ec01dd928ce47)), closes [#4](https://github.com/npm/make-fetch-happen/issues/4) - -## [7.0.0](https://github.com/npm/make-fetch-happen/compare/v6.1.0...v7.0.0) (2019-12-17) - - -### ⚠ BREAKING CHANGES - -* drops support for node v8, since it's EOL as of 2020-01-01 - -### Features - -* **github:** added github actions with coveralls integration ([1913c1b](https://github.com/npm/make-fetch-happen/commit/1913c1b51aaac6044b4dab65b3d19ec943a35f39)) -* updated fetch module; linting mostly; based on testing ([063f28e](https://github.com/npm/make-fetch-happen/commit/063f28ea1ac23f7e9d9d79e15949ca82b634ce97)) -* **utils:** fixed configure-options based on testing ([9dd4f6f](https://github.com/npm/make-fetch-happen/commit/9dd4f6f108442dc247de44e1ddc0341edcb84c9b)) -* fixed test dep requires; added mockRequire function to mock tests properly ([95de7a1](https://github.com/npm/make-fetch-happen/commit/95de7a171110907e30f41f489e4be983cd8184a5)) -* refactored functions into utilities ([74620dd](https://github.com/npm/make-fetch-happen/commit/74620dd7c2262ac46d9b4f6ac2dc9ff45a4f19ee)) -* updated dev deps; update tap; updated standard ([dce6eec](https://github.com/npm/make-fetch-happen/commit/dce6eece130fb20164a62eeabc6090811d8f14a4)) -* updated fetch tests; linting, logic, added tests ([d50aeaf](https://github.com/npm/make-fetch-happen/commit/d50aeafebeb5d8f7118d7f6660208f40ac487804)) - - -### Bug Fixes - -* format cache key with new URL object shape ([21cb6cc](https://github.com/npm/make-fetch-happen/commit/21cb6cc968aabff8b5c5c02e3666fb093fd6578c)) -* polish out an unnecessary URL object creation ([67a01d4](https://github.com/npm/make-fetch-happen/commit/67a01d46b2cacbadc22f49604ee524526cee3912)), closes [#14](https://github.com/npm/make-fetch-happen/issues/14) -* support user without password in proxy auth ([e24bbf9](https://github.com/npm/make-fetch-happen/commit/e24bbf935bc8a2c49070cdb2518e5ee290143191)) -* updated 'files' property in package file ([945e40c](https://github.com/npm/make-fetch-happen/commit/945e40c7fbb59333e0c632c490683e4babc68dc1)) -* Use WhatWG URL objects over deprecated legacy url API ([28aca97](https://github.com/npm/make-fetch-happen/commit/28aca97dfb63ca003ebf62d1b961771cfbb2481d)) - - -* drop node 8 ([9fa7944](https://github.com/npm/make-fetch-happen/commit/9fa7944cbc603f3a194dfb440f519a7d5265653e)) - -## [6.1.0](https://github.com/npm/make-fetch-happen/compare/v6.0.1...v6.1.0) (2019-11-14) - - -### Bug Fixes - -* **streams:** change condition/logic of fitInMemory used when defining memoize ([c173723](https://github.com/npm/make-fetch-happen/commit/c173723)) - -### [6.0.1](https://github.com/npm/make-fetch-happen/compare/v6.0.0...v6.0.1) (2019-10-23) - -<a name="6.0.0"></a> -# [6.0.0](https://github.com/npm/make-fetch-happen/compare/v5.0.0...v6.0.0) (2019-10-01) - -### Bug Fixes - -* preserve rfc7234 5.5.4 warnings ([001b91e](https://github.com/npm/make-fetch-happen/commit/001b91e)) -* properly detect thrown HTTP "error" objects ([d7cbeb4](https://github.com/npm/make-fetch-happen/commit/d7cbeb4)) -* safely create synthetic response body for 304 ([bc70f88](https://github.com/npm/make-fetch-happen/commit/bc70f88)) - -### Features - -* **promises:** refactor bluebird with native promises ([7482d54](https://github.com/npm/make-fetch-happen/commit/7482d54)) - -### BREAKING CHANGES - -* **streams:** refactor node streams with minipass ([1d7f5a3](https://github.com/npm/make-fetch-happen/commit/1d7f5a3)) - -<a name="5.0.0"></a> -# [5.0.0](https://github.com/npm/make-fetch-happen/compare/v4.0.2...v5.0.0) (2019-07-15) - - -### Features - -* cacache@12, no need for uid/gid opts ([fdb956f](https://github.com/npm/make-fetch-happen/commit/fdb956f)) - - -### BREAKING CHANGES - -* cache uid and gid are inferred from the cache folder itself, -not passed in as options. - - - -<a name="4.0.2"></a> -## [4.0.2](https://github.com/npm/make-fetch-happen/compare/v4.0.1...v4.0.2) (2019-07-02) - - - -<a name="4.0.1"></a> -## [4.0.1](https://github.com/npm/make-fetch-happen/compare/v4.0.0...v4.0.1) (2018-04-12) - - -### Bug Fixes - -* **integrity:** use new sri.match() for verification ([4f371a0](https://github.com/npm/make-fetch-happen/commit/4f371a0)) - - - -<a name="4.0.0"></a> -# [4.0.0](https://github.com/npm/make-fetch-happen/compare/v3.0.0...v4.0.0) (2018-04-09) - - -### meta - -* drop node@4, add node@9 ([7b0191a](https://github.com/npm/make-fetch-happen/commit/7b0191a)) - - -### BREAKING CHANGES - -* node@4 is no longer supported - - - -<a name="3.0.0"></a> -# [3.0.0](https://github.com/npm/make-fetch-happen/compare/v2.6.0...v3.0.0) (2018-03-12) - - -### Bug Fixes - -* **license:** switch to ISC ([#49](https://github.com/npm/make-fetch-happen/issues/49)) ([bf90c6d](https://github.com/npm/make-fetch-happen/commit/bf90c6d)) -* **standard:** standard@11 update ([ff0aa70](https://github.com/npm/make-fetch-happen/commit/ff0aa70)) - - -### BREAKING CHANGES - -* **license:** license changed from CC0 to ISC. - - - -<a name="2.6.0"></a> -# [2.6.0](https://github.com/npm/make-fetch-happen/compare/v2.5.0...v2.6.0) (2017-11-14) - - -### Bug Fixes - -* **integrity:** disable node-fetch compress when checking integrity (#42) ([a7cc74c](https://github.com/npm/make-fetch-happen/commit/a7cc74c)) - - -### Features - -* **onretry:** Add `options.onRetry` (#48) ([f90ccff](https://github.com/npm/make-fetch-happen/commit/f90ccff)) - - - -<a name="2.5.0"></a> -# [2.5.0](https://github.com/npm/make-fetch-happen/compare/v2.4.13...v2.5.0) (2017-08-24) - - -### Bug Fixes - -* **agent:** support timeout durations greater than 30 seconds ([04875ae](https://github.com/npm/make-fetch-happen/commit/04875ae)), closes [#35](https://github.com/npm/make-fetch-happen/issues/35) - - -### Features - -* **cache:** export cache deletion functionality (#40) ([3da4250](https://github.com/npm/make-fetch-happen/commit/3da4250)) - - - -<a name="2.4.13"></a> -## [2.4.13](https://github.com/npm/make-fetch-happen/compare/v2.4.12...v2.4.13) (2017-06-29) - - -### Bug Fixes - -* **deps:** bump other deps for bugfixes ([eab8297](https://github.com/npm/make-fetch-happen/commit/eab8297)) -* **proxy:** bump proxy deps with bugfixes (#32) ([632f860](https://github.com/npm/make-fetch-happen/commit/632f860)), closes [#32](https://github.com/npm/make-fetch-happen/issues/32) - - - -<a name="2.4.12"></a> -## [2.4.12](https://github.com/npm/make-fetch-happen/compare/v2.4.11...v2.4.12) (2017-06-06) - - -### Bug Fixes - -* **cache:** encode x-local-cache-etc headers to be header-safe ([dc9fb1b](https://github.com/npm/make-fetch-happen/commit/dc9fb1b)) - - - -<a name="2.4.11"></a> -## [2.4.11](https://github.com/npm/make-fetch-happen/compare/v2.4.10...v2.4.11) (2017-06-05) - - -### Bug Fixes - -* **deps:** bump deps with ssri fix ([bef1994](https://github.com/npm/make-fetch-happen/commit/bef1994)) - - - -<a name="2.4.10"></a> -## [2.4.10](https://github.com/npm/make-fetch-happen/compare/v2.4.9...v2.4.10) (2017-05-31) - - -### Bug Fixes - -* **deps:** bump dep versions with bugfixes ([0af4003](https://github.com/npm/make-fetch-happen/commit/0af4003)) -* **proxy:** use auth parameter for proxy authentication (#30) ([c687306](https://github.com/npm/make-fetch-happen/commit/c687306)) - - - -<a name="2.4.9"></a> -## [2.4.9](https://github.com/npm/make-fetch-happen/compare/v2.4.8...v2.4.9) (2017-05-25) - - -### Bug Fixes - -* **cache:** use the passed-in promise for resolving cache stuff ([4c46257](https://github.com/npm/make-fetch-happen/commit/4c46257)) - - - -<a name="2.4.8"></a> -## [2.4.8](https://github.com/npm/make-fetch-happen/compare/v2.4.7...v2.4.8) (2017-05-25) - - -### Bug Fixes - -* **cache:** pass uid/gid/Promise through to cache ([a847c92](https://github.com/npm/make-fetch-happen/commit/a847c92)) - - - -<a name="2.4.7"></a> -## [2.4.7](https://github.com/npm/make-fetch-happen/compare/v2.4.6...v2.4.7) (2017-05-24) - - -### Bug Fixes - -* **deps:** pull in various fixes from deps ([fc2a587](https://github.com/npm/make-fetch-happen/commit/fc2a587)) - - - -<a name="2.4.6"></a> -## [2.4.6](https://github.com/npm/make-fetch-happen/compare/v2.4.5...v2.4.6) (2017-05-24) - - -### Bug Fixes - -* **proxy:** choose agent for http(s)-proxy by protocol of destUrl ([ea4832a](https://github.com/npm/make-fetch-happen/commit/ea4832a)) -* **proxy:** make socks proxy working ([1de810a](https://github.com/npm/make-fetch-happen/commit/1de810a)) -* **proxy:** revert previous proxy solution ([563b0d8](https://github.com/npm/make-fetch-happen/commit/563b0d8)) - - - -<a name="2.4.5"></a> -## [2.4.5](https://github.com/npm/make-fetch-happen/compare/v2.4.4...v2.4.5) (2017-05-24) - - -### Bug Fixes - -* **proxy:** use the destination url when determining agent ([1a714e7](https://github.com/npm/make-fetch-happen/commit/1a714e7)) - - - -<a name="2.4.4"></a> -## [2.4.4](https://github.com/npm/make-fetch-happen/compare/v2.4.3...v2.4.4) (2017-05-23) - - -### Bug Fixes - -* **redirect:** handle redirects explicitly (#27) ([4c4af54](https://github.com/npm/make-fetch-happen/commit/4c4af54)) - - - -<a name="2.4.3"></a> -## [2.4.3](https://github.com/npm/make-fetch-happen/compare/v2.4.2...v2.4.3) (2017-05-06) - - -### Bug Fixes - -* **redirect:** redirects now delete authorization if hosts fail to match ([c071805](https://github.com/npm/make-fetch-happen/commit/c071805)) - - - -<a name="2.4.2"></a> -## [2.4.2](https://github.com/npm/make-fetch-happen/compare/v2.4.1...v2.4.2) (2017-05-04) - - -### Bug Fixes - -* **cache:** reduce race condition window by checking for content ([24544b1](https://github.com/npm/make-fetch-happen/commit/24544b1)) -* **match:** Rewrite the conditional stream logic (#25) ([66bba4b](https://github.com/npm/make-fetch-happen/commit/66bba4b)) - - - -<a name="2.4.1"></a> -## [2.4.1](https://github.com/npm/make-fetch-happen/compare/v2.4.0...v2.4.1) (2017-04-28) - - -### Bug Fixes - -* **memoization:** missed spots + allow passthrough of memo objs ([ac0cd12](https://github.com/npm/make-fetch-happen/commit/ac0cd12)) - - - -<a name="2.4.0"></a> -# [2.4.0](https://github.com/npm/make-fetch-happen/compare/v2.3.0...v2.4.0) (2017-04-28) - - -### Bug Fixes - -* **memoize:** cacache had a broken memoizer ([8a9ed4c](https://github.com/npm/make-fetch-happen/commit/8a9ed4c)) - - -### Features - -* **memoization:** only slurp stuff into memory if opts.memoize is not false ([0744adc](https://github.com/npm/make-fetch-happen/commit/0744adc)) - - - -<a name="2.3.0"></a> -# [2.3.0](https://github.com/npm/make-fetch-happen/compare/v2.2.6...v2.3.0) (2017-04-27) - - -### Features - -* **agent:** added opts.strictSSL and opts.localAddress ([c35015a](https://github.com/npm/make-fetch-happen/commit/c35015a)) -* **proxy:** Added opts.noProxy and NO_PROXY support ([f45c915](https://github.com/npm/make-fetch-happen/commit/f45c915)) - - - -<a name="2.2.6"></a> -## [2.2.6](https://github.com/npm/make-fetch-happen/compare/v2.2.5...v2.2.6) (2017-04-26) - - -### Bug Fixes - -* **agent:** check uppercase & lowercase proxy env (#24) ([acf2326](https://github.com/npm/make-fetch-happen/commit/acf2326)), closes [#22](https://github.com/npm/make-fetch-happen/issues/22) -* **deps:** switch to node-fetch-npm and stop bundling ([3db603b](https://github.com/npm/make-fetch-happen/commit/3db603b)) - - - -<a name="2.2.5"></a> -## [2.2.5](https://github.com/npm/make-fetch-happen/compare/v2.2.4...v2.2.5) (2017-04-23) - - -### Bug Fixes - -* **deps:** bump cacache and use its size feature ([926c1d3](https://github.com/npm/make-fetch-happen/commit/926c1d3)) - - - -<a name="2.2.4"></a> -## [2.2.4](https://github.com/npm/make-fetch-happen/compare/v2.2.3...v2.2.4) (2017-04-18) - - -### Bug Fixes - -* **integrity:** hash verification issues fixed ([07f9402](https://github.com/npm/make-fetch-happen/commit/07f9402)) - - - -<a name="2.2.3"></a> -## [2.2.3](https://github.com/npm/make-fetch-happen/compare/v2.2.2...v2.2.3) (2017-04-18) - - -### Bug Fixes - -* **staleness:** responses older than 8h were never stale :< ([b54dd75](https://github.com/npm/make-fetch-happen/commit/b54dd75)) -* **warning:** remove spurious warning, make format more spec-compliant ([2e4f6bb](https://github.com/npm/make-fetch-happen/commit/2e4f6bb)) - - - -<a name="2.2.2"></a> -## [2.2.2](https://github.com/npm/make-fetch-happen/compare/v2.2.1...v2.2.2) (2017-04-12) - - -### Bug Fixes - -* **retry:** stop retrying 404s ([6fafd53](https://github.com/npm/make-fetch-happen/commit/6fafd53)) - - - -<a name="2.2.1"></a> -## [2.2.1](https://github.com/npm/make-fetch-happen/compare/v2.2.0...v2.2.1) (2017-04-10) - - -### Bug Fixes - -* **deps:** move test-only deps to devDeps ([2daaf80](https://github.com/npm/make-fetch-happen/commit/2daaf80)) - - - -<a name="2.2.0"></a> -# [2.2.0](https://github.com/npm/make-fetch-happen/compare/v2.1.0...v2.2.0) (2017-04-09) - - -### Bug Fixes - -* **cache:** treat caches as private ([57b7dc2](https://github.com/npm/make-fetch-happen/commit/57b7dc2)) - - -### Features - -* **retry:** accept shorthand retry settings ([dfed69d](https://github.com/npm/make-fetch-happen/commit/dfed69d)) - - - -<a name="2.1.0"></a> -# [2.1.0](https://github.com/npm/make-fetch-happen/compare/v2.0.4...v2.1.0) (2017-04-09) - - -### Features - -* **cache:** cache now obeys Age and a variety of other things (#13) ([7b9652d](https://github.com/npm/make-fetch-happen/commit/7b9652d)) - - - -<a name="2.0.4"></a> -## [2.0.4](https://github.com/npm/make-fetch-happen/compare/v2.0.3...v2.0.4) (2017-04-09) - - -### Bug Fixes - -* **agent:** accept Request as fetch input, not just strings ([b71669a](https://github.com/npm/make-fetch-happen/commit/b71669a)) - - - -<a name="2.0.3"></a> -## [2.0.3](https://github.com/npm/make-fetch-happen/compare/v2.0.2...v2.0.3) (2017-04-09) - - -### Bug Fixes - -* **deps:** seriously ([c29e7e7](https://github.com/npm/make-fetch-happen/commit/c29e7e7)) - - - -<a name="2.0.2"></a> -## [2.0.2](https://github.com/npm/make-fetch-happen/compare/v2.0.1...v2.0.2) (2017-04-09) - - -### Bug Fixes - -* **deps:** use bundleDeps instead ([c36ebf0](https://github.com/npm/make-fetch-happen/commit/c36ebf0)) - - - -<a name="2.0.1"></a> -## [2.0.1](https://github.com/npm/make-fetch-happen/compare/v2.0.0...v2.0.1) (2017-04-09) - - -### Bug Fixes - -* **deps:** make sure node-fetch tarball included in release ([3bf49d1](https://github.com/npm/make-fetch-happen/commit/3bf49d1)) - - - -<a name="2.0.0"></a> -# [2.0.0](https://github.com/npm/make-fetch-happen/compare/v1.7.0...v2.0.0) (2017-04-09) - - -### Bug Fixes - -* **deps:** manually pull in newer node-fetch to avoid babel prod dep ([66e5e87](https://github.com/npm/make-fetch-happen/commit/66e5e87)) -* **retry:** be more specific about when we retry ([a47b782](https://github.com/npm/make-fetch-happen/commit/a47b782)) - - -### Features - -* **agent:** add ca/cert/key support to auto-agent (#15) ([57585a7](https://github.com/npm/make-fetch-happen/commit/57585a7)) - - -### BREAKING CHANGES - -* **agent:** pac proxies are no longer supported. -* **retry:** Retry logic has changes. - -* 404s, 420s, and 429s all retry now. -* ENOTFOUND no longer retries. -* Only ECONNRESET, ECONNREFUSED, EADDRINUSE, ETIMEDOUT, and `request-timeout` errors are retried. - - - -<a name="1.7.0"></a> -# [1.7.0](https://github.com/npm/make-fetch-happen/compare/v1.6.0...v1.7.0) (2017-04-08) - - -### Features - -* **cache:** add useful headers to inform users about cached data ([9bd7b00](https://github.com/npm/make-fetch-happen/commit/9bd7b00)) - - - -<a name="1.6.0"></a> -# [1.6.0](https://github.com/npm/make-fetch-happen/compare/v1.5.1...v1.6.0) (2017-04-06) - - -### Features - -* **agent:** better, keepalive-supporting, default http agents ([16277f6](https://github.com/npm/make-fetch-happen/commit/16277f6)) - - - -<a name="1.5.1"></a> -## [1.5.1](https://github.com/npm/make-fetch-happen/compare/v1.5.0...v1.5.1) (2017-04-05) - - -### Bug Fixes - -* **cache:** bump cacache for its fixed error messages ([2f2b916](https://github.com/npm/make-fetch-happen/commit/2f2b916)) -* **cache:** fix handling of errors in cache reads ([5729222](https://github.com/npm/make-fetch-happen/commit/5729222)) - - - -<a name="1.5.0"></a> -# [1.5.0](https://github.com/npm/make-fetch-happen/compare/v1.4.0...v1.5.0) (2017-04-04) - - -### Features - -* **retry:** retry requests on 408 timeouts, too ([8d8b5bd](https://github.com/npm/make-fetch-happen/commit/8d8b5bd)) - - - -<a name="1.4.0"></a> -# [1.4.0](https://github.com/npm/make-fetch-happen/compare/v1.3.1...v1.4.0) (2017-04-04) - - -### Bug Fixes - -* **cache:** stop relying on BB.catch ([2b04494](https://github.com/npm/make-fetch-happen/commit/2b04494)) - - -### Features - -* **retry:** report retry attempt number as extra header ([fd50927](https://github.com/npm/make-fetch-happen/commit/fd50927)) - - - -<a name="1.3.1"></a> -## [1.3.1](https://github.com/npm/make-fetch-happen/compare/v1.3.0...v1.3.1) (2017-04-04) - - -### Bug Fixes - -* **cache:** pretend cache entry is missing on ENOENT ([9c2bb26](https://github.com/npm/make-fetch-happen/commit/9c2bb26)) - - - -<a name="1.3.0"></a> -# [1.3.0](https://github.com/npm/make-fetch-happen/compare/v1.2.1...v1.3.0) (2017-04-04) - - -### Bug Fixes - -* **cache:** if metadata is missing for some odd reason, ignore the entry ([a021a6b](https://github.com/npm/make-fetch-happen/commit/a021a6b)) - - -### Features - -* **cache:** add special headers when request was loaded straight from cache ([8a7dbd1](https://github.com/npm/make-fetch-happen/commit/8a7dbd1)) -* **cache:** allow configuring algorithms to be calculated on insertion ([bf4a0f2](https://github.com/npm/make-fetch-happen/commit/bf4a0f2)) - - - -<a name="1.2.1"></a> -## [1.2.1](https://github.com/npm/make-fetch-happen/compare/v1.2.0...v1.2.1) (2017-04-03) - - -### Bug Fixes - -* **integrity:** update cacache and ssri and change EBADCHECKSUM -> EINTEGRITY ([b6cf6f6](https://github.com/npm/make-fetch-happen/commit/b6cf6f6)) - - - -<a name="1.2.0"></a> -# [1.2.0](https://github.com/npm/make-fetch-happen/compare/v1.1.0...v1.2.0) (2017-04-03) - - -### Features - -* **integrity:** full Subresource Integrity support (#10) ([a590159](https://github.com/npm/make-fetch-happen/commit/a590159)) - - - -<a name="1.1.0"></a> -# [1.1.0](https://github.com/npm/make-fetch-happen/compare/v1.0.1...v1.1.0) (2017-04-01) - - -### Features - -* **opts:** fetch.defaults() for default options ([522a65e](https://github.com/npm/make-fetch-happen/commit/522a65e)) - - - -<a name="1.0.1"></a> -## [1.0.1](https://github.com/npm/make-fetch-happen/compare/v1.0.0...v1.0.1) (2017-04-01) - - - -<a name="1.0.0"></a> -# 1.0.0 (2017-04-01) - - -### Bug Fixes - -* **cache:** default on cache-control header ([b872a2c](https://github.com/npm/make-fetch-happen/commit/b872a2c)) -* standard stuff and cache matching ([753f2c2](https://github.com/npm/make-fetch-happen/commit/753f2c2)) -* **agent:** nudge around things with opts.agent ([ed62b57](https://github.com/npm/make-fetch-happen/commit/ed62b57)) -* **agent:** {agent: false} has special behavior ([b8cc923](https://github.com/npm/make-fetch-happen/commit/b8cc923)) -* **cache:** invalidation on non-GET ([fe78fac](https://github.com/npm/make-fetch-happen/commit/fe78fac)) -* **cache:** make force-cache and only-if-cached work as expected ([f50e9df](https://github.com/npm/make-fetch-happen/commit/f50e9df)) -* **cache:** more spec compliance ([d5a56db](https://github.com/npm/make-fetch-happen/commit/d5a56db)) -* **cache:** only cache 200 gets ([0abb25a](https://github.com/npm/make-fetch-happen/commit/0abb25a)) -* **cache:** only load cache code if cache opt is a string ([250fcd5](https://github.com/npm/make-fetch-happen/commit/250fcd5)) -* **cache:** oops ([e3fa15a](https://github.com/npm/make-fetch-happen/commit/e3fa15a)) -* **cache:** refactored warning removal into main file ([5b0a9f9](https://github.com/npm/make-fetch-happen/commit/5b0a9f9)) -* **cache:** req constructor no longer needed in Cache ([5b74cbc](https://github.com/npm/make-fetch-happen/commit/5b74cbc)) -* **cache:** standard fetch api calls cacheMode "cache" ([6fba805](https://github.com/npm/make-fetch-happen/commit/6fba805)) -* **cache:** was using wrong method for non-GET/HEAD cache invalidation ([810763a](https://github.com/npm/make-fetch-happen/commit/810763a)) -* **caching:** a bunch of cache-related fixes ([8ebda1d](https://github.com/npm/make-fetch-happen/commit/8ebda1d)) -* **deps:** `cacache[@6](https://github.com/6).3.0` - race condition fixes ([9528442](https://github.com/npm/make-fetch-happen/commit/9528442)) -* **freshness:** fix regex for cacheControl matching ([070db86](https://github.com/npm/make-fetch-happen/commit/070db86)) -* **freshness:** fixed default freshness heuristic value ([5d29e88](https://github.com/npm/make-fetch-happen/commit/5d29e88)) -* **logging:** remove console.log calls ([a1d0a47](https://github.com/npm/make-fetch-happen/commit/a1d0a47)) -* **method:** node-fetch guarantees uppercase ([a1d68d6](https://github.com/npm/make-fetch-happen/commit/a1d68d6)) -* **opts:** simplified opts handling ([516fd6e](https://github.com/npm/make-fetch-happen/commit/516fd6e)) -* **proxy:** pass proxy option directly to ProxyAgent ([3398460](https://github.com/npm/make-fetch-happen/commit/3398460)) -* **retry:** false -> {retries: 0} ([297fbb6](https://github.com/npm/make-fetch-happen/commit/297fbb6)) -* **retry:** only retry put if body is not a stream ([a24e599](https://github.com/npm/make-fetch-happen/commit/a24e599)) -* **retry:** skip retries if body is a stream for ANY method ([780c0f8](https://github.com/npm/make-fetch-happen/commit/780c0f8)) - - -### Features - -* **api:** initial implementation -- can make and cache requests ([7d55b49](https://github.com/npm/make-fetch-happen/commit/7d55b49)) -* **fetch:** injectable cache, and retry support ([87b84bf](https://github.com/npm/make-fetch-happen/commit/87b84bf)) - - -### BREAKING CHANGES - -* **cache:** opts.cache -> opts.cacheManager; opts.cacheMode -> opts.cache -* **fetch:** opts.cache accepts a Cache-like obj or a path. Requests are now retried. -* **api:** actual api implemented diff --git a/deps/npm/node_modules/make-fetch-happen/README.md b/deps/npm/node_modules/make-fetch-happen/README.md index f454469e68..87659c9133 100644 --- a/deps/npm/node_modules/make-fetch-happen/README.md +++ b/deps/npm/node_modules/make-fetch-happen/README.md @@ -20,7 +20,7 @@ pooling, proxies, retries, [and more](#features)! * [`fetch.defaults`](#fetch-defaults) * [`minipass-fetch` options](#minipass-fetch-options) * [`make-fetch-happen` options](#extra-options) - * [`opts.cacheManager`](#opts-cache-manager) + * [`opts.cachePath`](#opts-cache-path) * [`opts.cache`](#opts-cache) * [`opts.proxy`](#opts-proxy) * [`opts.noProxy`](#opts-no-proxy) @@ -35,7 +35,7 @@ pooling, proxies, retries, [and more](#features)! ```javascript const fetch = require('make-fetch-happen').defaults({ - cacheManager: './my-cache' // path where cache will be written (and read) + cachePath: './my-cache' // path where cache will be written (and read) }) fetch('https://registry.npmjs.org/make-fetch-happen').then(res => { @@ -103,7 +103,7 @@ A defaulted `fetch` will also have a `.defaults()` method, so they can be chaine ```javascript const fetch = require('make-fetch-happen').defaults({ - cacheManager: './my-local-cache' + cachePath: './my-local-cache' }) fetch('https://registry.npmjs.org/make-fetch-happen') // will always use the cache @@ -136,7 +136,7 @@ For more details, see [the documentation for `minipass-fetch` itself](https://gi make-fetch-happen augments the `minipass-fetch` API with additional features available through extra options. The following extra options are available: -* [`opts.cacheManager`](#opts-cache-manager) - Cache target to read/write +* [`opts.cachePath`](#opts-cache-path) - Cache target to read/write * [`opts.cache`](#opts-cache) - `fetch` cache mode. Controls cache *behavior*. * [`opts.proxy`](#opts-proxy) - Proxy agent * [`opts.noProxy`](#opts-no-proxy) - Domain segments to disable proxying for. @@ -147,15 +147,9 @@ make-fetch-happen augments the `minipass-fetch` API with additional features ava * [`opts.onRetry`](#opts-onretry) - a function called whenever a retry is attempted * [`opts.integrity`](#opts-integrity) - [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) metadata. -#### <a name="opts-cache-manager"></a> `> opts.cacheManager` +#### <a name="opts-cache-path"></a> `> opts.cachePath` -Either a `String` or a `Cache`. If the former, it will be assumed to be a `Path` to be used as the cache root for [`cacache`](https://npm.im/cacache). - -If an object is provided, it will be assumed to be a compliant [`Cache` instance](https://developer.mozilla.org/en-US/docs/Web/API/Cache). Only `Cache.match()`, `Cache.put()`, and `Cache.delete()` are required. Options objects will not be passed in to `match()` or `delete()`. - -By implementing this API, you can customize the storage backend for make-fetch-happen itself -- for example, you could implement a cache that uses `redis` for caching, or simply keeps everything in memory. Most of the caching logic exists entirely on the make-fetch-happen side, so the only thing you need to worry about is reading, writing, and deleting, as well as making sure `fetch.Response` objects are what gets returned. - -You can refer to `cache.js` in the make-fetch-happen source code for a reference implementation. +A string `Path` to be used as the cache root for [`cacache`](https://npm.im/cacache). **NOTE**: Requests will not be cached unless their response bodies are consumed. You will need to use one of the `res.json()`, `res.buffer()`, etc methods on the response, or drain the `res.body` stream, in order for it to be written. @@ -163,7 +157,9 @@ The default cache manager also adds the following headers to cached responses: * `X-Local-Cache`: Path to the cache the content was found in * `X-Local-Cache-Key`: Unique cache entry key for this response +* `X-Local-Cache-Mode`: Either `stream` or `buffer` to indicate how the response was read from cacache * `X-Local-Cache-Hash`: Specific integrity hash for the cached entry +* `X-Local-Cache-Status`: One of `miss`, `hit`, `stale`, `revalidated`, `updated`, or `skip` to signal how the response was created * `X-Local-Cache-Time`: UTCString of the cache insertion time for the entry Using [`cacache`](https://npm.im/cacache), a call like this may be used to @@ -181,12 +177,8 @@ cacache.get.byDigest(h.get('x-local-cache'), h.get('x-local-cache-hash')) ```javascript fetch('https://registry.npmjs.org/make-fetch-happen', { - cacheManager: './my-local-cache' + cachePath: './my-local-cache' }) // -> 200-level response will be written to disk - -fetch('https://npm.im/cacache', { - cacheManager: new MyCustomRedisCache(process.env.PORT) -}) // -> 200-level response will be written to redis ``` A possible (minimal) implementation for `MyCustomRedisCache`: @@ -230,7 +222,7 @@ class MyCustomRedisCache { #### <a name="opts-cache"></a> `> opts.cache` -This option follows the standard `fetch` API cache option. This option will do nothing if [`opts.cacheManager`](#opts-cache-manager) is null. The following values are accepted (as strings): +This option follows the standard `fetch` API cache option. This option will do nothing if [`opts.cachePath`](#opts-cache-path) is null. The following values are accepted (as strings): * `default` - Fetch will inspect the HTTP cache on the way to the network. If there is a fresh response it will be used. If there is a stale response a conditional request will be created, and a normal request otherwise. It then updates the HTTP cache with the response. If the revalidation request fails (for example, on a 500 or if you're offline), the stale response will be returned. * `no-store` - Fetch behaves as if there is no HTTP cache at all. @@ -245,7 +237,7 @@ This option follows the standard `fetch` API cache option. This option will do n ```javascript const fetch = require('make-fetch-happen').defaults({ - cacheManager: './my-cache' + cachePath: './my-cache' }) // Will error with ENOTCACHED if we haven't already cached this url @@ -330,7 +322,6 @@ An object that can be used to tune request retry settings. Retries will only be The following are worth noting as explicitly not retried: * `getaddrinfo ENOTFOUND` and will be assumed to be either an unreachable domain or the user will be assumed offline. If a response is cached, it will be returned immediately. -* `ECONNRESET` currently has no support for restarting. It will eventually be supported but requires a bit more juggling due to streaming. If `opts.retry` is `false`, it is equivalent to `{retries: 0}` diff --git a/deps/npm/node_modules/make-fetch-happen/cache.js b/deps/npm/node_modules/make-fetch-happen/cache.js deleted file mode 100644 index 234e3a41d0..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/cache.js +++ /dev/null @@ -1,260 +0,0 @@ -'use strict' - -const fetch = require('minipass-fetch') -const cacache = require('cacache') -const ssri = require('ssri') -const url = require('url') - -const Minipass = require('minipass') -const MinipassFlush = require('minipass-flush') -const MinipassCollect = require('minipass-collect') -const MinipassPipeline = require('minipass-pipeline') - -const MAX_MEM_SIZE = 5 * 1024 * 1024 // 5MB - -// some headers should never be stored in the cache, either because -// they're a security footgun to leave lying around, or because we -// just don't need them taking up space. -// set to undefined so they're omitted from the JSON.stringify -const pruneHeaders = { - authorization: undefined, - 'npm-session': undefined, - 'set-cookie': undefined, - 'cf-ray': undefined, - 'cf-cache-status': undefined, - 'cf-request-id': undefined, - 'x-fetch-attempts': undefined, -} - -function cacheKey (req) { - const parsed = new url.URL(req.url) - return `make-fetch-happen:request-cache:${ - url.format({ - protocol: parsed.protocol, - slashes: true, - port: parsed.port, - hostname: parsed.hostname, - pathname: parsed.pathname, - search: parsed.search, - }) - }` -} - -// This is a cacache-based implementation of the Cache standard, -// using node-fetch. -// docs: https://developer.mozilla.org/en-US/docs/Web/API/Cache -// -module.exports = class Cache { - constructor (path, opts) { - this._path = path - this.Promise = (opts && opts.Promise) || Promise - } - - static get pruneHeaders () { - // exposed for testing, not modifiable - return { ...pruneHeaders } - } - - // Returns a Promise that resolves to the response associated with the first - // matching request in the Cache object. - match (req, opts) { - const key = cacheKey(req) - return cacache.get.info(this._path, key).then(info => { - return info && cacache.get.hasContent( - this._path, info.integrity, opts - ).then(exists => exists && info) - }).then(info => { - if (info && info.metadata && matchDetails(req, { - url: info.metadata.url, - reqHeaders: new fetch.Headers(info.metadata.reqHeaders), - resHeaders: new fetch.Headers(info.metadata.resHeaders), - cacheIntegrity: info.integrity, - integrity: opts && opts.integrity, - })) { - const resHeaders = new fetch.Headers(info.metadata.resHeaders) - addCacheHeaders(resHeaders, this._path, key, info.integrity, info.time) - if (req.method === 'HEAD') { - return new fetch.Response(null, { - url: req.url, - headers: resHeaders, - status: 200, - }) - } - const cachePath = this._path - // avoid opening cache file handles until a user actually tries to - // read from it. - const body = new Minipass() - const fitInMemory = info.size < MAX_MEM_SIZE - const removeOnResume = () => body.removeListener('resume', onResume) - const onResume = - opts.memoize !== false && fitInMemory - ? () => { - const c = cacache.get.stream.byDigest(cachePath, info.integrity, { - memoize: opts.memoize, - }) - c.on('error', /* istanbul ignore next */ err => { - body.emit('error', err) - }) - c.pipe(body) - } - : () => { - removeOnResume() - cacache.get.byDigest(cachePath, info.integrity, { - memoize: opts.memoize, - }) - .then(data => body.end(data)) - .catch(/* istanbul ignore next */ err => { - body.emit('error', err) - }) - } - body.once('resume', onResume) - body.once('end', () => removeOnResume) - return this.Promise.resolve(new fetch.Response(body, { - url: req.url, - headers: resHeaders, - status: 200, - size: info.size, - })) - } - }) - } - - // Takes both a request and its response and adds it to the given cache. - put (req, response, opts) { - opts = opts || {} - const size = response.headers.get('content-length') - const fitInMemory = !!size && opts.memoize !== false && size < MAX_MEM_SIZE - const ckey = cacheKey(req) - const cacheOpts = { - algorithms: opts.algorithms, - metadata: { - url: req.url, - reqHeaders: { - ...req.headers.raw(), - ...pruneHeaders, - }, - resHeaders: { - ...response.headers.raw(), - ...pruneHeaders, - }, - }, - size, - memoize: fitInMemory && opts.memoize, - } - if (req.method === 'HEAD' || response.status === 304) { - // Update metadata without writing - return cacache.get.info(this._path, ckey).then(info => { - // Providing these will bypass content write - cacheOpts.integrity = info.integrity - addCacheHeaders( - response.headers, this._path, ckey, info.integrity, info.time - ) - - return new MinipassPipeline( - cacache.get.stream.byDigest(this._path, info.integrity, cacheOpts), - cacache.put.stream(this._path, ckey, cacheOpts) - ).promise().then(() => { - return response - }) - }) - } - const oldBody = response.body - // the flush is the last thing in the pipeline. Build the pipeline - // back-to-front so we don't consume the data before we use it! - // We unshift in either a tee-stream to the cache put stream, - // or a collecter that dumps it to cache in one go, then the - // old body to bring in the data. - const newBody = new MinipassPipeline(new MinipassFlush({ - flush () { - return cacheWritePromise - }, - })) - - let cacheWriteResolve, cacheWriteReject - const cacheWritePromise = new Promise((resolve, reject) => { - cacheWriteResolve = resolve - cacheWriteReject = reject - }) - const cachePath = this._path - - if (fitInMemory) { - const collecter = new MinipassCollect.PassThrough() - collecter.on('collect', data => { - cacache.put( - cachePath, - ckey, - data, - cacheOpts - ).then(cacheWriteResolve, cacheWriteReject) - }) - newBody.unshift(collecter) - } else { - const tee = new Minipass() - const cacheStream = cacache.put.stream( - cachePath, - ckey, - cacheOpts - ) - tee.pipe(cacheStream) - cacheStream.promise().then(cacheWriteResolve, cacheWriteReject) - newBody.unshift(tee) - } - - newBody.unshift(oldBody) - return Promise.resolve(new fetch.Response(newBody, response)) - } - - // Finds the Cache entry whose key is the request, and if found, deletes the - // Cache entry and returns a Promise that resolves to true. If no Cache entry - // is found, it returns false. - 'delete' (req, opts) { - opts = opts || {} - if (typeof opts.memoize === 'object') { - if (opts.memoize.reset) - opts.memoize.reset() - else if (opts.memoize.clear) - opts.memoize.clear() - else { - Object.keys(opts.memoize).forEach(k => { - opts.memoize[k] = null - }) - } - } - return cacache.rm.entry( - this._path, - cacheKey(req) - // TODO - true/false - ).then(() => false) - } -} - -function matchDetails (req, cached) { - const reqUrl = new url.URL(req.url) - const cacheUrl = new url.URL(cached.url) - const vary = cached.resHeaders.get('Vary') - // https://tools.ietf.org/html/rfc7234#section-4.1 - if (vary) { - if (vary.match(/\*/)) - return false - else { - const fieldsMatch = vary.split(/\s*,\s*/).every(field => { - return cached.reqHeaders.get(field) === req.headers.get(field) - }) - if (!fieldsMatch) - return false - } - } - if (cached.integrity) - return ssri.parse(cached.integrity).match(cached.cacheIntegrity) - - reqUrl.hash = null - cacheUrl.hash = null - return url.format(reqUrl) === url.format(cacheUrl) -} - -function addCacheHeaders (resHeaders, path, key, hash, time) { - resHeaders.set('X-Local-Cache', encodeURIComponent(path)) - resHeaders.set('X-Local-Cache-Key', encodeURIComponent(key)) - resHeaders.set('X-Local-Cache-Hash', encodeURIComponent(hash)) - resHeaders.set('X-Local-Cache-Time', new Date(time).toUTCString()) -} diff --git a/deps/npm/node_modules/make-fetch-happen/index.js b/deps/npm/node_modules/make-fetch-happen/index.js deleted file mode 100644 index 54f72049c1..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/index.js +++ /dev/null @@ -1,457 +0,0 @@ -'use strict' - -const url = require('url') -const fetch = require('minipass-fetch') -const pkg = require('./package.json') -const retry = require('promise-retry') -let ssri - -const Minipass = require('minipass') -const MinipassPipeline = require('minipass-pipeline') -const getAgent = require('./agent') -const setWarning = require('./warning') - -const configureOptions = require('./utils/configure-options') -const iterableToObject = require('./utils/iterable-to-object') -const makePolicy = require('./utils/make-policy') - -const isURL = /^https?:/ -const USER_AGENT = `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})` - -const RETRY_ERRORS = [ - 'ECONNRESET', // remote socket closed on us - 'ECONNREFUSED', // remote host refused to open connection - 'EADDRINUSE', // failed to bind to a local port (proxy?) - 'ETIMEDOUT', // someone in the transaction is WAY TOO SLOW - // Known codes we do NOT retry on: - // ENOTFOUND (getaddrinfo failure. Either bad hostname, or offline) -] - -const RETRY_TYPES = [ - 'request-timeout', -] - -// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch -module.exports = cachingFetch -cachingFetch.defaults = function (_uri, _opts) { - const fetch = this - if (typeof _uri === 'object') { - _opts = _uri - _uri = null - } - - function defaultedFetch (uri, opts) { - const finalOpts = Object.assign({}, _opts || {}, opts || {}) - return fetch(uri || _uri, finalOpts) - } - - defaultedFetch.defaults = fetch.defaults - defaultedFetch.delete = fetch.delete - return defaultedFetch -} - -cachingFetch.delete = cacheDelete -function cacheDelete (uri, opts) { - opts = configureOptions(opts) - if (opts.cacheManager) { - const req = new fetch.Request(uri, { - method: opts.method, - headers: opts.headers, - }) - return opts.cacheManager.delete(req, opts) - } -} - -function initializeSsri () { - if (!ssri) - ssri = require('ssri') -} - -function cachingFetch (uri, _opts) { - const opts = configureOptions(_opts) - - if (opts.integrity) { - initializeSsri() - // if verifying integrity, fetch must not decompress - opts.compress = false - } - - const isCachable = ( - ( - opts.method === 'GET' || - opts.method === 'HEAD' - ) && - Boolean(opts.cacheManager) && - opts.cache !== 'no-store' && - opts.cache !== 'reload' - ) - - if (isCachable) { - const req = new fetch.Request(uri, { - method: opts.method, - headers: opts.headers, - }) - - return opts.cacheManager.match(req, opts).then(res => { - if (res) { - const warningCode = (res.headers.get('Warning') || '').match(/^\d+/) - if (warningCode && +warningCode >= 100 && +warningCode < 200) { - // https://tools.ietf.org/html/rfc7234#section-4.3.4 - // - // If a stored response is selected for update, the cache MUST: - // - // * delete any Warning header fields in the stored response with - // warn-code 1xx (see Section 5.5); - // - // * retain any Warning header fields in the stored response with - // warn-code 2xx; - // - res.headers.delete('Warning') - } - - if (opts.cache === 'default' && !isStale(req, res)) - return res - - if (opts.cache === 'default' || opts.cache === 'no-cache') - return conditionalFetch(req, res, opts) - - if (opts.cache === 'force-cache' || opts.cache === 'only-if-cached') { - // 112 Disconnected operation - // SHOULD be included if the cache is intentionally disconnected from - // the rest of the network for a period of time. - // (https://tools.ietf.org/html/rfc2616#section-14.46) - setWarning(res, 112, 'Disconnected operation') - return res - } - } - - if (!res && opts.cache === 'only-if-cached') { - const errorMsg = `request to ${ - uri - } failed: cache mode is 'only-if-cached' but no cached response available.` - - const err = new Error(errorMsg) - err.code = 'ENOTCACHED' - throw err - } - - // Missing cache entry, or mode is default (if stale), reload, no-store - return remoteFetch(req.url, opts) - }) - } - return remoteFetch(uri, opts) -} - -// https://tools.ietf.org/html/rfc7234#section-4.2 -function isStale (req, res) { - const _req = { - url: req.url, - method: req.method, - headers: iterableToObject(req.headers), - } - - const policy = makePolicy(req, res) - - const responseTime = res.headers.get('x-local-cache-time') || - /* istanbul ignore next - would be weird to get a 'stale' - * response that didn't come from cache with a cache time header */ - (res.headers.get('date') || 0) - - policy._responseTime = new Date(responseTime) - - const bool = !policy.satisfiesWithoutRevalidation(_req) - const headers = policy.responseHeaders() - if (headers.warning && /^113\b/.test(headers.warning)) { - // Possible to pick up a rfc7234 warning at this point. - // This is kind of a weird place to stick this, should probably go - // in cachingFetch. But by putting it here, we save an extra - // CachePolicy object construction. - res.headers.append('warning', headers.warning) - } - return bool -} - -function mustRevalidate (res) { - return (res.headers.get('cache-control') || '').match(/must-revalidate/i) -} - -function conditionalFetch (req, cachedRes, opts) { - const _req = { - url: req.url, - method: req.method, - headers: Object.assign({}, opts.headers || {}), - } - - const policy = makePolicy(req, cachedRes) - opts.headers = policy.revalidationHeaders(_req) - - return remoteFetch(req.url, opts) - .then(condRes => { - const revalidatedPolicy = policy.revalidatedPolicy(_req, { - status: condRes.status, - headers: iterableToObject(condRes.headers), - }) - - if (condRes.status >= 500 && !mustRevalidate(cachedRes)) { - // 111 Revalidation failed - // MUST be included if a cache returns a stale response because an - // attempt to revalidate the response failed, due to an inability to - // reach the server. - // (https://tools.ietf.org/html/rfc2616#section-14.46) - setWarning(cachedRes, 111, 'Revalidation failed') - return cachedRes - } - - if (condRes.status === 304) { // 304 Not Modified - // Create a synthetic response from the cached body and original req - const synthRes = new fetch.Response(cachedRes.body, condRes) - return opts.cacheManager.put(req, synthRes, opts) - .then(newRes => { - // Get the list first, because if we delete while iterating, - // it'll throw off the count and not make it through all - // of them. - const newHeaders = revalidatedPolicy.policy.responseHeaders() - const toDelete = [...newRes.headers.keys()] - .filter(k => !newHeaders[k]) - for (const key of toDelete) - newRes.headers.delete(key) - - for (const [key, val] of Object.entries(newHeaders)) - newRes.headers.set(key, val) - - return newRes - }) - } - - return condRes - }) - .then(res => res) - .catch(err => { - if (mustRevalidate(cachedRes)) - throw err - else { - // 111 Revalidation failed - // MUST be included if a cache returns a stale response because an - // attempt to revalidate the response failed, due to an inability to - // reach the server. - // (https://tools.ietf.org/html/rfc2616#section-14.46) - setWarning(cachedRes, 111, 'Revalidation failed') - // 199 Miscellaneous warning - // The warning text MAY include arbitrary information to be presented to - // a human user, or logged. A system receiving this warning MUST NOT take - // any automated action, besides presenting the warning to the user. - // (https://tools.ietf.org/html/rfc2616#section-14.46) - setWarning( - cachedRes, - 199, - `Miscellaneous Warning ${err.code}: ${err.message}` - ) - - return cachedRes - } - }) -} - -function remoteFetchHandleIntegrity (res, integrity) { - if (res.status !== 200) - return res // Error responses aren't subject to integrity checks. - - const oldBod = res.body - const newBod = ssri.integrityStream({ - integrity, - }) - return new fetch.Response(new MinipassPipeline(oldBod, newBod), res) -} - -function remoteFetch (uri, opts) { - const agent = getAgent(uri, opts) - const headers = opts.headers instanceof fetch.Headers - ? opts.headers - : new fetch.Headers(opts.headers) - if (!headers.get('connection')) - headers.set('connection', agent ? 'keep-alive' : 'close') - - if (!headers.get('user-agent')) - headers.set('user-agent', USER_AGENT) - - const reqOpts = { - agent, - body: opts.body, - compress: opts.compress, - follow: opts.follow, - headers, - method: opts.method, - redirect: 'manual', - size: opts.size, - counter: opts.counter, - timeout: opts.timeout, - ca: opts.ca, - cert: opts.cert, - key: opts.key, - rejectUnauthorized: opts.strictSSL, - } - - return retry( - (retryHandler, attemptNum) => { - const req = new fetch.Request(uri, reqOpts) - return fetch(req) - .then((res) => { - if (opts.integrity) - res = remoteFetchHandleIntegrity(res, opts.integrity) - - res.headers.set('x-fetch-attempts', attemptNum) - - const isStream = Minipass.isStream(req.body) - - if (opts.cacheManager) { - const isMethodGetHead = ( - req.method === 'GET' || - req.method === 'HEAD' - ) - - const isCachable = ( - opts.cache !== 'no-store' && - isMethodGetHead && - makePolicy(req, res).storable() && - res.status === 200 // No other statuses should be stored! - ) - - if (isCachable) - return opts.cacheManager.put(req, res, opts) - - if (!isMethodGetHead) { - return opts.cacheManager.delete(req).then(() => { - if (res.status >= 500 && req.method !== 'POST' && !isStream) { - if (typeof opts.onRetry === 'function') - opts.onRetry(res) - - return retryHandler(res) - } - - return res - }) - } - } - - const isRetriable = ( - req.method !== 'POST' && - !isStream && - ( - res.status === 408 || // Request Timeout - res.status === 420 || // Enhance Your Calm (usually Twitter rate-limit) - res.status === 429 || // Too Many Requests ("standard" rate-limiting) - res.status >= 500 // Assume server errors are momentary hiccups - ) - ) - - if (isRetriable) { - if (typeof opts.onRetry === 'function') - opts.onRetry(res) - - return retryHandler(res) - } - - if (!fetch.isRedirect(res.status)) - return res - - if (opts.redirect === 'manual') - return res - - // if (!fetch.isRedirect(res.status) || opts.redirect === 'manual') { - // return res - // } - - // handle redirects - matches behavior of fetch: https://github.com/bitinn/node-fetch - if (opts.redirect === 'error') { - const err = new fetch.FetchError(`redirect mode is set to error: ${uri}`, 'no-redirect', { code: 'ENOREDIRECT' }) - throw err - } - - if (!res.headers.get('location')) { - const err = new fetch.FetchError(`redirect location header missing at: ${uri}`, 'no-location', { code: 'EINVALIDREDIRECT' }) - throw err - } - - if (req.counter >= req.follow) { - const err = new fetch.FetchError(`maximum redirect reached at: ${uri}`, 'max-redirect', { code: 'EMAXREDIRECT' }) - throw err - } - - const resolvedUrlParsed = new url.URL(res.headers.get('location'), req.url) - const resolvedUrl = url.format(resolvedUrlParsed) - const redirectURL = (isURL.test(res.headers.get('location'))) - ? new url.URL(res.headers.get('location')) - : resolvedUrlParsed - - // Comment below is used under the following license: - // Copyright (c) 2010-2012 Mikeal Rogers - // Licensed under the Apache License, Version 2.0 (the "License"); - // you may not use this file except in compliance with the License. - // You may obtain a copy of the License at - // http://www.apache.org/licenses/LICENSE-2.0 - // Unless required by applicable law or agreed to in writing, - // software distributed under the License is distributed on an "AS - // IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either - // express or implied. See the License for the specific language - // governing permissions and limitations under the License. - - // Remove authorization if changing hostnames (but not if just - // changing ports or protocols). This matches the behavior of request: - // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 - if (new url.URL(req.url).hostname !== redirectURL.hostname) - req.headers.delete('authorization') - - // for POST request with 301/302 response, or any request with 303 response, - // use GET when following redirect - if ( - res.status === 303 || - ( - req.method === 'POST' && - ( - res.status === 301 || - res.status === 302 - ) - ) - ) { - opts.method = 'GET' - opts.body = null - req.headers.delete('content-length') - } - - opts.headers = {} - req.headers.forEach((value, name) => { - opts.headers[name] = value - }) - - opts.counter = ++req.counter - return cachingFetch(resolvedUrl, opts) - }) - .catch(err => { - const code = (err.code === 'EPROMISERETRY') - ? err.retried.code - : err.code - - const isRetryError = ( - RETRY_ERRORS.indexOf(code) === -1 && - RETRY_TYPES.indexOf(err.type) === -1 - ) - - if (req.method === 'POST' || isRetryError) - throw err - - if (typeof opts.onRetry === 'function') - opts.onRetry(err) - - return retryHandler(err) - }) - }, - opts.retry - ).catch(err => { - if (err.status >= 400 && err.type !== 'system') { - // this is an HTTP response "error" that we care about - return err - } - - throw err - }) -} diff --git a/deps/npm/node_modules/make-fetch-happen/agent.js b/deps/npm/node_modules/make-fetch-happen/lib/agent.js index e27eb4f3a8..873d69cf47 100644 --- a/deps/npm/node_modules/make-fetch-happen/agent.js +++ b/deps/npm/node_modules/make-fetch-happen/lib/agent.js @@ -4,8 +4,8 @@ const url = require('url') const isLambda = require('is-lambda') const AGENT_CACHE = new LRU({ max: 50 }) -let HttpsAgent -let HttpAgent +const HttpAgent = require('agentkeepalive') +const HttpsAgent = HttpAgent.HttpsAgent module.exports = getAgent @@ -66,11 +66,6 @@ function getAgent (uri, opts) { return proxy } - if (!HttpsAgent) { - HttpAgent = require('agentkeepalive') - HttpsAgent = HttpAgent.HttpsAgent - } - const agent = isHttps ? new HttpsAgent({ maxSockets: agentMaxSockets, ca: opts.ca, @@ -155,15 +150,15 @@ function getProxyUri (uri, opts) { } const getAuth = u => - u.username && u.password ? `${u.username}:${u.password}` - : u.username ? u.username + u.username && u.password ? decodeURIComponent(`${u.username}:${u.password}`) + : u.username ? decodeURIComponent(u.username) : null const getPath = u => u.pathname + u.search + u.hash -let HttpProxyAgent -let HttpsProxyAgent -let SocksProxyAgent +const HttpProxyAgent = require('http-proxy-agent') +const HttpsProxyAgent = require('https-proxy-agent') +const SocksProxyAgent = require('socks-proxy-agent') module.exports.getProxy = getProxy function getProxy (proxyUrl, opts, isHttps) { const popts = { @@ -182,23 +177,13 @@ function getProxy (proxyUrl, opts, isHttps) { } if (proxyUrl.protocol === 'http:' || proxyUrl.protocol === 'https:') { - if (!isHttps) { - if (!HttpProxyAgent) - HttpProxyAgent = require('http-proxy-agent') - + if (!isHttps) return new HttpProxyAgent(popts) - } else { - if (!HttpsProxyAgent) - HttpsProxyAgent = require('https-proxy-agent') - + else return new HttpsProxyAgent(popts) - } - } else if (proxyUrl.protocol.startsWith('socks')) { - if (!SocksProxyAgent) - SocksProxyAgent = require('socks-proxy-agent') - + } else if (proxyUrl.protocol.startsWith('socks')) return new SocksProxyAgent(popts) - } else { + else { throw Object.assign( new Error(`unsupported proxy protocol: '${proxyUrl.protocol}'`), { diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/entry.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/entry.js new file mode 100644 index 0000000000..0df006fe34 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/entry.js @@ -0,0 +1,432 @@ +const { Request, Response } = require('minipass-fetch') +const Minipass = require('minipass') +const MinipassCollect = require('minipass-collect') +const MinipassFlush = require('minipass-flush') +const MinipassPipeline = require('minipass-pipeline') +const cacache = require('cacache') +const url = require('url') + +const CachePolicy = require('./policy.js') +const cacheKey = require('./key.js') +const remote = require('../remote.js') + +const hasOwnProperty = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) + +// maximum amount of data we will buffer into memory +// if we'll exceed this, we switch to streaming +const MAX_MEM_SIZE = 5 * 1024 * 1024 // 5MB + +// allow list for request headers that will be written to the cache index +// note: we will also store any request headers +// that are named in a response's vary header +const KEEP_REQUEST_HEADERS = [ + 'accept-charset', + 'accept-encoding', + 'accept-language', + 'accept', + 'cache-control', +] + +// allow list for response headers that will be written to the cache index +// note: we must not store the real response's age header, or when we load +// a cache policy based on the metadata it will think the cached response +// is always stale +const KEEP_RESPONSE_HEADERS = [ + 'cache-control', + 'content-encoding', + 'content-language', + 'content-type', + 'date', + 'etag', + 'expires', + 'last-modified', + 'location', + 'pragma', + 'vary', +] + +// return an object containing all metadata to be written to the index +const getMetadata = (request, response, options) => { + const metadata = { + url: request.url, + reqHeaders: {}, + resHeaders: {}, + } + + // only save the status if it's not a 200 or 304 + if (response.status !== 200 && response.status !== 304) + metadata.status = response.status + + for (const name of KEEP_REQUEST_HEADERS) { + if (request.headers.has(name)) + metadata.reqHeaders[name] = request.headers.get(name) + } + + // if the request's host header differs from the host in the url + // we need to keep it, otherwise it's just noise and we ignore it + const host = request.headers.get('host') + const parsedUrl = new url.URL(request.url) + if (host && parsedUrl.host !== host) + metadata.reqHeaders.host = host + + // if the response has a vary header, make sure + // we store the relevant request headers too + if (response.headers.has('vary')) { + const vary = response.headers.get('vary') + // a vary of "*" means every header causes a different response. + // in that scenario, we do not include any additional headers + // as the freshness check will always fail anyway and we don't + // want to bloat the cache indexes + if (vary !== '*') { + // copy any other request headers that will vary the response + const varyHeaders = vary.trim().toLowerCase().split(/\s*,\s*/) + for (const name of varyHeaders) { + // explicitly ignore accept-encoding here + if (name !== 'accept-encoding' && request.headers.has(name)) + metadata.reqHeaders[name] = request.headers.get(name) + } + } + } + + for (const name of KEEP_RESPONSE_HEADERS) { + if (response.headers.has(name)) + metadata.resHeaders[name] = response.headers.get(name) + } + + // we only store accept-encoding and content-encoding if the user + // has disabled automatic compression and decompression in minipass-fetch + // since if it's enabled (the default) then the content will have + // already been decompressed making the header a lie + if (options.compress === false) { + metadata.reqHeaders['accept-encoding'] = request.headers.get('accept-encoding') + metadata.resHeaders['content-encoding'] = response.headers.get('content-encoding') + } + + return metadata +} + +// symbols used to hide objects that may be lazily evaluated in a getter +const _request = Symbol('request') +const _response = Symbol('response') +const _policy = Symbol('policy') + +class CacheEntry { + constructor ({ entry, request, response, options }) { + this.entry = entry + this.options = options + this.key = entry ? entry.key : cacheKey(request) + + // these properties are behind getters that lazily evaluate + this[_request] = request + this[_response] = response + this[_policy] = null + } + + // returns a CacheEntry instance that satisfies the given request + // or undefined if no existing entry satisfies + static async find (request, options) { + try { + // compacts the index and returns an array of unique entries + var matches = await cacache.index.compact(options.cachePath, cacheKey(request), (A, B) => { + const entryA = new CacheEntry({ entry: A, options }) + const entryB = new CacheEntry({ entry: B, options }) + return entryA.policy.satisfies(entryB.request) + }, { + validateEntry: (entry) => { + // if an integrity is null, it needs to have a status specified + if (entry.integrity === null) + return !!(entry.metadata && entry.metadata.status) + + return true + }, + }) + } catch (err) { + // if the compact request fails, ignore the error and return + return + } + + // find the specific entry that satisfies the request + let match + for (const entry of matches) { + const _entry = new CacheEntry({ + entry, + options, + }) + + if (_entry.policy.satisfies(request)) { + match = _entry + break + } + } + + return match + } + + // if the user made a PUT/POST/PATCH then we invalidate our + // cache for the same url by deleting the index entirely + static async invalidate (request, options) { + const key = cacheKey(request) + try { + await cacache.rm.entry(options.cachePath, key, { removeFully: true }) + } catch (err) { + // ignore errors + } + } + + get request () { + if (!this[_request]) { + this[_request] = new Request(this.entry.metadata.url, { + method: 'GET', + headers: this.entry.metadata.reqHeaders, + }) + } + + return this[_request] + } + + get response () { + if (!this[_response]) { + this[_response] = new Response(null, { + url: this.entry.metadata.url, + counter: this.options.counter, + status: this.entry.metadata.status || 200, + headers: { + ...this.entry.metadata.resHeaders, + 'content-length': this.entry.size, + }, + }) + } + + return this[_response] + } + + get policy () { + if (!this[_policy]) { + this[_policy] = new CachePolicy({ + entry: this.entry, + request: this.request, + response: this.response, + options: this.options, + }) + } + + return this[_policy] + } + + // wraps the response in a pipeline that stores the data + // in the cache while the user consumes it + async store (status) { + // if we got a status other than 200, 301, or 308, + // or the CachePolicy forbid storage, append the + // cache status header and return it untouched + if (this.request.method !== 'GET' || ![200, 301, 308].includes(this.response.status) || !this.policy.storable()) { + this.response.headers.set('x-local-cache-status', 'skip') + return this.response + } + + const size = this.response.headers.get('content-length') + const fitsInMemory = !!size && Number(size) < MAX_MEM_SIZE + const shouldBuffer = this.options.memoize !== false && fitsInMemory + const cacheOpts = { + algorithms: this.options.algorithms, + metadata: getMetadata(this.request, this.response, this.options), + size, + memoize: fitsInMemory && this.options.memoize, + } + + let body = null + // we only set a body if the status is a 200, redirects are + // stored as metadata only + if (this.response.status === 200) { + let cacheWriteResolve, cacheWriteReject + const cacheWritePromise = new Promise((resolve, reject) => { + cacheWriteResolve = resolve + cacheWriteReject = reject + }) + + body = new MinipassPipeline(new MinipassFlush({ + flush () { + return cacheWritePromise + }, + })) + + let abortStream, onResume + if (shouldBuffer) { + // if the result fits in memory, use a collect stream to gather + // the response and write it to cacache while also passing it through + // to the user + onResume = () => { + const collector = new MinipassCollect.PassThrough() + abortStream = collector + collector.on('collect', (data) => { + // TODO if the cache write fails, log a warning but return the response anyway + cacache.put(this.options.cachePath, this.key, data, cacheOpts).then(cacheWriteResolve, cacheWriteReject) + }) + body.unshift(collector) + body.unshift(this.response.body) + } + } else { + // if it does not fit in memory, create a tee stream and use + // that to pipe to both the cache and the user simultaneously + onResume = () => { + const tee = new Minipass() + const cacheStream = cacache.put.stream(this.options.cachePath, this.key, cacheOpts) + abortStream = cacheStream + tee.pipe(cacheStream) + // TODO if the cache write fails, log a warning but return the response anyway + cacheStream.promise().then(cacheWriteResolve, cacheWriteReject) + body.unshift(tee) + body.unshift(this.response.body) + } + } + + body.once('resume', onResume) + body.once('end', () => body.removeListener('resume', onResume)) + this.response.body.on('error', (err) => { + // the abortStream will either be a MinipassCollect if we buffer + // or a cacache write stream, either way be sure to listen for + // errors from the actual response and avoid writing data that we + // know to be invalid to the cache + abortStream.destroy(err) + }) + } else + await cacache.index.insert(this.options.cachePath, this.key, null, cacheOpts) + + // note: we do not set the x-local-cache-hash header because we do not know + // the hash value until after the write to the cache completes, which doesn't + // happen until after the response has been sent and it's too late to write + // the header anyway + this.response.headers.set('x-local-cache', encodeURIComponent(this.options.cachePath)) + this.response.headers.set('x-local-cache-key', encodeURIComponent(this.key)) + this.response.headers.set('x-local-cache-mode', shouldBuffer ? 'buffer' : 'stream') + this.response.headers.set('x-local-cache-status', status) + this.response.headers.set('x-local-cache-time', new Date().toISOString()) + const newResponse = new Response(body, { + url: this.response.url, + status: this.response.status, + headers: this.response.headers, + counter: this.options.counter, + }) + return newResponse + } + + // use the cached data to create a response and return it + async respond (method, options, status) { + let response + const size = Number(this.response.headers.get('content-length')) + const fitsInMemory = !!size && size < MAX_MEM_SIZE + const shouldBuffer = this.options.memoize !== false && fitsInMemory + if (method === 'HEAD' || [301, 308].includes(this.response.status)) { + // if the request is a HEAD, or the response is a redirect, + // then the metadata in the entry already includes everything + // we need to build a response + response = this.response + } else { + // we're responding with a full cached response, so create a body + // that reads from cacache and attach it to a new Response + const body = new Minipass() + const removeOnResume = () => body.removeListener('resume', onResume) + let onResume + if (shouldBuffer) { + onResume = async () => { + removeOnResume() + try { + const content = await cacache.get.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + body.end(content) + } catch (err) { + body.emit('error', err) + } + } + } else { + onResume = () => { + const cacheStream = cacache.get.stream.byDigest(this.options.cachePath, this.entry.integrity, { memoize: this.options.memoize }) + cacheStream.on('error', (err) => body.emit('error', err)) + cacheStream.pipe(body) + } + } + + body.once('resume', onResume) + body.once('end', removeOnResume) + response = new Response(body, { + url: this.entry.metadata.url, + counter: options.counter, + status: 200, + headers: { + ...this.policy.responseHeaders(), + }, + }) + } + + response.headers.set('x-local-cache', encodeURIComponent(this.options.cachePath)) + response.headers.set('x-local-cache-hash', encodeURIComponent(this.entry.integrity)) + response.headers.set('x-local-cache-key', encodeURIComponent(this.key)) + response.headers.set('x-local-cache-mode', shouldBuffer ? 'buffer' : 'stream') + response.headers.set('x-local-cache-status', status) + response.headers.set('x-local-cache-time', new Date(this.entry.time).toUTCString()) + return response + } + + // use the provided request along with this cache entry to + // revalidate the stored response. returns a response, either + // from the cache or from the update + async revalidate (request, options) { + const revalidateRequest = new Request(request, { + headers: this.policy.revalidationHeaders(request), + }) + + try { + // NOTE: be sure to remove the headers property from the + // user supplied options, since we have already defined + // them on the new request object. if they're still in the + // options then those will overwrite the ones from the policy + var response = await remote(revalidateRequest, { + ...options, + headers: undefined, + }) + } catch (err) { + // if the network fetch fails, return the stale + // cached response unless it has a cache-control + // of 'must-revalidate' + if (!this.policy.mustRevalidate) + return this.respond(request.method, options, 'stale') + + throw err + } + + if (this.policy.revalidated(revalidateRequest, response)) { + // we got a 304, write a new index to the cache and respond from cache + const metadata = getMetadata(request, response, options) + // 304 responses do not include headers that are specific to the response data + // since they do not include a body, so we copy values for headers that were + // in the old cache entry to the new one, if the new metadata does not already + // include that header + for (const name of KEEP_RESPONSE_HEADERS) { + if (!hasOwnProperty(metadata.resHeaders, name) && hasOwnProperty(this.entry.metadata.resHeaders, name)) + metadata.resHeaders[name] = this.entry.metadata.resHeaders[name] + } + + try { + await cacache.index.insert(options.cachePath, this.key, this.entry.integrity, { + size: this.entry.size, + metadata, + }) + } catch (err) { + // if updating the cache index fails, we ignore it and + // respond anyway + } + return this.respond(request.method, options, 'revalidated') + } + + // if we got a modified response, create a new entry based on it + const newEntry = new CacheEntry({ + request, + response, + options, + }) + + // respond with the new entry while writing it to the cache + return newEntry.store('updated') + } +} + +module.exports = CacheEntry diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/errors.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/errors.js new file mode 100644 index 0000000000..31e97c4b03 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/errors.js @@ -0,0 +1,10 @@ +class NotCachedError extends Error { + constructor (url) { + super(`request to ${url} failed: cache mode is 'only-if-cached' but no cached response is available.`) + this.code = 'ENOTCACHED' + } +} + +module.exports = { + NotCachedError, +} diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/index.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/index.js new file mode 100644 index 0000000000..00df31dd15 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/index.js @@ -0,0 +1,46 @@ +const { NotCachedError } = require('./errors.js') +const CacheEntry = require('./entry.js') +const remote = require('../remote.js') + +// do whatever is necessary to get a Response and return it +const cacheFetch = async (request, options) => { + // try to find a cached entry that satisfies this request + const entry = await CacheEntry.find(request, options) + if (!entry) { + // no cached result, if the cache mode is only-if-cached that's a failure + if (options.cache === 'only-if-cached') + throw new NotCachedError(request.url) + + // otherwise, we make a request, store it and return it + const response = await remote(request, options) + const entry = new CacheEntry({ request, response, options }) + return entry.store('miss') + } + + // we have a cached response that satisfies this request, however + // if the cache mode is reload the user explicitly wants us to revalidate + if (options.cache === 'reload') + return entry.revalidate(request, options) + + // if the cache mode is either force-cache or only-if-cached we will only + // respond with a cached entry, even if it's stale. set the status to the + // appropriate value based on whether revalidation is needed and respond + // from the cache + const _needsRevalidation = entry.policy.needsRevalidation(request) + if (options.cache === 'force-cache' || + options.cache === 'only-if-cached' || + !_needsRevalidation) + return entry.respond(request.method, options, _needsRevalidation ? 'stale' : 'hit') + + // cache entry might be stale, revalidate it and return a response + return entry.revalidate(request, options) +} + +cacheFetch.invalidate = async (request, options) => { + if (!options.cachePath) + return + + return CacheEntry.invalidate(request, options) +} + +module.exports = cacheFetch diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/key.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/key.js new file mode 100644 index 0000000000..f7684d562b --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/key.js @@ -0,0 +1,17 @@ +const { URL, format } = require('url') + +// options passed to url.format() when generating a key +const formatOptions = { + auth: false, + fragment: false, + search: true, + unicode: false, +} + +// returns a string to be used as the cache key for the Request +const cacheKey = (request) => { + const parsed = new URL(request.url) + return `make-fetch-happen:request-cache:${format(parsed, formatOptions)}` +} + +module.exports = cacheKey diff --git a/deps/npm/node_modules/make-fetch-happen/lib/cache/policy.js b/deps/npm/node_modules/make-fetch-happen/lib/cache/policy.js new file mode 100644 index 0000000000..189dce80ee --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/cache/policy.js @@ -0,0 +1,161 @@ +const CacheSemantics = require('http-cache-semantics') +const Negotiator = require('negotiator') +const ssri = require('ssri') + +// HACK: negotiator lazy loads several of its own modules +// as a micro optimization. we need to be sure that they're +// in memory as soon as possible at startup so that we do +// not try to lazy load them after the directory has been +// retired during a self update of the npm CLI, we do this +// by calling all of the methods that trigger a lazy load +// on a fake instance. +const preloadNegotiator = new Negotiator({ headers: {} }) +preloadNegotiator.charsets() +preloadNegotiator.encodings() +preloadNegotiator.languages() +preloadNegotiator.mediaTypes() + +// options passed to http-cache-semantics constructor +const policyOptions = { + shared: false, + ignoreCargoCult: true, +} + +// a fake empty response, used when only testing the +// request for storability +const emptyResponse = { status: 200, headers: {} } + +// returns a plain object representation of the Request +const requestObject = (request) => { + const _obj = { + method: request.method, + url: request.url, + headers: {}, + } + + request.headers.forEach((value, key) => { + _obj.headers[key] = value + }) + + return _obj +} + +// returns a plain object representation of the Response +const responseObject = (response) => { + const _obj = { + status: response.status, + headers: {}, + } + + response.headers.forEach((value, key) => { + _obj.headers[key] = value + }) + + return _obj +} + +class CachePolicy { + constructor ({ entry, request, response, options }) { + this.entry = entry + this.request = requestObject(request) + this.response = responseObject(response) + this.options = options + this.policy = new CacheSemantics(this.request, this.response, policyOptions) + + if (this.entry) { + // if we have an entry, copy the timestamp to the _responseTime + // this is necessary because the CacheSemantics constructor forces + // the value to Date.now() which means a policy created from a + // cache entry is likely to always identify itself as stale + this.policy._responseTime = this.entry.time + } + } + + // static method to quickly determine if a request alone is storable + static storable (request, options) { + // no cachePath means no caching + if (!options.cachePath) + return false + + // user explicitly asked not to cache + if (options.cache === 'no-store') + return false + + // we only cache GET and HEAD requests + if (!['GET', 'HEAD'].includes(request.method)) + return false + + // otherwise, let http-cache-semantics make the decision + // based on the request's headers + const policy = new CacheSemantics(requestObject(request), emptyResponse, policyOptions) + return policy.storable() + } + + // returns true if the policy satisfies the request + satisfies (request) { + const _req = requestObject(request) + if (this.request.headers.host !== _req.headers.host) + return false + + const negotiatorA = new Negotiator(this.request) + const negotiatorB = new Negotiator(_req) + + if (JSON.stringify(negotiatorA.mediaTypes()) !== JSON.stringify(negotiatorB.mediaTypes())) + return false + + if (JSON.stringify(negotiatorA.languages()) !== JSON.stringify(negotiatorB.languages())) + return false + + if (JSON.stringify(negotiatorA.encodings()) !== JSON.stringify(negotiatorB.encodings())) + return false + + if (this.options.integrity) + return ssri.parse(this.options.integrity).match(this.entry.integrity) + + return true + } + + // returns true if the request and response allow caching + storable () { + return this.policy.storable() + } + + // NOTE: this is a hack to avoid parsing the cache-control + // header ourselves, it returns true if the response's + // cache-control contains must-revalidate + get mustRevalidate () { + return !!this.policy._rescc['must-revalidate'] + } + + // returns true if the cached response requires revalidation + // for the given request + needsRevalidation (request) { + const _req = requestObject(request) + // force method to GET because we only cache GETs + // but can serve a HEAD from a cached GET + _req.method = 'GET' + return !this.policy.satisfiesWithoutRevalidation(_req) + } + + responseHeaders () { + return this.policy.responseHeaders() + } + + // returns a new object containing the appropriate headers + // to send a revalidation request + revalidationHeaders (request) { + const _req = requestObject(request) + return this.policy.revalidationHeaders(_req) + } + + // returns true if the request/response was revalidated + // successfully. returns false if a new response was received + revalidated (request, response) { + const _req = requestObject(request) + const _res = responseObject(response) + const policy = this.policy.revalidatedPolicy(_req, _res) + return !policy.modified + } +} + +module.exports = CachePolicy diff --git a/deps/npm/node_modules/make-fetch-happen/lib/fetch.js b/deps/npm/node_modules/make-fetch-happen/lib/fetch.js new file mode 100644 index 0000000000..dfded79295 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/fetch.js @@ -0,0 +1,100 @@ +'use strict' + +const { FetchError, Request, isRedirect } = require('minipass-fetch') +const url = require('url') + +const CachePolicy = require('./cache/policy.js') +const cache = require('./cache/index.js') +const remote = require('./remote.js') + +// given a Request, a Response and user options +// return true if the response is a redirect that +// can be followed. we throw errors that will result +// in the fetch being rejected if the redirect is +// possible but invalid for some reason +const canFollowRedirect = (request, response, options) => { + if (!isRedirect(response.status)) + return false + + if (options.redirect === 'manual') + return false + + if (options.redirect === 'error') + throw new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect', { code: 'ENOREDIRECT' }) + + if (!response.headers.has('location')) + throw new FetchError(`redirect location header missing for: ${request.url}`, 'no-location', { code: 'EINVALIDREDIRECT' }) + + if (request.counter >= request.follow) + throw new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect', { code: 'EMAXREDIRECT' }) + + return true +} + +// given a Request, a Response, and the user's options return an object +// with a new Request and a new options object that will be used for +// following the redirect +const getRedirect = (request, response, options) => { + const _opts = { ...options } + const location = response.headers.get('location') + const redirectUrl = new url.URL(location, /^https?:/.test(location) ? undefined : request.url) + // Comment below is used under the following license: + // Copyright (c) 2010-2012 Mikeal Rogers + // Licensed under the Apache License, Version 2.0 (the "License"); + // you may not use this file except in compliance with the License. + // You may obtain a copy of the License at + // http://www.apache.org/licenses/LICENSE-2.0 + // Unless required by applicable law or agreed to in writing, + // software distributed under the License is distributed on an "AS + // IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either + // express or implied. See the License for the specific language + // governing permissions and limitations under the License. + + // Remove authorization if changing hostnames (but not if just + // changing ports or protocols). This matches the behavior of request: + // https://github.com/request/request/blob/b12a6245/lib/redirect.js#L134-L138 + if (new url.URL(request.url).hostname !== redirectUrl.hostname) + request.headers.delete('authorization') + + // for POST request with 301/302 response, or any request with 303 response, + // use GET when following redirect + if (response.status === 303 || (request.method === 'POST' && [301, 302].includes(response.status))) { + _opts.method = 'GET' + _opts.body = null + request.headers.delete('content-length') + } + + _opts.headers = {} + request.headers.forEach((value, key) => { + _opts.headers[key] = value + }) + + _opts.counter = ++request.counter + const redirectReq = new Request(url.format(redirectUrl), _opts) + return { + request: redirectReq, + options: _opts, + } +} + +const fetch = async (request, options) => { + const response = CachePolicy.storable(request, options) + ? await cache(request, options) + : await remote(request, options) + + // if the request wasn't a GET or HEAD, and the response + // status is between 200 and 399 inclusive, invalidate the + // request url + if (!['GET', 'HEAD'].includes(request.method) && + response.status >= 200 && + response.status <= 399) + await cache.invalidate(request, options) + + if (!canFollowRedirect(request, response, options)) + return response + + const redirect = getRedirect(request, response, options) + return fetch(redirect.request, redirect.options) +} + +module.exports = fetch diff --git a/deps/npm/node_modules/make-fetch-happen/lib/index.js b/deps/npm/node_modules/make-fetch-happen/lib/index.js new file mode 100644 index 0000000000..6028bc0725 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/index.js @@ -0,0 +1,40 @@ +const { FetchError, Headers, Request, Response } = require('minipass-fetch') + +const configureOptions = require('./options.js') +const fetch = require('./fetch.js') + +const makeFetchHappen = (url, opts) => { + const options = configureOptions(opts) + + const request = new Request(url, options) + return fetch(request, options) +} + +makeFetchHappen.defaults = (defaultUrl, defaultOptions = {}) => { + if (typeof defaultUrl === 'object') { + defaultOptions = defaultUrl + defaultUrl = null + } + + const defaultedFetch = (url, options = {}) => { + const finalUrl = url || defaultUrl + const finalOptions = { + ...defaultOptions, + ...options, + headers: { + ...defaultOptions.headers, + ...options.headers, + }, + } + return makeFetchHappen(finalUrl, finalOptions) + } + + defaultedFetch.defaults = makeFetchHappen.defaults + return defaultedFetch +} + +module.exports = makeFetchHappen +module.exports.FetchError = FetchError +module.exports.Headers = Headers +module.exports.Request = Request +module.exports.Response = Response diff --git a/deps/npm/node_modules/make-fetch-happen/lib/options.js b/deps/npm/node_modules/make-fetch-happen/lib/options.js new file mode 100644 index 0000000000..0889175486 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/options.js @@ -0,0 +1,45 @@ +const conditionalHeaders = [ + 'if-modified-since', + 'if-none-match', + 'if-unmodified-since', + 'if-match', + 'if-range', +] + +const configureOptions = (opts) => { + const options = { ...opts } + options.method = options.method ? options.method.toUpperCase() : 'GET' + if (Object.prototype.hasOwnProperty.call(options, 'strictSSL')) + options.rejectUnauthorized = options.strictSSL + + if (!options.retry) + options.retry = { retries: 0 } + else if (typeof options.retry === 'string') { + const retries = parseInt(options.retry, 10) + if (isFinite(retries)) + options.retry = { retries } + else + options.retry = { retries: 0 } + } else if (typeof options.retry === 'number') + options.retry = { retries: options.retry } + else + options.retry = { retries: 0, ...options.retry } + + options.cache = options.cache || 'default' + if (options.cache === 'default') { + const hasConditionalHeader = Object.keys(options.headers || {}).some((name) => { + return conditionalHeaders.includes(name.toLowerCase()) + }) + if (hasConditionalHeader) + options.cache = 'no-store' + } + + // cacheManager is deprecated, but if it's set and + // cachePath is not we should copy it to the new field + if (options.cacheManager && !options.cachePath) + options.cachePath = options.cacheManager + + return options +} + +module.exports = configureOptions diff --git a/deps/npm/node_modules/make-fetch-happen/lib/remote.js b/deps/npm/node_modules/make-fetch-happen/lib/remote.js new file mode 100644 index 0000000000..e37f39de84 --- /dev/null +++ b/deps/npm/node_modules/make-fetch-happen/lib/remote.js @@ -0,0 +1,101 @@ +const Minipass = require('minipass') +const MinipassPipeline = require('minipass-pipeline') +const fetch = require('minipass-fetch') +const promiseRetry = require('promise-retry') +const ssri = require('ssri') + +const getAgent = require('./agent.js') +const pkg = require('../package.json') + +const USER_AGENT = `${pkg.name}/${pkg.version} (+https://npm.im/${pkg.name})` + +const RETRY_ERRORS = [ + 'ECONNRESET', // remote socket closed on us + 'ECONNREFUSED', // remote host refused to open connection + 'EADDRINUSE', // failed to bind to a local port (proxy?) + 'ETIMEDOUT', // someone in the transaction is WAY TOO SLOW + // Known codes we do NOT retry on: + // ENOTFOUND (getaddrinfo failure. Either bad hostname, or offline) +] + +const RETRY_TYPES = [ + 'request-timeout', +] + +// make a request directly to the remote source, +// retrying certain classes of errors as well as +// following redirects (through the cache if necessary) +// and verifying response integrity +const remoteFetch = (request, options) => { + const agent = getAgent(request.url, options) + if (!request.headers.has('connection')) + request.headers.set('connection', agent ? 'keep-alive' : 'close') + + if (!request.headers.has('user-agent')) + request.headers.set('user-agent', USER_AGENT) + + // keep our own options since we're overriding the agent + // and the redirect mode + const _opts = { + ...options, + agent, + redirect: 'manual', + } + + return promiseRetry(async (retryHandler, attemptNum) => { + const req = new fetch.Request(request, _opts) + try { + let res = await fetch(req, _opts) + if (_opts.integrity && res.status === 200) { + // we got a 200 response and the user has specified an expected + // integrity value, so wrap the response in an ssri stream to verify it + const integrityStream = ssri.integrityStream({ integrity: _opts.integrity }) + res = new fetch.Response(new MinipassPipeline(res.body, integrityStream), res) + } + + res.headers.set('x-fetch-attempts', attemptNum) + + // do not retry POST requests, or requests with a streaming body + // do retry requests with a 408, 420, 429 or 500+ status in the response + const isStream = Minipass.isStream(req.body) + const isRetriable = req.method !== 'POST' && + !isStream && + ([408, 420, 429].includes(res.status) || res.status >= 500) + + if (isRetriable) { + if (typeof options.onRetry === 'function') + options.onRetry(res) + + return retryHandler(res) + } + + return res + } catch (err) { + const code = (err.code === 'EPROMISERETRY') + ? err.retried.code + : err.code + + // err.retried will be the thing that was thrown from above + // if it's a response, we just got a bad status code and we + // can re-throw to allow the retry + const isRetryError = err.retried instanceof fetch.Response || + (RETRY_ERRORS.includes(code) && RETRY_TYPES.includes(err.type)) + + if (req.method === 'POST' || isRetryError) + throw err + + if (typeof options.onRetry === 'function') + options.onRetry(err) + + return retryHandler(err) + } + }, options.retry).catch((err) => { + // don't reject for http errors, just return them + if (err.status >= 400 && err.type !== 'system') + return err + + throw err + }) +} + +module.exports = remoteFetch diff --git a/deps/npm/node_modules/make-fetch-happen/package.json b/deps/npm/node_modules/make-fetch-happen/package.json index 7e854dcdf0..af97a161c6 100644 --- a/deps/npm/node_modules/make-fetch-happen/package.json +++ b/deps/npm/node_modules/make-fetch-happen/package.json @@ -1,21 +1,19 @@ { "name": "make-fetch-happen", - "version": "8.0.14", + "version": "9.0.2", "description": "Opinionated, caching, retrying fetch client", - "main": "index.js", + "main": "lib/index.js", "files": [ - "*.js", - "lib", - "utils" + "lib" ], "scripts": { "preversion": "npm t", "postversion": "npm publish", "prepublishOnly": "git push --follow-tags", - "test": "tap test/*.js", + "test": "tap", "posttest": "npm run lint", "eslint": "eslint", - "lint": "npm run eslint -- *.js utils test", + "lint": "npm run eslint -- lib test", "lintfix": "npm run lint -- --fix" }, "repository": "https://github.com/npm/make-fetch-happen", @@ -36,7 +34,7 @@ "license": "ISC", "dependencies": { "agentkeepalive": "^4.1.3", - "cacache": "^15.0.5", + "cacache": "^15.2.0", "http-cache-semantics": "^4.1.0", "http-proxy-agent": "^4.0.1", "https-proxy-agent": "^5.0.0", @@ -47,26 +45,32 @@ "minipass-fetch": "^1.3.2", "minipass-flush": "^1.0.5", "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", "promise-retry": "^2.0.1", "socks-proxy-agent": "^5.0.0", "ssri": "^8.0.0" }, "devDependencies": { - "eslint": "^7.14.0", - "eslint-plugin-import": "^2.22.1", + "eslint": "^7.26.0", + "eslint-plugin-import": "^2.23.2", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-promise": "^5.1.0", "eslint-plugin-standard": "^5.0.0", "mkdirp": "^1.0.4", - "nock": "^11.9.1", + "nock": "^13.0.11", "npmlog": "^4.1.2", "require-inject": "^1.4.2", - "rimraf": "^2.7.1", + "rimraf": "^3.0.2", "safe-buffer": "^5.2.1", - "standard-version": "^7.1.0", - "tap": "^14.11.0" + "standard-version": "^9.3.0", + "tap": "^15.0.9" }, "engines": { "node": ">= 10" + }, + "tap": { + "color": 1, + "files": "test/*.js", + "check-coverage": true } } diff --git a/deps/npm/node_modules/make-fetch-happen/utils/configure-options.js b/deps/npm/node_modules/make-fetch-happen/utils/configure-options.js deleted file mode 100644 index 75ea5d15ec..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/utils/configure-options.js +++ /dev/null @@ -1,32 +0,0 @@ -'use strict' - -const initializeCache = require('./initialize-cache') - -module.exports = function configureOptions (_opts) { - const opts = Object.assign({}, _opts || {}) - opts.method = (opts.method || 'GET').toUpperCase() - - if (!opts.retry) { - // opts.retry was falsy; set default - opts.retry = { retries: 0 } - } else { - if (typeof opts.retry !== 'object') { - // Shorthand - if (typeof opts.retry === 'number') - opts.retry = { retries: opts.retry } - - if (typeof opts.retry === 'string') { - const value = parseInt(opts.retry, 10) - opts.retry = (value) ? { retries: value } : { retries: 0 } - } - } else { - // Set default retries - opts.retry = Object.assign({}, { retries: 0 }, opts.retry) - } - } - - if (opts.cacheManager) - initializeCache(opts) - - return opts -} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/initialize-cache.js b/deps/npm/node_modules/make-fetch-happen/utils/initialize-cache.js deleted file mode 100644 index 9f96bf5622..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/utils/initialize-cache.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' - -const isHeaderConditional = require('./is-header-conditional') -// Default cacache-based cache -const Cache = require('../cache') - -module.exports = function initializeCache (opts) { - /** - * NOTE: `opts.cacheManager` is the path to cache - * We're making the assumption that if `opts.cacheManager` *isn't* a string, - * it's a cache object - */ - if (typeof opts.cacheManager === 'string') { - // Need to make a cache object - opts.cacheManager = new Cache(opts.cacheManager, opts) - } - - opts.cache = opts.cache || 'default' - - if (opts.cache === 'default' && isHeaderConditional(opts.headers)) { - // If header list contains `If-Modified-Since`, `If-None-Match`, - // `If-Unmodified-Since`, `If-Match`, or `If-Range`, fetch will set cache - // mode to "no-store" if it is "default". - opts.cache = 'no-store' - } -} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/is-header-conditional.js b/deps/npm/node_modules/make-fetch-happen/utils/is-header-conditional.js deleted file mode 100644 index 5081e0ce12..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/utils/is-header-conditional.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict' - -module.exports = function isHeaderConditional (headers) { - if (!headers || typeof headers !== 'object') - return false - - const modifiers = [ - 'if-modified-since', - 'if-none-match', - 'if-unmodified-since', - 'if-match', - 'if-range', - ] - - return Object.keys(headers) - .some(h => modifiers.indexOf(h.toLowerCase()) !== -1) -} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/iterable-to-object.js b/deps/npm/node_modules/make-fetch-happen/utils/iterable-to-object.js deleted file mode 100644 index 1fe5ba6544..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/utils/iterable-to-object.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' - -module.exports = function iterableToObject (iter) { - const obj = {} - for (const k of iter.keys()) - obj[k] = iter.get(k) - - return obj -} diff --git a/deps/npm/node_modules/make-fetch-happen/utils/make-policy.js b/deps/npm/node_modules/make-fetch-happen/utils/make-policy.js deleted file mode 100644 index 5e884847dd..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/utils/make-policy.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict' - -const CachePolicy = require('http-cache-semantics') - -const iterableToObject = require('./iterable-to-object') - -module.exports = function makePolicy (req, res) { - const _req = { - url: req.url, - method: req.method, - headers: iterableToObject(req.headers), - } - const _res = { - status: res.status, - headers: iterableToObject(res.headers), - } - - return new CachePolicy(_req, _res, { shared: false }) -} diff --git a/deps/npm/node_modules/make-fetch-happen/warning.js b/deps/npm/node_modules/make-fetch-happen/warning.js deleted file mode 100644 index 2b96024714..0000000000 --- a/deps/npm/node_modules/make-fetch-happen/warning.js +++ /dev/null @@ -1,24 +0,0 @@ -const url = require('url') - -module.exports = setWarning - -function setWarning (reqOrRes, code, message, replace) { - // Warning = "Warning" ":" 1#warning-value - // warning-value = warn-code SP warn-agent SP warn-text [SP warn-date] - // warn-code = 3DIGIT - // warn-agent = ( host [ ":" port ] ) | pseudonym - // ; the name or pseudonym of the server adding - // ; the Warning header, for use in debugging - // warn-text = quoted-string - // warn-date = <"> HTTP-date <"> - // (https://tools.ietf.org/html/rfc2616#section-14.46) - const host = new url.URL(reqOrRes.url).host - const jsonMessage = JSON.stringify(message) - const jsonDate = JSON.stringify(new Date().toUTCString()) - const header = replace ? 'set' : 'append' - - reqOrRes.headers[header]( - 'Warning', - `${code} ${host} ${jsonMessage} ${jsonDate}` - ) -} diff --git a/deps/npm/node_modules/mime-db/HISTORY.md b/deps/npm/node_modules/mime-db/HISTORY.md index 1555055e8a..ff9438ee9c 100644 --- a/deps/npm/node_modules/mime-db/HISTORY.md +++ b/deps/npm/node_modules/mime-db/HISTORY.md @@ -1,3 +1,10 @@ +1.48.0 / 2021-05-30 +=================== + + * Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + * Add new upstream MIME types + * Mark `text/yaml` as compressible + 1.47.0 / 2021-04-01 =================== diff --git a/deps/npm/node_modules/mime-db/db.json b/deps/npm/node_modules/mime-db/db.json index 63c189ea26..067e0ce815 100644 --- a/deps/npm/node_modules/mime-db/db.json +++ b/deps/npm/node_modules/mime-db/db.json @@ -11,6 +11,14 @@ "source": "iana", "compressible": true }, + "application/3gpphal+json": { + "source": "iana", + "compressible": true + }, + "application/3gpphalforms+json": { + "source": "iana", + "compressible": true + }, "application/a2l": { "source": "iana" }, @@ -999,6 +1007,9 @@ "application/nss": { "source": "iana" }, + "application/oauth-authz-req+jwt": { + "source": "iana" + }, "application/ocsp-request": { "source": "iana" }, @@ -1342,6 +1353,10 @@ "source": "iana", "compressible": true }, + "application/sarif-external-properties+json": { + "source": "iana", + "compressible": true + }, "application/sbe": { "source": "iana" }, @@ -1696,6 +1711,9 @@ "application/vnd.3gpp-v2x-local-service-information": { "source": "iana" }, + "application/vnd.3gpp.5gnas": { + "source": "iana" + }, "application/vnd.3gpp.access-transfer-events+xml": { "source": "iana", "compressible": true @@ -1708,9 +1726,15 @@ "source": "iana", "compressible": true }, + "application/vnd.3gpp.gtpc": { + "source": "iana" + }, "application/vnd.3gpp.interworking-data": { "source": "iana" }, + "application/vnd.3gpp.lpp": { + "source": "iana" + }, "application/vnd.3gpp.mc-signalling-ear": { "source": "iana" }, @@ -1820,6 +1844,12 @@ "source": "iana", "compressible": true }, + "application/vnd.3gpp.ngap": { + "source": "iana" + }, + "application/vnd.3gpp.pfcp": { + "source": "iana" + }, "application/vnd.3gpp.pic-bw-large": { "source": "iana", "extensions": ["plb"] @@ -1832,6 +1862,9 @@ "source": "iana", "extensions": ["pvb"] }, + "application/vnd.3gpp.s1ap": { + "source": "iana" + }, "application/vnd.3gpp.sms": { "source": "iana" }, @@ -2322,6 +2355,9 @@ "application/vnd.cryptomator.encrypted": { "source": "iana" }, + "application/vnd.cryptomator.vault": { + "source": "iana" + }, "application/vnd.ctc-posml": { "source": "iana", "extensions": ["pml"] @@ -2817,6 +2853,19 @@ "source": "iana", "extensions": ["fsc"] }, + "application/vnd.fujifilm.fb.docuworks": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.binder": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.docuworks.container": { + "source": "iana" + }, + "application/vnd.fujifilm.fb.jfi+xml": { + "source": "iana", + "compressible": true + }, "application/vnd.fujitsu.oasys": { "source": "iana", "extensions": ["oas"] @@ -3427,7 +3476,8 @@ "extensions": ["portpkg"] }, "application/vnd.mapbox-vector-tile": { - "source": "iana" + "source": "iana", + "extensions": ["mvt"] }, "application/vnd.marlin.drm.actiontoken+xml": { "source": "iana", @@ -5438,6 +5488,7 @@ "source": "iana" }, "application/wasm": { + "source": "iana", "compressible": true, "extensions": ["wasm"] }, @@ -7400,6 +7451,9 @@ "source": "iana", "extensions": ["x_t"] }, + "model/vnd.pytha.pyox": { + "source": "iana" + }, "model/vnd.rosette.annotated-data-model": { "source": "iana" }, @@ -7682,6 +7736,7 @@ "source": "iana" }, "text/shex": { + "source": "iana", "extensions": ["shex"] }, "text/slim": { @@ -7953,6 +8008,7 @@ "source": "iana" }, "text/yaml": { + "compressible": true, "extensions": ["yaml","yml"] }, "video/1d-interleaved-parityfec": { diff --git a/deps/npm/node_modules/mime-db/package.json b/deps/npm/node_modules/mime-db/package.json index bd6403fb68..d4395a727b 100644 --- a/deps/npm/node_modules/mime-db/package.json +++ b/deps/npm/node_modules/mime-db/package.json @@ -1,7 +1,7 @@ { "name": "mime-db", "description": "Media Type Database", - "version": "1.47.0", + "version": "1.48.0", "contributors": [ "Douglas Christopher Wilson <doug@somethingdoug.com>", "Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)", @@ -22,16 +22,16 @@ "bluebird": "3.7.2", "co": "4.6.0", "cogent": "1.0.1", - "csv-parse": "4.15.3", - "eslint": "7.23.0", + "csv-parse": "4.15.4", + "eslint": "7.27.0", "eslint-config-standard": "15.0.1", - "eslint-plugin-import": "2.22.1", - "eslint-plugin-markdown": "2.0.0", + "eslint-plugin-import": "2.23.4", + "eslint-plugin-markdown": "2.2.0", "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", + "eslint-plugin-promise": "5.1.0", "eslint-plugin-standard": "4.1.0", "gnode": "0.1.2", - "mocha": "8.3.2", + "mocha": "8.4.0", "nyc": "15.1.0", "raw-body": "2.4.1", "stream-to-array": "2.3.0" diff --git a/deps/npm/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/mime-types/HISTORY.md index 38472bee13..19e45a15fc 100644 --- a/deps/npm/node_modules/mime-types/HISTORY.md +++ b/deps/npm/node_modules/mime-types/HISTORY.md @@ -1,3 +1,11 @@ +2.1.31 / 2021-06-01 +=================== + + * deps: mime-db@1.48.0 + - Add extension `.mvt` to `application/vnd.mapbox-vector-tile` + - Add new upstream MIME types + - Mark `text/yaml` as compressible + 2.1.30 / 2021-04-02 =================== diff --git a/deps/npm/node_modules/mime-types/package.json b/deps/npm/node_modules/mime-types/package.json index ea53dd22aa..a271000ec9 100644 --- a/deps/npm/node_modules/mime-types/package.json +++ b/deps/npm/node_modules/mime-types/package.json @@ -1,7 +1,7 @@ { "name": "mime-types", "description": "The ultimate javascript content-type utility.", - "version": "2.1.30", + "version": "2.1.31", "contributors": [ "Douglas Christopher Wilson <doug@somethingdoug.com>", "Jeremiah Senkpiel <fishrock123@rocketmail.com> (https://searchbeam.jit.su)", @@ -14,17 +14,17 @@ ], "repository": "jshttp/mime-types", "dependencies": { - "mime-db": "1.47.0" + "mime-db": "1.48.0" }, "devDependencies": { - "eslint": "7.23.0", + "eslint": "7.27.0", "eslint-config-standard": "14.1.1", - "eslint-plugin-import": "2.22.1", - "eslint-plugin-markdown": "2.0.0", + "eslint-plugin-import": "2.23.4", + "eslint-plugin-markdown": "2.2.0", "eslint-plugin-node": "11.1.0", - "eslint-plugin-promise": "4.3.1", + "eslint-plugin-promise": "5.1.0", "eslint-plugin-standard": "4.1.0", - "mocha": "8.3.2", + "mocha": "8.4.0", "nyc": "15.1.0" }, "files": [ diff --git a/deps/npm/node_modules/negotiator/HISTORY.md b/deps/npm/node_modules/negotiator/HISTORY.md new file mode 100644 index 0000000000..6d06c76aaa --- /dev/null +++ b/deps/npm/node_modules/negotiator/HISTORY.md @@ -0,0 +1,103 @@ +0.6.2 / 2019-04-29 +================== + + * Fix sorting charset, encoding, and language with extra parameters + +0.6.1 / 2016-05-02 +================== + + * perf: improve `Accept` parsing speed + * perf: improve `Accept-Charset` parsing speed + * perf: improve `Accept-Encoding` parsing speed + * perf: improve `Accept-Language` parsing speed + +0.6.0 / 2015-09-29 +================== + + * Fix including type extensions in parameters in `Accept` parsing + * Fix parsing `Accept` parameters with quoted equals + * Fix parsing `Accept` parameters with quoted semicolons + * Lazy-load modules from main entry point + * perf: delay type concatenation until needed + * perf: enable strict mode + * perf: hoist regular expressions + * perf: remove closures getting spec properties + * perf: remove a closure from media type parsing + * perf: remove property delete from media type parsing + +0.5.3 / 2015-05-10 +================== + + * Fix media type parameter matching to be case-insensitive + +0.5.2 / 2015-05-06 +================== + + * Fix comparing media types with quoted values + * Fix splitting media types with quoted commas + +0.5.1 / 2015-02-14 +================== + + * Fix preference sorting to be stable for long acceptable lists + +0.5.0 / 2014-12-18 +================== + + * Fix list return order when large accepted list + * Fix missing identity encoding when q=0 exists + * Remove dynamic building of Negotiator class + +0.4.9 / 2014-10-14 +================== + + * Fix error when media type has invalid parameter + +0.4.8 / 2014-09-28 +================== + + * Fix all negotiations to be case-insensitive + * Stable sort preferences of same quality according to client order + * Support Node.js 0.6 + +0.4.7 / 2014-06-24 +================== + + * Handle invalid provided languages + * Handle invalid provided media types + +0.4.6 / 2014-06-11 +================== + + * Order by specificity when quality is the same + +0.4.5 / 2014-05-29 +================== + + * Fix regression in empty header handling + +0.4.4 / 2014-05-29 +================== + + * Fix behaviors when headers are not present + +0.4.3 / 2014-04-16 +================== + + * Handle slashes on media params correctly + +0.4.2 / 2014-02-28 +================== + + * Fix media type sorting + * Handle media types params strictly + +0.4.1 / 2014-01-16 +================== + + * Use most specific matches + +0.4.0 / 2014-01-09 +================== + + * Remove preferred prefix from methods diff --git a/deps/npm/node_modules/negotiator/LICENSE b/deps/npm/node_modules/negotiator/LICENSE new file mode 100644 index 0000000000..ea6b9e2e9a --- /dev/null +++ b/deps/npm/node_modules/negotiator/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2012-2014 Federico Romero +Copyright (c) 2012-2014 Isaac Z. Schlueter +Copyright (c) 2014-2015 Douglas Christopher Wilson + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/negotiator/README.md b/deps/npm/node_modules/negotiator/README.md new file mode 100644 index 0000000000..04a67ff765 --- /dev/null +++ b/deps/npm/node_modules/negotiator/README.md @@ -0,0 +1,203 @@ +# negotiator + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +An HTTP content negotiator for Node.js + +## Installation + +```sh +$ npm install negotiator +``` + +## API + +```js +var Negotiator = require('negotiator') +``` + +### Accept Negotiation + +```js +availableMediaTypes = ['text/html', 'text/plain', 'application/json'] + +// The negotiator constructor receives a request object +negotiator = new Negotiator(request) + +// Let's say Accept header is 'text/html, application/*;q=0.2, image/jpeg;q=0.8' + +negotiator.mediaTypes() +// -> ['text/html', 'image/jpeg', 'application/*'] + +negotiator.mediaTypes(availableMediaTypes) +// -> ['text/html', 'application/json'] + +negotiator.mediaType(availableMediaTypes) +// -> 'text/html' +``` + +You can check a working example at `examples/accept.js`. + +#### Methods + +##### mediaType() + +Returns the most preferred media type from the client. + +##### mediaType(availableMediaType) + +Returns the most preferred media type from a list of available media types. + +##### mediaTypes() + +Returns an array of preferred media types ordered by the client preference. + +##### mediaTypes(availableMediaTypes) + +Returns an array of preferred media types ordered by priority from a list of +available media types. + +### Accept-Language Negotiation + +```js +negotiator = new Negotiator(request) + +availableLanguages = ['en', 'es', 'fr'] + +// Let's say Accept-Language header is 'en;q=0.8, es, pt' + +negotiator.languages() +// -> ['es', 'pt', 'en'] + +negotiator.languages(availableLanguages) +// -> ['es', 'en'] + +language = negotiator.language(availableLanguages) +// -> 'es' +``` + +You can check a working example at `examples/language.js`. + +#### Methods + +##### language() + +Returns the most preferred language from the client. + +##### language(availableLanguages) + +Returns the most preferred language from a list of available languages. + +##### languages() + +Returns an array of preferred languages ordered by the client preference. + +##### languages(availableLanguages) + +Returns an array of preferred languages ordered by priority from a list of +available languages. + +### Accept-Charset Negotiation + +```js +availableCharsets = ['utf-8', 'iso-8859-1', 'iso-8859-5'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Charset header is 'utf-8, iso-8859-1;q=0.8, utf-7;q=0.2' + +negotiator.charsets() +// -> ['utf-8', 'iso-8859-1', 'utf-7'] + +negotiator.charsets(availableCharsets) +// -> ['utf-8', 'iso-8859-1'] + +negotiator.charset(availableCharsets) +// -> 'utf-8' +``` + +You can check a working example at `examples/charset.js`. + +#### Methods + +##### charset() + +Returns the most preferred charset from the client. + +##### charset(availableCharsets) + +Returns the most preferred charset from a list of available charsets. + +##### charsets() + +Returns an array of preferred charsets ordered by the client preference. + +##### charsets(availableCharsets) + +Returns an array of preferred charsets ordered by priority from a list of +available charsets. + +### Accept-Encoding Negotiation + +```js +availableEncodings = ['identity', 'gzip'] + +negotiator = new Negotiator(request) + +// Let's say Accept-Encoding header is 'gzip, compress;q=0.2, identity;q=0.5' + +negotiator.encodings() +// -> ['gzip', 'identity', 'compress'] + +negotiator.encodings(availableEncodings) +// -> ['gzip', 'identity'] + +negotiator.encoding(availableEncodings) +// -> 'gzip' +``` + +You can check a working example at `examples/encoding.js`. + +#### Methods + +##### encoding() + +Returns the most preferred encoding from the client. + +##### encoding(availableEncodings) + +Returns the most preferred encoding from a list of available encodings. + +##### encodings() + +Returns an array of preferred encodings ordered by the client preference. + +##### encodings(availableEncodings) + +Returns an array of preferred encodings ordered by priority from a list of +available encodings. + +## See Also + +The [accepts](https://npmjs.org/package/accepts#readme) module builds on +this module and provides an alternative interface, mime type validation, +and more. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/negotiator.svg +[npm-url]: https://npmjs.org/package/negotiator +[node-version-image]: https://img.shields.io/node/v/negotiator.svg +[node-version-url]: https://nodejs.org/en/download/ +[travis-image]: https://img.shields.io/travis/jshttp/negotiator/master.svg +[travis-url]: https://travis-ci.org/jshttp/negotiator +[coveralls-image]: https://img.shields.io/coveralls/jshttp/negotiator/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/negotiator?branch=master +[downloads-image]: https://img.shields.io/npm/dm/negotiator.svg +[downloads-url]: https://npmjs.org/package/negotiator diff --git a/deps/npm/node_modules/negotiator/index.js b/deps/npm/node_modules/negotiator/index.js new file mode 100644 index 0000000000..8d4f6a226c --- /dev/null +++ b/deps/npm/node_modules/negotiator/index.js @@ -0,0 +1,124 @@ +/*! + * negotiator + * Copyright(c) 2012 Federico Romero + * Copyright(c) 2012-2014 Isaac Z. Schlueter + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Cached loaded submodules. + * @private + */ + +var modules = Object.create(null); + +/** + * Module exports. + * @public + */ + +module.exports = Negotiator; +module.exports.Negotiator = Negotiator; + +/** + * Create a Negotiator instance from a request. + * @param {object} request + * @public + */ + +function Negotiator(request) { + if (!(this instanceof Negotiator)) { + return new Negotiator(request); + } + + this.request = request; +} + +Negotiator.prototype.charset = function charset(available) { + var set = this.charsets(available); + return set && set[0]; +}; + +Negotiator.prototype.charsets = function charsets(available) { + var preferredCharsets = loadModule('charset').preferredCharsets; + return preferredCharsets(this.request.headers['accept-charset'], available); +}; + +Negotiator.prototype.encoding = function encoding(available) { + var set = this.encodings(available); + return set && set[0]; +}; + +Negotiator.prototype.encodings = function encodings(available) { + var preferredEncodings = loadModule('encoding').preferredEncodings; + return preferredEncodings(this.request.headers['accept-encoding'], available); +}; + +Negotiator.prototype.language = function language(available) { + var set = this.languages(available); + return set && set[0]; +}; + +Negotiator.prototype.languages = function languages(available) { + var preferredLanguages = loadModule('language').preferredLanguages; + return preferredLanguages(this.request.headers['accept-language'], available); +}; + +Negotiator.prototype.mediaType = function mediaType(available) { + var set = this.mediaTypes(available); + return set && set[0]; +}; + +Negotiator.prototype.mediaTypes = function mediaTypes(available) { + var preferredMediaTypes = loadModule('mediaType').preferredMediaTypes; + return preferredMediaTypes(this.request.headers.accept, available); +}; + +// Backwards compatibility +Negotiator.prototype.preferredCharset = Negotiator.prototype.charset; +Negotiator.prototype.preferredCharsets = Negotiator.prototype.charsets; +Negotiator.prototype.preferredEncoding = Negotiator.prototype.encoding; +Negotiator.prototype.preferredEncodings = Negotiator.prototype.encodings; +Negotiator.prototype.preferredLanguage = Negotiator.prototype.language; +Negotiator.prototype.preferredLanguages = Negotiator.prototype.languages; +Negotiator.prototype.preferredMediaType = Negotiator.prototype.mediaType; +Negotiator.prototype.preferredMediaTypes = Negotiator.prototype.mediaTypes; + +/** + * Load the given module. + * @private + */ + +function loadModule(moduleName) { + var module = modules[moduleName]; + + if (module !== undefined) { + return module; + } + + // This uses a switch for static require analysis + switch (moduleName) { + case 'charset': + module = require('./lib/charset'); + break; + case 'encoding': + module = require('./lib/encoding'); + break; + case 'language': + module = require('./lib/language'); + break; + case 'mediaType': + module = require('./lib/mediaType'); + break; + default: + throw new Error('Cannot find module \'' + moduleName + '\''); + } + + // Store to prevent invoking require() + modules[moduleName] = module; + + return module; +} diff --git a/deps/npm/node_modules/negotiator/lib/charset.js b/deps/npm/node_modules/negotiator/lib/charset.js new file mode 100644 index 0000000000..cdd0148034 --- /dev/null +++ b/deps/npm/node_modules/negotiator/lib/charset.js @@ -0,0 +1,169 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredCharsets; +module.exports.preferredCharsets = preferredCharsets; + +/** + * Module variables. + * @private + */ + +var simpleCharsetRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Charset header. + * @private + */ + +function parseAcceptCharset(accept) { + var accepts = accept.split(','); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var charset = parseCharset(accepts[i].trim(), i); + + if (charset) { + accepts[j++] = charset; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a charset from the Accept-Charset header. + * @private + */ + +function parseCharset(str, i) { + var match = simpleCharsetRegExp.exec(str); + if (!match) return null; + + var charset = match[1]; + var q = 1; + if (match[2]) { + var params = match[2].split(';') + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); + if (p[0] === 'q') { + q = parseFloat(p[1]); + break; + } + } + } + + return { + charset: charset, + q: q, + i: i + }; +} + +/** + * Get the priority of a charset. + * @private + */ + +function getCharsetPriority(charset, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(charset, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the charset. + * @private + */ + +function specify(charset, spec, index) { + var s = 0; + if(spec.charset.toLowerCase() === charset.toLowerCase()){ + s |= 1; + } else if (spec.charset !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +} + +/** + * Get the preferred charsets from an Accept-Charset header. + * @public + */ + +function preferredCharsets(accept, provided) { + // RFC 2616 sec 14.2: no header = * + var accepts = parseAcceptCharset(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all charsets + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullCharset); + } + + var priorities = provided.map(function getPriority(type, index) { + return getCharsetPriority(type, accepts, index); + }); + + // sorted list of accepted charsets + return priorities.filter(isQuality).sort(compareSpecs).map(function getCharset(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full charset string. + * @private + */ + +function getFullCharset(spec) { + return spec.charset; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/deps/npm/node_modules/negotiator/lib/encoding.js b/deps/npm/node_modules/negotiator/lib/encoding.js new file mode 100644 index 0000000000..8432cd77b8 --- /dev/null +++ b/deps/npm/node_modules/negotiator/lib/encoding.js @@ -0,0 +1,184 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredEncodings; +module.exports.preferredEncodings = preferredEncodings; + +/** + * Module variables. + * @private + */ + +var simpleEncodingRegExp = /^\s*([^\s;]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Encoding header. + * @private + */ + +function parseAcceptEncoding(accept) { + var accepts = accept.split(','); + var hasIdentity = false; + var minQuality = 1; + + for (var i = 0, j = 0; i < accepts.length; i++) { + var encoding = parseEncoding(accepts[i].trim(), i); + + if (encoding) { + accepts[j++] = encoding; + hasIdentity = hasIdentity || specify('identity', encoding); + minQuality = Math.min(minQuality, encoding.q || 1); + } + } + + if (!hasIdentity) { + /* + * If identity doesn't explicitly appear in the accept-encoding header, + * it's added to the list of acceptable encoding with the lowest q + */ + accepts[j++] = { + encoding: 'identity', + q: minQuality, + i: i + }; + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse an encoding from the Accept-Encoding header. + * @private + */ + +function parseEncoding(str, i) { + var match = simpleEncodingRegExp.exec(str); + if (!match) return null; + + var encoding = match[1]; + var q = 1; + if (match[2]) { + var params = match[2].split(';'); + for (var j = 0; j < params.length; j++) { + var p = params[j].trim().split('='); + if (p[0] === 'q') { + q = parseFloat(p[1]); + break; + } + } + } + + return { + encoding: encoding, + q: q, + i: i + }; +} + +/** + * Get the priority of an encoding. + * @private + */ + +function getEncodingPriority(encoding, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(encoding, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the encoding. + * @private + */ + +function specify(encoding, spec, index) { + var s = 0; + if(spec.encoding.toLowerCase() === encoding.toLowerCase()){ + s |= 1; + } else if (spec.encoding !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred encodings from an Accept-Encoding header. + * @public + */ + +function preferredEncodings(accept, provided) { + var accepts = parseAcceptEncoding(accept || ''); + + if (!provided) { + // sorted list of all encodings + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullEncoding); + } + + var priorities = provided.map(function getPriority(type, index) { + return getEncodingPriority(type, accepts, index); + }); + + // sorted list of accepted encodings + return priorities.filter(isQuality).sort(compareSpecs).map(function getEncoding(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full encoding string. + * @private + */ + +function getFullEncoding(spec) { + return spec.encoding; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/deps/npm/node_modules/negotiator/lib/language.js b/deps/npm/node_modules/negotiator/lib/language.js new file mode 100644 index 0000000000..62f737f006 --- /dev/null +++ b/deps/npm/node_modules/negotiator/lib/language.js @@ -0,0 +1,179 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredLanguages; +module.exports.preferredLanguages = preferredLanguages; + +/** + * Module variables. + * @private + */ + +var simpleLanguageRegExp = /^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/; + +/** + * Parse the Accept-Language header. + * @private + */ + +function parseAcceptLanguage(accept) { + var accepts = accept.split(','); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var language = parseLanguage(accepts[i].trim(), i); + + if (language) { + accepts[j++] = language; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a language from the Accept-Language header. + * @private + */ + +function parseLanguage(str, i) { + var match = simpleLanguageRegExp.exec(str); + if (!match) return null; + + var prefix = match[1], + suffix = match[2], + full = prefix; + + if (suffix) full += "-" + suffix; + + var q = 1; + if (match[3]) { + var params = match[3].split(';') + for (var j = 0; j < params.length; j++) { + var p = params[j].split('='); + if (p[0] === 'q') q = parseFloat(p[1]); + } + } + + return { + prefix: prefix, + suffix: suffix, + q: q, + i: i, + full: full + }; +} + +/** + * Get the priority of a language. + * @private + */ + +function getLanguagePriority(language, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(language, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the language. + * @private + */ + +function specify(language, spec, index) { + var p = parseLanguage(language) + if (!p) return null; + var s = 0; + if(spec.full.toLowerCase() === p.full.toLowerCase()){ + s |= 4; + } else if (spec.prefix.toLowerCase() === p.full.toLowerCase()) { + s |= 2; + } else if (spec.full.toLowerCase() === p.prefix.toLowerCase()) { + s |= 1; + } else if (spec.full !== '*' ) { + return null + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s + } +}; + +/** + * Get the preferred languages from an Accept-Language header. + * @public + */ + +function preferredLanguages(accept, provided) { + // RFC 2616 sec 14.4: no header = * + var accepts = parseAcceptLanguage(accept === undefined ? '*' : accept || ''); + + if (!provided) { + // sorted list of all languages + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullLanguage); + } + + var priorities = provided.map(function getPriority(type, index) { + return getLanguagePriority(type, accepts, index); + }); + + // sorted list of accepted languages + return priorities.filter(isQuality).sort(compareSpecs).map(function getLanguage(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full language string. + * @private + */ + +function getFullLanguage(spec) { + return spec.full; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} diff --git a/deps/npm/node_modules/negotiator/lib/mediaType.js b/deps/npm/node_modules/negotiator/lib/mediaType.js new file mode 100644 index 0000000000..67309dd75f --- /dev/null +++ b/deps/npm/node_modules/negotiator/lib/mediaType.js @@ -0,0 +1,294 @@ +/** + * negotiator + * Copyright(c) 2012 Isaac Z. Schlueter + * Copyright(c) 2014 Federico Romero + * Copyright(c) 2014-2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict'; + +/** + * Module exports. + * @public + */ + +module.exports = preferredMediaTypes; +module.exports.preferredMediaTypes = preferredMediaTypes; + +/** + * Module variables. + * @private + */ + +var simpleMediaTypeRegExp = /^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/; + +/** + * Parse the Accept header. + * @private + */ + +function parseAccept(accept) { + var accepts = splitMediaTypes(accept); + + for (var i = 0, j = 0; i < accepts.length; i++) { + var mediaType = parseMediaType(accepts[i].trim(), i); + + if (mediaType) { + accepts[j++] = mediaType; + } + } + + // trim accepts + accepts.length = j; + + return accepts; +} + +/** + * Parse a media type from the Accept header. + * @private + */ + +function parseMediaType(str, i) { + var match = simpleMediaTypeRegExp.exec(str); + if (!match) return null; + + var params = Object.create(null); + var q = 1; + var subtype = match[2]; + var type = match[1]; + + if (match[3]) { + var kvps = splitParameters(match[3]).map(splitKeyValuePair); + + for (var j = 0; j < kvps.length; j++) { + var pair = kvps[j]; + var key = pair[0].toLowerCase(); + var val = pair[1]; + + // get the value, unwrapping quotes + var value = val && val[0] === '"' && val[val.length - 1] === '"' + ? val.substr(1, val.length - 2) + : val; + + if (key === 'q') { + q = parseFloat(value); + break; + } + + // store parameter + params[key] = value; + } + } + + return { + type: type, + subtype: subtype, + params: params, + q: q, + i: i + }; +} + +/** + * Get the priority of a media type. + * @private + */ + +function getMediaTypePriority(type, accepted, index) { + var priority = {o: -1, q: 0, s: 0}; + + for (var i = 0; i < accepted.length; i++) { + var spec = specify(type, accepted[i], index); + + if (spec && (priority.s - spec.s || priority.q - spec.q || priority.o - spec.o) < 0) { + priority = spec; + } + } + + return priority; +} + +/** + * Get the specificity of the media type. + * @private + */ + +function specify(type, spec, index) { + var p = parseMediaType(type); + var s = 0; + + if (!p) { + return null; + } + + if(spec.type.toLowerCase() == p.type.toLowerCase()) { + s |= 4 + } else if(spec.type != '*') { + return null; + } + + if(spec.subtype.toLowerCase() == p.subtype.toLowerCase()) { + s |= 2 + } else if(spec.subtype != '*') { + return null; + } + + var keys = Object.keys(spec.params); + if (keys.length > 0) { + if (keys.every(function (k) { + return spec.params[k] == '*' || (spec.params[k] || '').toLowerCase() == (p.params[k] || '').toLowerCase(); + })) { + s |= 1 + } else { + return null + } + } + + return { + i: index, + o: spec.i, + q: spec.q, + s: s, + } +} + +/** + * Get the preferred media types from an Accept header. + * @public + */ + +function preferredMediaTypes(accept, provided) { + // RFC 2616 sec 14.2: no header = */* + var accepts = parseAccept(accept === undefined ? '*/*' : accept || ''); + + if (!provided) { + // sorted list of all types + return accepts + .filter(isQuality) + .sort(compareSpecs) + .map(getFullType); + } + + var priorities = provided.map(function getPriority(type, index) { + return getMediaTypePriority(type, accepts, index); + }); + + // sorted list of accepted types + return priorities.filter(isQuality).sort(compareSpecs).map(function getType(priority) { + return provided[priorities.indexOf(priority)]; + }); +} + +/** + * Compare two specs. + * @private + */ + +function compareSpecs(a, b) { + return (b.q - a.q) || (b.s - a.s) || (a.o - b.o) || (a.i - b.i) || 0; +} + +/** + * Get full type string. + * @private + */ + +function getFullType(spec) { + return spec.type + '/' + spec.subtype; +} + +/** + * Check if a spec has any quality. + * @private + */ + +function isQuality(spec) { + return spec.q > 0; +} + +/** + * Count the number of quotes in a string. + * @private + */ + +function quoteCount(string) { + var count = 0; + var index = 0; + + while ((index = string.indexOf('"', index)) !== -1) { + count++; + index++; + } + + return count; +} + +/** + * Split a key value pair. + * @private + */ + +function splitKeyValuePair(str) { + var index = str.indexOf('='); + var key; + var val; + + if (index === -1) { + key = str; + } else { + key = str.substr(0, index); + val = str.substr(index + 1); + } + + return [key, val]; +} + +/** + * Split an Accept header into media types. + * @private + */ + +function splitMediaTypes(accept) { + var accepts = accept.split(','); + + for (var i = 1, j = 0; i < accepts.length; i++) { + if (quoteCount(accepts[j]) % 2 == 0) { + accepts[++j] = accepts[i]; + } else { + accepts[j] += ',' + accepts[i]; + } + } + + // trim accepts + accepts.length = j + 1; + + return accepts; +} + +/** + * Split a string of parameters. + * @private + */ + +function splitParameters(str) { + var parameters = str.split(';'); + + for (var i = 1, j = 0; i < parameters.length; i++) { + if (quoteCount(parameters[j]) % 2 == 0) { + parameters[++j] = parameters[i]; + } else { + parameters[j] += ';' + parameters[i]; + } + } + + // trim parameters + parameters.length = j + 1; + + for (var i = 0; i < parameters.length; i++) { + parameters[i] = parameters[i].trim(); + } + + return parameters; +} diff --git a/deps/npm/node_modules/negotiator/package.json b/deps/npm/node_modules/negotiator/package.json new file mode 100644 index 0000000000..0c7ff3c2e6 --- /dev/null +++ b/deps/npm/node_modules/negotiator/package.json @@ -0,0 +1,42 @@ +{ + "name": "negotiator", + "description": "HTTP content negotiation", + "version": "0.6.2", + "contributors": [ + "Douglas Christopher Wilson <doug@somethingdoug.com>", + "Federico Romero <federico.romero@outboxlabs.com>", + "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)" + ], + "license": "MIT", + "keywords": [ + "http", + "content negotiation", + "accept", + "accept-language", + "accept-encoding", + "accept-charset" + ], + "repository": "jshttp/negotiator", + "devDependencies": { + "eslint": "5.16.0", + "eslint-plugin-markdown": "1.0.0", + "mocha": "6.1.4", + "nyc": "14.0.0" + }, + "files": [ + "lib/", + "HISTORY.md", + "LICENSE", + "index.js", + "README.md" + ], + "engines": { + "node": ">= 0.6" + }, + "scripts": { + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --check-leaks --bail test/", + "test-cov": "nyc --reporter=html --reporter=text npm test", + "test-travis": "nyc --reporter=text npm test" + } +} diff --git a/deps/npm/node_modules/npm-package-arg/CHANGELOG.md b/deps/npm/node_modules/npm-package-arg/CHANGELOG.md deleted file mode 100644 index 390a3a3c4f..0000000000 --- a/deps/npm/node_modules/npm-package-arg/CHANGELOG.md +++ /dev/null @@ -1,52 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. - -## [8.0.0](https://github.com/npm/npm-package-arg/compare/v7.0.0...v8.0.0) (2019-12-15) - - -### ⚠ BREAKING CHANGES - -* Dropping support for node 6 and 8. It'll probably -still work on those versions, but they are no longer supported or -tested, since npm v7 is moving away from them. - -* drop support for node 6 and 8 ([ba85e68](https://github.com/npm/npm-package-arg/commit/ba85e68555d6270f672c3d59da17672f744d0376)) - -<a name="7.0.0"></a> -# [7.0.0](https://github.com/npm/npm-package-arg/compare/v6.1.1...v7.0.0) (2019-11-11) - - -### deps - -* bump hosted-git-info to 3.0.2 ([68a4fc3](https://github.com/npm/npm-package-arg/commit/68a4fc3)), closes [/github.com/npm/hosted-git-info/pull/38#issuecomment-520243803](https://github.com//github.com/npm/hosted-git-info/pull/38/issues/issuecomment-520243803) - - -### BREAKING CHANGES - -* this drops support for ancient node versions. - - - -<a name="6.1.1"></a> -## [6.1.1](https://github.com/npm/npm-package-arg/compare/v6.1.0...v6.1.1) (2019-08-21) - - -### Bug Fixes - -* preserve drive letter on windows git file:// urls ([3909203](https://github.com/npm/npm-package-arg/commit/3909203)) - - - -<a name="6.1.0"></a> -# [6.1.0](https://github.com/npm/npm-package-arg/compare/v6.0.0...v6.1.0) (2018-04-10) - - -### Bug Fixes - -* **git:** Fix gitRange for git+ssh for private git ([#33](https://github.com/npm/npm-package-arg/issues/33)) ([647a0b3](https://github.com/npm/npm-package-arg/commit/647a0b3)) - - -### Features - -* **alias:** add `npm:` registry alias spec ([#34](https://github.com/npm/npm-package-arg/issues/34)) ([ab99f8e](https://github.com/npm/npm-package-arg/commit/ab99f8e)) diff --git a/deps/npm/node_modules/npm-package-arg/npa.js b/deps/npm/node_modules/npm-package-arg/npa.js index 6018dd608e..3a01d4d907 100644 --- a/deps/npm/node_modules/npm-package-arg/npa.js +++ b/deps/npm/node_modules/npm-package-arg/npa.js @@ -3,16 +3,12 @@ module.exports = npa module.exports.resolve = resolve module.exports.Result = Result -let url -let HostedGit -let semver -let path_ -function path () { - if (!path_) path_ = require('path') - return path_ -} -let validatePackageName -let os +const url = require('url') +const HostedGit = require('hosted-git-info') +const semver = require('semver') +const path = require('path') +const validatePackageName = require('validate-npm-package-name') +const { homedir } = require('os') const isWindows = process.platform === 'win32' || global.FAKE_WINDOWS const hasSlashes = isWindows ? /\\|[/]/ : /[/]/ @@ -24,33 +20,30 @@ function npa (arg, where) { let name let spec if (typeof arg === 'object') { - if (arg instanceof Result && (!where || where === arg.where)) { + if (arg instanceof Result && (!where || where === arg.where)) return arg - } else if (arg.name && arg.rawSpec) { + else if (arg.name && arg.rawSpec) return npa.resolve(arg.name, arg.rawSpec, where || arg.where) - } else { + else return npa(arg.raw, where || arg.where) - } } const nameEndsAt = arg[0] === '@' ? arg.slice(1).indexOf('@') + 1 : arg.indexOf('@') const namePart = nameEndsAt > 0 ? arg.slice(0, nameEndsAt) : arg - if (isURL.test(arg)) { + if (isURL.test(arg)) spec = arg - } else if (isGit.test(arg)) { + else if (isGit.test(arg)) spec = `git+ssh://${arg}` - } else if (namePart[0] !== '@' && (hasSlashes.test(namePart) || isFilename.test(namePart))) { + else if (namePart[0] !== '@' && (hasSlashes.test(namePart) || isFilename.test(namePart))) spec = arg - } else if (nameEndsAt > 0) { + else if (nameEndsAt > 0) { name = namePart spec = arg.slice(nameEndsAt + 1) } else { - if (!validatePackageName) validatePackageName = require('validate-npm-package-name') const valid = validatePackageName(arg) - if (valid.validForOldPackages) { + if (valid.validForOldPackages) name = arg - } else { + else spec = arg - } } return resolve(name, spec, where, arg) } @@ -62,27 +55,29 @@ function resolve (name, spec, where, arg) { raw: arg, name: name, rawSpec: spec, - fromArgument: arg != null + fromArgument: arg != null, }) - if (name) res.setName(name) + if (name) + res.setName(name) - if (spec && (isFilespec.test(spec) || /^file:/i.test(spec))) { + if (spec && (isFilespec.test(spec) || /^file:/i.test(spec))) return fromFile(res, where) - } else if (spec && /^npm:/i.test(spec)) { + else if (spec && /^npm:/i.test(spec)) return fromAlias(res, where) - } - if (!HostedGit) HostedGit = require('hosted-git-info') - const hosted = HostedGit.fromUrl(spec, { noGitPlus: true, noCommittish: true }) - if (hosted) { + + const hosted = HostedGit.fromUrl(spec, { + noGitPlus: true, + noCommittish: true, + }) + if (hosted) return fromHostedGit(res, hosted) - } else if (spec && isURL.test(spec)) { + else if (spec && isURL.test(spec)) return fromURL(res) - } else if (spec && (hasSlashes.test(spec) || isFilename.test(spec))) { + else if (spec && (hasSlashes.test(spec) || isFilename.test(spec))) return fromFile(res, where) - } else { + else return fromRegistry(res) - } } function invalidPackageName (name, valid) { @@ -100,29 +95,29 @@ function Result (opts) { this.type = opts.type this.registry = opts.registry this.where = opts.where - if (opts.raw == null) { + if (opts.raw == null) this.raw = opts.name ? opts.name + '@' + opts.rawSpec : opts.rawSpec - } else { + else this.raw = opts.raw - } + this.name = undefined this.escapedName = undefined this.scope = undefined this.rawSpec = opts.rawSpec == null ? '' : opts.rawSpec this.saveSpec = opts.saveSpec this.fetchSpec = opts.fetchSpec - if (opts.name) this.setName(opts.name) + if (opts.name) + this.setName(opts.name) this.gitRange = opts.gitRange this.gitCommittish = opts.gitCommittish this.hosted = opts.hosted } Result.prototype.setName = function (name) { - if (!validatePackageName) validatePackageName = require('validate-npm-package-name') const valid = validatePackageName(name) - if (!valid.validForOldPackages) { + if (!valid.validForOldPackages) throw invalidPackageName(name, valid) - } + this.name = name this.scope = name[0] === '@' ? name.slice(0, name.indexOf('/')) : undefined // scoped packages in couch must have slash url-encoded, e.g. @foo%2Fbar @@ -132,9 +127,11 @@ Result.prototype.setName = function (name) { Result.prototype.toString = function () { const full = [] - if (this.name != null && this.name !== '') full.push(this.name) + if (this.name != null && this.name !== '') + full.push(this.name) const spec = this.saveSpec || this.fetchSpec || this.rawSpec - if (spec != null && spec !== '') full.push(spec) + if (spec != null && spec !== '') + full.push(spec) return full.length ? full.join('@') : this.raw } @@ -148,45 +145,47 @@ function setGitCommittish (res, committish) { if (committish != null && committish.length >= 7 && committish.slice(0, 7) === 'semver:') { res.gitRange = decodeURIComponent(committish.slice(7)) res.gitCommittish = null - } else { + } else res.gitCommittish = committish === '' ? null : committish - } + return res } const isAbsolutePath = /^[/]|^[A-Za-z]:/ function resolvePath (where, spec) { - if (isAbsolutePath.test(spec)) return spec - return path().resolve(where, spec) + if (isAbsolutePath.test(spec)) + return spec + return path.resolve(where, spec) } function isAbsolute (dir) { - if (dir[0] === '/') return true - if (/^[A-Za-z]:/.test(dir)) return true + if (dir[0] === '/') + return true + if (/^[A-Za-z]:/.test(dir)) + return true return false } function fromFile (res, where) { - if (!where) where = process.cwd() + if (!where) + where = process.cwd() res.type = isFilename.test(res.rawSpec) ? 'file' : 'directory' res.where = where const spec = res.rawSpec.replace(/\\/g, '/') .replace(/^file:[/]*([A-Za-z]:)/, '$1') // drive name paths on windows - .replace(/^file:(?:[/]*([~./]))?/, '$1') + .replace(/^file:(?:[/]*(~\/|\.*\/|[/]))?/, '$1') if (/^~[/]/.test(spec)) { // this is needed for windows and for file:~/foo/bar - if (!os) os = require('os') - res.fetchSpec = resolvePath(os.homedir(), spec.slice(2)) + res.fetchSpec = resolvePath(homedir(), spec.slice(2)) res.saveSpec = 'file:' + spec } else { res.fetchSpec = resolvePath(where, spec) - if (isAbsolute(spec)) { + if (isAbsolute(spec)) res.saveSpec = 'file:' + spec - } else { - res.saveSpec = 'file:' + path().relative(where, res.fetchSpec) - } + else + res.saveSpec = 'file:' + path.relative(where, res.fetchSpec) } return res } @@ -217,12 +216,12 @@ function matchGitScp (spec) { const matched = spec.match(/^git\+ssh:\/\/([^:#]+:[^#]+(?:\.git)?)(?:#(.*))?$/i) return matched && !matched[1].match(/:[0-9]+\/?.*$/i) && { fetchSpec: matched[1], - gitCommittish: matched[2] == null ? null : matched[2] + gitCommittish: matched[2] == null ? null : matched[2], } } function fromURL (res) { - if (!url) url = require('url') + // eslint-disable-next-line node/no-deprecated-api const urlparse = url.parse(res.rawSpec) res.saveSpec = res.rawSpec // check the protocol, and then see if it's git or not @@ -233,9 +232,10 @@ function fromURL (res) { case 'git+rsync:': case 'git+ftp:': case 'git+file:': - case 'git+ssh:': + case 'git+ssh:': { res.type = 'git' - const match = urlparse.protocol === 'git+ssh:' && matchGitScp(res.rawSpec) + const match = urlparse.protocol === 'git+ssh:' ? matchGitScp(res.rawSpec) + : null if (match) { setGitCommittish(res, match.gitCommittish) res.fetchSpec = match.fetchSpec @@ -251,6 +251,7 @@ function fromURL (res) { res.fetchSpec = url.format(urlparse) } break + } case 'http:': case 'https:': res.type = 'remote' @@ -266,12 +267,12 @@ function fromURL (res) { function fromAlias (res, where) { const subSpec = npa(res.rawSpec.substr(4), where) - if (subSpec.type === 'alias') { + if (subSpec.type === 'alias') throw new Error('nested aliases not supported') - } - if (!subSpec.registry) { + + if (!subSpec.registry) throw new Error('aliases only work for registry deps') - } + res.subSpec = subSpec res.registry = true res.type = 'alias' @@ -282,22 +283,21 @@ function fromAlias (res, where) { function fromRegistry (res) { res.registry = true - const spec = res.rawSpec === '' ? 'latest' : res.rawSpec + const spec = res.rawSpec === '' ? 'latest' : res.rawSpec.trim() // no save spec for registry components as we save based on the fetched // version, not on the argument so this can't compute that. res.saveSpec = null res.fetchSpec = spec - if (!semver) semver = require('semver') const version = semver.valid(spec, true) const range = semver.validRange(spec, true) - if (version) { + if (version) res.type = 'version' - } else if (range) { + else if (range) res.type = 'range' - } else { - if (encodeURIComponent(spec) !== spec) { + else { + if (encodeURIComponent(spec) !== spec) throw invalidTagName(spec) - } + res.type = 'tag' } return res diff --git a/deps/npm/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/npm-package-arg/package.json index ed3b364442..a237928943 100644 --- a/deps/npm/node_modules/npm-package-arg/package.json +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -1,6 +1,6 @@ { "name": "npm-package-arg", - "version": "8.1.2", + "version": "8.1.4", "description": "Parse the things that can be arguments to `npm install`", "main": "npa.js", "directories": { @@ -15,14 +15,20 @@ "validate-npm-package-name": "^3.0.0" }, "devDependencies": { - "tap": "^14.11.0" + "@npmcli/lint": "^1.0.1", + "tap": "^15.0.9" }, "scripts": { "preversion": "npm test", "postversion": "npm publish", "prepublishOnly": "git push origin --follow-tags", "test": "tap", - "snap": "tap" + "snap": "tap", + "npmclilint": "npmcli-lint", + "lint": "npm run npmclilint -- \"*.*js\" \"test/**/*.*js\"", + "lintfix": "npm run lint -- --fix", + "posttest": "npm run lint --", + "postsnap": "npm run lintfix --" }, "repository": { "type": "git", diff --git a/deps/npm/node_modules/npm-profile/CHANGELOG.md b/deps/npm/node_modules/npm-profile/CHANGELOG.md deleted file mode 100644 index 3205cf5322..0000000000 --- a/deps/npm/node_modules/npm-profile/CHANGELOG.md +++ /dev/null @@ -1,62 +0,0 @@ -# v5.0.0 (2020-02-27) - -- Drop the CLI from the project, just maintain the library -- Drop support for EOL Node.js versions -- Remove `Promise` option, just use native Promises -- Remove `figgy-pudding` -- Use `npm-registry-fetch` v8 -- fix: do not try to open invalid URLs for WebLogin - -# v4.0.3 (2020-02-27) - -- fix: do not try to open invalid URLs for WebLogin - -# v4.0.2 (2019-07-16) - -- Update `npm-registry-fetch` to 4.0.0 - -# v4.0.1 (2018-08-29) - -- `opts.password` needs to be base64-encoded when passed in for login -- Bump `npm-registry-fetch` dep because we depend on `opts.forceAuth` - -# v4.0.0 (2018-08-28) - -## BREAKING CHANGES: - -- Networking and auth-related options now use the latest [`npm-registry-fetch` config format](https://www.npmjs.com/package/npm-registry-fetch#fetch-opts). - -# v3.0.2 (2018-06-07) - -- Allow newer make-fetch-happen. -- Report 500s from weblogin end point as unsupported. -- EAUTHUNKNOWN errors were incorrectly reported as EAUTHIP. - -# v3.0.1 (2018-02-18) - -- Log `npm-notice` headers - -# v3.0.0 (2018-02-18) - -## BREAKING CHANGES: - -- profile.login() and profile.adduser() take 2 functions: opener() and - prompter(). opener is used when we get the url couplet from the - registry. prompter is used if web-based login fails. -- Non-200 status codes now always throw. Previously if the `content.error` - property was set, `content` would be returned. Content is available on the - thrown error object in the `body` property. - -## FEATURES: - -- The previous adduser is available as adduserCouch -- The previous login is available as loginCouch -- New loginWeb and adduserWeb commands added, which take an opener - function to open up the web browser. -- General errors have better error message reporting - -## FIXES: - -- General errors now correctly include the URL. -- Missing user errors from Couch are now thrown. (As was always intended.) -- Many errors have better stacktrace filtering. diff --git a/deps/npm/node_modules/npm-profile/package.json b/deps/npm/node_modules/npm-profile/package.json index 7e2acc4d07..43cc7c921b 100644 --- a/deps/npm/node_modules/npm-profile/package.json +++ b/deps/npm/node_modules/npm-profile/package.json @@ -1,12 +1,12 @@ { "name": "npm-profile", - "version": "5.0.3", + "version": "5.0.4", "description": "Library for updating an npmjs.com profile", "keywords": [], "author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org/)", "license": "ISC", "dependencies": { - "npm-registry-fetch": "^10.0.0" + "npm-registry-fetch": "^11.0.0" }, "main": "index.js", "repository": { diff --git a/deps/npm/node_modules/npm-registry-fetch/README.md b/deps/npm/node_modules/npm-registry-fetch/README.md index 5ce9770c60..efc3b1f644 100644 --- a/deps/npm/node_modules/npm-registry-fetch/README.md +++ b/deps/npm/node_modules/npm-registry-fetch/README.md @@ -390,7 +390,7 @@ invocations of the CLI). * Type: String * Default: null -If provided, it will be sent in the `npm-command` header. This yeader is +If provided, it will be sent in the `npm-command` header. This header is used by the npm registry to identify the npm command that caused this request to be made. @@ -516,10 +516,7 @@ If the request URI already has a query string, it will be merged with * Default: `'https://registry.npmjs.org'` Registry configuration for a request. If a request URL only includes the URL -path, this registry setting will be prepended. This configuration is also used -to determine authentication details, so even if the request URL references a -completely different host, `opts.registry` will be used to find the auth details -for that request. +path, this registry setting will be prepended. See also [`opts.scope`](#opts-scope), [`opts.spec`](#opts-spec), and [`opts.<scope>:registry`](#opts-scope-registry) which can all affect the actual diff --git a/deps/npm/node_modules/npm-registry-fetch/check-response.js b/deps/npm/node_modules/npm-registry-fetch/check-response.js index 7610e0d7a7..8bd85661ee 100644 --- a/deps/npm/node_modules/npm-registry-fetch/check-response.js +++ b/deps/npm/node_modules/npm-registry-fetch/check-response.js @@ -1,46 +1,46 @@ 'use strict' const errors = require('./errors.js') -const LRU = require('lru-cache') const { Response } = require('minipass-fetch') const defaultOpts = require('./default-opts.js') -const checkResponse = async ({ method, uri, res, registry, startTime, auth, opts }) => { - opts = { ...defaultOpts, ...opts } - if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) - opts.log.notice('', res.headers.get('npm-notice')) +const checkResponse = + async ({ method, uri, res, registry, startTime, auth, opts }) => { + opts = { ...defaultOpts, ...opts } + if (res.headers.has('npm-notice') && !res.headers.has('x-local-cache')) + opts.log.notice('', res.headers.get('npm-notice')) - checkWarnings(res, registry, opts) - if (res.status >= 400) { - logRequest(method, res, startTime, opts) - if (auth && auth.scopeAuthKey && !auth.token && !auth.auth) { + if (res.status >= 400) { + logRequest(method, res, startTime, opts) + if (auth && auth.scopeAuthKey && !auth.token && !auth.auth) { // we didn't have auth for THIS request, but we do have auth for // requests to the registry indicated by the spec's scope value. // Warn the user. - opts.log.warn('registry', `No auth for URI, but auth present for scoped registry. + opts.log.warn('registry', `No auth for URI, but auth present for scoped registry. URI: ${uri} Scoped Registry Key: ${auth.scopeAuthKey} More info here: https://github.com/npm/cli/wiki/No-auth-for-URI,-but-auth-present-for-scoped-registry`) + } + return checkErrors(method, res, startTime, opts) + } else { + res.body.on('end', () => logRequest(method, res, startTime, opts)) + if (opts.ignoreBody) { + res.body.resume() + return new Response(null, res) + } + return res } - return checkErrors(method, res, startTime, opts) - } else { - res.body.on('end', () => logRequest(method, res, startTime, opts)) - if (opts.ignoreBody) { - res.body.resume() - return new Response(null, res) - } - return res } -} module.exports = checkResponse function logRequest (method, res, startTime, opts) { const elapsedTime = Date.now() - startTime const attempt = res.headers.get('x-fetch-attempts') const attemptStr = attempt && attempt > 1 ? ` attempt #${attempt}` : '' - const cacheStr = res.headers.get('x-local-cache') ? ' (from cache)' : '' + const cacheStatus = res.headers.get('x-local-cache-status') + const cacheStr = cacheStatus ? ` (cache ${cacheStatus})` : '' let urlStr try { @@ -60,46 +60,6 @@ function logRequest (method, res, startTime, opts) { ) } -const WARNING_REGEXP = /^\s*(\d{3})\s+(\S+)\s+"(.*)"\s+"([^"]+)"/ -const BAD_HOSTS = new LRU({ max: 50 }) - -function checkWarnings (res, registry, opts) { - if (res.headers.has('warning') && !BAD_HOSTS.has(registry)) { - const warnings = {} - // note: headers.raw() will preserve case, so we might have a - // key on the object like 'WaRnInG' if that was used first - for (const [key, value] of Object.entries(res.headers.raw())) { - if (key.toLowerCase() !== 'warning') - continue - value.forEach(w => { - const match = w.match(WARNING_REGEXP) - if (match) { - warnings[match[1]] = { - code: match[1], - host: match[2], - message: match[3], - date: new Date(match[4]), - } - } - }) - } - BAD_HOSTS.set(registry, true) - if (warnings['199']) { - if (warnings['199'].message.match(/ENOTFOUND/)) - opts.log.warn('registry', `Using stale data from ${registry} because the host is inaccessible -- are you offline?`) - else - opts.log.warn('registry', `Unexpected warning for ${registry}: ${warnings['199'].message}`) - } - if (warnings['111']) { - // 111 Revalidation failed -- we're using stale data - opts.log.warn( - 'registry', - `Using stale data from ${registry} due to a request error during revalidation.` - ) - } - } -} - function checkErrors (method, res, startTime, opts) { return res.buffer() .catch(() => null) @@ -126,7 +86,8 @@ function checkErrors (method, res, startTime, opts) { ) } } else if (res.status === 401 && body != null && /one-time pass/.test(body.toString('utf8'))) { - // Heuristic for malformed OTP responses that don't include the www-authenticate header. + // Heuristic for malformed OTP responses that don't include the + // www-authenticate header. throw new errors.HttpErrorAuthOTP( method, res, parsed, opts.spec ) diff --git a/deps/npm/node_modules/npm-registry-fetch/index.js b/deps/npm/node_modules/npm-registry-fetch/index.js index 5411b51e58..35fab75bca 100644 --- a/deps/npm/node_modules/npm-registry-fetch/index.js +++ b/deps/npm/node_modules/npm-registry-fetch/index.js @@ -160,7 +160,8 @@ function fetchJSON (uri, opts) { } module.exports.json.stream = fetchJSONStream -function fetchJSONStream (uri, jsonPath, /* istanbul ignore next */ opts_ = {}) { +function fetchJSONStream (uri, jsonPath, + /* istanbul ignore next */ opts_ = {}) { const opts = { ...defaultOpts, ...opts_ } const parser = JSONStream.parse(jsonPath, opts.mapJSON) regFetch(uri, opts).then(res => diff --git a/deps/npm/node_modules/npm-registry-fetch/package.json b/deps/npm/node_modules/npm-registry-fetch/package.json index d32f82c075..e4eaabaa5b 100644 --- a/deps/npm/node_modules/npm-registry-fetch/package.json +++ b/deps/npm/node_modules/npm-registry-fetch/package.json @@ -1,6 +1,6 @@ { "name": "npm-registry-fetch", - "version": "10.1.2", + "version": "11.0.0", "description": "Fetch-based http client for use with npm registry APIs", "main": "index.js", "files": [ @@ -8,13 +8,15 @@ ], "scripts": { "eslint": "eslint", - "lint": "npm run eslint -- *.js test/*.js", + "lint": "npm run npmclilint -- \"*.*js\" \"test/**/*.*js\"", "lintfix": "npm run lint -- --fix", "prepublishOnly": "git push origin --follow-tags", "preversion": "npm test", "postversion": "npm publish", "test": "tap", - "posttest": "npm run lint" + "posttest": "npm run lint --", + "npmclilint": "npmcli-lint", + "postsnap": "npm run lintfix --" }, "repository": "https://github.com/npm/npm-registry-fetch", "keywords": [ @@ -29,8 +31,7 @@ }, "license": "ISC", "dependencies": { - "lru-cache": "^6.0.0", - "make-fetch-happen": "^8.0.9", + "make-fetch-happen": "^9.0.1", "minipass": "^3.1.3", "minipass-fetch": "^1.3.0", "minipass-json-stream": "^1.0.1", @@ -38,17 +39,11 @@ "npm-package-arg": "^8.0.0" }, "devDependencies": { + "@npmcli/lint": "^1.0.1", "cacache": "^15.0.0", - "eslint": "^6.8.0", - "eslint-plugin-import": "^2.18.2", - "eslint-plugin-node": "^10.0.0", - "eslint-plugin-promise": "^4.2.1", - "eslint-plugin-standard": "^4.0.1", - "mkdirp": "^0.5.1", - "nock": "^11.7.0", + "nock": "^13.1.0", "npmlog": "^4.1.2", "require-inject": "^1.4.4", - "rimraf": "^2.6.2", "ssri": "^8.0.0", "tap": "^15.0.4" }, diff --git a/deps/npm/node_modules/pacote/package.json b/deps/npm/node_modules/pacote/package.json index 2461b055bf..7472c6eeab 100644 --- a/deps/npm/node_modules/pacote/package.json +++ b/deps/npm/node_modules/pacote/package.json @@ -1,6 +1,6 @@ { "name": "pacote", - "version": "11.3.3", + "version": "11.3.4", "description": "JavaScript package downloader", "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", "bin": { @@ -46,7 +46,7 @@ "npm-package-arg": "^8.0.1", "npm-packlist": "^2.1.4", "npm-pick-manifest": "^6.0.0", - "npm-registry-fetch": "^10.0.0", + "npm-registry-fetch": "^11.0.0", "promise-retry": "^2.0.1", "read-package-json-fast": "^2.0.1", "rimraf": "^3.0.2", diff --git a/deps/npm/node_modules/path-parse/.travis.yml b/deps/npm/node_modules/path-parse/.travis.yml deleted file mode 100644 index dae31da968..0000000000 --- a/deps/npm/node_modules/path-parse/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: node_js -node_js: - - "0.12" - - "0.11" - - "0.10" - - "0.10.12" - - "0.8" - - "0.6" - - "iojs" diff --git a/deps/npm/node_modules/path-parse/index.js b/deps/npm/node_modules/path-parse/index.js index 3b7601fe49..ffb22a1ead 100644 --- a/deps/npm/node_modules/path-parse/index.js +++ b/deps/npm/node_modules/path-parse/index.js @@ -2,29 +2,14 @@ var isWindows = process.platform === 'win32'; -// Regex to split a windows path into three parts: [*, device, slash, -// tail] windows-only -var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - -// Regex to split the tail part of the above into [*, dir, basename, ext] -var splitTailRe = - /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; +// Regex to split a windows path into into [dir, root, basename, name, ext] +var splitWindowsRe = + /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/; var win32 = {}; -// Function to split a filename into [root, dir, basename, ext] function win32SplitPath(filename) { - // Separate device+slash from tail - var result = splitDeviceRe.exec(filename), - device = (result[1] || '') + (result[2] || ''), - tail = result[3] || ''; - // Split the tail into dir, basename and extension - var result2 = splitTailRe.exec(tail), - dir = result2[1], - basename = result2[2], - ext = result2[3]; - return [device, dir, basename, ext]; + return splitWindowsRe.exec(filename).slice(1); } win32.parse = function(pathString) { @@ -34,24 +19,24 @@ win32.parse = function(pathString) { ); } var allParts = win32SplitPath(pathString); - if (!allParts || allParts.length !== 4) { + if (!allParts || allParts.length !== 5) { throw new TypeError("Invalid path '" + pathString + "'"); } return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), + root: allParts[1], + dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1), base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + ext: allParts[4], + name: allParts[3] }; }; -// Split a filename into [root, dir, basename, ext], unix version +// Split a filename into [dir, root, basename, name, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; + /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/; var posix = {}; @@ -67,19 +52,16 @@ posix.parse = function(pathString) { ); } var allParts = posixSplitPath(pathString); - if (!allParts || allParts.length !== 4) { + if (!allParts || allParts.length !== 5) { throw new TypeError("Invalid path '" + pathString + "'"); } - allParts[1] = allParts[1] || ''; - allParts[2] = allParts[2] || ''; - allParts[3] = allParts[3] || ''; return { - root: allParts[0], - dir: allParts[0] + allParts[1].slice(0, -1), + root: allParts[1], + dir: allParts[0].slice(0, -1), base: allParts[2], - ext: allParts[3], - name: allParts[2].slice(0, allParts[2].length - allParts[3].length) + ext: allParts[4], + name: allParts[3], }; }; diff --git a/deps/npm/node_modules/path-parse/package.json b/deps/npm/node_modules/path-parse/package.json index 21332bb14f..36c23f84e7 100644 --- a/deps/npm/node_modules/path-parse/package.json +++ b/deps/npm/node_modules/path-parse/package.json @@ -1,6 +1,6 @@ { "name": "path-parse", - "version": "1.0.6", + "version": "1.0.7", "description": "Node.js path.parse() ponyfill", "main": "index.js", "scripts": { diff --git a/deps/npm/node_modules/path-parse/test.js b/deps/npm/node_modules/path-parse/test.js deleted file mode 100644 index 0b30c12393..0000000000 --- a/deps/npm/node_modules/path-parse/test.js +++ /dev/null @@ -1,77 +0,0 @@ -var assert = require('assert'); -var pathParse = require('./index'); - -var winParseTests = [ - [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'], - [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'], - [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'], - [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'], - [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], - [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'], - - // unc - [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'], - [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'], - [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'], - [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share'] -]; - -var winSpecialCaseFormatTests = [ - [{dir: 'some\\dir'}, 'some\\dir\\'], - [{base: 'index.html'}, 'index.html'], - [{}, ''] -]; - -var unixParseTests = [ - [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'], - [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'], - [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'], - [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'], - [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'], - [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'], - [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'], - [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'], - [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo'] -]; - -var unixSpecialCaseFormatTests = [ - [{dir: 'some/dir'}, 'some/dir/'], - [{base: 'index.html'}, 'index.html'], - [{}, ''] -]; - -var errors = [ - {input: null, message: /Parameter 'pathString' must be a string, not/}, - {input: {}, message: /Parameter 'pathString' must be a string, not object/}, - {input: true, message: /Parameter 'pathString' must be a string, not boolean/}, - {input: 1, message: /Parameter 'pathString' must be a string, not number/}, - {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/}, -]; - -checkParseFormat(pathParse.win32, winParseTests); -checkParseFormat(pathParse.posix, unixParseTests); -checkErrors(pathParse.win32); -checkErrors(pathParse.posix); - -function checkErrors(parse) { - errors.forEach(function(errorCase) { - try { - parse(errorCase.input); - } catch(err) { - assert.ok(err instanceof TypeError); - assert.ok( - errorCase.message.test(err.message), - 'expected ' + errorCase.message + ' to match ' + err.message - ); - return; - } - - assert.fail('should have thrown'); - }); -} - -function checkParseFormat(parse, testCases) { - testCases.forEach(function(testCase) { - assert.deepEqual(parse(testCase[1]), testCase[0]); - }); -} diff --git a/deps/npm/node_modules/form-data/License b/deps/npm/node_modules/request/node_modules/form-data/License index c7ff12a2f8..c7ff12a2f8 100644 --- a/deps/npm/node_modules/form-data/License +++ b/deps/npm/node_modules/request/node_modules/form-data/License diff --git a/deps/npm/node_modules/form-data/README.md b/deps/npm/node_modules/request/node_modules/form-data/README.md index d7809364fb..d7809364fb 100644 --- a/deps/npm/node_modules/form-data/README.md +++ b/deps/npm/node_modules/request/node_modules/form-data/README.md diff --git a/deps/npm/node_modules/form-data/README.md.bak b/deps/npm/node_modules/request/node_modules/form-data/README.md.bak index 0524d60288..0524d60288 100644 --- a/deps/npm/node_modules/form-data/README.md.bak +++ b/deps/npm/node_modules/request/node_modules/form-data/README.md.bak diff --git a/deps/npm/node_modules/form-data/lib/browser.js b/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js index 09e7c70e6e..09e7c70e6e 100644 --- a/deps/npm/node_modules/form-data/lib/browser.js +++ b/deps/npm/node_modules/request/node_modules/form-data/lib/browser.js diff --git a/deps/npm/node_modules/form-data/lib/form_data.js b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js index 3a1bb82b11..3a1bb82b11 100644 --- a/deps/npm/node_modules/form-data/lib/form_data.js +++ b/deps/npm/node_modules/request/node_modules/form-data/lib/form_data.js diff --git a/deps/npm/node_modules/form-data/lib/populate.js b/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js index 4d35738dd5..4d35738dd5 100644 --- a/deps/npm/node_modules/form-data/lib/populate.js +++ b/deps/npm/node_modules/request/node_modules/form-data/lib/populate.js diff --git a/deps/npm/node_modules/form-data/package.json b/deps/npm/node_modules/request/node_modules/form-data/package.json index adacbae78f..adacbae78f 100644 --- a/deps/npm/node_modules/form-data/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/package.json diff --git a/deps/npm/node_modules/form-data/yarn.lock b/deps/npm/node_modules/request/node_modules/form-data/yarn.lock index ab55059c10..ab55059c10 100644 --- a/deps/npm/node_modules/form-data/yarn.lock +++ b/deps/npm/node_modules/request/node_modules/form-data/yarn.lock diff --git a/deps/npm/node_modules/spdx-license-ids/README.md b/deps/npm/node_modules/spdx-license-ids/README.md index 699514d1a2..e9b5aa6372 100644 --- a/deps/npm/node_modules/spdx-license-ids/README.md +++ b/deps/npm/node_modules/spdx-license-ids/README.md @@ -7,7 +7,7 @@ A list of [SPDX license](https://spdx.org/licenses/) identifiers ## Installation -[Download JSON directly](https://raw.githubusercontent.com/shinnn/spdx-license-ids/master/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/): +[Download JSON directly](https://raw.githubusercontent.com/shinnn/spdx-license-ids/main/index.json), or [use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/about-npm/): ``` npm install spdx-license-ids diff --git a/deps/npm/node_modules/spdx-license-ids/index.json b/deps/npm/node_modules/spdx-license-ids/index.json index 864d2410c8..c2d5e017b2 100644 --- a/deps/npm/node_modules/spdx-license-ids/index.json +++ b/deps/npm/node_modules/spdx-license-ids/index.json @@ -42,11 +42,14 @@ "BSD-3-Clause-Attribution", "BSD-3-Clause-Clear", "BSD-3-Clause-LBNL", + "BSD-3-Clause-Modification", + "BSD-3-Clause-No-Military-License", "BSD-3-Clause-No-Nuclear-License", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause-No-Nuclear-Warranty", "BSD-3-Clause-Open-MPI", "BSD-4-Clause", + "BSD-4-Clause-Shortened", "BSD-4-Clause-UC", "BSD-Protection", "BSD-Source-Code", @@ -59,6 +62,7 @@ "BitTorrent-1.1", "BlueOak-1.0.0", "Borceux", + "C-UDA-1.0", "CAL-1.0", "CAL-1.0-Combined-Work-Exception", "CATOSL-1.1", @@ -93,6 +97,7 @@ "CC-BY-SA-1.0", "CC-BY-SA-2.0", "CC-BY-SA-2.0-UK", + "CC-BY-SA-2.1-JP", "CC-BY-SA-2.5", "CC-BY-SA-3.0", "CC-BY-SA-3.0-AT", @@ -101,6 +106,7 @@ "CC0-1.0", "CDDL-1.0", "CDDL-1.1", + "CDL-1.0", "CDLA-Permissive-1.0", "CDLA-Sharing-1.0", "CECILL-1.0", @@ -129,6 +135,7 @@ "Cube", "D-FSL-1.0", "DOC", + "DRL-1.0", "DSDP", "Dotseqn", "ECL-1.0", @@ -151,7 +158,9 @@ "FTL", "Fair", "Frameworx-1.0", + "FreeBSD-DOC", "FreeImage", + "GD", "GFDL-1.1-invariants-only", "GFDL-1.1-invariants-or-later", "GFDL-1.1-no-invariants-only", @@ -227,6 +236,7 @@ "MIT", "MIT-0", "MIT-CMU", + "MIT-Modern-Variant", "MIT-advertising", "MIT-enna", "MIT-feh", @@ -246,6 +256,7 @@ "MulanPSL-2.0", "Multics", "Mup", + "NAIST-2003", "NASA-1.3", "NBPL-1.0", "NCGL-UK-2.0", @@ -280,6 +291,7 @@ "OFL-1.1-RFN", "OFL-1.1-no-RFN", "OGC-1.0", + "OGDL-Taiwan-1.0", "OGL-Canada-2.0", "OGL-UK-1.0", "OGL-UK-2.0", diff --git a/deps/npm/node_modules/spdx-license-ids/package.json b/deps/npm/node_modules/spdx-license-ids/package.json index eea631250e..5639091b87 100644 --- a/deps/npm/node_modules/spdx-license-ids/package.json +++ b/deps/npm/node_modules/spdx-license-ids/package.json @@ -1,6 +1,6 @@ { "name": "spdx-license-ids", - "version": "3.0.7", + "version": "3.0.9", "description": "A list of SPDX license identifiers", "repository": "jslicense/spdx-license-ids", "author": "Shinnosuke Watanabe (https://github.com/shinnn)", diff --git a/deps/npm/package.json b/deps/npm/package.json index 7df4358933..3f54979cb9 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,7 +1,10 @@ { - "version": "7.15.1", + "version": "7.16.0", "name": "npm", "description": "a package manager for JavaScript", + "workspaces": [ + "docs" + ], "keywords": [ "install", "modules", @@ -76,7 +79,7 @@ "libnpmsearch": "^3.1.1", "libnpmteam": "^2.0.3", "libnpmversion": "^1.2.0", - "make-fetch-happen": "^8.0.14", + "make-fetch-happen": "^9.0.1", "minipass": "^3.1.3", "minipass-pipeline": "^1.2.4", "mkdirp": "^1.0.4", @@ -85,10 +88,10 @@ "node-gyp": "^7.1.2", "nopt": "^5.0.0", "npm-audit-report": "^2.1.5", - "npm-package-arg": "^8.1.2", + "npm-package-arg": "^8.1.4", "npm-pick-manifest": "^6.1.1", "npm-profile": "^5.0.3", - "npm-registry-fetch": "^10.1.2", + "npm-registry-fetch": "^11.0.0", "npm-user-validate": "^1.0.1", "npmlog": "~4.1.2", "opener": "^1.5.2", @@ -180,18 +183,13 @@ "write-file-atomic" ], "devDependencies": { - "@mdx-js/mdx": "^1.6.22", - "cmark-gfm": "^0.8.5", "eslint": "^7.26.0", "eslint-plugin-import": "^2.23.4", "eslint-plugin-node": "^11.1.0", "eslint-plugin-promise": "^5.1.0", "eslint-plugin-standard": "^5.0.0", - "jsdom": "^16.5.2", - "licensee": "^8.1.0", - "marked-man": "^0.7.0", - "tap": "^15.0.9", - "yaml": "^1.10.2" + "licensee": "^8.2.0", + "tap": "^15.0.9" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", @@ -212,10 +210,6 @@ "resetdeps": "bash scripts/resetdeps.sh", "smoke-tests": "tap smoke-tests/index.js" }, - "//": [ - "XXX temporarily only run unit tests while v7 beta is in progress", - "Remove the 'files' below once we're done porting old tests over" - ], "tap": { "test-env": [ "LC_ALL=sk" diff --git a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs index 48aea03030..da8cd1794f 100644 --- a/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs +++ b/deps/npm/tap-snapshots/test/lib/utils/config/describe-all.js.test.cjs @@ -655,6 +655,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 diff --git a/deps/npm/test/lib/cli.js b/deps/npm/test/lib/cli.js index f491c6174b..42e05cc5d1 100644 --- a/deps/npm/test/lib/cli.js +++ b/deps/npm/test/lib/cli.js @@ -45,6 +45,7 @@ const npmlogMock = { const cli = t.mock('../../lib/cli.js', { '../../lib/npm.js': npmock, + '../../lib/utils/update-notifier.js': async () => null, '../../lib/utils/did-you-mean.js': () => '\ntest did you mean', '../../lib/utils/unsupported.js': unsupportedMock, '../../lib/utils/error-handler.js': errorHandlerMock, diff --git a/deps/npm/test/lib/utils/update-notifier.js b/deps/npm/test/lib/utils/update-notifier.js index ad4d407728..dc0a64ff46 100644 --- a/deps/npm/test/lib/utils/update-notifier.js +++ b/deps/npm/test/lib/utils/update-notifier.js @@ -86,9 +86,14 @@ t.afterEach(() => { WRITE_ERROR = null }) +const runUpdateNotifier = async npm => { + await updateNotifier(npm) + return npm.updateNotification +} + t.test('situations in which we do not notify', t => { t.test('nothing to do if notifier disabled', async t => { - t.equal(await updateNotifier({ + t.equal(await runUpdateNotifier({ ...npm, config: { get: (k) => k !== 'update-notifier' }, }), null) @@ -96,7 +101,7 @@ t.test('situations in which we do not notify', t => { }) t.test('do not suggest update if already updating', async t => { - t.equal(await updateNotifier({ + t.equal(await runUpdateNotifier({ ...npm, flatOptions: { ...flatOptions, global: true }, command: 'install', @@ -105,32 +110,42 @@ t.test('situations in which we do not notify', t => { t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') }) + t.test('do not suggest update if already updating with spec', async t => { + t.equal(await runUpdateNotifier({ + ...npm, + flatOptions: { ...flatOptions, global: true }, + command: 'install', + argv: ['npm@latest'], + }), null) + t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') + }) + t.test('do not update if same as latest', async t => { - t.equal(await updateNotifier(npm), null) + t.equal(await runUpdateNotifier(npm), null) t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') }) t.test('check if stat errors (here for coverage)', async t => { STAT_ERROR = new Error('blorg') - t.equal(await updateNotifier(npm), null) + t.equal(await runUpdateNotifier(npm), null) t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') }) t.test('ok if write errors (here for coverage)', async t => { WRITE_ERROR = new Error('grolb') - t.equal(await updateNotifier(npm), null) + t.equal(await runUpdateNotifier(npm), null) t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') }) t.test('ignore pacote failures (here for coverage)', async t => { PACOTE_ERROR = new Error('pah-KO-tchay') - t.equal(await updateNotifier(npm), null) + t.equal(await runUpdateNotifier(npm), null) t.strictSame(MANIFEST_REQUEST, ['npm@latest'], 'requested latest version') }) t.test('do not update if newer than latest, but same as next', async t => { - t.equal(await updateNotifier({ ...npm, version: NEXT_VERSION }), null) + t.equal(await runUpdateNotifier({ ...npm, version: NEXT_VERSION }), null) const reqs = ['npm@latest', `npm@^${NEXT_VERSION}`] t.strictSame(MANIFEST_REQUEST, reqs, 'requested latest and next versions') }) t.test('do not update if on the latest beta', async t => { - t.equal(await updateNotifier({ ...npm, version: CURRENT_BETA }), null) + t.equal(await runUpdateNotifier({ ...npm, version: CURRENT_BETA }), null) const reqs = [`npm@^${CURRENT_BETA}`] t.strictSame(MANIFEST_REQUEST, reqs, 'requested latest and next versions') }) @@ -140,21 +155,21 @@ t.test('situations in which we do not notify', t => { ciMock = null }) ciMock = 'something' - t.equal(await updateNotifier(npm), null) + t.equal(await runUpdateNotifier(npm), null) t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') }) t.test('only check weekly for GA releases', async t => { // One week (plus five minutes to account for test environment fuzziness) STAT_MTIME = Date.now() - (1000 * 60 * 60 * 24 * 7) + (1000 * 60 * 5) - t.equal(await updateNotifier(npm), null) + t.equal(await runUpdateNotifier(npm), null) t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') }) t.test('only check daily for betas', async t => { // One day (plus five minutes to account for test environment fuzziness) STAT_MTIME = Date.now() - (1000 * 60 * 60 * 24) + (1000 * 60 * 5) - t.equal(await updateNotifier({ ...npm, version: HAVE_BETA }), null) + t.equal(await runUpdateNotifier({ ...npm, version: HAVE_BETA }), null) t.strictSame(MANIFEST_REQUEST, [], 'no requests for manifests') }) @@ -164,43 +179,43 @@ t.test('situations in which we do not notify', t => { t.test('notification situations', t => { t.test('new beta available', async t => { const version = HAVE_BETA - t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') - t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.matchSnapshot(await runUpdateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await runUpdateNotifier({ ...npmNoColor, version }), 'no color') t.strictSame(MANIFEST_REQUEST, [`npm@^${version}`, `npm@^${version}`]) }) t.test('patch to next version', async t => { const version = NEXT_PATCH - t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') - t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.matchSnapshot(await runUpdateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await runUpdateNotifier({ ...npmNoColor, version }), 'no color') t.strictSame(MANIFEST_REQUEST, ['npm@latest', `npm@^${version}`, 'npm@latest', `npm@^${version}`]) }) t.test('minor to next version', async t => { const version = NEXT_MINOR - t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') - t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.matchSnapshot(await runUpdateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await runUpdateNotifier({ ...npmNoColor, version }), 'no color') t.strictSame(MANIFEST_REQUEST, ['npm@latest', `npm@^${version}`, 'npm@latest', `npm@^${version}`]) }) t.test('patch to current', async t => { const version = CURRENT_PATCH - t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') - t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.matchSnapshot(await runUpdateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await runUpdateNotifier({ ...npmNoColor, version }), 'no color') t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest']) }) t.test('minor to current', async t => { const version = CURRENT_MINOR - t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') - t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.matchSnapshot(await runUpdateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await runUpdateNotifier({ ...npmNoColor, version }), 'no color') t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest']) }) t.test('major to current', async t => { const version = CURRENT_MAJOR - t.matchSnapshot(await updateNotifier({ ...npm, version }), 'color') - t.matchSnapshot(await updateNotifier({ ...npmNoColor, version }), 'no color') + t.matchSnapshot(await runUpdateNotifier({ ...npm, version }), 'color') + t.matchSnapshot(await runUpdateNotifier({ ...npmNoColor, version }), 'no color') t.strictSame(MANIFEST_REQUEST, ['npm@latest', 'npm@latest']) }) |