From 8c9e24778db867cb3148bc247c7e321639aa9f58 Mon Sep 17 00:00:00 2001 From: Gar Date: Thu, 8 Apr 2021 10:08:23 -0700 Subject: feat(version): add workspace support PR-URL: https://github.com/npm/cli/pull/3055 Credit: @wraithgar Close: #3055 Reviewed-by: @darcyclarke --- lib/workspaces/get-workspaces.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/workspaces') diff --git a/lib/workspaces/get-workspaces.js b/lib/workspaces/get-workspaces.js index 64812d540..91b007455 100644 --- a/lib/workspaces/get-workspaces.js +++ b/lib/workspaces/get-workspaces.js @@ -3,7 +3,10 @@ const mapWorkspaces = require('@npmcli/map-workspaces') const minimatch = require('minimatch') 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 }) => { + // 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 }) const res = filters.length ? new Map() : workspaces -- cgit v1.2.3