yg-team-cli 2.4.4 → 2.4.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/README.md CHANGED
@@ -32,6 +32,39 @@
32
32
 
33
33
  以下记录了 team-cli 的开发进展,按时间倒序排列。
34
34
 
35
+ ### 2026-02-03 - Bug 修复
36
+
37
+ **v2.4.4** - 修复 breakdown 命令日志变量未正确插值
38
+ - **提交**: `c873ea5`
39
+ - **修复**: `breakdown.ts` 中 `ctx.selectedFile` 变量未正确插值
40
+ - **npm 发布**: `yg-team-cli@2.4.4`
41
+
42
+ **v2.4.3** - 修复 breakdown 命令 Listr 任务上下文传递
43
+ - **提交**: `bed4981`
44
+ - **修复**: `ctx.specs` 和 `ctx.selectedFile` 未赋值问题
45
+ - **修复**: `ctx.breakdownResult` 未赋值问题
46
+ - **修复**: `breakdown.ts` 任务返回类型不匹配
47
+ - **npm 发布**: `yg-team-cli@2.4.3`
48
+
49
+ **v2.4.2** - 修复 add-feature 命令上下文传递
50
+ - **提交**: `8cd6c85`
51
+ - **修复**: PRD 模式 `ctx.generatedSpec` 未赋值
52
+ - **修复**: 简单描述模式 `ctx.generatedSpec` 未赋值
53
+ - **npm 发布**: `yg-team-cli@2.4.2`
54
+
55
+ **v2.4.1** - 修复 breakdown 命令上下文传递
56
+ - **提交**: `e674879`
57
+ - **修复**: `ctx.breakdownResult` 未赋值导致文件写入失败
58
+ - **npm 发布**: `yg-team-cli@2.4.1`
59
+
60
+ **v2.4.0** - SSO 模块集成
61
+ - **提交**: `d17a8be`
62
+ - **新增**: SSO 单点登录模块 (`yungu-sso`)
63
+ - **功能**: CAS 集成、Token 验证、会话管理、UserContext
64
+ - **新增文件**: `src/templates/modules/yungu-sso/`
65
+ - **新增依赖**: `org.yungu:login-client`
66
+ - **npm 发布**: `yg-team-cli@2.4.0`
67
+
35
68
  ### 2026-01-27 - GitLab 版本管理与 Dev 模式增强
36
69
 
37
70
  **Phase 4: GitLab 版本管理**
package/dist/cli.js CHANGED
@@ -3229,17 +3229,9 @@ async function addFeatureFromPrd(featureName, featureSlug, specFile) {
3229
3229
  ctx2.projectContext,
3230
3230
  ctx2.completedSpecs
3231
3231
  );
3232
- logger.newLine();
3233
- logger.separator("\u2500", 60);
3234
- logger.info("Claude \u751F\u6210 spec \u4E2D...");
3235
- logger.separator("\u2500", 60);
3236
- logger.newLine();
3237
3232
  const result = await claudeAI.prompt(prompt, {
3238
3233
  contextFiles: ["TECH_STACK.md", "CONVENTIONS.md", "AI_MEMORY.md"]
3239
3234
  });
3240
- logger.newLine();
3241
- logger.separator("\u2500", 60);
3242
- logger.newLine();
3243
3235
  ctx2.generatedSpec = result;
3244
3236
  }
3245
3237
  },
@@ -3257,6 +3249,9 @@ async function addFeatureFromPrd(featureName, featureSlug, specFile) {
3257
3249
  }
3258
3250
  ]);
3259
3251
  const ctx = await tasks.run();
3252
+ logger.newLine();
3253
+ logger.separator("\u2500", 60);
3254
+ logger.newLine();
3260
3255
  logger.success(`Spec \u6587\u4EF6\u5DF2\u751F\u6210: ${specFile}`);
3261
3256
  await showSpecPreview(specFile);
3262
3257
  await askToAdjust(specFile);
@@ -3319,17 +3314,9 @@ async function addFeatureSimple(featureName, featureSlug, specFile) {
3319
3314
  ctx2.projectContext,
3320
3315
  ctx2.selectedDeps
3321
3316
  );
3322
- logger.newLine();
3323
- logger.separator("\u2500", 60);
3324
- logger.info("Claude \u751F\u6210 spec \u4E2D...");
3325
- logger.separator("\u2500", 60);
3326
- logger.newLine();
3327
3317
  const result = await claudeAI.prompt(prompt, {
3328
3318
  contextFiles: ["TECH_STACK.md", "CONVENTIONS.md", "AI_MEMORY.md"]
3329
3319
  });
3330
- logger.newLine();
3331
- logger.separator("\u2500", 60);
3332
- logger.newLine();
3333
3320
  ctx2.generatedSpec = result;
3334
3321
  }
3335
3322
  },
@@ -3347,6 +3334,9 @@ async function addFeatureSimple(featureName, featureSlug, specFile) {
3347
3334
  }
3348
3335
  ]);
3349
3336
  const ctx = await tasks.run();
3337
+ logger.newLine();
3338
+ logger.separator("\u2500", 60);
3339
+ logger.newLine();
3350
3340
  logger.success(`Spec \u6587\u4EF6\u5DF2\u751F\u6210: ${specFile}`);
3351
3341
  await showSpecPreview(specFile);
3352
3342
  await askToAdjust(specFile);
@@ -3558,23 +3548,26 @@ async function updateAiMemory(featureName, featureSlug) {
3558
3548
  return;
3559
3549
  }
3560
3550
  let content = await FileUtils.read(aiMemoryFile);
3551
+ const newRow = `| ${featureName} | ${featureSlug}.md | \u25CB \u672A\u5F00\u59CB | 0/0 | - | |`;
3561
3552
  if (!content.includes("## \u529F\u80FD\u6E05\u5355")) {
3562
- const featureList = `
3553
+ content += `
3563
3554
  ## \u529F\u80FD\u6E05\u5355 (Feature Inventory)
3564
3555
 
3565
3556
  | \u529F\u80FD | Spec \u6587\u4EF6 | \u72B6\u6001 | \u8FDB\u5EA6 | \u5B8C\u6210\u65E5\u671F | \u5907\u6CE8 |
3566
3557
  |------|----------|------|------|---------|------|
3567
- | ${featureName} | ${featureSlug}.md | \u25CB \u672A\u5F00\u59CB | 0/0 | - | |
3558
+ ${newRow}
3568
3559
  `;
3569
- content = content.replace("(/\u9879\u76EE\u4FE1\u606F/[^#]*)", `$1
3570
- ${featureList}`);
3571
3560
  } else {
3572
- const newRow = `| ${featureName} | ${featureSlug}.md | \u25CB \u672A\u5F00\u59CB | 0/0 | - | |`;
3573
- content = content.replace(
3574
- /(\| 功能 \| Spec 文件 \| 状态 \| 进度 \| 完成日期 \| 备注 \|)/,
3575
- `$1
3576
- ${newRow}`
3577
- );
3561
+ const lines = content.split("\n");
3562
+ const lastIndex = lines.findLastIndex((line) => line.trim().startsWith("|") && !line.includes("---"));
3563
+ if (lastIndex !== -1) {
3564
+ lines.splice(lastIndex + 1, 0, newRow);
3565
+ content = lines.join("\n");
3566
+ } else {
3567
+ content += `
3568
+ ${newRow}
3569
+ `;
3570
+ }
3578
3571
  }
3579
3572
  await FileUtils.write(aiMemoryFile, content);
3580
3573
  logger.success("AI_MEMORY.md \u5DF2\u66F4\u65B0");
@@ -3583,15 +3576,27 @@ async function showSpecPreview(specFile) {
3583
3576
  logger.newLine();
3584
3577
  logger.header("\u751F\u6210\u7684 Spec \u9884\u89C8:");
3585
3578
  logger.newLine();
3586
- const content = await FileUtils.read(specFile);
3587
- const lines = content.split("\n");
3588
- const preview = lines.slice(0, 40).join("\n");
3589
- console.log(preview);
3590
- if (lines.length > 40) {
3591
- console.log("...");
3592
- console.log(`(\u5171 ${lines.length} \u884C)`);
3579
+ try {
3580
+ const content = await FileUtils.read(specFile);
3581
+ if (!content || content.trim().length === 0) {
3582
+ logger.warn("Spec \u6587\u4EF6\u5185\u5BB9\u4E3A\u7A7A");
3583
+ return;
3584
+ }
3585
+ const lines = content.split("\n");
3586
+ if (lines.length === 0) {
3587
+ logger.warn("Spec \u6587\u4EF6\u6CA1\u6709\u5185\u5BB9");
3588
+ return;
3589
+ }
3590
+ const preview = lines.slice(0, 40).join("\n");
3591
+ console.log(preview);
3592
+ if (lines.length > 40) {
3593
+ console.log("...");
3594
+ console.log(`(\u5171 ${lines.length} \u884C)`);
3595
+ }
3596
+ console.log("");
3597
+ } catch (error) {
3598
+ logger.error(`\u8BFB\u53D6 Spec \u9884\u89C8\u5931\u8D25: ${error.message}`);
3593
3599
  }
3594
- console.log("");
3595
3600
  }
3596
3601
  async function askToAdjust(specFile) {
3597
3602
  const { needAdjust } = await inquirer4.prompt([