Coder Social home page Coder Social logo

weaselandfox / react-component-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from survivejs/react-component-boilerplate

0.0 2.0 0.0 947 KB

Boilerplate for React.js components (MIT)

Home Page: https://survivejs.github.io/react-component-boilerplate/

License: MIT License

JavaScript 81.73% CSS 8.13% HTML 10.14%

react-component-boilerplate's Introduction

build status bitHound Score Dependency Status

react-component-boilerplate - Boilerplate for React.js components

This is a simple boilerplate that has been developed to make it easier to develop React components and small projects.

Check out SurviveJS - Webpack and React to dig deeper into the topic.

Basic Usage

If you want to replace project meta information (author etc.), consider using a tool like replace-project-meta.

Common Tasks

  • Developing - npm start - Runs the development server at localhost:8080 and use Hot Module Replacement. You can override the default host and port through env (HOST, PORT).
  • Creating a version - npm version <x.y.z> - Updates /dist and package.json with the new version and create a version tag to Git.
  • Publishing a version - npm publish - Pushes a new version to npm and updates the project site.

If you don't want to use universal rendering for the React portion, set RENDER_UNIVERSAL to false at webpack.config.babel.js.

Testing

The test setup is based on Karma/Mocha/Chai/Phantom. Code coverage report is generated through istanbul/isparta to build/.

  • Running tests once - npm test
  • Running tests continuously npm run test:tdd
  • Linting - npm run test:lint - Runs ESLint.

Demo Site

The boilerplate includes a GitHub Pages specific portion for setting up a demo site for the component. The main commands handle with the details for you. Sometimes you might want to generate and deploy it by hand, or just investigate the generated bundle.

  • Building - npm run gh-pages - Builds the demo into ./gh-pages directory.
  • Deploying - npm run deploy-gh-pages - Deploys the contents of ./gh-pages to the gh-pages branch. GitHub will pick this up automatically. Your site will be available through *.github.io/`.
  • Generating stats - npm run stats - Generates stats that can be passed to webpack analyse tool. This is useful for investigating what the build consists of.

Highlighting Demo for the Site

var a = 5;
var b = 10;

// just trying out code highlighting feature here
console.log(a + b);

License

react-component-boilerplate is available under MIT. See LICENSE for more details.

react-component-boilerplate's People

Contributors

bebraw avatar yn5 avatar

Watchers

James Cloos 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.