Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Ensure experimental versions don't use Canary release channel
  • Loading branch information
eps1lon committed Apr 24, 2024
commit 0e9134c7a6aece6a24937594b6ef69e8ed9b8c06
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise the script made react-experimental-builtin point to the Canary release 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