0.6.11 • Published 6 years ago

yz-cli v0.6.11

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

ya-cli

Simple CLI for scaffolding Ya projects

安装

环境 : Node.js , npm 3.0+、 Git.

npm install -g yz-cli

创建项目

在要创建项目的路径执行 ‘ya init’。

$ ya

  Usage: ya <command> [options]

  Options:

    -V, --version  output the version number
    -h, --help     output usage information

$ ya init

  Usage: ya-init [project-name]


  Options:

    -o, --offline  使用已经下载的本地模板
    --template [value] 选择使用的模板
    -i, --install  下载模板后自动安装依赖
    -h, --help     output usage information

$ ya update
  Usage: ya-update [project-name]

  Options:

    -h, --help          output usage information
    -o, --offline       使用本地模板
    --template [value]  选择使用的模板
    -i, --install       下载模板后自动安装依赖

Examples:

创建 / 更新项目

$ ya init project1

在当前目录创建 / 更新项目

$ ya init

更新当前项目

$ ya update project1

在当前目录更新项目

$ ya update

使用本地模板 & 自动安装依赖

$ ya init project1 -i -o

默认模板进行开发

默认模板 使用如下

开发环境

开启本地服务器开发并热替换。默认开启 eslint(standard)、flow。

$ cd [project]
$ npm run dev

生产

$ npm run build

mock

使用mockjs规则生成 mock 数据。

$ npm run mock

开启 mock 服务后即可本地 mock 请求。配置规则参考 tools/config dev.proxyTable。可于/src/mock 文件夹按请求地址创建 js/json 文件并填写符合 mockjs 规则或普通数据。如:

c2s('/ya/modules/test')

对应
  \ya
  -- \modules
  ---- \test.json

flow

默认集成在eslint中。
也可以关闭自行使用 $ npm run flow 检测,或 $ npm run flowserver 实时监听。
使用eslint时,如遇到提示模块未发现。可手动执行stopflow关闭flow服务后重新
$ npm run dev

自定义模板

自定义模板无需发布到 npm,只需上传到 github 并通过 template 参数使用即可

$ ya init project1 --template q13/vue-spa-template
0.6.11

6 years ago

0.6.10

6 years ago

0.6.9

6 years ago

0.6.8

6 years ago

0.6.7

6 years ago

0.6.6

6 years ago

0.6.5

6 years ago

0.6.4

6 years ago

0.6.3

6 years ago

0.6.1

6 years ago

0.6.0

6 years ago

0.5.9

6 years ago

0.5.8

6 years ago

0.5.7

6 years ago

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago