-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
CI User
committed
May 14, 2021
1 parent
9aae121
commit cfe751f
Showing
3 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
Submodule v7
updated
21 files
+18 −0 | CHANGELOG.md | |
+56 −0 | docs/content/commands/npm-fund.md | |
+7 −0 | docs/content/commands/npm-publish.md | |
+11 −5 | lib/fund.js | |
+50 −26 | lib/publish.js | |
+24 −0 | lib/workspaces/arborist-cmd.js | |
+23 −0 | node_modules/@npmcli/arborist/lib/arborist/index.js | |
+33 −0 | node_modules/@npmcli/arborist/lib/get-workspace-nodes.js | |
+1 −1 | node_modules/@npmcli/arborist/package.json | |
+0 −6 | node_modules/libnpmfund/CHANGELOG.md | |
+4 −1 | node_modules/libnpmfund/README.md | |
+38 −25 | node_modules/libnpmfund/index.js | |
+12 −7 | node_modules/libnpmfund/package.json | |
+18 −18 | package-lock.json | |
+4 −4 | package.json | |
+20 −0 | tap-snapshots/test/lib/fund.js.test.cjs | |
+103 −0 | tap-snapshots/test/lib/publish.js.test.cjs | |
+3 −0 | tap-snapshots/test/lib/utils/npm-usage.js.test.cjs | |
+86 −0 | test/lib/fund.js | |
+112 −20 | test/lib/publish.js | |
+109 −0 | test/lib/workspaces/arborist-cmd.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ github_path: docs/content/commands/npm-fund.md | |
|
||
```bash | ||
npm fund [<pkg>] | ||
npm fund [-w <workspace-name>] | ||
``` | ||
|
||
### Description | ||
|
@@ -34,6 +35,43 @@ The list will avoid duplicated entries and will stack all packages that | |
share the same url as a single entry. Thus, the list does not have the same | ||
shape of the output from `npm ls`. | ||
|
||
#### Example | ||
|
||
### Workspaces support | ||
|
||
It's possible to filter the results to only include a single workspace and its | ||
dependencies using the `workspace` config option. | ||
|
||
#### Example: | ||
|
||
Here's an example running `npm fund` in a project with a configured | ||
workspace `a`: | ||
|
||
```bash | ||
$ npm fund | ||
[email protected] | ||
+-- https://example.com/a | ||
| | `-- [email protected] | ||
| `-- https://example.com/maintainer | ||
| `-- [email protected] | ||
+-- https://example.com/npmcli-funding | ||
| `-- @npmcli/test-funding | ||
`-- https://example.com/org | ||
`-- [email protected] | ||
``` | ||
|
||
And here is an example of the expected result when filtering only by | ||
a specific workspace `a` in the same project: | ||
|
||
```bash | ||
$ npm fund -w a | ||
[email protected] | ||
`-- https://example.com/a | ||
| `-- [email protected] | ||
`-- https://example.com/maintainer | ||
`-- [email protected] | ||
``` | ||
|
||
### Configuration | ||
|
||
#### browser | ||
|
@@ -58,6 +96,23 @@ Show information in JSON format. | |
Whether to represent the tree structure using unicode characters. | ||
Set it to `false` in order to use all-ansi output. | ||
|
||
#### `workspace` | ||
|
||
* Default: | ||
* Type: String (can be set multiple times) | ||
|
||
Enable running a command in the context of the configured workspaces of the | ||
current project while filtering by running only the workspaces defined by | ||
this configuration option. | ||
|
||
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. | ||
|
||
#### which | ||
|
||
* Type: Number | ||
|
@@ -71,3 +126,4 @@ If there are multiple funding sources, which 1-indexed source URL to open. | |
* [npm docs](/cli/v7/commands/npm-docs) | ||
* [npm ls](/cli/v7/commands/npm-ls) | ||
* [npm config](/cli/v7/commands/npm-config) | ||
* [npm workspaces](/cli/v7/using-npm/workspaces) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters