create-common-library v1.0.6
create-common-library
CLI for creating reusable, modern common libraries using create-react-library, react-styleguidist or storybook.
The create-common-library library exported as Nodejs module.
Installation
Using npm:
npm i -g create-common-libraryUsing yarn:
yarn global add create-common-libraryUsage
default:
create-common-libraryspecify options from the command line:
create-common-library --name=newLibrary --template=storybookDocumentation
Name
The name expected for your common library
Templates
create-react-library: the logic is based on create-react-library
react-styleguildist: the logic is based on react-styleguildist
storybook: the logic is based on storybook
Development
create-react-library and react-styleguildist
Local development is broken into two parts (ideally using two tabs).
First, run rollup to watch your src/ module and automatically recompile it into dist/ whenever you make changes.
yarn start # runs rollup with watch flagThe second part will be running the example/ create-react-app that's linked to the local version of your module.
# (in another tab)
cd example
yarn install
yarn start # runs create-react-app dev serverNow, anytime you make a change to your library in src/ or to the example app's example/src, create-react-app will live-reload your local dev server so you can iterate on your component in real-time.
storybook:
Following the detailed Storybook document: https://storybook.js.org/
Example
Select template
Select project name
Watch your library in /src