0.2.0 • Published 3 years ago
springci v0.2.0
简介
一个简单的脚手架工具, 借鉴 create-react-app、 vuecli@2.0.0、 yeoman
安装
# install it globally
$ npm install -g springci
# or yarn
$ yarn global add springci
快速上手
Create new project from a template.
$ springci <template> [project] [-f|--force] [-o|--offline]
# springci with an official template
$ springci <template> [project]
# springci with a github repo
$ springci <owner>/<repo> [project]
如果只使用一次,我建议采用npx去允许springci
$ npx springci <template> [project] [-f|--force] [-o|--offline]
配置项
-f, --force
: Overwrite if the target exists-o, --offline
: Try to use an offline template
Recipes
GitHub orgnizetion Templates
$ springci template my-project
该指令是从springci组织拉去template模版,并且以template模版创建my-project项目
$ springci template#typescript my-project
如果运行该指令,会拉去ts分支的模版。
Custmore
$ caz wannaSpring/template my-project
必须是公开库.
Local Templates
根据本地模版创建项目
e.g.
$ springci ~/local/template my-project
Remote ZIP Templates
也可以依据cdn或者其他方式存储的zip包创建项目
e.g.
$ springci https://cdn.wannaspring.me/boilerplate.zip my-project
The above command will download & extract template from https://cdn.wannaspring.me/boilerplate.zip
.
Offline Mode
$ springci template my-project --offline
离线模式,springci会尝试从cache 中拉去拉取模版
List Available Templates
展示springci 下的所有模版
$ springci list [owner] [-j|--json] [-s|--short]
Arguments
[owner]
: GitHub orgs or user slug, default:'springcli'
Options
-j, --json
: Output with json format-s, --short
: Output with short format
Configuration
springci 可以读取你的配置,通过~/.springcirc
来修改配置。
; template download registry,
; {owner} & {name} & {branch} will eventually be replaced by the corresponding value.
registry = https://github.com/{owner}/{name}/archive/{branch}.zip
; template offlicial organization name
official = springcli
; default template branch name
branch = master
这意味着你可以通过springci加上springcirc来自定义你的脚手架工具
For example, in your ~/.springcirc
:
registry = https://gitlab.com/{owner}/{name}/archive/{branch}.zip
official = faker
branch = dev
运行指令
$ springci temlate my-project
The above command will download & extract template from https://gitlab.com/faker/nm/archive/dev.zip
.
About
jest
单元测试覆盖率100%, 通过率99.52%