@liuli-util/cli 3.18.0 → 3.19.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.zh-CN.md +53 -9
- package/dist/bin.js +113 -93
- package/dist/bin.js.map +3 -3
- package/dist/commands/deploy/DeployService.d.ts.map +1 -1
- package/dist/commands/esbuild/ESBuildProgram.d.ts +5 -2
- package/dist/commands/esbuild/ESBuildProgram.d.ts.map +1 -1
- package/dist/commands/esbuild/index.d.ts.map +1 -1
- package/dist/commands/esbuild/util/esbuildPlugins.d.ts +1 -0
- package/dist/commands/esbuild/util/esbuildPlugins.d.ts.map +1 -1
- package/dist/commands/sync/when.d.ts.map +1 -1
- package/dist/index.esm.js +4 -2
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +4 -2
- package/dist/index.js.map +2 -2
- package/package.json +14 -14
- package/src/commands/deploy/DeployService.ts +0 -2
- package/src/commands/deploy/__tests__/.temp/test.lock +0 -0
- package/src/commands/deploy/__tests__/DeployService.test.ts +2 -3
- package/src/commands/deploy/__tests__/conf.test.ts +0 -1
- package/src/commands/deploy/__tests__/simpleGit.test.ts +6 -3
- package/src/commands/deploy/__tests__/util/deployGhPageWorker.ts +3 -2
- package/src/commands/esbuild/ESBuildProgram.ts +25 -5
- package/src/commands/esbuild/__tests__/.temp/package.json +1 -0
- package/src/commands/esbuild/__tests__/.temp/src/index.ts +1 -0
- package/src/commands/esbuild/__tests__/ESBuildProgram.test.ts +50 -13
- package/src/commands/esbuild/index.ts +26 -13
- package/src/commands/esbuild/util/esbuildPlugins.ts +37 -1
- package/src/commands/generate/__tests__/.temp/README.md +1 -0
- package/src/commands/generate/__tests__/.temp/package.json +3 -0
- package/src/commands/generate/__tests__/.temp/test-cli/CHANGELOG.md +1 -0
- package/src/commands/generate/__tests__/.temp/test-cli/README.md +1 -0
- package/src/commands/generate/__tests__/.temp/test-cli/bin.js +3 -0
- package/src/commands/generate/__tests__/.temp/test-cli/package.json +34 -0
- package/src/commands/generate/__tests__/.temp/test-cli/src/bin.ts +13 -0
- package/src/commands/generate/__tests__/.temp/test-cli/src/index.ts +1 -0
- package/src/commands/generate/__tests__/.temp/test-cli/tsconfig.json +28 -0
- package/src/commands/sync/SyncProgram.ts +1 -1
- package/src/commands/sync/__tests__/SyncProgram.test.ts +1 -1
- package/src/commands/sync/__tests__/when.test.ts +3 -7
- package/src/commands/sync/when.ts +8 -23
- package/templates/cli/package.json +4 -4
- package/templates/lib/package.json +2 -2
- package/dist/commands/deploy/util/FileLock.d.ts +0 -14
- package/dist/commands/deploy/util/FileLock.d.ts.map +0 -1
- package/src/commands/deploy/__tests__/FileLock.test.ts +0 -27
- package/src/commands/deploy/util/FileLock.ts +0 -31
package/README.zh-CN.md
CHANGED
@@ -7,15 +7,15 @@
|
|
7
7
|
### 安装
|
8
8
|
|
9
9
|
```sh
|
10
|
-
|
11
|
-
|
10
|
+
pnpm i -D @liuli-util/cli # 局部安装
|
11
|
+
pnpm i -g @liuli-util/cli # 全局安装
|
12
12
|
```
|
13
13
|
|
14
14
|
### 打包
|
15
15
|
|
16
16
|
```sh
|
17
|
-
|
18
|
-
|
17
|
+
liuli-cli build lib # 打包库
|
18
|
+
liuli-cli build cli # 打包 cli 引用程序
|
19
19
|
```
|
20
20
|
|
21
21
|
> 添加 `-w` 选项则启动 rollup 的监视模式,打包出来的 dist/ 不会压缩且不会将依赖项打进 bundle。
|
@@ -25,22 +25,66 @@ yarn liuli-cli build cli # 打包 cli 引用程序
|
|
25
25
|
### 生成
|
26
26
|
|
27
27
|
```sh
|
28
|
-
|
29
|
-
|
28
|
+
liuli-cli generate <name> --template lib # 生成 ts-lib 项目
|
29
|
+
liuli-cli generate <name> --template cli # 生成 cli 项目
|
30
30
|
```
|
31
31
|
|
32
32
|
util 也支持交互式的创建项目
|
33
33
|
|
34
34
|
```shell
|
35
|
-
|
35
|
+
liuli-cli generate
|
36
36
|
```
|
37
37
|
|
38
38
|
![liuli-cli 交互式创建截图](https://liuli.dev/images/liuli-cli%20%E4%BA%A4%E4%BA%92%E5%BC%8F%E5%88%9B%E5%BB%BA%E6%88%AA%E5%9B%BE.gif)
|
39
39
|
|
40
|
+
### 部署
|
41
|
+
|
42
|
+
支持部署前端资源通过 sftp/gh-pages 部署到远端,配置信息在 package.json 中的 `deploy` 字段
|
43
|
+
|
44
|
+
```sh
|
45
|
+
liuli deploy
|
46
|
+
```
|
47
|
+
|
48
|
+
公共
|
49
|
+
|
50
|
+
| 配置 | 说明 | 默认值 |
|
51
|
+
| ------ | ------------------------- | ------ |
|
52
|
+
| `type` | 部署类型,`sftp/gh-pgaes` | 无 |
|
53
|
+
| `dist` | 静态资源目录 | 无 |
|
54
|
+
| `dest` | 部署的远端目录 | 无 |
|
55
|
+
|
56
|
+
sftp
|
57
|
+
|
58
|
+
| 配置 | 说明 | 默认值 |
|
59
|
+
| -------------------- | -------------- | ------ |
|
60
|
+
| `sshConfig.host` | ssh 的 ip 地址 | |
|
61
|
+
| `sshConfig.port` | ssh 的端口号 | 22 |
|
62
|
+
| `sshConfig.username` | ssh 的用户名 | |
|
63
|
+
|
64
|
+
gh-pages
|
65
|
+
|
66
|
+
| 配置 | 说明 | 默认值 |
|
67
|
+
| -------- | ------------------- | --------------------------- |
|
68
|
+
| `repo` | 部署的 git 项目地址 | 当前 git 项目的 remote 地址 |
|
69
|
+
| `remote` | 远端名 | origin |
|
70
|
+
| `branch` | 远端分支 | gh-pages |
|
71
|
+
|
72
|
+
部署 vuepress 文档网站示例配置
|
73
|
+
|
74
|
+
```json
|
75
|
+
{
|
76
|
+
"deploy": {
|
77
|
+
"type": "gh-pages",
|
78
|
+
"dest": "docs/.vuepress/dist",
|
79
|
+
"remote": "/"
|
80
|
+
}
|
81
|
+
}
|
82
|
+
```
|
83
|
+
|
40
84
|
### 同步配置
|
41
85
|
|
42
86
|
```shell
|
43
|
-
|
87
|
+
liuli-cli sync
|
44
88
|
```
|
45
89
|
|
46
90
|
需要在 package.json 中指定同步哪些配置
|
@@ -69,7 +113,7 @@ yarn liuli-cli sync
|
|
69
113
|
也支持交互式的初始化同步配置
|
70
114
|
|
71
115
|
```shell
|
72
|
-
|
116
|
+
liuli-cli sync init
|
73
117
|
```
|
74
118
|
|
75
119
|
## 设计理念
|