Skip to content

Commit ee9ac1b

Browse files
committed
fix(docs): add workspaces configuration
Adds workspaces configuration to `docs`, `repo`, and `set-script`.
1 parent 32717a6 commit ee9ac1b

File tree

5 files changed

+44
-5
lines changed

5 files changed

+44
-5
lines changed

docs/content/commands/npm-docs.md

+13
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@ Set to `true` to use default system URL opener.
4141
4242
The base URL of the npm package registry.
4343
44+
#### workspaces
45+
46+
Enables workspaces context while searching the `package.json` in the
47+
current folder. Documentation urls for the packages named in each
48+
workspace will be opened.
49+
50+
#### workspace
51+
52+
Enables workspaces context and limits results to only those specified by
53+
this config item. Only the documentation urls for the packages named in
54+
the workspaces given here will be opened.
55+
56+
4457
### See Also
4558
4659
* [npm view](/commands/npm-view)

docs/content/commands/npm-repo.md

+13
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ terminal.
3131
3232
Set to `true` to use default system URL opener.
3333
34+
#### workspaces
35+
36+
Enables workspaces context while searching the `package.json` in the
37+
current folder. Repo urls for the packages named in each workspace will
38+
be opened.
39+
40+
#### workspace
41+
42+
Enables workspaces context and limits results to only those specified by
43+
this config item. Only the repo urls for the packages named in the
44+
workspaces given here will be opened.
45+
46+
3447
### See Also
3548
3649
* [npm docs](/commands/npm-docs)

docs/content/commands/npm-set-script.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Set tasks in the scripts section of package.json
55
---
66

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

1010
```bash
1111
npm set-script [<script>] [<command>]
@@ -26,6 +26,19 @@ npm set-script [<script>] [<command>]
2626
}
2727
```
2828

29+
### Configuration
30+
31+
#### workspaces
32+
33+
Enables workspaces context. Tasks will be created in the `scripts` section
34+
of the `package.json` of each workspace.
35+
36+
#### workspace
37+
38+
Enables workspaces context and limits creating a task to the
39+
`package.json` files of the workspaces given.
40+
41+
2942
### See Also
3043

3144
* [npm run-script](/commands/npm-run-script)

lib/docs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Docs extends BaseCommand {
1818

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

2424
/* istanbul ignore next - see test/lib/load-all-commands.js */

tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ All commands:
335335
npm docs [<pkgname> [<pkgname> ...]]
336336
337337
Options:
338-
[--browser|--browser <browser>] [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
338+
[--browser|--browser <browser>] [--registry <registry>] [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
339339
340340
alias: home
341341
@@ -772,7 +772,7 @@ All commands:
772772
npm set-script [<script>] [<command>]
773773
774774
Options:
775-
[-w|--workspace <workspace>|-w|--workspace <workspace>] [-ws|--workspaces]
775+
[-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
776776
777777
Run "npm help set-script" for more info
778778
@@ -921,7 +921,7 @@ All commands:
921921
npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]
922922
923923
Options:
924-
[--json] [-w|--workspace <workspace>|-w|--workspace <workspace>] [-ws|--workspaces]
924+
[--json] [-w|--workspace <workspace-name> [<workspace-name> ...]] [-ws|--workspaces]
925925
926926
aliases: v, info, show
927927

0 commit comments

Comments
 (0)