Skip to content

Commit

Permalink
Ensure experimental versions don't use Canary release channel
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Apr 19, 2024
1 parent 3587979 commit dd8a935
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/sync-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function sync(channel = 'next') {
newVersionStr = stdout.trim()
}

const newVersionInfo = extractInfoFromReactCanaryVersion(newVersionStr)
const newVersionInfo = extractInfoFromReactVersion(newVersionStr)
if (!newVersionInfo) {
throw new Error(
`New react version does not match expected format: ${newVersionStr}
Expand All @@ -50,6 +50,7 @@ Or, run this command with no arguments to use the most recently published versio
`
)
}
newVersionInfo.releaseLabel = channel

const cwd = process.cwd()
const pkgJson = JSON.parse(
Expand All @@ -60,7 +61,7 @@ Or, run this command with no arguments to use the most recently published versio
useExperimental ? 'react-experimental-builtin' : 'react-builtin'
].replace(/^npm:react@/, '')

const baseVersionInfo = extractInfoFromReactCanaryVersion(baseVersionStr)
const baseVersionInfo = extractInfoFromReactVersion(baseVersionStr)
if (!baseVersionInfo) {
throw new Error(
'Base react version does not match expected format: ' + baseVersionStr
Expand Down Expand Up @@ -175,7 +176,7 @@ function readStringArg(argv, argName) {
return argIndex === -1 ? null : argv[argIndex + 1]
}

function extractInfoFromReactCanaryVersion(reactCanaryVersion) {
function extractInfoFromReactVersion(reactCanaryVersion) {
const match = reactCanaryVersion.match(
/(?<semverVersion>.*)-(?<releaseLabel>.*)-(?<sha>.*)-(?<dateString>.*)$/
)
Expand Down

0 comments on commit dd8a935

Please sign in to comment.