Giter Site home page Giter Site logo

react-component-template's Introduction

react-component-template npm

Discord

CircleCI AppVeyor Coverage Dependencies Dev Dependencies

Base for React Components

Reason

Developing and publishing multiple React components requires a lot of work to keep them all at the same code, ops, best-practices level. Most of configs are often copy-pasted. If one project updated, for example, .eslintrc, other projects should follow to keep codebase consistent. Having growing number of components leads to a more diverged codebase that is exponentially harder to manage.

Contents

  • React module boilerplate dependencies and scripts
  • .gitignore and .npmignore
  • CircleCI config
  • ESLint config, strict version of Airbnb code style guide
  • Empty React component
  • Example
  • Tests and coverage (Tape, Isparta)
  • End-to-End tests (Nightwatch, Selenium)

Usage

  1. Install
npm install --save-dev react-component-template
  1. Set npm scripts in package.json and set component name
{
  "config": {
    "component": "ReactComponentTemplate"
  },
  "scripts": {
    "start": "react-component-template",
    "test": "npm start test",
    "precommit": "npm start precommit",
    "prepush": "npm start prepush",
    "postversion": "npm start postversion",
    "prepublish": "npm start prepublish"
  }
}
  1. Create webpack.config.js
'use strict';

module.exports = require('react-component-template/webpack.config');
  1. Create .eslintrc
{
  "extends": "./node_modules/react-component-template/.eslintrc"
}
  1. Other files

There is a react-component-template scaffold generator, install it:

npm install -g cf-react-component-template

and answer some questions, for example:

cf-react-component-template

Your name: Nik Butenko
Your email (will be publicly available, optional): [email protected]
Your GitHub public username: nkbt
Package name: my-awesome-react-lib
Global package name (CamelCased): MyAwesomeReactLib
Package description: My awesome React library

License

MIT

react-component-template's People

Contributors

butenkot avatar dantman avatar forresst avatar greenkeeperio-bot avatar nkbt avatar tribou avatar

Watchers

 avatar  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.