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

Function main

scripts/devtools/prepare-release.js:29–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

27
28// This is the primary control function for this script.
29async function main() {
30 clear();
31
32 await checkNPMPermissions();
33
34 const sha = await getPreviousCommitSha();
35 const [shortCommitLog, formattedCommitLog] = await getCommitLog(sha);
36
37 console.log('');
38 console.log(
39 'This release includes the following commits:',
40 chalk.gray(shortCommitLog)
41 );
42 console.log('');
43
44 const releaseType = await getReleaseType();
45
46 const path = join(ROOT_PATH, PACKAGE_PATHS[0]);
47 const previousVersion = readJsonSync(path).version;
48 const {major, minor, patch} = semver(previousVersion);
49 const nextVersion =
50 releaseType === 'minor'
51 ? `${major}.${minor + 1}.0`
52 : `${major}.${minor}.${patch + 1}`;
53
54 updateChangelog(nextVersion, formattedCommitLog);
55
56 await reviewChangelogPrompt();
57
58 updatePackageVersions(previousVersion, nextVersion);
59 updateManifestVersions(previousVersion, nextVersion);
60
61 console.log('');
62 console.log(
63 `Packages and manifests have been updated from version ${chalk.bold(
64 previousVersion
65 )} to ${chalk.bold(nextVersion)}`
66 );
67 console.log('');
68
69 await commitPendingChanges(previousVersion, nextVersion);
70
71 printFinalInstructions();
72}
73
74async function commitPendingChanges(previousVersion, nextVersion) {
75 console.log('');

Callers 1

prepare-release.jsFile · 0.70

Calls 11

checkNPMPermissionsFunction · 0.85
getPreviousCommitShaFunction · 0.85
getCommitLogFunction · 0.85
getReleaseTypeFunction · 0.85
updateChangelogFunction · 0.85
reviewChangelogPromptFunction · 0.85
updateManifestVersionsFunction · 0.85
commitPendingChangesFunction · 0.85
clearFunction · 0.70
updatePackageVersionsFunction · 0.70
printFinalInstructionsFunction · 0.70

Tested by

no test coverage detected