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:
authorGar <gar+gh@danger.computer>2021-04-08 20:08:23 +0300
committerGar <gar+gh@danger.computer>2021-04-15 20:30:37 +0300
commit8c9e24778db867cb3148bc247c7e321639aa9f58 (patch)
tree70b5db93056e1dc0b0542d88d348c5a8107213fd /lib/workspaces
parent3b476a24cf0b2823fdf92505b84bddde4fcc8b14 (diff)
feat(version): add workspace support
PR-URL: https://github.com/npm/cli/pull/3055 Credit: @wraithgar Close: #3055 Reviewed-by: @darcyclarke
Diffstat (limited to 'lib/workspaces')
-rw-r--r--lib/workspaces/get-workspaces.js3
1 files changed, 3 insertions, 0 deletions
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