Skip to content

Commit dd8a935

Browse files
committed
Ensure experimental versions don't use Canary release channel
1 parent 3587979 commit dd8a935

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/sync-react.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async function sync(channel = 'next') {
3939
newVersionStr = stdout.trim()
4040
}
4141

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

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

63-
const baseVersionInfo = extractInfoFromReactCanaryVersion(baseVersionStr)
64+
const baseVersionInfo = extractInfoFromReactVersion(baseVersionStr)
6465
if (!baseVersionInfo) {
6566
throw new Error(
6667
'Base react version does not match expected format: ' + baseVersionStr
@@ -175,7 +176,7 @@ function readStringArg(argv, argName) {
175176
return argIndex === -1 ? null : argv[argIndex + 1]
176177
}
177178

178-
function extractInfoFromReactCanaryVersion(reactCanaryVersion) {
179+
function extractInfoFromReactVersion(reactCanaryVersion) {
179180
const match = reactCanaryVersion.match(
180181
/(?<semverVersion>.*)-(?<releaseLabel>.*)-(?<sha>.*)-(?<dateString>.*)$/
181182
)

0 commit comments

Comments
 (0)