Design system implemented with React. Why? Just as a learning experiment
DTS scaffolds your new library inside /src
, and also sets up a Vite-based playground for it inside /example
.
The recommended workflow is to run DTS in one terminal:
npm start # or yarn start
This builds to /dist
and runs the project in watch mode so any edits you save inside src
causes a rebuild to /dist
.
Then run either Storybook or the example playground:
Run inside another terminal:
yarn storybook
This loads the stories from ./stories
.
NOTE: Stories should reference the components as if using the library, similar to the example playground. This means importing from the root project directory. This has been aliased in the tsconfig and the storybook webpack config as a helper.
Then run the example inside another:
cd example
npm i # or yarn to install dependencies
npm start # or yarn start
The default example imports and live reloads whatever is in /dist
, so if you are seeing an out of date component, make sure DTS is running in watch mode like we recommend above.
To do a one-off build, use npm run build
or yarn build
.
To run tests, use npm test
or yarn test
.