From e5696d3372d8d2435efe1e9f77c552966137d6c5 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 b3ca8c633db52..7c9e20c0524ca 100644 --- a/.github/labeler.json +++ b/.github/labeler.json @@ -71,6 +71,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..2de43dcf77c1f --- /dev/null +++ b/.react-version @@ -0,0 +1 @@ +19.0.0-rc-6230622a1a-20240610 \ 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` +