This repo uses changesets to determine what packages need a version bump.
Each PR MUST be accompanied by a changeset unless it has zero impact on package consumers (i.e. changing GitHub Action workflows).
To create a changeset run:
$ changeset add
# or
$ yarn cs
This will bring up an interactive console that asks which packages are affected and if they require a patch, minor, or major update.
Based on semantic versioning best practices,g iven a version number
MAJOR.MINOR.PATCH
, increment the:
MAJOR
version when you make incompatible API changesMINOR
version when you add functionality in a backward compatible mannerPATCH
version when you make backward compatible bug fixes
Additional labels for pre-release and build metadata are available as extensions to the
MAJOR.MINOR.PATCH
format.
The release.yaml
workflow will create a PR called
"Version Packages", each time a PR is merged to master with changeset files this PR will be rebased and updated to show what the published versions would be. Merging this PR will build and publish packages to NPM,
and publish GitHub release notes.
When it's time to release NPM packages run:
$ changeset version
This will look through the changeset files that have been generated since the last release and bump package versions automatically.
To publish the relevant NPM packages run:
$ changeset publish
Afterwards, push git tags to GitHub:
$ git push --follow-tags
Tip
For detailed steps read beta-mode.sh
.
-
Run
yarn beta-enter
This will enter the "pre mode" of changesets, create a
prerelease/beta
branch, and push it toorigin
(GitHub).Anytime a commit is pushed to
prerelease/..
GitHub will open a "Version Packages (Beta)" PR. You can merge this PR and packages will be published as specified in the branch (should be beta). -
If you need to release another beta make a changeset and commit it up.
-
When done run
yarn beta-exit
This will exit changeset pre mode. Push up. -
Now you can open a PR with your
prerelease/..
branch againstmain
.
Changesets has two strategies for pre release versions.
The first is to enter pre
mode on changesets.
$ yarn changeset pre enter beta
$ yarn changeset version
$ git add .
$ git commit -m "Enter prerelease mode and version packages"
$ yarn changeset publish
$ git push --follow-tags
The other is to append --snapshot
, which is great for daily releases.
$ yarn changeset version --snapshot canary
$ yarn changeset publish --no-git-tag --snapshot