Code Monkey home page Code Monkey logo

generator-rc's Introduction

generator-rc

yeoman generator for react component for node 4.0.0

see also https://github.com/react-component/rc-tools

Feature

  • support typescript
  • support pre-commit
  • support eslint
  • support karma
  • support coveralls.io
  • support travis-ci
  • support saucelabs

Usage

npm install yo generator-rc -g
mkdir test
cd test
yo rc --port=8000 [email protected] --rc_version=1.0.0

all parameters:

`` port defaults to 8000,

author defaults to empty,

rc_version defaults to 1.0.0,

tnpm defaults to false,

repo_url defaults to http://github.com/react-component,

pkg_name defaults to parent directory's name, ``

file structure

- .travis.yml
- examples
 - index.html
 - index.tsx
- src
 - Component.tsx
 - index.tsx
- index.js
- tests
  - index.js
  - detail.spec.tsx
- package.json

examples/index.tsx

import * as ReactDOM from 'react-dom';
import * as React from 'react';
import Component from 'rc-test';
ReactDOM.render(<Component />, document.getElementById('__react-content'));

src/Component.tsx

import * as React from 'react';
export default class Component extends React.Component<any, any> {
    // TODO
    render(){
        return <div></div>;
    }
}

.travis.yml

package.json

detail.spec.tsx

import expect from 'expect.js';
import * as React from 'react';
import Component from 'rc-test';

describe('it', function(){
    it('works', function(){
        const component = (<Component/><a></a></Component>);
        expect(component).to.be(component);
    });
});

index.html

placeholder

start server

npm install
npm start

generator-rc's People

Contributors

missingtears avatar yiminghe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

generator-rc's Issues

package.json init error

hey buddy, I try to use your generator to initialize my react component,but when I get started, There is a problem in json file name with package.json, causing of a unnecessary “,” , it occur to a "Trailing comma in object at 39:3" error even through I don`t code anything there.

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.