lake
lake copied to clipboard
Swan's design system and utils
Swan Lake
Swan's component kit
Getting started
First, install yarn.
Clone
$ git clone [email protected]:swan-io/lake.git
Install
$ yarn
Editor
We recommend the following setup for an optimal developer experience:
By default, the VS Code TypeScript extension only checks the types in open files. If you want your IDE to check types in the whole project, check typescript.tsserver.experimental.enableProjectDiagnostics
in your VS Code preferences.
For better performance (and confort!), it's recommended to set:
-
eslint.run
to"onSave"
.
Linting
$ yarn lint
You can also configure lint-staged
as a pre-commit hook by running the following command :
$ yarn configure-hooks
Generate Fluent icons
Add the name of the desired icon in scripts/fluent-icons/icons.json
using the format icon-name-{filled|regular}
, and run the following command:
$ yarn icons
And you'll be able to use your icon using the <Icon />
component using the name you specified!
Testing
$ yarn test
We generally collocate test files next to their implementation, in a __tests__
directory, with the tested file name suffixed with .test
:
> utils
> __tests__
> myFile.test.tsx
> myFile.tsx
We use Vitest and React Testing Library.
Releasing
- Run
yarn release
, select next version increment. - Copy the PR url, make it approved and merge it.
- A Github release will automatically be created by the CI.