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 10, 2024
1 parent 801d7c7 commit a4c50b5
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 @@ -70,6 +70,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-a26e3f403e-20240611
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 a4c50b5

Please sign in to comment.