Giter Site home page Giter Site logo

adamchenwei / react-component-library-lerna Goto Github PK

View Code? Open in Web Editor NEW

This project forked from natterstefan/react-component-library-lerna

0.0 1.0 0.0 820 KB

Build your own React component library managed with lerna, presented with storybook and published in private npm registry.

License: Apache License 2.0

JavaScript 99.11% HTML 0.89%

react-component-library-lerna's Introduction

React Component Library with Lerna

Dependencies DevDependencies Known Vulnerabilities GitHub license PRs Welcome

Build your own React component library managed with lerna and presented with storybook.

Features

Getting started

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.

Docs

Please, be patient. I will soon add "How to" sections. They are going to tell you:

  • how to use this example component library for your own projects,
  • some things I learned about lerna and monorepos (eg. yarn workspaces are pretty neat),
  • how to use storybook (eg. creating stories, ...),
  • how to publish packages to your private npm registry (eg. with verdaccio),
  • and finally how to create a docker image with an example app.

Stay tuned!

How to add new dependencies

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.

How to test publishing

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.

Contribution

PRs are welcome and I am happy if you want to contribute! Just let me know, please.

Forks

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.

Licence

Apache 2.0

Maintainers


Stefan Natter

react-component-library-lerna's People

Contributors

natterstefan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.