Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorLuke Karrys <luke@lukekarrys.com>2021-09-30 23:55:55 +0300
committerLuke Karrys <luke@lukekarrys.com>2021-09-30 23:55:55 +0300
commitd7d5dd6aa66251805afd9009e3978f61ea732f05 (patch)
treea9f30844846e3dc4748bc5e222a7fa4a4ad2220b /lib/utils
parentf17dfa0ced7d8df9bb7baf378bb20d33175c8e8b (diff)
Revert "feat(workspaces): --include-workspace-root"
This reverts commit f17dfa0ced7d8df9bb7baf378bb20d33175c8e8b.
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/completion/installed-deep.js9
-rw-r--r--lib/utils/config/definitions.js41
2 files changed, 7 insertions, 43 deletions
diff --git a/lib/utils/completion/installed-deep.js b/lib/utils/completion/installed-deep.js
index 62686f9b2..590955a1e 100644
--- a/lib/utils/completion/installed-deep.js
+++ b/lib/utils/completion/installed-deep.js
@@ -7,7 +7,6 @@ const installedDeep = async (npm) => {
depth,
global,
prefix,
- workspacesEnabled,
} = npm.flatOptions
const getValues = (tree) =>
@@ -20,18 +19,14 @@ const installedDeep = async (npm) => {
.sort((a, b) => (a.depth - b.depth) || localeCompare(a.name, b.name))
const res = new Set()
- const gArb = new Arborist({
- global: true,
- path: resolve(npm.globalDir, '..'),
- workspacesEnabled,
- })
+ const gArb = new Arborist({ global: true, path: resolve(npm.globalDir, '..') })
const gTree = await gArb.loadActual({ global: true })
for (const node of getValues(gTree))
res.add(global ? node.name : [node.name, '-g'])
if (!global) {
- const arb = new Arborist({ global: false, path: prefix, workspacesEnabled })
+ const arb = new Arborist({ global: false, path: prefix })
const tree = await arb.loadActual()
for (const node of getValues(tree))
res.add(node.name)
diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js
index 57a50d1c8..009f60a7b 100644
--- a/lib/utils/config/definitions.js
+++ b/lib/utils/config/definitions.js
@@ -918,19 +918,6 @@ define('include-staged', {
flatten,
})
-define('include-workspace-root', {
- default: false,
- type: Boolean,
- description: `
- Include the workspace root when workspaces are enabled for a command.
-
- When false, specifying individual workspaces via the \`workspace\` config,
- or all workspaces via the \`workspaces\` flag, will cause npm to operate only
- on the specified workspaces, and not on the root project.
- `,
- flatten,
-})
-
define('init-author-email', {
default: '',
type: String,
@@ -2150,8 +2137,8 @@ define('workspace', {
* Workspace names
* Path to a workspace directory
- * Path to a parent workspace directory (will result in selecting all
- workspaces within that folder)
+ * Path to a parent workspace directory (will result to selecting all of the
+ nested workspaces)
When set for the \`npm init\` command, this may be set to the folder of
a workspace which does not yet exist, to create the folder and set it
@@ -2163,34 +2150,16 @@ define('workspace', {
})
define('workspaces', {
- default: null,
- type: [null, Boolean],
+ default: false,
+ type: Boolean,
short: 'ws',
envExport: false,
description: `
- Set to true to run the command in the context of **all** configured
+ Enable running a command in the context of **all** the configured
workspaces.
-
- Explicitly setting this to false will cause commands like \`install\` to
- ignore workspaces altogether.
- When not set explicitly:
-
- - Commands that operate on the \`node_modules\` tree (install, update,
- etc.) will link workspaces into the \`node_modules\` folder.
- - Commands that do other things (test, exec, publish, etc.) will operate
- on the root project, _unless_ one or more workspaces are specified in
- the \`workspace\` config.
`,
flatten: (key, obj, flatOptions) => {
definitions['user-agent'].flatten('user-agent', obj, flatOptions)
-
- // TODO: this is a derived value, and should be reworked when we have a
- // pattern for derived value
-
- // workspacesEnabled is true whether workspaces is null or true
- // commands contextually work with workspaces or not regardless of
- // configuration, so we need an option specifically to disable workspaces
- flatOptions.workspacesEnabled = obj[key] !== false
},
})