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

Function updateChangelog

scripts/devtools/prepare-release.js:224–244  ·  view source on GitHub ↗
(nextVersion, commitLog)

Source from the content-addressed store, hash-verified

222}
223
224function updateChangelog(nextVersion, commitLog) {
225 const path = join(ROOT_PATH, CHANGELOG_PATH);
226 const oldChangelog = readFileSync(path, 'utf8');
227
228 const [beginning, end] = oldChangelog.split(RELEASE_SCRIPT_TOKEN);
229
230 const dateString = new Date().toLocaleDateString('en-us', {
231 year: 'numeric',
232 month: 'long',
233 day: 'numeric',
234 });
235 const header = `---\n\n### ${nextVersion}\n${dateString}`;
236
237 const newChangelog = `${beginning}${RELEASE_SCRIPT_TOKEN}\n\n${header}\n${commitLog}${end}`;
238
239 console.log(chalk.dim(' Updating changelog: ' + CHANGELOG_PATH));
240
241 if (!DRY_RUN) {
242 writeFileSync(path, newChangelog);
243 }
244}
245
246function updateManifestVersions(previousVersion, nextVersion) {
247 MANIFEST_PATHS.forEach(partialPath => {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected