Skip to content

Commit cfe751f

Browse files
author
CI User
committed
CLI documentation update from CI
1 parent 9aae121 commit cfe751f

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

content/cli/v7/commands/npm-fund.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ github_path: docs/content/commands/npm-fund.md
1818

1919
```bash
2020
npm fund [<pkg>]
21+
npm fund [-w <workspace-name>]
2122
```
2223

2324
### Description
@@ -34,6 +35,43 @@ The list will avoid duplicated entries and will stack all packages that
3435
share the same url as a single entry. Thus, the list does not have the same
3536
shape of the output from `npm ls`.
3637

38+
#### Example
39+
40+
### Workspaces support
41+
42+
It's possible to filter the results to only include a single workspace and its
43+
dependencies using the `workspace` config option.
44+
45+
#### Example:
46+
47+
Here's an example running `npm fund` in a project with a configured
48+
workspace `a`:
49+
50+
```bash
51+
$ npm fund
52+
53+
+-- https://example.com/a
54+
55+
| `-- https://example.com/maintainer
56+
57+
+-- https://example.com/npmcli-funding
58+
| `-- @npmcli/test-funding
59+
`-- https://example.com/org
60+
61+
```
62+
63+
And here is an example of the expected result when filtering only by
64+
a specific workspace `a` in the same project:
65+
66+
```bash
67+
$ npm fund -w a
68+
69+
`-- https://example.com/a
70+
71+
`-- https://example.com/maintainer
72+
73+
```
74+
3775
### Configuration
3876

3977
#### browser
@@ -58,6 +96,23 @@ Show information in JSON format.
5896
Whether to represent the tree structure using unicode characters.
5997
Set it to `false` in order to use all-ansi output.
6098

99+
#### `workspace`
100+
101+
* Default:
102+
* Type: String (can be set multiple times)
103+
104+
Enable running a command in the context of the configured workspaces of the
105+
current project while filtering by running only the workspaces defined by
106+
this configuration option.
107+
108+
Valid values for the `workspace` config are either:
109+
* Workspace names
110+
* Path to a workspace directory
111+
* Path to a parent workspace directory (will result to selecting all of the
112+
nested workspaces)
113+
114+
This value is not exported to the environment for child processes.
115+
61116
#### which
62117

63118
* Type: Number
@@ -71,3 +126,4 @@ If there are multiple funding sources, which 1-indexed source URL to open.
71126
* [npm docs](/cli/v7/commands/npm-docs)
72127
* [npm ls](/cli/v7/commands/npm-ls)
73128
* [npm config](/cli/v7/commands/npm-config)
129+
* [npm workspaces](/cli/v7/using-npm/workspaces)

content/cli/v7/commands/npm-publish.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ by specifying a different default registry or using a
5757
actually publishing to the registry. Reports the details of what would
5858
have been published.
5959
60+
* `[--workspaces]`: Enables workspace context while publishing. All
61+
workspace packages will be published.
62+
63+
* `[--workspace]`: Enables workspaces context and limits results to only
64+
those specified by this config item. Only the packages in the
65+
workspaces given will be published.
66+
6067
The publish will fail if the package name and version combination already
6168
exists in the specified registry.
6269

0 commit comments

Comments
 (0)