yeoman generator for react component for node 4.0.0
see also https://github.com/react-component/rc-tools
- support typescript
- support pre-commit
- support eslint
- support karma
- support coveralls.io
- support travis-ci
- support saucelabs
npm install yo generator-rc -g
mkdir test
cd test
yo rc --port=8000 --author=yiminghe@gmail.com --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, ``
- .travis.yml
- examples
- index.html
- index.tsx
- src
- Component.tsx
- index.tsx
- index.js
- tests
- index.js
- detail.spec.tsx
- package.json
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import Component from 'rc-test';
ReactDOM.render(<Component />, document.getElementById('__react-content'));
import * as React from 'react';
export default class Component extends React.Component<any, any> {
// TODO
render(){
return <div></div>;
}
}
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);
});
});
placeholder
npm install
npm start
- run
npm run chrome-test
to see test - open http://localhost:8000/examples/ to see demo