From a4c50b524c3f140523dac65e891189182b7b319f Mon Sep 17 00:00:00 2001 From: eps1lon Date: Wed, 10 Jul 2024 14:17:25 +0200 Subject: [PATCH] Label React syncs in GitHub 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. --- .github/labeler.json | 3 ++- .react-version | 1 + scripts/sync-react.js | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .react-version diff --git a/.github/labeler.json b/.github/labeler.json index 50efeddaa21b5..7344082c8dc30 100644 --- a/.github/labeler.json +++ b/.github/labeler.json @@ -70,6 +70,7 @@ "packages/next-swc/**", "packages/next/**", "packages/react-refresh-utils/**" - ] + ], + "type: react-sync": [".react-version"] } } diff --git a/.react-version b/.react-version new file mode 100644 index 0000000000000..a9870eb754cd3 --- /dev/null +++ b/.react-version @@ -0,0 +1 @@ +19.0.0-rc-a26e3f403e-20240611 \ No newline at end of file diff --git a/scripts/sync-react.js b/scripts/sync-react.js index 011755bbf52af..f57ade32f3a94 100644 --- a/scripts/sync-react.js +++ b/scripts/sync-react.js @@ -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` +