一个脚手架项目,可以快速的生成项目模板
- 通过commander,inquirer等插件实现与用户的交互
- 借助于github的api,获取用于用户选择的repo列表,tag列表
- 确定模板后后下载到当前目录
- commander,负责注册识别命令,这里主要就是一个create命令
- inquirer,向用户问询并提供选项让用户选择
- 查询repos列表,https://api.github.com/orgs/${org}/repos
- 查询tags列表,https://api.github.com/repos/${org}/${repo}/tags
- 下载模板,这里使用了download-git-repo库
- 需要在github创建一个组织,替换掉代码我的zjjZone
- 在组织中上传一些repo
- 需要在每个repo打上tag
npm install
npm link
npm unlink -g
zli create prjectName