This workspace is managed by pnpm and Lerna. It follows the semantic versioning using conventional commits - all orchestrated by lerna.
Ensure you are on a feature branch. You'd then need to create a pull request for the feature branch to main
. After all the review ceremonies are complete you then proceed with the following steps. ⛔️⛔️⛔️ NOTE: DO NOT MERGE THE PR!!!!!
- In your local repo, checkout to your feature branch
- Ensure your working directory is clean (stash any untracked or uncommitted changes)
- Prepare your changes for release by running;
pnpm release:prepare
If the command above is run successfully, you'd be automatically checkout to the release branch (i.e releases/*
).
- On the release branch, create a PR to
main
by running;
pnpm release:pr
The command above will automatically create a pull request targeting main
from your release branch.
After all review ceremonies on the release pull request are complete, merge to master. ⛔️⛔️⛔️ NOTE: DO UPDATE THE RELEASE BRANCH DIRECTLY. You should update your feature branch instead then star from Step 1.
- Merge your release pull request to main once ready. This will kickstart the release workflow in the CI - which publishes changed packages to npm and creates tagged releases with notes. As a side effect, your feature branch pull request will be automatically closed.
- After the release workflow is successful, confirm your release and published packages on npm.
Storybook test-runner is setup as the visual regression tool to capture snapshots and compare them based on set thresholds. Under the hood, @storybook/test-runner uses playwright and jest.
Install playwright supported browsers
pnpx playwright install
To run the tests, you'd need to have storybook running locally. For example
pnpm --filter @mbao01/common dev
then run the visual regression tests
pnpm --filter @mbao01/common test:visual
You could also run the tests in watch mode
pnpm --filter @mbao01/common test:visual:watch