A Comprehensive Guide for React Boilerplate containing Webpack, Gulp, React, Redux, Router, Immutable, etc.
First, install wern-cli using npm (we assume you have pre-installed node.js).
npm install -g wern-cliThen generate your new project:
mkdir demo
cd demo
wern initcd demo && npm installnpm install -g gulp
gulp dll
gulp servernpm run testor watch test
npm run test-watchgulp buildwerng moduleName
Note: The "moduleName" is you enter module name. After exec this command, it will create "react component", "redux action", ande "redux reducer" etc.
The wern-cli generator react templates can download from the github https://github.com/enjoyfuture/wern-template.
npm run compile
npm publish
wern -v // Check CLI version
wern --help // Get help and check usage- ava : 测试框架,类似于 mocha jest jasmine QUnit 等 官网:https://github.com/avajs/ava 中文指南:https://github.com/avajs/ava-docs/blob/master/zh_CN/readme.md
- enzyme : React测试工具,依赖 react-addons-test-utils 可以类似 jquery 风格的 api 操作react 节点 官网:https://github.com/airbnb/enzyme 文档:http://airbnb.io/enzyme/
- sinon : 提供 fake 数据, 替换函数调用等功能 官网:http://sinonjs.org/
- nyc : JS code coverage tool that computes statement, line, function and branch coverage(用来检测单元测试覆盖率) 官网:https://github.com/istanbuljs/nyc Note: With this configuration, the Istanbul instrumentation will only be active when NODE_ENV or BABEL_ENV is test.
- nock: 用来模拟 http 请求测试用 官网:https://github.com/node-nock/nock
- 参考文章
MERN is released under the MIT License.