Skip to content

Commit

Permalink
deps: upgrade npm to 7.8.0
Browse files Browse the repository at this point in the history
PR-URL: #38030
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Ruy Adorno <[email protected]>
  • Loading branch information
darcyclarke authored and ruyadorno committed Apr 8, 2021
1 parent cc4ee6c commit bc531d1
Show file tree
Hide file tree
Showing 132 changed files with 2,164 additions and 4,290 deletions.
49 changes: 49 additions & 0 deletions deps/npm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
## v7.8.0 (2021-04-01)
### FEATURES


* [`8bcc5d73f`](https://github.com/npm/cli/commit/8bcc5d73f35434e781ff56419dd7f0c380efd072)
[#2972](https://github.com/npm/cli/issues/2972)
feat(workspaces): add repo and docs
([@wraithgar](https://github.com/wraithgar))
* [`ec520ce32`](https://github.com/npm/cli/commit/ec520ce32d5e834a32ebd58491df4200e01ce690)
[#2998](https://github.com/npm/cli/issues/2998)
feat(set-script): implement workspaces
* [`32717a60e`](https://github.com/npm/cli/commit/32717a60eb55fcf8c7e5016223bfee78a6daba0e)
[#3001](https://github.com/npm/cli/issues/3001)
feat(view): add workspace support
([@wraithgar](https://github.com/wraithgar))
* [`7b177e43f`](https://github.com/npm/cli/commit/7b177e43f3bfb558bcd8723cdb2166a3df19647a)
[#3014](https://github.com/npm/cli/issues/3014)
feat(config): add 'envExport' flag
([@isaacs](https://github.com/isaacs))

### BUG FIXES

* [`4c4252348`](https://github.com/npm/cli/commit/4c4252348c538246e1072421d65f4558dc948080)
[#3016](https://github.com/npm/cli/issues/3016)
fix(usage): specify the key each time for multiples
([@isaacs](https://github.com/isaacs))
* [`9237d375b`](https://github.com/npm/cli/commit/9237d375b0b7d34c7dc5ba70aec7f616f4133732)
[#3013](https://github.com/npm/cli/issues/3013)
fix(docs): add workspaces configuration
([@wraithgar](https://github.com/wraithgar))
* [`cb6eb0d20`](https://github.com/npm/cli/commit/cb6eb0d206b7e2f63d5c7a7a17bea4aed1b9f2bf)
[#3015](https://github.com/npm/cli/issues/3015)
fix(ERESOLVE): better errors when current is missing
([@isaacs](https://github.com/isaacs))

### DEPENDENCIES

* [`61da39beb`](https://github.com/npm/cli/commit/61da39beb5373320e2b591b61ecd6596eeaba6ed)
`@npmcli/[email protected]`
* feat(config): add support for envExport:false
* [`fb095a708`](https://github.com/npm/cli/commit/fb095a708a1f930bbd0195446ac611b82bfeff14)
`@npmcli/[email protected]`:
* [#2896](https://github.com/npm/cli/issues/2896) Provide currentEdge in
ERESOLVE if known, and address self-linking edge case.
* Add/remove dependencies to/from workspaces when set, not root project
* Only reify the portions of the dependency graph identified by the
`workspace` configuration value.
* Do not recursively `chown` the project root path.

## v7.7.6 (2021-03-29)

### BUG FIXES
Expand Down
13 changes: 13 additions & 0 deletions deps/npm/docs/content/commands/npm-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,19 @@ Set to `true` to use default system URL opener.
The base URL of the npm package registry.
#### workspaces
Enables workspaces context while searching the `package.json` in the
current folder. Documentation urls for the packages named in each
workspace will be opened.
#### workspace
Enables workspaces context and limits results to only those specified by
this config item. Only the documentation urls for the packages named in
the workspaces given here will be opened.
### See Also
* [npm view](/commands/npm-view)
Expand Down
13 changes: 13 additions & 0 deletions deps/npm/docs/content/commands/npm-repo.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ terminal.
Set to `true` to use default system URL opener.
#### workspaces
Enables workspaces context while searching the `package.json` in the
current folder. Repo urls for the packages named in each workspace will
be opened.
#### workspace
Enables workspaces context and limits results to only those specified by
this config item. Only the repo urls for the packages named in the
workspaces given here will be opened.
### See Also
* [npm docs](/commands/npm-docs)
Expand Down
15 changes: 14 additions & 1 deletion deps/npm/docs/content/commands/npm-set-script.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Set tasks in the scripts section of package.json
---

### Synopsis
An npm command that lets you create a task in the scripts section of the package.json.
An npm command that lets you create a task in the `scripts` section of the `package.json`.

```bash
npm set-script [<script>] [<command>]
Expand All @@ -26,6 +26,19 @@ npm set-script [<script>] [<command>]
}
```

### Configuration

#### workspaces

Enables workspaces context. Tasks will be created in the `scripts` section
of the `package.json` of each workspace.

#### workspace

Enables workspaces context and limits creating a task to the
`package.json` files of the workspaces given.


### See Also

* [npm run-script](/commands/npm-run-script)
Expand Down
3 changes: 1 addition & 2 deletions deps/npm/docs/content/commands/npm-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ aliases: info, show, v

### Description

This command shows data about a package and prints it to the stream
referenced by the `outfd` config, which defaults to stdout.
This command shows data about a package and prints it to stdout.

As an example, to view information about the `connect` package from the registry, you would run:

Expand Down
6 changes: 5 additions & 1 deletion deps/npm/docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

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

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand Down Expand Up @@ -1333,6 +1333,8 @@ Valid values for the `workspace` config are either: - Workspace names - Path
to a workspace directory - Path to a parent workspace directory (will result
to selecting all of the nested workspaces)

This value is not exported to the environment for child processes.

#### `workspaces`

* Default: false
Expand All @@ -1341,6 +1343,8 @@ to selecting all of the nested workspaces)
Enable running a command in the context of **all** the configured
workspaces.

This value is not exported to the environment for child processes.

#### `yes`

* Default: null
Expand Down
10 changes: 9 additions & 1 deletion deps/npm/docs/output/commands/npm-docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h1 id="npm-docs">npm-docs</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#browser">browser</a></li><li><a href="#registry">registry</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#browser">browser</a></li><li><a href="#registry">registry</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand Down Expand Up @@ -171,6 +171,14 @@ <h4 id="registry">registry</h4>
<li>Type: url</li>
</ul>
<p>The base URL of the npm package registry.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while searching the <code>package.json</code> in the
current folder. Documentation urls for the packages named in each
workspace will be opened.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Only the documentation urls for the packages named in
the workspaces given here will be opened.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-view.html">npm view</a></li>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm-ls.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
the results to only the paths to the packages named. Note that nested
packages will <em>also</em> show the paths to the specified packages. For
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
<pre lang="bash"><code>npm@7.7.6 /path/to/npm
<pre lang="bash"><code>npm@7.8.0 /path/to/npm
└─┬ [email protected]
└── [email protected]
</code></pre>
Expand Down
10 changes: 9 additions & 1 deletion deps/npm/docs/output/commands/npm-repo.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ <h1 id="npm-repo">npm-repo</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#browser">browser</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#description">Description</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#browser">browser</a></li><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
Expand All @@ -162,6 +162,14 @@ <h4 id="browser">browser</h4>
<p>Set to <code>false</code> to suppress browser behavior and instead print urls to
terminal.</p>
<p>Set to <code>true</code> to use default system URL opener.</p>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context while searching the <code>package.json</code> in the
current folder. Repo urls for the packages named in each workspace will
be opened.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits results to only those specified by
this config item. Only the repo urls for the packages named in the
workspaces given here will be opened.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-docs.html">npm docs</a></li>
Expand Down
11 changes: 9 additions & 2 deletions deps/npm/docs/output/commands/npm-set-script.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ <h1 id="npm-set-script">npm-set-script</h1>

<section id="table_of_contents">
<h2 id="table-of-contents">Table of contents</h2>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#see-also">See Also</a></li></ul></div>
<div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#configuration">Configuration</a></li><ul><li><a href="#workspaces">workspaces</a></li><li><a href="#workspace">workspace</a></li></ul><li><a href="#see-also">See Also</a></li></ul></div>
</section>

<div id="_content"><h3 id="synopsis">Synopsis</h3>
<p>An npm command that lets you create a task in the scripts section of the package.json.</p>
<p>An npm command that lets you create a task in the <code>scripts</code> section of the <code>package.json</code>.</p>
<pre lang="bash"><code>npm set-script [&lt;script&gt;] [&lt;command&gt;]
</code></pre>
<p><strong>Example:</strong></p>
Expand All @@ -160,6 +160,13 @@ <h2 id="table-of-contents">Table of contents</h2>
}
}
</code></pre>
<h3 id="configuration">Configuration</h3>
<h4 id="workspaces">workspaces</h4>
<p>Enables workspaces context. Tasks will be created in the <code>scripts</code> section
of the <code>package.json</code> of each workspace.</p>
<h4 id="workspace">workspace</h4>
<p>Enables workspaces context and limits creating a task to the
<code>package.json</code> files of the workspaces given.</p>
<h3 id="see-also">See Also</h3>
<ul>
<li><a href="../commands/npm-run-script.html">npm run-script</a></li>
Expand Down
3 changes: 1 addition & 2 deletions deps/npm/docs/output/commands/npm-view.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ <h2 id="table-of-contents">Table of contents</h2>
aliases: info, show, v
</code></pre>
<h3 id="description">Description</h3>
<p>This command shows data about a package and prints it to the stream
referenced by the <code>outfd</code> config, which defaults to stdout.</p>
<p>This command shows data about a package and prints it to stdout.</p>
<p>As an example, to view information about the <code>connect</code> package from the registry, you would run:</p>
<pre lang="bash"><code>npm view connect
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion deps/npm/docs/output/commands/npm.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
<pre lang="bash"><code>npm &lt;command&gt; [args]
</code></pre>
<h3 id="version">Version</h3>
<p>7.7.6</p>
<p>7.8.0</p>
<h3 id="description">Description</h3>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
Expand Down
4 changes: 3 additions & 1 deletion deps/npm/docs/output/using-npm/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ <h4 id="audit"><code>audit</code></h4>
<h4 id="audit-level"><code>audit-level</code></h4>
<ul>
<li>Default: null</li>
<li>Type: “info”, “low”, “moderate”, “high”, “critical”, “none”, or null</li>
<li>Type: null, “info”, “low”, “moderate”, “high”, “critical”, or “none”</li>
</ul>
<p>The minimum level of vulnerability for <code>npm audit</code> to exit with a non-zero
exit code.</p>
Expand Down Expand Up @@ -1262,13 +1262,15 @@ <h4 id="workspace"><code>workspace</code></h4>
<p>Valid values for the <code>workspace</code> config are either: - Workspace names - Path
to a workspace directory - Path to a parent workspace directory (will result
to selecting all of the nested workspaces)</p>
<p>This value is not exported to the environment for child processes.</p>
<h4 id="workspaces"><code>workspaces</code></h4>
<ul>
<li>Default: false</li>
<li>Type: Boolean</li>
</ul>
<p>Enable running a command in the context of <strong>all</strong> the configured
workspaces.</p>
<p>This value is not exported to the environment for child processes.</p>
<h4 id="yes"><code>yes</code></h4>
<ul>
<li>Default: null</li>
Expand Down
1 change: 1 addition & 0 deletions deps/npm/lib/base-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class BaseCommand {
usage = `${usage}${this.constructor.usage.map(u => `npm ${this.constructor.name} ${u}`).join('\n')}`

if (this.constructor.params)
// TODO word wrap this along params boundaries
usage = `${usage}\n\nOptions:\n[${this.constructor.params.map(p => ConfigDefinitions[p].usage).join('] [')}]`

// Mostly this just appends aliases, this could be more clear
Expand Down
16 changes: 16 additions & 0 deletions deps/npm/lib/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const log = require('npmlog')
const pacote = require('pacote')
const openUrl = require('./utils/open-url.js')
const hostedFromMani = require('./utils/hosted-git-info-from-manifest.js')
const getWorkspaces = require('./workspaces/get-workspaces.js')

const BaseCommand = require('./base-command.js')
class Docs extends BaseCommand {
Expand All @@ -15,6 +16,11 @@ class Docs extends BaseCommand {
return 'docs'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['browser', 'registry', 'workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get usage () {
return ['[<pkgname> [<pkgname> ...]]']
Expand All @@ -24,13 +30,23 @@ class Docs extends BaseCommand {
this.docs(args).then(() => cb()).catch(cb)
}

execWorkspaces (args, filters, cb) {
this.docsWorkspaces(args, filters).then(() => cb()).catch(cb)
}

async docs (args) {
if (!args || !args.length)
args = ['.']

await Promise.all(args.map(pkg => this.getDocs(pkg)))
}

async docsWorkspaces (args, filters) {
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
return this.docs([...workspaces.values()])
}

async getDocs (pkg) {
const opts = { ...this.npm.flatOptions, fullMetadata: true }
const mani = await pacote.manifest(pkg, opts)
Expand Down
12 changes: 7 additions & 5 deletions deps/npm/lib/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ class Exec extends BaseCommand {
return 'Run a command from a local or remote npm package'
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return ['workspace', 'workspaces']
}

/* istanbul ignore next - see test/lib/load-all-commands.js */
static get name () {
return 'exec'
Expand Down Expand Up @@ -339,12 +344,9 @@ class Exec extends BaseCommand {
.slice(0, 16)
}

async workspaces (filters) {
return getWorkspaces(filters, { path: this.npm.localPrefix })
}

async _execWorkspaces (args, filters) {
const workspaces = await this.workspaces(filters)
const workspaces =
await getWorkspaces(filters, { path: this.npm.localPrefix })
const getLocationMsg = async path => {
const color = this.npm.config.get('color')
const colorize = color ? chalk : nocolor
Expand Down
Loading

0 comments on commit bc531d1

Please sign in to comment.