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

release/v7.8.0 #3017

Merged
merged 12 commits into from
Apr 1, 2021
Prev Previous commit
Next Next commit
usage: specify the key each time for multiples
If a user runs 'npm install -w foo bar baz', that won't set 'bar' and
'baz' as workspace names.  The correct incantation is 'npm install -w
foo -w bar -w baz'.

PR-URL: #3016
Credit: @isaacs
Close: #3016
Reviewed-by: @wraithgar
  • Loading branch information
isaacs authored and wraithgar committed Apr 1, 2021
commit 4c4252348c538246e1072421d65f4558dc948080
2 changes: 1 addition & 1 deletion docs/content/using-npm/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ registry and all registries configured for scopes. See the documentation for
#### `audit-level`

* Default: null
* Type: "info", "low", "moderate", "high", "critical", "none", or null
* Type: null, "info", "low", "moderate", "high", "critical", or "none"

The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
Expand Down
9 changes: 5 additions & 4 deletions lib/utils/config/definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,14 @@ const describeUsage = (def) => {
description = def.hint
}

if (multiple)
description = `${description} [${description} ...]`

if (bool)
key = `${key}|${key}`

return `${key} ${description}`
const usage = `${key} ${description}`
if (multiple)
return `${usage} [${usage} ...]`
else
return usage
}

const describeType = type => {
Expand Down
12 changes: 6 additions & 6 deletions 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> [<workspace-name> ...]] [-ws|--workspaces]
[--browser|--browser <browser>] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces]

alias: home

Expand Down Expand Up @@ -370,7 +370,7 @@ All commands:
npm exec --package=foo -c '<cmd> [args...]'

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

alias: x

Expand Down Expand Up @@ -702,7 +702,7 @@ All commands:
npm repo [<pkgname> [<pkgname> ...]]

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

Run "npm help repo" for more info

Expand Down Expand Up @@ -735,7 +735,7 @@ All commands:
npm run-script <command> [-- <args>]

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

aliases: run, rum, urn

Expand Down Expand Up @@ -772,7 +772,7 @@ All commands:
npm set-script [<script>] [<command>]

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

Run "npm help set-script" for more info

Expand Down Expand Up @@ -921,7 +921,7 @@ All commands:
npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]

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

aliases: v, info, show

Expand Down