diff --git a/docs/content/commands/npm-adduser.md b/docs/content/commands/npm-adduser.md index 7960869ad33cc..d0ddd68c2529a 100644 --- a/docs/content/commands/npm-adduser.md +++ b/docs/content/commands/npm-adduser.md @@ -12,6 +12,8 @@ npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=leg aliases: login, add-user ``` +Note: This command is unaware of workspaces. + ### Description Create or verify a user named `` in the specified registry, and diff --git a/docs/content/commands/npm-bin.md b/docs/content/commands/npm-bin.md index 4303040e78dac..c835784f675a0 100644 --- a/docs/content/commands/npm-bin.md +++ b/docs/content/commands/npm-bin.md @@ -10,6 +10,8 @@ description: Display npm bin folder npm bin [-g|--global] ``` +Note: This command is unaware of workspaces. + ### Description Print the folder where npm will install executables. diff --git a/docs/content/commands/npm-cache.md b/docs/content/commands/npm-cache.md index 13386f2c4a439..bcc2989b7d3c3 100644 --- a/docs/content/commands/npm-cache.md +++ b/docs/content/commands/npm-cache.md @@ -18,6 +18,8 @@ aliases: npm cache clear, npm cache rm npm cache verify ``` +Note: This command is unaware of workspaces. + ### Description Used to add, list, or clean the npm cache folder. diff --git a/docs/content/commands/npm-completion.md b/docs/content/commands/npm-completion.md index 53737c8033194..9dbd960913f27 100644 --- a/docs/content/commands/npm-completion.md +++ b/docs/content/commands/npm-completion.md @@ -10,6 +10,8 @@ description: Tab Completion for npm source <(npm completion) ``` +Note: This command is unaware of workspaces. + ### Description Enables tab-completion in all npm commands. diff --git a/docs/content/commands/npm-config.md b/docs/content/commands/npm-config.md index 51caa5a61b607..31629a6b7d7a2 100644 --- a/docs/content/commands/npm-config.md +++ b/docs/content/commands/npm-config.md @@ -18,6 +18,8 @@ npm get [ [ ...]] alias: c ``` +Note: This command is unaware of workspaces. + ### Description npm gets its config settings from the command line, environment diff --git a/docs/content/commands/npm-deprecate.md b/docs/content/commands/npm-deprecate.md index 139441856bb06..0603797661055 100644 --- a/docs/content/commands/npm-deprecate.md +++ b/docs/content/commands/npm-deprecate.md @@ -10,6 +10,8 @@ description: Deprecate a version of a package npm deprecate [@] ``` +Note: This command is unaware of workspaces. + ### Description This command will update the npm registry entry for a package, providing a diff --git a/docs/content/commands/npm-doctor.md b/docs/content/commands/npm-doctor.md index 2aceee2390331..9416818a40aaf 100644 --- a/docs/content/commands/npm-doctor.md +++ b/docs/content/commands/npm-doctor.md @@ -10,6 +10,8 @@ description: Check your npm environment npm doctor ``` +Note: This command is unaware of workspaces. + ### Description `npm doctor` runs a set of checks to ensure that your npm installation has diff --git a/docs/content/commands/npm-edit.md b/docs/content/commands/npm-edit.md index 40fac0408529a..20788aafb6d6a 100644 --- a/docs/content/commands/npm-edit.md +++ b/docs/content/commands/npm-edit.md @@ -10,6 +10,8 @@ description: Edit an installed package npm edit ``` +Note: This command is unaware of workspaces. + ### Description Selects a dependency in the current project and opens the package folder in diff --git a/docs/content/commands/npm-explore.md b/docs/content/commands/npm-explore.md index e467a755753b4..7e2004b84c041 100644 --- a/docs/content/commands/npm-explore.md +++ b/docs/content/commands/npm-explore.md @@ -10,6 +10,8 @@ description: Browse an installed package npm explore [ -- ] ``` +Note: This command is unaware of workspaces. + ### Description Spawn a subshell in the directory of the installed package specified. diff --git a/docs/content/commands/npm-help-search.md b/docs/content/commands/npm-help-search.md index e10638efa07d9..51c7b43fb54f1 100644 --- a/docs/content/commands/npm-help-search.md +++ b/docs/content/commands/npm-help-search.md @@ -10,6 +10,8 @@ description: Search npm help documentation npm help-search ``` +Note: This command is unaware of workspaces. + ### Description This command will search the npm markdown documentation files for the terms diff --git a/docs/content/commands/npm-help.md b/docs/content/commands/npm-help.md index 56e46645522ba..57c5efc8ed5eb 100644 --- a/docs/content/commands/npm-help.md +++ b/docs/content/commands/npm-help.md @@ -10,6 +10,8 @@ description: Get help on npm npm help [] ``` +Note: This command is unaware of workspaces. + ### Description If supplied a topic, then show the appropriate documentation page. diff --git a/docs/content/commands/npm-hook.md b/docs/content/commands/npm-hook.md index 2ac548ada0c21..6effc9b7d223b 100644 --- a/docs/content/commands/npm-hook.md +++ b/docs/content/commands/npm-hook.md @@ -13,6 +13,8 @@ npm hook update [secret] npm hook rm ``` +Note: This command is unaware of workspaces. + ### Description Allows you to manage [npm diff --git a/docs/content/commands/npm-logout.md b/docs/content/commands/npm-logout.md index 7fa858a99993d..1172a3f0f560a 100644 --- a/docs/content/commands/npm-logout.md +++ b/docs/content/commands/npm-logout.md @@ -10,6 +10,8 @@ description: Log out of the registry npm logout [--registry=] [--scope=<@scope>] ``` +Note: This command is unaware of workspaces. + ### Description When logged into a registry that supports token-based authentication, tell diff --git a/docs/content/commands/npm-org.md b/docs/content/commands/npm-org.md index 18047d109cc0b..384f5b99fd42e 100644 --- a/docs/content/commands/npm-org.md +++ b/docs/content/commands/npm-org.md @@ -12,6 +12,8 @@ npm org rm npm org ls [] ``` +Note: This command is unaware of workspaces. + ### Example Add a new developer to an org: diff --git a/docs/content/commands/npm-owner.md b/docs/content/commands/npm-owner.md index 69eba56afd97d..b30bbc8dc68ef 100644 --- a/docs/content/commands/npm-owner.md +++ b/docs/content/commands/npm-owner.md @@ -14,6 +14,8 @@ npm owner ls [<@scope>/] aliases: author ``` +Note: This command is unaware of workspaces. + ### Description Manage ownership of published packages. diff --git a/docs/content/commands/npm-ping.md b/docs/content/commands/npm-ping.md index 8de06aa184836..f640bf060c750 100644 --- a/docs/content/commands/npm-ping.md +++ b/docs/content/commands/npm-ping.md @@ -10,6 +10,8 @@ description: Ping npm registry npm ping [--registry ] ``` +Note: This command is unaware of workspaces. + ### Description Ping the configured or given npm registry and verify authentication. diff --git a/docs/content/commands/npm-prefix.md b/docs/content/commands/npm-prefix.md index 9c33bb18901ef..4e3edf1902301 100644 --- a/docs/content/commands/npm-prefix.md +++ b/docs/content/commands/npm-prefix.md @@ -10,6 +10,8 @@ description: Display prefix npm prefix [-g] ``` +Note: This command is unaware of workspaces. + ### Description Print the local prefix to standard output. This is the closest parent directory diff --git a/docs/content/commands/npm-profile.md b/docs/content/commands/npm-profile.md index 88edf26d87c41..b4e2fdaee6cb1 100644 --- a/docs/content/commands/npm-profile.md +++ b/docs/content/commands/npm-profile.md @@ -14,6 +14,8 @@ npm profile enable-2fa [auth-and-writes|auth-only] npm profile disable-2fa ``` +Note: This command is unaware of workspaces. + ### Description Change your profile information on the registry. Note that this command diff --git a/docs/content/commands/npm-search.md b/docs/content/commands/npm-search.md index 35178bcb0a580..046c9334ff062 100644 --- a/docs/content/commands/npm-search.md +++ b/docs/content/commands/npm-search.md @@ -12,6 +12,8 @@ npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms . aliases: s, se, find ``` +Note: This command is unaware of workspaces. + ### Description Search the registry for packages matching the search terms. `npm search` diff --git a/docs/content/commands/npm-shrinkwrap.md b/docs/content/commands/npm-shrinkwrap.md index dce50b7843bc3..6786229469d2c 100644 --- a/docs/content/commands/npm-shrinkwrap.md +++ b/docs/content/commands/npm-shrinkwrap.md @@ -10,6 +10,8 @@ description: Lock down dependency versions for publication npm shrinkwrap ``` +Note: This command is unaware of workspaces. + ### Description This command repurposes `package-lock.json` into a publishable diff --git a/docs/content/commands/npm-star.md b/docs/content/commands/npm-star.md index aab6e107747fd..e624b92480f91 100644 --- a/docs/content/commands/npm-star.md +++ b/docs/content/commands/npm-star.md @@ -10,6 +10,8 @@ description: Mark your favorite packages npm star [...] ``` +Note: This command is unaware of workspaces. + ### Description "Starring" a package means that you have some interest in it. It's diff --git a/docs/content/commands/npm-stars.md b/docs/content/commands/npm-stars.md index dab11bc669d1a..80217ee044aa8 100644 --- a/docs/content/commands/npm-stars.md +++ b/docs/content/commands/npm-stars.md @@ -9,6 +9,8 @@ description: View packages marked as favorites npm stars [] ``` +Note: This command is unaware of workspaces. + ### Description If you have starred a lot of neat things and want to find them again diff --git a/docs/content/commands/npm-team.md b/docs/content/commands/npm-team.md index 96aacd8ae95f2..04e1d7f9eb1a5 100644 --- a/docs/content/commands/npm-team.md +++ b/docs/content/commands/npm-team.md @@ -16,6 +16,8 @@ npm team rm npm team ls | ``` +Note: This command is unaware of workspaces. + ### Description Used to manage teams in organizations, and change team memberships. Does not diff --git a/docs/content/commands/npm-token.md b/docs/content/commands/npm-token.md index 652079453702e..bafc7fc45c677 100644 --- a/docs/content/commands/npm-token.md +++ b/docs/content/commands/npm-token.md @@ -9,7 +9,9 @@ description: Manage your authentication tokens npm token list [--json|--parseable] npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16] npm token revoke - ``` +``` + +Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-unstar.md b/docs/content/commands/npm-unstar.md index 5471d908004e1..bad1917593841 100644 --- a/docs/content/commands/npm-unstar.md +++ b/docs/content/commands/npm-unstar.md @@ -10,6 +10,8 @@ description: Remove an item from your favorite packages npm unstar [...] ``` +Note: This command is unaware of workspaces. + ### Description "Unstarring" a package is the opposite of [`npm star`](/commands/npm-star), diff --git a/docs/content/commands/npm-whoami.md b/docs/content/commands/npm-whoami.md index 43b301c51707a..892adeea3db7c 100644 --- a/docs/content/commands/npm-whoami.md +++ b/docs/content/commands/npm-whoami.md @@ -10,6 +10,8 @@ description: Display npm username npm whoami [--registry ] ``` +Note: This command is unaware of workspaces. + ### Description Print the `username` config to standard output. diff --git a/lib/utils/config.js b/lib/utils/config.js index 3ca9766132f02..6d994d18653f9 100644 --- a/lib/utils/config.js +++ b/lib/utils/config.js @@ -192,6 +192,8 @@ const defaults = { version: false, versions: false, viewer: isWindows ? 'browser' : 'man', + workspace: [], + workspaces: false, } const types = { @@ -348,6 +350,8 @@ const types = { version: Boolean, versions: Boolean, viewer: String, + workspace: [String, Array], + workspaces: Boolean } const shorthands = { @@ -389,6 +393,7 @@ const shorthands = { v: ['--version'], verbose: ['--loglevel', 'verbose'], y: ['--yes'], + w: ['--workspace'], } module.exports = { defaults, types, shorthands } diff --git a/tap-snapshots/test-lib-utils-config.js-TAP.test.js b/tap-snapshots/test-lib-utils-config.js-TAP.test.js index 39927e600e123..6de77cff430db 100644 --- a/tap-snapshots/test-lib-utils-config.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-config.js-TAP.test.js @@ -149,6 +149,8 @@ Object { "version": false, "versions": false, "viewer": "browser", + "workspace": Array [], + "workspaces": false, }, "shorthands": Object { "?": Array [ @@ -270,6 +272,9 @@ Object { "--loglevel", "verbose", ], + "w": Array [ + "--workspace", + ], "y": Array [ "--yes", ], @@ -552,6 +557,11 @@ Object { "version": "{Boolean TYPE}", "versions": "{Boolean TYPE}", "viewer": "{String TYPE}", + "workspace": Array [ + "{String TYPE}", + "{Array TYPE}", + ], + "workspaces": "{Boolean TYPE}", }, } ` @@ -700,6 +710,8 @@ Object { "version": false, "versions": false, "viewer": "man", + "workspace": Array [], + "workspaces": false, }, "shorthands": Object { "?": Array [ @@ -821,6 +833,9 @@ Object { "--loglevel", "verbose", ], + "w": Array [ + "--workspace", + ], "y": Array [ "--yes", ], @@ -1105,6 +1120,11 @@ Object { "version": "{Boolean TYPE}", "versions": "{Boolean TYPE}", "viewer": "{String TYPE}", + "workspace": Array [ + "{String TYPE}", + "{Array TYPE}", + ], + "workspaces": "{Boolean TYPE}", }, } `