zero-ai 0.3.26 → 0.3.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 +26 -25
- package/package.json +1 -1
- package/src/commander-ai/fn.init.js +4 -2
- package/src/commander-ai/fn.sync.js +5 -5
package/README.md
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
# Zero工具箱
|
|
2
2
|
|
|
3
|
-
Zero
|
|
3
|
+
Zero工具箱为一个工具类型的项目,主要为后端项目和前端项目打造的辅助开发人员进行快速开发的命令行工具,该工具可以帮助开发人员执行`Zero/Zero Ui`
|
|
4
|
+
的智能化开发,版本会持续发布到npm社区。
|
|
4
5
|
|
|
5
|
-
*
|
|
6
|
-
* 后端:[http://www.vertxup.cn](http://www.vertxup.cn)
|
|
7
|
-
* 详细文档:[Zero Ai文档](http://www.vertxai.cn/document/doc-web/index.html)
|
|
6
|
+
* 详细文档:[Zero Ai命令](http://www.vertxai.cn/document/doc-web/index.html)
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
## 0. 引导
|
|
9
|
+
|
|
10
|
+
- (后端)Zero Ecotope:<https://www.zerows.io>
|
|
11
|
+
- (前端)Zero UI:<https://www.vertxui.cn>
|
|
12
|
+
- (工具)Zero AI:<https://www.vertxai.cn>
|
|
13
|
+
- (标准)Zero Schema:<https://www.vertx-cloud.cn>
|
|
10
14
|
|
|
11
15
|
## 1. 安装流程
|
|
12
16
|
|
|
17
|
+
> Windows必须启用 WSL 才可用
|
|
18
|
+
|
|
13
19
|
使用以下命令安装该工具
|
|
14
20
|
|
|
15
21
|
```
|
|
16
|
-
# 旧版
|
|
17
|
-
npm install -g vertx-ai
|
|
18
|
-
# 新版(从 0.3.25)
|
|
19
22
|
npm install -g zero-ai
|
|
20
23
|
```
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
等你看到下边的输出信息后,证明安装过程已完成:
|
|
23
26
|
|
|
24
27
|
```
|
|
25
28
|
/usr/local/bin/ai -> /usr/local/lib/node_modules/vertx-ai/src/ai.js
|
|
@@ -29,27 +32,25 @@ npm install -g zero-ai
|
|
|
29
32
|
added 77 packages from 119 contributors in 8.417s
|
|
30
33
|
```
|
|
31
34
|
|
|
32
|
-
## 2.
|
|
35
|
+
## 2. 常用命令说明
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
### 2.1. 三大命令
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
- ai:标准命令
|
|
40
|
+
- aj:后端专用命令(For Java)
|
|
41
|
+
- art:前端开发命令(For React)
|
|
39
42
|
|
|
40
|
-
### 2.
|
|
43
|
+
### 2.2. 工程初始化
|
|
41
44
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
```shell
|
|
46
|
+
# 前端工程初始化
|
|
47
|
+
ai init -name <name>
|
|
48
|
+
# 前端工程更新
|
|
49
|
+
ai sync
|
|
46
50
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* `src/components/generated/tool` - Zero中的组件开发目录
|
|
51
|
-
* `src/cab/cn/components/generated/tool` - Zero中的资源文件目录
|
|
52
|
-
* ZF环境变量设置后,设置目录下必须包含`pom.xml`文件(后端项目基础结构,Maven检测)
|
|
51
|
+
# 后端工程初始化
|
|
52
|
+
aj init
|
|
53
|
+
```
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
|
package/package.json
CHANGED
|
@@ -5,7 +5,9 @@ module.exports = () => {
|
|
|
5
5
|
[
|
|
6
6
|
['-n', '--name']
|
|
7
7
|
],
|
|
8
|
-
[
|
|
8
|
+
[
|
|
9
|
+
['-n', '--name']
|
|
10
|
+
]
|
|
9
11
|
);
|
|
10
12
|
// 第一步:环境检查
|
|
11
13
|
if (Ec.isExist(".git")) {
|
|
@@ -15,7 +17,7 @@ module.exports = () => {
|
|
|
15
17
|
// 第二步:检查 vertx-ui
|
|
16
18
|
const target = actual.name;
|
|
17
19
|
Ec.info(`工程构建目录:${target}`);
|
|
18
|
-
const cmd = `git clone https://gitee.com/silentbalanceyh/
|
|
20
|
+
const cmd = `git clone https://gitee.com/silentbalanceyh/scaffold-ui.git ${target}`;
|
|
19
21
|
child.execSync(cmd, {stdio: 'inherit'});
|
|
20
22
|
// 删除目标目录中的 .git 文件夹
|
|
21
23
|
Ec.info(`执行工程初始化:${target}`);
|
|
@@ -17,16 +17,16 @@ module.exports = () => {
|
|
|
17
17
|
// 2. 创建 .zero 目录
|
|
18
18
|
const cmdDir = `mkdir -p ${path}`;
|
|
19
19
|
child.execSync(cmdDir, {stdio: 'inherit'});
|
|
20
|
+
const pathSource = `${path}/scaffold-ui`
|
|
20
21
|
// 3. 删除 .zero/vertx-ui 目录
|
|
21
|
-
if (Ec.isExist(
|
|
22
|
-
Ec.info(`发现存在旧代码,正在删除:${
|
|
23
|
-
const cmdDel = `rm -rf ${
|
|
22
|
+
if (Ec.isExist(pathSource)) {
|
|
23
|
+
Ec.info(`发现存在旧代码,正在删除:${pathSource}`);
|
|
24
|
+
const cmdDel = `rm -rf ${pathSource}`;
|
|
24
25
|
child.execSync(cmdDel, {stdio: 'inherit'});
|
|
25
26
|
}
|
|
26
27
|
// 4. 重新拉取代码
|
|
27
|
-
const pathSource = `${path}/vertx-ui`
|
|
28
28
|
Ec.info(`拉取最新代码:${pathSource}`);
|
|
29
|
-
const cmdGit = `git clone https://gitee.com/silentbalanceyh/
|
|
29
|
+
const cmdGit = `git clone https://gitee.com/silentbalanceyh/scaffold-ui.git ${pathSource}`;
|
|
30
30
|
child.execSync(cmdGit, {stdio: 'inherit'});
|
|
31
31
|
const cmdRm = `rm -rf ${pathSource}/.git`;
|
|
32
32
|
child.execSync(cmdRm, {stdio: 'inherit'});
|