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
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/workspaces
parentf17dfa0ced7d8df9bb7baf378bb20d33175c8e8b (diff)
Revert "feat(workspaces): --include-workspace-root"
This reverts commit f17dfa0ced7d8df9bb7baf378bb20d33175c8e8b.
Diffstat (limited to 'lib/workspaces')
-rw-r--r--lib/workspaces/arborist-cmd.js7
-rw-r--r--lib/workspaces/get-workspaces.js9
2 files changed, 3 insertions, 13 deletions
diff --git a/lib/workspaces/arborist-cmd.js b/lib/workspaces/arborist-cmd.js
index a75b351be..cb6b66b8c 100644
--- a/lib/workspaces/arborist-cmd.js
+++ b/lib/workspaces/arborist-cmd.js
@@ -4,21 +4,16 @@
const BaseCommand = require('../base-command.js')
class ArboristCmd extends BaseCommand {
- get isArboristCmd () {
- return true
- }
-
/* istanbul ignore next - see test/lib/load-all-commands.js */
static get params () {
return [
'workspace',
'workspaces',
- 'include-workspace-root',
]
}
execWorkspaces (args, filters, cb) {
- this.setWorkspaces(filters, true)
+ this.setWorkspaces(filters)
.then(() => {
this.exec(args, cb)
})
diff --git a/lib/workspaces/get-workspaces.js b/lib/workspaces/get-workspaces.js
index 3eb8e4865..91b007455 100644
--- a/lib/workspaces/get-workspaces.js
+++ b/lib/workspaces/get-workspaces.js
@@ -5,16 +5,11 @@ const rpj = require('read-package-json-fast')
// Returns an Map of paths to workspaces indexed by workspace name
// { foo => '/path/to/foo' }
-const getWorkspaces = async (filters, { path, includeWorkspaceRoot }) => {
+const getWorkspaces = async (filters, { path }) => {
// TODO we need a better error to be bubbled up here if this rpj call fails
const pkg = await rpj(resolve(path, 'package.json'))
const workspaces = await mapWorkspaces({ cwd: path, pkg })
- let res = new Map()
- if (includeWorkspaceRoot)
- res.set(pkg.name, path)
-
- if (!filters.length)
- res = new Map([...res, ...workspaces])
+ const res = filters.length ? new Map() : workspaces
for (const filterArg of filters) {
for (const [workspaceName, workspacePath] of workspaces.entries()) {