ylcwf 0.10.0 → 0.11.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  遵循 [语义化版本](https://semver.org/lang/zh-CN/)。
4
4
 
5
+ ## 0.11.0
6
+
7
+ 桌面端 App 同步发布 `0.11.0`。
8
+
9
+ ### 新增
10
+
11
+ - **`ylcwf doc migrate --map <列名=旧值=新值>`**:按列名批量改写表格单元格(如执行终端改名),
12
+ 可多次;列按表头名定位,需求表与任务表顺序不同也不会改错列
13
+
14
+ ### 变更
15
+
16
+ - **「执行终端」列的取值统一为执行终端名**:归属校验改为按 `execution_terminals.json` 里的
17
+ 名字建索引(`buildRepoSideIndex` → `buildTerminalSideIndex`、`sideOfRepo` → `sideOfTerminal`、
18
+ `isKnownRepo` → `isKnownTerminal`);**不再兼容写代码仓库名**(`ai-pad` 之类),
19
+ 旧文档用 `ylcwf doc migrate --map "执行终端=<仓库名>=<终端名>"` 迁移
20
+ - 前后端都配了仓库的执行终端名按歧义跳过归属校验(不猜),只配一端的可直接判定
21
+
5
22
  ## 0.10.0
6
23
 
7
24
  桌面端 App 同步发布 `0.10.0`。
package/README.md CHANGED
@@ -299,7 +299,10 @@ ylcwf doc migrate # 执行
299
299
  # 2. 改列名:自动推断(文档多出的列数 == schema 缺失的列数),否则显式指定
300
300
  ylcwf doc migrate --rename "任务编号=任务号" # 可多次
301
301
  # 3. 详情字段:补缺失的字段(`<待补充>`),并按 schema 顺序重排区块
302
- # 4. 迭代信息字段:改名 + 补 schema 新增字段(值用 --fill 给)+ 删下线字段(--drop)
302
+ # 4. 单元格改值:按列名批量替换(如执行终端改名)
303
+ ylcwf doc migrate --map "执行终端=ai-pad=引励场AI学习机" \
304
+ --map "执行终端=iep-web-corp=引励场业务平台-IEP"
305
+ # 5. 迭代信息字段:改名 + 补 schema 新增字段(值用 --fill 给)+ 删下线字段(--drop)
303
306
  ylcwf doc migrate --rename "迭代版本=迭代ID" \
304
307
  --fill "迭代名称=AI-YLC-PAD-v2.9引励场学习机升级v3_AI精准学v1" \
305
308
  --fill "原型评审=2026-11-06" --fill "UI评审=2026-11-06" \
package/dist/index.js CHANGED
@@ -11511,7 +11511,7 @@ function loadDocSchema(docsRoot, options = {}) {
11511
11511
  const schema = parseDocSchema(raw, docsRoot);
11512
11512
  if (true !== options.allowTooOld && null !== schema.requiresYlcwf) {
11513
11513
  const required = parseMinVersion(schema.requiresYlcwf);
11514
- if (null !== required && compareVersions("0.10.0", `${required[0]}.${required[1]}.${required[2]}`) < 0) fail(docsRoot, `文档仓库要求 ylcwf ${schema.requiresYlcwf},当前版本是 0.10.0,请先升级 ylcwf:\n npm install -g ylcwf@latest`);
11514
+ if (null !== required && compareVersions("0.11.0", `${required[0]}.${required[1]}.${required[2]}`) < 0) fail(docsRoot, `文档仓库要求 ylcwf ${schema.requiresYlcwf},当前版本是 0.11.0,请先升级 ylcwf:\n npm install -g ylcwf@latest`);
11515
11515
  }
11516
11516
  return schema;
11517
11517
  }
@@ -11558,31 +11558,31 @@ function readTextFile(path) {
11558
11558
  eol: detectEol(raw)
11559
11559
  };
11560
11560
  }
11561
- function buildRepoSideIndex(terminals) {
11561
+ function buildTerminalSideIndex(terminals) {
11562
11562
  const byName = new Map();
11563
- for (const terminal of Object.values(terminals))for (const side of [
11564
- 'frontend',
11565
- 'backend'
11566
- ])for (const repoPath of terminal.repos[side]){
11567
- const name = basename(repoPath);
11568
- if (0 === name.length) continue;
11569
- const existing = byName.get(name) ?? new Set();
11570
- existing.add(side);
11571
- byName.set(name, existing);
11563
+ for (const [terminalName, terminal] of Object.entries(terminals)){
11564
+ const key = terminalName.trim();
11565
+ if (0 === key.length) continue;
11566
+ const sides = new Set();
11567
+ for (const side of [
11568
+ 'frontend',
11569
+ 'backend'
11570
+ ])if (terminal.repos[side].length > 0) sides.add(side);
11571
+ if (sides.size > 0) byName.set(key, sides);
11572
11572
  }
11573
11573
  return {
11574
11574
  byName
11575
11575
  };
11576
11576
  }
11577
- function sideOfRepo(index, repoName) {
11578
- const sides = index.byName.get(repoName.trim());
11577
+ function sideOfTerminal(index, name) {
11578
+ const sides = index.byName.get(name.trim());
11579
11579
  if (void 0 === sides || 1 !== sides.size) return null;
11580
11580
  return [
11581
11581
  ...sides
11582
11582
  ][0] ?? null;
11583
11583
  }
11584
- function isKnownRepo(index, repoName) {
11585
- return index.byName.has(repoName.trim());
11584
+ function isKnownTerminal(index, name) {
11585
+ return index.byName.has(name.trim());
11586
11586
  }
11587
11587
  function validateTaskSides(options) {
11588
11588
  const issues = [];
@@ -11594,7 +11594,7 @@ function validateTaskSides(options) {
11594
11594
  skipped += 1;
11595
11595
  continue;
11596
11596
  }
11597
- const repoSide = sideOfRepo(options.index, task.terminal);
11597
+ const repoSide = sideOfTerminal(options.index, task.terminal);
11598
11598
  if (null === repoSide) {
11599
11599
  skipped += 1;
11600
11600
  if (options.index.byName.size > 0) issues.push({
@@ -11603,7 +11603,7 @@ function validateTaskSides(options) {
11603
11603
  terminal: task.terminal,
11604
11604
  repoSide: null,
11605
11605
  level: 'warning',
11606
- message: isKnownRepo(options.index, task.terminal) ? `任务 ${task.id} 的执行终端「${task.terminal}」在本机配置中同时对应前后端仓库,无法校验归属` : `任务 ${task.id} 的执行终端「${task.terminal}」不在本机执行终端配置中,无法校验所属端与仓库是否一致`
11606
+ message: isKnownTerminal(options.index, task.terminal) ? `任务 ${task.id} 的执行终端「${task.terminal}」在本机配置中同时对应前后端仓库,无法校验归属` : `任务 ${task.id} 的执行终端「${task.terminal}」不在本机执行终端配置中,无法校验所属端与仓库是否一致`
11607
11607
  });
11608
11608
  continue;
11609
11609
  }
@@ -11819,7 +11819,7 @@ function validatePlanReferences(options) {
11819
11819
  const knownRequirements = new Set(options.knownRequirements ?? []);
11820
11820
  for (const task of options.plan.tasks){
11821
11821
  if (!requirementCodes.has(task.requirement) && !knownRequirements.has(task.requirement)) docplan_fail(`任务「${task.name}」关联的需求 ${task.requirement} 既不在 requirements 中,也不在文档现有需求里`);
11822
- if (knownRepos.size > 0 && !isKnownRepo(options.index, task.terminal)) process.stderr.write(`提示:任务「${task.name}」的执行终端「${task.terminal}」不在本机执行终端配置中,跳过归属校验\n`);
11822
+ if (knownRepos.size > 0 && !isKnownTerminal(options.index, task.terminal)) process.stderr.write(`提示:任务「${task.name}」的执行终端「${task.terminal}」不在本机执行终端配置中,跳过归属校验\n`);
11823
11823
  for (const dependency of task.dependsOn ?? [])if (!options.knownTaskIds.includes(dependency)) {
11824
11824
  if (!options.plan.tasks.some((item)=>item.name === dependency)) docplan_fail(`任务「${task.name}」的前置依赖 ${dependency} 既不在文档中,也不在本次计划中`);
11825
11825
  }
@@ -15049,7 +15049,7 @@ function checkDocTaskSides(options) {
15049
15049
  const schema = loadDocSchema(options.docsRoot);
15050
15050
  const payload = parseMarkdownDoc(markdown, schema);
15051
15051
  return validateTaskSides({
15052
- index: buildRepoSideIndex(options.terminals),
15052
+ index: buildTerminalSideIndex(options.terminals),
15053
15053
  tasks: payload.tasks.map((task)=>({
15054
15054
  id: task.id,
15055
15055
  scope: task.scope,
@@ -15296,7 +15296,7 @@ function buildKeys(schema) {
15296
15296
  requirementSection: `## ${schema.sections[1] ?? '二、需求清单'}`
15297
15297
  };
15298
15298
  }
15299
- function columnIndex(headerCells, name) {
15299
+ function taskdoc_columnIndex(headerCells, name) {
15300
15300
  const index = headerCells.findIndex((cell)=>cell.trim() === name);
15301
15301
  if (index < 0) throw new errors_CliError(`表格缺少列「${name}」,无法安全写入`, errors_EXIT.INVALID);
15302
15302
  return index;
@@ -15343,15 +15343,15 @@ function parseTaskRows(lines, keys) {
15343
15343
  continue;
15344
15344
  }
15345
15345
  if (cells.every((cell)=>/^:?-{2,}:?$/.test(cell))) continue;
15346
- const taskId = cells[columnIndex(header, keys.task.id)] ?? '';
15346
+ const taskId = cells[taskdoc_columnIndex(header, keys.task.id)] ?? '';
15347
15347
  if (TASK_ID_PATTERN.test(taskId)) rows.push({
15348
15348
  index,
15349
15349
  cells,
15350
15350
  taskId,
15351
- status: cells[columnIndex(header, keys.task.status)] ?? '',
15352
- acceptance: cells[columnIndex(header, keys.task.acceptance)] ?? '',
15353
- selfTest: cells[columnIndex(header, keys.task.selfTest)] ?? '',
15354
- requirementId: cells[columnIndex(header, keys.task.requirement)] ?? ''
15351
+ status: cells[taskdoc_columnIndex(header, keys.task.status)] ?? '',
15352
+ acceptance: cells[taskdoc_columnIndex(header, keys.task.acceptance)] ?? '',
15353
+ selfTest: cells[taskdoc_columnIndex(header, keys.task.selfTest)] ?? '',
15354
+ requirementId: cells[taskdoc_columnIndex(header, keys.task.requirement)] ?? ''
15355
15355
  });
15356
15356
  }
15357
15357
  if (null === header) throw new errors_CliError('未找到任务清单表头,无法安全写入', errors_EXIT.INVALID);
@@ -15373,7 +15373,7 @@ function parseRequirementRows(lines, keys) {
15373
15373
  continue;
15374
15374
  }
15375
15375
  if (cells.every((cell)=>/^:?-{2,}:?$/.test(cell))) continue;
15376
- const id = cells[columnIndex(header, keys.requirement.id)] ?? '';
15376
+ const id = cells[taskdoc_columnIndex(header, keys.requirement.id)] ?? '';
15377
15377
  if (REQUIREMENT_ID_PATTERN.test(id)) rows.push({
15378
15378
  index,
15379
15379
  cells,
@@ -15439,8 +15439,8 @@ function computeUpdate(lines, taskId, action, keys, docsRoot) {
15439
15439
  const { header, rows } = parseTaskRows(lines, keys);
15440
15440
  const target = rows.find((row)=>row.taskId === taskId);
15441
15441
  if (void 0 === target) throw new errors_CliError(`任务清单中未找到 ${taskId}`, errors_EXIT.NOT_FOUND);
15442
- const statusIndex = columnIndex(header, keys.task.status);
15443
- const acceptanceIndex = columnIndex(header, keys.task.acceptance);
15442
+ const statusIndex = taskdoc_columnIndex(header, keys.task.status);
15443
+ const acceptanceIndex = taskdoc_columnIndex(header, keys.task.acceptance);
15444
15444
  const currentStatus = target.status;
15445
15445
  const currentAcceptance = target.acceptance;
15446
15446
  const meta = ACTION_META[action];
@@ -15460,7 +15460,7 @@ function computeUpdate(lines, taskId, action, keys, docsRoot) {
15460
15460
  ];
15461
15461
  taskCells[statusIndex] = nextStatus;
15462
15462
  taskCells[acceptanceIndex] = nextAcceptance;
15463
- taskCells[columnIndex(header, keys.task.updatedAt)] = stamp;
15463
+ taskCells[taskdoc_columnIndex(header, keys.task.updatedAt)] = stamp;
15464
15464
  updated[target.index] = taskdoc_joinRow(taskCells);
15465
15465
  const withDetail = updateDetailBlock(updated, taskId, {
15466
15466
  任务状态: nextStatus,
@@ -15476,11 +15476,11 @@ function computeUpdate(lines, taskId, action, keys, docsRoot) {
15476
15476
  const requirementCells = [
15477
15477
  ...requirementTarget.cells
15478
15478
  ];
15479
- const previousStatus = requirementCells[columnIndex(requirementParse.header, keys.requirement.status)] ?? '';
15480
- const previousProgress = requirementCells[columnIndex(requirementParse.header, keys.requirement.progress)] ?? '';
15481
- requirementCells[columnIndex(requirementParse.header, keys.requirement.status)] = requirementStatus;
15482
- requirementCells[columnIndex(requirementParse.header, keys.requirement.progress)] = String(progress);
15483
- if (previousStatus !== requirementStatus || previousProgress !== String(progress)) requirementCells[columnIndex(requirementParse.header, keys.requirement.updatedAt)] = stamp;
15479
+ const previousStatus = requirementCells[taskdoc_columnIndex(requirementParse.header, keys.requirement.status)] ?? '';
15480
+ const previousProgress = requirementCells[taskdoc_columnIndex(requirementParse.header, keys.requirement.progress)] ?? '';
15481
+ requirementCells[taskdoc_columnIndex(requirementParse.header, keys.requirement.status)] = requirementStatus;
15482
+ requirementCells[taskdoc_columnIndex(requirementParse.header, keys.requirement.progress)] = String(progress);
15483
+ if (previousStatus !== requirementStatus || previousProgress !== String(progress)) requirementCells[taskdoc_columnIndex(requirementParse.header, keys.requirement.updatedAt)] = stamp;
15484
15484
  withDetail[requirementTarget.index] = taskdoc_joinRow(requirementCells);
15485
15485
  if (previousStatus !== requirementStatus) changes.push(`需求 ${target.requirementId} 开发状态:${previousStatus} → ${requirementStatus}`);
15486
15486
  if (previousProgress !== String(progress)) changes.push(`需求 ${target.requirementId} 开发进度:${previousProgress}% → ${progress}%`);
@@ -15639,7 +15639,7 @@ function applyTaskDetail(options) {
15639
15639
  const { header, rows } = parseTaskRows(context.lines, keys);
15640
15640
  const target = rows.find((row)=>row.taskId === options.taskId);
15641
15641
  if (void 0 === target) throw new errors_CliError(`任务清单中未找到 ${options.taskId}`, errors_EXIT.NOT_FOUND);
15642
- const scope = target.cells[columnIndex(header, keys.task.scope)] ?? '';
15642
+ const scope = target.cells[taskdoc_columnIndex(header, keys.task.scope)] ?? '';
15643
15643
  const allowedFields = detailFieldsOfScope(schema, scope);
15644
15644
  const allowed = new Map(allowedFields.map((field)=>[
15645
15645
  normalizeDetailField(field),
@@ -15694,7 +15694,7 @@ function applyTaskDetail(options) {
15694
15694
  const cells = [
15695
15695
  ...refreshed.cells
15696
15696
  ];
15697
- cells[columnIndex(header, keys.task.updatedAt)] = stamp;
15697
+ cells[taskdoc_columnIndex(header, keys.task.updatedAt)] = stamp;
15698
15698
  lines[refreshed.index] = taskdoc_joinRow(cells);
15699
15699
  }
15700
15700
  return commit(context, lines, changes, `已更新「${options.taskId}」详情:${touched.join('、')}`, taskdoc_safeSegment(options.iteration, '迭代目录'), taskdoc_safeSegment(options.developer, '开发者标识'), 'detail', [
@@ -15737,8 +15737,8 @@ function applySelfTest(options) {
15737
15737
  const cells = [
15738
15738
  ...target.cells
15739
15739
  ];
15740
- cells[columnIndex(header, keys.task.selfTest)] = value;
15741
- cells[columnIndex(header, keys.task.updatedAt)] = stamp;
15740
+ cells[taskdoc_columnIndex(header, keys.task.selfTest)] = value;
15741
+ cells[taskdoc_columnIndex(header, keys.task.updatedAt)] = stamp;
15742
15742
  updated[target.index] = taskdoc_joinRow(cells);
15743
15743
  const withDetail = updateDetailBlock(updated, options.taskId, {
15744
15744
  自测状态: value
@@ -15838,7 +15838,7 @@ function applyRequirementNote(options) {
15838
15838
  const note = options.note.trim();
15839
15839
  if (0 === note.length) throw new errors_CliError('备注不能为空;如需清空请写成「无」', errors_EXIT.USAGE);
15840
15840
  if (0 === keys.requirement.note.length) throw new errors_CliError('schema.json 未声明需求备注列语义(requirementTable.keys.note)', errors_EXIT.INVALID);
15841
- const noteIndex = columnIndex(requirementParse.header, keys.requirement.note);
15841
+ const noteIndex = taskdoc_columnIndex(requirementParse.header, keys.requirement.note);
15842
15842
  const previous = target.cells[noteIndex] ?? '';
15843
15843
  if (previous === note) return {
15844
15844
  ok: true,
@@ -15853,7 +15853,7 @@ function applyRequirementNote(options) {
15853
15853
  ...target.cells
15854
15854
  ];
15855
15855
  cells[noteIndex] = note;
15856
- cells[columnIndex(requirementParse.header, keys.requirement.updatedAt)] = nowStamp();
15856
+ cells[taskdoc_columnIndex(requirementParse.header, keys.requirement.updatedAt)] = nowStamp();
15857
15857
  lines[target.index] = taskdoc_joinRow(cells);
15858
15858
  return commit(context, lines, [
15859
15859
  `${requirementId} 备注:${previous || '(空)'} → ${note}`
@@ -15889,11 +15889,11 @@ function recalcRequirements(options) {
15889
15889
  const cells = [
15890
15890
  ...requirement.cells
15891
15891
  ];
15892
- const previousStatus = cells[columnIndex(requirementParse.header, keys.requirement.status)] ?? '';
15893
- const previousProgress = cells[columnIndex(requirementParse.header, keys.requirement.progress)] ?? '';
15892
+ const previousStatus = cells[taskdoc_columnIndex(requirementParse.header, keys.requirement.status)] ?? '';
15893
+ const previousProgress = cells[taskdoc_columnIndex(requirementParse.header, keys.requirement.progress)] ?? '';
15894
15894
  if (previousStatus !== status || previousProgress !== String(progress)) {
15895
- cells[columnIndex(requirementParse.header, keys.requirement.status)] = status;
15896
- cells[columnIndex(requirementParse.header, keys.requirement.progress)] = String(progress);
15895
+ cells[taskdoc_columnIndex(requirementParse.header, keys.requirement.status)] = status;
15896
+ cells[taskdoc_columnIndex(requirementParse.header, keys.requirement.progress)] = String(progress);
15897
15897
  lines[requirement.index] = taskdoc_joinRow(cells);
15898
15898
  if (previousStatus !== status) changes.push(`${requirement.id} 开发状态:${previousStatus} → ${status}`);
15899
15899
  if (previousProgress !== String(progress)) changes.push(`${requirement.id} 开发进度:${previousProgress}% → ${progress}%`);
@@ -16026,6 +16026,50 @@ function renameTaskColumns(options) {
16026
16026
  renamed
16027
16027
  };
16028
16028
  }
16029
+ function remapColumnValues(options) {
16030
+ if (0 === options.maps.length) return {
16031
+ lines: options.lines,
16032
+ changed: 0
16033
+ };
16034
+ const lines = [
16035
+ ...options.lines
16036
+ ];
16037
+ let header = null;
16038
+ let changed = 0;
16039
+ for(let index = 0; index < lines.length; index += 1){
16040
+ const cells = doc_migrate_splitRow(lines[index] ?? '');
16041
+ if (null === cells) {
16042
+ header = null;
16043
+ continue;
16044
+ }
16045
+ if (isSeparator(cells)) continue;
16046
+ if (null === header) {
16047
+ header = cells;
16048
+ continue;
16049
+ }
16050
+ let touched = false;
16051
+ const next = [
16052
+ ...cells
16053
+ ];
16054
+ for (const map of options.maps){
16055
+ const columnIndex = header.indexOf(map.column);
16056
+ if (!(columnIndex < 0)) {
16057
+ if ((next[columnIndex] ?? '') === map.from) {
16058
+ next[columnIndex] = map.to;
16059
+ touched = true;
16060
+ }
16061
+ }
16062
+ }
16063
+ if (touched) {
16064
+ lines[index] = doc_migrate_joinRow(next);
16065
+ changed += 1;
16066
+ }
16067
+ }
16068
+ return {
16069
+ lines,
16070
+ changed
16071
+ };
16072
+ }
16029
16073
  const ITERATION_TABLE_HEADER = [
16030
16074
  '项',
16031
16075
  '内容'
@@ -16419,9 +16463,9 @@ function migrateDetailFields(options) {
16419
16463
  };
16420
16464
  }
16421
16465
  function makeTerminalResolver(terminals) {
16422
- const index = buildRepoSideIndex(terminals);
16423
- return (repoName)=>{
16424
- const side = sideOfRepo(index, repoName);
16466
+ const index = buildTerminalSideIndex(terminals);
16467
+ return (terminalName)=>{
16468
+ const side = sideOfTerminal(index, terminalName);
16425
16469
  if ('frontend' === side) return '前端';
16426
16470
  if ('backend' === side) return '后端';
16427
16471
  return '';
@@ -16452,6 +16496,17 @@ function runDocMigrate(options) {
16452
16496
  if (separator <= 0) throw new errors_CliError(`--fill 的格式应为 字段名=值,收到:${pair}`, errors_EXIT.USAGE);
16453
16497
  fills.set(pair.slice(0, separator).trim(), pair.slice(separator + 1).trim());
16454
16498
  }
16499
+ const valueMaps = [];
16500
+ for (const pair of options.map ?? []){
16501
+ const firstEq = pair.indexOf('=');
16502
+ const secondEq = firstEq < 0 ? -1 : pair.indexOf('=', firstEq + 1);
16503
+ if (firstEq <= 0 || secondEq <= firstEq) throw new errors_CliError(`--map 的格式应为 列名=旧值=新值,收到:${pair}`, errors_EXIT.USAGE);
16504
+ valueMaps.push({
16505
+ column: pair.slice(0, firstEq).trim(),
16506
+ from: pair.slice(firstEq + 1, secondEq).trim(),
16507
+ to: pair.slice(secondEq + 1).trim()
16508
+ });
16509
+ }
16455
16510
  const drops = new Set();
16456
16511
  for (const label of options.drop ?? []){
16457
16512
  const cleaned = label.trim();
@@ -16476,8 +16531,12 @@ function runDocMigrate(options) {
16476
16531
  schema,
16477
16532
  renames
16478
16533
  });
16479
- const iterationMigrated = migrateIterationFields({
16534
+ const mappedResult = remapColumnValues({
16480
16535
  lines: renamedResult.lines,
16536
+ maps: valueMaps
16537
+ });
16538
+ const iterationMigrated = migrateIterationFields({
16539
+ lines: mappedResult.lines,
16481
16540
  schema,
16482
16541
  renames,
16483
16542
  fills,
@@ -16509,7 +16568,8 @@ function runDocMigrate(options) {
16509
16568
  const renamedIteration = iterationMigrated.renamed.length;
16510
16569
  const insertedIteration = iterationMigrated.inserted.length;
16511
16570
  const droppedIteration = iterationMigrated.dropped.length;
16512
- if (0 === addedRows && 0 === addedFields && 0 === renamedColumns && 0 === reorderedBlocks && 0 === strippedIds && 0 === renamedIteration && 0 === insertedIteration && 0 === droppedIteration) continue;
16571
+ const remappedCells = mappedResult.changed;
16572
+ if (0 === addedRows && 0 === addedFields && 0 === renamedColumns && 0 === reorderedBlocks && 0 === strippedIds && 0 === renamedIteration && 0 === insertedIteration && 0 === droppedIteration && 0 === remappedCells) continue;
16513
16573
  const migrated = {
16514
16574
  lines: reordered.lines,
16515
16575
  unresolved: tableMigrated.unresolved
@@ -16524,6 +16584,7 @@ function runDocMigrate(options) {
16524
16584
  renamedIteration,
16525
16585
  insertedIteration,
16526
16586
  droppedIteration,
16587
+ remappedCells,
16527
16588
  unresolved: tableMigrated.unresolved
16528
16589
  });
16529
16590
  if (true === options.dryRun) continue;
@@ -16569,6 +16630,7 @@ function runDocMigrate(options) {
16569
16630
  if (item.renamedIteration > 0) parts.push(`${item.renamedIteration} 个迭代信息字段改名`);
16570
16631
  if (item.insertedIteration > 0) parts.push(`${item.insertedIteration} 个迭代信息字段补行`);
16571
16632
  if (item.droppedIteration > 0) parts.push(`${item.droppedIteration} 个迭代信息字段删行`);
16633
+ if (item.remappedCells > 0) parts.push(`${item.remappedCells} 个单元格改值`);
16572
16634
  printLine(` · ${item.file} ${parts.join(' + ')}${extra}`);
16573
16635
  }
16574
16636
  if (totalUnresolved.length > 0) {
@@ -16605,12 +16667,15 @@ function collectTaskScopes(lines, schema) {
16605
16667
  return result;
16606
16668
  }
16607
16669
  function registerDocMigrate(doc) {
16608
- doc.command('migrate').description('按 schema.json 迁移存量文档(列改名 + 补缺失列 + 补详情字段 + 迭代信息字段)').option('-i, --iteration <name>', '只迁移指定迭代').option('--dry-run', '只打印将要迁移的文件,不写盘').option('--rename <old=new>', '列名对应关系(可多次),如 --rename "任务编号=任务号";不给时按缺失/多余列自动推断', (value, previous)=>[
16670
+ doc.command('migrate').description('按 schema.json 迁移存量文档(列改名 + 改单元格取值 + 补缺失列 + 补详情字段 + 迭代信息字段)').option('-i, --iteration <name>', '只迁移指定迭代').option('--dry-run', '只打印将要迁移的文件,不写盘').option('--rename <old=new>', '列名对应关系(可多次),如 --rename "任务编号=任务号";不给时按缺失/多余列自动推断', (value, previous)=>[
16609
16671
  ...previous ?? [],
16610
16672
  value
16611
16673
  ]).option('--fill <label=value>', '补齐迭代信息字段的值(可多次),如 --fill "迭代名称=引励场学员随访"', (value, previous)=>[
16612
16674
  ...previous ?? [],
16613
16675
  value
16676
+ ]).option('--map <column=from=to>', '批量改单元格取值(可多次),如 --map "执行终端=ai-pad=引励场AI学习机"', (value, previous)=>[
16677
+ ...previous ?? [],
16678
+ value
16614
16679
  ]).option('--drop <label>', '删除已下线的迭代信息字段行(可多次),如 --drop "排期计划"', (value, previous)=>[
16615
16680
  ...previous ?? [],
16616
16681
  value
@@ -17222,7 +17287,7 @@ function runDocApply(options, mode = 'apply') {
17222
17287
  plan,
17223
17288
  schema,
17224
17289
  role,
17225
- index: buildRepoSideIndex(config.terminals),
17290
+ index: buildTerminalSideIndex(config.terminals),
17226
17291
  knownTaskIds: parsed.tasks.map((task)=>task.id),
17227
17292
  knownRequirements: parsed.requirements.map((item)=>item.id)
17228
17293
  });
@@ -17240,7 +17305,7 @@ function runDocApply(options, mode = 'apply') {
17240
17305
  developer,
17241
17306
  aggregate: aggregateRequirement
17242
17307
  });
17243
- const sideIndex = buildRepoSideIndex(config.terminals);
17308
+ const sideIndex = buildTerminalSideIndex(config.terminals);
17244
17309
  const sideReport = validateTaskSides({
17245
17310
  index: sideIndex,
17246
17311
  tasks: rendered.assigned.map((item)=>{
@@ -18560,9 +18625,9 @@ async function fetchManifest(url) {
18560
18625
  const payload = await response.json();
18561
18626
  if ('string' != typeof payload.version || 0 === payload.version.length) return null;
18562
18627
  return {
18563
- current: "0.10.0",
18628
+ current: "0.11.0",
18564
18629
  latest: payload.version,
18565
- hasUpdate: isNewer(payload.version, "0.10.0"),
18630
+ hasUpdate: isNewer(payload.version, "0.11.0"),
18566
18631
  downloadUrl: 'string' == typeof payload.downloadUrl ? payload.downloadUrl : null,
18567
18632
  source: 'manifest',
18568
18633
  checkedAt: new Date().toISOString(),
@@ -18574,7 +18639,7 @@ async function fetchManifest(url) {
18574
18639
  }
18575
18640
  async function fetchNpm() {
18576
18641
  const base = {
18577
- current: "0.10.0",
18642
+ current: "0.11.0",
18578
18643
  latest: null,
18579
18644
  hasUpdate: false,
18580
18645
  downloadUrl: null,
@@ -18601,7 +18666,7 @@ async function fetchNpm() {
18601
18666
  return {
18602
18667
  ...base,
18603
18668
  latest,
18604
- hasUpdate: isNewer(latest, "0.10.0"),
18669
+ hasUpdate: isNewer(latest, "0.11.0"),
18605
18670
  downloadUrl: null
18606
18671
  };
18607
18672
  } catch (error) {
@@ -18808,7 +18873,7 @@ async function runUpgrade(options) {
18808
18873
  const kind = detectInstallKind();
18809
18874
  const result = await checkUpdate(true);
18810
18875
  const target = void 0 === options.to ? result.latest : assertVersion(options.to.trim());
18811
- printLine("当前版本:0.10.0");
18876
+ printLine("当前版本:0.11.0");
18812
18877
  printLine(`安装方式:${installKindLabel(kind)}`);
18813
18878
  if (null !== result.error) printLine(`版本查询失败:${result.error}`);
18814
18879
  else if (null !== result.latest) printLine(`最新版本:${result.latest}(来源:${result.source})`);
@@ -19269,11 +19334,11 @@ function checkSchemaRequirement(config) {
19269
19334
  const required = parseMinVersion(schema.requiresYlcwf);
19270
19335
  if (null === required) return [];
19271
19336
  const floor = `${required[0]}.${required[1]}.${required[2]}`;
19272
- if (compareVersions("0.10.0", floor) >= 0) return [];
19337
+ if (compareVersions("0.11.0", floor) >= 0) return [];
19273
19338
  return [
19274
19339
  {
19275
19340
  level: 'error',
19276
- message: `文档仓库要求 ylcwf ${schema.requiresYlcwf},当前 0.10.0;请先升级:npm install -g ylcwf@latest`
19341
+ message: `文档仓库要求 ylcwf ${schema.requiresYlcwf},当前 0.11.0;请先升级:npm install -g ylcwf@latest`
19277
19342
  }
19278
19343
  ];
19279
19344
  } catch (error) {
@@ -19568,7 +19633,7 @@ function readState(explicitPath) {
19568
19633
  issues: checked.issues,
19569
19634
  backups: listBackups(explicitPath),
19570
19635
  meta: {
19571
- version: "0.10.0",
19636
+ version: "0.11.0",
19572
19637
  features: SERVER_FEATURES
19573
19638
  }
19574
19639
  };
@@ -20988,7 +21053,7 @@ function registerReset(program) {
20988
21053
  }
20989
21054
  function buildProgram() {
20990
21055
  const program = new command_Command();
20991
- program.name('ylcwf').description('YLC 研发工作流配置:文档仓库、开发者标识、默认角色与执行终端仓库映射').version("0.10.0", '-v, --version', '显示版本号').showHelpAfterError();
21056
+ program.name('ylcwf').description('YLC 研发工作流配置:文档仓库、开发者标识、默认角色与执行终端仓库映射').version("0.11.0", '-v, --version', '显示版本号').showHelpAfterError();
20992
21057
  registerInit(program);
20993
21058
  registerShow(program);
20994
21059
  registerGet(program);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ylcwf",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "研发工作流 CLI:配置、文档校验与模板、PRD 快照(dws 取数)与任务状态机",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,8 +37,8 @@
37
37
  "tsx": "^4.23.15",
38
38
  "typescript": "^5.9.3",
39
39
  "@ylcwf/core": "0.5.2",
40
- "@ylcwf/ui": "0.5.2",
41
- "@ylcwf/server": "0.5.2"
40
+ "@ylcwf/server": "0.5.2",
41
+ "@ylcwf/ui": "0.5.2"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "rslib build && node ../../scripts/sync-ui-dist.mjs ui-dist",