Thanks for taking the time to contribute! 🎉
This monorepo uses Lerna as a task runner, Changesets to manage the versioning and releases and Yarn Classic as the package manager to handle dependencies.
All packages inside the packages folder are being tracked and need to follow the versioning and release process described below.
Packages and files that are outside the packages
folder are not
being tracked and warnings that the Changesets bot
will generate on your Pull Request can be safely ignored.
Whenever you add a new package or make changes to an existing one, you need to follow the steps below to ensure that the changes are properly versioned and released.
Important
You don't need to manually update the versions of each package
inside the packages
folder, the Changesets CLI will take care
of that for you.
To create snapshot releases on Pull Requests, you need to:
- Commit your changes.
- Run the Changesets CLI to bump the version of the package you're working on
yarn changeset
This will trigger a interactive flow to select if the changes you're doing are
considered patch
, minor
, major
changes and then it will ask you for
a summary of these changes. This summary will be included in the next github
release if merged.
- Commit the new file that was generated under the
.changeset
folder. - Push your changes to the feature branch you're working on.
- Add the
snapshot
label to the pull request. If you don't add a changeset file the triggered action will fail. - Wait for the action to add a comment with a link to your most recent snapshot.
This will publish a package-name@preview-shortsha-timestamp
package; without
creating tags nor releases. Also this won't touch the latest
tag on NPM.
The Changesets workflow to release packages work as follows:
- You open a Pull Request.
- Include a changeset summary and commit the generated file under the
.changeset
folder to your feature branch.
yarn changeset
This will trigger a interactive flow to select if the changes you're doing are
considered patch
, minor
, major
changes and then it will ask you for a summary
of these changes. This summary will be included in the next github release if merged.
- Your Pull Request gets merged to
main
. - A new Pull Request is opened by the Changesets action to consolidate all changes that will be included in the next release.
- Once it's time to create the new release, merge the Pull Request created by the
changeset github action on step 4. This merge will trigger the Changesets action
again and will:
- Create a new tag for each package that has a version bump.
- Create a new Github Release including the packages that have a version bump.
- Push the packages to NPM and mark each of them as "latest".
- Lerna Documentation: https://lerna.js.org/docs/introduction
- Changesets Documentation: https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md