@icebreakers/monorepo 4.0.1 → 4.0.2
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 +30 -30
- package/dist/{commands-ikcXv_mG.mjs → commands-DMDl__jL.mjs} +6 -6
- package/dist/{config-BGCo7USv.mjs → config-itCaAICn.mjs} +5 -2
- package/dist/{create-flow-DDlO-uio.mjs → create-flow-D0_9kaqA.mjs} +3 -3
- package/dist/index.mjs +5 -5
- package/dist/{tooling-DyUe-eiv.mjs → tooling-cxnXmQex.mjs} +1 -1
- package/dist/tooling-entry.mjs +1 -1
- package/dist/{types-CveZChKu.mjs → types-C8ml9Ztb.mjs} +2 -2
- package/dist/{workspace-DS6LAL71.mjs → workspace-BVfGk4Av.mjs} +6 -1
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as logger, g as fs, r as cliName, t as initToolingTargets, u as version } from "./types-
|
|
1
|
+
import { d as logger, g as fs, r as cliName, t as initToolingTargets, u as version } from "./types-C8ml9Ztb.mjs";
|
|
2
2
|
import path from "pathe";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import os from "node:os";
|
|
@@ -8,8 +8,8 @@ import { Command } from "commander";
|
|
|
8
8
|
async function handleAiPromptCreate(cwd, opts) {
|
|
9
9
|
const [{ input }, { createTimestampFolderName, defaultAgenticBaseDir, generateAgenticTemplate, generateAgenticTemplates, loadAgenticTasks }, { resolveCommandConfig }] = await Promise.all([
|
|
10
10
|
import("@icebreakers/monorepo-templates"),
|
|
11
|
-
import("./commands-
|
|
12
|
-
import("./config-
|
|
11
|
+
import("./commands-DMDl__jL.mjs").then((n) => n.t),
|
|
12
|
+
import("./config-itCaAICn.mjs").then((n) => n.n)
|
|
13
13
|
]);
|
|
14
14
|
const aiConfig = await resolveCommandConfig("ai", cwd);
|
|
15
15
|
const format = opts.format ?? aiConfig?.format ?? "md";
|
|
@@ -123,7 +123,7 @@ async function emitConfigInspection(inspection, opts, cwd) {
|
|
|
123
123
|
}
|
|
124
124
|
function registerConfigCommands(program, cwd) {
|
|
125
125
|
program.command("config").alias("cfg").description("配置命令").command("inspect").description("输出当前 repoctl 配置文件和已解析配置").alias("i").option("--json", "输出 JSON,方便脚本消费").option("--markdown", "输出 Markdown,方便粘贴到 issue 或 PR").option("--out <file>", "把当前输出写入文件").option("--redact", "脱敏 cwd/configDir/home 绝对路径后再输出").action(async (opts) => {
|
|
126
|
-
const { inspectMonorepoConfig } = await import("./commands-
|
|
126
|
+
const { inspectMonorepoConfig } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
127
127
|
await emitConfigInspection(await inspectMonorepoConfig(cwd), opts, cwd);
|
|
128
128
|
});
|
|
129
129
|
}
|
|
@@ -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("环境命令");
|
|
447
447
|
envCommand.command("info").description("输出当前仓库环境信息").alias("i").option("--json", "输出 JSON,方便脚本消费").option("--markdown", "输出 Markdown,方便粘贴到 issue 或 PR").option("--out <file>", "把当前输出写入文件").option("--redact", "脱敏 workspace/cwd/home 绝对路径后再输出").action(async (opts) => {
|
|
448
|
-
const { collectEnvInfo } = await import("./commands-
|
|
448
|
+
const { collectEnvInfo } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
449
449
|
await emitEnvInfo(await collectEnvInfo(cwd), opts, cwd);
|
|
450
450
|
});
|
|
451
451
|
envCommand.command("snapshot").description("输出排障快照,包含环境、doctor 和 check 计划").alias("s").option("--json", "输出 JSON,方便脚本消费").option("--markdown", "输出 Markdown,方便粘贴到 issue 或 PR").option("--out <file>", "把当前输出写入文件").option("--redact", "脱敏 workspace/cwd/home 绝对路径后再输出").option("--strict", "输出快照后,如果 doctor 有 fail 或 warn 则返回失败码").action(async (opts) => {
|
|
452
|
-
const { collectEnvSnapshot } = await import("./commands-
|
|
452
|
+
const { collectEnvSnapshot } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
453
453
|
await emitEnvSnapshot(await collectEnvSnapshot(cwd), opts, cwd);
|
|
454
454
|
});
|
|
455
455
|
envCommand.command("paths").description("输出当前仓库关键路径和报告建议位置").alias("p").option("--json", "输出 JSON,方便脚本消费").option("--markdown", "输出 Markdown,方便粘贴到 issue 或 PR").option("--out <file>", "把当前输出写入文件").option("--redact", "脱敏 workspace/cwd/home 绝对路径后再输出").action(async (opts) => {
|
|
456
|
-
const { collectEnvPaths } = await import("./commands-
|
|
456
|
+
const { collectEnvPaths } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
457
457
|
await emitEnvPaths(await collectEnvPaths(cwd), opts, cwd);
|
|
458
458
|
});
|
|
459
459
|
envCommand.command("support").description("输出完整排障包,包含环境、路径、配置、doctor 和 check 计划").alias("b").option("--json", "输出 JSON,方便脚本消费").option("--markdown", "输出 Markdown,方便粘贴到 issue 或 PR").option("--out <file>", "把当前输出写入文件").option("--redact", "脱敏 workspace/cwd/home 绝对路径后再输出").option("--strict", "输出排障包后,如果 doctor 有 fail 或 warn 则返回失败码").action(async (opts) => {
|
|
460
|
-
const { collectEnvSupportBundle } = await import("./commands-
|
|
460
|
+
const { collectEnvSupportBundle } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
461
461
|
await emitEnvSupportBundle(await collectEnvSupportBundle(cwd), opts, cwd);
|
|
462
462
|
});
|
|
463
463
|
envCommand.command("mirror").description("设置 VS Code binary mirror").alias("m").action(async () => {
|
|
464
|
-
const { setVscodeBinaryMirror } = await import("./commands-
|
|
464
|
+
const { setVscodeBinaryMirror } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
465
465
|
await setVscodeBinaryMirror(cwd);
|
|
466
466
|
logger.success("env 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("子包命令").command("create").description("创建一个新的子包").alias("new").argument("[name]").option("-t, --template <template>", "直接使用指定模板,跳过模板选择").option("--dry-run", "预览将要创建的目录与 package 信息,不写入文件").option("--json", "以 JSON 输出创建预览,隐含 --dry-run").option("--out <file>", "把创建预览写入文件,隐含 --dry-run").action(async (inputName, opts) => {
|
|
473
|
-
const { runCreateFlow } = await import("./create-flow-
|
|
473
|
+
const { runCreateFlow } = await import("./create-flow-D0_9kaqA.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 } : {},
|
|
@@ -486,7 +486,7 @@ function registerPackageCommands(program, cwd) {
|
|
|
486
486
|
const skillTargets = ["codex", "claude"];
|
|
487
487
|
function registerSkillsCommands(program, cwd) {
|
|
488
488
|
program.command("skills").alias("sk").description("技能工具集").command("sync").description("同步 resources/skills/icebreakers-monorepo-cli 到全局目录").alias("s").option("--codex", "同步到 ~/.codex/skills").option("--claude", "同步到 ~/.claude/skills").option("--all", "同步全部目标").action(async (opts) => {
|
|
489
|
-
const { syncSkills } = await import("./commands-
|
|
489
|
+
const { syncSkills } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
490
490
|
const selected = /* @__PURE__ */ new Set();
|
|
491
491
|
if (opts.all) for (const target of skillTargets) selected.add(target);
|
|
492
492
|
else {
|
|
@@ -606,7 +606,7 @@ function registerTemplatesCommands(program) {
|
|
|
606
606
|
program.command("templates").alias("tpl").description("列出可用的内置模板").argument("[key]", "查看指定模板详情").option("-c, --category <category>", "按模板分类过滤:library / app / service / docs / tool").option("--check", "检查内置模板元数据、目录和临时文件").option("--json", "输出 JSON,方便脚本消费").option("--markdown", "输出 Markdown,方便同步文档").option("--out <file>", "把当前输出写入文件").action(async (key, opts) => {
|
|
607
607
|
const { getTemplateChoice, getTemplateChoices, isTemplateCategory, suggestTemplateKey, templateCategories } = await import("@icebreakers/monorepo-templates");
|
|
608
608
|
if (opts.check) {
|
|
609
|
-
const { checkTemplates } = await import("./commands-
|
|
609
|
+
const { checkTemplates } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
610
610
|
const report = await checkTemplates();
|
|
611
611
|
if (opts.json) await emitTemplateOutput(JSON.stringify(report, null, 2), opts);
|
|
612
612
|
else await emitTemplateOutput(formatTemplateHealthReport(report, !opts.out), opts);
|
|
@@ -685,7 +685,7 @@ function normalizeToolingTargets(tooling) {
|
|
|
685
685
|
function registerToolingCommands(program, cwd) {
|
|
686
686
|
program.command("tooling").alias("tg").description("工程化配置命令").command("init").description(`生成 tooling 配置(可选值:${initToolingTargets.join(", ")})`).alias("i").argument("[tooling...]").option("-a, --all", "生成全部 tooling 配置").option("-f, --force", "覆盖已存在的 tooling 配置文件").action(async (tooling = [], opts) => {
|
|
687
687
|
const normalizedTooling = normalizeToolingTargets(tooling);
|
|
688
|
-
const { initTooling } = await import("./commands-
|
|
688
|
+
const { initTooling } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
689
689
|
await initTooling(cwd, {
|
|
690
690
|
...normalizedTooling ? { targets: normalizedTooling } : {},
|
|
691
691
|
...opts.all !== void 0 ? { all: opts.all } : {},
|
|
@@ -856,7 +856,7 @@ async function emitCheckPlan(plan, opts, cwd) {
|
|
|
856
856
|
}
|
|
857
857
|
function registerTopLevelCommands(program, cwd) {
|
|
858
858
|
program.command("init").description("初始化当前 workspace,并生成推荐配置").alias("setup").option("--preset <preset>", "初始化预设:minimal / standard", "standard").option("-f, --force", "覆盖已存在的 tooling 配置文件").option("--overwrite", "覆盖 setup 管理的已存在文件").option("-y, --yes", "使用默认值跳过所有交互,适合 CI").action(async (opts) => {
|
|
859
|
-
const { init } = await import("./commands-
|
|
859
|
+
const { init } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
860
860
|
await init(cwd, {
|
|
861
861
|
...opts.preset !== void 0 ? { preset: opts.preset } : {},
|
|
862
862
|
...opts.force !== void 0 ? { force: opts.force } : {},
|
|
@@ -867,7 +867,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
867
867
|
logger.info("next: run `pnpm install` and `pnpm build`");
|
|
868
868
|
});
|
|
869
869
|
program.command("new").description("创建新的 package / app").argument("[name]").option("-t, --template <template>", "直接使用指定模板,跳过模板选择").option("--dry-run", "预览将要创建的目录与 package 信息,不写入文件").option("--json", "以 JSON 输出创建预览,隐含 --dry-run").option("--out <file>", "把创建预览写入文件,隐含 --dry-run").action(async (inputName, opts) => {
|
|
870
|
-
const { runCreateFlow } = await import("./create-flow-
|
|
870
|
+
const { runCreateFlow } = await import("./create-flow-D0_9kaqA.mjs");
|
|
871
871
|
const result = await runCreateFlow(cwd, inputName, {
|
|
872
872
|
...opts.template !== void 0 ? { template: opts.template } : {},
|
|
873
873
|
...opts.dryRun || opts.json || opts.out ? { dryRun: true } : {},
|
|
@@ -885,10 +885,10 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
885
885
|
...opts.staged !== void 0 ? { staged: opts.staged } : {},
|
|
886
886
|
...opts.editFile !== void 0 ? { editFile: opts.editFile } : {}
|
|
887
887
|
};
|
|
888
|
-
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-
|
|
888
|
+
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
889
889
|
if (opts.dryRun || opts.json || opts.markdown || opts.out) {
|
|
890
890
|
if (opts.full) {
|
|
891
|
-
const { resolveFullWorkspaceCheckPlan } = await import("./commands-
|
|
891
|
+
const { resolveFullWorkspaceCheckPlan } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
892
892
|
await emitCheckPlan(await resolveFullWorkspaceCheckPlan(cwd), opts, cwd);
|
|
893
893
|
return;
|
|
894
894
|
}
|
|
@@ -899,7 +899,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
899
899
|
logger.success("check finished!");
|
|
900
900
|
});
|
|
901
901
|
program.command("doctor").description("诊断当前仓库是否适合直接开始使用").option("--json", "输出 JSON 报告,方便 CI 或脚本消费").option("--markdown", "输出 Markdown 报告,方便粘贴到 issue 或 PR").option("--out <file>", "把诊断报告写入文件").option("--redact", "脱敏 workspace/cwd/home 绝对路径后再输出").option("--strict", "把 warning 也视为失败,适合 CI 门禁").action(async (opts) => {
|
|
902
|
-
const { runDoctor } = await import("./commands-
|
|
902
|
+
const { runDoctor } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
903
903
|
const report = await runDoctor(cwd);
|
|
904
904
|
await emitDoctorReport(report, opts, cwd);
|
|
905
905
|
if (opts.out || opts.json || opts.markdown) {
|
|
@@ -922,22 +922,22 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
922
922
|
logger.success("doctor finished!");
|
|
923
923
|
});
|
|
924
924
|
program.command("upgrade").description("同步仓库标准资产与脚本").option("-i,--interactive").option("-c,--core", "仅同步核心配置,跳过 GitHub 相关资产").option("--outDir <dir>", "Output directory").option("-s,--skip-overwrite", "skip overwrite").option("-y, --yes", "跳过交互并覆盖 drifted 标准资产").option("--overwrite", "覆盖 drifted 标准资产").option("--no-overwrite", "不覆盖 drifted 标准资产").action(async (opts) => {
|
|
925
|
-
const { upgradeMonorepo } = await import("./commands-
|
|
925
|
+
const { upgradeMonorepo } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
926
926
|
await upgradeMonorepo(normalizeCliOpts(cwd, opts));
|
|
927
927
|
logger.success("upgrade finished!");
|
|
928
928
|
});
|
|
929
929
|
program.command("sync").description("兼容入口:同步仓库标准资产与脚本").option("-i,--interactive").option("-c,--core", "仅同步核心配置,跳过 GitHub 相关资产").option("--outDir <dir>", "Output directory").option("-s,--skip-overwrite", "skip overwrite").option("-y, --yes", "跳过交互并覆盖 drifted 标准资产").option("--overwrite", "覆盖 drifted 标准资产").option("--no-overwrite", "不覆盖 drifted 标准资产").action(async (opts) => {
|
|
930
|
-
const { upgradeMonorepo } = await import("./commands-
|
|
930
|
+
const { upgradeMonorepo } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
931
931
|
await upgradeMonorepo(normalizeCliOpts(cwd, opts));
|
|
932
932
|
logger.success("sync finished!");
|
|
933
933
|
});
|
|
934
934
|
program.command("clean").description("兼容入口:清理选中的 workspace 包").option("-y, --yes", "跳过交互直接清理(等价 autoConfirm)").option("--include-private", "包含 private 包").option("--pinned-version <version>", "覆盖写入的 @icebreakers/monorepo 版本").action(async (opts) => {
|
|
935
|
-
const { cleanProjects } = await import("./commands-
|
|
935
|
+
const { cleanProjects } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
936
936
|
await cleanProjects(cwd, normalizeCleanOptions(opts));
|
|
937
937
|
logger.success("clean finished!");
|
|
938
938
|
});
|
|
939
939
|
program.command("mirror").description("兼容入口:设置 VS Code binary mirror").action(async () => {
|
|
940
|
-
const { setVscodeBinaryMirror } = await import("./commands-
|
|
940
|
+
const { setVscodeBinaryMirror } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
941
941
|
await setVscodeBinaryMirror(cwd);
|
|
942
942
|
logger.success("mirror finished!");
|
|
943
943
|
});
|
|
@@ -947,22 +947,22 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
947
947
|
function registerVerifyCommands(program, cwd) {
|
|
948
948
|
const verifyCommand = program.command("verify").alias("v").description("本地校验工具集");
|
|
949
949
|
verifyCommand.command("pre-push").description("按推送变更范围执行 build/test/tsd 校验").alias("push").action(async () => {
|
|
950
|
-
const { verifyPrePush } = await import("./commands-
|
|
950
|
+
const { verifyPrePush } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
951
951
|
await verifyPrePush({ cwd });
|
|
952
952
|
});
|
|
953
953
|
verifyCommand.command("pre-commit").description("执行 lint-staged 校验").alias("commit").action(async () => {
|
|
954
|
-
const { verifyPreCommit } = await import("./commands-
|
|
954
|
+
const { verifyPreCommit } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
955
955
|
await verifyPreCommit({ cwd });
|
|
956
956
|
});
|
|
957
957
|
verifyCommand.command("commit-msg").description("执行 commitlint 校验").alias("msg").argument("<edit-file>").action(async (editFile) => {
|
|
958
|
-
const { verifyCommitMsg } = await import("./commands-
|
|
958
|
+
const { verifyCommitMsg } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
959
959
|
await verifyCommitMsg({
|
|
960
960
|
cwd,
|
|
961
961
|
editFile
|
|
962
962
|
});
|
|
963
963
|
});
|
|
964
964
|
verifyCommand.command("staged-typecheck").description("按暂存文件所在 workspace 执行 typecheck").alias("tc").argument("[files...]").action(async (files = []) => {
|
|
965
|
-
const { verifyStagedTypecheck } = await import("./commands-
|
|
965
|
+
const { verifyStagedTypecheck } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
966
966
|
verifyStagedTypecheck(files, { cwd });
|
|
967
967
|
});
|
|
968
968
|
}
|
|
@@ -1041,17 +1041,17 @@ async function emitWorkspaceList(result, opts) {
|
|
|
1041
1041
|
function registerWorkspaceCommands(program, cwd) {
|
|
1042
1042
|
const workspaceCommand = program.command("workspace").alias("ws").description("工作区命令");
|
|
1043
1043
|
workspaceCommand.command("upgrade").description("升级/同步 monorepo 相关包").alias("up").option("-i,--interactive").option("-c,--core", "仅同步核心配置,跳过 GitHub 相关资产").option("--outDir <dir>", "Output directory").option("-s,--skip-overwrite", "skip overwrite").option("-y, --yes", "跳过交互并覆盖 drifted 标准资产").option("--overwrite", "覆盖 drifted 标准资产").option("--no-overwrite", "不覆盖 drifted 标准资产").action(async (opts) => {
|
|
1044
|
-
const { upgradeMonorepo } = await import("./commands-
|
|
1044
|
+
const { upgradeMonorepo } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
1045
1045
|
await upgradeMonorepo(normalizeCliOpts(cwd, opts));
|
|
1046
1046
|
logger.success("workspace upgrade finished!");
|
|
1047
1047
|
});
|
|
1048
1048
|
workspaceCommand.command("init").description("初始化工作区元信息(README、package.json、changeset、issue template)").alias("i").action(async () => {
|
|
1049
|
-
const { initMetadata } = await import("./commands-
|
|
1049
|
+
const { initMetadata } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
1050
1050
|
await initMetadata(cwd);
|
|
1051
1051
|
logger.success("workspace init finished!");
|
|
1052
1052
|
});
|
|
1053
1053
|
workspaceCommand.command("list").description("列出 workspace 包").alias("ls").option("--json", "输出 JSON").option("--markdown", "输出 Markdown,方便粘贴到 issue 或 PR").option("--redact", "脱敏 workspace/cwd/home 绝对路径后再输出").option("--include-private", "包含 private 包").option("--include-root", "包含 workspace 根包").option("-p, --pattern <glob>", "追加自定义 workspace glob,可重复", collectValues).option("--out <file>", "把当前列表输出写入文件").action(async (opts) => {
|
|
1054
|
-
const { getWorkspacePackageSummaries } = await import("./workspace-
|
|
1054
|
+
const { getWorkspacePackageSummaries } = await import("./workspace-BVfGk4Av.mjs").then((n) => n.a);
|
|
1055
1055
|
await emitWorkspaceList(await getWorkspacePackageSummaries(cwd, {
|
|
1056
1056
|
ignorePrivatePackage: !opts.includePrivate,
|
|
1057
1057
|
ignoreRootPackage: !opts.includeRoot,
|
|
@@ -1059,7 +1059,7 @@ function registerWorkspaceCommands(program, cwd) {
|
|
|
1059
1059
|
}), opts);
|
|
1060
1060
|
});
|
|
1061
1061
|
workspaceCommand.command("clean").description("清除选中的包").alias("rm").option("-y, --yes", "跳过交互直接清理(等价 autoConfirm)").option("--include-private", "包含 private 包").option("--pinned-version <version>", "覆盖写入的 @icebreakers/monorepo 版本").action(async (opts) => {
|
|
1062
|
-
const { cleanProjects } = await import("./commands-
|
|
1062
|
+
const { cleanProjects } = await import("./commands-DMDl__jL.mjs").then((n) => n.t);
|
|
1063
1063
|
await cleanProjects(cwd, normalizeCleanOptions(opts));
|
|
1064
1064
|
logger.success("workspace clean finished!");
|
|
1065
1065
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-twds-ZHy.mjs";
|
|
2
|
-
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries } from "./workspace-
|
|
3
|
-
import { _ as isIgnorableFsError, c as devDependencies$1, d as logger, g as fs$1, i as packageDir, l as name$1, n as assetsDir, o as templatesDir, s as dependencies, t as initToolingTargets, u as version$1 } from "./types-
|
|
4
|
-
import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getMonorepoConfigCandidates, o as loadMonorepoConfigDetails, s as resolveCommandConfig } from "./config-
|
|
5
|
-
import { f as defineTsconfigConfig } from "./tooling-
|
|
2
|
+
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries } from "./workspace-BVfGk4Av.mjs";
|
|
3
|
+
import { _ as isIgnorableFsError, c as devDependencies$1, d as logger, g as fs$1, i as packageDir, l as name$1, n as assetsDir, o as templatesDir, s as dependencies, t as initToolingTargets, u as version$1 } from "./types-C8ml9Ztb.mjs";
|
|
4
|
+
import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getMonorepoConfigCandidates, o as loadMonorepoConfigDetails, s as resolveCommandConfig } from "./config-itCaAICn.mjs";
|
|
5
|
+
import { f as defineTsconfigConfig } from "./tooling-cxnXmQex.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";
|
|
@@ -1594,7 +1594,7 @@ var devDependencies = {
|
|
|
1594
1594
|
"es-toolkit": "^1.46.1",
|
|
1595
1595
|
"eslint": "^10.3.0",
|
|
1596
1596
|
"husky": "^9.1.7",
|
|
1597
|
-
"lint-staged": "^
|
|
1597
|
+
"lint-staged": "^17.0.2",
|
|
1598
1598
|
"only-allow": "^1.2.2",
|
|
1599
1599
|
"pathe": "^2.0.3",
|
|
1600
1600
|
"pkg-types": "^2.3.1",
|
|
@@ -1619,7 +1619,7 @@ const packageDependencies = {
|
|
|
1619
1619
|
type: "module",
|
|
1620
1620
|
version: "0.0.0",
|
|
1621
1621
|
"private": true,
|
|
1622
|
-
packageManager: "pnpm@10.33.
|
|
1622
|
+
packageManager: "pnpm@10.33.3",
|
|
1623
1623
|
author: "ice breaker <hi@sonofmagic.top>",
|
|
1624
1624
|
repository: {
|
|
1625
1625
|
"type": "git",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-twds-ZHy.mjs";
|
|
2
2
|
import path from "pathe";
|
|
3
|
+
import { realpath } from "node:fs/promises";
|
|
3
4
|
import fs from "node:fs";
|
|
4
5
|
import { loadConfig } from "c12";
|
|
5
6
|
//#region src/core/config.ts
|
|
@@ -40,16 +41,18 @@ async function loadConfigInternal(cwd) {
|
|
|
40
41
|
const repoctlConfigFiles = findConfigFiles(cwd, "repoctl");
|
|
41
42
|
const monorepoConfigFiles = findConfigFiles(cwd, "monorepo");
|
|
42
43
|
if (repoctlConfigFiles.length > 0 && monorepoConfigFiles.length > 0) throw new Error(`Found both repoctl and monorepo config files in ${cwd}. Please keep only one of them. repoctl candidates: ${repoctlConfigFiles.join(", ")}; monorepo candidates: ${monorepoConfigFiles.join(", ")}`);
|
|
44
|
+
const configName = repoctlConfigFiles.length > 0 ? "repoctl" : "monorepo";
|
|
43
45
|
const { config, configFile } = await loadConfig({
|
|
44
|
-
name:
|
|
46
|
+
name: configName,
|
|
45
47
|
cwd,
|
|
46
48
|
rcFile: false,
|
|
47
49
|
defaults: {},
|
|
48
50
|
globalRc: false,
|
|
49
51
|
packageJson: false
|
|
50
52
|
});
|
|
53
|
+
const matchedConfigFile = configFile && fs.existsSync(configFile) ? findConfigFiles(cwd, configName).find((file) => path.basename(file).toLowerCase() === path.basename(configFile).toLowerCase()) : void 0;
|
|
51
54
|
return {
|
|
52
|
-
file: configFile && fs.existsSync(configFile) ?
|
|
55
|
+
file: matchedConfigFile ? await realpath(matchedConfigFile) : configFile && fs.existsSync(configFile) ? await realpath(configFile) : null,
|
|
53
56
|
config: config ?? {}
|
|
54
57
|
};
|
|
55
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as getCreateChoices, g as defaultTemplate, h as createNewProject, y as resolveCreateNewProjectPlan } from "./commands-
|
|
2
|
-
import { d as logger, g as fs } from "./types-
|
|
3
|
-
import { s as resolveCommandConfig } from "./config-
|
|
1
|
+
import { _ as getCreateChoices, g as defaultTemplate, h as createNewProject, y as resolveCreateNewProjectPlan } from "./commands-DMDl__jL.mjs";
|
|
2
|
+
import { d as logger, g as fs } from "./types-C8ml9Ztb.mjs";
|
|
3
|
+
import { s as resolveCommandConfig } from "./config-itCaAICn.mjs";
|
|
4
4
|
import path from "pathe";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { input, select } from "@icebreakers/monorepo-templates";
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as isFileChanged, B as verifyPreCommit, C as getSkillTargetPaths, D as isMatch, E as escapeStringRegexp, F as getKnownRepoCheckCommands, G as generateAgenticTemplate, H as verifyStagedTypecheck, I as resolveFullWorkspaceCheckPlan, J as GitClient, K as generateAgenticTemplates, L as resolveRecommendedCheckPlan, M as toPublishGitignorePath, N as toWorkspaceGitignorePath, O as setByPath, P as updateIssueTemplateConfig, R as runRecommendedCheck, S as cleanProjects, T as syncSkills, U as createTimestampFolderName, V as verifyPrePush, W as defaultAgenticBaseDir, _ as getCreateChoices, a as init, b as templateMap, c as normalizeInitToolingTargets, d as collectEnvPaths, f as collectEnvSnapshot, h as createNewProject, i as setVscodeBinaryMirror, j as isGitignoreFile, k as getFileHash, l as createContext, m as runDoctor, n as upgradeMonorepo, o as initMetadata, p as collectEnvSupportBundle, q as loadAgenticTasks, r as checkTemplates, s as initTooling, u as collectEnvInfo, v as getTemplateMap, w as skillTargets, x as inspectMonorepoConfig, y as resolveCreateNewProjectPlan, z as verifyCommitMsg } from "./commands-
|
|
2
|
-
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries, t as clearWorkspaceCache } from "./workspace-
|
|
3
|
-
import { C as readJson, E as writeJson, S as readJSON, T as writeJSON, _ as isIgnorableFsError, a as rootDir, b as outputJson, d as logger, f as copy, h as exists, i as packageDir, l as name, m as ensureFile, n as assetsDir, o as templatesDir, p as ensureDir, r as cliName, t as initToolingTargets, u as version, v as outputFile, w as remove, x as pathExists, y as outputJSON } from "./types-
|
|
4
|
-
import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getMonorepoConfigCandidates, o as loadMonorepoConfigDetails, r as defineMonorepoConfig, s as resolveCommandConfig, t as configExtensions } from "./config-
|
|
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-
|
|
1
|
+
import { A as isFileChanged, B as verifyPreCommit, C as getSkillTargetPaths, D as isMatch, E as escapeStringRegexp, F as getKnownRepoCheckCommands, G as generateAgenticTemplate, H as verifyStagedTypecheck, I as resolveFullWorkspaceCheckPlan, J as GitClient, K as generateAgenticTemplates, L as resolveRecommendedCheckPlan, M as toPublishGitignorePath, N as toWorkspaceGitignorePath, O as setByPath, P as updateIssueTemplateConfig, R as runRecommendedCheck, S as cleanProjects, T as syncSkills, U as createTimestampFolderName, V as verifyPrePush, W as defaultAgenticBaseDir, _ as getCreateChoices, a as init, b as templateMap, c as normalizeInitToolingTargets, d as collectEnvPaths, f as collectEnvSnapshot, h as createNewProject, i as setVscodeBinaryMirror, j as isGitignoreFile, k as getFileHash, l as createContext, m as runDoctor, n as upgradeMonorepo, o as initMetadata, p as collectEnvSupportBundle, q as loadAgenticTasks, r as checkTemplates, s as initTooling, u as collectEnvInfo, v as getTemplateMap, w as skillTargets, x as inspectMonorepoConfig, y as resolveCreateNewProjectPlan, z as verifyCommitMsg } from "./commands-DMDl__jL.mjs";
|
|
2
|
+
import { i as getWorkspacePackages, n as getWorkspaceData, r as getWorkspacePackageSummaries, t as clearWorkspaceCache } from "./workspace-BVfGk4Av.mjs";
|
|
3
|
+
import { C as readJson, E as writeJson, S as readJSON, T as writeJSON, _ as isIgnorableFsError, a as rootDir, b as outputJson, d as logger, f as copy, h as exists, i as packageDir, l as name, m as ensureFile, n as assetsDir, o as templatesDir, p as ensureDir, r as cliName, t as initToolingTargets, u as version, v as outputFile, w as remove, x as pathExists, y as outputJSON } from "./types-C8ml9Ztb.mjs";
|
|
4
|
+
import { a as loadMonorepoConfig, c as resolveToolingConfig, i as getMonorepoConfigCandidates, o as loadMonorepoConfigDetails, r as defineMonorepoConfig, s as resolveCommandConfig, t as configExtensions } from "./config-itCaAICn.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-cxnXmQex.mjs";
|
|
6
6
|
export { GitClient, assetsDir, checkTemplates, cleanProjects, clearWorkspaceCache, cliName, collectEnvInfo, collectEnvPaths, collectEnvSnapshot, collectEnvSupportBundle, configExtensions, copy, createContext, createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, createNewProject, createTimestampFolderName, defaultAgenticBaseDir, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineMonorepoConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, ensureDir, ensureFile, escapeStringRegexp, exists, generateAgenticTemplate, generateAgenticTemplates, getCreateChoices, getFileHash, getKnownRepoCheckCommands, getMonorepoConfigCandidates, 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, pathExists, readJSON, readJson, remove, 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 };
|
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-cxnXmQex.mjs";
|
|
2
2
|
export { createMonorepoCommitlintConfig, createMonorepoEslintConfig, createMonorepoLintStagedConfig, createMonorepoStylelintConfig, createMonorepoTsconfig, createMonorepoVitestConfig, createMonorepoVitestProjectConfig, defineCommitlintConfig, defineEslintConfig, defineLintStagedConfig, defineStylelintConfig, defineTsconfigConfig, defineVitestConfig, defineVitestProjectConfig, loadMonorepoToolingConfig };
|
|
@@ -142,7 +142,7 @@ const logger = createConsola();
|
|
|
142
142
|
//#endregion
|
|
143
143
|
//#region package.json
|
|
144
144
|
var name = "@icebreakers/monorepo";
|
|
145
|
-
var version = "4.0.
|
|
145
|
+
var version = "4.0.2";
|
|
146
146
|
var dependencies = {
|
|
147
147
|
"@icebreakers/commitlint-config": "^2.0.0",
|
|
148
148
|
"@icebreakers/eslint-config": "^4.0.10",
|
|
@@ -160,7 +160,7 @@ var dependencies = {
|
|
|
160
160
|
"consola": "^3.4.2",
|
|
161
161
|
"git-url-parse": "^16.1.0",
|
|
162
162
|
"klaw": "^4.1.0",
|
|
163
|
-
"lint-staged": "^
|
|
163
|
+
"lint-staged": "^17.0.2",
|
|
164
164
|
"p-queue": "^9.2.0",
|
|
165
165
|
"pathe": "^2.0.3",
|
|
166
166
|
"picocolors": "^1.1.1",
|
|
@@ -22,6 +22,9 @@ function getPatternsCacheKey(patterns) {
|
|
|
22
22
|
function comparePackagePath(left, right) {
|
|
23
23
|
return left.relativeDir.localeCompare(right.relativeDir);
|
|
24
24
|
}
|
|
25
|
+
function getPackageRootDir(project) {
|
|
26
|
+
return normalizeDir(project.rootDirRealPath || project.rootDir);
|
|
27
|
+
}
|
|
25
28
|
async function findWorkspaceDirCached(cwd) {
|
|
26
29
|
const key = normalizeDir(cwd);
|
|
27
30
|
if (!workspaceDirCache.has(key)) workspaceDirCache.set(key, findWorkspaceDir(key));
|
|
@@ -69,9 +72,11 @@ async function getWorkspacePackages(workspaceDir, options) {
|
|
|
69
72
|
if (ignorePrivatePackage && x.manifest.private) return false;
|
|
70
73
|
return true;
|
|
71
74
|
}).map((project) => {
|
|
72
|
-
const
|
|
75
|
+
const rootDir = getPackageRootDir(project);
|
|
76
|
+
const pkgJsonPath = path.resolve(rootDir, "package.json");
|
|
73
77
|
return {
|
|
74
78
|
...project,
|
|
79
|
+
rootDir,
|
|
75
80
|
pkgJsonPath
|
|
76
81
|
};
|
|
77
82
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.2",
|
|
5
5
|
"description": "Core engine and compatibility package behind the repoctl monorepo CLI",
|
|
6
6
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"consola": "^3.4.2",
|
|
75
75
|
"git-url-parse": "^16.1.0",
|
|
76
76
|
"klaw": "^4.1.0",
|
|
77
|
-
"lint-staged": "^
|
|
77
|
+
"lint-staged": "^17.0.2",
|
|
78
78
|
"p-queue": "^9.2.0",
|
|
79
79
|
"pathe": "^2.0.3",
|
|
80
80
|
"picocolors": "^1.1.1",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"simple-git": "^3.36.0",
|
|
83
83
|
"vitest": "~4.1.5",
|
|
84
84
|
"yaml": "^2.8.4",
|
|
85
|
-
"@icebreakers/monorepo-templates": "1.0.
|
|
85
|
+
"@icebreakers/monorepo-templates": "1.0.2"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@types/klaw": "^3.0.7",
|