Build your own React component library managed with lerna, presented with storybook and published in private npm registry.
Build your own React component library managed with lerna and presented with storybook.
yarn commander --help
)Use yarn
instead of npm
, because we rely on yarn
's workspaces
feature.
yarn
yarn bootstrap
yarn start
Now you can open storybook at http://localhost:9001.
Please, be patient. I will soon add "How to" sections. They are going to tell you:
Stay tuned!
Adding devDependencies
looks like this:
yarn add <package-name> --dev -W
This will add the dependency too the root package.json
and make it available
to all packages.
Adding a new dependency
for all or one of the packages looks like this:
npx lerna add <package-name>
One can read more about the command (eg. how to scope it, etc.) here.
This repository comes with a pre-configured verdaccio (private npm registry) setup. All you need to do is start it with:
cd localdev
docker-compose -d # will start the verdaccio docker image
Now, open http://localhost:4873/. You should see
the UI of verdaccio on your screen now. That's great. Because it means you can
now publish the packages to this npm registry. Usually you have to login to
the registry, but the .npmrc already includes the _authToken
. So
yarn publish
in one of the packages will publish it, or with yarn publish
in
the root folder (uses lerna).
In order to publish your packages to npm, simply change the registry
property
in each package.json
's publishConfig
.
PRs are welcome and I am happy if you want to contribute! Just let me know, please.
If this repository is forked and I see further progress on the forked repo, I am very happy to list your work here. It's awesome to see, when people start using and moving this repository even further.
Stefan Natter |