# install
npm i --legacy-peer-deps
# run development env
npm run dev
# build
npm run build
# lint
npm run lint
# test (storybook must be running)
npm run test
# generate new custom-elements.json (updates storybook docs/args)
npm run analyze
# format all files with prettier
npm run format
- Commits
- Commit messages MUST use Conventional Commit format.
- Certain commit types like
fix:
(patch),feat:
(minor), andperf:
(major) orBREAKING CHANGE:
(in the commit body or footer, major), will automatically trigger a release to publish a new package and update the semantic version. - Conventional Commits Cheat Sheet
- Git hooks are installed to enforce commit message formatting with commitlint, and code formatting with Prettier.
- Branching
main
branch is for stable/current version changes.beta
branch is for future version/prerelease/breaking changes.- Prefix your branch names based on the type of change, ex
feature/
,bugfix/
, orhotfix/
. - Use the GitHub Flow.
- Code Review
- Always have someone peer review your PR.
- Status checks must pass.
- Strongly recommend using the Prettier extension to ensure consistent formatting.
- Releases
- Releases will trigger automatically when the right commit messages are pushed to
main
orbeta
. - All testing must be done on the PR level before merging, since the release will happen automatically after merge.
- Releases will trigger automatically when the right commit messages are pushed to
- Creating Components
- Components should be contained within their own folder containing
ts
,scss
, andstories
files. Sub-components can share the same folder. - Add new components to the root
index.ts
file. - Everything in the design system should be 100% generic. Remember that these components could be used to build any application. Application concerns must be separated.
- Use Lit directives and decorators whenever possible.
- Build responsive, build clean, focus on style and performance, enhance with quick and smooth animations.
- Components should be contained within their own folder containing
- Documentation
- Document everything in your components with JSDoc.
- Update the
custom-elements.json
file with thenpm run analyze
script any time you add or change documentation. This is where the Storybook args tables are derived from. - Write your storybook stories with controls enabled for every property where possible.
- When building modular components with sub-components, write multiple stories to show different variations. Include any sub-components in the main story so it renders a new tab with an args table.
- Testing
- We use @storybook/test to execute a variety of automated tests.
- The Test Runner is used to execute Accessibility and Interaction tests both locally and in CI.
- Accessibility Tests
- Interaction Tests
- Interaction Test writing strategy TBD
- Visual Testing via Chromatic
- Provides visual screenshot comparison testing and a review process which integrates with our CI.
- We use @storybook/test to execute a variety of automated tests.