- Clone the Git repository
- Install the dependencies
- Run Storybook
- ???
- Profit!
$ git clone [email protected]:Frontify/arcade.git
$ npm ci
$ npm run storybook
$ echo "YAY ✨"
When adding a new component to arcade this is the flow that is applied.
- Create new branch
- Create component files, write tests, write stories & fiddle with React
- Open PR
- Squash
Create a new branch for your additions
git checkout -b feat/add-cool-cats-and-kittens
The name of the branch is not really relevant. Nonetheless we usually go for a prefix following Conventional Commits, slash as a separator and a short description of what the branch will change in kebab-case.
Theres a nifty script that creates that files you'll need:
npm run component:create CoolCatsAndKittens
This will add a folder inside src/components
with the name CoolCatsAndKittens
and three files:
CoolCatsAndKittens.tsx
which is where your React magic happens 🧙♀️CoolCatsAndKittens.spec.tsx
is the place to write your tests 🔬CoolCatsAndKittens.stories.tsx
is for your Stories inside Storybook 📄
Once you're happy with your new component, it's time to open a new PR. Push your branch to GitHub as a start:
git push -u origin feat/cool-cats-and-kittens
and click the link provided by the git CLI.
The Pull Requests basically follow Conventional Commits.
The name of your PR should be:
<type>[optional scope]: <description>
Following the example from above, it would look like this:
feat: Add CoolCatsAndKittens Component
Breaking Changes can be declared with a exclamation mark (!) after the type.
- GitHub automatically deploys Storybook with your new changes to Netlify and adds a Preview link to the PR.
- SonarCloud checks the code base for its quality.
- Cypress tests are run to make sure, you're not breaking anything.
Make sure you choose "Squash and merge" when merging the PR into the main
branch.
You can find more about that here.