Skip to content

Commit

Permalink
文档说明
Browse files Browse the repository at this point in the history
  • Loading branch information
wtto00 committed Oct 24, 2024
1 parent 2af88c9 commit 56fa500
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 15 deletions.
94 changes: 94 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,100 @@

CLI for Uniapp

## 🛠️ 正在开发中...

## 安装

```shell
npm i -g uniapp_cli
```

## 用法

```shell
uniapp --help
```

### 创建应用

```shell
uniapp create app-name
uniapp create -t <template> app-name
uniapp create --force app-name
uniapp create --no-cache app-name
```

TODO:

- 帮助信息中文
- 使用 Git 浅克隆,替换 degit
- 模板添加 vitess

### 检查环境

```shell
uniapp requirement android
uniapp requirement mp-weixin
uniapp requirements ios
```

TODO:

- 帮助信息中文
- 平台完善

### 平台

```shell
uniapp platform add android
uniapp platform rm android
uniapp platform ls
```

TODO:

- 帮助信息中文
- 平台完善

### 运行

```shell
uniapp platform run android --debug
uniapp platform run h5 --no-open
uniapp platform run android --device xxx
```

TODO:

- 帮助信息中文
- 平台完善

### 打包

```shell
uniapp platform build android --release
uniapp platform build h5
uniapp platform build android --device xxx
```

TODO:

- 帮助信息中文
- 平台完善

### 上传部署

```shell
uniapp platform up mp-weixin --release
uniapp platform upload h5
uniapp platform upload android --device xxx
```

TODO:

- 帮助信息中文
- 平台完善

## 版本注意事项

- **oauth.qq**: qq_mta-sdk-1.6.2.jar(3.6.7 以下版本需要)
Expand Down
12 changes: 3 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
{
"name": "unicli",
"name": "uniapp_cli",
"version": "0.0.1-alpha.1",
"description": "CLI for uniapp.",
"type": "module",
"bin": {
"uniapp": "./bin/uniapp.js"
},
"files": [
"bin",
"dist"
],
"files": ["bin", "dist"],
"scripts": {
"dev": "tsc -p tsconfig.json --pretty --declaration --sourceMap --watch",
"build": "pnpm build:js && pnpm build:type",
Expand All @@ -25,10 +22,7 @@
"url": "git+https://github.com/wtto00/uniapp-cli.git",
"directory": "packages/cli"
},
"keywords": [
"uniapp",
"cli"
],
"keywords": ["uniapp", "cli"],
"author": "wtto00 <wtto00@outlook.com>",
"license": "MIT",
"bugs": {
Expand Down
12 changes: 6 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ program
.description('Create a new project powered by uniapp-cli.')
.argument('<app-name>', 'Human readable name')
.option('-t, --template <template>', 'use a custom template from GitHub/GitLab/Bitbucket')
.option('-f, --force', 'Overwrite target directory if it exists')
.option('--no-cache', 'Overwrite target directory if it exists')
.addHelpText('after', '\nExample:\n uniapp create MyUniApp')
.option('-f, --force', '如果目录已存在,强制覆盖')
.option('--no-cache', '不使用缓存')
.addHelpText('after', '\n示例:\n uniapp create MyUniApp')
.action((appName, options) => {
void import('./create.js').then(({ create }) => create(appName, options))
})
Expand All @@ -35,7 +35,7 @@ program
.summary('Checks and print out all the requirements for platforms specified')
.description('Checks and print out all the requirements for platforms specified.')
.argument('<platform...>', 'Platforms requirements you want to check')
.addHelpText('after', '\nExample:\n uniapp requirements android')
.addHelpText('after', '\n示例:\n uniapp requirements android')
.action((platforms) => {
void import('./requirements.js').then(({ requirements }) => requirements(platforms))
})
Expand Down Expand Up @@ -86,7 +86,7 @@ program
.option('--device <device>', 'Deploy a build to specified device.\nOnly available on Android and iOS')
.addHelpText(
'after',
'\nExample:\n uniapp run android --release --device myEmulator\n uniapp run ios --debug\n uniapp run mp-weixin',
'\n示例:\n uniapp run android --release --device myEmulator\n uniapp run ios --debug\n uniapp run mp-weixin',
)
.action((platform, options) => {
void import('./run.js').then(({ run }) => run(platform, options))
Expand All @@ -104,7 +104,7 @@ program
.option('--device <device>', 'Deploy a build to specified device.\nOnly available on Android and iOS')
.addHelpText(
'after',
'\nExample:\n uniapp build android --release\n uniapp build ios --debug\n uniapp build mp-weixin',
'\n示例:\n uniapp build android --release\n uniapp build ios --debug\n uniapp build mp-weixin',
)
.action((platform, options) => {
void import('./build.js').then(({ build }) => build(platform, options))
Expand Down

0 comments on commit 56fa500

Please sign in to comment.