MCPcopy
hub / github.com/vuejs/core / updatePackage

Function updatePackage

scripts/release.js:391–398  ·  view source on GitHub ↗

* @param {string} pkgRoot * @param {string} version * @param {(pkgName: string) => string} getNewPackageName

(pkgRoot, version, getNewPackageName)

Source from the content-addressed store, hash-verified

389 * @param {(pkgName: string) => string} getNewPackageName
390 */
391function updatePackage(pkgRoot, version, getNewPackageName) {
392 const pkgPath = path.resolve(pkgRoot, 'package.json')
393 /** @type {Package} */
394 const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'))
395 pkg.name = getNewPackageName(pkg.name)
396 pkg.version = version
397 fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n')
398}
399
400async function buildPackages() {
401 step('\nBuilding all packages...')

Callers 1

updateVersionsFunction · 0.85

Calls 2

resolveMethod · 0.65
parseMethod · 0.65

Tested by

no test coverage detected