Skip to content

Commit

Permalink
Label React syncs in GitHub
Browse files Browse the repository at this point in the history
by keeping the version in a dedicated file that we can use to label PRs via `labeler.json`.

Makes it easier to search for React syncs in GitHub.

Since PRs are created manually, using the PR title for searching may not work all the time.
There's still a possibility that people don't use the sync script but why would you do that?
Even on manual updates they may stumble over `.react-version` and update it.
  • Loading branch information
eps1lon committed Jul 22, 2024
1 parent eb23134 commit a2fb505
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/labeler.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"packages/next-swc/**",
"packages/next/**",
"packages/react-refresh-utils/**"
]
],
"type: react-sync": [".react-version"]
}
}
1 change: 1 addition & 0 deletions .react-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19.0.0-rc-6230622a1a-20240610
2 changes: 2 additions & 0 deletions scripts/sync-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ Or run this command again without the --no-install flag to do both automatically
)
}

await fsp.writeFile(path.join(cwd, '.react-version'), newVersionStr)

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` +
Expand Down

0 comments on commit a2fb505

Please sign in to comment.