@agile-team/robot-cli 1.1.5 → 1.1.6
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/lib/create.js +19 -8
- package/package.json +1 -1
package/lib/create.js
CHANGED
|
@@ -213,7 +213,7 @@ async function selectFromRecommended() {
|
|
|
213
213
|
const choices = Object.entries(recommended).map(([key, template]) => {
|
|
214
214
|
// 构建特性标签
|
|
215
215
|
const featureTags = template.features.slice(0, 3).map(f =>
|
|
216
|
-
chalk.
|
|
216
|
+
chalk.dim(`[${f}]`)
|
|
217
217
|
).join(' ');
|
|
218
218
|
|
|
219
219
|
// 版本标签 - 只保留方括号内的版本
|
|
@@ -222,16 +222,27 @@ async function selectFromRecommended() {
|
|
|
222
222
|
chalk.yellow('[精简版]');
|
|
223
223
|
|
|
224
224
|
return {
|
|
225
|
-
name: `${chalk.bold.white(template.name.replace(/\s*(完整版|精简版)\s*$/, ''))} ${versionTag}
|
|
226
|
-
${chalk.dim(template.
|
|
227
|
-
${featureTags}${template.features.length > 3 ? chalk.dim(` +${template.features.length - 3}more`) : ''}
|
|
228
|
-
${chalk.dim('━'.repeat(60))}`,
|
|
225
|
+
name: `${chalk.bold.white(template.name.replace(/\s*(完整版|精简版)\s*$/, ''))} ${versionTag} - ${chalk.dim(template.description)}
|
|
226
|
+
${chalk.dim(featureTags)}${template.features.length > 3 ? chalk.dim(` +${template.features.length - 3}more`) : ''}`,
|
|
229
227
|
value: { key, ...template },
|
|
230
228
|
short: template.name,
|
|
231
229
|
};
|
|
232
230
|
});
|
|
233
231
|
|
|
234
|
-
|
|
232
|
+
// 为每个推荐模板添加分隔符
|
|
233
|
+
const choicesWithSeparators = [];
|
|
234
|
+
choices.forEach((choice, index) => {
|
|
235
|
+
choicesWithSeparators.push(choice);
|
|
236
|
+
if (index < choices.length - 1) {
|
|
237
|
+
choicesWithSeparators.push({
|
|
238
|
+
name: chalk.dim("━".repeat(60)),
|
|
239
|
+
value: `sep_${index}`,
|
|
240
|
+
disabled: true
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
choicesWithSeparators.push({
|
|
235
246
|
name: chalk.dim("⬅️ 返回选择其他方式"),
|
|
236
247
|
value: "back",
|
|
237
248
|
});
|
|
@@ -241,8 +252,8 @@ async function selectFromRecommended() {
|
|
|
241
252
|
type: "list",
|
|
242
253
|
name: "selectedTemplate",
|
|
243
254
|
message: "选择推荐模板:",
|
|
244
|
-
choices,
|
|
245
|
-
pageSize:
|
|
255
|
+
choices: choicesWithSeparators,
|
|
256
|
+
pageSize: 15,
|
|
246
257
|
loop: false
|
|
247
258
|
},
|
|
248
259
|
]);
|