From d7d5dd6aa66251805afd9009e3978f61ea732f05 Mon Sep 17 00:00:00 2001 From: Luke Karrys Date: Thu, 30 Sep 2021 13:55:55 -0700 Subject: Revert "feat(workspaces): --include-workspace-root" This reverts commit f17dfa0ced7d8df9bb7baf378bb20d33175c8e8b. --- lib/workspaces/arborist-cmd.js | 7 +------ lib/workspaces/get-workspaces.js | 9 ++------- 2 files changed, 3 insertions(+), 13 deletions(-) (limited to 'lib/workspaces') 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()) { -- cgit v1.2.3