mirror of
https://github.com/youzan/vant.git
synced 2025-10-16 08:00:34 +00:00
docs(vant-cli): translate vant-cli docs to en (#10537)
* docs(vant-cli): translate commands doc to en * docs(vant-cli): translate config doc to en * docs(vant-cli): translate directory doc to en * docs(vant-cli): fix doc link
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# 命令
|
||||
# Commands
|
||||
|
||||
Vant CLI 中内置了一系列的命令,可以将命令添加到 npm scripts 中进行使用。
|
||||
You can add built-in commands to `npm scripts` to use it.
|
||||
|
||||
```json
|
||||
// package.json
|
||||
@@ -15,7 +15,7 @@ Vant CLI 中内置了一系列的命令,可以将命令添加到 npm scripts
|
||||
}
|
||||
```
|
||||
|
||||
也可以通过 npm 自带的 [npx](https://github.com/npm/npx) 直接执行某个命令:
|
||||
Additionally, [npx](https://github.com/npm/npx) can used to be run those commands.
|
||||
|
||||
```bash
|
||||
npx vant-cli dev
|
||||
@@ -23,17 +23,15 @@ npx vant-cli dev
|
||||
|
||||
### dev
|
||||
|
||||
运行本地开发环境。
|
||||
|
||||
运行 dev 命令时,Vant CLI 会通过启动一个本地服务器,用于在开发过程中对文档和示例进行预览。
|
||||
Start local dev server for browsering components and demo.
|
||||
|
||||
### build
|
||||
|
||||
构建组件库。
|
||||
Build Vue component library.
|
||||
|
||||
运行 build 命令会在 `es` 和 `lib` 目录下生成可用于生产环境的组件代码,详见 [目录结构](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md)。
|
||||
Files will be output to `es` and `lib` directory. More details [directory structure](https://github.com/youzan/vant/tree/dev/packages/vant-cli/docs/directory.md)
|
||||
|
||||
发布 npm 时,请将以下配置加入到 `package.json` 中,使 npm 包能被正确识别:
|
||||
Please add the followed config to `package.json` when publish to npm.
|
||||
|
||||
```json
|
||||
// package.json
|
||||
@@ -46,19 +44,19 @@ npx vant-cli dev
|
||||
|
||||
### build-site
|
||||
|
||||
构建文档站点,在 `site` 目录生成可用于生产环境的文档站点代码。
|
||||
Build documentation website. Files will be output to `site` directory.
|
||||
|
||||
### release
|
||||
|
||||
发布组件库,发布前会自动执行 build 和 changelog 命令,并通过 [release-it](https://github.com/release-it/release-it) 发布 npm 包。
|
||||
Publish to npm. `build` and `changlog` will be automatically execute when run `release`.
|
||||
|
||||
## changelog
|
||||
|
||||
基于 commit 记录生成更新日志,基于 [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) 实现。
|
||||
Generate changelog based on commit records.
|
||||
|
||||
## commit-lint
|
||||
|
||||
校验 commit message 的格式是否符合规范,需要配合 `husky` 在提交 commit 时触发。
|
||||
Validate the format of commit message. Need `husky` to do this.
|
||||
|
||||
```bash
|
||||
npx husky add .husky/commit-msg 'npx --no-install vant-cli commit-lint $1'
|
||||
|
Reference in New Issue
Block a user