腳手架package一般拆分為:核心流程core无牵、命令commands河劝、模型models和支撐模塊utils
核心流程:core
命令:commands
- 初始化
- 發(fā)布
- 清緩存
模型models
- Command命令
- Project項(xiàng)目
- Components組件
- Npm模塊
- Git倉庫
支撐模塊utils
- Git操作
- 云構(gòu)建
- 工具方法
- Api請求
原有目錄調(diào)整
文件調(diào)整目錄如下:
- spring-breeze
- commands
- core
- core
- bin
- index.js
- lib
- core.js
- node_modules
...
- models
- utils
- tools
...
.gitignore
lerna.json
...
因?yàn)閏ore將不再作為工具包而是cli入口文件,所以在core中的package.json添加bin屬性,修改如下:
{
"name": "@spring-breeze/core",
"version": "0.0.4",
"description": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"bin": {
"spring-breeze-cli": "bin/index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@spring-breeze/tools": "^0.0.4",
"jquery": "^3.6.0",
"lodash": "^4.17.21"
},
"publishConfig": {
"access": "public"
},
"gitHead": "2afb10960470792464538183b89ab01f69e436af"
}
進(jìn)入core執(zhí)行 npm link;然后執(zhí)行spring-breeze-cli
PS F:\spring-breeze\core\core> spring-breeze-cli
我是core包.
我是tools包~~1
這樣一個spring-breeze-cli腳手架目錄結(jié)構(gòu)就大致完成了