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

Method changeWorkspaces

deps/npm/lib/commands/version.js:83–111  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

81 }
82
83 async changeWorkspaces (args) {
84 const updateWorkspaces = require('../utils/update-workspaces.js')
85 const libnpmversion = require('libnpmversion')
86 const prefix = this.npm.config.get('tag-version-prefix')
87 const {
88 config,
89 flatOptions,
90 localPrefix,
91 } = this.npm
92 await this.setWorkspaces()
93 const updatedWorkspaces = []
94 for (const [name, path] of this.workspaces) {
95 output.standard(name)
96 const version = await libnpmversion(args[0], {
97 ...flatOptions,
98 'git-tag-version': false,
99 path,
100 })
101 updatedWorkspaces.push(name)
102 output.standard(`${prefix}${version}`)
103 }
104 return updateWorkspaces({
105 config,
106 flatOptions,
107 localPrefix,
108 npm: this.npm,
109 workspaces: updatedWorkspaces,
110 })
111 }
112
113 async list (results = {}) {
114 const pj = resolve(this.npm.prefix, 'package.json')

Callers 1

execWorkspacesMethod · 0.95

Calls 5

updateWorkspacesFunction · 0.85
setWorkspacesMethod · 0.80
getMethod · 0.65
requireFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected