- Make sure to update the name of the package inside package.json file to a unique name
- If you want to make updates to your library make sure to update the version inside package.json file
- It allows you to create UI components in isolation.
- It will not be part of your NPM package.
- Documentations link: storybook
- It's a bundler tool similar to webpack but much easier.
- It will not be part of your NPM package.
- Documentations link: rollupjs
- Add your component in components directory
- Add your styles in styles.scss
Note: if you want to create a package with many components inside it make sure to include the required styles file for each one
- Create a new story for your component in stories directory following the instructions on storybook site.
- Run storybook for development:
yarn storybook
- Run yarn build-lib command
- Build your package:
yarn build-lib
- Sign in to your npm account:
npm login
- Publish your package:
npm publish
In the project directory, you can run:
Runs the storybook in development mode
It will open http://localhost:6006 automatically in the browser to see your stories.
- Add and commit your changes to git with commit messages which is used to add the correct package version.
- Pumps the package version using standard-version
Builds the storybook for production.
Builds your npm package using rollup.