Wanda's design system monorepo is built on top of a modern toolchain composed by Turborepo, NPM Workspaces, Changeset, and GitHub Actions.
To work on this project you have to know how a monorepo works and how to use the above mentioned tools to being able to introduce features, fixes and changes.
Worspaces are areas defined within the repository which are considered as isolated scopes where to put your packages and apps.
In this project there are 2 defined workspaces:
packages
Where live all the NPM packages like, tokens, themes, components...apps
Where live all the web applications/websites related to Wanda. Like the documentation website.To being able to start the project you have to follow the following steps and install all the required tools.
After you cloned the repository, run npm i
from the project root. You'will install all the required dependencies.
Environment variables are handled by Doppler. Proceed as follow to configure and get env variables:
- Install Doppler CLI and
gnupg
by following the doc - Login to Doppler website by using the shared
design
credential. - Login to doppler cli from terminal, by running
doppler login
. More info - From the project root, go inside
/apps/docs
and rundoppler setup
, on requested, select thedev
environment ofwanda
project. - Go back to the project root and follow the next section.
npm run start
Running this command from the project root will execute all the start
scripts inside workspaces. Currently only react-components and docs packages have a start
script.
Once you run the command both react-components
and docs
should start in development mode.
If you're working with graphql
queries you may need to run codegen:watch
in a separated terminal to watch and rebuild queries on file changes.
npm run build
Running this command from the project root will execute all the build
scripts inside workspaces. It will build all the packages
and apps
at the same time, using the power of Turborepo to build only the changed elements.
npm run test
This command will run all the test
scripts inside workspaces.
Warning Is required to sign every commits pushed to the repo in order to merge PRs and release.
We rely on Changeset to generate changelogs and release notes across all workspaces. You can check the whole documentation to learn how to create and ship changes. Here you can find some basic commands:
npx changeset
npx changeset pre enter next
Start a new prerelease channel called next
. All npm run change
commands run after this will be released as package-name@version-next
.
npx changeset pre exit
Exit from the current prerelease channel and make all future changes released inside the main channel.
To release the packages the only thing to do is to merge the release pull request opened by changeset workflow, created after pushing/merging changes
on the main
branch.
To release the documentation website you can either use the Github CLI or trigger the workflow from GithHub
If you have the github-cli
installed you can just run this command gh workflow run "production"