UNPKG

1.75 kBMarkdownView Raw
1<h1 style="font-weight: normal"> 为 Ykit 贡献代码 </h1>
2
3<h2 style="font-weight: normal"> 工程结构 </h2>
4
5ykit 核心代码基本都在src目录下:
6
7```
8├── commands - ykit命令
9├── config - 静态文件如初始化工程模板等
10├── models - ykit核心(如编译打包)
11├── modules - 功能模块
12├── plugins - webpack plugins
13└── utils - 工具
14```
15
16`src`会通过 gulp 编译到`lib`对应目录下,将 src 中的 es6 编译为 es5 ,ykit运行是使用 es5 的代码,所以开发过程中要一直开着 gulp。
17
18<h2 style="font-weight: normal"> 本地开发 </h2>
19
201. fork & clone git 工程
212. qnpm install
223. gulp
234. node /bin/ykit 进行开发和调试
24
25<h2 style="font-weight: normal"> Ykit插件 </h2>
26
27Ykit 对于不同场景的覆盖主要通过插件来实现。插件有两种,一种是功能/技术解决方案插件(如 qunar/hy/fekit),一种是业务插件(如 xta ),目前已有的插件:
28
29- [ykit-config-qunar][1]: 支持 sass/less,实现资源带版本号,fekit_moudles 打包,sync 命令等。
30- [ykit-config-fekit][2]: 主要用于兼容 fekit 模块化语法,如 css 中的 require 等。
31- [ykit-config-hy][3]: 支持 es6,更多功能仍在开发中。
32- [ykit-config-xta][4]: xta 业务团队插件,可在里面引用其它功能插件,和定义团队自己的 lint 规则,自定义插件、服务中间件、命令等。
33
34未来将会有更多技术解决方案插件如 react-native,以及更多业务团队插件...
35
36[1]: http://gitlab.corp.qunar.com/mfe/ykit-config-qunar
37[2]: http://gitlab.corp.qunar.com/mfe/ykit-config-fekit
38[3]: http://gitlab.corp.qunar.com/mfe/ykit-config-hy
39[4]: http://gitlab.corp.qunar.com/mfe/ykit-config-xta