MCPcopy Index your code
hub / github.com/nodejs/node / updateWorkspaces

Function updateWorkspaces

deps/npm/lib/utils/update-workspaces.js:5–35  ·  view source on GitHub ↗
({
  config,
  flatOptions,
  localPrefix,
  npm,
  workspaces,
})

Source from the content-addressed store, hash-verified

3const reifyFinish = require('../utils/reify-finish.js')
4
5async function updateWorkspaces ({
6 config,
7 flatOptions,
8 localPrefix,
9 npm,
10 workspaces,
11}) {
12 if (!flatOptions.workspacesUpdate || !workspaces.length) {
13 return
14 }
15
16 // default behavior is to not save by default in order to avoid race condition problems when publishing multiple workspaces that have dependencies on one another
17 // it might still be useful in some cases, which then need to set --save
18 const save = config.isDefault('save')
19 ? false
20 : config.get('save')
21
22 // runs a minimalistic reify update, targeting only the workspaces that had version updates and skipping fund/audit/save
23 const opts = {
24 ...flatOptions,
25 audit: false,
26 fund: false,
27 path: localPrefix,
28 save,
29 }
30 const Arborist = require('@npmcli/arborist')
31 const arb = new Arborist(opts)
32
33 await arb.reify({ ...opts, update: workspaces })
34 await reifyFinish(npm, arb)
35}
36
37module.exports = updateWorkspaces

Callers 2

updateMethod · 0.85
changeWorkspacesMethod · 0.85

Calls 4

reifyMethod · 0.95
reifyFinishFunction · 0.85
getMethod · 0.65
requireFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…