GithubHelp home page GithubHelp logo

alex-react / generator-react-component Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jedwatson/generator-react-component

0.0 2.0 0.0 193 KB

React Component Project Generator

License: MIT License

JavaScript 79.97% HTML 9.33% CSS 10.71%

generator-react-component's Introduction

generator-react-component

Yeoman generator for React Components

Builds a React Component project with useful gulp tasks for development, build and publishing.

See react-component-gulp-tasks for documentation on how to use the gulp tasks.

Getting Started

Install the generator:

npm install -g generator-react-component

Then run the generator:

yo react-component

... and follow the prompts.

How to develop your component

Source

Your component source code is in src. You can use JSX and ES6 syntax freely in your component source; it will be transpiled to lib with Babel before being published to npm so that your users will simply be able to include it.

It's a great idea to add a description, documentation and other information to your README.md file, to help people who are interested in using your component.

Example & Preview

Preview your component with LiveReload:

npm start

A webserver will be started on localhost:8000 running the examples in example/src.

You can use this playpen to test your component, and then publish it as live examples to GitHub Pages, which is a great way to let potential users try out your component and see what it can do.

Lint your code!

npm run lint

Your code will be linted with ESLint, using the Babel parser and the React plugin. You can customise the settings by editing the .eslintrc file.

Build and Publish

npm run build

This will build your lib, dist and example/dist folders ready for release.

You can then publish your component to npm and GitHub Pages by running:

npm run release

Other npm scripts

examples

Just run the examples server; no code will be built or watched, everything in example/dist will be served on localhost:8000.

publish:site

Usually run as part of the release script, this will copy the contents of example/dist to your gh-pages branch and push it.

watch

This task watches the src folder for changes, and builds automatically into lib. This is useful if you are developing your component in another project using npm link.

Feedback?

I'd love to hear it. Open an issue or submit a PR.

License

MIT. Copyright (c) Jed Watson 2015.

generator-react-component's People

Contributors

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