This project was created as a TypeScript boilerplate for ESM + CJS React components libaries. After build, it exposes each component individually, enabling tree shaking and reducing consumption bundle size.
- TypeScript -> 4.x
- JavaScript Framework -> React
- CSS -> CSS Modules
- Build Library -> Rollup
- Components Preview -> Storybook
- Code Formatting -> Eslint
- Tests -> Jest + RTL
First, make sure to attend to those requirements before running any command:
To run this project's storybook, run the following commands:
yarn
yarn storybook
To build this project using Rollup, run the following commands:
yarn
yarn build
After completion, check dist
folder for builded files. After that, you can run...
yarn publish
...to pubish your package on npm's or yarn's registries. You can also publish on a private registry by using npmPublishRegistry option.
Other useful commands:
yarn test -> # Tests with coverage
yarn test:update -> # Tests updating snapshots
yarn lint -> # Verify code formatting
yarn lint -> # Fix code formatting