@icebreakers/monorepo 5.4.9 → 5.5.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/dist/cli.mjs +44 -35
- package/dist/{commands-ChVgQ-MD.mjs → commands-ByI13wrh.mjs} +143 -147
- package/dist/{create-flow-BiiHvQTm.mjs → create-flow-9c4YQqzw.mjs} +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{types-C-aVvG6i.mjs → types-BOsjWpX0.mjs} +116 -33
- package/package.json +14 -7
- package/resources/skills/repoctl/SKILL.md +63 -0
- package/resources/skills/{icebreakers-monorepo-cli → repoctl}/references/commands.md +10 -7
- package/resources/skills/{icebreakers-monorepo-cli → repoctl}/references/templates.md +2 -2
- package/resources/skills/icebreakers-monorepo-cli/SKILL.md +0 -45
- /package/resources/skills/{icebreakers-monorepo-cli → repoctl}/references/config.md +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-BOsjWpX0.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-
|
|
13
|
+
import("./commands-ByI13wrh.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-
|
|
128
|
+
const { inspectMonorepoConfig } = await import("./commands-ByI13wrh.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-
|
|
448
|
+
const { collectEnvInfo } = await import("./commands-ByI13wrh.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-
|
|
452
|
+
const { collectEnvSnapshot } = await import("./commands-ByI13wrh.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-
|
|
456
|
+
const { collectEnvPaths } = await import("./commands-ByI13wrh.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-
|
|
460
|
+
const { collectEnvSupportBundle } = await import("./commands-ByI13wrh.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-
|
|
464
|
+
const { setVscodeBinaryMirror } = await import("./commands-ByI13wrh.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-
|
|
473
|
+
const { runCreateFlow } = await import("./create-flow-9c4YQqzw.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", "auto / prepare / publish / publish-unpublished"), "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 使用的版本")).action(async (opts) => {
|
|
504
504
|
await runReleaseAction(async () => {
|
|
505
|
-
const { releaseCi } = await import("./commands-
|
|
505
|
+
const { releaseCi } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
506
506
|
await releaseCi({
|
|
507
507
|
...await resolveReleaseOptions(cwd),
|
|
508
508
|
...opts.mode ? { mode: opts.mode } : {},
|
|
@@ -514,7 +514,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
514
514
|
});
|
|
515
515
|
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")).action(async (opts) => {
|
|
516
516
|
await runReleaseAction(async () => {
|
|
517
|
-
const { repairReleaseNotes } = await import("./commands-
|
|
517
|
+
const { repairReleaseNotes } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
518
518
|
const result = await repairReleaseNotes({
|
|
519
519
|
cwd,
|
|
520
520
|
...opts.all ? { all: true } : {},
|
|
@@ -526,7 +526,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
526
526
|
});
|
|
527
527
|
const stableCommand = releaseCommand.command("stable").description(localize("Run a stable release from main", "在 main 分支执行正式发布")).action(async () => {
|
|
528
528
|
await runReleaseAction(async () => {
|
|
529
|
-
const { releaseCi } = await import("./commands-
|
|
529
|
+
const { releaseCi } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
530
530
|
await releaseCi({
|
|
531
531
|
...await resolveReleaseOptions(cwd),
|
|
532
532
|
mode: "publish"
|
|
@@ -536,7 +536,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
536
536
|
});
|
|
537
537
|
stableCommand.command("prepare").description(localize("Consume pnpm change intents and prepare a Release PR", "消费 pnpm change intents 并准备 Release PR")).action(async () => {
|
|
538
538
|
await runReleaseAction(async () => {
|
|
539
|
-
const { releaseCi } = await import("./commands-
|
|
539
|
+
const { releaseCi } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
540
540
|
await releaseCi({
|
|
541
541
|
...await resolveReleaseOptions(cwd),
|
|
542
542
|
mode: "prepare"
|
|
@@ -546,7 +546,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
546
546
|
});
|
|
547
547
|
stableCommand.command("publish").description(localize("Publish versions on main that are not yet on npm", "发布 main 分支上尚未发布的包")).action(async () => {
|
|
548
548
|
await runReleaseAction(async () => {
|
|
549
|
-
const { releaseCi } = await import("./commands-
|
|
549
|
+
const { releaseCi } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
550
550
|
await releaseCi({
|
|
551
551
|
...await resolveReleaseOptions(cwd),
|
|
552
552
|
mode: "publish"
|
|
@@ -557,21 +557,21 @@ function registerReleaseCommands(program, cwd) {
|
|
|
557
557
|
const preCommand = releaseCommand.command("pre").description(localize("Run or manage prereleases", "执行或管理 prerelease 发布"));
|
|
558
558
|
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 () => {
|
|
559
559
|
await runReleaseAction(async () => {
|
|
560
|
-
const { releaseCi } = await import("./commands-
|
|
560
|
+
const { releaseCi } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
561
561
|
await releaseCi(await resolveReleaseOptions(cwd));
|
|
562
562
|
logger.success(localize("Prerelease finished.", "预发布完成。"));
|
|
563
563
|
});
|
|
564
564
|
});
|
|
565
565
|
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) => {
|
|
566
566
|
await runReleaseAction(async () => {
|
|
567
|
-
const { enterPrerelease } = await import("./commands-
|
|
567
|
+
const { enterPrerelease } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
568
568
|
await enterPrerelease(tag, { cwd });
|
|
569
569
|
logger.success(localize(`Entered ${tag} prerelease mode.`, `已进入 ${tag} 预发布模式。`));
|
|
570
570
|
});
|
|
571
571
|
});
|
|
572
572
|
preCommand.command("exit").description(localize("Exit the pnpm prerelease lane", "退出 pnpm prerelease lane")).action(async () => {
|
|
573
573
|
await runReleaseAction(async () => {
|
|
574
|
-
const { exitPrerelease } = await import("./commands-
|
|
574
|
+
const { exitPrerelease } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
575
575
|
await exitPrerelease({ cwd });
|
|
576
576
|
logger.success(localize("Exited prerelease mode.", "已退出预发布模式。"));
|
|
577
577
|
});
|
|
@@ -579,15 +579,24 @@ function registerReleaseCommands(program, cwd) {
|
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
//#region src/cli/commands/skills.ts
|
|
582
|
-
const skillTargets = [
|
|
582
|
+
const skillTargets = [
|
|
583
|
+
"codex",
|
|
584
|
+
"claude",
|
|
585
|
+
"cursor",
|
|
586
|
+
"agents",
|
|
587
|
+
"grok"
|
|
588
|
+
];
|
|
583
589
|
function registerSkillsCommands(program, cwd) {
|
|
584
|
-
program.command("skills").alias("sk").description(localize("AI skill commands", "技能工具集")).command("sync").description(localize("Synchronize the repoctl skill to global agent directories", "同步 resources/skills/
|
|
585
|
-
const { syncSkills } = await import("./commands-
|
|
590
|
+
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) => {
|
|
591
|
+
const { syncSkills } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
586
592
|
const selected = /* @__PURE__ */ new Set();
|
|
587
593
|
if (opts.all) for (const target of skillTargets) selected.add(target);
|
|
588
594
|
else {
|
|
589
595
|
if (opts.codex) selected.add("codex");
|
|
590
596
|
if (opts.claude) selected.add("claude");
|
|
597
|
+
if (opts.cursor) selected.add("cursor");
|
|
598
|
+
if (opts.agents) selected.add("agents");
|
|
599
|
+
if (opts.grok) selected.add("grok");
|
|
591
600
|
}
|
|
592
601
|
const results = await syncSkills(selected.size ? {
|
|
593
602
|
cwd,
|
|
@@ -702,7 +711,7 @@ function registerTemplatesCommands(program) {
|
|
|
702
711
|
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) => {
|
|
703
712
|
const { getTemplateChoice, getTemplateChoices, isTemplateCategory, suggestTemplateKey, templateCategories } = await import("@icebreakers/monorepo-templates");
|
|
704
713
|
if (opts.check) {
|
|
705
|
-
const { checkTemplates } = await import("./commands-
|
|
714
|
+
const { checkTemplates } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
706
715
|
const report = await checkTemplates();
|
|
707
716
|
if (opts.json) await emitTemplateOutput(JSON.stringify(report, null, 2), opts);
|
|
708
717
|
else await emitTemplateOutput(formatTemplateHealthReport(report, !opts.out), opts);
|
|
@@ -781,7 +790,7 @@ function normalizeToolingTargets(tooling) {
|
|
|
781
790
|
function registerToolingCommands(program, cwd) {
|
|
782
791
|
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) => {
|
|
783
792
|
const normalizedTooling = normalizeToolingTargets(tooling);
|
|
784
|
-
const { initTooling } = await import("./commands-
|
|
793
|
+
const { initTooling } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
785
794
|
await initTooling(cwd, {
|
|
786
795
|
...normalizedTooling ? { targets: normalizedTooling } : {},
|
|
787
796
|
...opts.all !== void 0 ? { all: opts.all } : {},
|
|
@@ -952,7 +961,7 @@ async function emitCheckPlan(plan, opts, cwd) {
|
|
|
952
961
|
}
|
|
953
962
|
function registerTopLevelCommands(program, cwd) {
|
|
954
963
|
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) => {
|
|
955
|
-
const { init } = await import("./commands-
|
|
964
|
+
const { init } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
956
965
|
await init(cwd, {
|
|
957
966
|
...opts.preset !== void 0 ? { preset: opts.preset } : {},
|
|
958
967
|
...opts.force !== void 0 ? { force: opts.force } : {},
|
|
@@ -963,7 +972,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
963
972
|
logger.info(localize("Next: run `pnpm install` and `pnpm build`.", "下一步:运行 `pnpm install` 和 `pnpm build`。"));
|
|
964
973
|
});
|
|
965
974
|
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) => {
|
|
966
|
-
const { runCreateFlow } = await import("./create-flow-
|
|
975
|
+
const { runCreateFlow } = await import("./create-flow-9c4YQqzw.mjs");
|
|
967
976
|
const result = await runCreateFlow(cwd, inputName, {
|
|
968
977
|
...opts.template !== void 0 ? { template: opts.template } : {},
|
|
969
978
|
...opts.dryRun || opts.json || opts.out ? { dryRun: true } : {},
|
|
@@ -981,10 +990,10 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
981
990
|
...opts.staged !== void 0 ? { staged: opts.staged } : {},
|
|
982
991
|
...opts.editFile !== void 0 ? { editFile: opts.editFile } : {}
|
|
983
992
|
};
|
|
984
|
-
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-
|
|
993
|
+
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
985
994
|
if (opts.dryRun || opts.json || opts.markdown || opts.out) {
|
|
986
995
|
if (opts.full) {
|
|
987
|
-
const { resolveFullWorkspaceCheckPlan } = await import("./commands-
|
|
996
|
+
const { resolveFullWorkspaceCheckPlan } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
988
997
|
await emitCheckPlan(await resolveFullWorkspaceCheckPlan(cwd), opts, cwd);
|
|
989
998
|
return;
|
|
990
999
|
}
|
|
@@ -995,7 +1004,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
995
1004
|
logger.success(localize("Checks finished.", "检查完成。"));
|
|
996
1005
|
});
|
|
997
1006
|
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) => {
|
|
998
|
-
const { runDoctor } = await import("./commands-
|
|
1007
|
+
const { runDoctor } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
999
1008
|
const report = await runDoctor(cwd);
|
|
1000
1009
|
await emitDoctorReport(report, opts, cwd);
|
|
1001
1010
|
if (opts.out || opts.json || opts.markdown) {
|
|
@@ -1018,7 +1027,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
1018
1027
|
logger.success(localize("Doctor finished.", "Doctor 诊断完成。"));
|
|
1019
1028
|
});
|
|
1020
1029
|
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) => {
|
|
1021
|
-
const { upgradeMonorepo } = await import("./commands-
|
|
1030
|
+
const { upgradeMonorepo } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1022
1031
|
await upgradeMonorepo(normalizeCliOpts(cwd, opts));
|
|
1023
1032
|
logger.success(localize("Upgrade finished.", "升级完成。"));
|
|
1024
1033
|
});
|
|
@@ -1028,22 +1037,22 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
1028
1037
|
function registerVerifyCommands(program, cwd) {
|
|
1029
1038
|
const verifyCommand = program.command("verify").alias("v").description(localize("Local verification commands", "本地校验工具集"));
|
|
1030
1039
|
verifyCommand.command("pre-push").description(localize("Run build, test, and tsd checks for pushed changes", "按推送变更范围执行 build/test/tsd 校验")).alias("push").action(async () => {
|
|
1031
|
-
const { verifyPrePush } = await import("./commands-
|
|
1040
|
+
const { verifyPrePush } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1032
1041
|
await verifyPrePush({ cwd });
|
|
1033
1042
|
});
|
|
1034
1043
|
verifyCommand.command("pre-commit").description(localize("Run lint-staged verification", "执行 lint-staged 校验")).alias("commit").action(async () => {
|
|
1035
|
-
const { verifyPreCommit } = await import("./commands-
|
|
1044
|
+
const { verifyPreCommit } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1036
1045
|
await verifyPreCommit({ cwd });
|
|
1037
1046
|
});
|
|
1038
1047
|
verifyCommand.command("commit-msg").description(localize("Run commitlint verification", "执行 commitlint 校验")).alias("msg").argument("<edit-file>").action(async (editFile) => {
|
|
1039
|
-
const { verifyCommitMsg } = await import("./commands-
|
|
1048
|
+
const { verifyCommitMsg } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1040
1049
|
await verifyCommitMsg({
|
|
1041
1050
|
cwd,
|
|
1042
1051
|
editFile
|
|
1043
1052
|
});
|
|
1044
1053
|
});
|
|
1045
1054
|
verifyCommand.command("staged-typecheck").description(localize("Run typecheck in workspaces containing staged files", "按暂存文件所在 workspace 执行 typecheck")).alias("tc").argument("[files...]").action(async (files = []) => {
|
|
1046
|
-
const { verifyStagedTypecheck } = await import("./commands-
|
|
1055
|
+
const { verifyStagedTypecheck } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1047
1056
|
verifyStagedTypecheck(files, { cwd });
|
|
1048
1057
|
});
|
|
1049
1058
|
}
|
|
@@ -1122,12 +1131,12 @@ async function emitWorkspaceList(result, opts) {
|
|
|
1122
1131
|
function registerWorkspaceCommands(program, cwd) {
|
|
1123
1132
|
const workspaceCommand = program.command("workspace").alias("ws").description(localize("Workspace commands", "工作区命令"));
|
|
1124
1133
|
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) => {
|
|
1125
|
-
const { upgradeMonorepo } = await import("./commands-
|
|
1134
|
+
const { upgradeMonorepo } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1126
1135
|
await upgradeMonorepo(normalizeCliOpts(cwd, opts));
|
|
1127
1136
|
logger.success(localize("Workspace upgrade finished.", "Workspace 升级完成。"));
|
|
1128
1137
|
});
|
|
1129
1138
|
workspaceCommand.command("init").description(localize("Initialize workspace metadata and repository files", "初始化工作区元信息(README、package.json、pnpm intent、issue template)")).alias("i").action(async () => {
|
|
1130
|
-
const { initMetadata } = await import("./commands-
|
|
1139
|
+
const { initMetadata } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1131
1140
|
await initMetadata(cwd);
|
|
1132
1141
|
logger.success(localize("Workspace initialization finished.", "Workspace 初始化完成。"));
|
|
1133
1142
|
});
|
|
@@ -1140,7 +1149,7 @@ function registerWorkspaceCommands(program, cwd) {
|
|
|
1140
1149
|
}), opts);
|
|
1141
1150
|
});
|
|
1142
1151
|
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) => {
|
|
1143
|
-
const { cleanProjects } = await import("./commands-
|
|
1152
|
+
const { cleanProjects } = await import("./commands-ByI13wrh.mjs").then((n) => n.t);
|
|
1144
1153
|
await cleanProjects(cwd, normalizeCleanOptions(opts));
|
|
1145
1154
|
logger.success(localize("Workspace cleanup finished.", "Workspace 清理完成。"));
|
|
1146
1155
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.mjs";
|
|
2
2
|
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries } from "./workspace-MCKewElu.mjs";
|
|
3
|
-
import { b as
|
|
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-BOsjWpX0.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";
|
|
@@ -682,11 +682,21 @@ function isMatch(str, arr) {
|
|
|
682
682
|
/**
|
|
683
683
|
* 内置 skills 目录名称。
|
|
684
684
|
*/
|
|
685
|
-
const skillName = "
|
|
685
|
+
const skillName = "repoctl";
|
|
686
|
+
/**
|
|
687
|
+
* 历史 skill 目录名称,同步时删除以免过期副本继续被加载。
|
|
688
|
+
*/
|
|
689
|
+
const legacySkillName = "icebreakers-monorepo-cli";
|
|
686
690
|
/**
|
|
687
691
|
* 当前支持的 skills 同步目标。
|
|
688
692
|
*/
|
|
689
|
-
const skillTargets = [
|
|
693
|
+
const skillTargets = [
|
|
694
|
+
"codex",
|
|
695
|
+
"claude",
|
|
696
|
+
"cursor",
|
|
697
|
+
"agents",
|
|
698
|
+
"grok"
|
|
699
|
+
];
|
|
690
700
|
/**
|
|
691
701
|
* 包内 skills 模板源目录。
|
|
692
702
|
*/
|
|
@@ -698,8 +708,20 @@ const skillSourceDir = path.join(packageDir, "resources", "skills", skillName);
|
|
|
698
708
|
*/
|
|
699
709
|
function getSkillTargetPaths(homeDir = os.homedir()) {
|
|
700
710
|
return {
|
|
711
|
+
agents: path.join(homeDir, ".agents", "skills", skillName),
|
|
712
|
+
claude: path.join(homeDir, ".claude", "skills", skillName),
|
|
701
713
|
codex: path.join(homeDir, ".codex", "skills", skillName),
|
|
702
|
-
|
|
714
|
+
cursor: path.join(homeDir, ".cursor", "skills", skillName),
|
|
715
|
+
grok: path.join(homeDir, ".grok", "skills", skillName)
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
function getLegacySkillTargetPaths(homeDir = os.homedir()) {
|
|
719
|
+
return {
|
|
720
|
+
agents: path.join(homeDir, ".agents", "skills", legacySkillName),
|
|
721
|
+
claude: path.join(homeDir, ".claude", "skills", legacySkillName),
|
|
722
|
+
codex: path.join(homeDir, ".codex", "skills", legacySkillName),
|
|
723
|
+
cursor: path.join(homeDir, ".cursor", "skills", legacySkillName),
|
|
724
|
+
grok: path.join(homeDir, ".grok", "skills", legacySkillName)
|
|
703
725
|
};
|
|
704
726
|
}
|
|
705
727
|
function normalizeTargets(values) {
|
|
@@ -729,9 +751,11 @@ async function syncSkills(options = {}) {
|
|
|
729
751
|
}));
|
|
730
752
|
if (!targets?.length) return [];
|
|
731
753
|
const targetPaths = getSkillTargetPaths();
|
|
754
|
+
const legacyPaths = getLegacySkillTargetPaths();
|
|
732
755
|
const results = [];
|
|
733
756
|
for (const target of targets) {
|
|
734
757
|
const dest = targetPaths[target];
|
|
758
|
+
await fs$1.remove(legacyPaths[target]);
|
|
735
759
|
await fs$1.remove(dest);
|
|
736
760
|
await fs$1.ensureDir(path.dirname(dest));
|
|
737
761
|
await fs$1.copy(skillSourceDir, dest);
|
|
@@ -1817,155 +1841,122 @@ async function setReadme_default(ctx, options = {}) {
|
|
|
1817
1841
|
}
|
|
1818
1842
|
//#endregion
|
|
1819
1843
|
//#region ../../package.json
|
|
1820
|
-
var
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
"
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
"
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
"
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1844
|
+
var package_default = {
|
|
1845
|
+
name: "repoctl-workspace",
|
|
1846
|
+
type: "module",
|
|
1847
|
+
version: "0.0.0",
|
|
1848
|
+
"private": true,
|
|
1849
|
+
packageManager: "pnpm@12.3.4",
|
|
1850
|
+
description: "Source workspace for repoctl and Icebreaker's shared development packages",
|
|
1851
|
+
author: "ice breaker <hi@sonofmagic.top>",
|
|
1852
|
+
license: "MIT",
|
|
1853
|
+
homepage: "https://repoctl.icebreaker.top",
|
|
1854
|
+
repository: {
|
|
1855
|
+
"type": "git",
|
|
1856
|
+
"url": "git+https://github.com/sonofmagic/repoctl.git"
|
|
1857
|
+
},
|
|
1858
|
+
bugs: { "url": "https://github.com/sonofmagic/repoctl/issues" },
|
|
1859
|
+
keywords: [
|
|
1860
|
+
"repoctl",
|
|
1861
|
+
"monorepo",
|
|
1862
|
+
"pnpm",
|
|
1863
|
+
"turborepo",
|
|
1864
|
+
"typescript"
|
|
1865
|
+
],
|
|
1866
|
+
engines: { "node": ">=22.13.0" },
|
|
1867
|
+
scripts: {
|
|
1868
|
+
"build": "turbo run build",
|
|
1869
|
+
"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
|
+
"test:packaged-doctor": "node scripts/smoke-packaged-doctor.mjs",
|
|
1873
|
+
"test:worker-types": "node scripts/worker-types/index.mjs",
|
|
1874
|
+
"test:dev": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest",
|
|
1875
|
+
"lint": "pnpm run tooling:build && turbo run lint",
|
|
1876
|
+
"tsd": "turbo run tsd",
|
|
1877
|
+
"test:types": "turbo run test:types",
|
|
1878
|
+
"check:no-tracked-build-artifacts": "node ./scripts/check-no-tracked-build-artifacts.mjs",
|
|
1879
|
+
"check:workflows": "node ./scripts/check-workflows.mjs",
|
|
1880
|
+
"audit": "pnpm audit --audit-level=moderate",
|
|
1881
|
+
"audit:fix": "pnpm audit --fix",
|
|
1882
|
+
"cf-typegen": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen",
|
|
1883
|
+
"cf-typegen:check": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen:check",
|
|
1884
|
+
"typecheck": "turbo run typecheck",
|
|
1885
|
+
"format": "eslint . --fix",
|
|
1886
|
+
"validate": "pnpm run build && pnpm run lint && pnpm run typecheck && pnpm run tsd && pnpm run test",
|
|
1887
|
+
"release": "pnpm change",
|
|
1888
|
+
"version-packages": "pnpm version -r",
|
|
1889
|
+
"publish-packages": "repo release stable publish",
|
|
1890
|
+
"release:pre": "repo release pre publish",
|
|
1891
|
+
"------": "--------------",
|
|
1892
|
+
"preinstall": "npx only-allow pnpm",
|
|
1893
|
+
"prepare": "husky",
|
|
1894
|
+
"postinstall": "pnpm run build",
|
|
1895
|
+
"commit": "commit",
|
|
1896
|
+
"commitlint": "commitlint --edit",
|
|
1897
|
+
"sync": "turbo run sync",
|
|
1898
|
+
"inspector": "npx @eslint/config-inspector",
|
|
1899
|
+
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
|
|
1900
|
+
"-------": "---------------",
|
|
1901
|
+
"repo:init": "repo init",
|
|
1902
|
+
"repo:new": "repo new",
|
|
1903
|
+
"repo:check": "repo check",
|
|
1904
|
+
"repo:doctor": "repo doctor",
|
|
1905
|
+
"------simple": "--------------",
|
|
1906
|
+
"pr:alpha": "repo release pre enter alpha",
|
|
1907
|
+
"pr:beta": "repo release pre enter beta",
|
|
1908
|
+
"pr:rc": "repo release pre enter rc",
|
|
1909
|
+
"pr:next": "repo release pre enter next",
|
|
1910
|
+
"pr:exit": "repo release pre exit",
|
|
1911
|
+
"--------": "----------------"
|
|
1912
|
+
},
|
|
1913
|
+
devDependencies: {
|
|
1914
|
+
"@commitlint/cli": "^21.2.2",
|
|
1915
|
+
"@eslint/config-inspector": "^3.4.1",
|
|
1916
|
+
"@icebreakers/commitlint-config": "workspace:*",
|
|
1917
|
+
"@icebreakers/eslint-config": "workspace:*",
|
|
1918
|
+
"@icebreakers/monorepo": "workspace:*",
|
|
1919
|
+
"@icebreakers/stylelint-config": "workspace:*",
|
|
1920
|
+
"@types/node": "^26.5.1",
|
|
1921
|
+
"@vitest/coverage-v8": "~5.0.0",
|
|
1922
|
+
"eslint": "^10.10.0",
|
|
1923
|
+
"execa": "^10.0.1",
|
|
1924
|
+
"husky": "^9.1.7",
|
|
1925
|
+
"lint-staged": "^17.5.1",
|
|
1926
|
+
"only-allow": "^1.2.2",
|
|
1927
|
+
"repoctl": "workspace:*",
|
|
1928
|
+
"stylelint": "^17.15.0",
|
|
1929
|
+
"tailwindcss": "^4.3.3",
|
|
1930
|
+
"tsd": "^0.33.0",
|
|
1931
|
+
"tsdown": "0.23.0",
|
|
1932
|
+
"turbo": "^2.10.12",
|
|
1933
|
+
"typescript": "^6.0.3",
|
|
1934
|
+
"vitest": "~5.0.0",
|
|
1935
|
+
"yaml": "^2.9.0"
|
|
1936
|
+
},
|
|
1937
|
+
publishConfig: {
|
|
1938
|
+
"access": "public",
|
|
1939
|
+
"registry": "https://registry.npmjs.org"
|
|
1940
|
+
}
|
|
1884
1941
|
};
|
|
1885
1942
|
//#endregion
|
|
1886
1943
|
//#region src/commands/init/tooling/presets.ts
|
|
1944
|
+
function isConcreteNpmSpecifier(version) {
|
|
1945
|
+
return !version.startsWith("catalog:") && !version.startsWith("workspace:");
|
|
1946
|
+
}
|
|
1947
|
+
function collectConcreteDependencyVersions(pkg) {
|
|
1948
|
+
const versions = {};
|
|
1949
|
+
for (const group of [pkg.dependencies, pkg.devDependencies]) for (const [name, version] of Object.entries(group ?? {})) if (typeof version === "string" && version.length > 0 && isConcreteNpmSpecifier(version)) versions[name] = version;
|
|
1950
|
+
return versions;
|
|
1951
|
+
}
|
|
1887
1952
|
const packageDependencies = {
|
|
1888
|
-
...
|
|
1889
|
-
|
|
1890
|
-
type: "module",
|
|
1891
|
-
version: "0.0.0",
|
|
1892
|
-
"private": true,
|
|
1893
|
-
packageManager: "pnpm@12.3.4",
|
|
1894
|
-
description: "Source workspace for repoctl and Icebreaker's shared development packages",
|
|
1895
|
-
author: "ice breaker <hi@sonofmagic.top>",
|
|
1896
|
-
homepage: "https://repoctl.icebreaker.top",
|
|
1897
|
-
repository: {
|
|
1898
|
-
"type": "git",
|
|
1899
|
-
"url": "git+https://github.com/sonofmagic/repoctl.git"
|
|
1900
|
-
},
|
|
1901
|
-
bugs: { "url": "https://github.com/sonofmagic/repoctl/issues" },
|
|
1902
|
-
keywords: [
|
|
1903
|
-
"repoctl",
|
|
1904
|
-
"monorepo",
|
|
1905
|
-
"pnpm",
|
|
1906
|
-
"turborepo",
|
|
1907
|
-
"typescript"
|
|
1908
|
-
],
|
|
1909
|
-
engines: { "node": ">=22.13.0" },
|
|
1910
|
-
scripts: {
|
|
1911
|
-
"build": "turbo run build",
|
|
1912
|
-
"tooling:build": "turbo run build --filter=@icebreakers/monorepo --filter=repoctl",
|
|
1913
|
-
"dev": "turbo run dev --parallel",
|
|
1914
|
-
"test": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest run && pnpm test:types",
|
|
1915
|
-
"test:packaged-doctor": "node scripts/smoke-packaged-doctor.mjs",
|
|
1916
|
-
"test:worker-types": "node scripts/worker-types/index.mjs",
|
|
1917
|
-
"test:dev": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest",
|
|
1918
|
-
"lint": "pnpm run tooling:build && turbo run lint",
|
|
1919
|
-
"tsd": "turbo run tsd",
|
|
1920
|
-
"test:types": "turbo run test:types",
|
|
1921
|
-
"check:no-tracked-build-artifacts": "node ./scripts/check-no-tracked-build-artifacts.mjs",
|
|
1922
|
-
"check:workflows": "node ./scripts/check-workflows.mjs",
|
|
1923
|
-
"audit": "pnpm audit --audit-level=moderate",
|
|
1924
|
-
"audit:fix": "pnpm audit --fix",
|
|
1925
|
-
"cf-typegen": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen",
|
|
1926
|
-
"cf-typegen:check": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen:check",
|
|
1927
|
-
"typecheck": "turbo run typecheck",
|
|
1928
|
-
"format": "eslint . --fix",
|
|
1929
|
-
"validate": "pnpm run build && pnpm run lint && pnpm run typecheck && pnpm run tsd && pnpm run test",
|
|
1930
|
-
"release": "pnpm change",
|
|
1931
|
-
"version-packages": "pnpm version -r",
|
|
1932
|
-
"publish-packages": "repo release stable publish",
|
|
1933
|
-
"release:pre": "repo release pre publish",
|
|
1934
|
-
"------": "--------------",
|
|
1935
|
-
"preinstall": "npx only-allow pnpm",
|
|
1936
|
-
"prepare": "husky",
|
|
1937
|
-
"postinstall": "pnpm run build",
|
|
1938
|
-
"commit": "commit",
|
|
1939
|
-
"commitlint": "commitlint --edit",
|
|
1940
|
-
"sync": "turbo run sync",
|
|
1941
|
-
"inspector": "npx @eslint/config-inspector",
|
|
1942
|
-
"build:inspector": "pnpm build && npx @eslint/config-inspector build",
|
|
1943
|
-
"-------": "---------------",
|
|
1944
|
-
"repo:init": "repo init",
|
|
1945
|
-
"repo:new": "repo new",
|
|
1946
|
-
"repo:check": "repo check",
|
|
1947
|
-
"repo:doctor": "repo doctor",
|
|
1948
|
-
"------simple": "--------------",
|
|
1949
|
-
"pr:alpha": "repo release pre enter alpha",
|
|
1950
|
-
"pr:beta": "repo release pre enter beta",
|
|
1951
|
-
"pr:rc": "repo release pre enter rc",
|
|
1952
|
-
"pr:next": "repo release pre enter next",
|
|
1953
|
-
"pr:exit": "repo release pre exit",
|
|
1954
|
-
"--------": "----------------"
|
|
1955
|
-
},
|
|
1956
|
-
devDependencies,
|
|
1957
|
-
publishConfig: {
|
|
1958
|
-
"access": "public",
|
|
1959
|
-
"registry": "https://registry.npmjs.org"
|
|
1960
|
-
}
|
|
1961
|
-
}.dependencies ?? {},
|
|
1962
|
-
...devDependencies ?? {},
|
|
1963
|
-
...dependencies ?? {},
|
|
1964
|
-
...devDependencies$1 ?? {}
|
|
1953
|
+
...collectConcreteDependencyVersions(package_default),
|
|
1954
|
+
...collectConcreteDependencyVersions(package_default$1)
|
|
1965
1955
|
};
|
|
1966
1956
|
function getDependencyVersion(name) {
|
|
1967
1957
|
const version = packageDependencies[name];
|
|
1968
1958
|
if (!version) throw new Error(localize(`No version information was found for dependency ${name}.`, `未找到依赖 ${name} 的版本信息。`));
|
|
1959
|
+
if (!isConcreteNpmSpecifier(version)) throw new Error(localize(`Dependency ${name} must use a concrete version, not ${version}.`, `依赖 ${name} 必须使用具体版本,不能使用 ${version}。`));
|
|
1969
1960
|
return version;
|
|
1970
1961
|
}
|
|
1971
1962
|
function getToolingPackageVersion() {
|
|
@@ -2165,8 +2156,8 @@ async function ensureRootPackageJson(cwd) {
|
|
|
2165
2156
|
type: "module",
|
|
2166
2157
|
version: "0.0.0",
|
|
2167
2158
|
private: true,
|
|
2168
|
-
packageManager: "pnpm@
|
|
2169
|
-
engines: { node: ">=
|
|
2159
|
+
packageManager: "pnpm@12.3.4",
|
|
2160
|
+
engines: { node: ">=22.13.0" },
|
|
2170
2161
|
scripts: {},
|
|
2171
2162
|
devDependencies: {}
|
|
2172
2163
|
};
|
|
@@ -4243,6 +4234,9 @@ const scriptsEntries = Object.entries({
|
|
|
4243
4234
|
//#endregion
|
|
4244
4235
|
//#region src/commands/upgrade/pkg-json.ts
|
|
4245
4236
|
const NON_OVERRIDABLE_PREFIXES = ["workspace:", "catalog:"];
|
|
4237
|
+
function isCatalogSpecifier(version) {
|
|
4238
|
+
return version.startsWith("catalog:");
|
|
4239
|
+
}
|
|
4246
4240
|
const legacyToolPackageName = "@icebreakers/monorepo";
|
|
4247
4241
|
const legacyReleaseDependencies = ["@changesets/cli", "@icebreakers/changelog-github"];
|
|
4248
4242
|
function parseVersion(input) {
|
|
@@ -4281,6 +4275,7 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
|
|
|
4281
4275
|
if (packageManager && !targetPkgJson.packageManager) targetPkgJson.packageManager = packageManager;
|
|
4282
4276
|
for (const [depName, depVersion] of Object.entries(sourceDeps)) {
|
|
4283
4277
|
if (typeof depVersion !== "string") continue;
|
|
4278
|
+
if (isCatalogSpecifier(depVersion)) continue;
|
|
4284
4279
|
const targetVersion = targetDeps[depName];
|
|
4285
4280
|
if (hasNonOverridablePrefix(targetVersion)) continue;
|
|
4286
4281
|
if (shouldAssignVersion(targetVersion, depVersion)) targetDeps[depName] = depVersion;
|
|
@@ -4288,6 +4283,7 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
|
|
|
4288
4283
|
if (Object.keys(targetDeps).length) targetPkgJson.dependencies = targetDeps;
|
|
4289
4284
|
for (const [depName, depVersion] of Object.entries(sourceDevDeps)) {
|
|
4290
4285
|
if (typeof depVersion !== "string") continue;
|
|
4286
|
+
if (isCatalogSpecifier(depVersion)) continue;
|
|
4291
4287
|
if (depName === "repoctl") {
|
|
4292
4288
|
const nextVersion = `^${version$1}`;
|
|
4293
4289
|
const targetVersion = targetDevDeps[depName];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as getCreateChoices, M as resolveCreateNewProjectPlan, O as createNewProject, k as defaultTemplate } from "./commands-
|
|
2
|
-
import {
|
|
1
|
+
import { A as getCreateChoices, M as resolveCreateNewProjectPlan, O as createNewProject, k as defaultTemplate } from "./commands-ByI13wrh.mjs";
|
|
2
|
+
import { m as logger, u as localize, y as fs } from "./types-BOsjWpX0.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
|
@@ -426,7 +426,7 @@ export declare function releaseStable(options: ReleaseOptions): Promise<Publishe
|
|
|
426
426
|
/**
|
|
427
427
|
* 当前支持的 skills 同步目标。
|
|
428
428
|
*/
|
|
429
|
-
export declare const skillTargets: readonly ["codex", "claude"];
|
|
429
|
+
export declare const skillTargets: readonly ["codex", "claude", "cursor", "agents", "grok"];
|
|
430
430
|
type SkillTarget = typeof skillTargets[number];
|
|
431
431
|
interface SyncSkillsOptions {
|
|
432
432
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as verifyPreCommit, A as getCreateChoices, B as isMatch, C as collectEnvInfo, D as runDoctor, E as collectEnvSupportBundle, F as cleanProjects, G as toPublishGitignorePath, H as getFileHash, I as getSkillTargetPaths, J as getKnownRepoCheckCommands, K as toWorkspaceGitignorePath, L as skillTargets, M as resolveCreateNewProjectPlan, N as templateMap, O as createNewProject, P as inspectMonorepoConfig, Q as verifyCommitMsg, R as syncSkills, S as createContext, T as collectEnvSnapshot, U as isFileChanged, V as setByPath, W as isGitignoreFile, X as resolveRecommendedCheckPlan, Y as resolveFullWorkspaceCheckPlan, Z as runRecommendedCheck, _ as setVscodeBinaryMirror, a as createReleasePullRequest, at as generateAgenticTemplates, b as initTooling, c as prepareStable, d as enterPrerelease, et as verifyPrePush, f as exitPrerelease, g as parsePublishSummary, h as GitHubClient, i as repairReleaseNotes, it as generateAgenticTemplate, j as getTemplateMap, l as publishStable, m as GitHubApiError, n as upgradeMonorepo, nt as createTimestampFolderName, o as recoverUnpublished, ot as loadAgenticTasks, p as releasePrerelease, q as updateIssueTemplateConfig, r as checkTemplates, rt as defaultAgenticBaseDir, s as releaseCi, st as GitClient, tt as verifyStagedTypecheck, u as releaseStable, v as init, w as collectEnvPaths, x as normalizeInitToolingTargets, y as initMetadata, z as escapeStringRegexp } from "./commands-
|
|
1
|
+
import { $ as verifyPreCommit, A as getCreateChoices, B as isMatch, C as collectEnvInfo, D as runDoctor, E as collectEnvSupportBundle, F as cleanProjects, G as toPublishGitignorePath, H as getFileHash, I as getSkillTargetPaths, J as getKnownRepoCheckCommands, K as toWorkspaceGitignorePath, L as skillTargets, M as resolveCreateNewProjectPlan, N as templateMap, O as createNewProject, P as inspectMonorepoConfig, Q as verifyCommitMsg, R as syncSkills, S as createContext, T as collectEnvSnapshot, U as isFileChanged, V as setByPath, W as isGitignoreFile, X as resolveRecommendedCheckPlan, Y as resolveFullWorkspaceCheckPlan, Z as runRecommendedCheck, _ as setVscodeBinaryMirror, a as createReleasePullRequest, at as generateAgenticTemplates, b as initTooling, c as prepareStable, d as enterPrerelease, et as verifyPrePush, f as exitPrerelease, g as parsePublishSummary, h as GitHubClient, i as repairReleaseNotes, it as generateAgenticTemplate, j as getTemplateMap, l as publishStable, m as GitHubApiError, n as upgradeMonorepo, nt as createTimestampFolderName, o as recoverUnpublished, ot as loadAgenticTasks, p as releasePrerelease, q as updateIssueTemplateConfig, r as checkTemplates, rt as defaultAgenticBaseDir, s as releaseCi, st as GitClient, tt as verifyStagedTypecheck, u as releaseStable, v as init, w as collectEnvPaths, x as normalizeInitToolingTargets, y as initMetadata, z as escapeStringRegexp } from "./commands-ByI13wrh.mjs";
|
|
2
2
|
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries, t as clearWorkspaceCache } from "./workspace-MCKewElu.mjs";
|
|
3
|
-
import {
|
|
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-BOsjWpX0.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
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, 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 };
|
|
@@ -343,38 +343,121 @@ function message(key, values = {}) {
|
|
|
343
343
|
//#endregion
|
|
344
344
|
//#region package.json
|
|
345
345
|
var name = "@icebreakers/monorepo";
|
|
346
|
-
var version = "5.
|
|
347
|
-
var
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
"
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
346
|
+
var version = "5.5.0";
|
|
347
|
+
var package_default = {
|
|
348
|
+
name,
|
|
349
|
+
type: "module",
|
|
350
|
+
version,
|
|
351
|
+
description: "Core engine and programmatic APIs for repoctl",
|
|
352
|
+
author: "ice breaker <hi@sonofmagic.top>",
|
|
353
|
+
license: "MIT",
|
|
354
|
+
homepage: "https://repoctl.icebreaker.top",
|
|
355
|
+
repository: {
|
|
356
|
+
"type": "git",
|
|
357
|
+
"url": "git+https://github.com/sonofmagic/repoctl.git",
|
|
358
|
+
"directory": "packages/monorepo"
|
|
359
|
+
},
|
|
360
|
+
bugs: { "url": "https://github.com/sonofmagic/repoctl/issues" },
|
|
361
|
+
keywords: [
|
|
362
|
+
"monorepo",
|
|
363
|
+
"repoctl",
|
|
364
|
+
"tooling",
|
|
365
|
+
"icebreaker"
|
|
366
|
+
],
|
|
367
|
+
sideEffects: false,
|
|
368
|
+
exports: {
|
|
369
|
+
".": {
|
|
370
|
+
"types": "./dist/index.d.mts",
|
|
371
|
+
"default": "./dist/index.mjs"
|
|
372
|
+
},
|
|
373
|
+
"./cli": {
|
|
374
|
+
"types": "./dist/cli.d.mts",
|
|
375
|
+
"default": "./dist/cli.mjs"
|
|
376
|
+
},
|
|
377
|
+
"./tooling": {
|
|
378
|
+
"types": "./dist/tooling-entry.d.mts",
|
|
379
|
+
"default": "./dist/tooling-entry.mjs"
|
|
380
|
+
},
|
|
381
|
+
"./tsconfig": "./tsconfig.base.json",
|
|
382
|
+
"./tsconfig.json": "./tsconfig.base.json",
|
|
383
|
+
"./package.json": "./package.json"
|
|
384
|
+
},
|
|
385
|
+
main: "./dist/index.mjs",
|
|
386
|
+
module: "./dist/index.mjs",
|
|
387
|
+
types: "./dist/index.d.mts",
|
|
388
|
+
bin: {
|
|
389
|
+
"repo": "bin/repo.js",
|
|
390
|
+
"repoctl": "bin/repoctl.js"
|
|
391
|
+
},
|
|
392
|
+
files: [
|
|
393
|
+
"README.md",
|
|
394
|
+
"bin",
|
|
395
|
+
"dist",
|
|
396
|
+
"resources",
|
|
397
|
+
"tsconfig.base.json"
|
|
398
|
+
],
|
|
399
|
+
engines: { "node": ">=22.13.0" },
|
|
400
|
+
scripts: {
|
|
401
|
+
"dev": "tsdown --watch --sourcemap",
|
|
402
|
+
"build": "tsdown",
|
|
403
|
+
"test": "vitest run",
|
|
404
|
+
"test:dev": "vitest",
|
|
405
|
+
"typecheck": "pnpm --filter @icebreakers/monorepo-templates build && node ../../node_modules/typescript/bin/tsc -p tsconfig.json",
|
|
406
|
+
"tsd": "pnpm build && tsd --files test-d/**/*.test-d.ts",
|
|
407
|
+
"release": "pnpm publish",
|
|
408
|
+
"lint": "eslint .",
|
|
409
|
+
"lint:fix": "eslint . --fix"
|
|
410
|
+
},
|
|
411
|
+
peerDependencies: {
|
|
412
|
+
"@commitlint/cli": "catalog:",
|
|
413
|
+
"eslint": "^9.0.0 || ^10.0.0",
|
|
414
|
+
"stylelint": "catalog:",
|
|
415
|
+
"typescript": "^5.0.0 || ^6.0.0"
|
|
416
|
+
},
|
|
417
|
+
peerDependenciesMeta: {
|
|
418
|
+
"@commitlint/cli": { "optional": true },
|
|
419
|
+
"eslint": { "optional": true },
|
|
420
|
+
"stylelint": { "optional": true },
|
|
421
|
+
"typescript": { "optional": true }
|
|
422
|
+
},
|
|
423
|
+
dependencies: {
|
|
424
|
+
"@icebreakers/commitlint-config": "workspace:*",
|
|
425
|
+
"@icebreakers/eslint-config": "workspace:*",
|
|
426
|
+
"@icebreakers/monorepo-templates": "workspace:*",
|
|
427
|
+
"@icebreakers/stylelint-config": "workspace:*",
|
|
428
|
+
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
429
|
+
"@pnpm/logger": "^1100.0.0",
|
|
430
|
+
"@pnpm/types": "^1102.1.0",
|
|
431
|
+
"@pnpm/worker": "^1100.4.1",
|
|
432
|
+
"@pnpm/workspace.find-packages": "^1000.0.65",
|
|
433
|
+
"@pnpm/workspace.read-manifest": "^1000.3.1",
|
|
434
|
+
"c12": "^3.3.4",
|
|
435
|
+
"commander": "catalog:",
|
|
436
|
+
"comment-json": "catalog:",
|
|
437
|
+
"consola": "^3.4.2",
|
|
438
|
+
"git-url-parse": "^16.1.0",
|
|
439
|
+
"klaw": "^4.1.0",
|
|
440
|
+
"lint-staged": "^17.5.1",
|
|
441
|
+
"p-queue": "^9.3.3",
|
|
442
|
+
"pathe": "^2.0.3",
|
|
443
|
+
"picocolors": "^1.1.1",
|
|
444
|
+
"semver": "catalog:",
|
|
445
|
+
"simple-git": "^3.36.0",
|
|
446
|
+
"vitest": "catalog:",
|
|
447
|
+
"yaml": "catalog:"
|
|
448
|
+
},
|
|
449
|
+
devDependencies: {
|
|
450
|
+
"@types/klaw": "^3.0.7",
|
|
451
|
+
"@types/micromatch": "^4.0.10",
|
|
452
|
+
"@types/semver": "catalog:",
|
|
453
|
+
"ci-info": "^4.4.0",
|
|
454
|
+
"fdir": "^6.5.0",
|
|
455
|
+
"micromatch": "^4.0.8"
|
|
456
|
+
},
|
|
457
|
+
publishConfig: {
|
|
458
|
+
"access": "public",
|
|
459
|
+
"registry": "https://registry.npmjs.org"
|
|
460
|
+
}
|
|
378
461
|
};
|
|
379
462
|
//#endregion
|
|
380
463
|
//#region src/constants.ts
|
|
@@ -413,4 +496,4 @@ const initToolingTargets = [
|
|
|
413
496
|
"vitest"
|
|
414
497
|
];
|
|
415
498
|
//#endregion
|
|
416
|
-
export {
|
|
499
|
+
export { outputJson as C, remove as D, readJson as E, writeJSON as O, outputJSON as S, readJSON as T, ensureFile as _, rootDir as a, isIgnorableFsError as b, package_default as c, message as d, resolveRepoctlLocale as f, ensureDir as g, copy as h, packageDir as i, writeJson as k, version as l, logger as m, assetsDir as n, templatesDir as o, supportedLocales as p, cliName as r, name as s, initToolingTargets as t, localize as u, exists as v, pathExists as w, outputFile as x, fs as y };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.5.0",
|
|
5
5
|
"description": "Core engine and programmatic APIs for repoctl",
|
|
6
6
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -46,13 +46,14 @@
|
|
|
46
46
|
"repoctl": "bin/repoctl.js"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
|
+
"README.md",
|
|
49
50
|
"bin",
|
|
50
51
|
"dist",
|
|
51
52
|
"resources",
|
|
52
53
|
"tsconfig.base.json"
|
|
53
54
|
],
|
|
54
55
|
"engines": {
|
|
55
|
-
"node": ">=22.
|
|
56
|
+
"node": ">=22.13.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
59
|
"@commitlint/cli": "^21.2.2",
|
|
@@ -75,10 +76,10 @@
|
|
|
75
76
|
}
|
|
76
77
|
},
|
|
77
78
|
"dependencies": {
|
|
78
|
-
"@icebreakers/commitlint-config": "4.0
|
|
79
|
-
"@icebreakers/eslint-config": "
|
|
80
|
-
"@icebreakers/monorepo-templates": "
|
|
81
|
-
"@icebreakers/stylelint-config": "5.0
|
|
79
|
+
"@icebreakers/commitlint-config": "4.1.0",
|
|
80
|
+
"@icebreakers/eslint-config": "8.0.0",
|
|
81
|
+
"@icebreakers/monorepo-templates": "2.0.0",
|
|
82
|
+
"@icebreakers/stylelint-config": "5.1.0",
|
|
82
83
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
83
84
|
"@pnpm/logger": "^1100.0.0",
|
|
84
85
|
"@pnpm/types": "^1102.1.0",
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
"consola": "^3.4.2",
|
|
92
93
|
"git-url-parse": "^16.1.0",
|
|
93
94
|
"klaw": "^4.1.0",
|
|
94
|
-
"lint-staged": "^17.5.
|
|
95
|
+
"lint-staged": "^17.5.1",
|
|
95
96
|
"p-queue": "^9.3.3",
|
|
96
97
|
"pathe": "^2.0.3",
|
|
97
98
|
"picocolors": "^1.1.1",
|
|
@@ -103,9 +104,15 @@
|
|
|
103
104
|
"devDependencies": {
|
|
104
105
|
"@types/klaw": "^3.0.7",
|
|
105
106
|
"@types/micromatch": "^4.0.10",
|
|
107
|
+
"@types/semver": "^7.8.0",
|
|
108
|
+
"ci-info": "^4.4.0",
|
|
106
109
|
"fdir": "^6.5.0",
|
|
107
110
|
"micromatch": "^4.0.8"
|
|
108
111
|
},
|
|
112
|
+
"publishConfig": {
|
|
113
|
+
"access": "public",
|
|
114
|
+
"registry": "https://registry.npmjs.org"
|
|
115
|
+
},
|
|
109
116
|
"scripts": {
|
|
110
117
|
"dev": "tsdown --watch --sourcemap",
|
|
111
118
|
"build": "tsdown",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
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.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# repoctl
|
|
7
|
+
|
|
8
|
+
The package name is `repoctl`. The command is `repo`.
|
|
9
|
+
|
|
10
|
+
## Empty directory
|
|
11
|
+
|
|
12
|
+
Do not prompt. Map the request to template keys, then:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm create repoctl <dir> -- --yes --templates <keys>
|
|
16
|
+
cd <dir>
|
|
17
|
+
pnpm install
|
|
18
|
+
pnpm exec repo init
|
|
19
|
+
pnpm exec repo doctor
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
`npm create` and `pnpm create` need the extra `--` before flags. `npx create-repoctl <dir> --yes --templates <keys>` does not.
|
|
23
|
+
|
|
24
|
+
| User intent | `--templates` key |
|
|
25
|
+
| ------------------------ | ------------------ |
|
|
26
|
+
| Vue / full-stack web app | `vue-hono` |
|
|
27
|
+
| API / Hono service | `hono-server` |
|
|
28
|
+
| TypeScript library / SDK | `tsdown` |
|
|
29
|
+
| Vue component library | `vue-lib` |
|
|
30
|
+
| Documentation site | `vitepress` |
|
|
31
|
+
| CLI | `cli` |
|
|
32
|
+
| Unspecified | omit `--templates` |
|
|
33
|
+
|
|
34
|
+
Then implement the requested feature in the generated workspace.
|
|
35
|
+
|
|
36
|
+
## Existing repoctl workspace
|
|
37
|
+
|
|
38
|
+
Look for `pnpm-workspace.yaml` and a `repoctl` / `repo` dependency.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm exec repo templates
|
|
42
|
+
pnpm exec repo new <name> --template <key>
|
|
43
|
+
pnpm exec repo check
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Verify
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm exec repo doctor
|
|
50
|
+
pnpm exec repo check
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Do not
|
|
54
|
+
|
|
55
|
+
- Do not add packages by copying folders.
|
|
56
|
+
- Do not hang on create prompts; pass `--yes`.
|
|
57
|
+
- Do not create business apps inside the `sonofmagic/repoctl` source repository.
|
|
58
|
+
|
|
59
|
+
## References
|
|
60
|
+
|
|
61
|
+
- `references/templates.md` for template keys and `repo new` flags.
|
|
62
|
+
- `references/commands.md` for other CLI commands.
|
|
63
|
+
- `references/config.md` for `repoctl.config.ts`.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Purpose: bootstrap workspace metadata plus recommended tooling defaults.
|
|
6
6
|
Usage:
|
|
7
7
|
|
|
8
|
-
-
|
|
8
|
+
- pnpm exec repo init
|
|
9
9
|
Options:
|
|
10
10
|
- --preset <minimal|standard>: choose a lighter or fuller setup
|
|
11
11
|
- --force: overwrite existing tooling config files
|
|
@@ -108,7 +108,7 @@ Usage:
|
|
|
108
108
|
Purpose: initialize workspace metadata such as README, package.json, pnpm change intent support, and issue template.
|
|
109
109
|
Usage:
|
|
110
110
|
|
|
111
|
-
-
|
|
111
|
+
- pnpm exec repo init
|
|
112
112
|
- npx repoctl workspace init
|
|
113
113
|
- npx repoctl ws init
|
|
114
114
|
|
|
@@ -193,13 +193,16 @@ Usage:
|
|
|
193
193
|
|
|
194
194
|
## skills sync
|
|
195
195
|
|
|
196
|
-
Purpose: sync
|
|
196
|
+
Purpose: sync the `repoctl` skill into global agent skill directories.
|
|
197
197
|
Usage:
|
|
198
198
|
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
199
|
+
- pnpm exec repo skills sync
|
|
200
|
+
- pnpm exec repo skills sync --codex
|
|
201
|
+
- pnpm exec repo skills sync --claude
|
|
202
|
+
- pnpm exec repo skills sync --cursor
|
|
203
|
+
- pnpm exec repo skills sync --agents
|
|
204
|
+
- pnpm exec repo skills sync --grok
|
|
205
|
+
- pnpm exec repo skills sync --all
|
|
203
206
|
|
|
204
207
|
## ai prompt create (aliases: ai p create, ai p new)
|
|
205
208
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Templates
|
|
2
2
|
|
|
3
|
-
Prefer `repo new [name]` for the guided flow.
|
|
4
|
-
|
|
3
|
+
Prefer `repo new [name]` for the guided flow. For agents, pass `--template`
|
|
4
|
+
explicitly so the command does not prompt.
|
|
5
5
|
|
|
6
6
|
Intent defaults:
|
|
7
7
|
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: icebreakers-monorepo-cli
|
|
3
|
-
description: Use when working with repoctl or @icebreakers/monorepo in this pnpm/turbo monorepo. Covers CLI tasks like workspace upgrade/ws up, init, clean, mirror, skills sync, creating new template packages (tsdown/vitepress/etc), generating agentic prompt templates (repoctl ai prompt create / ai p new), and editing repoctl.config.ts or monorepo.config.ts defaults.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Icebreakers Monorepo Cli
|
|
7
|
-
|
|
8
|
-
## Overview
|
|
9
|
-
|
|
10
|
-
Map user requests to the correct `repoctl` CLI command, templates, and configuration defaults.
|
|
11
|
-
Prefer `repoctl` in examples, allow `repo` as the short alias, and treat `rc` as a compatibility alias rather than the primary recommendation.
|
|
12
|
-
|
|
13
|
-
## Quick Workflow
|
|
14
|
-
|
|
15
|
-
1. Confirm the workspace root (look for `pnpm-workspace.yaml` and `package.json`).
|
|
16
|
-
2. Check `repoctl.config.ts` first, then `monorepo.config.ts` for command defaults or overrides.
|
|
17
|
-
3. Select the task below and follow the linked reference.
|
|
18
|
-
|
|
19
|
-
## Tasks
|
|
20
|
-
|
|
21
|
-
### Create a template package
|
|
22
|
-
|
|
23
|
-
- Prefer `repoctl new [name]` for the guided flow and use `references/templates.md` for intent-to-template mapping.
|
|
24
|
-
- Use `repoctl package create [path]` (alias `pkg new`) when the user explicitly wants direct template selection.
|
|
25
|
-
- Example: for "create a tsdown app in apps/my-app", run `npx repoctl new my-app`, choose `library`, then choose `tsdown`.
|
|
26
|
-
- For non-interactive defaults, set `commands.create.defaultTemplate` in `repoctl.config.ts` or `monorepo.config.ts`.
|
|
27
|
-
|
|
28
|
-
### Upgrade or sync monorepo assets
|
|
29
|
-
|
|
30
|
-
- Prefer `repoctl upgrade`; use `repoctl workspace upgrade` (`ws up`) when matching existing scripts or user wording.
|
|
31
|
-
|
|
32
|
-
### Generate agentic prompt templates
|
|
33
|
-
|
|
34
|
-
- Use `repoctl ai prompt create` (`ai p new`) and options from `references/commands.md`.
|
|
35
|
-
|
|
36
|
-
### Maintenance tasks
|
|
37
|
-
|
|
38
|
-
- Use `repoctl init`, `check`, `clean`, `mirror`, or `skills sync` from `references/commands.md`.
|
|
39
|
-
- Confirm destructive actions (clean) and note repo-wide effects.
|
|
40
|
-
|
|
41
|
-
## References
|
|
42
|
-
|
|
43
|
-
- `references/commands.md` for CLI options and flags.
|
|
44
|
-
- `references/templates.md` for template mapping and placement.
|
|
45
|
-
- `references/config.md` for `repoctl.config.ts` / `monorepo.config.ts` defaults.
|
|
File without changes
|