Skip to content

Commit 608d0e1

Browse files
ruyadornotargos
authored andcommitted
deps: upgrade npm to 7.13.0
PR-URL: #38682 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Danielle Adams <adamzdanielle@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 1765e32 commit 608d0e1

File tree

28 files changed

+846
-99
lines changed

28 files changed

+846
-99
lines changed

deps/npm/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## v7.13.0 (2021-05-13)
2+
3+
* [`076420c14`](https://github.com/npm/cli/commit/076420c149d097056f687e44e21744b743b86e4e)
4+
[#3231](https://github.com/npm/cli/issues/3231)
5+
feat(publish): add workspace support
6+
([@wraithgar](https://github.com/wraithgar))
7+
* [`370b36a36`](https://github.com/npm/cli/commit/370b36a36ca226840761e4214cbccaf2a1a90e3c)
8+
[#3241](https://github.com/npm/cli/issues/3241)
9+
feat(fund): add workspaces support
10+
([@ruyadorno](https://github.com/ruyadorno))
11+
12+
### DEPENDENCIES
13+
14+
* [`0c18e4f77`](https://github.com/npm/cli/commit/0c18e4f774562fa054fedf323bea25805ebf39b3)
15+
`@npmcli/arborist@2.5.0`
16+
* [`b551c6811`](https://github.com/npm/cli/commit/b551c6811251dbc901f47fea3c137f93e205a9e4)
17+
`libnpmfund@1.1.0`
18+
119
## v7.12.1 (2021-05-10)
220

321
### BUG FIXES

deps/npm/docs/content/commands/npm-fund.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ description: Retrieve funding information
88

99
```bash
1010
npm fund [<pkg>]
11+
npm fund [-w <workspace-name>]
1112
```
1213

1314
### Description
@@ -24,6 +25,43 @@ The list will avoid duplicated entries and will stack all packages that
2425
share the same url as a single entry. Thus, the list does not have the same
2526
shape of the output from `npm ls`.
2627

28+
#### Example
29+
30+
### Workspaces support
31+
32+
It's possible to filter the results to only include a single workspace and its
33+
dependencies using the `workspace` config option.
34+
35+
#### Example:
36+
37+
Here's an example running `npm fund` in a project with a configured
38+
workspace `a`:
39+
40+
```bash
41+
$ npm fund
42+
test-workspaces-fund@1.0.0
43+
+-- https://example.com/a
44+
| | `-- a@1.0.0
45+
| `-- https://example.com/maintainer
46+
| `-- foo@1.0.0
47+
+-- https://example.com/npmcli-funding
48+
| `-- @npmcli/test-funding
49+
`-- https://example.com/org
50+
`-- bar@2.0.0
51+
```
52+
53+
And here is an example of the expected result when filtering only by
54+
a specific workspace `a` in the same project:
55+
56+
```bash
57+
$ npm fund -w a
58+
test-workspaces-fund@1.0.0
59+
`-- https://example.com/a
60+
| `-- a@1.0.0
61+
`-- https://example.com/maintainer
62+
`-- foo@2.0.0
63+
```
64+
2765
### Configuration
2866

2967
#### browser
@@ -48,6 +86,23 @@ Show information in JSON format.
4886
Whether to represent the tree structure using unicode characters.
4987
Set it to `false` in order to use all-ansi output.
5088

89+
#### `workspace`
90+
91+
* Default:
92+
* Type: String (can be set multiple times)
93+
94+
Enable running a command in the context of the configured workspaces of the
95+
current project while filtering by running only the workspaces defined by
96+
this configuration option.
97+
98+
Valid values for the `workspace` config are either:
99+
* Workspace names
100+
* Path to a workspace directory
101+
* Path to a parent workspace directory (will result to selecting all of the
102+
nested workspaces)
103+
104+
This value is not exported to the environment for child processes.
105+
51106
#### which
52107

53108
* Type: Number
@@ -61,3 +116,4 @@ If there are multiple funding sources, which 1-indexed source URL to open.
61116
* [npm docs](/commands/npm-docs)
62117
* [npm ls](/commands/npm-ls)
63118
* [npm config](/commands/npm-config)
119+
* [npm workspaces](/using-npm/workspaces)

deps/npm/docs/content/commands/npm-publish.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ by specifying a different default registry or using a
4747
actually publishing to the registry. Reports the details of what would
4848
have been published.
4949
50+
* `[--workspaces]`: Enables workspace context while publishing. All
51+
workspace packages will be published.
52+
53+
* `[--workspace]`: Enables workspaces context and limits results to only
54+
those specified by this config item. Only the packages in the
55+
workspaces given will be published.
56+
5057
The publish will fail if the package name and version combination already
5158
exists in the specified registry.
5259

deps/npm/docs/output/commands/npm-fund.html

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ <h2 id="table-of-contents">Table of contents</h2>
146146

147147
<div id="_content"><h3 id="synopsis">Synopsis</h3>
148148
<pre lang="bash"><code>npm fund [&lt;pkg&gt;]
149+
npm fund [-w &lt;workspace-name&gt;]
149150
</code></pre>
150151
<h3 id="description">Description</h3>
151152
<p>This command retrieves information on how to fund the dependencies of a
@@ -158,6 +159,33 @@ <h3 id="description">Description</h3>
158159
<p>The list will avoid duplicated entries and will stack all packages that
159160
share the same url as a single entry. Thus, the list does not have the same
160161
shape of the output from <code>npm ls</code>.</p>
162+
<h4 id="example">Example</h4>
163+
<h3 id="workspaces-support">Workspaces support</h3>
164+
<p>It’s possible to filter the results to only include a single workspace and its
165+
dependencies using the <code>workspace</code> config option.</p>
166+
<h4 id="example2">Example:</h4>
167+
<p>Here’s an example running <code>npm fund</code> in a project with a configured
168+
workspace <code>a</code>:</p>
169+
<pre lang="bash"><code>$ npm fund
170+
test-workspaces-fund@1.0.0
171+
+-- https://example.com/a
172+
| | `-- a@1.0.0
173+
| `-- https://example.com/maintainer
174+
| `-- foo@1.0.0
175+
+-- https://example.com/npmcli-funding
176+
| `-- @npmcli/test-funding
177+
`-- https://example.com/org
178+
`-- bar@2.0.0
179+
</code></pre>
180+
<p>And here is an example of the expected result when filtering only by
181+
a specific workspace <code>a</code> in the same project:</p>
182+
<pre lang="bash"><code>$ npm fund -w a
183+
test-workspaces-fund@1.0.0
184+
`-- https://example.com/a
185+
| `-- a@1.0.0
186+
`-- https://example.com/maintainer
187+
`-- foo@2.0.0
188+
</code></pre>
161189
<h3 id="configuration">Configuration</h3>
162190
<h4 id="browser">browser</h4>
163191
<ul>
@@ -178,6 +206,22 @@ <h4 id="unicode">unicode</h4>
178206
</ul>
179207
<p>Whether to represent the tree structure using unicode characters.
180208
Set it to <code>false</code> in order to use all-ansi output.</p>
209+
<h4 id="workspace"><code>workspace</code></h4>
210+
<ul>
211+
<li>Default:</li>
212+
<li>Type: String (can be set multiple times)</li>
213+
</ul>
214+
<p>Enable running a command in the context of the configured workspaces of the
215+
current project while filtering by running only the workspaces defined by
216+
this configuration option.</p>
217+
<p>Valid values for the <code>workspace</code> config are either:</p>
218+
<ul>
219+
<li>Workspace names</li>
220+
<li>Path to a workspace directory</li>
221+
<li>Path to a parent workspace directory (will result to selecting all of the
222+
nested workspaces)</li>
223+
</ul>
224+
<p>This value is not exported to the environment for child processes.</p>
181225
<h4 id="which">which</h4>
182226
<ul>
183227
<li>Type: Number</li>
@@ -190,6 +234,7 @@ <h2 id="see-also">See Also</h2>
190234
<li><a href="../commands/npm-docs.html">npm docs</a></li>
191235
<li><a href="../commands/npm-ls.html">npm ls</a></li>
192236
<li><a href="../commands/npm-config.html">npm config</a></li>
237+
<li><a href="../using-npm/workspaces.html">npm workspaces</a></li>
193238
</ul>
194239
</div>
195240

deps/npm/docs/output/commands/npm-ls.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ <h3 id="description">Description</h3>
159159
the results to only the paths to the packages named. Note that nested
160160
packages will <em>also</em> show the paths to the specified packages. For
161161
example, running <code>npm ls promzard</code> in npm’s source tree will show:</p>
162-
<pre lang="bash"><code>npm@7.12.1 /path/to/npm
162+
<pre lang="bash"><code>npm@7.13.0 /path/to/npm
163163
└─┬ init-package-json@0.0.4
164164
└── promzard@0.1.5
165165
</code></pre>

deps/npm/docs/output/commands/npm-publish.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,15 @@ <h3 id="description">Description</h3>
188188
actually publishing to the registry. Reports the details of what would
189189
have been published.</p>
190190
</li>
191+
<li>
192+
<p><code>[--workspaces]</code>: Enables workspace context while publishing. All
193+
workspace packages will be published.</p>
194+
</li>
195+
<li>
196+
<p><code>[--workspace]</code>: Enables workspaces context and limits results to only
197+
those specified by this config item. Only the packages in the
198+
workspaces given will be published.</p>
199+
</li>
191200
</ul>
192201
<p>The publish will fail if the package name and version combination already
193202
exists in the specified registry.</p>

deps/npm/docs/output/commands/npm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2>
148148
<pre lang="bash"><code>npm &lt;command&gt; [args]
149149
</code></pre>
150150
<h3 id="version">Version</h3>
151-
<p>7.12.1</p>
151+
<p>7.13.0</p>
152152
<h3 id="description">Description</h3>
153153
<p>npm is the package manager for the Node JavaScript platform. It puts
154154
modules in place so that node can find them, and manages dependency

deps/npm/lib/fund.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ const {
1313

1414
const completion = require('./utils/completion/installed-deep.js')
1515
const openUrl = require('./utils/open-url.js')
16+
const ArboristWorkspaceCmd = require('./workspaces/arborist-cmd.js')
1617

1718
const getPrintableName = ({ name, version }) => {
1819
const printableVersion = version ? `@${version}` : ''
1920
return `${name}${printableVersion}`
2021
}
2122

22-
const BaseCommand = require('./base-command.js')
23-
24-
class Fund extends BaseCommand {
23+
class Fund extends ArboristWorkspaceCmd {
2524
/* istanbul ignore next - see test/lib/load-all-commands.js */
2625
static get description () {
2726
return 'Retrieve funding information'
@@ -38,6 +37,7 @@ class Fund extends BaseCommand {
3837
'json',
3938
'browser',
4039
'unicode',
40+
'workspace',
4141
'which',
4242
]
4343
}
@@ -92,10 +92,16 @@ class Fund extends BaseCommand {
9292
return
9393
}
9494

95+
const fundingInfo = getFundingInfo(tree, {
96+
...this.flatOptions,
97+
log: this.npm.log,
98+
workspaces: this.workspaces,
99+
})
100+
95101
if (this.npm.config.get('json'))
96-
this.npm.output(this.printJSON(getFundingInfo(tree)))
102+
this.npm.output(this.printJSON(fundingInfo))
97103
else
98-
this.npm.output(this.printHuman(getFundingInfo(tree)))
104+
this.npm.output(this.printHuman(fundingInfo))
99105
}
100106

101107
printJSON (fundingInfo) {

0 commit comments

Comments
 (0)