This is a boilerplate project for writing React NPM modules (or component libraries) in TypeScript + Storybook.
This boilderplate includes a Storybook to visualize and demonstrate your components.
- TypeScript with automatic linting via ESLint + Prettier
- Unit testing with Jest + @testing-library/react
- Storybook + hot reloading, including the addons Actions, Knobs, Storysource, Notes, Viewport, Console, and Centered.
- Fork or clone this repository
- If using VS Code, install recommended extensions
npm install
npm run start:storybook
- Create your components
- Export your components in
index.ts
npm build
To build your React components befor deploying to NPM.npm publish
Publish your module.
To do...
test
- run unit teststest:cover
- run unit tests with test coveragelint
- checkeslint
andprettier
ruleslint:fix
- autofix unmeteslint
andprettier
rulesstart:storybook
- start the storybook server and automatically open in browserbuild
- for deploymentbuild:storybook
- run this command to build your storybooknpm publish
- run this command to publish your packages to npm
Before each commit, husky
and lint-staged
will automatically lint your staged ts, tsx, js, jsx
files.
I recommend enabling Dependabot on this repository to keep your dependencies up to date. Each dependency update will be created as a PR, which will automatically validate via Circle CI and you can manually validate via Zeit.
This code is released under the MIT license - feel free to use it.
Please contribute any improvements or fixes to this project!
To make sure you have a pleasant experience, please read the code of conduct. It outlines core values and beliefs and will make working together a happier experience.