Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update release script * Move from `ts-node` to its modern alternative `tsx` These changes do not affect our current release process. They make it easier to perform the existing package release sequence. Do mind though that the script reports release tag name as `react-v0.6.x` instead of the old format `v0.6.x-react`. The release pipeline still expects the latter version, I just haven't made that change yet. I moved the package discriminator to suffix position so that pre-release versions of packages have cleaner tags, e.g. `react-1.2.3-nightly.4`. ### Excerpt from `release.ts` This script's purpose is to automate the process of publishing a branch containing new version of a package to the remote repository. It was written with the goal to maintain a good balance of code brevity, features, and resilience to errors. If you had to perform the release manually, you would have to successfully execute the following steps. * Create a release branch or merge code into an already existing one * Edit `CHANGELOG.md` to update the release title * Bump `"version"` field in `package.json` * Commit the changes * Push release branch to remote repository The steps above, except for editing the changelog, could be performed with following commands. ```console $ git switch -c release/1.2.x <edit CHANGELOG.md> $ npm version minor $ git commit -m "Release [email protected]" package.json CHANGELOG.md $ git push origin HEAD ``` That's not a lot. But to account for various (valid and invalid) local repository states, we need to perform additional checks and actions so that the desirable result is achieved more consistently and problems are detected and reported preemptively. When extending this script, please maintain a couple of core design guidelines. * Seek confirmation from the user before making changes to existing repository state. Changes in branches that this script has just created are exempt because there's no chance of messing up user's repository. * Report all observable repository state changes (file writes, commits, branch operations, etc.) * Use `throw new RuntimeError(message)` to report error and terminate script with non-zero status code
- Loading branch information