GithubHelp home page GithubHelp logo

alduro / generator-rf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from taiansu/generator-rf

0.0 2.0 0.0 638 KB

RF: a React/Flux generator with webpack, dialects and some good stuffs.

JavaScript 88.59% CSS 0.80% LiveScript 4.71% HTML 1.22% CoffeeScript 4.67%

generator-rf's Introduction

generator-rf Build Status Gitter

RF: a React/Flux generator with webpack, dialects and some good stuffs.

What's inside

What 'RF' stands for

No, not the boring abbreviation of "React" and "Flux". It's actually the suffix of rm -rf. Now it sounds dangerous and cooler, doesn't it?

Installation

Prerequisites

Install Yeoman

npm install -g yo

Install RF generator

npm install -g generator-rf

Getting Started

Intiate Project

For example, to create a project named "myapp", just type:

yo rf myapp

Run it up

cd myapp && npm run dev

Then Open http://localhost:8080 in the browser and have fun!

If you get error message like Cannot GET / on MS Windows, try http://localhost:8080/index.html instead. And please let me how to fix it if you know how.

Run the test suit

Don't forget to test your project by:

npm test

Build for deploy

npm run build

What RF generates:

.
└── myapp *
    ├── package.json
    ├── preprocessor.js
    ├── node_modules
    ├── src
    │   ├── assets
    │   │   ├── images
    │   │   └── stylesheets
    │   │       └── style.sass **
    │   ├── index.html
    │   └── scripts
    │       ├── actions
    │       │   └── __tests__
    │       ├── components
    │       │   ├── App.coffee **
    │       │   └── __tests__
    │       │       └── App-test.coffee **
    │       ├── constants
    │       │   └── __tests__
    │       ├── dispatcher
    │       │   ├── AppDispatcher.coffee **
    │       │   └── __tests__
    │       ├── main.coffee **
    │       ├── mixins
    │       │   └── __tests__
    │       └── stores
    │           └── __tests__
    └── webpack.config.js
  • * Won't create root directory if your current directory is identical with your project name. Check --skip-root section for detail.
  • ** Varied by your choices of the dialect and stylesheet syntax

What npm run build gives:

.
└── myapp
    ├── build
    │   ├── bundle.js
    │   └── index.html
    └── ...

Options

--d: Dialect

By default, RF will generate codes in CoffeeScript. If you don't like it, use --d flag to change the dialect to generate.

  • ls for LiveScript
  • babel for Babel (Formally JavaScript 6to5)
  • js for vanilla JavaScript

Example:

yo rf myapp --d=ls

--s: Stylesheet Syntax

RF generate SASS (indented syntax) by default. Use --s flag to change it.

  • scss for SCSS (Sassy CSS)
  • less for LESS
  • stylus for Stylus
  • or css for CSS.

Example:

yo rf myapp --s=scss

--skip-root: Don't create root directory

From 0.1.13, RF will create a root directory if current directory name is different from your appname, or generate files in current directory if they have same name. But if you're intentionally have them with different name, use --skip-root to generate files right in the current directory.

Example:

yo rf trueName --skip-root

--skip-test: Don't create __tests__ directory

For every sub-directories in src/scripts, RF will create a __tests__ directory within. Use skip-test to skip that.

Example:

yo rf myapp --skip-test

--skip-install: Skip automatic package installation

Example:

yo rf myapp --skip-install

Contribute

  • Fork this project
  • run npm install && npm test and make sure all test are pass
  • Make your changes with a bit of test
  • For commit message of pull request, please check these useful tips ahead.

TODO

  • Actions w/Constants, Store
  • Component and Mixin generate command
  • Isomorphic server script(?)
  • React native things(?)

License

MIT

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.