generator-react-zero
v1.3.1
Published
A yeoman generator for react/flux
Downloads
4
Maintainers
Readme
generator-react-zero
A Yeoman generator to bootstrap a React/Flux application.
Features
- [x] React/Flux project scaffold
- [x] Sub-generator for react components
- [x] Test setup (with tape)
- [x] Sass scaffold with Bourbon
- [x] Complete build process with npm
- JS Build
- JS bundling (using Browserify)
- External sourcemaps
- ES6 + JSX transpiling (using Babel)
- CSS build
- SASS transpiling
- Assets copy
- copy all assets to
public/
- copy all assets to
- Serve in browser
- Watch all & sync browser
- JS Build
Getting Started
Install yeoman and the react-zero generator:
$ npm install -g yo
$ npm install -g generator-react-zero
Run the app generator:
$ mkdir myapp && cd myapp
$ yo react-zero
Run the component sub-generator (inside the project's directory):
$ yo react-zero:component
Usage
The entire build process is based on NPM.
Build, watch & serve
$ npm start
Build project
$ npm run build
Build project in public/
.
You can also build the different part separately:
$ npm run build:js
$ npm run build:css
$ npm run build:assets
Watch project
Same as build, but replace build
with watch
Serve project
$ npm run serve
Browser sync the public/
folder.
Clean
$ npm run clean
Remove content of public/
folder.
Run tests
Run all tests:
$ npm test
Or run separated tests:
$ npm test -- test/components/MyComponent-test.js
Future improvements
- Assets optimization (minify, uglify, etc).
Resources
- Why I use tape instead of mocha & so should you
- Unit testing react components without a dom
- Gulp is awesome, but do we really need it
License
MIT
Contributing
- Fork it ( https://github.com/nsarno/generator-react-zero/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request