Giter Site home page Giter Site logo

glarivie / react-components-library-starter-kit Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 1.0 376 KB

Boilerplate to building a React components library for NPM

License: MIT License

JavaScript 97.03% CSS 2.97%
react boilterplate stater-kit babel webpack npm-package

react-components-library-starter-kit's Introduction

React-Components-Library-Starter-Kit

Boilerplate to building a React components library for NPM

How to start ?

Setup you development environement

git clone [email protected]:hqro/React-Components-Library-Starter-Kit.git
cd React-Components-Library-Starter-Kit
yarn install

Rename project and initialize your git repository

cd ..
mv React-Components-Library-Starter-Kit my-components-library
cd my-components-library
rm -Rvf .git
git init
git remote add ...

Don't forget to edit the package.json. Add your dependencies and customize name, description and author.

How to use ?

yarn start

webpack now wath for file changes in src/components folder. Each time you add a new component, it will compile your source files again. Don't forget to export your components on index.js file.

How to test ?

yarn link

This command is run in the package folder you’d like to link. Then initialize a new react project with create-react-app for example

cd ..
create-react-app Demo
cd Demo
yarn link my-components-library

Then go to you React project and try to import your components.

import React from 'react'
import { Button } from 'my-components-library'

const App = () => (
  <div className="App">
    <Button label="Awesome button" onClick={() => console.log('click')} />
  </div>
)

How to build for production ?

yarn build
yarn login
yarn publish --access=public

You need a NPM account to publish your package

react-components-library-starter-kit's People

Contributors

hqro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

g-ray

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.