• Stars
    star
    602
  • Rank 74,409 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 7 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React NPM library starter kit based on Facebook's create react app

Create React Library npm PRs Welcome

Create React NPM Library with no build configuration, based on Facebook's Create React App. We are constantly updating the repository with the updates of create-react-app, so we have all new features and bug fixes of it.

Quick Overview

npx @udilia/create-react-library my-lib
cd my-lib
npm start

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

Then open http://localhost:3000 to see demo library running in the browser.

Creating a Library

You’ll need to have Node 8.16.0 or Node 10.16.0 or later version on your local development machine.

To create a new library, you may choose one of the following methods:

npx

npx @udilia/create-react-library my-lib

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

npm

npm init @udilia/react-library my-lib

npm init <initializer> is available in npm 6+

Yarn

yarn create @udilia/react-library my-lib

yarn create is available in Yarn 0.25+

It will create a directory called my-lib inside the current folder. Inside that directory, it will generate the initial project structure and install dependencies.

my-lib
├── config
├── node_modules
├── public
├── scripts
├── src
    ├── demo
    ├── lib
├── .gitignore
├── package.json
├── README.md

All library files are located inside src/lib folder.

Inside src/demo folder, you can test your library while developing.

Once the installation is done, you can open your project folder:

cd my-lib

Inside the newly created project, you can run some built-in commands:

npm start or yarn start

Runs the library in development mode. Open http://localhost:3000 to view it in the browser.

npm run test or yarn run test

Runs the test watcher in an interactive mode.

npm run build or yarn build

Builds the library for production to the build folder. It correctly bundles React in production mode and optimizes the build for the best performance.

npm publish

Publishes the library to NPM.

Contributing

Please read our CONTRIBUTING.md before submitting a Pull Request to the project.

Typescript

Adding Typescript support

Troubleshooting

Usage of other libraries within your library

  • Add the library as a peer dependency in package.json (effectively requiring the calling project to provide this dependency)
  • Add the library as a dev dependency in package.json (effectively allowing this library to successfully build without complaining about not having this dependency)
  • Add the library to the externals config in your webpack.config file(s). By default, only react and react-dom are there, meaning that those are the only two libraries that you can use within your new shared library.

Example libraries built with Create React Library

https://github.com/DimiMikadze/react-under-construction

License

MIT License Copyright (c) 2019 Dimi Mikadze

More Repositories

1

orca

Build modern community apps with React and Node.
TypeScript
1,220
star
2

laravel-angular-cms

CMS built on Laravel, AngularJS and Material Design
JavaScript
269
star
3

fest

SaaS boilerplate built with Node.js & React.
TypeScript
208
star
4

express-react-redux-starter

Starter for Express, React, Redux, SCSS applications
JavaScript
198
star
5

node-redux-auth

Token authentication system using Node, Mongo, React, Redux
JavaScript
181
star
6

firebase-react-native-redux-starter

Starter For Firebase, React Native, Redux Applications With 100% Of Code In Common Between IOS And Android, with built In Authentication, Crud Example And Form Validation.
JavaScript
169
star
7

Mean-Blog

Blog using Nodejs, Expressjs, Angularjs and Mongodb. MEAN Javascript Fullstack application
JavaScript
164
star
8

react-native-game

IOS and Android mobile app "Guess famous people" built with React Native
JavaScript
132
star
9

lumen-angular-todo

Laravel lumen and AngularJS Todo Application
CSS
42
star
10

vanilla-slideshow

Vanilla Javascript CSS3 Responsive Fullscreen Slideshow
JavaScript
41
star
11

vanilla-helpers

Vanilla Javascript Helper Functions, Ajax, Effects, DOM manipulation, Styles, Utilities
JavaScript
34
star
12

es6-node-starter

ES6/7 Node starter kit with built in Rest API authentication
JavaScript
27
star
13

focused

A Google Chrome extension that will improve your focus and increase productivity by blocking distracting websites while working or studying.
TypeScript
26
star
14

react-under-construction

An easily customisable, responsive under construction react page component
JavaScript
24
star
15

sass-useful-mixins

Sass useful mixins Media Queries, Font-size, Transition, Opacity, Background image, Font face, place holder, vertical align
CSS
8
star
16

es6-simple-starterkit

Simple to understand and use ES6 Starter Kit
JavaScript
8
star
17

isomorphic-react-webapp

Shared JavaScript Web Application that runs on both the client & server using React and Node/Express.
CSS
7
star
18

orca-docs

Orca documentation website.
JavaScript
2
star
19

resume

1
star
20

eleven-symbols-website

CSS
1
star
21

create-social-network-old

Open-source software for building social networks.
JavaScript
1
star