cloudcc-cli 2.3.5 → 2.3.7
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/.cursor/skills/cloudcc-cli-dev/SKILL.md +29 -23
- package/.cursor/skills/cloudcc-dev-skill/SKILL.md +26 -26
- package/README.md +68 -13
- package/bin/cc.js +6 -6
- package/mcp/cliRunner.js +2 -2
- package/mcp/tools/Application Creator/handler.js +1 -1
- package/mcp/tools/Approval/handler.js +3 -3
- package/mcp/tools/Class Creator/handler.js +2 -2
- package/mcp/tools/Class Detail Retriever/handler.js +1 -1
- package/mcp/tools/Class Editor Guide/handler.js +1 -1
- package/mcp/tools/Class List Retriever/handler.js +1 -1
- package/mcp/tools/Class Publisher/handler.js +1 -1
- package/mcp/tools/Class Puller/handler.js +1 -1
- package/mcp/tools/Client Script Detail Retriever/handler.js +1 -1
- package/mcp/tools/Client Script Editor Guide/handler.js +1 -1
- package/mcp/tools/Client Script List Retriever/handler.js +1 -1
- package/mcp/tools/Client Script Publisher/handler.js +1 -1
- package/mcp/tools/Client Script Puller/handler.js +2 -2
- package/mcp/tools/CloudCC Development Overview/handler.js +1 -1
- package/mcp/tools/Component Creator/handler.js +1 -1
- package/mcp/tools/Component Detail Retriever/handler.js +1 -1
- package/mcp/tools/Component Editor Guide/handler.js +1 -1
- package/mcp/tools/Component List Retriever/handler.js +1 -1
- package/mcp/tools/Component Publisher/handler.js +2 -2
- package/mcp/tools/Component Puller/handler.js +1 -1
- package/mcp/tools/Dev Environment Creator/handler.js +1 -1
- package/mcp/tools/Dev Environment Validator/handler.js +1 -1
- package/mcp/tools/Developer Key Setup Guide/handler.js +1 -1
- package/mcp/tools/Menu Creator/handler.js +1 -1
- package/mcp/tools/Object Creator/handler.js +2 -2
- package/mcp/tools/Object Fields Creator/handler.js +1 -1
- package/mcp/tools/Object Fields Retriever/handler.js +1 -1
- package/mcp/tools/Object List Retriever/handler.js +1 -1
- package/mcp/tools/Scheduled Class Creator/handler.js +1 -1
- package/mcp/tools/Scheduled Class Detail Retriever/handler.js +1 -1
- package/mcp/tools/Scheduled Class List Retriever/handler.js +1 -1
- package/mcp/tools/Scheduled Class Publisher/handler.js +1 -1
- package/mcp/tools/Scheduled Class Puller/handler.js +1 -1
- package/mcp/tools/Trigger Creator/handler.js +1 -1
- package/mcp/tools/Trigger Detail Retriever/handler.js +1 -1
- package/mcp/tools/Trigger Editor Guide/handler.js +1 -1
- package/mcp/tools/Trigger List Retriever/handler.js +1 -1
- package/mcp/tools/Trigger Publisher/handler.js +1 -1
- package/mcp/tools/Trigger Puller/handler.js +1 -1
- package/package.json +4 -2
- package/src/application/create.js +2 -2
- package/src/application/delete.js +2 -2
- package/src/application/doc.js +2 -2
- package/src/application/docs/devguide.md +25 -25
- package/src/application/docs/introduction.md +2 -2
- package/src/button/create.js +1 -1
- package/src/button/delete.js +1 -1
- package/src/button/doc.js +2 -2
- package/src/button/docs/devguide.md +11 -11
- package/src/button/get.js +1 -1
- package/src/button/index.js +1 -1
- package/src/classes/create.js +1 -1
- package/src/classes/delete.js +1 -1
- package/src/classes/detail.js +1 -1
- package/src/classes/doc.js +2 -2
- package/src/classes/docs/devguide.md +21 -21
- package/src/classes/get.js +1 -1
- package/src/classes/publish.js +1 -1
- package/src/classes/pull.js +1 -1
- package/src/classes/pullList.js +1 -1
- package/src/config/doc.js +2 -2
- package/src/config/docs/devguide.md +15 -15
- package/src/customPage/create.js +2 -2
- package/src/customPage/delete.js +2 -2
- package/src/customPage/doc.js +2 -2
- package/src/customPage/docs/devguide.md +27 -27
- package/src/customPage/get.js +1 -1
- package/src/customSetting/create.js +1 -1
- package/src/customSetting/delete.js +1 -1
- package/src/customSetting/deleteCustomSettingField.js +1 -1
- package/src/customSetting/detail.js +1 -1
- package/src/customSetting/docs/devguide.md +9 -9
- package/src/customSetting/editCustomSettingField.js +1 -1
- package/src/customSetting/get.js +1 -1
- package/src/customSetting/modify.js +1 -1
- package/src/customSetting/saveCustomSettingField.js +1 -1
- package/src/fields/delete.js +2 -2
- package/src/fields/docs/devguide.md +14 -14
- package/src/fields/docs/introduction.md +3 -3
- package/src/globalSelectList/create.js +1 -1
- package/src/globalSelectList/delete.js +1 -1
- package/src/globalSelectList/detail.js +1 -1
- package/src/globalSelectList/doc.js +2 -2
- package/src/globalSelectList/docs/devguide.md +7 -7
- package/src/globalSelectList/get.js +1 -1
- package/src/identityProvider/create.js +3 -3
- package/src/identityProvider/delete.js +3 -3
- package/src/identityProvider/doc.js +2 -2
- package/src/identityProvider/docs/devguide.md +10 -10
- package/src/identityProvider/download.js +1 -1
- package/src/identityProvider/get.js +1 -1
- package/src/menu/create-object.js +2 -2
- package/src/menu/create-page.js +2 -2
- package/src/menu/create-script.js +2 -2
- package/src/menu/create-site.js +2 -2
- package/src/menu/create.js +11 -11
- package/src/menu/delete.js +2 -2
- package/src/menu/doc.js +2 -2
- package/src/menu/docs/devguide.md +13 -13
- package/src/menu/docs/introduction.md +3 -3
- package/src/menu/get.js +1 -1
- package/src/object/create.js +2 -2
- package/src/object/delete.js +2 -2
- package/src/object/docs/devguide.md +11 -11
- package/src/pagelayout/create.js +6 -6
- package/src/pagelayout/delete.js +4 -4
- package/src/pagelayout/doc.js +2 -2
- package/src/pagelayout/docs/devguide.md +9 -9
- package/src/pagelayout/docs/introduction.md +1 -1
- package/src/pagelayout/get.js +4 -4
- package/src/permission/add.js +4 -4
- package/src/permission/assign.js +3 -3
- package/src/permission/docs/devguide.md +20 -20
- package/src/permission/docs/introduction.md +18 -18
- package/src/permission/get.js +1 -1
- package/src/permission/remove.js +4 -4
- package/src/plugin/delete.js +2 -2
- package/src/plugin/doc.js +2 -2
- package/src/plugin/docs/devguide.md +29 -29
- package/src/profile/create.js +5 -5
- package/src/profile/delete.js +2 -2
- package/src/profile/doc.js +2 -2
- package/src/profile/docs/devguide.md +8 -8
- package/src/profile/docs/introduction.md +12 -12
- package/src/profile/get.js +1 -1
- package/src/project/docs/devguide.md +19 -6
- package/src/recordType/create.js +1 -1
- package/src/recordType/delete.js +1 -1
- package/src/recordType/doc.js +2 -2
- package/src/recordType/docs/devguide.md +10 -10
- package/src/recordType/editInfo.js +1 -1
- package/src/recordType/editSave.js +1 -1
- package/src/recordType/getList.js +1 -1
- package/src/recordType/newInfo.js +1 -1
- package/src/recordType/validDelete.js +1 -1
- package/src/res.md +1 -1
- package/src/role/create.js +6 -6
- package/src/role/delete.js +2 -2
- package/src/role/doc.js +2 -2
- package/src/role/docs/devguide.md +9 -9
- package/src/role/docs/introduction.md +13 -13
- package/src/role/get.js +1 -1
- package/src/scheduleJob/doc.js +1 -1
- package/src/scheduleJob/docs/devguide.md +6 -6
- package/src/scheduleJob/docs/introduction.md +6 -6
- package/src/script/docs/devguide.md +18 -18
- package/src/singleSignOn/delete.js +3 -3
- package/src/singleSignOn/doc.js +2 -2
- package/src/singleSignOn/docs/devguide.md +5 -5
- package/src/singleSignOn/get.js +1 -1
- package/src/staticResource/count.js +1 -1
- package/src/staticResource/create.js +1 -1
- package/src/staticResource/delete.js +1 -1
- package/src/staticResource/detail.js +1 -1
- package/src/staticResource/docs/devguide.md +11 -11
- package/src/staticResource/get.js +1 -1
- package/src/timer/create.js +1 -1
- package/src/timer/delete.js +1 -1
- package/src/timer/detail.js +1 -1
- package/src/timer/doc.js +2 -2
- package/src/timer/docs/devguide.md +19 -19
- package/src/timer/get.js +1 -1
- package/src/timer/publish.js +1 -1
- package/src/timer/pull.js +1 -1
- package/src/timer/pullList.js +1 -1
- package/src/triggers/detail.js +1 -1
- package/src/triggers/doc.js +2 -2
- package/src/triggers/docs/devguide.md +23 -23
- package/src/triggers/get.js +1 -1
- package/src/triggers/pullList.js +1 -1
- package/src/user/create.js +2 -2
- package/src/user/delete.js +2 -2
- package/src/user/doc.js +2 -2
- package/src/user/docs/devguide.md +13 -13
- package/src/user/docs/introduction.md +12 -12
- package/src/user/get.js +1 -1
- package/src/user/update.js +3 -3
- package/src/user/view.js +2 -2
- package/src/validationRule/create.js +5 -5
- package/src/validationRule/delete.js +2 -2
- package/src/validationRule/doc.js +2 -2
- package/src/validationRule/docs/devguide.md +7 -7
- package/src/validationRule/docs/introduction.md +11 -11
- package/src/validationRule/get.js +1 -1
- package/src/version/actionHelp.js +3 -3
- package/src/version/doctor.js +1 -1
- package/src/version/get.js +0 -6
- package/src/version/help.js +15 -14
- package/src/version/initHelp.js +2 -2
- package/src/version/listModuleCommands.js +2 -2
- package/src/version/stats.js +1 -1
- package/test/application.cli.test.js +1 -1
- package/test/classes.cli.test.js +1 -1
- package/test/customSetting.cli.test.js +1 -1
- package/test/fields.cli.test.js +2 -2
- package/test/globalSelectList.cli.test.js +1 -1
- package/test/menu-script.cli.test.js +1 -1
- package/test/menu.cli.test.js +1 -1
- package/test/object.cli.test.js +1 -1
- package/test/plugin.cli.test.js +1 -1
- package/test/scheduleJob.cli.test.js +1 -1
- package/test/script.cli.test.js +1 -1
- package/test/staticResource.cli.test.js +1 -1
- package/test/timer.cli.test.js +1 -1
- package/test/trigger.cli.test.js +1 -1
- package/utils/checkVersion.js +9 -13
- package/utils/commandStats.js +7 -7
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
### 创建验证规则
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
|
-
|
|
16
|
+
cloudcc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMessage]
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
**参数说明:**
|
|
@@ -30,16 +30,16 @@ cc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMe
|
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
32
|
# 交互式输入所有信息
|
|
33
|
-
|
|
33
|
+
cloudcc create validationRule . "b00"
|
|
34
34
|
|
|
35
35
|
# 非交互式创建
|
|
36
|
-
|
|
36
|
+
cloudcc create validationRule . "b00" "规则1" "Batch_Size__c__f==5" "数量必须是5"
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
### 查询验证规则列表
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
|
|
42
|
+
cloudcc get validationRule <projectPath> <objectPrefix>
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
**参数说明:**
|
|
@@ -53,13 +53,13 @@ cc get validationRule <projectPath> <objectPrefix>
|
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
# 获取对象 b00 的所有验证规则
|
|
56
|
-
|
|
56
|
+
cloudcc get validationRule . "b00"
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
### 删除验证规则
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
-
|
|
62
|
+
cloudcc delete validationRule <projectPath> <ruleId>
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
**参数说明:**
|
|
@@ -72,5 +72,5 @@ cc delete validationRule <projectPath> <ruleId>
|
|
|
72
72
|
**示例:**
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
|
-
|
|
75
|
+
cloudcc delete validationRule . 202689E55795D38oAQlN
|
|
76
76
|
```
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
创建一个新的 CloudCC 验证规则。
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
cloudcc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMessage]
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
**参数说明:**
|
|
@@ -40,10 +40,10 @@ cc create validationRule <path> <objectPrefix> [ruleName] [ruleContent] [errorMe
|
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
# 交互式输入所有信息
|
|
43
|
-
|
|
43
|
+
cloudcc create validationRule . "b00"
|
|
44
44
|
|
|
45
45
|
# 非交互式创建
|
|
46
|
-
|
|
46
|
+
cloudcc create validationRule . "b00" "规则1" "Batch_Size__c__f==5" "数量必须是5"
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
---
|
|
@@ -53,7 +53,7 @@ cc create validationRule . "b00" "规则1" "Batch_Size__c__f==5" "数量必须
|
|
|
53
53
|
获取指定对象的所有验证规则列表。
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
|
-
|
|
56
|
+
cloudcc get validationRule <projectPath> <objectPrefix>
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
**参数说明:**
|
|
@@ -67,7 +67,7 @@ cc get validationRule <projectPath> <objectPrefix>
|
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
69
|
# 获取对象 b00 的所有验证规则
|
|
70
|
-
|
|
70
|
+
cloudcc get validationRule . "b00"
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
---
|
|
@@ -77,7 +77,7 @@ cc get validationRule . "b00"
|
|
|
77
77
|
删除指定的验证规则。
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
|
-
|
|
80
|
+
cloudcc delete validationRule <projectPath> <ruleId>
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
**参数说明:**
|
|
@@ -91,7 +91,7 @@ cc delete validationRule <projectPath> <ruleId>
|
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
93
|
# 删除指定规则
|
|
94
|
-
|
|
94
|
+
cloudcc delete validationRule . 202689E55795D38oAQlN
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
---
|
|
@@ -105,16 +105,16 @@ cc delete validationRule . 202689E55795D38oAQlN
|
|
|
105
105
|
cat cloudcc-cli.config.js
|
|
106
106
|
|
|
107
107
|
# 2. 查询对象现有的验证规则
|
|
108
|
-
|
|
108
|
+
cloudcc get validationRule . "b00"
|
|
109
109
|
|
|
110
110
|
# 3. 创建新验证规则
|
|
111
|
-
|
|
111
|
+
cloudcc create validationRule . "b00"
|
|
112
112
|
|
|
113
113
|
# 4. 验证规则创建成功
|
|
114
|
-
|
|
114
|
+
cloudcc get validationRule . "b00"
|
|
115
115
|
|
|
116
116
|
# 5. 如需删除
|
|
117
|
-
#
|
|
117
|
+
# cloudcc delete validationRule . <ruleId>
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
---
|
|
@@ -3,7 +3,7 @@ const { getPackageJson } = require("../../utils/config");
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 查询验证规则列表
|
|
6
|
-
* 用法:
|
|
6
|
+
* 用法:cloudcc get validationRule <projectPath> <objectPrefix>
|
|
7
7
|
* 接口:POST /api/validateRule/queryByPrefix
|
|
8
8
|
* 参数:{ prefix: "b00" }
|
|
9
9
|
*/
|
|
@@ -7,18 +7,18 @@ function actionHelp(argvs) {
|
|
|
7
7
|
console.error()
|
|
8
8
|
if (list.length === 0) {
|
|
9
9
|
console.error(chalk.yellow(`没有 resource 支持 action「${action}」。`))
|
|
10
|
-
console.error(chalk.gray("运行 ") + chalk.green("
|
|
10
|
+
console.error(chalk.gray("运行 ") + chalk.green("cloudcc --help") + chalk.gray(" 查看全部命令。"))
|
|
11
11
|
console.error()
|
|
12
12
|
return
|
|
13
13
|
}
|
|
14
|
-
console.error(chalk.bold.cyan(`
|
|
14
|
+
console.error(chalk.bold.cyan(`cloudcc ${action}`) + chalk.gray(" <resource> [args...]"))
|
|
15
15
|
console.error()
|
|
16
16
|
console.error(chalk.yellow("可用的 resource:"))
|
|
17
17
|
for (const r of list) {
|
|
18
18
|
console.error(" " + chalk.green(r))
|
|
19
19
|
}
|
|
20
20
|
console.error()
|
|
21
|
-
console.error(chalk.gray("示例:") + chalk.green(`
|
|
21
|
+
console.error(chalk.gray("示例:") + chalk.green(`cloudcc ${action} ${list[0]}`) + chalk.gray(" <后续参数见各模块文档>"))
|
|
22
22
|
console.error()
|
|
23
23
|
}
|
|
24
24
|
|
package/src/version/doctor.js
CHANGED
|
@@ -5,7 +5,7 @@ const pkg = require("../../package.json")
|
|
|
5
5
|
|
|
6
6
|
function doctor() {
|
|
7
7
|
console.error()
|
|
8
|
-
console.error(chalk.bold.cyan("
|
|
8
|
+
console.error(chalk.bold.cyan("cloudcc doctor") + chalk.gray(" — 环境自检"))
|
|
9
9
|
console.error()
|
|
10
10
|
console.error(chalk.green("✓") + " Node " + process.version)
|
|
11
11
|
console.error(chalk.green("✓") + " cloudcc-cli v" + pkg.version)
|
package/src/version/get.js
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
const chalk = require("chalk")
|
|
2
2
|
const pkg = require("../../package.json")
|
|
3
|
-
const { getReleaseForExact, defaultReadmePath } = require("../../utils/readmeReleases")
|
|
4
|
-
const { printReleaseNotesBlocks } = require("../../utils/formatReleaseNotes")
|
|
5
3
|
|
|
6
4
|
function get() {
|
|
7
5
|
console.error()
|
|
8
6
|
console.error(chalk.green(`cloudcc-cli version: ${pkg.version}`))
|
|
9
|
-
const rel = getReleaseForExact(defaultReadmePath(), pkg.version)
|
|
10
|
-
if (rel) {
|
|
11
|
-
printReleaseNotesBlocks([rel], console.error)
|
|
12
|
-
}
|
|
13
7
|
console.error()
|
|
14
8
|
}
|
|
15
9
|
|
package/src/version/help.js
CHANGED
|
@@ -4,21 +4,22 @@ const { getModuleGroups, describeActionLine } = require("./listModuleCommands")
|
|
|
4
4
|
|
|
5
5
|
function help() {
|
|
6
6
|
console.error()
|
|
7
|
-
console.error(chalk.bold.cyan("cloudcc-cli (cc)") + chalk.gray(` v${pkg.version}`))
|
|
7
|
+
console.error(chalk.bold.cyan("cloudcc-cli (cc / cloudcc)") + chalk.gray(` v${pkg.version}`))
|
|
8
|
+
console.error(chalk.dim(" 与系统 C 编译器 cc 冲突时请使用 cloudcc"))
|
|
8
9
|
console.error()
|
|
9
10
|
console.error(chalk.yellow("Usage:"))
|
|
10
|
-
console.error(" " + chalk.green("cc") + " <action> <resource> [args...]")
|
|
11
|
+
console.error(" " + chalk.green("cc") + " / " + chalk.green("cloudcc") + " <action> <resource> [args...]")
|
|
11
12
|
console.error()
|
|
12
13
|
console.error(chalk.yellow("Global:"))
|
|
13
|
-
console.error(" " + chalk.green("
|
|
14
|
-
console.error(" " + chalk.green("
|
|
15
|
-
console.error(" " + chalk.green("
|
|
16
|
-
console.error(" " + chalk.green("
|
|
17
|
-
console.error(" " + chalk.green("
|
|
18
|
-
console.error(" " + chalk.green("
|
|
19
|
-
console.error(" " + chalk.green("
|
|
20
|
-
console.error(" " + chalk.green("
|
|
21
|
-
console.error(" " + chalk.green("
|
|
14
|
+
console.error(" " + chalk.green("cloudcc --help") + ", " + chalk.green("-h") + ", " + chalk.green("cloudcc help") + " 显示本帮助")
|
|
15
|
+
console.error(" " + chalk.green("cloudcc --version") + ", " + chalk.green("-v") + " 打印版本号")
|
|
16
|
+
console.error(" " + chalk.green("cloudcc update") + " 升级全局 cloudcc-cli")
|
|
17
|
+
console.error(" " + chalk.green("cloudcc uninstall") + " 卸载全局 cloudcc-cli")
|
|
18
|
+
console.error(" " + chalk.green("cloudcc doctor") + " 环境自检(Node、配置、CLI 版本)")
|
|
19
|
+
console.error(" " + chalk.green("cloudcc docs") + " 在浏览器打开 CloudCC 帮助中心")
|
|
20
|
+
console.error(" " + chalk.green("cloudcc stats") + " 查看本地命令调用统计(默认开启," + chalk.gray("CLOUDCC_CLI_STATS=0") + " 可关闭)")
|
|
21
|
+
console.error(" " + chalk.green("cloudcc init") + " [项目名] 等同于 cloudcc create project")
|
|
22
|
+
console.error(" " + chalk.green("cloudcc <action> -h") + " 查看该 action 下可用的 resource")
|
|
22
23
|
console.error()
|
|
23
24
|
console.error(chalk.yellow("模块 (resource)"))
|
|
24
25
|
console.error()
|
|
@@ -29,7 +30,7 @@ function help() {
|
|
|
29
30
|
console.error(chalk.bold.white(" " + title))
|
|
30
31
|
const ex = resources[0]
|
|
31
32
|
for (const a of actions) {
|
|
32
|
-
const cmd = "
|
|
33
|
+
const cmd = "cloudcc " + a + " " + ex
|
|
33
34
|
const note = describeActionLine(ex, a)
|
|
34
35
|
console.error(" " + chalk.green(cmd) + " " + chalk.gray(note))
|
|
35
36
|
}
|
|
@@ -37,8 +38,8 @@ function help() {
|
|
|
37
38
|
}
|
|
38
39
|
|
|
39
40
|
console.error(chalk.yellow("Examples:"))
|
|
40
|
-
console.error(" " + chalk.gray("
|
|
41
|
-
console.error(" " + chalk.gray("
|
|
41
|
+
console.error(" " + chalk.gray("cloudcc doc object introduction"))
|
|
42
|
+
console.error(" " + chalk.gray("cloudcc get object Account"))
|
|
42
43
|
console.error()
|
|
43
44
|
console.error(chalk.gray("Developer docs: https://help.cloudcc.cn/"))
|
|
44
45
|
console.error()
|
package/src/version/initHelp.js
CHANGED
|
@@ -2,10 +2,10 @@ const chalk = require("chalk")
|
|
|
2
2
|
|
|
3
3
|
function initHelp() {
|
|
4
4
|
console.error()
|
|
5
|
-
console.error(chalk.bold.cyan("
|
|
5
|
+
console.error(chalk.bold.cyan("cloudcc init") + chalk.gray(" — 与 ") + chalk.green("cloudcc create project") + chalk.gray(" 相同"))
|
|
6
6
|
console.error()
|
|
7
7
|
console.error(chalk.yellow("用法:"))
|
|
8
|
-
console.error(" " + chalk.green("
|
|
8
|
+
console.error(" " + chalk.green("cloudcc init") + " [项目名]")
|
|
9
9
|
console.error(chalk.gray(" 不传项目名时进入交互式创建。"))
|
|
10
10
|
console.error()
|
|
11
11
|
}
|
|
@@ -39,7 +39,7 @@ const MODULE_KEYS_ORDER = [
|
|
|
39
39
|
]
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
* 各 resource 一句话说明(供 --help 展示)。与自动解析的 action 列表互补,不替代 `
|
|
42
|
+
* 各 resource 一句话说明(供 --help 展示)。与自动解析的 action 列表互补,不替代 `cloudcc doc <resource> introduction`。
|
|
43
43
|
*/
|
|
44
44
|
const MODULE_HINT = {
|
|
45
45
|
project: "创建/初始化 CloudCC 开发项目。",
|
|
@@ -181,7 +181,7 @@ const RESOURCE_CN = {
|
|
|
181
181
|
}
|
|
182
182
|
|
|
183
183
|
/**
|
|
184
|
-
* 单行命令说明(替代行尾「…」),与
|
|
184
|
+
* 单行命令说明(替代行尾「…」),与 cloudcc <action> <resource> 对应。
|
|
185
185
|
*/
|
|
186
186
|
function describeActionLine(resource, action) {
|
|
187
187
|
const n = RESOURCE_CN[resource] || resource
|
package/src/version/stats.js
CHANGED
|
@@ -10,7 +10,7 @@ function stats() {
|
|
|
10
10
|
const entries = Object.entries(data.counts || {}).sort((a, b) => b[1] - a[1])
|
|
11
11
|
|
|
12
12
|
console.error()
|
|
13
|
-
console.error(chalk.bold.cyan("
|
|
13
|
+
console.error(chalk.bold.cyan("cloudcc command statistics"))
|
|
14
14
|
console.error(chalk.gray("File: ") + chalk.dim(statsFilePath()))
|
|
15
15
|
console.error(
|
|
16
16
|
chalk.gray("Recording: ") +
|
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
package/test/classes.cli.test.js
CHANGED
|
@@ -13,7 +13,7 @@ function quoteArg(value) {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async function runCc(args) {
|
|
16
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
16
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
17
17
|
return execAsync(cmd, { cwd: repoRoot });
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
package/test/fields.cli.test.js
CHANGED
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -44,7 +44,7 @@ test("字段管理流程:获取对象列表→create 字段→get 字段列表
|
|
|
44
44
|
|
|
45
45
|
t.test("2) create 创建一个文本字段(S)", async () => {
|
|
46
46
|
assert.ok(objId, "需要对象 id");
|
|
47
|
-
// create fields 调用约定:
|
|
47
|
+
// create fields 调用约定:cloudcc create fields <path> <fieldType> <objid> <nameLabel> [...]
|
|
48
48
|
const { stdout, stderr } = await runCc(["create", "fields", repoRoot, "S", objId, fieldLabel]);
|
|
49
49
|
// create fields 会通过 console.error 输出创建结果(见 src/fields/create.js)
|
|
50
50
|
assert.match(
|
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
package/test/menu.cli.test.js
CHANGED
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
package/test/object.cli.test.js
CHANGED
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
package/test/plugin.cli.test.js
CHANGED
|
@@ -14,7 +14,7 @@ function quoteArg(value) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async function runCc(args) {
|
|
17
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
17
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
18
18
|
return execAsync(cmd, { cwd: repoRoot });
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
package/test/script.cli.test.js
CHANGED
|
@@ -14,7 +14,7 @@ function quoteArg(value) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async function runCc(args) {
|
|
17
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
17
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
18
18
|
return execAsync(cmd, { cwd: repoRoot });
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -12,7 +12,7 @@ function quoteArg(value) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
async function runCc(args) {
|
|
15
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
15
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
16
16
|
return execAsync(cmd, { cwd: repoRoot });
|
|
17
17
|
}
|
|
18
18
|
|
package/test/timer.cli.test.js
CHANGED
|
@@ -14,7 +14,7 @@ function quoteArg(value) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async function runCc(args) {
|
|
17
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
17
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
18
18
|
return execAsync(cmd, { cwd: repoRoot });
|
|
19
19
|
}
|
|
20
20
|
|
package/test/trigger.cli.test.js
CHANGED
|
@@ -14,7 +14,7 @@ function quoteArg(value) {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
async function runCc(args) {
|
|
17
|
-
const cmd = `npx --prefix "${repoRoot}"
|
|
17
|
+
const cmd = `npx --prefix "${repoRoot}" cloudcc ${args.map(quoteArg).join(" ")}`;
|
|
18
18
|
return execAsync(cmd, { cwd: repoRoot });
|
|
19
19
|
}
|
|
20
20
|
|
package/utils/checkVersion.js
CHANGED
|
@@ -7,7 +7,6 @@ const fs = require('fs');
|
|
|
7
7
|
const path = require('path');
|
|
8
8
|
const {
|
|
9
9
|
semverCompare,
|
|
10
|
-
getReleaseForExact,
|
|
11
10
|
getReleasesBetween,
|
|
12
11
|
defaultReadmePath,
|
|
13
12
|
} = require("./readmeReleases");
|
|
@@ -40,7 +39,7 @@ function checkNpmVersion() {
|
|
|
40
39
|
console.error(' ' + chalk.magenta('★') + ' Changelog : ' + chalk.cyan('https://www.npmjs.com/package/cloudcc-cli'));
|
|
41
40
|
console.error(' ' + chalk.gray('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
printReadmeReleaseNotesIfUpgradeNeeded(config.version, onlineVersion);
|
|
44
43
|
|
|
45
44
|
if (onlineVersionNum - currentVersion > 0) {
|
|
46
45
|
return onlineVersion;
|
|
@@ -49,20 +48,17 @@ function checkNpmVersion() {
|
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
|
-
* Prints README `# ReleaseV*` sections
|
|
53
|
-
*
|
|
51
|
+
* Prints README `# ReleaseV*` sections only when the registry has a **newer** version than local:
|
|
52
|
+
* all release blocks from current (exclusive) through latest (inclusive). If already up to date,
|
|
53
|
+
* prints nothing (changelog link remains in the version panel above).
|
|
54
54
|
*/
|
|
55
|
-
function
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
if (semverCompare(latestVersion, currentVersion) > 0) {
|
|
59
|
-
blocks = getReleasesBetween(readmePath, currentVersion, latestVersion);
|
|
60
|
-
} else {
|
|
61
|
-
const one = getReleaseForExact(readmePath, currentVersion);
|
|
62
|
-
if (one) blocks = [one];
|
|
55
|
+
function printReadmeReleaseNotesIfUpgradeNeeded(currentVersion, latestVersion) {
|
|
56
|
+
if (semverCompare(latestVersion, currentVersion) <= 0) {
|
|
57
|
+
return;
|
|
63
58
|
}
|
|
59
|
+
const readmePath = defaultReadmePath();
|
|
60
|
+
const blocks = getReleasesBetween(readmePath, currentVersion, latestVersion);
|
|
64
61
|
if (blocks.length === 0) {
|
|
65
|
-
console.error('\n');
|
|
66
62
|
return;
|
|
67
63
|
}
|
|
68
64
|
printReleaseNotesBlocks(blocks, console.error);
|
package/utils/commandStats.js
CHANGED
|
@@ -4,7 +4,7 @@ const os = require("os")
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* 默认开启:在 ~/.cloudcc-cli/command-stats.json 累计调用次数;
|
|
7
|
-
* 键为人类可读形式,如 `
|
|
7
|
+
* 键为人类可读形式,如 `cloudcc doc classes`、`cloudcc get brief`。
|
|
8
8
|
* 设 `CLOUDCC_CLI_STATS=0` / `false` / `off` 可关闭。
|
|
9
9
|
*/
|
|
10
10
|
function isEnabled() {
|
|
@@ -32,20 +32,20 @@ function formatRecordKey(action, resource) {
|
|
|
32
32
|
action === "-version" ||
|
|
33
33
|
action === "--version"
|
|
34
34
|
) {
|
|
35
|
-
return "
|
|
35
|
+
return "cloudcc --version"
|
|
36
36
|
}
|
|
37
37
|
if (action === "-h" || action === "--h" || action === "--help") {
|
|
38
|
-
return "
|
|
38
|
+
return "cloudcc --help"
|
|
39
39
|
}
|
|
40
|
-
return `
|
|
40
|
+
return `cloudcc ${action}`
|
|
41
41
|
}
|
|
42
42
|
if (res === "_help") {
|
|
43
|
-
return `
|
|
43
|
+
return `cloudcc ${action} --help`
|
|
44
44
|
}
|
|
45
45
|
if (res === "-h" || res === "--help") {
|
|
46
|
-
return `
|
|
46
|
+
return `cloudcc ${action} -h`
|
|
47
47
|
}
|
|
48
|
-
return `
|
|
48
|
+
return `cloudcc ${action} ${res}`
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|