Add script to automate updating vendored React version (#46663)
Since we intend to update our vendored copy of React frequently, I wrote a script to automate the steps. Basic usage (defaults to most recent React canary version): ```sh pnpm run sync-react ``` Specify a canary version: ```sh pnpm run sync-react --version 18.3.0-next-41110021f-20230301 ``` Update package.json but skip installing the dependencies automatically: ```sh pnpm run sync-react --no-install ``` At the end it will print out a changelog so you can copy/paste it into the PR description. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: --> ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] [e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm build && pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
Showing
| ... | ... | @@ -48,7 +48,8 @@ |
| "debug": "cross-env NEXT_TELEMETRY_DISABLED=1 node --inspect packages/next/dist/bin/next", | ||
| "postinstall": "git config feature.manyFiles true && node scripts/install-native.mjs", | ||
| "version": "npx pnpm@7.24.3 install && IS_PUBLISH=yes ./scripts/check-pre-compiled.sh && git add .", | ||
| "prepare": "husky install" | ||
| "prepare": "husky install", | ||
| "sync-react": "node ./scripts/sync-react.js" | ||
| }, | ||
| "devDependencies": { | ||
| "@babel/core": "7.18.0", | ||
| ... | ... |
scripts/sync-react.js
0 → 100644
Please
register
or
sign in
to comment