thinkjs/doc/dev.md
2015-05-26 13:18:45 +08:00

33 lines
913 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 2.0开发文档
### 介绍
`https://github.com/75team/thinkjs`上拉取代码后,选择`es6`的分支。
2.0基于ES6特性进行开发如果对ES6不够了解请先熟练了解ES6的特性 http://es6.ruanyifeng.com/#README
由于有些特性目前Node还不支持所以需要使用`Babel`来编译成Es5的代码运行。http://babeljs.io/
安装Babel
```
npm install -g babel
```
然后对src目录进行编译
```
babel --loose all --optional runtime --stage 0 src/ --out-dir lib/ --watch
```
上面代码表示用监听的方式将src/目录编译到lib/目录下,这样文件有修改后会自动编译。
### 规范
* 必须使用2个空格作为缩进
* 必须写较为完善的注释,注释使用英文
* git commit的message也必须是英文
* 代码必须经过`eslint`检测(通过`npm install -g eslint babel-eslint`安装然后eslint file.js来检测