Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): add workspaces configuration #3013

Merged
merged 1 commit into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions 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 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 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
2 changes: 1 addition & 1 deletion lib/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Docs extends BaseCommand {

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

/* istanbul ignore next - see test/lib/load-all-commands.js */
Expand Down
2 changes: 1 addition & 1 deletion tap-snapshots/test-lib-utils-npm-usage.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ All commands:
npm docs [<pkgname> [<pkgname> ...]]

Options:
[--browser|--browser <browser>] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]
[--browser|--browser <browser>] [--registry <registry>] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]

alias: home

Expand Down