@icebreakers/monorepo 5.5.5 → 5.5.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.
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { d as message, l as version, m as logger, p as supportedLocales, r as cliName, t as initToolingTargets, u as localize, y as fs } from "./types-g0R589p_.mjs";
1
+ import { d as message, l as version, m as logger, p as supportedLocales, r as cliName, t as initToolingTargets, u as localize, y as fs } from "./types-DpfpqJWb.mjs";
2
2
  import { s as resolveCommandConfig } from "./config-p842Knhq.mjs";
3
3
  import path from "pathe";
4
4
  import process from "node:process";
@@ -10,7 +10,7 @@ import { Command, Option } from "commander";
10
10
  async function handleAiPromptCreate(cwd, opts) {
11
11
  const [{ input }, { createTimestampFolderName, defaultAgenticBaseDir, generateAgenticTemplate, generateAgenticTemplates, loadAgenticTasks }, { resolveCommandConfig }] = await Promise.all([
12
12
  import("@icebreakers/monorepo-templates"),
13
- import("./commands-D8kCvxPl.mjs").then((n) => n.t),
13
+ import("./commands-CCp7Q5I1.mjs").then((n) => n.t),
14
14
  import("./config-p842Knhq.mjs").then((n) => n.n)
15
15
  ]);
16
16
  const aiConfig = await resolveCommandConfig("ai", cwd);
@@ -125,7 +125,7 @@ async function emitConfigInspection(inspection, opts, cwd) {
125
125
  }
126
126
  function registerConfigCommands(program, cwd) {
127
127
  program.command("config").alias("cfg").description(localize("Configuration commands", "配置命令")).command("inspect").description(localize("Show the active repoctl config file and resolved configuration", "输出当前 repoctl 配置文件和已解析配置")).alias("i").option("--json", localize("Output JSON for scripts", "输出 JSON,方便脚本消费")).option("--markdown", localize("Output Markdown", "输出 Markdown,方便粘贴到 issue 或 PR")).option("--out <file>", localize("Write output to a file", "把当前输出写入文件")).option("--redact", localize("Redact cwd, configDir, and home paths", "脱敏 cwd/configDir/home 绝对路径后再输出")).action(async (opts) => {
128
- const { inspectMonorepoConfig } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
128
+ const { inspectMonorepoConfig } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
129
129
  await emitConfigInspection(await inspectMonorepoConfig(cwd), opts, cwd);
130
130
  });
131
131
  }
@@ -445,23 +445,23 @@ async function emitEnvSupportBundle(bundle, opts, cwd) {
445
445
  function registerEnvCommands(program, cwd) {
446
446
  const envCommand = program.command("env").alias("e").description(localize("Environment and support commands", "环境命令"));
447
447
  envCommand.command("info").description(localize("Show environment information for the current repository", "输出当前仓库环境信息")).alias("i").option("--json", localize("Output JSON for scripts", "输出 JSON,方便脚本消费")).option("--markdown", localize("Output Markdown", "输出 Markdown,方便粘贴到 issue 或 PR")).option("--out <file>", localize("Write output to a file", "把当前输出写入文件")).option("--redact", localize("Redact workspace, cwd, and home paths", "脱敏 workspace/cwd/home 绝对路径后再输出")).action(async (opts) => {
448
- const { collectEnvInfo } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
448
+ const { collectEnvInfo } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
449
449
  await emitEnvInfo(await collectEnvInfo(cwd), opts, cwd);
450
450
  });
451
451
  envCommand.command("snapshot").description(localize("Create a support snapshot with environment, doctor, and check data", "输出排障快照,包含环境、doctor 和 check 计划")).alias("s").option("--json", localize("Output JSON for scripts", "输出 JSON,方便脚本消费")).option("--markdown", localize("Output Markdown", "输出 Markdown,方便粘贴到 issue 或 PR")).option("--out <file>", localize("Write output to a file", "把当前输出写入文件")).option("--redact", localize("Redact workspace, cwd, and home paths", "脱敏 workspace/cwd/home 绝对路径后再输出")).option("--strict", localize("Fail when doctor reports a failure or warning", "输出快照后,如果 doctor 有 fail 或 warn 则返回失败码")).action(async (opts) => {
452
- const { collectEnvSnapshot } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
452
+ const { collectEnvSnapshot } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
453
453
  await emitEnvSnapshot(await collectEnvSnapshot(cwd), opts, cwd);
454
454
  });
455
455
  envCommand.command("paths").description(localize("Show important repository and report paths", "输出当前仓库关键路径和报告建议位置")).alias("p").option("--json", localize("Output JSON for scripts", "输出 JSON,方便脚本消费")).option("--markdown", localize("Output Markdown", "输出 Markdown,方便粘贴到 issue 或 PR")).option("--out <file>", localize("Write output to a file", "把当前输出写入文件")).option("--redact", localize("Redact workspace, cwd, and home paths", "脱敏 workspace/cwd/home 绝对路径后再输出")).action(async (opts) => {
456
- const { collectEnvPaths } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
456
+ const { collectEnvPaths } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
457
457
  await emitEnvPaths(await collectEnvPaths(cwd), opts, cwd);
458
458
  });
459
459
  envCommand.command("support").description(localize("Create a complete support bundle", "输出完整排障包,包含环境、路径、配置、doctor 和 check 计划")).alias("b").option("--json", localize("Output JSON for scripts", "输出 JSON,方便脚本消费")).option("--markdown", localize("Output Markdown", "输出 Markdown,方便粘贴到 issue 或 PR")).option("--out <file>", localize("Write output to a file", "把当前输出写入文件")).option("--redact", localize("Redact workspace, cwd, and home paths", "脱敏 workspace/cwd/home 绝对路径后再输出")).option("--strict", localize("Fail when doctor reports a failure or warning", "输出排障包后,如果 doctor 有 fail 或 warn 则返回失败码")).action(async (opts) => {
460
- const { collectEnvSupportBundle } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
460
+ const { collectEnvSupportBundle } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
461
461
  await emitEnvSupportBundle(await collectEnvSupportBundle(cwd), opts, cwd);
462
462
  });
463
463
  envCommand.command("mirror").description(localize("Configure the VS Code binary mirror", "设置 VS Code binary mirror")).alias("m").action(async () => {
464
- const { setVscodeBinaryMirror } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
464
+ const { setVscodeBinaryMirror } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
465
465
  await setVscodeBinaryMirror(cwd);
466
466
  logger.success(localize("Environment mirror finished.", "环境镜像完成。"));
467
467
  });
@@ -470,7 +470,7 @@ function registerEnvCommands(program, cwd) {
470
470
  //#region src/cli/commands/package.ts
471
471
  function registerPackageCommands(program, cwd) {
472
472
  program.command("package").alias("pkg").description(localize("Package commands", "子包命令")).command("create").description(localize("Create a new workspace package", "创建一个新的子包")).alias("new").argument("[name]").option("-t, --template <template>", localize("Use a template key without prompting", "直接使用指定模板,跳过模板选择")).option("--dry-run", localize("Preview without writing files", "预览将要创建的目录与 package 信息,不写入文件")).option("--json", localize("Output JSON; implies --dry-run", "以 JSON 输出创建预览,隐含 --dry-run")).option("--out <file>", localize("Write the preview to a file; implies --dry-run", "把创建预览写入文件,隐含 --dry-run")).action(async (inputName, opts) => {
473
- const { runCreateFlow } = await import("./create-flow-BxK8BJHc.mjs");
473
+ const { runCreateFlow } = await import("./create-flow-DUgGkiS_.mjs");
474
474
  const result = await runCreateFlow(cwd, inputName, {
475
475
  ...opts.template !== void 0 ? { template: opts.template } : {},
476
476
  ...opts.dryRun || opts.json || opts.out ? { dryRun: true } : {},
@@ -502,7 +502,7 @@ function registerReleaseCommands(program, cwd) {
502
502
  const releaseCommand = program.command("release").description(localize("Release and pnpm versioning commands", "发布与 pnpm versioning 工具集"));
503
503
  releaseCommand.command("ci").description(localize("Prepare, publish, or recover versions in CI", "在 CI 中自动准备、发布和恢复版本")).option("--mode <mode>", localize("auto / prepare / publish / publish-unpublished / reconcile", "auto / prepare / publish / publish-unpublished / reconcile"), "auto").option("--package <name>", localize("Package used by publish-unpublished mode", "publish-unpublished 使用的 package")).option("--version <version>", localize("Version used by publish-unpublished mode", "publish-unpublished 使用的版本")).option("--dry-run", localize("Preview reconcile changes without updating GitHub", "只预览 reconcile 变更,不更新 GitHub")).action(async (opts) => {
504
504
  await runReleaseAction(async () => {
505
- const { releaseCi } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
505
+ const { releaseCi } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
506
506
  await releaseCi({
507
507
  ...await resolveReleaseOptions(cwd),
508
508
  ...opts.mode ? { mode: opts.mode } : {},
@@ -515,7 +515,7 @@ function registerReleaseCommands(program, cwd) {
515
515
  });
516
516
  releaseCommand.command("notes").description(localize("Manage GitHub Release notes", "维护 GitHub Release 正文")).command("repair").description(localize("Rebuild GitHub Release notes from the changelog for each release tag", "按每个发布 tag 对应的 changelog 重建 GitHub Release 正文")).option("--all", localize("Repair every recognized GitHub Release", "修复所有可识别的 GitHub Release")).option("--tag <package@version>", localize("Repair only the specified package@version", "只修复指定 package@version")).option("--dry-run", localize("Generate and summarize without updating GitHub Releases", "只生成并统计,不更新 GitHub Release")).option("--create-missing", localize("Create a missing GitHub Release after validating the published package and tag", "核验已发布 package 和 tag 后补建缺失的 GitHub Release")).action(async (opts) => {
517
517
  await runReleaseAction(async () => {
518
- const { repairReleaseNotes } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
518
+ const { repairReleaseNotes } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
519
519
  const result = await repairReleaseNotes({
520
520
  cwd,
521
521
  ...opts.all ? { all: true } : {},
@@ -528,7 +528,7 @@ function registerReleaseCommands(program, cwd) {
528
528
  });
529
529
  const stableCommand = releaseCommand.command("stable").description(localize("Run a stable release from main", "在 main 分支执行正式发布")).action(async () => {
530
530
  await runReleaseAction(async () => {
531
- const { releaseCi } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
531
+ const { releaseCi } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
532
532
  await releaseCi({
533
533
  ...await resolveReleaseOptions(cwd),
534
534
  mode: "publish"
@@ -538,7 +538,7 @@ function registerReleaseCommands(program, cwd) {
538
538
  });
539
539
  stableCommand.command("prepare").description(localize("Consume pnpm change intents and prepare a Release PR", "消费 pnpm change intents 并准备 Release PR")).action(async () => {
540
540
  await runReleaseAction(async () => {
541
- const { releaseCi } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
541
+ const { releaseCi } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
542
542
  await releaseCi({
543
543
  ...await resolveReleaseOptions(cwd),
544
544
  mode: "prepare"
@@ -548,7 +548,7 @@ function registerReleaseCommands(program, cwd) {
548
548
  });
549
549
  stableCommand.command("publish").description(localize("Publish versions on main that are not yet on npm", "发布 main 分支上尚未发布的包")).action(async () => {
550
550
  await runReleaseAction(async () => {
551
- const { releaseCi } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
551
+ const { releaseCi } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
552
552
  await releaseCi({
553
553
  ...await resolveReleaseOptions(cwd),
554
554
  mode: "publish"
@@ -559,21 +559,21 @@ function registerReleaseCommands(program, cwd) {
559
559
  const preCommand = releaseCommand.command("pre").description(localize("Run or manage prereleases", "执行或管理 prerelease 发布"));
560
560
  preCommand.command("publish").alias("run").description(localize("Publish a prerelease from an alpha, beta, rc, or next lane", "在 alpha/beta/rc/next 分支发布 prerelease")).action(async () => {
561
561
  await runReleaseAction(async () => {
562
- const { releaseCi } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
562
+ const { releaseCi } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
563
563
  await releaseCi(await resolveReleaseOptions(cwd));
564
564
  logger.success(localize("Prerelease finished.", "预发布完成。"));
565
565
  });
566
566
  });
567
567
  preCommand.command("enter").description(localize("Enter a pnpm prerelease lane", "进入 pnpm prerelease lane")).argument("<tag>", localize("alpha / beta / rc / next", "alpha / beta / rc / next")).action(async (tag) => {
568
568
  await runReleaseAction(async () => {
569
- const { enterPrerelease } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
569
+ const { enterPrerelease } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
570
570
  await enterPrerelease(tag, { cwd });
571
571
  logger.success(localize(`Entered ${tag} prerelease mode.`, `已进入 ${tag} 预发布模式。`));
572
572
  });
573
573
  });
574
574
  preCommand.command("exit").description(localize("Exit the pnpm prerelease lane", "退出 pnpm prerelease lane")).action(async () => {
575
575
  await runReleaseAction(async () => {
576
- const { exitPrerelease } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
576
+ const { exitPrerelease } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
577
577
  await exitPrerelease({ cwd });
578
578
  logger.success(localize("Exited prerelease mode.", "已退出预发布模式。"));
579
579
  });
@@ -590,7 +590,7 @@ const skillTargets = [
590
590
  ];
591
591
  function registerSkillsCommands(program, cwd) {
592
592
  program.command("skills").alias("sk").description(localize("AI skill commands", "技能工具集")).command("sync").description(localize("Synchronize the repoctl skill to global agent directories", "同步 resources/skills/repoctl 到全局目录")).alias("s").option("--codex", localize("Synchronize to ~/.codex/skills", "同步到 ~/.codex/skills")).option("--claude", localize("Synchronize to ~/.claude/skills", "同步到 ~/.claude/skills")).option("--cursor", localize("Synchronize to ~/.cursor/skills", "同步到 ~/.cursor/skills")).option("--agents", localize("Synchronize to ~/.agents/skills", "同步到 ~/.agents/skills")).option("--grok", localize("Synchronize to ~/.grok/skills", "同步到 ~/.grok/skills")).option("--all", localize("Synchronize every target", "同步全部目标")).action(async (opts) => {
593
- const { syncSkills } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
593
+ const { syncSkills } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
594
594
  const selected = /* @__PURE__ */ new Set();
595
595
  if (opts.all) for (const target of skillTargets) selected.add(target);
596
596
  else {
@@ -713,7 +713,7 @@ function registerTemplatesCommands(program) {
713
713
  program.command("templates").alias("tpl").description(localize("List the built-in templates", "列出可用的内置模板")).argument("[key]", localize("Show details for a template key", "查看指定模板详情")).option("-c, --category <category>", localize("Filter by library, app, service, docs, or tool", "按模板分类过滤:library / app / service / docs / tool")).option("--check", localize("Check built-in template metadata and directories", "检查内置模板元数据、目录和临时文件")).option("--json", localize("Output JSON for scripts", "输出 JSON,方便脚本消费")).option("--markdown", localize("Output Markdown for documentation", "输出 Markdown,方便同步文档")).option("--out <file>", localize("Write output to a file", "把当前输出写入文件")).action(async (key, opts) => {
714
714
  const { getTemplateChoice, getTemplateChoices, isTemplateCategory, suggestTemplateKey, templateCategories } = await import("@icebreakers/monorepo-templates");
715
715
  if (opts.check) {
716
- const { checkTemplates } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
716
+ const { checkTemplates } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
717
717
  const report = await checkTemplates();
718
718
  if (opts.json) await emitTemplateOutput(JSON.stringify(report, null, 2), opts);
719
719
  else await emitTemplateOutput(formatTemplateHealthReport(report, !opts.out), opts);
@@ -792,7 +792,7 @@ function normalizeToolingTargets(tooling) {
792
792
  function registerToolingCommands(program, cwd) {
793
793
  program.command("tooling").alias("tg").description(localize("Tooling configuration commands", "工程化配置命令")).command("init").description(localize(`Generate tooling configuration (${initToolingTargets.join(", ")})`, `生成 tooling 配置(可选值:${initToolingTargets.join(", ")})`)).alias("i").argument("[tooling...]").option("-a, --all", localize("Generate every tooling configuration", "生成全部 tooling 配置")).option("-f, --force", localize("Overwrite existing tooling configuration files", "覆盖已存在的 tooling 配置文件")).action(async (tooling = [], opts) => {
794
794
  const normalizedTooling = normalizeToolingTargets(tooling);
795
- const { initTooling } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
795
+ const { initTooling } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
796
796
  await initTooling(cwd, {
797
797
  ...normalizedTooling ? { targets: normalizedTooling } : {},
798
798
  ...opts.all !== void 0 ? { all: opts.all } : {},
@@ -963,7 +963,7 @@ async function emitCheckPlan(plan, opts, cwd) {
963
963
  }
964
964
  function registerTopLevelCommands(program, cwd) {
965
965
  program.command("init").description(localize("Initialize the current workspace with recommended configuration", "初始化当前 workspace,并生成推荐配置")).option("--preset <preset>", localize("Initialization preset: minimal or standard", "初始化预设:minimal / standard"), "standard").option("-f, --force", localize("Overwrite existing tooling configuration files", "覆盖已存在的 tooling 配置文件")).option("--overwrite", localize("Overwrite existing managed files", "覆盖受管的已存在文件")).option("-y, --yes", localize("Use defaults without prompting; suitable for CI", "使用默认值跳过所有交互,适合 CI")).action(async (opts) => {
966
- const { init } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
966
+ const { init } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
967
967
  await init(cwd, {
968
968
  ...opts.preset !== void 0 ? { preset: opts.preset } : {},
969
969
  ...opts.force !== void 0 ? { force: opts.force } : {},
@@ -974,7 +974,7 @@ function registerTopLevelCommands(program, cwd) {
974
974
  logger.info(localize("Next: run `pnpm install` and `pnpm build`.", "下一步:运行 `pnpm install` 和 `pnpm build`。"));
975
975
  });
976
976
  program.command("new").description(localize("Create a new package or application", "创建新的 package / app")).argument("[name]").option("-t, --template <template>", localize("Use a template key without prompting", "直接使用指定模板,跳过模板选择")).option("--dry-run", localize("Preview directories and package metadata without writing", "预览将要创建的目录与 package 信息,不写入文件")).option("--json", localize("Output the creation preview as JSON; implies --dry-run", "以 JSON 输出创建预览,隐含 --dry-run")).option("--out <file>", localize("Write the creation preview to a file; implies --dry-run", "把创建预览写入文件,隐含 --dry-run")).action(async (inputName, opts) => {
977
- const { runCreateFlow } = await import("./create-flow-BxK8BJHc.mjs");
977
+ const { runCreateFlow } = await import("./create-flow-DUgGkiS_.mjs");
978
978
  const result = await runCreateFlow(cwd, inputName, {
979
979
  ...opts.template !== void 0 ? { template: opts.template } : {},
980
980
  ...opts.dryRun || opts.json || opts.out ? { dryRun: true } : {},
@@ -992,10 +992,10 @@ function registerTopLevelCommands(program, cwd) {
992
992
  ...opts.staged !== void 0 ? { staged: opts.staged } : {},
993
993
  ...opts.editFile !== void 0 ? { editFile: opts.editFile } : {}
994
994
  };
995
- const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
995
+ const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
996
996
  if (opts.dryRun || opts.json || opts.markdown || opts.out) {
997
997
  if (opts.full) {
998
- const { resolveFullWorkspaceCheckPlan } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
998
+ const { resolveFullWorkspaceCheckPlan } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
999
999
  await emitCheckPlan(await resolveFullWorkspaceCheckPlan(cwd), opts, cwd);
1000
1000
  return;
1001
1001
  }
@@ -1006,7 +1006,7 @@ function registerTopLevelCommands(program, cwd) {
1006
1006
  logger.success(localize("Checks finished.", "检查完成。"));
1007
1007
  });
1008
1008
  program.command("doctor").description(localize("Diagnose whether the current repository is ready to use", "诊断当前仓库是否适合直接开始使用")).option("--json", localize("Output JSON for CI or scripts", "输出 JSON 报告,方便 CI 或脚本消费")).option("--markdown", localize("Output Markdown for an issue or pull request", "输出 Markdown 报告,方便粘贴到 issue 或 PR")).option("--out <file>", localize("Write the diagnostic report to a file", "把诊断报告写入文件")).option("--redact", localize("Redact workspace, cwd, and home paths", "脱敏 workspace/cwd/home 绝对路径后再输出")).option("--strict", localize("Treat warnings as failures", "把 warning 也视为失败,适合 CI 门禁")).action(async (opts) => {
1009
- const { runDoctor } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1009
+ const { runDoctor } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1010
1010
  const report = await runDoctor(cwd);
1011
1011
  await emitDoctorReport(report, opts, cwd);
1012
1012
  if (opts.out || opts.json || opts.markdown) {
@@ -1029,7 +1029,7 @@ function registerTopLevelCommands(program, cwd) {
1029
1029
  logger.success(localize("Doctor finished.", "Doctor 诊断完成。"));
1030
1030
  });
1031
1031
  program.command("upgrade").description(localize("Synchronize standard repository assets and scripts", "同步仓库标准资产与脚本")).option("-i,--interactive", localize("Select managed files interactively", "交互式选择受管文件")).option("-c,--core", localize("Synchronize core configuration without GitHub assets", "仅同步核心配置,跳过 GitHub 相关资产")).option("--outDir <dir>", localize("Output directory", "输出目录")).option("-s,--skip-overwrite", localize("Preserve existing files", "保留已存在文件")).option("-y, --yes", localize("Skip prompts and overwrite drifted managed assets", "跳过交互并覆盖 drifted 标准资产")).option("--overwrite", localize("Overwrite drifted managed assets", "覆盖 drifted 标准资产")).option("--no-overwrite", localize("Preserve drifted managed assets", "不覆盖 drifted 标准资产")).option("--overwrite-release", localize("Overwrite an unmarked custom release workflow", "覆盖未标记的自定义 release workflow")).action(async (opts) => {
1032
- const { upgradeMonorepo } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1032
+ const { upgradeMonorepo } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1033
1033
  await upgradeMonorepo(normalizeCliOpts(cwd, opts));
1034
1034
  logger.success(localize("Upgrade finished.", "升级完成。"));
1035
1035
  });
@@ -1039,22 +1039,22 @@ function registerTopLevelCommands(program, cwd) {
1039
1039
  function registerVerifyCommands(program, cwd) {
1040
1040
  const verifyCommand = program.command("verify").alias("v").description(localize("Local verification commands", "本地校验工具集"));
1041
1041
  verifyCommand.command("pre-push").description(localize("Run build, test, and tsd checks for pushed changes", "按推送变更范围执行 build/test/tsd 校验")).alias("push").action(async () => {
1042
- const { verifyPrePush } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1042
+ const { verifyPrePush } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1043
1043
  await verifyPrePush({ cwd });
1044
1044
  });
1045
1045
  verifyCommand.command("pre-commit").description(localize("Run lint-staged verification", "执行 lint-staged 校验")).alias("commit").action(async () => {
1046
- const { verifyPreCommit } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1046
+ const { verifyPreCommit } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1047
1047
  await verifyPreCommit({ cwd });
1048
1048
  });
1049
1049
  verifyCommand.command("commit-msg").description(localize("Run commitlint verification", "执行 commitlint 校验")).alias("msg").argument("<edit-file>").action(async (editFile) => {
1050
- const { verifyCommitMsg } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1050
+ const { verifyCommitMsg } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1051
1051
  await verifyCommitMsg({
1052
1052
  cwd,
1053
1053
  editFile
1054
1054
  });
1055
1055
  });
1056
1056
  verifyCommand.command("staged-typecheck").description(localize("Run typecheck in workspaces containing staged files", "按暂存文件所在 workspace 执行 typecheck")).alias("tc").argument("[files...]").action(async (files = []) => {
1057
- const { verifyStagedTypecheck } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1057
+ const { verifyStagedTypecheck } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1058
1058
  verifyStagedTypecheck(files, { cwd });
1059
1059
  });
1060
1060
  }
@@ -1133,12 +1133,12 @@ async function emitWorkspaceList(result, opts) {
1133
1133
  function registerWorkspaceCommands(program, cwd) {
1134
1134
  const workspaceCommand = program.command("workspace").alias("ws").description(localize("Workspace commands", "工作区命令"));
1135
1135
  workspaceCommand.command("upgrade").description(localize("Upgrade or synchronize monorepo packages", "升级/同步 monorepo 相关包")).alias("up").option("-i,--interactive", localize("Select managed files interactively", "交互式选择受管文件")).option("-c,--core", localize("Synchronize core configuration without GitHub assets", "仅同步核心配置,跳过 GitHub 相关资产")).option("--outDir <dir>", localize("Output directory", "输出目录")).option("-s,--skip-overwrite", localize("Preserve existing files", "保留已存在文件")).option("-y, --yes", localize("Skip prompts and overwrite drifted managed assets", "跳过交互并覆盖 drifted 标准资产")).option("--overwrite", localize("Overwrite drifted managed assets", "覆盖 drifted 标准资产")).option("--no-overwrite", localize("Preserve drifted managed assets", "不覆盖 drifted 标准资产")).option("--overwrite-release", localize("Overwrite an unmarked custom release workflow", "覆盖未标记的自定义 release workflow")).action(async (opts) => {
1136
- const { upgradeMonorepo } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1136
+ const { upgradeMonorepo } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1137
1137
  await upgradeMonorepo(normalizeCliOpts(cwd, opts));
1138
1138
  logger.success(localize("Workspace upgrade finished.", "Workspace 升级完成。"));
1139
1139
  });
1140
1140
  workspaceCommand.command("init").description(localize("Initialize workspace metadata and repository files", "初始化工作区元信息(README、package.json、pnpm intent、issue template)")).alias("i").action(async () => {
1141
- const { initMetadata } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1141
+ const { initMetadata } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1142
1142
  await initMetadata(cwd);
1143
1143
  logger.success(localize("Workspace initialization finished.", "Workspace 初始化完成。"));
1144
1144
  });
@@ -1151,7 +1151,7 @@ function registerWorkspaceCommands(program, cwd) {
1151
1151
  }), opts);
1152
1152
  });
1153
1153
  workspaceCommand.command("clean").description(localize("Remove selected workspace packages", "清除选中的包")).alias("rm").option("-y, --yes", localize("Skip prompts and clean immediately", "跳过交互直接清理(等价 autoConfirm)")).option("--include-private", localize("Include private packages", "包含 private 包")).option("--pinned-version <version>", localize("Override the repoctl version written to the root package", "覆盖写入的 repoctl 版本")).action(async (opts) => {
1154
- const { cleanProjects } = await import("./commands-D8kCvxPl.mjs").then((n) => n.t);
1154
+ const { cleanProjects } = await import("./commands-CCp7Q5I1.mjs").then((n) => n.t);
1155
1155
  await cleanProjects(cwd, normalizeCleanOptions(opts));
1156
1156
  logger.success(localize("Workspace cleanup finished.", "Workspace 清理完成。"));
1157
1157
  });
@@ -1,6 +1,6 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
2
- import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries } from "./workspace-MCKewElu.mjs";
3
- import { b as isIgnorableFsError, c as package_default$1, f as resolveRepoctlLocale, i as packageDir, l as version$1, m as logger, n as assetsDir, o as templatesDir, t as initToolingTargets, u as localize, y as fs$1 } from "./types-g0R589p_.mjs";
2
+ import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries, t as clearWorkspaceCache } from "./workspace-MCKewElu.mjs";
3
+ import { b as isIgnorableFsError, c as package_default$1, f as resolveRepoctlLocale, i as packageDir, l as version$1, m as logger, n as assetsDir, o as templatesDir, t as initToolingTargets, u as localize, y as fs$1 } from "./types-DpfpqJWb.mjs";
4
4
  import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getRepoctlConfigCandidates, o as loadMonorepoConfigDetails, s as resolveCommandConfig } from "./config-p842Knhq.mjs";
5
5
  import { f as defineTsconfigConfig } from "./tooling-BfXlmCi-.mjs";
6
6
  import gitUrlParse from "git-url-parse";
@@ -8,18 +8,20 @@ import { simpleGit } from "simple-git";
8
8
  import { findWorkspaceDir } from "@pnpm/find-workspace-dir";
9
9
  import path from "pathe";
10
10
  import process from "node:process";
11
- import { access, readFile, readdir, realpath, rm, writeFile } from "node:fs/promises";
11
+ import { access, readFile, readdir, realpath, rename, rm, writeFile } from "node:fs/promises";
12
12
  import { execFileSync, spawnSync } from "node:child_process";
13
13
  import fs from "node:fs";
14
14
  import path$1 from "node:path";
15
- import { checkbox, ensureTemplateAssetsPrepared, getAssetTargets, getTemplateChoices, isGitignoreFile, scaffoldTemplate, shouldSkipTemplatePath, suggestTemplateKey, templateChoices, toPublishGitignorePath, toWorkspaceGitignorePath } from "@icebreakers/monorepo-templates";
15
+ import { checkbox, ensureTemplateAssetsPrepared, getAssetTargets, getTemplateChoices, getWorkspacePackageManager, isGitignoreFile, scaffoldTemplate, shouldSkipTemplatePath, suggestTemplateKey, templateChoices, toPublishGitignorePath, toWorkspaceAssetPath, toWorkspaceGitignorePath } from "@icebreakers/monorepo-templates";
16
16
  import YAML, { isSeq, parseDocument } from "yaml";
17
17
  import { Buffer } from "node:buffer";
18
- import crypto from "node:crypto";
18
+ import crypto, { randomUUID } from "node:crypto";
19
19
  import os from "node:os";
20
20
  import pc from "picocolors";
21
21
  import { coerce, gte, minVersion, satisfies } from "semver";
22
22
  import { parse, stringify } from "comment-json";
23
+ import { stripVTControlCharacters } from "node:util";
24
+ import { performance } from "node:perf_hooks";
23
25
  import klaw from "klaw";
24
26
  //#region src/core/git.ts
25
27
  /**
@@ -1846,7 +1848,7 @@ var package_default = {
1846
1848
  type: "module",
1847
1849
  version: "0.0.0",
1848
1850
  "private": true,
1849
- packageManager: "pnpm@12.5.1",
1851
+ packageManager: "pnpm@12.6.0",
1850
1852
  description: "Source workspace for repoctl and Icebreaker's shared development packages",
1851
1853
  author: "ice breaker <hi@sonofmagic.top>",
1852
1854
  license: "MIT",
@@ -1867,10 +1869,24 @@ var package_default = {
1867
1869
  scripts: {
1868
1870
  "build": "turbo run build",
1869
1871
  "tooling:build": "turbo run build --filter=@icebreakers/monorepo --filter=repoctl",
1870
- "dev": "turbo run dev --parallel",
1871
- "test": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest run && pnpm test:types",
1872
+ "dev": "pnpm run dev:repoctl",
1873
+ "dev:repoctl": "turbo run build --filter=repoctl && node packages/monorepo-templates/dist/cli.mjs && turbo watch build --filter=repoctl",
1874
+ "dev:create": "turbo run build --filter=create-icebreaker && node packages/monorepo-templates/dist/cli.mjs && turbo watch build --filter=create-icebreaker",
1875
+ "dev:configs": "turbo watch build --filter=@icebreakers/eslint-config --filter=@icebreakers/commitlint-config --filter=lightningcss-tailwindcss --filter=@icebreakers/changelog-github",
1876
+ "dev:packages": "turbo run build \"--filter=./packages/*\" && node packages/monorepo-templates/dist/cli.mjs && turbo watch build \"--filter=./packages/*\"",
1877
+ "dev:assets": "pnpm --filter @icebreakers/monorepo-templates sync:assets",
1878
+ "dev:client": "pnpm run tooling:build && turbo run dev --filter=@icebreakers/client",
1879
+ "dev:server": "pnpm run tooling:build && turbo run dev --filter=@icebreakers/server",
1880
+ "dev:docs": "pnpm run tooling:build && turbo run dev --filter=@icebreakers/website",
1881
+ "dev:server:node": "pnpm run tooling:build && pnpm --filter @icebreakers/server node:dev",
1882
+ "dev:cli": "turbo watch build --filter=@icebreakers/cli",
1883
+ "dev:tsdown": "turbo watch build --filter=@icebreakers/tsdown-template",
1884
+ "dev:vue-lib": "turbo run build --filter=@icebreakers/vue-lib-template && pnpm --filter @icebreakers/vue-lib-template test:dev",
1885
+ "test": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest run && pnpm test:types && pnpm test:dev-scenarios",
1872
1886
  "test:packaged-doctor": "node scripts/smoke-packaged-doctor.mjs",
1887
+ "test:packaged-create": "node scripts/smoke-packaged-create.mjs",
1873
1888
  "test:worker-types": "node scripts/worker-types/index.mjs",
1889
+ "test:dev-scenarios": "vitest run --config scripts/dev/vitest.config.mjs",
1874
1890
  "test:dev": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest",
1875
1891
  "lint": "pnpm run tooling:build && turbo run lint",
1876
1892
  "tsd": "turbo run tsd",
@@ -2156,7 +2172,7 @@ async function ensureRootPackageJson(cwd) {
2156
2172
  type: "module",
2157
2173
  version: "0.0.0",
2158
2174
  private: true,
2159
- packageManager: "pnpm@12.3.4",
2175
+ packageManager: await getWorkspacePackageManager(),
2160
2176
  engines: { node: ">=22.13.0" },
2161
2177
  scripts: {},
2162
2178
  devDependencies: {}
@@ -3287,24 +3303,29 @@ function runAfterPublishHooks(packages, options) {
3287
3303
  }
3288
3304
  }
3289
3305
  //#endregion
3290
- //#region src/commands/release/publish.ts
3291
- const publishAttempts = 3;
3292
- const retryDelays = [2e4, 4e4];
3306
+ //#region src/commands/release/publish/evidence.ts
3293
3307
  function outputText(output) {
3294
3308
  return output == null ? "" : String(output);
3295
3309
  }
3296
- function commandOutput(result) {
3297
- return `${outputText(result.stdout)}\n${outputText(result.stderr)}`;
3310
+ function acceptedFromOutput(output, candidates) {
3311
+ const versions = new Set(candidates.map((pkg) => `${pkg.name}@${pkg.version}`));
3312
+ return stripVTControlCharacters(output).split(/\r?\n|\r/).flatMap((line) => {
3313
+ const match = line.trim().match(/^(?:✅\s*)?Published package ((?:@[^\s/]+\/)?[^\s@]+)@(\S+)$/u);
3314
+ if (!match || !versions.has(`${match[1]}@${match[2]}`)) return [];
3315
+ return [{
3316
+ name: match[1],
3317
+ version: match[2]
3318
+ }];
3319
+ });
3298
3320
  }
3299
3321
  function isTransientPublishFailure(output) {
3300
- return /CA_CREATE_SIGNING_CERTIFICATE_ERROR|\b(?:429|5\d{2})\b|EAI_AGAIN|ECONNRESET|ETIMEDOUT/i.test(output);
3322
+ return /CA_CREATE_SIGNING_CERTIFICATE_ERROR|\bE(?:429|5\d{2})\b|ERR_PNPM_FETCH_(?:429|5\d{2})\b|EAI_AGAIN|ECONNRESET|ETIMEDOUT|(?:HTTP(?:\/\d(?:\.\d)?)?|status(?:\s+code)?|response(?:\s+code)?)\s*(?:[:=]\s*)?(?:429|5\d{2})\b/i.test(output);
3301
3323
  }
3302
3324
  function isPublishConflict(output) {
3303
- return /cannot publish over|EPUBLISHCONFLICT|previously published|already exists/i.test(output);
3304
- }
3305
- function sleep(milliseconds, options) {
3306
- return options.sleep?.(milliseconds) ?? new Promise((resolve) => setTimeout(resolve, milliseconds));
3325
+ return /cannot publish over|EPUBLISHCONFLICT|previously published|already exists|status\s*(?::\s*)?409\b/i.test(output);
3307
3326
  }
3327
+ //#endregion
3328
+ //#region src/commands/release/publish/command.ts
3308
3329
  function runPublishAttempt(args, options) {
3309
3330
  const result = (options.spawn ?? spawnSync)("pnpm", args, {
3310
3331
  cwd: options.cwd,
@@ -3315,7 +3336,8 @@ function runPublishAttempt(args, options) {
3315
3336
  "ignore",
3316
3337
  "pipe",
3317
3338
  "pipe"
3318
- ]
3339
+ ],
3340
+ maxBuffer: 16777216
3319
3341
  });
3320
3342
  const stdout = outputText(result.stdout);
3321
3343
  const stderr = outputText(result.stderr);
@@ -3323,45 +3345,119 @@ function runPublishAttempt(args, options) {
3323
3345
  if (stderr) process.stderr.write(stderr);
3324
3346
  return {
3325
3347
  ...result,
3326
- stdout,
3327
- stderr
3348
+ output: `${stdout}\n${stderr}`
3328
3349
  };
3329
3350
  }
3330
- function queryPublishedVersion(candidate, options) {
3331
- const result = (options.spawn ?? spawnSync)("npm", [
3332
- "view",
3333
- `${candidate.name}@${candidate.version}`,
3334
- "version"
3335
- ], {
3336
- cwd: options.cwd,
3337
- encoding: "utf8",
3338
- env: getReleaseEnv(options),
3339
- shell: false,
3340
- stdio: [
3341
- "ignore",
3342
- "pipe",
3343
- "pipe"
3344
- ]
3345
- });
3346
- return result.status === 0 && outputText(result.stdout).trim() === candidate.version;
3347
- }
3348
- function readPublishedCandidates(candidates, options) {
3349
- return candidates.filter((candidate) => queryPublishedVersion(candidate, options));
3351
+ //#endregion
3352
+ //#region src/commands/release/publish/state.ts
3353
+ function packageKey(pkg) {
3354
+ return `${pkg.name}@${pkg.version}`;
3350
3355
  }
3351
- function addPackageFilters(args, candidates) {
3352
- return [...args, ...candidates.flatMap((candidate) => ["--filter", candidate.name])];
3356
+ async function writeJsonAtomic(filename, value) {
3357
+ const temporary = `${filename}.${randomUUID()}.tmp`;
3358
+ try {
3359
+ await writeFile(temporary, `${JSON.stringify(value, null, 2)}\n`, "utf8");
3360
+ await rename(temporary, filename);
3361
+ } finally {
3362
+ await rm(temporary, { force: true });
3363
+ }
3364
+ }
3365
+ /** Evidence is monotonic for this invocation; old on-disk reports are never trusted. */
3366
+ var PublishState = class {
3367
+ candidates;
3368
+ accepted = /* @__PURE__ */ new Map();
3369
+ confirmed = /* @__PURE__ */ new Set();
3370
+ allowed;
3371
+ constructor(candidates) {
3372
+ this.candidates = candidates;
3373
+ this.allowed = new Set(candidates.map(packageKey));
3374
+ }
3375
+ accept(packages) {
3376
+ for (const pkg of packages) if (this.allowed.has(packageKey(pkg))) this.accepted.set(packageKey(pkg), pkg);
3377
+ }
3378
+ confirm(pkg) {
3379
+ this.accept([pkg]);
3380
+ if (this.allowed.has(packageKey(pkg))) this.confirmed.add(packageKey(pkg));
3381
+ }
3382
+ get acceptedPackages() {
3383
+ return [...this.accepted.values()];
3384
+ }
3385
+ get pendingUploads() {
3386
+ return this.candidates.filter((pkg) => !this.accepted.has(packageKey(pkg)));
3387
+ }
3388
+ unconfirmed(packages = this.acceptedPackages) {
3389
+ return packages.filter((pkg) => !this.confirmed.has(packageKey(pkg)));
3390
+ }
3391
+ async save(cwd, status) {
3392
+ const acceptedPackages = this.acceptedPackages;
3393
+ await writeJsonAtomic(path.join(cwd, "repoctl-publish-progress.json"), {
3394
+ schemaVersion: 1,
3395
+ status,
3396
+ candidates: this.candidates,
3397
+ acceptedPackages,
3398
+ confirmedPackages: acceptedPackages.filter((pkg) => this.confirmed.has(packageKey(pkg)))
3399
+ });
3400
+ await writeJsonAtomic(path.join(cwd, "pnpm-publish-summary.json"), { publishedPackages: acceptedPackages });
3401
+ }
3402
+ };
3403
+ //#endregion
3404
+ //#region src/commands/release/publish/registry.ts
3405
+ const visibilityBudget = 3e5;
3406
+ const pollInterval = 1e4;
3407
+ function sleep(milliseconds, options) {
3408
+ return options.sleep?.(milliseconds) ?? new Promise((resolve) => setTimeout(resolve, milliseconds));
3353
3409
  }
3354
- function mergePackages(...groups) {
3355
- const packages = /* @__PURE__ */ new Map();
3356
- for (const group of groups) for (const pkg of group) packages.set(`${pkg.name}@${pkg.version}`, pkg);
3357
- return [...packages.values()];
3410
+ async function refreshRegistry(state, options, packages = state.candidates, deadline = performance.now() + visibilityBudget) {
3411
+ for (const pkg of state.unconfirmed(packages)) {
3412
+ const remaining = Math.floor(deadline - performance.now());
3413
+ if (remaining <= 0) break;
3414
+ const result = (options.spawn ?? spawnSync)("npm", [
3415
+ "view",
3416
+ packageKey(pkg),
3417
+ "version"
3418
+ ], {
3419
+ cwd: options.cwd,
3420
+ encoding: "utf8",
3421
+ env: getReleaseEnv(options),
3422
+ shell: false,
3423
+ stdio: [
3424
+ "ignore",
3425
+ "pipe",
3426
+ "pipe"
3427
+ ],
3428
+ timeout: Math.min(1e4, remaining),
3429
+ killSignal: "SIGKILL"
3430
+ });
3431
+ if (result.status === 0 && outputText(result.stdout).trim() === pkg.version) {
3432
+ state.confirm(pkg);
3433
+ await state.save(options.cwd, "confirming");
3434
+ }
3435
+ }
3358
3436
  }
3359
- async function preservePublishSummary(cwd, previous) {
3360
- if (!previous.length) return;
3361
- const merged = mergePackages(previous, await readPublishSummary(cwd));
3362
- await writeFile(path.join(cwd, "pnpm-publish-summary.json"), `${JSON.stringify({ publishedPackages: merged }, null, 2)}\n`, "utf8");
3437
+ async function confirmVisibility(state, options, packages, initialDelay = 0) {
3438
+ let remaining = visibilityBudget;
3439
+ let delay = initialDelay;
3440
+ while (state.unconfirmed(packages).length && remaining > 0) {
3441
+ const started = performance.now();
3442
+ const wait = Math.min(delay, remaining);
3443
+ if (wait) await sleep(wait, options);
3444
+ remaining -= Math.max(wait, performance.now() - started);
3445
+ const queryStarted = performance.now();
3446
+ await refreshRegistry(state, options, packages, queryStarted + remaining);
3447
+ await state.save(options.cwd, "confirming");
3448
+ remaining -= performance.now() - queryStarted;
3449
+ delay = pollInterval;
3450
+ }
3451
+ const pending = state.unconfirmed(packages);
3452
+ if (pending.length) throw new ReleaseCommandError(`npm registry visibility confirmation timed out after 5 minutes; pending versions: ${pending.map(packageKey).join(", ")}`);
3453
+ if (packages.length) logger.info("npm registry visibility confirmed for all requested versions.");
3363
3454
  }
3455
+ //#endregion
3456
+ //#region src/commands/release/publish/index.ts
3457
+ const publishAttempts = 3;
3458
+ const retryDelays = [2e4, 4e4];
3364
3459
  async function getPublishCandidates(cwd) {
3460
+ clearWorkspaceCache();
3365
3461
  const candidates = (await getWorkspacePackages(cwd)).flatMap(({ manifest }) => typeof manifest.name === "string" && typeof manifest.version === "string" ? [{
3366
3462
  name: manifest.name,
3367
3463
  version: manifest.version
@@ -3369,38 +3465,51 @@ async function getPublishCandidates(cwd) {
3369
3465
  if (!candidates.length) throw new ReleaseCommandError("no versioned publishable workspace packages were found");
3370
3466
  return candidates;
3371
3467
  }
3372
- /**
3373
- * 发布 workspace 包,并在 provenance 服务出现瞬时错误时按包重试。
3374
- *
3375
- * 首次尝试仍交给 pnpm 处理 workspace 发布顺序;只有失败后才查询已上传的
3376
- * 版本,并为剩余包追加筛选条件,避免重复发布已成功上传的包。
3377
- */
3378
- async function publishWithRetry(args, options, candidates) {
3468
+ /** Only pnpm uploads; accepted versions never re-enter its retry filters. */
3469
+ async function publishWithRetry(args, options, candidates, confirmAll = false) {
3470
+ const state = new PublishState(candidates);
3379
3471
  let attemptArgs = args;
3380
- let publishedBeforeRetry = await readPublishSummary(options.cwd);
3381
- for (let attempt = 1; attempt <= publishAttempts; attempt += 1) {
3382
- const result = runPublishAttempt(attemptArgs, options);
3383
- const currentSummary = await readPublishSummary(options.cwd);
3384
- publishedBeforeRetry = mergePackages(publishedBeforeRetry, currentSummary);
3385
- if (result.status === 0) {
3386
- await preservePublishSummary(options.cwd, publishedBeforeRetry);
3387
- return;
3388
- }
3389
- const output = commandOutput(result);
3390
- const published = readPublishedCandidates(candidates, options);
3391
- publishedBeforeRetry = mergePackages(publishedBeforeRetry, published);
3392
- const unpublished = candidates.filter((candidate) => !published.some((pkg) => pkg.name === candidate.name && pkg.version === candidate.version));
3393
- if (!unpublished.length) {
3394
- await preservePublishSummary(options.cwd, publishedBeforeRetry);
3395
- logger.warn("npm publish returned an error, but all requested package versions are present in the registry; continuing.");
3396
- return;
3472
+ let recovering = confirmAll;
3473
+ try {
3474
+ await state.save(options.cwd, "publishing");
3475
+ for (let attempt = 1; attempt <= publishAttempts; attempt += 1) {
3476
+ const result = runPublishAttempt(attemptArgs, options);
3477
+ state.accept(acceptedFromOutput(result.output, candidates));
3478
+ state.accept(await readPublishSummary(options.cwd));
3479
+ await state.save(options.cwd, "publishing");
3480
+ if (result.status === 0) {
3481
+ await confirmVisibility(state, options, recovering ? candidates : state.acceptedPackages);
3482
+ await state.save(options.cwd, "complete");
3483
+ return;
3484
+ }
3485
+ recovering = true;
3486
+ await refreshRegistry(state, options);
3487
+ await state.save(options.cwd, "publishing");
3488
+ const transient = isTransientPublishFailure(result.output);
3489
+ const conflict = isPublishConflict(result.output);
3490
+ if (!transient && !conflict) throw new ReleaseCommandError(`command failed: pnpm ${args.join(" ")}`, result.status ?? 1);
3491
+ if (!state.pendingUploads.length || conflict && !transient) {
3492
+ await confirmVisibility(state, options, candidates, state.unconfirmed(candidates).length ? 2e4 : 0);
3493
+ await state.save(options.cwd, "complete");
3494
+ return;
3495
+ }
3496
+ if (attempt === publishAttempts) throw new ReleaseCommandError(`command failed after ${publishAttempts} publish attempts: pnpm ${args.join(" ")}`, result.status ?? 1);
3497
+ const delay = retryDelays[attempt - 1];
3498
+ logger.warn(`npm publish transient failure; reconciling before retry in ${delay / 1e3}s (attempt ${attempt + 1}/${publishAttempts}).`);
3499
+ await sleep(delay, options);
3500
+ await refreshRegistry(state, options);
3501
+ await state.save(options.cwd, "publishing");
3502
+ if (!state.pendingUploads.length) {
3503
+ await confirmVisibility(state, options, candidates);
3504
+ await state.save(options.cwd, "complete");
3505
+ return;
3506
+ }
3507
+ attemptArgs = [...args, ...state.pendingUploads.flatMap((pkg) => ["--filter", pkg.name])];
3397
3508
  }
3398
- if (!isTransientPublishFailure(output) && !isPublishConflict(output)) throw new ReleaseCommandError(`command failed: pnpm ${args.join(" ")}`, result.status ?? 1);
3399
- if (attempt === publishAttempts) throw new ReleaseCommandError(`command failed after ${publishAttempts} publish attempts: pnpm ${args.join(" ")}`, result.status ?? 1);
3400
- const delay = retryDelays[attempt - 1] ?? retryDelays[retryDelays.length - 1] ?? 0;
3401
- logger.warn(`npm publish transient failure; retrying ${unpublished.length} package(s) in ${delay / 1e3}s (attempt ${attempt + 1}/${publishAttempts}).`);
3402
- await sleep(delay, options);
3403
- attemptArgs = addPackageFilters(args, unpublished);
3509
+ } catch (error) {
3510
+ await state.save(options.cwd, "failed");
3511
+ logger.error(`npm publish progress saved to repoctl-publish-progress.json; accepted but unconfirmed: ${state.unconfirmed().map(packageKey).join(", ") || "(none)"}; still requiring upload: ${state.pendingUploads.map(packageKey).join(", ") || "(none)"}`);
3512
+ throw error;
3404
3513
  }
3405
3514
  }
3406
3515
  //#endregion
@@ -3886,12 +3995,7 @@ async function recoverUnpublished(options) {
3886
3995
  ], options, [{
3887
3996
  name: packageName,
3888
3997
  version: packageVersion
3889
- }]);
3890
- if (capture("npm", [
3891
- "view",
3892
- `${packageName}@${packageVersion}`,
3893
- "version"
3894
- ], options) !== packageVersion) throw new ReleaseCommandError(`npm did not report ${packageName}@${packageVersion} after recovery`);
3998
+ }], true);
3895
3999
  const packages = await readPublishSummary(options.cwd);
3896
4000
  await publishMetadata(packages, options);
3897
4001
  runAfterPublishHooks(packages, options);
@@ -4615,10 +4719,10 @@ async function upgradeMonorepo(opts) {
4615
4719
  };
4616
4720
  const pendingOverwrites = [];
4617
4721
  for await (const file of klaw(assetsDir, { filter(p) {
4618
- return isMatch(toWorkspaceGitignorePath(path.relative(assetsDir, p)), regexpArr);
4722
+ return isMatch(toWorkspaceAssetPath(path.relative(assetsDir, p)), regexpArr);
4619
4723
  } })) {
4620
4724
  if (!file.stats.isFile()) continue;
4621
- const relPath = toWorkspaceGitignorePath(path.relative(assetsDir, file.path));
4725
+ const relPath = toWorkspaceAssetPath(path.relative(assetsDir, file.path));
4622
4726
  if (skipChangesetMarkdown && relPath.startsWith(".changeset/") && relPath.endsWith(".md")) continue;
4623
4727
  const targetPath = path.resolve(absOutDir, relPath);
4624
4728
  if (relPath === ".github/workflows/release.yml" && await fs$1.pathExists(targetPath)) {
@@ -4829,4 +4933,4 @@ var commands_exports = /* @__PURE__ */ __exportAll({
4829
4933
  verifyStagedTypecheck: () => verifyStagedTypecheck
4830
4934
  });
4831
4935
  //#endregion
4832
- export { verifyCommitMsg as $, defaultTemplate as A, escapeStringRegexp as B, createContext as C, collectEnvSupportBundle as D, collectEnvSnapshot as E, inspectMonorepoConfig as F, isGitignoreFile as G, setByPath as H, cleanProjects as I, updateIssueTemplateConfig as J, toPublishGitignorePath as K, getSkillTargetPaths as L, getTemplateMap as M, resolveCreateNewProjectPlan as N, runDoctor as O, templateMap as P, runRecommendedCheck as Q, skillTargets as R, normalizeInitToolingTargets as S, collectEnvPaths as T, getFileHash as U, isMatch as V, isFileChanged as W, resolveFullWorkspaceCheckPlan as X, getKnownRepoCheckCommands as Y, resolveRecommendedCheckPlan as Z, parsePublishSummary as _, createReleasePullRequest as a, generateAgenticTemplate as at, initMetadata as b, prepareStable as c, GitClient as ct, reconcileRelease as d, verifyPreCommit as et, enterPrerelease as f, GitHubClient as g, GitHubApiError as h, repairReleaseNotes as i, defaultAgenticBaseDir as it, getCreateChoices as j, createNewProject as k, publishStable as l, releasePrerelease as m, upgradeMonorepo as n, verifyStagedTypecheck as nt, recoverUnpublished as o, generateAgenticTemplates as ot, exitPrerelease as p, toWorkspaceGitignorePath as q, checkTemplates as r, createTimestampFolderName as rt, releaseCi as s, loadAgenticTasks as st, commands_exports as t, verifyPrePush as tt, releaseStable as u, setVscodeBinaryMirror as v, collectEnvInfo as w, initTooling as x, init as y, syncSkills as z };
4936
+ export { runRecommendedCheck as $, defaultTemplate as A, escapeStringRegexp as B, createContext as C, collectEnvSupportBundle as D, collectEnvSnapshot as E, inspectMonorepoConfig as F, isGitignoreFile as G, setByPath as H, cleanProjects as I, toWorkspaceGitignorePath as J, toPublishGitignorePath as K, getSkillTargetPaths as L, getTemplateMap as M, resolveCreateNewProjectPlan as N, runDoctor as O, templateMap as P, resolveRecommendedCheckPlan as Q, skillTargets as R, normalizeInitToolingTargets as S, collectEnvPaths as T, getFileHash as U, isMatch as V, isFileChanged as W, getKnownRepoCheckCommands as X, updateIssueTemplateConfig as Y, resolveFullWorkspaceCheckPlan as Z, parsePublishSummary as _, createReleasePullRequest as a, defaultAgenticBaseDir as at, initMetadata as b, prepareStable as c, loadAgenticTasks as ct, reconcileRelease as d, verifyCommitMsg as et, enterPrerelease as f, GitHubClient as g, GitHubApiError as h, repairReleaseNotes as i, createTimestampFolderName as it, getCreateChoices as j, createNewProject as k, publishStable as l, GitClient as lt, releasePrerelease as m, upgradeMonorepo as n, verifyPrePush as nt, recoverUnpublished as o, generateAgenticTemplate as ot, exitPrerelease as p, toWorkspaceAssetPath as q, checkTemplates as r, verifyStagedTypecheck as rt, releaseCi as s, generateAgenticTemplates as st, commands_exports as t, verifyPreCommit as tt, releaseStable as u, setVscodeBinaryMirror as v, collectEnvInfo as w, initTooling as x, init as y, syncSkills as z };
@@ -1,5 +1,5 @@
1
- import { A as defaultTemplate, N as resolveCreateNewProjectPlan, j as getCreateChoices, k as createNewProject } from "./commands-D8kCvxPl.mjs";
2
- import { m as logger, u as localize, y as fs } from "./types-g0R589p_.mjs";
1
+ import { A as defaultTemplate, N as resolveCreateNewProjectPlan, j as getCreateChoices, k as createNewProject } from "./commands-CCp7Q5I1.mjs";
2
+ import { m as logger, u as localize, y as fs } from "./types-DpfpqJWb.mjs";
3
3
  import { s as resolveCommandConfig } from "./config-p842Knhq.mjs";
4
4
  import path from "pathe";
5
5
  import process from "node:process";
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { $ as init, A as loadMonorepoToolingConfig, B as HuskyToolingConfig, C a
2
2
  import gitUrlParse from "git-url-parse";
3
3
  import { mkdtemp, readFile, readdir, stat, writeFile } from "node:fs/promises";
4
4
  import { execFileSync, spawnSync } from "node:child_process";
5
- import { isGitignoreFile, toPublishGitignorePath, toWorkspaceGitignorePath } from "@icebreakers/monorepo-templates";
5
+ import { isGitignoreFile, toPublishGitignorePath, toWorkspaceAssetPath, toWorkspaceGitignorePath } from "@icebreakers/monorepo-templates";
6
6
  import { Buffer } from "node:buffer";
7
7
  import crypto from "node:crypto";
8
8
  //#region src/i18n/types.d.ts
@@ -907,4 +907,4 @@ export declare function escapeStringRegexp(str: string): string;
907
907
  */
908
908
  export declare function isMatch(str: string, arr: RegExp[]): boolean;
909
909
  //#endregion
910
- export { type AgenticTemplateFormat, type AgenticTemplateTask, AiCommandConfig, type CheckTemplatesOptions, CleanCommandConfig, CliOpts, type CommitMsgVerifyOptions, CommitlintToolingConfig, type ConfigInspection, type ConfigValues, CreateChoiceOption, CreateCommandConfig, type CreateNewProjectOptions, type CreateNewProjectPlan, DefineConfigOptions, DefineEslintConfigOptions, DefineVitestConfigOptions, DefineVitestProjectConfigOptions, type DoctorCheck, type DoctorReport, type DoctorStatus, type DoctorSummary, type EnsurePullRequestOptions, type EnsureReleaseOptions, type EnsureTagOptions, type EnvInfo, type EnvPathEntry, type EnvPaths, type EnvSnapshot, type EnvSupportBundle, EslintToolingConfig, type GenerateAgenticTemplateOptions, type GitHubClientOptions, type GitHubOperations, HuskyToolingConfig, InitCommandConfig, LintStagedToolingConfig, MirrorCommandConfig, MonorepoCommitlintConfig, MonorepoConfig, MonorepoEslintConfig, MonorepoLintStagedConfig, MonorepoLintStagedConfigOptions, MonorepoStylelintConfig, MonorepoTsconfig, MonorepoVitestConfigOptions, MonorepoVitestConfigOverrides, MonorepoVitestConfigResult, MonorepoVitestProjectConfigOptions, MonorepoVitestProjectConfigResult, type PreCommitVerifyOptions, type PrePushVerifyOptions, type RecommendedCheckMode, type RecommendedCheckOptions, type RecommendedCheckPlan, type RecommendedCheckPlanCommand, ReleaseAfterPublishHookConfig, ReleaseCommandConfig, type RepoctlLocale, type SimpleGit, type SimpleGitOptions, type SkillTarget, type StagedTypecheckOptions, StylelintToolingConfig, type SyncSkillsOptions, type TemplateHealthCheck, type TemplateHealthReport, type TemplateHealthStatus, type TemplateHealthSummary, ToolingConfig, TsconfigToolingConfig, UpgradeCommandConfig, type VerifyCommandOptions, VitestProjectToolingConfig, VitestToolingConfig, createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, createNewProject, createReleasePullRequest, createTimestampFolderName, defaultAgenticBaseDir, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getTemplateMap, init, initMetadata, initTooling, initToolingTargets, isGitignoreFile, loadAgenticTasks, loadMonorepoToolingConfig, normalizeInitToolingTargets, name as packageName, recoverUnpublished, resolveCreateNewProjectPlan, templateMap, toPublishGitignorePath, toWorkspaceGitignorePath };
910
+ export { type AgenticTemplateFormat, type AgenticTemplateTask, AiCommandConfig, type CheckTemplatesOptions, CleanCommandConfig, CliOpts, type CommitMsgVerifyOptions, CommitlintToolingConfig, type ConfigInspection, type ConfigValues, CreateChoiceOption, CreateCommandConfig, type CreateNewProjectOptions, type CreateNewProjectPlan, DefineConfigOptions, DefineEslintConfigOptions, DefineVitestConfigOptions, DefineVitestProjectConfigOptions, type DoctorCheck, type DoctorReport, type DoctorStatus, type DoctorSummary, type EnsurePullRequestOptions, type EnsureReleaseOptions, type EnsureTagOptions, type EnvInfo, type EnvPathEntry, type EnvPaths, type EnvSnapshot, type EnvSupportBundle, EslintToolingConfig, type GenerateAgenticTemplateOptions, type GitHubClientOptions, type GitHubOperations, HuskyToolingConfig, InitCommandConfig, LintStagedToolingConfig, MirrorCommandConfig, MonorepoCommitlintConfig, MonorepoConfig, MonorepoEslintConfig, MonorepoLintStagedConfig, MonorepoLintStagedConfigOptions, MonorepoStylelintConfig, MonorepoTsconfig, MonorepoVitestConfigOptions, MonorepoVitestConfigOverrides, MonorepoVitestConfigResult, MonorepoVitestProjectConfigOptions, MonorepoVitestProjectConfigResult, type PreCommitVerifyOptions, type PrePushVerifyOptions, type RecommendedCheckMode, type RecommendedCheckOptions, type RecommendedCheckPlan, type RecommendedCheckPlanCommand, ReleaseAfterPublishHookConfig, ReleaseCommandConfig, type RepoctlLocale, type SimpleGit, type SimpleGitOptions, type SkillTarget, type StagedTypecheckOptions, StylelintToolingConfig, type SyncSkillsOptions, type TemplateHealthCheck, type TemplateHealthReport, type TemplateHealthStatus, type TemplateHealthSummary, ToolingConfig, TsconfigToolingConfig, UpgradeCommandConfig, type VerifyCommandOptions, VitestProjectToolingConfig, VitestToolingConfig, createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, createNewProject, createReleasePullRequest, createTimestampFolderName, defaultAgenticBaseDir, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getTemplateMap, init, initMetadata, initTooling, initToolingTargets, isGitignoreFile, loadAgenticTasks, loadMonorepoToolingConfig, normalizeInitToolingTargets, name as packageName, recoverUnpublished, resolveCreateNewProjectPlan, templateMap, toPublishGitignorePath, toWorkspaceAssetPath, toWorkspaceGitignorePath };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { $ as verifyCommitMsg, B as escapeStringRegexp, C as createContext, D as collectEnvSupportBundle, E as collectEnvSnapshot, F as inspectMonorepoConfig, G as isGitignoreFile, H as setByPath, I as cleanProjects, J as updateIssueTemplateConfig, K as toPublishGitignorePath, L as getSkillTargetPaths, M as getTemplateMap, N as resolveCreateNewProjectPlan, O as runDoctor, P as templateMap, Q as runRecommendedCheck, R as skillTargets, S as normalizeInitToolingTargets, T as collectEnvPaths, U as getFileHash, V as isMatch, W as isFileChanged, X as resolveFullWorkspaceCheckPlan, Y as getKnownRepoCheckCommands, Z as resolveRecommendedCheckPlan, _ as parsePublishSummary, a as createReleasePullRequest, at as generateAgenticTemplate, b as initMetadata, c as prepareStable, ct as GitClient, d as reconcileRelease, et as verifyPreCommit, f as enterPrerelease, g as GitHubClient, h as GitHubApiError, i as repairReleaseNotes, it as defaultAgenticBaseDir, j as getCreateChoices, k as createNewProject, l as publishStable, m as releasePrerelease, n as upgradeMonorepo, nt as verifyStagedTypecheck, o as recoverUnpublished, ot as generateAgenticTemplates, p as exitPrerelease, q as toWorkspaceGitignorePath, r as checkTemplates, rt as createTimestampFolderName, s as releaseCi, st as loadAgenticTasks, tt as verifyPrePush, u as releaseStable, v as setVscodeBinaryMirror, w as collectEnvInfo, x as initTooling, y as init, z as syncSkills } from "./commands-D8kCvxPl.mjs";
1
+ import { $ as runRecommendedCheck, B as escapeStringRegexp, C as createContext, D as collectEnvSupportBundle, E as collectEnvSnapshot, F as inspectMonorepoConfig, G as isGitignoreFile, H as setByPath, I as cleanProjects, J as toWorkspaceGitignorePath, K as toPublishGitignorePath, L as getSkillTargetPaths, M as getTemplateMap, N as resolveCreateNewProjectPlan, O as runDoctor, P as templateMap, Q as resolveRecommendedCheckPlan, R as skillTargets, S as normalizeInitToolingTargets, T as collectEnvPaths, U as getFileHash, V as isMatch, W as isFileChanged, X as getKnownRepoCheckCommands, Y as updateIssueTemplateConfig, Z as resolveFullWorkspaceCheckPlan, _ as parsePublishSummary, a as createReleasePullRequest, at as defaultAgenticBaseDir, b as initMetadata, c as prepareStable, ct as loadAgenticTasks, d as reconcileRelease, et as verifyCommitMsg, f as enterPrerelease, g as GitHubClient, h as GitHubApiError, i as repairReleaseNotes, it as createTimestampFolderName, j as getCreateChoices, k as createNewProject, l as publishStable, lt as GitClient, m as releasePrerelease, n as upgradeMonorepo, nt as verifyPrePush, o as recoverUnpublished, ot as generateAgenticTemplate, p as exitPrerelease, q as toWorkspaceAssetPath, r as checkTemplates, rt as verifyStagedTypecheck, s as releaseCi, st as generateAgenticTemplates, tt as verifyPreCommit, u as releaseStable, v as setVscodeBinaryMirror, w as collectEnvInfo, x as initTooling, y as init, z as syncSkills } from "./commands-CCp7Q5I1.mjs";
2
2
  import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries, t as clearWorkspaceCache } from "./workspace-MCKewElu.mjs";
3
- import { C as outputJson, D as remove, E as readJson, O as writeJSON, S as outputJSON, T as readJSON, _ as ensureFile, a as rootDir, b as isIgnorableFsError, g as ensureDir, h as copy, i as packageDir, k as writeJson, l as version, m as logger, n as assetsDir, o as templatesDir, r as cliName, s as name, t as initToolingTargets, v as exists, w as pathExists, x as outputFile } from "./types-g0R589p_.mjs";
3
+ import { C as outputJson, D as remove, E as readJson, O as writeJSON, S as outputJSON, T as readJSON, _ as ensureFile, a as rootDir, b as isIgnorableFsError, g as ensureDir, h as copy, i as packageDir, k as writeJson, l as version, m as logger, n as assetsDir, o as templatesDir, r as cliName, s as name, t as initToolingTargets, v as exists, w as pathExists, x as outputFile } from "./types-DpfpqJWb.mjs";
4
4
  import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getRepoctlConfigCandidates, o as loadMonorepoConfigDetails, r as defineMonorepoConfig, s as resolveCommandConfig, t as configExtensions } from "./config-p842Knhq.mjs";
5
5
  import { a as createMonorepoTsconfig, c as defineCommitlintConfig, d as defineStylelintConfig, f as defineTsconfigConfig, h as loadMonorepoToolingConfig, i as createMonorepoStylelintConfig, l as defineEslintConfig, m as defineVitestProjectConfig, n as createMonorepoEslintConfig, o as createMonorepoVitestConfig, p as defineVitestConfig, r as createMonorepoLintStagedConfig, s as createMonorepoVitestProjectConfig, t as createMonorepoCommitlintConfig, u as defineLintStagedConfig } from "./tooling-BfXlmCi-.mjs";
6
- export { GitClient, GitHubApiError, GitHubClient, assetsDir, checkTemplates, cleanProjects, clearWorkspaceCache, cliName, collectEnvInfo, collectEnvPaths, collectEnvSnapshot, collectEnvSupportBundle, configExtensions, copy, createContext, createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, createNewProject, createReleasePullRequest, createTimestampFolderName, defaultAgenticBaseDir, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineMonorepoConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, ensureDir, ensureFile, enterPrerelease, escapeStringRegexp, exists, exitPrerelease, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getKnownRepoCheckCommands, getRepoctlConfigCandidates, getSkillTargetPaths, getTemplateMap, getWorkspaceData, getWorkspacePackageSummaries, getWorkspacePackages, init, initMetadata, initTooling, initToolingTargets, inspectMonorepoConfig, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, loadMonorepoConfigDetails, loadMonorepoToolingConfig, logger, normalizeInitToolingTargets, outputFile, outputJSON, outputJson, packageDir, name as packageName, parsePublishSummary, pathExists, prepareStable, publishStable, readJSON, readJson, reconcileRelease, recoverUnpublished, releaseCi, releasePrerelease, releaseStable, remove, repairReleaseNotes, resolveCommandConfig, resolveCreateNewProjectPlan, resolveFullWorkspaceCheckPlan, resolveRecommendedCheckPlan, resolveToolingConfig, rootDir, runDoctor, runRecommendedCheck, setByPath, setVscodeBinaryMirror, skillTargets, syncSkills, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceGitignorePath, updateIssueTemplateConfig, upgradeMonorepo, verifyCommitMsg, verifyPreCommit, verifyPrePush, verifyStagedTypecheck, version, writeJSON, writeJson };
6
+ export { GitClient, GitHubApiError, GitHubClient, assetsDir, checkTemplates, cleanProjects, clearWorkspaceCache, cliName, collectEnvInfo, collectEnvPaths, collectEnvSnapshot, collectEnvSupportBundle, configExtensions, copy, createContext, createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, createNewProject, createReleasePullRequest, createTimestampFolderName, defaultAgenticBaseDir, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineMonorepoConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, ensureDir, ensureFile, enterPrerelease, escapeStringRegexp, exists, exitPrerelease, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getKnownRepoCheckCommands, getRepoctlConfigCandidates, getSkillTargetPaths, getTemplateMap, getWorkspaceData, getWorkspacePackageSummaries, getWorkspacePackages, init, initMetadata, initTooling, initToolingTargets, inspectMonorepoConfig, isFileChanged, isGitignoreFile, isIgnorableFsError, isMatch, loadAgenticTasks, loadMonorepoConfig, loadMonorepoConfigDetails, loadMonorepoToolingConfig, logger, normalizeInitToolingTargets, outputFile, outputJSON, outputJson, packageDir, name as packageName, parsePublishSummary, pathExists, prepareStable, publishStable, readJSON, readJson, reconcileRelease, recoverUnpublished, releaseCi, releasePrerelease, releaseStable, remove, repairReleaseNotes, resolveCommandConfig, resolveCreateNewProjectPlan, resolveFullWorkspaceCheckPlan, resolveRecommendedCheckPlan, resolveToolingConfig, rootDir, runDoctor, runRecommendedCheck, setByPath, setVscodeBinaryMirror, skillTargets, syncSkills, templateMap, templatesDir, toPublishGitignorePath, toWorkspaceAssetPath, toWorkspaceGitignorePath, updateIssueTemplateConfig, upgradeMonorepo, verifyCommitMsg, verifyPreCommit, verifyPrePush, verifyStagedTypecheck, version, writeJSON, writeJson };
@@ -343,7 +343,7 @@ function message(key, values = {}) {
343
343
  //#endregion
344
344
  //#region package.json
345
345
  var name = "@icebreakers/monorepo";
346
- var version = "5.5.5";
346
+ var version = "5.5.7";
347
347
  var package_default = {
348
348
  name,
349
349
  type: "module",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo",
3
3
  "type": "module",
4
- "version": "5.5.5",
4
+ "version": "5.5.7",
5
5
  "description": "Core engine and programmatic APIs for repoctl",
6
6
  "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
@@ -77,8 +77,8 @@
77
77
  },
78
78
  "dependencies": {
79
79
  "@icebreakers/commitlint-config": "4.1.1",
80
- "@icebreakers/eslint-config": "8.0.2",
81
- "@icebreakers/monorepo-templates": "2.0.2",
80
+ "@icebreakers/eslint-config": "8.0.3",
81
+ "@icebreakers/monorepo-templates": "2.0.4",
82
82
  "@icebreakers/stylelint-config": "5.1.2",
83
83
  "@pnpm/find-workspace-dir": "^1000.1.5",
84
84
  "@pnpm/logger": "^1100.0.0",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: repoctl
3
- description: Create and maintain pnpm/Turborepo workspaces with repoctl. Use when the user says 使用 repoctl 创建项目, create a monorepo, pnpm create repoctl, scaffold Vue/Hono/tsdown/vitepress, or run repo init/doctor/new/check.
3
+ description: Create and maintain pnpm/Turborepo workspaces with repoctl. Use when the user says 使用 repoctl 创建项目, create a monorepo, pnpm create repoctl@latest, scaffold Vue/Hono/tsdown/vitepress, or run repo init/doctor/new/check.
4
4
  ---
5
5
 
6
6
  # repoctl
@@ -9,17 +9,22 @@ The package name is `repoctl`. The command is `repo`.
9
9
 
10
10
  ## Empty directory
11
11
 
12
- Do not prompt. Map the request to template keys, then:
12
+ Create into a new or empty directory outside the repoctl source workspace. Do
13
+ not add a business project under the source checkout, and do not point the
14
+ create command at a non-empty directory unless the user explicitly asks to
15
+ replace it with `--force`. Do not prompt. Map the request to template keys,
16
+ then:
13
17
 
14
18
  ```bash
15
- pnpm create repoctl <dir> -- --yes --templates <keys>
19
+ pnpm create repoctl@latest <dir> -- --yes --templates <keys>
16
20
  cd <dir>
21
+ corepack enable
17
22
  pnpm install
18
23
  pnpm exec repo init
19
24
  pnpm exec repo doctor
20
25
  ```
21
26
 
22
- `npm create` and `pnpm create` need the extra `--` before flags. `npx create-repoctl <dir> --yes --templates <keys>` does not.
27
+ `npm create` and `pnpm create` need the extra `--` before flags. `npx create-repoctl@latest <dir> --yes --templates <keys>` does not.
23
28
 
24
29
  | User intent | `--templates` key |
25
30
  | ------------------------ | ------------------ |
@@ -193,7 +193,8 @@ Usage:
193
193
 
194
194
  ## skills sync
195
195
 
196
- Purpose: sync the `repoctl` skill into global agent skill directories.
196
+ Purpose: sync the `repoctl` skill into global agent skill directories. Use
197
+ `--all` when all supported agents should receive the same skill version.
197
198
  Usage:
198
199
 
199
200
  - pnpm exec repo skills sync