MCPcopy Index your code
hub / github.com/react/react / updatePackageVersions

Function updatePackageVersions

scripts/devtools/prepare-release.js:264–284  ·  view source on GitHub ↗
(previousVersion, nextVersion)

Source from the content-addressed store, hash-verified

262}
263
264function updatePackageVersions(previousVersion, nextVersion) {
265 PACKAGE_PATHS.forEach(partialPath => {
266 const path = join(ROOT_PATH, partialPath);
267 const json = readJsonSync(path);
268 json.version = nextVersion;
269
270 for (let key in json.dependencies) {
271 if (key.startsWith('react-devtools')) {
272 const version = json.dependencies[key];
273
274 json.dependencies[key] = version.replace(previousVersion, nextVersion);
275 }
276 }
277
278 console.log(chalk.dim(' Updating package JSON: ' + partialPath));
279
280 if (!DRY_RUN) {
281 writeJsonSync(path, json, {spaces: 2});
282 }
283 });
284}
285
286main();

Callers 1

mainFunction · 0.70

Calls 1

forEachMethod · 0.65

Tested by

no test coverage detected