- Fork this repository to your GitHub account and then clone it to your local machine
- Create a new branch:
git checkout -b MY_BRANCH_NAME
- Install yarn:
npm install -g yarn
- Install dependencies:
yarn
- To build and watch for code changes in development:
yarn start
- Add and commit your changes
- Create a changeset:
yarn changeset
- Commit generated changeset file
- Push your branch and create a pull request against
main
branch
A changeset is a piece of information about changes made in a commit or branch. Before creating a pull request:
- Run
yarn changeset
- Select the packages you want to include in the changeset using ↑ and ↓ to navigate to packages, and space to select a package. Hit enter when all desired packages are selected. If no package is selected, a blank changeset will be created (e.g: use a blank changeset when changing/adding
examples/
or changes outside ofpackages/*
) - You will be prompted to select a bump type for each selected package. Select an appropriate bump type for the changes made
major
version when you make incompatible API changes,minor
version when you add functionality in a backwards compatible manner, andpatch
version when you make backwards compatible bug fixesSee here for more information on semver versioning
- Your final prompt will be to provide a message to go alongside the changeset. This will be written into the changelog when the next release occurs. A good idea of what should be in a changeset is:
- WHAT the change is
- WHY the change was made
- HOW a consumer should update their code
- A new changeset file, written in Markdown, will be added to
.changeset/[UNIQUE_ID].md
- the message you have typed can be found here. You can edit this file and add additional information or bump type of any package - Once you're happy with the changeset commit this file to your branch
See here for more information about adding a changeset in a monorepo.
See changeset template in CHANGESET-TEMPLATE.md
- Review pull request
- Merge pull request against
main
branch - A GitHub workflow will run and do automatic versioning from changesets and open a special pull request with title
Version Packages
- If a pull request
Version Packages
already exists (is open), then new changes are automatically combined into the existing PR so you can continue to review and merge other pull requests
- If a pull request
- Once you feel comfortable to make a release, merge
Version Packages
pull request againstmain
- A GitHub workflow will run to:
- Automatically publish packages to the npm registry
- Create a GitHub release with a changelog of all changes, and link changes to commits
nvm use
- (ifnvm
is installed) switch to the current recommended version of Node.jsyarn
- installs dependencies and builds all packagesyarn start
- build all packages and watch for changesyarn build
- build all packagesyarn docs
- build all packages documentationyarn lint
- lint eslint errors and TypeScript errors in all packagesyarn lint:ts
- lint only TypeScript errors in all packagesyarn lint:eslint
- lint only eslint errors in all packagesyarn lint:eslint:fix
- fix all possible eslint errors in all packages or lint errors that can't be auto-fixedyarn changeset
- open interactive CLI to create changesetsyarn changeset:code
- open interactive CLI to create changesets (sets external editor tovscode
to compose message)yarn changeset:empty
- creates an empty changeset with no packages selected (manually edit the generated changeset message)yarn changeset:status
- provide information about all changesetsyarn pkg:version
- (DO NOT RUN) does automatic versioning (run by GitHub workflow)yarn pkg:release
- (DO NOT RUN) publishes packages to the npm registry (run by GitHub workflow)