We welcome contributions form everyone. Please use our GitHub issue tracker for questions, ideas, bug reports, or feature requests.
If you want to make a pull request:
- discuss your idea first, before putting in a lot of effort
- refer to the developer documentation
- if needed, fork the repository to your own Github profile
- work on your own feature branch
- make sure the existing tests still work and add new tests (if necessary)
- update or expand the documentation;
- make sure your code follows the style guidelines
- don't be afraid to ask help with any of the above steps. We're happy to help!
By participating in this project, you agree to abide by the code of conduct.
We use ladle to develop components. To start the development server run:
pnpm dev
To lint use
pnpm lint
To check types with Typescript use
pnpm typecheck
To format use
pnpm format
Testing logic can be done with tests written with vitest in browser mode.
pnpm exec playwright install # Only needed once per installation
pnpm test
# Or to run headless
CI=1 pnpm test
# Or for coverage
CI=1 pnpm test -- run --coverage --coverage.reporter=html
# Open coverage/index.html in browser
Stories and tests can be located next to the code in the src/
folder.
If stories needs reusable helper code that should not be part of the package, then it can be placed in the stories/
folder.
The stories can be tested using Visual Snapshots with
pnpm run docs
pnpm preview
# In another shell
pnpm playwright test stories/snapshot.spec.ts
(A new story will fail initially, but after snapshot (stories/snapshot.spec.ts-snapshots/*.png) is created it will pass.) (A updated component or story will fail, but after you update the snapshot it will pass.)
Note: The visual snapshots are different between machines, tests will mostly fail if not run on the same machine as where expected snapshots where made.
pnpm build
Writes js, dts, sourcemap and declaration map files to dist/
folder and regenerates exports in package.json
file.
For component stories & api documentation
pnpm run docs
Writes to docs/
folder, which can be hosted on GitHub pages.
The site can be previewed with pnpm preview
.
- Set new semantic version in package.json
- Create an new GitHub release. The package will be published to npm using a GitHub action.