How to Contribute
Here are some guidelines we'd like you to follow before submitting a PR.
Pleas use pnpm to install a fork
The repo uses `pnpm`, so using `pnpm` is desiable when you fork and install dependencies to avoid unseen problems.
Frontend pages
Tailwind warns that you don't construct class names dynamically. In stead of this:
<div class="text-{{ error ? 'red' : 'green' }}-600"></div>
Always use complete class names:
<div class="{{ error ? 'text-red-600' : 'text-green-600' }}"></div>
Types and Props
Please add a type to `export`ed variables. When we generate props files, it will automatically pick up types from your file. If you don't add a type, it will break.
Please run the following to update prop files.
npm run gen:props
This script will update/generate files in `src/routes/props`.
Again avoid type inference for `export`ed variables.
Conventional commit
When makimg a commit, we recommend using the Coventional commits.
Some examples are:
feat: add rating component
fix: add if statement to Button component
chore: clean up About page
docs: add timeline page
style: update home page
test: add modal test
When you have a breaking change:
git commit -a "feat: change btnClass name to bClass" -m "BREAKING CHANGE: change the Button component attributes"
Playwright Test
Before submitting a PR, please run a test:
npm run test
A11y Test
I'm in a process of finding the best A11y testing method at the moment. For now, please install [@axe-core/cli](https://www.npmjs.com/package/@axe-core/cli) to test pages relating to your change.
npm install @axe-core/cli -g
Test a page.
axe http://localhost:3000/dropdowns/image