i18-fe-automator-beta 2.1.6 → 2.1.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.
@@ -1807,6 +1807,8 @@ const CACHE_KEY = "zentao"; // .cache/zentao: { account, password, zentaosid, pr
1807
1807
 
1808
1808
  // 需求列表展示与pull并发的上限
1809
1809
  const PLAN_STORY_TABLE_LIMIT = 50;
1810
+ // 需求列表表格中标题的最大展示长度(console.table单元格不换行, 超长截断)
1811
+ const STORY_TITLE_LIMIT = 30;
1810
1812
  const PULL_CONCURRENCY = 5;
1811
1813
 
1812
1814
  // 任务状态中文标签(close 命令展示用)
@@ -2752,8 +2754,8 @@ function writeCodeWorkspace(zentaoDir, planTitle, frontProjects, backProjects) {
2752
2754
  /**
2753
2755
  * plan --export 产出需求目录 .zentao-<计划名>/(产出契约见 .trae/documents/story-command-zentao.md 第4节):
2754
2756
  * tasks/manifest.json(对象结构: 顶部projects汇总全部涉及项目 + stories数组合并去重, 同storyID覆盖title/taskDir/projects, 按storyID数值排序)
2755
- * + 每条需求 tasks/<taskDir>/task.md(同名taskDir已由 exportPlanStories 先删除, 此处全新写入)
2756
- * plan.md 与 codex-*.md 是 workflow 的产物(重拉同名taskDir会连带删除, 确认关卡后不要再重导)
2757
+ * + 每条需求 tasks/<taskDir>/task.md(同名taskDir的task.md与images/已由 exportPlanStories 先删除, 此处全新写入)
2758
+ * plan.md 与 codex-*.md 是 workflow 的产物(重导时手术式刷新保留不覆盖, 但需求内容变了需AI自行判断是否重排)
2757
2759
  */
2758
2760
  function writeZentaoTasks({ plan, scope, stories, storyDetails, products, failed, storyImages, zentaoDir }) {
2759
2761
  const tasksDir = path.join(zentaoDir, "tasks");
@@ -2950,7 +2952,11 @@ async function showPlanDetail(zentaosid, selected) {
2950
2952
  );
2951
2953
  return {
2952
2954
  ID: s.id,
2953
- 标题: s.title,
2955
+ // console.table单元格不换行, 超长标题截断(完整标题可用 story detail 查看)
2956
+ 标题:
2957
+ s.title.length > STORY_TITLE_LIMIT
2958
+ ? `${s.title.slice(0, STORY_TITLE_LIMIT)}...`
2959
+ : s.title,
2954
2960
  前端工时: isFront ? s.webestimate : "-",
2955
2961
  后端工时: Number(s.estimate) > 0 ? s.estimate : "-",
2956
2962
  poollist: s.poollist || "-",
@@ -3018,16 +3024,23 @@ async function exportPlanStories(zentaosid, selected, scope) {
3018
3024
  Loading$1.succeed(`拉取需求详情完成(${done}/${stories.length})`);
3019
3025
  // 需求目录: .zentao-<计划名>(多计划互不混目录)
3020
3026
  const zentaoDir = path.join(process.cwd(), zentaoDirNameOf(plan));
3021
- // 同名taskDir直接删除重导(重拉=全新快照, 连带清掉旧images与旧plan/codex报告; 失败条目保留旧数据)
3027
+ // 同名taskDir手术式刷新: 只删task.md与images/重写, 保留plan.md/codex报告等AI产物; 失败条目保留旧数据
3022
3028
  stories.forEach((story) => {
3023
3029
  if (failed.has(String(story.id))) return;
3024
3030
  const dir = path.join(zentaoDir, "tasks", taskDirOf(story));
3025
3031
  if (isExistPath(dir)) {
3026
- fs.rmSync(dir, { recursive: true, force: true });
3027
- console.log(chalk.yellow(`同名任务目录已删除重导: ${taskDirOf(story)}`));
3032
+ const taskMd = path.join(dir, "task.md");
3033
+ if (isExistPath(taskMd)) fs.rmSync(taskMd, { force: true });
3034
+ const imagesDir = path.join(dir, "images");
3035
+ if (isExistPath(imagesDir)) {
3036
+ fs.rmSync(imagesDir, { recursive: true, force: true });
3037
+ }
3038
+ console.log(
3039
+ chalk.yellow(`同名任务目录已刷新(保留plan/报告): ${taskDirOf(story)}`)
3040
+ );
3028
3041
  }
3029
3042
  });
3030
- // 图片本地化到 tasks/<taskDir>/images/(目录已删全量重下, 失败黄字不阻塞, 引用降级远程url)
3043
+ // 图片本地化到 tasks/<taskDir>/images/(images/已删全量重下, 失败黄字不阻塞, 引用降级远程url)
3031
3044
  const storyImages = await downloadStoryImages({
3032
3045
  stories,
3033
3046
  storyDetails,
@@ -3053,11 +3066,13 @@ async function exportPlanStories(zentaosid, selected, scope) {
3053
3066
  scope === "back" || scope === "all"
3054
3067
  ? collectPoolProjects(stories, "back")
3055
3068
  : [];
3056
- if (frontProjects.length || backProjects.length) {
3057
- writeCodeWorkspace(zentaoDir, plan.title, frontProjects, backProjects);
3058
- } else {
3059
- console.log(chalk.yellow("本范围无关联项目, 跳过工作区生成"));
3069
+ // 无pool时仍生成单目录工作区(只含需求目录自身, 打开仍能看manifest与task.md), 黄字提示补维护
3070
+ if (!frontProjects.length && !backProjects.length) {
3071
+ console.log(
3072
+ chalk.yellow("本范围需求均未维护poollist, 工作区仅含需求目录, 维护后重跑可补齐项目")
3073
+ );
3060
3074
  }
3075
+ writeCodeWorkspace(zentaoDir, plan.title, frontProjects, backProjects);
3061
3076
  }
3062
3077
 
3063
3078
  /**
@@ -1785,6 +1785,8 @@ const CACHE_KEY = "zentao"; // .cache/zentao: { account, password, zentaosid, pr
1785
1785
 
1786
1786
  // 需求列表展示与pull并发的上限
1787
1787
  const PLAN_STORY_TABLE_LIMIT = 50;
1788
+ // 需求列表表格中标题的最大展示长度(console.table单元格不换行, 超长截断)
1789
+ const STORY_TITLE_LIMIT = 30;
1788
1790
  const PULL_CONCURRENCY = 5;
1789
1791
 
1790
1792
  // 任务状态中文标签(close 命令展示用)
@@ -2730,8 +2732,8 @@ function writeCodeWorkspace(zentaoDir, planTitle, frontProjects, backProjects) {
2730
2732
  /**
2731
2733
  * plan --export 产出需求目录 .zentao-<计划名>/(产出契约见 .trae/documents/story-command-zentao.md 第4节):
2732
2734
  * tasks/manifest.json(对象结构: 顶部projects汇总全部涉及项目 + stories数组合并去重, 同storyID覆盖title/taskDir/projects, 按storyID数值排序)
2733
- * + 每条需求 tasks/<taskDir>/task.md(同名taskDir已由 exportPlanStories 先删除, 此处全新写入)
2734
- * plan.md 与 codex-*.md 是 workflow 的产物(重拉同名taskDir会连带删除, 确认关卡后不要再重导)
2735
+ * + 每条需求 tasks/<taskDir>/task.md(同名taskDir的task.md与images/已由 exportPlanStories 先删除, 此处全新写入)
2736
+ * plan.md 与 codex-*.md 是 workflow 的产物(重导时手术式刷新保留不覆盖, 但需求内容变了需AI自行判断是否重排)
2735
2737
  */
2736
2738
  function writeZentaoTasks({ plan, scope, stories, storyDetails, products, failed, storyImages, zentaoDir }) {
2737
2739
  const tasksDir = path.join(zentaoDir, "tasks");
@@ -2928,7 +2930,11 @@ async function showPlanDetail(zentaosid, selected) {
2928
2930
  );
2929
2931
  return {
2930
2932
  ID: s.id,
2931
- 标题: s.title,
2933
+ // console.table单元格不换行, 超长标题截断(完整标题可用 story detail 查看)
2934
+ 标题:
2935
+ s.title.length > STORY_TITLE_LIMIT
2936
+ ? `${s.title.slice(0, STORY_TITLE_LIMIT)}...`
2937
+ : s.title,
2932
2938
  前端工时: isFront ? s.webestimate : "-",
2933
2939
  后端工时: Number(s.estimate) > 0 ? s.estimate : "-",
2934
2940
  poollist: s.poollist || "-",
@@ -2996,16 +3002,23 @@ async function exportPlanStories(zentaosid, selected, scope) {
2996
3002
  Loading.succeed(`拉取需求详情完成(${done}/${stories.length})`);
2997
3003
  // 需求目录: .zentao-<计划名>(多计划互不混目录)
2998
3004
  const zentaoDir = path.join(process.cwd(), zentaoDirNameOf(plan));
2999
- // 同名taskDir直接删除重导(重拉=全新快照, 连带清掉旧images与旧plan/codex报告; 失败条目保留旧数据)
3005
+ // 同名taskDir手术式刷新: 只删task.md与images/重写, 保留plan.md/codex报告等AI产物; 失败条目保留旧数据
3000
3006
  stories.forEach((story) => {
3001
3007
  if (failed.has(String(story.id))) return;
3002
3008
  const dir = path.join(zentaoDir, "tasks", taskDirOf(story));
3003
3009
  if (isExistPath(dir)) {
3004
- fs.rmSync(dir, { recursive: true, force: true });
3005
- console.log(chalk.yellow(`同名任务目录已删除重导: ${taskDirOf(story)}`));
3010
+ const taskMd = path.join(dir, "task.md");
3011
+ if (isExistPath(taskMd)) fs.rmSync(taskMd, { force: true });
3012
+ const imagesDir = path.join(dir, "images");
3013
+ if (isExistPath(imagesDir)) {
3014
+ fs.rmSync(imagesDir, { recursive: true, force: true });
3015
+ }
3016
+ console.log(
3017
+ chalk.yellow(`同名任务目录已刷新(保留plan/报告): ${taskDirOf(story)}`)
3018
+ );
3006
3019
  }
3007
3020
  });
3008
- // 图片本地化到 tasks/<taskDir>/images/(目录已删全量重下, 失败黄字不阻塞, 引用降级远程url)
3021
+ // 图片本地化到 tasks/<taskDir>/images/(images/已删全量重下, 失败黄字不阻塞, 引用降级远程url)
3009
3022
  const storyImages = await downloadStoryImages({
3010
3023
  stories,
3011
3024
  storyDetails,
@@ -3031,11 +3044,13 @@ async function exportPlanStories(zentaosid, selected, scope) {
3031
3044
  scope === "back" || scope === "all"
3032
3045
  ? collectPoolProjects(stories, "back")
3033
3046
  : [];
3034
- if (frontProjects.length || backProjects.length) {
3035
- writeCodeWorkspace(zentaoDir, plan.title, frontProjects, backProjects);
3036
- } else {
3037
- console.log(chalk.yellow("本范围无关联项目, 跳过工作区生成"));
3047
+ // 无pool时仍生成单目录工作区(只含需求目录自身, 打开仍能看manifest与task.md), 黄字提示补维护
3048
+ if (!frontProjects.length && !backProjects.length) {
3049
+ console.log(
3050
+ chalk.yellow("本范围需求均未维护poollist, 工作区仅含需求目录, 维护后重跑可补齐项目")
3051
+ );
3038
3052
  }
3053
+ writeCodeWorkspace(zentaoDir, plan.title, frontProjects, backProjects);
3039
3054
  }
3040
3055
 
3041
3056
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "i18-fe-automator-beta",
3
- "version": "2.1.6",
3
+ "version": "2.1.7",
4
4
  "description": "i18-fe-automator-beta内测版本,只用于key: ''替换、检测中文规则等",
5
5
  "type": "module",
6
6
  "bin": {