zero-ai 1.0.86 → 1.0.88
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.
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"lastScanned": 1774749690808,
|
|
4
|
+
"projectRoot": "/Users/lang/zero-cloud/app-zero/r2mo-matrix/r2mo-init",
|
|
5
|
+
"techStack": {
|
|
6
|
+
"languages": [
|
|
7
|
+
{
|
|
8
|
+
"name": "JavaScript/TypeScript",
|
|
9
|
+
"version": null,
|
|
10
|
+
"confidence": "high",
|
|
11
|
+
"markers": [
|
|
12
|
+
"package.json"
|
|
13
|
+
]
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"frameworks": [],
|
|
17
|
+
"packageManager": "npm",
|
|
18
|
+
"runtime": null
|
|
19
|
+
},
|
|
20
|
+
"build": {
|
|
21
|
+
"buildCommand": null,
|
|
22
|
+
"testCommand": "npm test",
|
|
23
|
+
"lintCommand": null,
|
|
24
|
+
"devCommand": null,
|
|
25
|
+
"scripts": {
|
|
26
|
+
"test": "src/index.test.js"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"conventions": {
|
|
30
|
+
"namingStyle": null,
|
|
31
|
+
"importStyle": null,
|
|
32
|
+
"testPattern": null,
|
|
33
|
+
"fileOrganization": null
|
|
34
|
+
},
|
|
35
|
+
"structure": {
|
|
36
|
+
"isMonorepo": false,
|
|
37
|
+
"workspaces": [],
|
|
38
|
+
"mainDirectories": [
|
|
39
|
+
"assets",
|
|
40
|
+
"docs",
|
|
41
|
+
"src",
|
|
42
|
+
"test"
|
|
43
|
+
],
|
|
44
|
+
"gitBranches": {
|
|
45
|
+
"defaultBranch": "master",
|
|
46
|
+
"branchingStrategy": null
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"customNotes": [],
|
|
50
|
+
"directoryMap": {
|
|
51
|
+
"_layouts": {
|
|
52
|
+
"path": "_layouts",
|
|
53
|
+
"purpose": null,
|
|
54
|
+
"fileCount": 1,
|
|
55
|
+
"lastAccessed": 1774749690773,
|
|
56
|
+
"keyFiles": [
|
|
57
|
+
"default.html"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"_sass": {
|
|
61
|
+
"path": "_sass",
|
|
62
|
+
"purpose": null,
|
|
63
|
+
"fileCount": 2,
|
|
64
|
+
"lastAccessed": 1774749690773,
|
|
65
|
+
"keyFiles": [
|
|
66
|
+
"jekyll-theme-dinky.scss",
|
|
67
|
+
"rouge-github.scss"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
"assets": {
|
|
71
|
+
"path": "assets",
|
|
72
|
+
"purpose": "Static assets",
|
|
73
|
+
"fileCount": 0,
|
|
74
|
+
"lastAccessed": 1774749690781,
|
|
75
|
+
"keyFiles": []
|
|
76
|
+
},
|
|
77
|
+
"configs": {
|
|
78
|
+
"path": "configs",
|
|
79
|
+
"purpose": null,
|
|
80
|
+
"fileCount": 1,
|
|
81
|
+
"lastAccessed": 1774749690784,
|
|
82
|
+
"keyFiles": [
|
|
83
|
+
"sorts.json"
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
"docs": {
|
|
87
|
+
"path": "docs",
|
|
88
|
+
"purpose": "Documentation",
|
|
89
|
+
"fileCount": 0,
|
|
90
|
+
"lastAccessed": 1774749690784,
|
|
91
|
+
"keyFiles": []
|
|
92
|
+
},
|
|
93
|
+
"document": {
|
|
94
|
+
"path": "document",
|
|
95
|
+
"purpose": null,
|
|
96
|
+
"fileCount": 0,
|
|
97
|
+
"lastAccessed": 1774749690788,
|
|
98
|
+
"keyFiles": []
|
|
99
|
+
},
|
|
100
|
+
"script": {
|
|
101
|
+
"path": "script",
|
|
102
|
+
"purpose": null,
|
|
103
|
+
"fileCount": 12,
|
|
104
|
+
"lastAccessed": 1774749690794,
|
|
105
|
+
"keyFiles": [
|
|
106
|
+
"bootstrap",
|
|
107
|
+
"cibuild",
|
|
108
|
+
"clear-excel-template-data.js",
|
|
109
|
+
"create-ex-api-templates.js",
|
|
110
|
+
"inspect-excel-templates.js"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"src": {
|
|
114
|
+
"path": "src",
|
|
115
|
+
"purpose": "Source code",
|
|
116
|
+
"fileCount": 1,
|
|
117
|
+
"lastAccessed": 1774749690799,
|
|
118
|
+
"keyFiles": [
|
|
119
|
+
"ai.js"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"test": {
|
|
123
|
+
"path": "test",
|
|
124
|
+
"purpose": "Test files",
|
|
125
|
+
"fileCount": 5,
|
|
126
|
+
"lastAccessed": 1774749690800,
|
|
127
|
+
"keyFiles": [
|
|
128
|
+
"csv.json",
|
|
129
|
+
"csv.zero",
|
|
130
|
+
"data.zero",
|
|
131
|
+
"key.json",
|
|
132
|
+
"uk.json"
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
"hotPaths": [
|
|
137
|
+
{
|
|
138
|
+
"path": "src/commander-ai/index.js",
|
|
139
|
+
"accessCount": 1,
|
|
140
|
+
"lastAccessed": 1774750534170,
|
|
141
|
+
"type": "file"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"path": "src/epic/index.js",
|
|
145
|
+
"accessCount": 1,
|
|
146
|
+
"lastAccessed": 1774750534369,
|
|
147
|
+
"type": "file"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"userDirectives": []
|
|
151
|
+
}
|
package/package.json
CHANGED
|
@@ -89,25 +89,72 @@ module.exports = async (options) => {
|
|
|
89
89
|
Ec.info(` ${index + 1}. ${file}`);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
|
|
92
|
+
// 按前缀分组 MDC 文件
|
|
93
|
+
const prefixGroups = [
|
|
94
|
+
{ prefix: "r2-spec-", label: "核心规范" },
|
|
95
|
+
{ prefix: "r2-go-", label: "GoLang全栈开发" },
|
|
96
|
+
{ prefix: "r2-rust-", label: "Rust前端开发" },
|
|
97
|
+
{ prefix: "r2-ui", label: "AntD前端开发" },
|
|
98
|
+
{ prefix: "r2-backend-spring-", label: "Spring后端开发" },
|
|
99
|
+
{ prefix: "r2-backend-zero-", label: "Zero后端开发" },
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
const groupedFiles = {};
|
|
103
|
+
const matchedFiles = new Set();
|
|
104
|
+
prefixGroups.forEach(({ prefix }) => {
|
|
105
|
+
const matched = ruleFiles.filter(f => f.startsWith(prefix));
|
|
106
|
+
if (matched.length > 0) {
|
|
107
|
+
groupedFiles[prefix] = matched;
|
|
108
|
+
matched.forEach(f => matchedFiles.add(f));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
const ungroupedFiles = ruleFiles.filter(f => !matchedFiles.has(f));
|
|
113
|
+
|
|
114
|
+
// 构造选择列表:前缀组(显示中文标签+数量)+ 未匹配文件并排
|
|
115
|
+
const mdcChoices = [];
|
|
116
|
+
prefixGroups.forEach(({ prefix, label }) => {
|
|
117
|
+
if (groupedFiles[prefix]) {
|
|
118
|
+
mdcChoices.push({
|
|
119
|
+
name: `${label}(${groupedFiles[prefix].length} 个文件)`,
|
|
120
|
+
value: { type: "group", prefix },
|
|
121
|
+
checked: false,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
ungroupedFiles.forEach(file => {
|
|
126
|
+
mdcChoices.push({
|
|
127
|
+
name: file,
|
|
128
|
+
value: { type: "single", file },
|
|
129
|
+
checked: false,
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const { selectedChoices } = await inquirer.prompt([
|
|
93
134
|
{
|
|
94
135
|
type: "checkbox",
|
|
95
|
-
name: "
|
|
136
|
+
name: "selectedChoices",
|
|
96
137
|
message: "请选择要安装的规则文件:",
|
|
97
138
|
loop: false,
|
|
98
|
-
choices:
|
|
99
|
-
name: file,
|
|
100
|
-
value: file,
|
|
101
|
-
checked: false
|
|
102
|
-
}))
|
|
139
|
+
choices: mdcChoices,
|
|
103
140
|
}
|
|
104
141
|
]);
|
|
105
142
|
|
|
106
|
-
if (
|
|
143
|
+
if (selectedChoices.length === 0) {
|
|
107
144
|
Ec.info(`未选择任何文件,操作取消。`);
|
|
108
145
|
process.exit(0);
|
|
109
146
|
}
|
|
110
147
|
|
|
148
|
+
// 展开所选项为最终文件列表
|
|
149
|
+
const selectedFiles = [];
|
|
150
|
+
selectedChoices.forEach(choice => {
|
|
151
|
+
if (choice.type === "group") {
|
|
152
|
+
groupedFiles[choice.prefix].forEach(f => selectedFiles.push(f));
|
|
153
|
+
} else {
|
|
154
|
+
selectedFiles.push(choice.file);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
|
|
111
158
|
const { selectedTargets } = await inquirer.prompt([
|
|
112
159
|
{
|
|
113
160
|
type: "checkbox",
|
|
@@ -160,11 +160,10 @@ module.exports = (options) => {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// 1. 环境检查(仅正向同步需要)
|
|
163
|
-
if (!
|
|
164
|
-
Ec.error("
|
|
163
|
+
if (!fs.existsSync("package.json")) {
|
|
164
|
+
Ec.error("当前目录不包含 package.json,请在前端项目根目录执行此命令!");
|
|
165
165
|
return;
|
|
166
166
|
}
|
|
167
|
-
|
|
168
167
|
let pathSource;
|
|
169
168
|
if (parsed.mode) {
|
|
170
169
|
// 本地模式
|
|
@@ -200,12 +199,28 @@ module.exports = (options) => {
|
|
|
200
199
|
COMMANDS.forEach(command => {
|
|
201
200
|
Ec.info(`处理目录:${command.green}`);
|
|
202
201
|
if (command.endsWith("/")) {
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
const srcDir = `${pathSource}/${command}`;
|
|
203
|
+
if (!fs.existsSync(srcDir)) {
|
|
204
|
+
Ec.info(`源目录不存在,跳过:${srcDir}`);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const destDir = path.resolve(outputBase, command);
|
|
208
|
+
if (!fs.existsSync(destDir)) {
|
|
209
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
205
210
|
}
|
|
206
|
-
child.execSync(`cp -rf ${
|
|
211
|
+
child.execSync(`cp -rf "${srcDir}"/. "${destDir}"`, optionsWait);
|
|
207
212
|
} else {
|
|
208
|
-
|
|
213
|
+
const srcFile = `${pathSource}/${command}`;
|
|
214
|
+
if (!fs.existsSync(srcFile)) {
|
|
215
|
+
Ec.info(`源文件不存在,跳过:${srcFile}`);
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const destFile = path.resolve(outputBase, command);
|
|
219
|
+
const destDir = path.dirname(destFile);
|
|
220
|
+
if (!fs.existsSync(destDir)) {
|
|
221
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
222
|
+
}
|
|
223
|
+
child.execSync(`cp -rf "${srcFile}" "${destFile}"`, optionsWait);
|
|
209
224
|
}
|
|
210
225
|
});
|
|
211
226
|
Ec.info(`主框架更新完成:${pathSource}!`.help);
|