gy-common-cli
v1.3.3
Published
一个快速构建中、后台项目的脚手架
Downloads
10
Maintainers
Readme
gy-common-cli
一个快速构建中、后台项目的脚手架
特性
- 快速构建一个配置有严格的开发规范的项目
- 自由的配置选择
- 初始化配置可选择
- 详细的命令行 log 提示
快速使用
全局下载 gy-common-cli,运行以下命令来创建一个新项目:
npm i gy-common-cli -g
gy-cli create hello-world
命令示例
gy-cli create hello-world -d
-d, --default 忽略提示符并使用默认预设选项
这个默认的设置非常适合快速创建一个新项目的原型,而手动设置则提供了更多的选项,它们是面向生产的项目更加需要的。
创建一个项目
运行以下命令来创建一个新项目:
gy-cli create hello-world
你会被提示选取一个预设的项目,默认将拉取包含全部组件及示例的项目
选择完成模板后将提示键入项目名称,该名称将会设置为package.json
的 name 属性的值,不输入则采用默认值
之后将会去远程仓库拉取代码,生成项目,项目拉取完毕后提示采用何种方式下载依赖
注意:建议手动下载依赖
至此项目创建完毕
添加一个模板
gy-cli add test
将提示选择一个组件模板,从远程仓库中下载,下载完成后将命名为 test,放置于 src/compoments 目录中
如果 src/compoments 目录中存在 名字为 test 的文件,则提示重新输入文件名称
如果 src 或者 compoments 目录不存在,则将创建这两个目录
注意:该命令仅生成模板组件,具体引用通过手动配置
使用图形化界面
你也可以通过 gy-cli ui 命令以图形化界面创建模板组件:
gy-cli start
命令将启动一个服务:http://localhost:8087
在浏览器打开 http://localhost:8087,将以图形化界面将你引导至创建模板组件的流程。
注意:将会创建在当前启动命令的目中,注意执行命令的位置
帮助和更多
gy-cli 命令有一些可选项,你可以通过运行以下命令进行探索:
gy-cli create --help
用法:create [options] <app-name>
创建一个由 `gy-common-cli` 提供支持的新项目
版本记录
- 1.0.0 初始化项目,一行命令拉取基础模板
- 1.0.1 增加目录覆盖检测
- 1.0.2 更换远程模板项目地址,使用 GitLab 作为模板仓库
- 1.0.3 支持项目配置,可选拉取多个项目
- 1.0.4 支持命令选择 npm、cnpm 或手动下载依赖
- 1.0.5 更友好的命令提示
- 1.1.0 增加 add \ start 命令,远程下载单个模板,增加下载模板可视化界面
- 1.2.2 新的 UI 界面,增加组件模板选择,支持下载多文件组件
- 1.3.2 UI 界面增加项目模板选择,支持下载项目模板
- 1.3.3 UI UI 界面增加加载动画
License
MIT