@wagq/wa-cli 0.6.25 → 0.6.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -53
- package/config/command.js +120 -97
- package/lib/exe/index.js +7 -0
- package/lib/init/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
# cli 工具
|
|
2
|
-
|
|
3
|
-
使用方式 全局安装后 可使用 wa [命令]
|
|
4
|
-
|
|
5
|
-
- 更多描述可以使用help查看
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
wa --help
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
- 初始化项目
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
wa init
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
- 启动本地服务
|
|
18
|
-
|
|
19
|
-
- `-P` 3000 指定端口
|
|
20
|
-
- `-S` true 开启https
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
wa server [path]
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- 转换 xlsx 文件为多语言配置
|
|
27
|
-
|
|
28
|
-
- `path` 文件路径
|
|
29
|
-
- `name` 被转换目标文件名称
|
|
30
|
-
- `ext` 转换后文件扩展名 json 或 ts
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
wa xlsx2Config [path] [name] [ext]
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
- 同步远端低代码配置
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
wa daml
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
- 同步远端应用所有页面的低代码配置
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
wa damls
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
- batchUpdate
|
|
49
|
-
批量更新指定组织下的包
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
wa batchUpdate
|
|
53
|
-
```
|
|
1
|
+
# cli 工具
|
|
2
|
+
|
|
3
|
+
使用方式 全局安装后 可使用 wa [命令]
|
|
4
|
+
|
|
5
|
+
- 更多描述可以使用help查看
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
wa --help
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- 初始化项目
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
wa init
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
- 启动本地服务
|
|
18
|
+
|
|
19
|
+
- `-P` 3000 指定端口
|
|
20
|
+
- `-S` true 开启https
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
wa server [path]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- 转换 xlsx 文件为多语言配置
|
|
27
|
+
|
|
28
|
+
- `path` 文件路径
|
|
29
|
+
- `name` 被转换目标文件名称
|
|
30
|
+
- `ext` 转换后文件扩展名 json 或 ts
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
wa xlsx2Config [path] [name] [ext]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
- 同步远端低代码配置
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
wa daml
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- 同步远端应用所有页面的低代码配置
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
wa damls
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
- batchUpdate
|
|
49
|
+
批量更新指定组织下的包
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
wa batchUpdate
|
|
53
|
+
```
|
package/config/command.js
CHANGED
|
@@ -1,97 +1,120 @@
|
|
|
1
|
-
const init = require("../lib/init");
|
|
2
|
-
const server = require("../lib/server");
|
|
3
|
-
const xlsx2Config = require("../lib/locale/xlsx2Config");
|
|
4
|
-
const asyncDaml = require("../lib/daml/async");
|
|
5
|
-
const asyncDamlByApp = require("../lib/daml/asyncByApp");
|
|
6
|
-
const batchUpdate = require("../lib/batchUpdate");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
1
|
+
const init = require("../lib/init");
|
|
2
|
+
const server = require("../lib/server");
|
|
3
|
+
const xlsx2Config = require("../lib/locale/xlsx2Config");
|
|
4
|
+
const asyncDaml = require("../lib/daml/async");
|
|
5
|
+
const asyncDamlByApp = require("../lib/daml/asyncByApp");
|
|
6
|
+
const batchUpdate = require("../lib/batchUpdate");
|
|
7
|
+
const web2exe = require("../lib/exe");
|
|
8
|
+
|
|
9
|
+
const command = [
|
|
10
|
+
{
|
|
11
|
+
name: "daml",
|
|
12
|
+
alias: "d",
|
|
13
|
+
description: "同步低代码逻辑器文件",
|
|
14
|
+
action: () => {
|
|
15
|
+
asyncDaml();
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "batchUpdate",
|
|
20
|
+
alias: "bu",
|
|
21
|
+
description: "批量升级依赖包,可以指定组织,只更新组织下的依赖",
|
|
22
|
+
action: () => {
|
|
23
|
+
batchUpdate();
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "damls",
|
|
28
|
+
description: `从应用同步所有页面的逻辑器与变量值,
|
|
29
|
+
可将appId,branchid,token配置到~/.damlrc文件中,
|
|
30
|
+
格式为{"origin":string,"appId":string,"branchid":string,"token":string, "appName": string}[]
|
|
31
|
+
其中origin为请求域名(/api/assembler/page/list(页面列表)接口域名),
|
|
32
|
+
appId,branchid,token为请求参数,
|
|
33
|
+
appName为应用名称,也是你区分不同应用的标识,所有生成的文件都会放在appName文件夹下`,
|
|
34
|
+
alias: "da",
|
|
35
|
+
action: () => {
|
|
36
|
+
asyncDamlByApp();
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "init",
|
|
41
|
+
alias: "i",
|
|
42
|
+
description: "项目初始化工具",
|
|
43
|
+
action: (name) => {
|
|
44
|
+
init(name);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "server [path]",
|
|
49
|
+
alias: "s",
|
|
50
|
+
description: "启动本地服务",
|
|
51
|
+
action: server,
|
|
52
|
+
options: {
|
|
53
|
+
端口: "-P, --port <port>",
|
|
54
|
+
https: "-S, --https <boolean>",
|
|
55
|
+
},
|
|
56
|
+
positional: [
|
|
57
|
+
{
|
|
58
|
+
key: "path",
|
|
59
|
+
option: {
|
|
60
|
+
default: "dist",
|
|
61
|
+
describe: "文件路径",
|
|
62
|
+
type: "string",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "xlsx2Config [path] [name] [ext]",
|
|
69
|
+
alias: "l",
|
|
70
|
+
description: "xlsx文件转多语言配置",
|
|
71
|
+
positional: [
|
|
72
|
+
{
|
|
73
|
+
key: "path",
|
|
74
|
+
option: {
|
|
75
|
+
describe: "文件路径",
|
|
76
|
+
type: "string",
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: "name",
|
|
81
|
+
option: {
|
|
82
|
+
describe: "xlsx文件名称",
|
|
83
|
+
type: "string",
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
key: "ext",
|
|
88
|
+
option: {
|
|
89
|
+
describe: "转换文件格式(ts or json)",
|
|
90
|
+
type: "string",
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
action: xlsx2Config,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: "web2exe [name] [path]",
|
|
98
|
+
alias: 'we',
|
|
99
|
+
description: "将网页打包成exe",
|
|
100
|
+
positional: [
|
|
101
|
+
{
|
|
102
|
+
key: "name",
|
|
103
|
+
option: {
|
|
104
|
+
describe: "应用名称",
|
|
105
|
+
type: "string",
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: "path",
|
|
110
|
+
option: {
|
|
111
|
+
describe: "文件路径",
|
|
112
|
+
type: "string",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
action: web2exe,
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
module.exports = command;
|
package/lib/exe/index.js
ADDED
package/lib/init/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const { execSync } = require("child_process");
|
|
|
8
8
|
|
|
9
9
|
const viteBin = "npm create vite@latest";
|
|
10
10
|
const uniAppBin = "npm create unibest";
|
|
11
|
+
const rnAppBin = "npx create-expo-app --template";
|
|
11
12
|
|
|
12
13
|
const urls = {
|
|
13
14
|
vue单页面后台: { remote: "sdmu-gaoqi/vite-vue" },
|
|
@@ -18,6 +19,7 @@ const urls = {
|
|
|
18
19
|
"vscode插件-vue版": { remote: "sdmu-gaoqi/vscode-plugin#vue" },
|
|
19
20
|
"vscode插件-react版": { remote: "sdmu-gaoqi/vscode-plugin#react" },
|
|
20
21
|
umi: { bin: "npx create-umi@latest" },
|
|
22
|
+
"react-native": { bin: rnAppBin },
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
const reactRepoMap = {
|