Skip to content

Commit

Permalink
Add hint that sync-react doesn't automate everything
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jun 4, 2024
1 parent 4c1d6e6 commit 79b0e33
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions scripts/sync-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ Or, run this command with no arguments to use the most recently published versio
console.log()
}

console.log(`Successfully updated React from ${baseSha} to ${newSha}.\n`)

// Fetch the changelog from GitHub and print it to the console.
try {
const changelog = await getChangelogFromGitHub(baseSha, newSha)
Expand Down Expand Up @@ -178,6 +176,13 @@ Or run this command again without the --no-install flag to do both automatically
`
)
}

console.log(
`Successfully updated React from ${baseSha} to ${newSha}.\n` +
`Don't forget to find & replace all references to the React version '${baseVersionStr}' with '${newVersionStr}':\n` +
`-${baseVersionStr}\n` +
`+${newVersionStr}\n`
)
}

function readBoolArg(argv, argName) {
Expand All @@ -189,8 +194,8 @@ function readStringArg(argv, argName) {
return argIndex === -1 ? null : argv[argIndex + 1]
}

function extractInfoFromReactVersion(reactCanaryVersion) {
const match = reactCanaryVersion.match(
function extractInfoFromReactVersion(reactVersion) {
const match = reactVersion.match(
/(?<semverVersion>.*)-(?<releaseLabel>.*)-(?<sha>.*)-(?<dateString>.*)$/
)
return match ? match.groups : null
Expand Down Expand Up @@ -251,8 +256,8 @@ async function getChangelogFromGitHub(baseSha, newSha) {
return changelog.length > 0 ? changelog.join('\n') : null
}

sync('rc')
.then(() => sync('experimental'))
sync('experimental')
.then(() => sync('rc'))
.catch((error) => {
console.error(error)
process.exit(1)
Expand Down

0 comments on commit 79b0e33

Please sign in to comment.