@icebreakers/monorepo 5.4.7 → 5.4.8
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 +33 -33
- package/dist/{commands-JuSRTiWz.mjs → commands-B2xqW9Ku.mjs} +25 -22
- package/dist/{create-flow-CW47jRpc.mjs → create-flow-j4JOKTf4.mjs} +2 -2
- package/dist/index.d.mts +88 -88
- package/dist/index.mjs +3 -3
- package/dist/{tooling-Cicm3wJh.mjs → tooling-BfXlmCi-.mjs} +2 -1
- package/dist/tooling-entry.mjs +1 -1
- package/dist/{types-X9VO-LVf.mjs → types-2jaUlCDe.mjs} +3 -3
- package/package.json +7 -7
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as fs, d as localize, f as message, h as logger, m as supportedLocales, r as cliName, t as initToolingTargets, u as version } from "./types-
|
|
1
|
+
import { b as fs, d as localize, f as message, h as logger, m as supportedLocales, r as cliName, t as initToolingTargets, u as version } from "./types-2jaUlCDe.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-j4JOKTf4.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.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-B2xqW9Ku.mjs").then((n) => n.t);
|
|
575
575
|
await exitPrerelease({ cwd });
|
|
576
576
|
logger.success(localize("Exited prerelease mode.", "已退出预发布模式。"));
|
|
577
577
|
});
|
|
@@ -582,7 +582,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
582
582
|
const skillTargets = ["codex", "claude"];
|
|
583
583
|
function registerSkillsCommands(program, cwd) {
|
|
584
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/icebreakers-monorepo-cli 到全局目录")).alias("s").option("--codex", localize("Synchronize to ~/.codex/skills", "同步到 ~/.codex/skills")).option("--claude", localize("Synchronize to ~/.claude/skills", "同步到 ~/.claude/skills")).option("--all", localize("Synchronize every target", "同步全部目标")).action(async (opts) => {
|
|
585
|
-
const { syncSkills } = await import("./commands-
|
|
585
|
+
const { syncSkills } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
586
586
|
const selected = /* @__PURE__ */ new Set();
|
|
587
587
|
if (opts.all) for (const target of skillTargets) selected.add(target);
|
|
588
588
|
else {
|
|
@@ -702,7 +702,7 @@ function registerTemplatesCommands(program) {
|
|
|
702
702
|
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
703
|
const { getTemplateChoice, getTemplateChoices, isTemplateCategory, suggestTemplateKey, templateCategories } = await import("@icebreakers/monorepo-templates");
|
|
704
704
|
if (opts.check) {
|
|
705
|
-
const { checkTemplates } = await import("./commands-
|
|
705
|
+
const { checkTemplates } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
706
706
|
const report = await checkTemplates();
|
|
707
707
|
if (opts.json) await emitTemplateOutput(JSON.stringify(report, null, 2), opts);
|
|
708
708
|
else await emitTemplateOutput(formatTemplateHealthReport(report, !opts.out), opts);
|
|
@@ -781,7 +781,7 @@ function normalizeToolingTargets(tooling) {
|
|
|
781
781
|
function registerToolingCommands(program, cwd) {
|
|
782
782
|
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
783
|
const normalizedTooling = normalizeToolingTargets(tooling);
|
|
784
|
-
const { initTooling } = await import("./commands-
|
|
784
|
+
const { initTooling } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
785
785
|
await initTooling(cwd, {
|
|
786
786
|
...normalizedTooling ? { targets: normalizedTooling } : {},
|
|
787
787
|
...opts.all !== void 0 ? { all: opts.all } : {},
|
|
@@ -952,7 +952,7 @@ async function emitCheckPlan(plan, opts, cwd) {
|
|
|
952
952
|
}
|
|
953
953
|
function registerTopLevelCommands(program, cwd) {
|
|
954
954
|
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-
|
|
955
|
+
const { init } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
956
956
|
await init(cwd, {
|
|
957
957
|
...opts.preset !== void 0 ? { preset: opts.preset } : {},
|
|
958
958
|
...opts.force !== void 0 ? { force: opts.force } : {},
|
|
@@ -963,7 +963,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
963
963
|
logger.info(localize("Next: run `pnpm install` and `pnpm build`.", "下一步:运行 `pnpm install` 和 `pnpm build`。"));
|
|
964
964
|
});
|
|
965
965
|
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-
|
|
966
|
+
const { runCreateFlow } = await import("./create-flow-j4JOKTf4.mjs");
|
|
967
967
|
const result = await runCreateFlow(cwd, inputName, {
|
|
968
968
|
...opts.template !== void 0 ? { template: opts.template } : {},
|
|
969
969
|
...opts.dryRun || opts.json || opts.out ? { dryRun: true } : {},
|
|
@@ -981,10 +981,10 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
981
981
|
...opts.staged !== void 0 ? { staged: opts.staged } : {},
|
|
982
982
|
...opts.editFile !== void 0 ? { editFile: opts.editFile } : {}
|
|
983
983
|
};
|
|
984
|
-
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-
|
|
984
|
+
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
985
985
|
if (opts.dryRun || opts.json || opts.markdown || opts.out) {
|
|
986
986
|
if (opts.full) {
|
|
987
|
-
const { resolveFullWorkspaceCheckPlan } = await import("./commands-
|
|
987
|
+
const { resolveFullWorkspaceCheckPlan } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
988
988
|
await emitCheckPlan(await resolveFullWorkspaceCheckPlan(cwd), opts, cwd);
|
|
989
989
|
return;
|
|
990
990
|
}
|
|
@@ -995,7 +995,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
995
995
|
logger.success(localize("Checks finished.", "检查完成。"));
|
|
996
996
|
});
|
|
997
997
|
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-
|
|
998
|
+
const { runDoctor } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
999
999
|
const report = await runDoctor(cwd);
|
|
1000
1000
|
await emitDoctorReport(report, opts, cwd);
|
|
1001
1001
|
if (opts.out || opts.json || opts.markdown) {
|
|
@@ -1018,7 +1018,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
1018
1018
|
logger.success(localize("Doctor finished.", "Doctor 诊断完成。"));
|
|
1019
1019
|
});
|
|
1020
1020
|
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-
|
|
1021
|
+
const { upgradeMonorepo } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1022
1022
|
await upgradeMonorepo(normalizeCliOpts(cwd, opts));
|
|
1023
1023
|
logger.success(localize("Upgrade finished.", "升级完成。"));
|
|
1024
1024
|
});
|
|
@@ -1028,22 +1028,22 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
1028
1028
|
function registerVerifyCommands(program, cwd) {
|
|
1029
1029
|
const verifyCommand = program.command("verify").alias("v").description(localize("Local verification commands", "本地校验工具集"));
|
|
1030
1030
|
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-
|
|
1031
|
+
const { verifyPrePush } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1032
1032
|
await verifyPrePush({ cwd });
|
|
1033
1033
|
});
|
|
1034
1034
|
verifyCommand.command("pre-commit").description(localize("Run lint-staged verification", "执行 lint-staged 校验")).alias("commit").action(async () => {
|
|
1035
|
-
const { verifyPreCommit } = await import("./commands-
|
|
1035
|
+
const { verifyPreCommit } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1036
1036
|
await verifyPreCommit({ cwd });
|
|
1037
1037
|
});
|
|
1038
1038
|
verifyCommand.command("commit-msg").description(localize("Run commitlint verification", "执行 commitlint 校验")).alias("msg").argument("<edit-file>").action(async (editFile) => {
|
|
1039
|
-
const { verifyCommitMsg } = await import("./commands-
|
|
1039
|
+
const { verifyCommitMsg } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1040
1040
|
await verifyCommitMsg({
|
|
1041
1041
|
cwd,
|
|
1042
1042
|
editFile
|
|
1043
1043
|
});
|
|
1044
1044
|
});
|
|
1045
1045
|
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-
|
|
1046
|
+
const { verifyStagedTypecheck } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1047
1047
|
verifyStagedTypecheck(files, { cwd });
|
|
1048
1048
|
});
|
|
1049
1049
|
}
|
|
@@ -1122,12 +1122,12 @@ async function emitWorkspaceList(result, opts) {
|
|
|
1122
1122
|
function registerWorkspaceCommands(program, cwd) {
|
|
1123
1123
|
const workspaceCommand = program.command("workspace").alias("ws").description(localize("Workspace commands", "工作区命令"));
|
|
1124
1124
|
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-
|
|
1125
|
+
const { upgradeMonorepo } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1126
1126
|
await upgradeMonorepo(normalizeCliOpts(cwd, opts));
|
|
1127
1127
|
logger.success(localize("Workspace upgrade finished.", "Workspace 升级完成。"));
|
|
1128
1128
|
});
|
|
1129
1129
|
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-
|
|
1130
|
+
const { initMetadata } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1131
1131
|
await initMetadata(cwd);
|
|
1132
1132
|
logger.success(localize("Workspace initialization finished.", "Workspace 初始化完成。"));
|
|
1133
1133
|
});
|
|
@@ -1140,7 +1140,7 @@ function registerWorkspaceCommands(program, cwd) {
|
|
|
1140
1140
|
}), opts);
|
|
1141
1141
|
});
|
|
1142
1142
|
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-
|
|
1143
|
+
const { cleanProjects } = await import("./commands-B2xqW9Ku.mjs").then((n) => n.t);
|
|
1144
1144
|
await cleanProjects(cwd, normalizeCleanOptions(opts));
|
|
1145
1145
|
logger.success(localize("Workspace cleanup finished.", "Workspace 清理完成。"));
|
|
1146
1146
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
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 fs$1, c as devDependencies$1, d as localize, h as logger, i as packageDir, n as assetsDir, o as templatesDir, p as resolveRepoctlLocale, s as dependencies, t as initToolingTargets, u as version$1, x as isIgnorableFsError } from "./types-
|
|
3
|
+
import { b as fs$1, c as devDependencies$1, d as localize, h as logger, i as packageDir, n as assetsDir, o as templatesDir, p as resolveRepoctlLocale, s as dependencies, t as initToolingTargets, u as version$1, x as isIgnorableFsError } from "./types-2jaUlCDe.mjs";
|
|
4
4
|
import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getRepoctlConfigCandidates, o as loadMonorepoConfigDetails, s as resolveCommandConfig } from "./config-p842Knhq.mjs";
|
|
5
|
-
import { f as defineTsconfigConfig } from "./tooling-
|
|
5
|
+
import { f as defineTsconfigConfig } from "./tooling-BfXlmCi-.mjs";
|
|
6
6
|
import gitUrlParse from "git-url-parse";
|
|
7
7
|
import { simpleGit } from "simple-git";
|
|
8
8
|
import { findWorkspaceDir } from "@pnpm/find-workspace-dir";
|
|
@@ -758,7 +758,8 @@ function mergeCleanConfig(base, overrides) {
|
|
|
758
758
|
*/
|
|
759
759
|
async function cleanProjects(cwd, overrides) {
|
|
760
760
|
const cleanConfig = mergeCleanConfig(await resolveCommandConfig("clean", cwd), overrides);
|
|
761
|
-
const
|
|
761
|
+
const workspaceOptions = cleanConfig?.includePrivate ?? true ? { ignorePrivatePackage: false } : void 0;
|
|
762
|
+
const { packages, workspaceDir } = await getWorkspaceData(cwd, workspaceOptions);
|
|
762
763
|
const filteredPackages = packages.filter((pkg) => {
|
|
763
764
|
const name = pkg.manifest.name ?? "";
|
|
764
765
|
if (!name) return true;
|
|
@@ -1832,18 +1833,18 @@ var devDependencies = {
|
|
|
1832
1833
|
"@types/lodash-es": "^4.17.12",
|
|
1833
1834
|
"@types/micromatch": "^4.0.10",
|
|
1834
1835
|
"@icebreakers/monorepo": "workspace:*",
|
|
1835
|
-
"@types/node": "^26.
|
|
1836
|
+
"@types/node": "^26.5.0",
|
|
1836
1837
|
"@types/semver": "^7.8.0",
|
|
1837
1838
|
"@types/set-value": "^4.0.3",
|
|
1838
|
-
"@typescript-eslint/types": "^8.
|
|
1839
|
-
"@unocss/eslint-plugin": "66.
|
|
1839
|
+
"@typescript-eslint/types": "^8.70.0",
|
|
1840
|
+
"@unocss/eslint-plugin": "66.10.0",
|
|
1840
1841
|
"@vitest/coverage-v8": "~5.0.0",
|
|
1841
1842
|
"astro-eslint-parser": "^3.1.0",
|
|
1842
1843
|
"ci-info": "^4.4.0",
|
|
1843
1844
|
"cross-env": "^10.1.0",
|
|
1844
1845
|
"defu": "^6.1.7",
|
|
1845
1846
|
"es-toolkit": "^1.52.0",
|
|
1846
|
-
"eslint": "^10.
|
|
1847
|
+
"eslint": "^10.10.0",
|
|
1847
1848
|
"eslint-plugin-astro": "^3.1.0",
|
|
1848
1849
|
"eslint-plugin-mdx": "3.8.1",
|
|
1849
1850
|
"eslint-plugin-svelte": "^3.23.0",
|
|
@@ -1853,24 +1854,24 @@ var devDependencies = {
|
|
|
1853
1854
|
"get-value": "^4.1.0",
|
|
1854
1855
|
"husky": "^9.1.7",
|
|
1855
1856
|
"jiti": "^2.7.0",
|
|
1856
|
-
"lint-staged": "^17.
|
|
1857
|
+
"lint-staged": "^17.5.0",
|
|
1857
1858
|
"lodash": "^4.18.1",
|
|
1858
1859
|
"lodash-es": "^4.18.1",
|
|
1859
1860
|
"micromatch": "^4.0.8",
|
|
1860
1861
|
"only-allow": "^1.2.2",
|
|
1861
1862
|
"pathe": "^2.0.3",
|
|
1862
|
-
"pkg-types": "^2.3.
|
|
1863
|
+
"pkg-types": "^2.3.3",
|
|
1863
1864
|
"prettier": "^3.9.6",
|
|
1864
1865
|
"prettier-plugin-astro": "^0.14.1",
|
|
1865
1866
|
"repoctl": "workspace:*",
|
|
1866
1867
|
"rimraf": "^6.1.3",
|
|
1867
1868
|
"set-value": "^4.1.0",
|
|
1868
|
-
"stylelint": "^17.
|
|
1869
|
+
"stylelint": "^17.15.0",
|
|
1869
1870
|
"svelte": "^5.57.0",
|
|
1870
1871
|
"svelte-eslint-parser": "^1.8.1",
|
|
1871
1872
|
"tailwindcss": "^4.3.3",
|
|
1872
1873
|
"tsd": "^0.33.0",
|
|
1873
|
-
"tsdown": "0.
|
|
1874
|
+
"tsdown": "0.23.0",
|
|
1874
1875
|
"tslib": "^2.8.1",
|
|
1875
1876
|
"tsx": "^4.23.13",
|
|
1876
1877
|
"turbo": "^2.10.12",
|
|
@@ -1889,7 +1890,7 @@ const packageDependencies = {
|
|
|
1889
1890
|
type: "module",
|
|
1890
1891
|
version: "0.0.0",
|
|
1891
1892
|
"private": true,
|
|
1892
|
-
packageManager: "pnpm@
|
|
1893
|
+
packageManager: "pnpm@12.3.4",
|
|
1893
1894
|
description: "Source workspace for repoctl and Icebreaker's shared development packages",
|
|
1894
1895
|
author: "ice breaker <hi@sonofmagic.top>",
|
|
1895
1896
|
homepage: "https://repoctl.icebreaker.top",
|
|
@@ -4427,16 +4428,18 @@ async function upgradeMonorepo(opts) {
|
|
|
4427
4428
|
const configTargets = upgradeConfig?.targets ?? [];
|
|
4428
4429
|
const mergeTargets = upgradeConfig?.mergeTargets;
|
|
4429
4430
|
let targets = configTargets.length ? mergeTargets === false ? [...configTargets] : [.../* @__PURE__ */ new Set([...baseTargets, ...configTargets])] : baseTargets;
|
|
4430
|
-
if (merged.interactive)
|
|
4431
|
-
|
|
4432
|
-
|
|
4433
|
-
|
|
4434
|
-
|
|
4435
|
-
|
|
4436
|
-
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
|
|
4431
|
+
if (merged.interactive) {
|
|
4432
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) logger.info(localize("Skipped interactive target selection in non-interactive mode.", "非交互模式下跳过交互式目标选择。"));
|
|
4433
|
+
else targets = await checkbox({
|
|
4434
|
+
message: localize("Select the files you need", "选择你需要的文件"),
|
|
4435
|
+
choices: targets.map((x) => {
|
|
4436
|
+
return {
|
|
4437
|
+
value: x,
|
|
4438
|
+
checked: true
|
|
4439
|
+
};
|
|
4440
|
+
})
|
|
4441
|
+
});
|
|
4442
|
+
}
|
|
4440
4443
|
const regexpArr = targets.map((x) => {
|
|
4441
4444
|
return new RegExp(`^${escapeStringRegexp(x)}`);
|
|
4442
4445
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as getCreateChoices, M as resolveCreateNewProjectPlan, O as createNewProject, k as defaultTemplate } from "./commands-
|
|
2
|
-
import { b as fs, d as localize, h as logger } from "./types-
|
|
1
|
+
import { A as getCreateChoices, M as resolveCreateNewProjectPlan, O as createNewProject, k as defaultTemplate } from "./commands-B2xqW9Ku.mjs";
|
|
2
|
+
import { b as fs, d as localize, h as logger } from "./types-2jaUlCDe.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
|
@@ -9,22 +9,22 @@ import crypto from "node:crypto";
|
|
|
9
9
|
type RepoctlLocale = 'en' | 'zh-CN';
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/types/package-json.d.ts
|
|
12
|
-
interface PackageJsonPerson {
|
|
12
|
+
export interface PackageJsonPerson {
|
|
13
13
|
name?: string;
|
|
14
14
|
email?: string;
|
|
15
15
|
url?: string;
|
|
16
16
|
}
|
|
17
|
-
interface PackageJsonRepository {
|
|
17
|
+
export interface PackageJsonRepository {
|
|
18
18
|
type?: string;
|
|
19
19
|
url?: string;
|
|
20
20
|
directory?: string;
|
|
21
21
|
}
|
|
22
|
-
interface PackageJsonBugs {
|
|
22
|
+
export interface PackageJsonBugs {
|
|
23
23
|
url?: string;
|
|
24
24
|
email?: string;
|
|
25
25
|
}
|
|
26
|
-
type PackageJsonExports = unknown;
|
|
27
|
-
interface PackageJson extends Record<string, unknown> {
|
|
26
|
+
export type PackageJsonExports = unknown;
|
|
27
|
+
export interface PackageJson extends Record<string, unknown> {
|
|
28
28
|
name?: string;
|
|
29
29
|
version?: string;
|
|
30
30
|
private?: boolean;
|
|
@@ -51,7 +51,7 @@ interface PackageJson extends Record<string, unknown> {
|
|
|
51
51
|
/**
|
|
52
52
|
* 工作区工具可接收的筛选选项。
|
|
53
53
|
*/
|
|
54
|
-
interface GetWorkspacePackagesOptions {
|
|
54
|
+
export interface GetWorkspacePackagesOptions {
|
|
55
55
|
/**
|
|
56
56
|
* 是否在结果中排除 workspace 根包。
|
|
57
57
|
* @default true
|
|
@@ -71,7 +71,7 @@ interface GetWorkspacePackagesOptions {
|
|
|
71
71
|
/**
|
|
72
72
|
* 兼容 pnpm workspace manifest 的轻量结构。
|
|
73
73
|
*/
|
|
74
|
-
interface WorkspacePackageManifest {
|
|
74
|
+
export interface WorkspacePackageManifest {
|
|
75
75
|
name?: string;
|
|
76
76
|
version?: string;
|
|
77
77
|
private?: boolean;
|
|
@@ -80,7 +80,7 @@ interface WorkspacePackageManifest {
|
|
|
80
80
|
/**
|
|
81
81
|
* 轻量的 workspace package 结构,避免导出类型泄漏到 pnpm 内部实现细节。
|
|
82
82
|
*/
|
|
83
|
-
interface WorkspacePackage {
|
|
83
|
+
export interface WorkspacePackage {
|
|
84
84
|
rootDir: string;
|
|
85
85
|
rootDirRealPath: string;
|
|
86
86
|
modulesDir?: string;
|
|
@@ -90,13 +90,13 @@ interface WorkspacePackage {
|
|
|
90
90
|
/**
|
|
91
91
|
* 附加 package.json 绝对路径后的 workspace package。
|
|
92
92
|
*/
|
|
93
|
-
interface WorkspacePackageWithJsonPath extends WorkspacePackage {
|
|
93
|
+
export interface WorkspacePackageWithJsonPath extends WorkspacePackage {
|
|
94
94
|
pkgJsonPath: string;
|
|
95
95
|
}
|
|
96
96
|
/**
|
|
97
97
|
* 适合 CLI 与 JSON 输出消费的 workspace package 摘要。
|
|
98
98
|
*/
|
|
99
|
-
interface WorkspacePackageSummary {
|
|
99
|
+
export interface WorkspacePackageSummary {
|
|
100
100
|
name?: string;
|
|
101
101
|
description?: string;
|
|
102
102
|
private: boolean;
|
|
@@ -107,7 +107,7 @@ interface WorkspacePackageSummary {
|
|
|
107
107
|
/**
|
|
108
108
|
* workspace package 摘要集合。
|
|
109
109
|
*/
|
|
110
|
-
interface WorkspacePackageSummaryData {
|
|
110
|
+
export interface WorkspacePackageSummaryData {
|
|
111
111
|
cwd: string;
|
|
112
112
|
workspaceDir: string;
|
|
113
113
|
packages: WorkspacePackageSummary[];
|
|
@@ -115,7 +115,7 @@ interface WorkspacePackageSummaryData {
|
|
|
115
115
|
/**
|
|
116
116
|
* 工作区基础信息与包集合。
|
|
117
117
|
*/
|
|
118
|
-
interface WorkspaceData {
|
|
118
|
+
export interface WorkspaceData {
|
|
119
119
|
cwd: string;
|
|
120
120
|
workspaceDir: string;
|
|
121
121
|
packages: WorkspacePackageWithJsonPath[];
|
|
@@ -141,10 +141,10 @@ interface RecommendedCheckPlan {
|
|
|
141
141
|
mode: RecommendedCheckMode;
|
|
142
142
|
commands: RecommendedCheckPlanCommand[];
|
|
143
143
|
}
|
|
144
|
-
declare function resolveRecommendedCheckPlan(options: RecommendedCheckOptions): RecommendedCheckPlan;
|
|
145
|
-
declare function getKnownRepoCheckCommands(): Set<string>;
|
|
146
|
-
declare function resolveFullWorkspaceCheckPlan(cwd: string): Promise<RecommendedCheckPlan>;
|
|
147
|
-
declare function runRecommendedCheck(options: RecommendedCheckOptions): Promise<void>;
|
|
144
|
+
export declare function resolveRecommendedCheckPlan(options: RecommendedCheckOptions): RecommendedCheckPlan;
|
|
145
|
+
export declare function getKnownRepoCheckCommands(): Set<string>;
|
|
146
|
+
export declare function resolveFullWorkspaceCheckPlan(cwd: string): Promise<RecommendedCheckPlan>;
|
|
147
|
+
export declare function runRecommendedCheck(options: RecommendedCheckOptions): Promise<void>;
|
|
148
148
|
//#endregion
|
|
149
149
|
//#region src/commands/config.d.ts
|
|
150
150
|
interface ConfigInspection {
|
|
@@ -152,7 +152,7 @@ interface ConfigInspection {
|
|
|
152
152
|
file: string | null;
|
|
153
153
|
config: MonorepoConfig;
|
|
154
154
|
}
|
|
155
|
-
declare function inspectMonorepoConfig(cwd: string): Promise<ConfigInspection>;
|
|
155
|
+
export declare function inspectMonorepoConfig(cwd: string): Promise<ConfigInspection>;
|
|
156
156
|
//#endregion
|
|
157
157
|
//#region src/commands/doctor/types.d.ts
|
|
158
158
|
type DoctorStatus = 'pass' | 'warn' | 'fail';
|
|
@@ -177,7 +177,7 @@ interface DoctorReport {
|
|
|
177
177
|
}
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region src/commands/doctor/index.d.ts
|
|
180
|
-
declare function runDoctor(cwd: string): Promise<{
|
|
180
|
+
export declare function runDoctor(cwd: string): Promise<{
|
|
181
181
|
cwd: string;
|
|
182
182
|
workspaceDir: string;
|
|
183
183
|
packageCount: number;
|
|
@@ -232,10 +232,10 @@ interface EnvPaths {
|
|
|
232
232
|
checkPlanReport: EnvPathEntry;
|
|
233
233
|
};
|
|
234
234
|
}
|
|
235
|
-
declare function collectEnvInfo(cwd: string): Promise<EnvInfo>;
|
|
236
|
-
declare function collectEnvPaths(cwd: string): Promise<EnvPaths>;
|
|
237
|
-
declare function collectEnvSnapshot(cwd: string, now?: Date): Promise<EnvSnapshot>;
|
|
238
|
-
declare function collectEnvSupportBundle(cwd: string, now?: Date): Promise<EnvSupportBundle>;
|
|
235
|
+
export declare function collectEnvInfo(cwd: string): Promise<EnvInfo>;
|
|
236
|
+
export declare function collectEnvPaths(cwd: string): Promise<EnvPaths>;
|
|
237
|
+
export declare function collectEnvSnapshot(cwd: string, now?: Date): Promise<EnvSnapshot>;
|
|
238
|
+
export declare function collectEnvSupportBundle(cwd: string, now?: Date): Promise<EnvSupportBundle>;
|
|
239
239
|
//#endregion
|
|
240
240
|
//#region src/commands/release/notes/model.d.ts
|
|
241
241
|
type ReleaseCategory = 'breaking' | 'features' | 'fixes' | 'performance' | 'docs' | 'maintenance' | 'other';
|
|
@@ -345,12 +345,12 @@ declare class ReleaseCommandError extends Error {
|
|
|
345
345
|
}
|
|
346
346
|
//#endregion
|
|
347
347
|
//#region src/commands/release/github/client.d.ts
|
|
348
|
-
declare class GitHubApiError extends ReleaseCommandError {
|
|
348
|
+
export declare class GitHubApiError extends ReleaseCommandError {
|
|
349
349
|
readonly status: number;
|
|
350
350
|
readonly responseBody?: string | undefined;
|
|
351
351
|
constructor(message: string, status: number, responseBody?: string | undefined);
|
|
352
352
|
}
|
|
353
|
-
declare class GitHubClient implements GitHubOperations {
|
|
353
|
+
export declare class GitHubClient implements GitHubOperations {
|
|
354
354
|
private readonly token;
|
|
355
355
|
private readonly repository;
|
|
356
356
|
private readonly apiUrl;
|
|
@@ -394,12 +394,12 @@ interface PublishedPackage {
|
|
|
394
394
|
//#region src/commands/release/ci.d.ts
|
|
395
395
|
declare function createReleasePullRequest(options: ReleaseCiOptions): Promise<boolean>;
|
|
396
396
|
declare function recoverUnpublished(options: ReleaseCiOptions): Promise<PublishedPackage[]>;
|
|
397
|
-
declare function releaseCi(options: ReleaseCiOptions): Promise<PublishedPackage[] | undefined>;
|
|
397
|
+
export declare function releaseCi(options: ReleaseCiOptions): Promise<PublishedPackage[] | undefined>;
|
|
398
398
|
//#endregion
|
|
399
399
|
//#region src/commands/release/prerelease.d.ts
|
|
400
|
-
declare function releasePrerelease(options: ReleaseOptions): Promise<PublishedPackage[] | undefined>;
|
|
401
|
-
declare function enterPrerelease(tag: string, options: ReleaseOptions): Promise<void>;
|
|
402
|
-
declare function exitPrerelease(options: ReleaseOptions): Promise<void>;
|
|
400
|
+
export declare function releasePrerelease(options: ReleaseOptions): Promise<PublishedPackage[] | undefined>;
|
|
401
|
+
export declare function enterPrerelease(tag: string, options: ReleaseOptions): Promise<void>;
|
|
402
|
+
export declare function exitPrerelease(options: ReleaseOptions): Promise<void>;
|
|
403
403
|
//#endregion
|
|
404
404
|
//#region src/commands/release/repair.d.ts
|
|
405
405
|
interface RepairReleaseNotesOptions extends ReleaseOptions {
|
|
@@ -408,25 +408,25 @@ interface RepairReleaseNotesOptions extends ReleaseOptions {
|
|
|
408
408
|
dryRun?: boolean;
|
|
409
409
|
github?: Pick<GitHubOperations, 'listReleases' | 'updateRelease' | 'readReleasePullRequestContributors'>;
|
|
410
410
|
}
|
|
411
|
-
declare function repairReleaseNotes(options: RepairReleaseNotesOptions): Promise<{
|
|
411
|
+
export declare function repairReleaseNotes(options: RepairReleaseNotesOptions): Promise<{
|
|
412
412
|
repaired: string[];
|
|
413
413
|
skipped: string[];
|
|
414
414
|
}>;
|
|
415
415
|
//#endregion
|
|
416
416
|
//#region src/commands/release/shared.d.ts
|
|
417
|
-
declare function parsePublishSummary(content: string): PublishedPackage[];
|
|
417
|
+
export declare function parsePublishSummary(content: string): PublishedPackage[];
|
|
418
418
|
//#endregion
|
|
419
419
|
//#region src/commands/release/stable.d.ts
|
|
420
|
-
declare function prepareStable(options: ReleaseOptions): Promise<boolean>;
|
|
421
|
-
declare function publishStable(options: ReleaseOptions): Promise<PublishedPackage[]>;
|
|
420
|
+
export declare function prepareStable(options: ReleaseOptions): Promise<boolean>;
|
|
421
|
+
export declare function publishStable(options: ReleaseOptions): Promise<PublishedPackage[]>;
|
|
422
422
|
/** Compatibility entry point retained for existing generated repositories. */
|
|
423
|
-
declare function releaseStable(options: ReleaseOptions): Promise<PublishedPackage[]>;
|
|
423
|
+
export declare function releaseStable(options: ReleaseOptions): Promise<PublishedPackage[]>;
|
|
424
424
|
//#endregion
|
|
425
425
|
//#region src/commands/skills.d.ts
|
|
426
426
|
/**
|
|
427
427
|
* 当前支持的 skills 同步目标。
|
|
428
428
|
*/
|
|
429
|
-
declare const skillTargets: readonly ["codex", "claude"];
|
|
429
|
+
export declare const skillTargets: readonly ["codex", "claude"];
|
|
430
430
|
type SkillTarget = typeof skillTargets[number];
|
|
431
431
|
interface SyncSkillsOptions {
|
|
432
432
|
/**
|
|
@@ -447,14 +447,14 @@ interface SyncSkillsOptions {
|
|
|
447
447
|
*
|
|
448
448
|
* @param homeDir 用户 home 目录,默认取 `os.homedir()`
|
|
449
449
|
*/
|
|
450
|
-
declare function getSkillTargetPaths(homeDir?: string): Record<SkillTarget, string>;
|
|
450
|
+
export declare function getSkillTargetPaths(homeDir?: string): Record<SkillTarget, string>;
|
|
451
451
|
/**
|
|
452
452
|
* 将内置 skills 同步到一个或多个目标平台目录。
|
|
453
453
|
*
|
|
454
454
|
* @param options 同步选项
|
|
455
455
|
* @returns 成功同步的目标及落盘路径列表
|
|
456
456
|
*/
|
|
457
|
-
declare function syncSkills(options?: SyncSkillsOptions): Promise<{
|
|
457
|
+
export declare function syncSkills(options?: SyncSkillsOptions): Promise<{
|
|
458
458
|
target: SkillTarget;
|
|
459
459
|
dest: string;
|
|
460
460
|
}[]>;
|
|
@@ -483,7 +483,7 @@ interface TemplateHealthReport {
|
|
|
483
483
|
interface CheckTemplatesOptions {
|
|
484
484
|
templatesDir?: string;
|
|
485
485
|
}
|
|
486
|
-
declare function checkTemplates(options?: CheckTemplatesOptions): Promise<TemplateHealthReport>;
|
|
486
|
+
export declare function checkTemplates(options?: CheckTemplatesOptions): Promise<TemplateHealthReport>;
|
|
487
487
|
//#endregion
|
|
488
488
|
//#region src/commands/verify/index.d.ts
|
|
489
489
|
interface VerifyCommandOptions {
|
|
@@ -552,7 +552,7 @@ interface PreCommitVerifyOptions extends VerifyCommandOptions {
|
|
|
552
552
|
* @param options pre-push 运行参数
|
|
553
553
|
* @returns Promise<void>
|
|
554
554
|
*/
|
|
555
|
-
declare function verifyPrePush(options?: PrePushVerifyOptions): Promise<void>;
|
|
555
|
+
export declare function verifyPrePush(options?: PrePushVerifyOptions): Promise<void>;
|
|
556
556
|
/**
|
|
557
557
|
* 对暂存区中涉及类型检查的文件,按最近的 workspace 归属执行 `typecheck`。
|
|
558
558
|
*
|
|
@@ -561,7 +561,7 @@ declare function verifyPrePush(options?: PrePushVerifyOptions): Promise<void>;
|
|
|
561
561
|
* @param stagedFiles 暂存区文件路径列表
|
|
562
562
|
* @param options 运行参数
|
|
563
563
|
*/
|
|
564
|
-
declare function verifyStagedTypecheck(stagedFiles: string[], options?: StagedTypecheckOptions): void;
|
|
564
|
+
export declare function verifyStagedTypecheck(stagedFiles: string[], options?: StagedTypecheckOptions): void;
|
|
565
565
|
/**
|
|
566
566
|
* 执行 commit-msg 校验。
|
|
567
567
|
*
|
|
@@ -570,7 +570,7 @@ declare function verifyStagedTypecheck(stagedFiles: string[], options?: StagedTy
|
|
|
570
570
|
*
|
|
571
571
|
* @param options commit-msg 运行参数
|
|
572
572
|
*/
|
|
573
|
-
declare function verifyCommitMsg(options: CommitMsgVerifyOptions): Promise<void>;
|
|
573
|
+
export declare function verifyCommitMsg(options: CommitMsgVerifyOptions): Promise<void>;
|
|
574
574
|
/**
|
|
575
575
|
* 执行 pre-commit 校验。
|
|
576
576
|
*
|
|
@@ -579,13 +579,13 @@ declare function verifyCommitMsg(options: CommitMsgVerifyOptions): Promise<void>
|
|
|
579
579
|
*
|
|
580
580
|
* @param options pre-commit 运行参数
|
|
581
581
|
*/
|
|
582
|
-
declare function verifyPreCommit(options?: PreCommitVerifyOptions): Promise<void>;
|
|
582
|
+
export declare function verifyPreCommit(options?: PreCommitVerifyOptions): Promise<void>;
|
|
583
583
|
//#endregion
|
|
584
584
|
//#region src/core/git.d.ts
|
|
585
585
|
/**
|
|
586
586
|
* 对 simple-git 的轻量封装,集中处理配置缓存与常用查询。
|
|
587
587
|
*/
|
|
588
|
-
declare class GitClient {
|
|
588
|
+
export declare class GitClient {
|
|
589
589
|
#private;
|
|
590
590
|
private readonly client;
|
|
591
591
|
constructor(options?: Partial<SimpleGitOptions>);
|
|
@@ -629,7 +629,7 @@ declare class GitClient {
|
|
|
629
629
|
* 普通 CLI 命令执行后进程会退出;长期运行的集成测试或程序化调用在修改
|
|
630
630
|
* `pnpm-workspace.yaml` / package 目录后,可以调用它让后续扫描重新读磁盘。
|
|
631
631
|
*/
|
|
632
|
-
declare function clearWorkspaceCache(): void;
|
|
632
|
+
export declare function clearWorkspaceCache(): void;
|
|
633
633
|
/**
|
|
634
634
|
* 读取 pnpm workspace 下的所有包,并根据选项做过滤。
|
|
635
635
|
*
|
|
@@ -641,64 +641,64 @@ declare function clearWorkspaceCache(): void;
|
|
|
641
641
|
* @param options 过滤选项
|
|
642
642
|
* @returns 带有 `pkgJsonPath` 字段的 workspace package 列表
|
|
643
643
|
*/
|
|
644
|
-
declare function getWorkspacePackages(workspaceDir: string, options?: GetWorkspacePackagesOptions): Promise<WorkspacePackageWithJsonPath[]>;
|
|
644
|
+
export declare function getWorkspacePackages(workspaceDir: string, options?: GetWorkspacePackagesOptions): Promise<WorkspacePackageWithJsonPath[]>;
|
|
645
645
|
/**
|
|
646
646
|
* 一次性返回 `cwd`、真实 `workspaceDir` 与过滤后的包列表。
|
|
647
647
|
*
|
|
648
648
|
* @param cwd 当前工作目录
|
|
649
649
|
* @param options 传给 `getWorkspacePackages()` 的过滤选项
|
|
650
650
|
*/
|
|
651
|
-
declare function getWorkspaceData(cwd: string, options?: GetWorkspacePackagesOptions): Promise<WorkspaceData>;
|
|
651
|
+
export declare function getWorkspaceData(cwd: string, options?: GetWorkspacePackagesOptions): Promise<WorkspaceData>;
|
|
652
652
|
/**
|
|
653
653
|
* 返回适合展示和程序化消费的 workspace package 摘要。
|
|
654
654
|
*/
|
|
655
|
-
declare function getWorkspacePackageSummaries(cwd: string, options?: GetWorkspacePackagesOptions): Promise<WorkspacePackageSummaryData>;
|
|
655
|
+
export declare function getWorkspacePackageSummaries(cwd: string, options?: GetWorkspacePackagesOptions): Promise<WorkspacePackageSummaryData>;
|
|
656
656
|
//#endregion
|
|
657
657
|
//#region src/commands/clean.d.ts
|
|
658
658
|
/**
|
|
659
659
|
* 交互式清理被选中的包目录,同时重写根 package.json 中的 repoctl 版本。
|
|
660
660
|
*/
|
|
661
|
-
declare function cleanProjects(cwd: string, overrides?: Partial<CleanCommandConfig>): Promise<void>;
|
|
661
|
+
export declare function cleanProjects(cwd: string, overrides?: Partial<CleanCommandConfig>): Promise<void>;
|
|
662
662
|
//#endregion
|
|
663
663
|
//#region src/commands/mirror/binaryMirror.d.ts
|
|
664
664
|
/**
|
|
665
665
|
* 根据中国大陆镜像源,自动向 VSCode settings.json 注入终端环境变量。
|
|
666
666
|
*/
|
|
667
|
-
declare function setVscodeBinaryMirror(cwd: string): Promise<void>;
|
|
667
|
+
export declare function setVscodeBinaryMirror(cwd: string): Promise<void>;
|
|
668
668
|
//#endregion
|
|
669
669
|
//#region src/commands/upgrade/index.d.ts
|
|
670
670
|
/**
|
|
671
671
|
* 将 assets 目录的模版文件同步到工程中,实现一键升级脚手架能力。
|
|
672
672
|
*/
|
|
673
|
-
declare function upgradeMonorepo(opts: CliOpts): Promise<void>;
|
|
673
|
+
export declare function upgradeMonorepo(opts: CliOpts): Promise<void>;
|
|
674
674
|
//#endregion
|
|
675
675
|
//#region package.json.d.ts
|
|
676
676
|
declare let name: string;
|
|
677
|
-
declare let version: string;
|
|
677
|
+
export declare let version: string;
|
|
678
678
|
//#endregion
|
|
679
679
|
//#region src/constants.d.ts
|
|
680
680
|
/**
|
|
681
681
|
* 用户默认看到的 CLI 名称,帮助文案和生成脚本都统一引导到 repo。
|
|
682
682
|
*/
|
|
683
|
-
declare const cliName = "repo";
|
|
683
|
+
export declare const cliName = "repo";
|
|
684
684
|
/**
|
|
685
685
|
* @icebreakers/monorepo 包的根目录。
|
|
686
686
|
*/
|
|
687
|
-
declare const packageDir: string;
|
|
688
|
-
declare const assetsDir: string;
|
|
689
|
-
declare const templatesDir: string;
|
|
687
|
+
export declare const packageDir: string;
|
|
688
|
+
export declare const assetsDir: string;
|
|
689
|
+
export declare const templatesDir: string;
|
|
690
690
|
/**
|
|
691
691
|
* monorepo 根目录,方便需要跳出当前包的逻辑(例如定位工作区文件)。
|
|
692
692
|
*/
|
|
693
|
-
declare const rootDir: string;
|
|
693
|
+
export declare const rootDir: string;
|
|
694
694
|
//#endregion
|
|
695
695
|
//#region src/core/config.d.ts
|
|
696
|
-
interface LoadedMonorepoConfig {
|
|
696
|
+
export interface LoadedMonorepoConfig {
|
|
697
697
|
file: string | null;
|
|
698
698
|
config: MonorepoConfig;
|
|
699
699
|
}
|
|
700
|
-
declare const configExtensions: readonly ["ts", "mts", "cts", "js", "mjs", "cjs"];
|
|
701
|
-
declare function getRepoctlConfigCandidates(cwd: string): string[];
|
|
700
|
+
export declare const configExtensions: readonly ["ts", "mts", "cts", "js", "mjs", "cjs"];
|
|
701
|
+
export declare function getRepoctlConfigCandidates(cwd: string): string[];
|
|
702
702
|
/**
|
|
703
703
|
* 为 `repoctl.config.ts` 提供类型提示的辅助函数。
|
|
704
704
|
*
|
|
@@ -717,21 +717,21 @@ declare function getRepoctlConfigCandidates(cwd: string): string[];
|
|
|
717
717
|
* })
|
|
718
718
|
* ```
|
|
719
719
|
*/
|
|
720
|
-
declare function defineMonorepoConfig(config: MonorepoConfig): MonorepoConfig;
|
|
720
|
+
export declare function defineMonorepoConfig(config: MonorepoConfig): MonorepoConfig;
|
|
721
721
|
/**
|
|
722
722
|
* 加载配置对象和实际命中的配置文件路径,供诊断和脚本集成使用。
|
|
723
723
|
*
|
|
724
724
|
* @param cwd 配置文件解析起点
|
|
725
725
|
* @returns 配置文件路径和解析后的配置对象;未找到时 file 为 null、config 为空对象
|
|
726
726
|
*/
|
|
727
|
-
declare function loadMonorepoConfigDetails(cwd: string): Promise<LoadedMonorepoConfig>;
|
|
727
|
+
export declare function loadMonorepoConfigDetails(cwd: string): Promise<LoadedMonorepoConfig>;
|
|
728
728
|
/**
|
|
729
729
|
* 加载指定目录的 `repoctl.config.*`,并在当前进程内做内存缓存。
|
|
730
730
|
*
|
|
731
731
|
* @param cwd 配置文件解析起点
|
|
732
732
|
* @returns 解析后的配置对象;未找到时返回空对象
|
|
733
733
|
*/
|
|
734
|
-
declare function loadMonorepoConfig(cwd: string): Promise<MonorepoConfig>;
|
|
734
|
+
export declare function loadMonorepoConfig(cwd: string): Promise<MonorepoConfig>;
|
|
735
735
|
/**
|
|
736
736
|
* 获取单个命令对应的配置块。
|
|
737
737
|
*
|
|
@@ -739,17 +739,17 @@ declare function loadMonorepoConfig(cwd: string): Promise<MonorepoConfig>;
|
|
|
739
739
|
* @param cwd 配置文件解析起点
|
|
740
740
|
* @returns 对应命令配置;未配置时返回空对象
|
|
741
741
|
*/
|
|
742
|
-
declare function resolveCommandConfig<Name extends keyof NonNullable<MonorepoConfig['commands']>>(name: Name, cwd: string): Promise<NonNullable<MonorepoConfig['commands']>[Name]>;
|
|
742
|
+
export declare function resolveCommandConfig<Name extends keyof NonNullable<MonorepoConfig['commands']>>(name: Name, cwd: string): Promise<NonNullable<MonorepoConfig['commands']>[Name]>;
|
|
743
743
|
/**
|
|
744
744
|
* 获取 `repoctl.config.ts` 中完整的 `tooling` 配置块。
|
|
745
745
|
*
|
|
746
746
|
* @param cwd 配置文件解析起点
|
|
747
747
|
* @returns `tooling` 配置;未配置时返回空对象
|
|
748
748
|
*/
|
|
749
|
-
declare function resolveToolingConfig(cwd: string): Promise<NonNullable<MonorepoConfig['tooling']>>;
|
|
749
|
+
export declare function resolveToolingConfig(cwd: string): Promise<NonNullable<MonorepoConfig['tooling']>>;
|
|
750
750
|
//#endregion
|
|
751
751
|
//#region src/core/context.d.ts
|
|
752
|
-
interface Context {
|
|
752
|
+
export interface Context {
|
|
753
753
|
cwd: string;
|
|
754
754
|
git: GitClient;
|
|
755
755
|
gitUrl: Awaited<ReturnType<GitClient['getGitUrl']>>;
|
|
@@ -762,19 +762,19 @@ interface Context {
|
|
|
762
762
|
/**
|
|
763
763
|
* 构建命令执行上下文,封装常用的工作区、Git、配置等信息。
|
|
764
764
|
*/
|
|
765
|
-
declare function createContext(cwd: string): Promise<Context>;
|
|
765
|
+
export declare function createContext(cwd: string): Promise<Context>;
|
|
766
766
|
//#endregion
|
|
767
767
|
//#region src/core/logger.d.ts
|
|
768
768
|
/**
|
|
769
769
|
* 统一的日志实例,便于在命令行中输出带有前缀和颜色的消息。
|
|
770
770
|
*/
|
|
771
|
-
declare const logger: import("consola").ConsolaInstance;
|
|
771
|
+
export declare const logger: import("consola").ConsolaInstance;
|
|
772
772
|
//#endregion
|
|
773
773
|
//#region src/utils/fs.d.ts
|
|
774
774
|
/**
|
|
775
775
|
* JSON 输出选项。
|
|
776
776
|
*/
|
|
777
|
-
interface JsonWriteOptions {
|
|
777
|
+
export interface JsonWriteOptions {
|
|
778
778
|
/**
|
|
779
779
|
* `JSON.stringify` 缩进空格数。
|
|
780
780
|
* @default undefined
|
|
@@ -787,69 +787,69 @@ interface JsonWriteOptions {
|
|
|
787
787
|
* @param targetPath 目标路径
|
|
788
788
|
* @returns 存在时返回 `true`
|
|
789
789
|
*/
|
|
790
|
-
declare function pathExists(targetPath: string): Promise<boolean>;
|
|
790
|
+
export declare function pathExists(targetPath: string): Promise<boolean>;
|
|
791
791
|
/**
|
|
792
792
|
* `pathExists()` 的别名。
|
|
793
793
|
*/
|
|
794
|
-
declare const exists: typeof pathExists;
|
|
794
|
+
export declare const exists: typeof pathExists;
|
|
795
795
|
/**
|
|
796
796
|
* 递归创建目录。
|
|
797
797
|
*/
|
|
798
|
-
declare function ensureDir(targetPath: string): Promise<void>;
|
|
798
|
+
export declare function ensureDir(targetPath: string): Promise<void>;
|
|
799
799
|
/**
|
|
800
800
|
* 确保文件存在;若父目录不存在会自动创建。
|
|
801
801
|
*/
|
|
802
|
-
declare function ensureFile(targetPath: string): Promise<void>;
|
|
802
|
+
export declare function ensureFile(targetPath: string): Promise<void>;
|
|
803
803
|
/**
|
|
804
804
|
* 递归删除文件或目录。
|
|
805
805
|
*
|
|
806
806
|
* 默认启用 `force: true`、`recursive: true`,并带少量重试。
|
|
807
807
|
*/
|
|
808
|
-
declare function remove(targetPath: string): Promise<void>;
|
|
808
|
+
export declare function remove(targetPath: string): Promise<void>;
|
|
809
809
|
/**
|
|
810
810
|
* 递归复制文件或目录。
|
|
811
811
|
*/
|
|
812
|
-
declare function copy(sourcePath: string, targetPath: string): Promise<void>;
|
|
812
|
+
export declare function copy(sourcePath: string, targetPath: string): Promise<void>;
|
|
813
813
|
/**
|
|
814
814
|
* 自动创建父目录后写入文件。
|
|
815
815
|
*/
|
|
816
|
-
declare function outputFile(targetPath: string, data: Parameters<typeof writeFile>[1], options?: Parameters<typeof writeFile>[2]): Promise<void>;
|
|
816
|
+
export declare function outputFile(targetPath: string, data: Parameters<typeof writeFile>[1], options?: Parameters<typeof writeFile>[2]): Promise<void>;
|
|
817
817
|
/**
|
|
818
818
|
* 读取 JSON 文件并解析。
|
|
819
819
|
*/
|
|
820
|
-
declare function readJson<T = any>(targetPath: string): Promise<T>;
|
|
820
|
+
export declare function readJson<T = any>(targetPath: string): Promise<T>;
|
|
821
821
|
/**
|
|
822
822
|
* `readJson()` 的别名。
|
|
823
823
|
*/
|
|
824
|
-
declare const readJSON: typeof readJson;
|
|
824
|
+
export declare const readJSON: typeof readJson;
|
|
825
825
|
/**
|
|
826
826
|
* 写入 JSON 文件,不会自动创建父目录。
|
|
827
827
|
*/
|
|
828
|
-
declare function writeJson(targetPath: string, data: unknown, options?: JsonWriteOptions): Promise<void>;
|
|
828
|
+
export declare function writeJson(targetPath: string, data: unknown, options?: JsonWriteOptions): Promise<void>;
|
|
829
829
|
/**
|
|
830
830
|
* `writeJson()` 的别名。
|
|
831
831
|
*/
|
|
832
|
-
declare const writeJSON: typeof writeJson;
|
|
832
|
+
export declare const writeJSON: typeof writeJson;
|
|
833
833
|
/**
|
|
834
834
|
* 自动创建父目录后写入 JSON 文件。
|
|
835
835
|
*/
|
|
836
|
-
declare function outputJson(targetPath: string, data: unknown, options?: JsonWriteOptions): Promise<void>;
|
|
836
|
+
export declare function outputJson(targetPath: string, data: unknown, options?: JsonWriteOptions): Promise<void>;
|
|
837
837
|
/**
|
|
838
838
|
* `outputJson()` 的别名。
|
|
839
839
|
*/
|
|
840
|
-
declare const outputJSON: typeof outputJson;
|
|
840
|
+
export declare const outputJSON: typeof outputJson;
|
|
841
841
|
/**
|
|
842
842
|
* 判断是否为可忽略的文件系统错误。
|
|
843
843
|
* - ENOENT: 文件已被删除
|
|
844
844
|
* - EBUSY: Windows 中资源被系统占用
|
|
845
845
|
*/
|
|
846
|
-
declare function isIgnorableFsError(error: unknown): error is NodeJS.ErrnoException;
|
|
846
|
+
export declare function isIgnorableFsError(error: unknown): error is NodeJS.ErrnoException;
|
|
847
847
|
//#endregion
|
|
848
848
|
//#region src/utils/github.d.ts
|
|
849
849
|
/**
|
|
850
850
|
* 将 Issue 模版里的 discussions 链接同步为当前仓库的 discussions 地址。
|
|
851
851
|
*/
|
|
852
|
-
declare function updateIssueTemplateConfig(source: string, repoName?: string): string;
|
|
852
|
+
export declare function updateIssueTemplateConfig(source: string, repoName?: string): string;
|
|
853
853
|
//#endregion
|
|
854
854
|
//#region src/utils/hash.d.ts
|
|
855
855
|
/**
|
|
@@ -858,7 +858,7 @@ declare function updateIssueTemplateConfig(source: string, repoName?: string): s
|
|
|
858
858
|
* @param data 任意 `crypto.BinaryLike` 内容
|
|
859
859
|
* @returns 32 位十六进制 md5 字符串
|
|
860
860
|
*/
|
|
861
|
-
declare function getFileHash(data: crypto.BinaryLike): string;
|
|
861
|
+
export declare function getFileHash(data: crypto.BinaryLike): string;
|
|
862
862
|
/**
|
|
863
863
|
* 对比两段内容的 md5,判断内容是否发生变化。
|
|
864
864
|
*
|
|
@@ -866,20 +866,20 @@ declare function getFileHash(data: crypto.BinaryLike): string;
|
|
|
866
866
|
* @param dest 旧内容
|
|
867
867
|
* @returns 两者 md5 不一致时返回 `true`
|
|
868
868
|
*/
|
|
869
|
-
declare function isFileChanged(src: crypto.BinaryLike, dest: crypto.BinaryLike): boolean;
|
|
869
|
+
export declare function isFileChanged(src: crypto.BinaryLike, dest: crypto.BinaryLike): boolean;
|
|
870
870
|
//#endregion
|
|
871
871
|
//#region src/utils/object.d.ts
|
|
872
872
|
type PathInput = readonly string[] | string;
|
|
873
|
-
declare function setByPath(target: Record<PropertyKey, any>, path: PathInput, value: unknown): Record<PropertyKey, any>;
|
|
873
|
+
export declare function setByPath(target: Record<PropertyKey, any>, path: PathInput, value: unknown): Record<PropertyKey, any>;
|
|
874
874
|
//#endregion
|
|
875
875
|
//#region src/utils/regexp.d.ts
|
|
876
876
|
/**
|
|
877
877
|
* 逃逸正则表达式中所有特殊字符,避免被当做模式解析。
|
|
878
878
|
*/
|
|
879
|
-
declare function escapeStringRegexp(str: string): string;
|
|
879
|
+
export declare function escapeStringRegexp(str: string): string;
|
|
880
880
|
/**
|
|
881
881
|
* 判断字符串是否命中任意一个正则,用于过滤要同步的资产文件。
|
|
882
882
|
*/
|
|
883
|
-
declare function isMatch(str: string, arr: RegExp[]): boolean;
|
|
883
|
+
export declare function isMatch(str: string, arr: RegExp[]): boolean;
|
|
884
884
|
//#endregion
|
|
885
|
-
export { type AgenticTemplateFormat, type AgenticTemplateTask, AiCommandConfig, type CheckTemplatesOptions, CleanCommandConfig, CliOpts, type CommitMsgVerifyOptions, CommitlintToolingConfig, type ConfigInspection, type ConfigValues,
|
|
885
|
+
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 };
|
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-B2xqW9Ku.mjs";
|
|
2
2
|
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries, t as clearWorkspaceCache } from "./workspace-MCKewElu.mjs";
|
|
3
|
-
import { A as writeJson, C as outputJSON, D as readJson, E as readJSON, O as remove, S as outputFile, T as pathExists, _ as ensureDir, a as rootDir, g as copy, h as logger, i as packageDir, k as writeJSON, l as name, n as assetsDir, o as templatesDir, r as cliName, t as initToolingTargets, u as version, v as ensureFile, w as outputJson, x as isIgnorableFsError, y as exists } from "./types-
|
|
3
|
+
import { A as writeJson, C as outputJSON, D as readJson, E as readJSON, O as remove, S as outputFile, T as pathExists, _ as ensureDir, a as rootDir, g as copy, h as logger, i as packageDir, k as writeJSON, l as name, n as assetsDir, o as templatesDir, r as cliName, t as initToolingTargets, u as version, v as ensureFile, w as outputJson, x as isIgnorableFsError, y as exists } from "./types-2jaUlCDe.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
|
-
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-
|
|
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 };
|
|
@@ -124,7 +124,8 @@ function mergeTsconfig(base, override) {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
function loadBundledTsconfig() {
|
|
127
|
-
|
|
127
|
+
const configContent = fs.readFileSync(monorepoTsconfigPath, "utf8");
|
|
128
|
+
return parse(configContent);
|
|
128
129
|
}
|
|
129
130
|
/**
|
|
130
131
|
* 基于 `@icebreakers/commitlint-config` 创建 commitlint 配置。
|
package/dist/tooling-entry.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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";
|
|
2
2
|
export { createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, loadMonorepoToolingConfig };
|
|
@@ -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.4.
|
|
346
|
+
var version = "5.4.8";
|
|
347
347
|
var dependencies = {
|
|
348
348
|
"@icebreakers/commitlint-config": "workspace:*",
|
|
349
349
|
"@icebreakers/eslint-config": "workspace:*",
|
|
@@ -352,7 +352,7 @@ var dependencies = {
|
|
|
352
352
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
353
353
|
"@pnpm/logger": "^1100.0.0",
|
|
354
354
|
"@pnpm/types": "^1102.1.0",
|
|
355
|
-
"@pnpm/worker": "^1100.4.
|
|
355
|
+
"@pnpm/worker": "^1100.4.1",
|
|
356
356
|
"@pnpm/workspace.find-packages": "^1000.0.65",
|
|
357
357
|
"@pnpm/workspace.read-manifest": "^1000.3.1",
|
|
358
358
|
"c12": "^3.3.4",
|
|
@@ -361,7 +361,7 @@ var dependencies = {
|
|
|
361
361
|
"consola": "^3.4.2",
|
|
362
362
|
"git-url-parse": "^16.1.0",
|
|
363
363
|
"klaw": "^4.1.0",
|
|
364
|
-
"lint-staged": "^17.
|
|
364
|
+
"lint-staged": "^17.5.0",
|
|
365
365
|
"p-queue": "^9.3.3",
|
|
366
366
|
"pathe": "^2.0.3",
|
|
367
367
|
"picocolors": "^1.1.1",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.4.
|
|
4
|
+
"version": "5.4.8",
|
|
5
5
|
"description": "Core engine and programmatic APIs for repoctl",
|
|
6
6
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@commitlint/cli": "^21.2.2",
|
|
59
59
|
"eslint": "^9.0.0 || ^10.0.0",
|
|
60
|
-
"stylelint": "^17.
|
|
60
|
+
"stylelint": "^17.15.0",
|
|
61
61
|
"typescript": "^5.0.0 || ^6.0.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependenciesMeta": {
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@icebreakers/commitlint-config": "4.0.6",
|
|
79
|
-
"@icebreakers/eslint-config": "7.1.
|
|
80
|
-
"@icebreakers/monorepo-templates": "1.3.
|
|
81
|
-
"@icebreakers/stylelint-config": "5.0.
|
|
79
|
+
"@icebreakers/eslint-config": "7.1.3",
|
|
80
|
+
"@icebreakers/monorepo-templates": "1.3.4",
|
|
81
|
+
"@icebreakers/stylelint-config": "5.0.9",
|
|
82
82
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|
|
83
83
|
"@pnpm/logger": "^1100.0.0",
|
|
84
84
|
"@pnpm/types": "^1102.1.0",
|
|
85
|
-
"@pnpm/worker": "^1100.4.
|
|
85
|
+
"@pnpm/worker": "^1100.4.1",
|
|
86
86
|
"@pnpm/workspace.find-packages": "^1000.0.65",
|
|
87
87
|
"@pnpm/workspace.read-manifest": "^1000.3.1",
|
|
88
88
|
"c12": "^3.3.4",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"consola": "^3.4.2",
|
|
92
92
|
"git-url-parse": "^16.1.0",
|
|
93
93
|
"klaw": "^4.1.0",
|
|
94
|
-
"lint-staged": "^17.
|
|
94
|
+
"lint-staged": "^17.5.0",
|
|
95
95
|
"p-queue": "^9.3.3",
|
|
96
96
|
"pathe": "^2.0.3",
|
|
97
97
|
"picocolors": "^1.1.1",
|