@icebreakers/monorepo 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{baseline-B6uEfHrm.mjs → baseline-Dpdng8Pw.mjs} +1 -1
- package/dist/{catalog-YipXrou_.mjs → catalog-A1_tGyBz.mjs} +3 -3
- package/dist/cli.mjs +186 -115
- package/dist/{commands-D1KtdxnV.mjs → commands-C8PiGh9h.mjs} +1507 -149
- package/dist/{config--wYfkdsO.mjs → config-CtnhpveO.mjs} +3 -3
- package/dist/{create-flow-D3ZzvBw6.mjs → create-flow-CqtNwZs7.mjs} +3 -3
- package/dist/{deps-qu9CwEKc.mjs → deps-CFZftEq2.mjs} +3 -3
- package/dist/docs-context-entry.d.mts +25 -0
- package/dist/docs-context-entry.mjs +88 -0
- package/dist/{execute-DP6M6JqN.mjs → execute-Brlvq-TY.mjs} +2 -2
- package/dist/{execute-BVtr43XS.mjs → execute-DE3pJ4nx.mjs} +2 -2
- package/dist/{format-VPlFgfoH.mjs → format-BXQ2yRvk.mjs} +1 -1
- package/dist/{index-DewDhzGv.d.mts → index-BJaI8Sig.d.mts} +170 -2
- package/dist/index.d.mts +45 -116
- package/dist/index.mjs +10 -10
- package/dist/{inputs-B_-kWnm2.mjs → inputs-DRWom7Va.mjs} +1 -1
- package/dist/{npm-S2sT1UgC.mjs → npm-CrQi6Gci.mjs} +1 -1
- package/dist/{plan-DuHMR5Za.mjs → plan-DT1Gz8tE.mjs} +1 -1
- package/dist/{run-BGHVj0Lj.mjs → run-BBf92Scj.mjs} +4 -4
- package/dist/{save-UiJgdSaY.mjs → save-CCCUswjG.mjs} +3 -3
- package/dist/{scan-Bg1EPIk6.mjs → scan-KcMaJTx2.mjs} +5 -4
- package/dist/{template-drift-BOk4oxoR.mjs → template-drift-BKCMx9vC.mjs} +3 -3
- package/dist/tooling-entry.d.mts +1 -1
- package/dist/tooling-entry.mjs +2 -2
- package/dist/{transaction-Cg5I2q47.mjs → transaction-CTFrGYJO.mjs} +2 -2
- package/dist/{tsconfig-rZG7b9Ul.mjs → tsconfig-CO_6DRDo.mjs} +127 -42
- package/dist/{vitest-BbbU7-qn.mjs → vitest-Deitv0TQ.mjs} +1 -1
- package/dist/{workspace-tasks--x70rhb8.mjs → workspace-tasks-CbetXdoh.mjs} +6 -6
- package/package.json +8 -3
- package/resources/maintenance/validate.mjs +14 -0
- package/resources/skills/repoctl/references/commands.md +36 -0
- package/resources/skills/repoctl/references/config.md +10 -1
- package/resources/skills/repoctl/references/dependencies.md +2 -0
- package/resources/skills/repoctl/references/templates.md +6 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ct as message, Et as supportedLocales, J as getWorkspaceGraph, Q as whyWorkspaceDependency, St as localize, Ut as getWorkspaceData, Z as getWorkspaceImpact, a as inspectWorkspaceOwners, i as planCodeowners, jt as fs$1, n as locateWorkspace, r as applyCodeownersPlan, t as getWorkspaceTaskCatalog, vt as cliName, wt as repoctlLocale } from "./workspace-tasks
|
|
2
|
-
import { d as logger } from "./execute-
|
|
3
|
-
import { A as applyInstallSecurityPreset, B as
|
|
4
|
-
import {
|
|
5
|
-
import { s as resolveCommandValues } from "./scan-
|
|
6
|
-
import { E as checkDependencyAdmission, T as checkWorkspaceBoundaries, f as inspectInstallSecurity } from "./template-drift-
|
|
1
|
+
import { Ct as message, Et as supportedLocales, J as getWorkspaceGraph, Q as whyWorkspaceDependency, St as localize, Ut as getWorkspaceData, Z as getWorkspaceImpact, a as inspectWorkspaceOwners, i as planCodeowners, jt as fs$1, n as locateWorkspace, r as applyCodeownersPlan, t as getWorkspaceTaskCatalog, vt as cliName, wt as repoctlLocale } from "./workspace-tasks-CbetXdoh.mjs";
|
|
2
|
+
import { d as logger } from "./execute-DE3pJ4nx.mjs";
|
|
3
|
+
import { A as applyInstallSecurityPreset, B as formatPublicApiReport, Bt as sanitizeConfigReport, C as getMaintenanceWorkflow, D as planOrganizationPresetAssets, E as applyOrganizationPresetAssets, F as checkPeerDependencies, Ft as resolveTemplateCatalog, H as formatUpgradePlan, It as loadTemplateCatalogContext, L as checkPublicApi, M as deployDocs, N as DocsDeploymentError, Nt as resolveRemoteTemplateSource, P as planDocsDeployment, Pt as createTemplateCatalog, R as applyPublicApiUpdate, S as checkPackages, Tt as applyUpgradePlan, V as upgradeMonorepo, Vt as validateConfigFile, a as planWorkspaceMove, b as applyProjectReferencesPlan, c as applyToolingCapability, ct as resolveReleaseMode, d as planTemplateValidation, f as createReleasePlan, g as releaseSnapshot, h as formatNightlySummary, ht as initToolingTargets, i as applyWorkspaceMovePlan, j as planInstallSecurityPreset, l as planToolingCapability, lt as renderReleasePullRequest, m as releaseNightly, n as applyWorkspaceRemovalPlan, o as applyWorkspaceArtifactPlan, r as planWorkspaceRemoval, s as planWorkspaceArtifact, st as parsePublishSummary, u as validateTemplate, v as checkProjectReferences, w as prepareMaintenanceUpgrade, wt as planUpgrade, x as planProjectReferences, y as syncProjectReferences, z as planPublicApiUpdate, zt as explainMonorepoConfig } from "./commands-C8PiGh9h.mjs";
|
|
4
|
+
import { K as withLegacyHookConfig, N as ConfigValidationError, S as canonicalDirectory, Z as splitConfigPath, _ as listToolingCapabilities, d as loadMonorepoConfig, f as loadMonorepoConfigDetails, j as version, p as resolveCommandConfig } from "./tsconfig-CO_6DRDo.mjs";
|
|
5
|
+
import { s as resolveCommandValues } from "./scan-KcMaJTx2.mjs";
|
|
6
|
+
import { E as checkDependencyAdmission, T as checkWorkspaceBoundaries, f as inspectInstallSecurity } from "./template-drift-BKCMx9vC.mjs";
|
|
7
7
|
import { findWorkspaceDir } from "@pnpm/find-workspace-dir";
|
|
8
8
|
import path from "pathe";
|
|
9
9
|
import process from "node:process";
|
|
@@ -50,8 +50,8 @@ function reportCliFailure(error) {
|
|
|
50
50
|
async function handleAiPromptCreate(cwd, opts) {
|
|
51
51
|
const [{ input }, { createTimestampFolderName, defaultAgenticBaseDir, generateAgenticTemplate, generateAgenticTemplates, loadAgenticTasks }, { resolveCommandConfig }] = await Promise.all([
|
|
52
52
|
import("@icebreakers/monorepo-templates"),
|
|
53
|
-
import("./commands-
|
|
54
|
-
import("./tsconfig-
|
|
53
|
+
import("./commands-C8PiGh9h.mjs").then((n) => n.t),
|
|
54
|
+
import("./tsconfig-CO_6DRDo.mjs").then((n) => n.c)
|
|
55
55
|
]);
|
|
56
56
|
const aiConfig = await resolveCommandConfig("ai", cwd);
|
|
57
57
|
const resolved = resolveCommandValues("ai", aiConfig, {
|
|
@@ -165,7 +165,7 @@ function formatConfigInspection(inspection) {
|
|
|
165
165
|
...(inspection.layers ?? []).map((layer) => `layer: ${layer.source.kind === "preset" ? `${layer.source.packageName}@${layer.source.version}` : layer.source.file ?? "project"}`)
|
|
166
166
|
].join("\n");
|
|
167
167
|
}
|
|
168
|
-
function formatMarkdownTable$
|
|
168
|
+
function formatMarkdownTable$4(rows) {
|
|
169
169
|
const formatCell = (value) => String(value ?? "-").split("|").join("\\|").split("\n").join("<br>");
|
|
170
170
|
return [
|
|
171
171
|
localize("| Field | Value |", "| 字段 | 值 |"),
|
|
@@ -179,7 +179,7 @@ function formatConfigInspectionMarkdown(inspection) {
|
|
|
179
179
|
return [
|
|
180
180
|
localize("# Repo config inspection", "# Repo 配置检查"),
|
|
181
181
|
"",
|
|
182
|
-
formatMarkdownTable$
|
|
182
|
+
formatMarkdownTable$4([
|
|
183
183
|
["cwd", inspection.cwd],
|
|
184
184
|
["file", inspection.file ?? "-"],
|
|
185
185
|
["commands", commandKeys.length],
|
|
@@ -240,7 +240,7 @@ function registerConfigCommands(program, cwd) {
|
|
|
240
240
|
if (!report.valid) throw new ConfigValidationError(report.diagnostics);
|
|
241
241
|
await emitConfigInspection(report, opts, cwd, report);
|
|
242
242
|
} else {
|
|
243
|
-
const { inspectMonorepoConfig } = await import("./commands-
|
|
243
|
+
const { inspectMonorepoConfig } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
244
244
|
await emitConfigInspection(await inspectMonorepoConfig(cwd), opts, cwd);
|
|
245
245
|
}
|
|
246
246
|
} catch (error) {
|
|
@@ -293,7 +293,7 @@ const output$2 = (value) => process.stdout.write(`${JSON.stringify(value, null,
|
|
|
293
293
|
function registerCatalogCommands(deps, cwd) {
|
|
294
294
|
const catalog = deps.command("catalog").description(localize("Inspect pnpm catalogs and review coordinated migrations", "巡检 pnpm catalog 并审阅联动迁移"));
|
|
295
295
|
catalog.command("check").description(localize("Inspect references, usage and direct-version bypasses without writing", "只读巡检引用、使用情况和直接版本绕过")).option("--catalog <name>", localize("Catalog policy for direct declarations and migration candidates", "直接声明与迁移候选所采用的 catalog 策略"), "default").option("--json", localize("Output a versioned catalog report", "输出有版本结构的 catalog 报告")).action(async (options) => {
|
|
296
|
-
const { checkCatalogs } = await import("./catalog-
|
|
296
|
+
const { checkCatalogs } = await import("./catalog-A1_tGyBz.mjs").then((n) => n.t);
|
|
297
297
|
const report = await checkCatalogs(cwd, options);
|
|
298
298
|
if (options.json) output$2(report);
|
|
299
299
|
else {
|
|
@@ -303,7 +303,7 @@ function registerCatalogCommands(deps, cwd) {
|
|
|
303
303
|
if (report.summary.missing || report.summary.direct) process.exitCode = 1;
|
|
304
304
|
});
|
|
305
305
|
catalog.command("plan").description(localize("Preview catalog YAML and consumer manifest changes without writing", "只读预览 catalog YAML 与消费者清单的联动变更")).argument("<dependency>", localize("Dependency to migrate", "待迁移依赖")).requiredOption("--section <section>", localize("Dependency section; peer ranges remain unchanged", "依赖分区;peer 范围保留原样")).option("--catalog <name>", localize("Default or named catalog", "默认或命名 catalog"), "default").option("--group <name>", localize("Configured dependency version group", "已配置的依赖版本组"), "default").option("--to <specifier>", localize("Explicit common subrange for non-equivalent declarations", "不等价声明的明确共同子范围")).option("--dry-run", localize("Preview only (the default)", "仅预览(默认行为)")).option("--json", localize("Output a reviewed plan for catalog apply", "输出可审阅并交给 catalog apply 的计划")).action(async (dependency, options) => {
|
|
306
|
-
const { planCatalogMigration } = await import("./catalog-
|
|
306
|
+
const { planCatalogMigration } = await import("./catalog-A1_tGyBz.mjs").then((n) => n.t);
|
|
307
307
|
const plan = await planCatalogMigration(cwd, {
|
|
308
308
|
dependency,
|
|
309
309
|
...options
|
|
@@ -315,7 +315,7 @@ function registerCatalogCommands(deps, cwd) {
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
catalog.command("apply").description(localize("Apply a reviewed catalog migration with conflict checks and rollback", "应用已审阅的 catalog 迁移,检查冲突并支持失败恢复")).argument("<plan>", localize("Reviewed JSON plan", "已审阅的 JSON 计划")).option("--json", localize("Output the apply result as JSON", "以 JSON 输出应用结果")).action(async (file, options) => {
|
|
318
|
-
const { applyCatalogMigrationPlan } = await import("./catalog-
|
|
318
|
+
const { applyCatalogMigrationPlan } = await import("./catalog-A1_tGyBz.mjs").then((n) => n.t);
|
|
319
319
|
const result = await applyCatalogMigrationPlan(cwd, JSON.parse(await readFile(file, "utf8")));
|
|
320
320
|
if (options.json) output$2(result);
|
|
321
321
|
else process.stdout.write(`${result.status}: ${result.changed.join(", ")}\n${result.nextSteps.join("\n")}\n`);
|
|
@@ -342,7 +342,7 @@ function registerDepsCommands(program, cwd) {
|
|
|
342
342
|
registerDependencyAdmission(deps, cwd);
|
|
343
343
|
registerCatalogCommands(deps, cwd);
|
|
344
344
|
deps.command("check").description(localize("Check dependency consistency without writing or accessing registries", "只读检查依赖版本一致性,不访问 registry")).option("--json", localize("Output the dependency report as JSON", "以 JSON 输出依赖报告")).action(async (options) => {
|
|
345
|
-
const { checkDependencies } = await import("./deps-
|
|
345
|
+
const { checkDependencies } = await import("./deps-CFZftEq2.mjs").then((n) => n.n);
|
|
346
346
|
const report = await checkDependencies(cwd);
|
|
347
347
|
if (options.json) output$1(report);
|
|
348
348
|
else for (const group of report.groups) {
|
|
@@ -352,7 +352,7 @@ function registerDepsCommands(program, cwd) {
|
|
|
352
352
|
if (report.summary.equivalent + report.summary.compatible + report.summary.conflict > 0) process.exitCode = 1;
|
|
353
353
|
});
|
|
354
354
|
deps.command("plan").alias("fix").description(localize("Preview an explicit dependency fix; always read-only", "预览显式依赖修复;始终只读")).argument("<dependency>", localize("Dependency name", "依赖名称")).requiredOption("--section <section>", localize("dependencies, devDependencies, peerDependencies or optionalDependencies", "依赖分区:dependencies、devDependencies、peerDependencies 或 optionalDependencies")).requiredOption("--to <specifier>", localize("Explicit target semver range or same-source npm alias", "明确的目标 semver 范围或同源 npm alias")).option("--group <name>", localize("Configured version group", "配置中的版本分组"), "default").option("--dry-run", localize("Preview only (already the default)", "仅预览(默认行为)")).option("--json", localize("Output a serializable plan for deps apply", "输出可交给 deps apply 的 JSON 计划")).action(async (dependency, options) => {
|
|
355
|
-
const { planDependencyFix } = await import("./deps-
|
|
355
|
+
const { planDependencyFix } = await import("./deps-CFZftEq2.mjs").then((n) => n.n);
|
|
356
356
|
const plan = await planDependencyFix(cwd, {
|
|
357
357
|
dependency,
|
|
358
358
|
section: options.section,
|
|
@@ -367,7 +367,7 @@ function registerDepsCommands(program, cwd) {
|
|
|
367
367
|
process.stdout.write(localize("Preview only. Save --json output, review it, then run deps apply <plan.json>.\n", "仅预览。保存并审阅 --json 输出,然后执行 deps apply <plan.json>。\n"));
|
|
368
368
|
});
|
|
369
369
|
deps.command("apply").description(localize("Apply a reviewed dependency plan with conflict checks and rollback", "应用已审阅的依赖计划,检查冲突并支持失败回滚")).argument("<plan>", localize("JSON plan file", "JSON 计划文件")).option("--json", localize("Output the result as JSON", "以 JSON 输出结果")).action(async (file, options) => {
|
|
370
|
-
const { applyDependencyFixPlan } = await import("./deps-
|
|
370
|
+
const { applyDependencyFixPlan } = await import("./deps-CFZftEq2.mjs").then((n) => n.n);
|
|
371
371
|
const result = await applyDependencyFixPlan(cwd, JSON.parse(await readFile(file, "utf8")));
|
|
372
372
|
if (options.json) output$1(result);
|
|
373
373
|
else {
|
|
@@ -387,11 +387,19 @@ function registerDocsCommands(program, cwd) {
|
|
|
387
387
|
channel: input.channel,
|
|
388
388
|
...input.sourceSha ? { sourceSha: input.sourceSha } : {},
|
|
389
389
|
...input.release ? { release: input.release } : {},
|
|
390
|
-
...input.commits ? { commits: input.commits } : {}
|
|
390
|
+
...input.commits ? { commits: input.commits } : {},
|
|
391
|
+
...input.json ? { json: true } : {}
|
|
391
392
|
};
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
393
|
+
try {
|
|
394
|
+
const result = action === "plan" ? await planDocsDeployment(options) : await deployDocs(options);
|
|
395
|
+
process.stdout.write(`${JSON.stringify(result, null, input.json ? void 0 : 2)}\n`);
|
|
396
|
+
if ("eligible" in result && !result.eligible) process.exitCode = 1;
|
|
397
|
+
} catch (error) {
|
|
398
|
+
if (!(error instanceof DocsDeploymentError)) throw error;
|
|
399
|
+
process.stdout.write(`${JSON.stringify(error.report, null, input.json ? void 0 : 2)}\n`);
|
|
400
|
+
if (!input.json) process.stderr.write(`${error.message}\n`);
|
|
401
|
+
process.exitCode = 1;
|
|
402
|
+
}
|
|
395
403
|
});
|
|
396
404
|
}
|
|
397
405
|
//#endregion
|
|
@@ -399,8 +407,8 @@ function registerDocsCommands(program, cwd) {
|
|
|
399
407
|
function registerEnvironmentCheck(command, cwd) {
|
|
400
408
|
command.command("check [tasks...]").description(localize("Check static environment references against Turbo cache declarations", "检查静态环境变量引用与 Turbo 缓存声明")).option("--json", localize("Output structured findings", "输出结构化诊断")).option("--markdown", localize("Output Markdown to stdout", "向标准输出写入 Markdown")).option("--strict", localize("Fail on warnings as well as errors", "警告也返回失败码")).option("--no-framework-inference", localize("Disable framework prefix assumptions", "不采用框架变量前缀推断")).option("--dry-run", localize("Read-only check (always enabled)", "只读检查(始终启用)")).action(async (tasks, options, action) => {
|
|
401
409
|
if (options.json && options.markdown) throw new Error("--json and --markdown cannot be combined");
|
|
402
|
-
const { checkEnvironmentCache } = await import("./workspace-tasks
|
|
403
|
-
const { formatEnvironmentCache } = await import("./workspace-tasks
|
|
410
|
+
const { checkEnvironmentCache } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.F);
|
|
411
|
+
const { formatEnvironmentCache } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.N);
|
|
404
412
|
const report = await checkEnvironmentCache(cwd, {
|
|
405
413
|
...tasks.length ? { tasks } : {},
|
|
406
414
|
...action.getOptionValueSource("frameworkInference") === "cli" ? { frameworkInference: options.frameworkInference } : {}
|
|
@@ -411,7 +419,7 @@ function registerEnvironmentCheck(command, cwd) {
|
|
|
411
419
|
}
|
|
412
420
|
//#endregion
|
|
413
421
|
//#region src/cli/commands/env/output.ts
|
|
414
|
-
function formatMarkdownTable$
|
|
422
|
+
function formatMarkdownTable$3(rows) {
|
|
415
423
|
const formatCell = (value) => String(value ?? "-").split("|").join("\\|").split("\n").join("<br>");
|
|
416
424
|
return [
|
|
417
425
|
localize("| Field | Value |", "| 字段 | 值 |"),
|
|
@@ -434,7 +442,7 @@ function formatEnvInfoMarkdown(info) {
|
|
|
434
442
|
return [
|
|
435
443
|
localize("# Repo environment", "# Repo 环境"),
|
|
436
444
|
"",
|
|
437
|
-
formatMarkdownTable$
|
|
445
|
+
formatMarkdownTable$3([
|
|
438
446
|
["cwd", info.cwd],
|
|
439
447
|
["workspace", info.workspaceDir],
|
|
440
448
|
["packages", info.packageCount],
|
|
@@ -469,7 +477,7 @@ function formatEnvPathsMarkdown(paths) {
|
|
|
469
477
|
return [
|
|
470
478
|
localize("# Repo paths", "# Repo 路径"),
|
|
471
479
|
"",
|
|
472
|
-
formatMarkdownTable$
|
|
480
|
+
formatMarkdownTable$3([["cwd", paths.cwd], ["workspace", paths.workspaceDir]]),
|
|
473
481
|
"",
|
|
474
482
|
localize("## Files", "## 文件"),
|
|
475
483
|
"",
|
|
@@ -498,7 +506,7 @@ function formatEnvSnapshotMarkdown(snapshot) {
|
|
|
498
506
|
"",
|
|
499
507
|
localize("## Environment", "## 环境"),
|
|
500
508
|
"",
|
|
501
|
-
formatMarkdownTable$
|
|
509
|
+
formatMarkdownTable$3([
|
|
502
510
|
["cwd", snapshot.env.cwd],
|
|
503
511
|
["workspace", snapshot.env.workspaceDir],
|
|
504
512
|
["packages", snapshot.env.packageCount],
|
|
@@ -510,7 +518,7 @@ function formatEnvSnapshotMarkdown(snapshot) {
|
|
|
510
518
|
"",
|
|
511
519
|
localize("## Diagnostics", "## 诊断"),
|
|
512
520
|
"",
|
|
513
|
-
formatMarkdownTable$
|
|
521
|
+
formatMarkdownTable$3([
|
|
514
522
|
["doctor pass", snapshot.doctor.summary.pass],
|
|
515
523
|
["doctor warn", snapshot.doctor.summary.warn],
|
|
516
524
|
["doctor fail", snapshot.doctor.summary.fail],
|
|
@@ -600,7 +608,7 @@ function formatEnvSupportBundle(bundle) {
|
|
|
600
608
|
...bundle.checkPlan.commands.map((command) => `- ${command.command}`)
|
|
601
609
|
].join("\n");
|
|
602
610
|
}
|
|
603
|
-
function formatMarkdownTable$
|
|
611
|
+
function formatMarkdownTable$2(rows) {
|
|
604
612
|
const formatCell = (value) => String(value ?? "-").split("|").join("\\|").split("\n").join("<br>");
|
|
605
613
|
return [
|
|
606
614
|
localize("| Field | Value |", "| 字段 | 值 |"),
|
|
@@ -617,7 +625,7 @@ function formatSupportBundleMarkdown(bundle) {
|
|
|
617
625
|
"",
|
|
618
626
|
localize("## Environment", "## 环境"),
|
|
619
627
|
"",
|
|
620
|
-
formatMarkdownTable$
|
|
628
|
+
formatMarkdownTable$2([
|
|
621
629
|
["cwd", bundle.env.cwd],
|
|
622
630
|
["workspace", bundle.env.workspaceDir],
|
|
623
631
|
["packages", bundle.env.packageCount],
|
|
@@ -629,7 +637,7 @@ function formatSupportBundleMarkdown(bundle) {
|
|
|
629
637
|
"",
|
|
630
638
|
localize("## Diagnostics", "## 诊断"),
|
|
631
639
|
"",
|
|
632
|
-
formatMarkdownTable$
|
|
640
|
+
formatMarkdownTable$2([
|
|
633
641
|
["doctor pass", bundle.doctor.summary.pass],
|
|
634
642
|
["doctor warn", bundle.doctor.summary.warn],
|
|
635
643
|
["doctor fail", bundle.doctor.summary.fail],
|
|
@@ -649,7 +657,7 @@ function formatSupportBundleMarkdown(bundle) {
|
|
|
649
657
|
"",
|
|
650
658
|
localize("## Report paths", "## 报告路径"),
|
|
651
659
|
"",
|
|
652
|
-
formatMarkdownTable$
|
|
660
|
+
formatMarkdownTable$2([
|
|
653
661
|
["doctor", bundle.paths.paths.doctorReport.relativePath],
|
|
654
662
|
["env", bundle.paths.paths.envReport.relativePath],
|
|
655
663
|
["snapshot", bundle.paths.paths.snapshotReport.relativePath],
|
|
@@ -726,23 +734,23 @@ function registerEnvCommands(program, cwd) {
|
|
|
726
734
|
const envCommand = program.command("env").alias("e").description(localize("Environment and support commands", "环境命令"));
|
|
727
735
|
registerEnvironmentCheck(envCommand, cwd);
|
|
728
736
|
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) => {
|
|
729
|
-
const { collectEnvInfo } = await import("./commands-
|
|
737
|
+
const { collectEnvInfo } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
730
738
|
await emitEnvInfo(await collectEnvInfo(cwd), opts, cwd);
|
|
731
739
|
});
|
|
732
740
|
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) => {
|
|
733
|
-
const { collectEnvSnapshot } = await import("./commands-
|
|
741
|
+
const { collectEnvSnapshot } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
734
742
|
await emitEnvSnapshot(await collectEnvSnapshot(cwd), opts, cwd);
|
|
735
743
|
});
|
|
736
744
|
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) => {
|
|
737
|
-
const { collectEnvPaths } = await import("./commands-
|
|
745
|
+
const { collectEnvPaths } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
738
746
|
await emitEnvPaths(await collectEnvPaths(cwd), opts, cwd);
|
|
739
747
|
});
|
|
740
748
|
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) => {
|
|
741
|
-
const { collectEnvSupportBundle } = await import("./commands-
|
|
749
|
+
const { collectEnvSupportBundle } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
742
750
|
await emitEnvSupportBundle(await collectEnvSupportBundle(cwd), opts, cwd);
|
|
743
751
|
});
|
|
744
752
|
envCommand.command("mirror").description(localize("Configure the VS Code binary mirror", "设置 VS Code binary mirror")).alias("m").action(async () => {
|
|
745
|
-
const { setVscodeBinaryMirror } = await import("./commands-
|
|
753
|
+
const { setVscodeBinaryMirror } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
746
754
|
await setVscodeBinaryMirror(cwd);
|
|
747
755
|
logger.success(localize("Environment mirror finished.", "环境镜像完成。"));
|
|
748
756
|
});
|
|
@@ -752,7 +760,7 @@ function registerEnvCommands(program, cwd) {
|
|
|
752
760
|
function registerGenerateCommand(program, cwd) {
|
|
753
761
|
program.command("generate").alias("g").description(localize("Generate a component or route inside an existing package", "在已有包内生成组件或路由")).argument("<generator>", "vue-component, react-component, hono-route").argument("<name>", localize("Kebab-case component or route name", "kebab-case 组件或路由名称")).requiredOption("--package <name-or-path>", localize("Exact workspace package name or relative directory", "精确 workspace 包名或相对目录")).option("--directory <path>", localize("Package-relative source directory", "包内源文件相对目录")).option("--barrel <path>", localize("TypeScript export barrel, used with --export", "配合 --export 使用的 TypeScript 导出文件")).option("--export", localize("Add a named export to src/index.ts or --barrel", "向 src/index.ts 或 --barrel 添加具名导出")).option("--params <json>", localize("Additional typed generator parameters as JSON", "JSON 格式的类型化生成参数")).option("--dry-run", localize("Preview all generated changes without writing", "预览全部生成变更,不写入文件")).option("--json", localize("Print a JSON preview without writing", "以 JSON 输出预览,不写入文件")).action(async (generator, name, options) => {
|
|
754
762
|
try {
|
|
755
|
-
const { applyGeneratePlan, planGenerate } = await import("./workspace-tasks
|
|
763
|
+
const { applyGeneratePlan, planGenerate } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.v);
|
|
756
764
|
const extra = options.params ? JSON.parse(options.params) : {};
|
|
757
765
|
if (!extra || typeof extra !== "object" || Array.isArray(extra)) throw new Error("--params must contain a JSON object.");
|
|
758
766
|
if (Object.hasOwn(extra, "name") || options.export !== void 0 && Object.hasOwn(extra, "export")) throw new Error("Do not supply the same generator parameter through multiple inputs.");
|
|
@@ -854,7 +862,7 @@ function registerPackageCommands(program, cwd) {
|
|
|
854
862
|
registerPackageCheckCommand(packageCommand, cwd);
|
|
855
863
|
registerPublicApiCommands(packageCommand, cwd);
|
|
856
864
|
packageCommand.command("create").description(localize("Create a new workspace package", "创建一个新的子包")).alias("new").argument("[name]").option("--offline", localize("Use only verified cached remote assets", "只使用通过校验的远程资产缓存")).option("--data <file>", localize("Read typed template parameters from a JSON file", "从 JSON 文件读取类型化模板参数")).option("--cache-dir <directory>", localize("Template asset cache directory", "模板资产缓存目录")).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) => {
|
|
857
|
-
const { runCreateFlow } = await import("./create-flow-
|
|
865
|
+
const { runCreateFlow } = await import("./create-flow-CqtNwZs7.mjs");
|
|
858
866
|
const result = await runCreateFlow(cwd, inputName, {
|
|
859
867
|
...opts.offline !== void 0 ? { offline: opts.offline } : {},
|
|
860
868
|
...opts.cacheDir ? { cacheDir: opts.cacheDir } : {},
|
|
@@ -1336,7 +1344,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1336
1344
|
registerNpmMirror(releaseCommand, cwd);
|
|
1337
1345
|
releaseCommand.command("ci").description(localize("Prepare, publish, or recover versions in CI", "在 CI 中自动准备、发布和恢复版本")).option("--stage <stage>", "all / plan / verify / prepare / upload / confirm / finalize", "all").option("--mode <mode>", "auto / prepare / publish / publish-unpublished / reconcile / oidc-audit", "auto").option("--package <name>", localize("Package used by publish-unpublished mode", "publish-unpublished 使用的 package")).option("--version <version>", localize("Version used by publish-unpublished mode", "publish-unpublished 使用的版本")).option("--source-sha <sha>", localize("Recover a prepared release from the selected line history", "从所选发布线的历史提交恢复整批发布")).option("--dry-run", localize("Preview reconcile changes without updating GitHub", "只预览 reconcile 变更,不更新 GitHub")).action(async (opts) => {
|
|
1338
1346
|
await runReleaseAction(async () => {
|
|
1339
|
-
const { releaseCi } = await import("./commands-
|
|
1347
|
+
const { releaseCi } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1340
1348
|
const mode = resolveReleaseMode(opts);
|
|
1341
1349
|
await releaseCi({
|
|
1342
1350
|
...mode === "oidc-audit" ? { cwd } : await resolveReleaseOptions(cwd),
|
|
@@ -1352,7 +1360,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1352
1360
|
});
|
|
1353
1361
|
releaseCommand.command("notes").description(localize("Manage GitHub Release notes", "维护 GitHub Release 正文")).command("repair").description(localize("Rebuild GitHub Release notes from the changelog for each release tag", "按每个发布 tag 对应的 changelog 重建 GitHub Release 正文")).option("--all", localize("Repair every recognized GitHub Release", "修复所有可识别的 GitHub Release")).option("--tag <package@version>", localize("Repair only the specified package@version", "只修复指定 package@version")).option("--dry-run", localize("Generate and summarize without updating GitHub Releases", "只生成并统计,不更新 GitHub Release")).option("--create-missing", localize("Create a missing GitHub Release after validating the published package and tag", "核验已发布 package 和 tag 后补建缺失的 GitHub Release")).action(async (opts) => {
|
|
1354
1362
|
await runReleaseAction(async () => {
|
|
1355
|
-
const { repairReleaseNotes } = await import("./commands-
|
|
1363
|
+
const { repairReleaseNotes } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1356
1364
|
const result = await repairReleaseNotes({
|
|
1357
1365
|
cwd,
|
|
1358
1366
|
...opts.all ? { all: true } : {},
|
|
@@ -1365,7 +1373,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1365
1373
|
});
|
|
1366
1374
|
const stableCommand = releaseCommand.command("stable").description(localize("Run a stable release from the configured release line", "在配置的正式发布线执行发布")).action(async () => {
|
|
1367
1375
|
await runReleaseAction(async () => {
|
|
1368
|
-
const { releaseCi } = await import("./commands-
|
|
1376
|
+
const { releaseCi } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1369
1377
|
await releaseCi({
|
|
1370
1378
|
...await resolveReleaseOptions(cwd),
|
|
1371
1379
|
mode: "publish"
|
|
@@ -1375,7 +1383,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1375
1383
|
});
|
|
1376
1384
|
stableCommand.command("prepare").description(localize("Consume pnpm change intents and prepare a Release PR", "消费 pnpm change intents 并准备 Release PR")).action(async () => {
|
|
1377
1385
|
await runReleaseAction(async () => {
|
|
1378
|
-
const { releaseCi } = await import("./commands-
|
|
1386
|
+
const { releaseCi } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1379
1387
|
await releaseCi({
|
|
1380
1388
|
...await resolveReleaseOptions(cwd),
|
|
1381
1389
|
mode: "prepare"
|
|
@@ -1385,7 +1393,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1385
1393
|
});
|
|
1386
1394
|
stableCommand.command("publish").description(localize("Publish prepared versions from the configured release line", "发布所选发布线已经准备的包版本")).action(async () => {
|
|
1387
1395
|
await runReleaseAction(async () => {
|
|
1388
|
-
const { releaseCi } = await import("./commands-
|
|
1396
|
+
const { releaseCi } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1389
1397
|
await releaseCi({
|
|
1390
1398
|
...await resolveReleaseOptions(cwd),
|
|
1391
1399
|
mode: "publish"
|
|
@@ -1396,21 +1404,21 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1396
1404
|
const preCommand = releaseCommand.command("pre").description(localize("Run or manage prereleases", "执行或管理 prerelease 发布"));
|
|
1397
1405
|
preCommand.command("publish").alias("run").description(localize("Publish from a configured prerelease branch", "在已配置的预发布分支发布 prerelease")).action(async () => {
|
|
1398
1406
|
await runReleaseAction(async () => {
|
|
1399
|
-
const { releaseCi } = await import("./commands-
|
|
1407
|
+
const { releaseCi } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1400
1408
|
await releaseCi(await resolveReleaseOptions(cwd));
|
|
1401
1409
|
logger.success(localize("Prerelease finished.", "预发布完成。"));
|
|
1402
1410
|
});
|
|
1403
1411
|
});
|
|
1404
1412
|
preCommand.command("enter").description(localize("Enter a pnpm prerelease lane", "进入 pnpm prerelease lane")).argument("<tag>", localize("Configured pnpm prerelease lane", "已配置的 pnpm 预发布 lane")).action(async (tag) => {
|
|
1405
1413
|
await runReleaseAction(async () => {
|
|
1406
|
-
const { enterPrerelease } = await import("./commands-
|
|
1414
|
+
const { enterPrerelease } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1407
1415
|
await enterPrerelease(tag, { cwd });
|
|
1408
1416
|
logger.success(localize(`Entered ${tag} prerelease mode.`, `已进入 ${tag} 预发布模式。`));
|
|
1409
1417
|
});
|
|
1410
1418
|
});
|
|
1411
1419
|
preCommand.command("exit").description(localize("Exit the pnpm prerelease lane", "退出 pnpm prerelease lane")).action(async () => {
|
|
1412
1420
|
await runReleaseAction(async () => {
|
|
1413
|
-
const { exitPrerelease } = await import("./commands-
|
|
1421
|
+
const { exitPrerelease } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1414
1422
|
const target = await exitPrerelease({ cwd });
|
|
1415
1423
|
logger.success(localize(`Exited prerelease mode. Stable target: ${target.branch}.`, `已退出预发布模式,正式目标分支:${target.branch}。`));
|
|
1416
1424
|
});
|
|
@@ -1427,7 +1435,7 @@ const skillTargets = [
|
|
|
1427
1435
|
];
|
|
1428
1436
|
function registerSkillsCommands(program, cwd) {
|
|
1429
1437
|
program.command("skills").alias("sk").description(localize("AI skill commands", "技能工具集")).command("sync").description(localize("Synchronize the repoctl skill to global agent directories", "同步 resources/skills/repoctl 到全局目录")).alias("s").option("--codex", localize("Synchronize to ~/.codex/skills", "同步到 ~/.codex/skills")).option("--claude", localize("Synchronize to ~/.claude/skills", "同步到 ~/.claude/skills")).option("--cursor", localize("Synchronize to ~/.cursor/skills", "同步到 ~/.cursor/skills")).option("--agents", localize("Synchronize to ~/.agents/skills", "同步到 ~/.agents/skills")).option("--grok", localize("Synchronize to ~/.grok/skills", "同步到 ~/.grok/skills")).option("--all", localize("Synchronize every target", "同步全部目标")).action(async (opts) => {
|
|
1430
|
-
const { syncSkills } = await import("./commands-
|
|
1438
|
+
const { syncSkills } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1431
1439
|
const selected = /* @__PURE__ */ new Set();
|
|
1432
1440
|
if (opts.all) for (const target of skillTargets) selected.add(target);
|
|
1433
1441
|
else {
|
|
@@ -1463,7 +1471,7 @@ async function emitTemplateReport(value, options) {
|
|
|
1463
1471
|
//#region src/cli/commands/template-instances/drift.ts
|
|
1464
1472
|
function registerTemplateDriftCommand(templates) {
|
|
1465
1473
|
templates.command("drift").description(localize("Inspect template versions and managed file drift without changing assets", "只读诊断模板版本、基线和受管文件漂移")).option("--source-dir <directory>", localize("Compare with metadata from an extracted template package", "与已解压模板包的真实版本元数据比较")).option("--remote", localize("Explicitly query the public npm latest dist-tag", "显式查询公共 npm 仓库的 latest 版本")).option("--strict", localize("Fail on active warnings, including unavailable evidence", "存在有效告警或证据不可用时失败")).option("--json", localize("Output structured JSON", "输出结构化 JSON")).option("--markdown", localize("Output a Markdown report (default)", "输出 Markdown 报告(默认)")).option("--out <file>", localize("Write only the report to this file", "仅将诊断报告写入指定文件")).action(async (options, command) => {
|
|
1466
|
-
const { checkTemplateDrift, formatTemplateDriftReport, hasTemplateDriftIssues } = await import("./template-drift-
|
|
1474
|
+
const { checkTemplateDrift, formatTemplateDriftReport, hasTemplateDriftIssues } = await import("./template-drift-BKCMx9vC.mjs").then((n) => n.n);
|
|
1467
1475
|
const merged = {
|
|
1468
1476
|
...command.optsWithGlobals(),
|
|
1469
1477
|
...options
|
|
@@ -1482,7 +1490,7 @@ function registerTemplateDriftCommand(templates) {
|
|
|
1482
1490
|
//#region src/cli/commands/template-instances/upgrade.ts
|
|
1483
1491
|
function registerTemplateUpgradeCommands(templates) {
|
|
1484
1492
|
templates.command("upgrade").description(localize("Preview a selected template instance upgrade, preserving business changes", "预览所选模板实例的增量升级,保留业务修改")).argument("<instance>", localize("Registered instance ID or target path", "已登记实例 ID 或目标路径")).requiredOption("--source-version <version>", localize("Exact target template package version", "目标模板包的精确版本")).option("--source-dir <directory>", localize("Read an extracted target template package", "只读使用已解压的目标模板包")).option("--exclude <paths...>", localize("Keep these relative files or directories unmanaged in future upgrades", "将这些相对文件或目录持久标记为不受管")).option("--apply", localize("Apply a conflict-free instance upgrade", "应用无冲突的实例升级")).option("--json", localize("Output structured JSON", "输出结构化 JSON")).option("--out <file>", localize("Write the report to a file", "将报告写入文件")).action(async (instance, options, command) => {
|
|
1485
|
-
const { planTemplateUpgrade, applyTemplateUpgradePlan } = await import("./workspace-tasks
|
|
1493
|
+
const { planTemplateUpgrade, applyTemplateUpgradePlan } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.d);
|
|
1486
1494
|
const plan = await planTemplateUpgrade({
|
|
1487
1495
|
cwd: await templateWorkspaceRoot(),
|
|
1488
1496
|
instance,
|
|
@@ -1496,7 +1504,7 @@ function registerTemplateUpgradeCommands(templates) {
|
|
|
1496
1504
|
});
|
|
1497
1505
|
});
|
|
1498
1506
|
templates.command("recover-upgrade").description(localize("Inspect or restore an interrupted instance upgrade", "检查或恢复中断的实例升级")).argument("<instance>", localize("Registered instance ID or target path", "已登记实例 ID 或目标路径")).option("--apply", localize("Restore the recorded instance and changed files", "恢复记录中的实例信息及受影响文件")).option("--json", localize("Output structured JSON", "输出结构化 JSON")).option("--out <file>", localize("Write the report to a file", "将报告写入文件")).action(async (instance, options, command) => {
|
|
1499
|
-
const { recoverTemplateUpgrade } = await import("./workspace-tasks
|
|
1507
|
+
const { recoverTemplateUpgrade } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.d);
|
|
1500
1508
|
await emitTemplateReport(await recoverTemplateUpgrade(await templateWorkspaceRoot(), instance, options.apply), {
|
|
1501
1509
|
...command.optsWithGlobals(),
|
|
1502
1510
|
...options
|
|
@@ -1509,7 +1517,7 @@ function registerTemplateInstanceCommands(templates) {
|
|
|
1509
1517
|
registerTemplateDriftCommand(templates);
|
|
1510
1518
|
registerTemplateUpgradeCommands(templates);
|
|
1511
1519
|
templates.command("instances").description(localize("Inspect registered template instances without changing files", "只读查询已登记模板实例")).argument("[target]", localize("Instance ID or workspace-relative target", "实例 ID 或相对工作区路径")).option("--json", localize("Output structured JSON", "输出结构化 JSON")).option("--out <file>", localize("Write the report to a file", "将报告写入文件")).action(async (target, options, command) => {
|
|
1512
|
-
const { listTemplateInstances } = await import("./workspace-tasks
|
|
1520
|
+
const { listTemplateInstances } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.d);
|
|
1513
1521
|
const instances = await listTemplateInstances(await templateWorkspaceRoot());
|
|
1514
1522
|
const selected = target ? instances.filter((item) => item.instance.id === target || item.instance.target === target) : instances;
|
|
1515
1523
|
if (target && !selected.length) throw new Error(`Unknown template instance: ${target}`);
|
|
@@ -1522,7 +1530,7 @@ function registerTemplateInstanceCommands(templates) {
|
|
|
1522
1530
|
});
|
|
1523
1531
|
});
|
|
1524
1532
|
templates.command("link").description(localize("Preview an explicit historical template association; --apply writes metadata only", "预览历史模板关联;--apply 仅写登记信息")).argument("<target>", localize("Existing workspace-relative project path", "存量项目相对工作区路径")).requiredOption("--template <key>", localize("Stable template key", "稳定模板标识")).requiredOption("--source-version <version>", localize("Exact historical template package version", "模板包的精确历史版本")).option("--source-dir <directory>", localize("Read an extracted historical template package without executing it", "只读使用已解压的历史模板包,不执行其脚本")).option("--profile <profile>", localize("workspace-copy-v1 or repo-new-v1", "workspace-copy-v1 或 repo-new-v1"), "repo-new-v1").option("--package-name <name>", localize("Historical generated package name", "历史生成包名")).option("--rename-json", localize("Historical output used package.mock.json", "历史生成时使用了 package.mock.json")).option("--unverified", localize("Explicitly allow metadata-only association when the source is unavailable", "来源不可用时显式允许未验证关联")).option("--apply", localize("Apply the reviewed association without changing project files", "应用关联,不改写项目文件")).option("--json", localize("Output the plan as JSON", "以 JSON 输出计划")).option("--out <file>", localize("Write the plan or result to a file", "将计划或结果写入文件")).action(async (target, options, command) => {
|
|
1525
|
-
const { applyTemplateLinkPlan, planTemplateLink } = await import("./workspace-tasks
|
|
1533
|
+
const { applyTemplateLinkPlan, planTemplateLink } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.d);
|
|
1526
1534
|
const plan = await planTemplateLink({
|
|
1527
1535
|
cwd: await templateWorkspaceRoot(),
|
|
1528
1536
|
target,
|
|
@@ -1542,14 +1550,14 @@ function registerTemplateInstanceCommands(templates) {
|
|
|
1542
1550
|
});
|
|
1543
1551
|
});
|
|
1544
1552
|
templates.command("relocate").description(localize("Associate a missing instance with an identical destination, without moving files", "显式关联已移动且可验证的实例,不移动业务文件")).argument("<instance>", localize("Registered instance ID or old path", "已登记实例 ID 或旧路径")).argument("<target>", localize("New workspace-relative path", "新相对工作区路径")).option("--apply", localize("Update the registered path", "更新登记路径")).option("--json", localize("Output JSON", "输出 JSON")).option("--out <file>", localize("Write the report to a file", "将报告写入文件")).action(async (instance, target, options, command) => {
|
|
1545
|
-
const { relocateTemplateInstance } = await import("./workspace-tasks
|
|
1553
|
+
const { relocateTemplateInstance } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.d);
|
|
1546
1554
|
await emitTemplateReport(await relocateTemplateInstance(await templateWorkspaceRoot(), instance, target, options.apply), {
|
|
1547
1555
|
...command.optsWithGlobals(),
|
|
1548
1556
|
...options
|
|
1549
1557
|
});
|
|
1550
1558
|
});
|
|
1551
1559
|
templates.command("rebuild-baseline").description(localize("Reconstruct a retained baseline into a new isolated directory", "在新的隔离目录中重建留存基线")).argument("<instance>", localize("Instance ID or target", "实例 ID 或目标路径")).requiredOption("--destination <directory>", localize("A directory that does not exist", "尚不存在的目录")).option("--original", localize("Reconstruct the original template before repoctl transformations", "重建 repoctl 处理前的原始模板")).action(async (instance, options) => {
|
|
1552
|
-
const { rebuildTemplateInstanceBaseline } = await import("./workspace-tasks
|
|
1560
|
+
const { rebuildTemplateInstanceBaseline } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.d);
|
|
1553
1561
|
await emitTemplateReport({
|
|
1554
1562
|
instance: (await rebuildTemplateInstanceBaseline(await templateWorkspaceRoot(), instance, path.resolve(options.destination), options.original ? "original" : "rendered")).id,
|
|
1555
1563
|
destination: path.resolve(options.destination)
|
|
@@ -1754,7 +1762,7 @@ function registerTemplatesCommands(program) {
|
|
|
1754
1762
|
const templates = program.command("templates").alias("tpl").description(localize("List built-in and configured 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 template configuration, 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) => {
|
|
1755
1763
|
const { isTemplateCategory, suggestTemplateKey, templateCategories } = await import("@icebreakers/monorepo-templates");
|
|
1756
1764
|
if (opts.check) {
|
|
1757
|
-
const { checkTemplates } = await import("./commands-
|
|
1765
|
+
const { checkTemplates } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1758
1766
|
const report = await checkTemplates();
|
|
1759
1767
|
if (opts.json) await emitTemplateOutput(JSON.stringify(report, null, 2), opts);
|
|
1760
1768
|
else await emitTemplateOutput(formatTemplateHealthReport(report, !opts.out), opts);
|
|
@@ -1878,7 +1886,7 @@ function registerCapabilityCommands(toolingCommand, cwd) {
|
|
|
1878
1886
|
function registerDevContainerCommand(command, cwd) {
|
|
1879
1887
|
command.command("devcontainer").description(localize("Preview a pnpm Dev Container preset, or apply a reviewed plan", "预览 pnpm Dev Container 预设,或应用已审查的计划")).option("--node-version <version>", localize("Choose an exact Node version allowed by engines.node", "选择 engines.node 允许的精确 Node 版本")).option("--apply <plan>", localize("Apply a saved JSON plan without starting containers", "应用已保存的 JSON 计划,不启动容器")).option("--dry-run", localize("Preview only (the default)", "只读预览(默认行为)")).option("--json", localize("Output JSON with generated files and diffs", "输出包含生成文件与差异的 JSON")).option("--out <file>", localize("Save the JSON preview to a new file", "将 JSON 预览保存到一个新文件")).action(async (_options, current) => {
|
|
1880
1888
|
const options = current.optsWithGlobals();
|
|
1881
|
-
const { applyDevContainerPlan, planDevContainer } = await import("./commands-
|
|
1889
|
+
const { applyDevContainerPlan, planDevContainer } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1882
1890
|
if (options.apply) {
|
|
1883
1891
|
if (options.nodeVersion || options.dryRun || options.out) throw new Error("--apply cannot be combined with preview or selection options.");
|
|
1884
1892
|
const filename = path.resolve(cwd, options.apply);
|
|
@@ -1930,7 +1938,7 @@ function registerToolingCommands(program, cwd) {
|
|
|
1930
1938
|
registerDevContainerCommand(toolingCommand, cwd);
|
|
1931
1939
|
toolingCommand.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) => {
|
|
1932
1940
|
const normalizedTooling = normalizeToolingTargets(tooling);
|
|
1933
|
-
const { initTooling } = await import("./commands-
|
|
1941
|
+
const { initTooling } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
1934
1942
|
await initTooling(cwd, {
|
|
1935
1943
|
...normalizedTooling ? { targets: normalizedTooling } : {},
|
|
1936
1944
|
...opts.all !== void 0 ? { all: opts.all } : {},
|
|
@@ -1954,8 +1962,8 @@ function registerCacheAnalysis(check, cwd) {
|
|
|
1954
1962
|
const markdown = options.markdown || parent["markdown"] === true;
|
|
1955
1963
|
if (json && markdown) throw new Error("--json and --markdown cannot be combined");
|
|
1956
1964
|
const own = command.opts();
|
|
1957
|
-
const { analyzeTurboRuns } = await import("./workspace-tasks
|
|
1958
|
-
const { formatTurboAnalysis } = await import("./format-
|
|
1965
|
+
const { analyzeTurboRuns } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.G);
|
|
1966
|
+
const { formatTurboAnalysis } = await import("./format-BXQ2yRvk.mjs");
|
|
1959
1967
|
const result = await analyzeTurboRuns(path.resolve(cwd, current), {
|
|
1960
1968
|
...previous !== void 0 ? { previous: path.resolve(cwd, previous) } : {},
|
|
1961
1969
|
...own.slowest !== void 0 ? { slowest: Number(own.slowest) } : {}
|
|
@@ -1983,7 +1991,7 @@ function registerKnipCheck(check, cwd) {
|
|
|
1983
1991
|
};
|
|
1984
1992
|
if (opts.saveBaseline && (opts.baseline || opts.newOnly || opts.dryRun || opts.recommendConfig)) throw new Error("--save-baseline cannot be combined with --baseline, --new-only, --dry-run or --recommend-config.");
|
|
1985
1993
|
if (opts.recommendConfig && (opts.config || opts.baseline || opts.newOnly || opts.timeout || opts.production || opts.strict)) throw new Error("--recommend-config only provides native configuration suggestions; it cannot run or compare an analysis.");
|
|
1986
|
-
const { getKnipConfigurationSuggestions, planKnipCheck, runKnipCheck, saveKnipBaseline } = await import("./workspace-tasks
|
|
1994
|
+
const { getKnipConfigurationSuggestions, planKnipCheck, runKnipCheck, saveKnipBaseline } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.L);
|
|
1987
1995
|
if (opts.recommendConfig) {
|
|
1988
1996
|
process.stdout.write(`${JSON.stringify(await getKnipConfigurationSuggestions(cwd), null, 2)}\n`);
|
|
1989
1997
|
return;
|
|
@@ -2061,7 +2069,7 @@ function formatCheckPlan(plan) {
|
|
|
2061
2069
|
}
|
|
2062
2070
|
return lines.join("\n");
|
|
2063
2071
|
}
|
|
2064
|
-
function formatMarkdownTable$
|
|
2072
|
+
function formatMarkdownTable$1(rows) {
|
|
2065
2073
|
const formatCell = (value) => String(value ?? "-").split("|").join("\\|").split("\n").join("<br>");
|
|
2066
2074
|
return [
|
|
2067
2075
|
localize("| Field | Value |", "| 字段 | 值 |"),
|
|
@@ -2073,7 +2081,7 @@ function formatCheckPlanMarkdown(plan) {
|
|
|
2073
2081
|
return [
|
|
2074
2082
|
localize("# Repo check plan", "# Repo 检查计划"),
|
|
2075
2083
|
"",
|
|
2076
|
-
formatMarkdownTable$
|
|
2084
|
+
formatMarkdownTable$1([
|
|
2077
2085
|
["cwd", plan.cwd],
|
|
2078
2086
|
["mode", plan.mode],
|
|
2079
2087
|
["commands", plan.commands.length]
|
|
@@ -2138,7 +2146,7 @@ function registerCheckCommand(program, cwd) {
|
|
|
2138
2146
|
...opts.globalInput ? { globalInputs: opts.globalInput } : {}
|
|
2139
2147
|
};
|
|
2140
2148
|
if (opts.matrix) {
|
|
2141
|
-
const { resolveAffectedCheckMatrix } = await import("./commands-
|
|
2149
|
+
const { resolveAffectedCheckMatrix } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2142
2150
|
const matrix = await resolveAffectedCheckMatrix({
|
|
2143
2151
|
...options,
|
|
2144
2152
|
...opts.shards !== void 0 ? { shards: Number(opts.shards) } : {}
|
|
@@ -2152,19 +2160,19 @@ function registerCheckCommand(program, cwd) {
|
|
|
2152
2160
|
if (opts.dryRun || opts.json || opts.markdown || opts.out) throw new Error("--report cannot be combined with preview options: --dry-run, --json, --markdown, --out");
|
|
2153
2161
|
const format = opts.reportFormat ?? "json";
|
|
2154
2162
|
if (format !== "json" && format !== "markdown") throw new Error("--report-format must be json or markdown");
|
|
2155
|
-
const { runCheckExecution } = await import("./execute-
|
|
2163
|
+
const { runCheckExecution } = await import("./execute-Brlvq-TY.mjs");
|
|
2156
2164
|
await runCheckExecution(options, opts.report, format, opts.redact);
|
|
2157
2165
|
return;
|
|
2158
2166
|
}
|
|
2159
|
-
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-
|
|
2167
|
+
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2160
2168
|
if (opts.dryRun || opts.json || opts.markdown || opts.out) {
|
|
2161
2169
|
if (opts.affected) {
|
|
2162
|
-
const { resolveAffectedCheckPlan } = await import("./commands-
|
|
2170
|
+
const { resolveAffectedCheckPlan } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2163
2171
|
await emitCheckPlan(await resolveAffectedCheckPlan(options), opts, cwd);
|
|
2164
2172
|
return;
|
|
2165
2173
|
}
|
|
2166
2174
|
if (opts.full) {
|
|
2167
|
-
const { resolveFullWorkspaceCheckPlan } = await import("./commands-
|
|
2175
|
+
const { resolveFullWorkspaceCheckPlan } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2168
2176
|
await emitCheckPlan(await resolveFullWorkspaceCheckPlan(cwd), opts, cwd);
|
|
2169
2177
|
return;
|
|
2170
2178
|
}
|
|
@@ -2172,7 +2180,7 @@ function registerCheckCommand(program, cwd) {
|
|
|
2172
2180
|
return;
|
|
2173
2181
|
}
|
|
2174
2182
|
if (opts.affected) {
|
|
2175
|
-
const { runCheckExecution } = await import("./execute-
|
|
2183
|
+
const { runCheckExecution } = await import("./execute-Brlvq-TY.mjs");
|
|
2176
2184
|
await runCheckExecution(options);
|
|
2177
2185
|
return;
|
|
2178
2186
|
}
|
|
@@ -2183,44 +2191,76 @@ function registerCheckCommand(program, cwd) {
|
|
|
2183
2191
|
registerKnipCheck(check, cwd);
|
|
2184
2192
|
}
|
|
2185
2193
|
//#endregion
|
|
2186
|
-
//#region src/cli/commands/doctor/
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2194
|
+
//#region src/cli/commands/doctor/render/groups.ts
|
|
2195
|
+
/** Group presentation only; preserve every check occurrence and the report's original counts. */
|
|
2196
|
+
function groupDoctorChecks(checks) {
|
|
2197
|
+
const groups = [];
|
|
2198
|
+
const indexed = /* @__PURE__ */ new Map();
|
|
2199
|
+
for (const check of checks) {
|
|
2200
|
+
const suppression = check.suppression;
|
|
2201
|
+
const key = JSON.stringify([
|
|
2202
|
+
check.id,
|
|
2203
|
+
check.status,
|
|
2204
|
+
check.title,
|
|
2205
|
+
check.detail,
|
|
2206
|
+
check.fix,
|
|
2207
|
+
check.field,
|
|
2208
|
+
suppression && [
|
|
2209
|
+
suppression.id,
|
|
2210
|
+
suppression.state,
|
|
2211
|
+
suppression.reason,
|
|
2212
|
+
suppression.expires,
|
|
2213
|
+
suppression.path
|
|
2214
|
+
]
|
|
2215
|
+
]);
|
|
2216
|
+
const existing = check.path === void 0 ? void 0 : indexed.get(key);
|
|
2217
|
+
if (existing) {
|
|
2218
|
+
existing.paths.push(check.path);
|
|
2219
|
+
existing.count++;
|
|
2220
|
+
} else {
|
|
2221
|
+
const group = {
|
|
2222
|
+
check,
|
|
2223
|
+
paths: check.path === void 0 ? [] : [check.path],
|
|
2224
|
+
count: 1
|
|
2225
|
+
};
|
|
2226
|
+
groups.push(group);
|
|
2227
|
+
if (check.path !== void 0) indexed.set(key, group);
|
|
2228
|
+
}
|
|
2204
2229
|
}
|
|
2205
|
-
|
|
2206
|
-
lines.push("");
|
|
2207
|
-
lines.push(color ? localize(`summary: ${pc.green(String(report.summary.pass))} pass, ${pc.yellow(String(report.summary.warn))} warn, ${pc.red(String(report.summary.fail))} fail`, `摘要:${pc.green(String(report.summary.pass))} 通过,${pc.yellow(String(report.summary.warn))} 警告,${pc.red(String(report.summary.fail))} 失败`) : localize(`summary: ${report.summary.pass} pass, ${report.summary.warn} warn, ${report.summary.fail} fail`, `摘要:${report.summary.pass} 通过,${report.summary.warn} 警告,${report.summary.fail} 失败`));
|
|
2208
|
-
return lines.join("\n");
|
|
2230
|
+
return groups;
|
|
2209
2231
|
}
|
|
2210
|
-
|
|
2211
|
-
|
|
2232
|
+
//#endregion
|
|
2233
|
+
//#region src/cli/commands/doctor/render/markdown.ts
|
|
2234
|
+
/** Render data as text, including paths that contain Markdown syntax or Windows separators. */
|
|
2235
|
+
function escape(value) {
|
|
2236
|
+
return String(value ?? "-").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replace(/[\\`*_{}[\]()#+.!|~\-]/g, "\\$&").replace(/\r\n|\r|\n/g, "<br>");
|
|
2237
|
+
}
|
|
2238
|
+
function table(rows) {
|
|
2212
2239
|
return [
|
|
2213
2240
|
localize("| Field | Value |", "| 字段 | 值 |"),
|
|
2214
2241
|
"| --- | --- |",
|
|
2215
|
-
...rows.map(([label, value]) => `| ${label} | ${
|
|
2242
|
+
...rows.map(([label, value]) => `| ${escape(label)} | ${escape(value)} |`)
|
|
2243
|
+
].join("\n");
|
|
2244
|
+
}
|
|
2245
|
+
function finding({ check, paths, count }) {
|
|
2246
|
+
const occurrences = count > 1 ? localize(` (${count} checks)`, `(${count} 项检查)`) : "";
|
|
2247
|
+
return [
|
|
2248
|
+
`- **${check.status.toUpperCase()}** [${escape(check.id)}]: ${escape(check.title)}${occurrences}`,
|
|
2249
|
+
...paths.map((filename) => localize(` - Path: ${escape(filename)}`, ` - 路径:${escape(filename)}`)),
|
|
2250
|
+
...check.field === void 0 ? [] : [localize(` - Field: ${escape(check.field)}`, ` - 字段:${escape(check.field)}`)],
|
|
2251
|
+
` - ${escape(check.detail)}`,
|
|
2252
|
+
...check.suppression ? [` - suppression: ${escape(check.suppression.state)}; reason: ${escape(check.suppression.reason)}; expires: ${escape(check.suppression.expires ?? "never")}`] : [],
|
|
2253
|
+
...check.fix ? [localize(` - Fix: ${escape(check.fix)}`, ` - 修复:${escape(check.fix)}`)] : []
|
|
2216
2254
|
].join("\n");
|
|
2217
2255
|
}
|
|
2218
2256
|
function formatDoctorMarkdown(report) {
|
|
2219
|
-
const
|
|
2257
|
+
const groups = groupDoctorChecks(report.checks);
|
|
2258
|
+
const findings = groups.filter((group) => group.check.status !== "pass");
|
|
2259
|
+
const passing = groups.filter((group) => group.check.status === "pass");
|
|
2220
2260
|
return [
|
|
2221
2261
|
localize("# Repo doctor report", "# Repo doctor 诊断报告"),
|
|
2222
2262
|
"",
|
|
2223
|
-
|
|
2263
|
+
table([
|
|
2224
2264
|
["workspace", report.workspaceDir],
|
|
2225
2265
|
["packages", report.packageCount],
|
|
2226
2266
|
["pass", report.summary.pass],
|
|
@@ -2228,23 +2268,27 @@ function formatDoctorMarkdown(report) {
|
|
|
2228
2268
|
["fail", report.summary.fail]
|
|
2229
2269
|
]),
|
|
2230
2270
|
"",
|
|
2231
|
-
...
|
|
2271
|
+
...findings.length ? [
|
|
2232
2272
|
localize("## Findings", "## 问题"),
|
|
2233
2273
|
"",
|
|
2234
|
-
...
|
|
2274
|
+
...findings.map(finding),
|
|
2235
2275
|
""
|
|
2236
2276
|
] : [],
|
|
2237
2277
|
...report.suppressions?.length ? [
|
|
2238
2278
|
localize("## Suppressions", "## 抑制记录"),
|
|
2239
2279
|
"",
|
|
2240
|
-
...report.suppressions.map((item) => `- ${item.id}: ${item.state}; matched: ${item.matched}; reason: ${item.reason}; expires: ${item.expires ?? "never"}`),
|
|
2280
|
+
...report.suppressions.map((item) => `- ${escape(item.id)}: ${escape(item.state)}; matched: ${item.matched}; reason: ${escape(item.reason)}; expires: ${escape(item.expires ?? "never")}`),
|
|
2241
2281
|
""
|
|
2242
2282
|
] : [],
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2283
|
+
...passing.length ? [
|
|
2284
|
+
localize("## Passing checks", "## 通过的检查"),
|
|
2285
|
+
"",
|
|
2286
|
+
...passing.map(finding)
|
|
2287
|
+
] : []
|
|
2246
2288
|
].join("\n");
|
|
2247
2289
|
}
|
|
2290
|
+
//#endregion
|
|
2291
|
+
//#region src/cli/commands/doctor/render/redact.ts
|
|
2248
2292
|
function replaceAll$1(value, search, replacement) {
|
|
2249
2293
|
return search.length > 0 ? value.split(search).join(replacement) : value;
|
|
2250
2294
|
}
|
|
@@ -2261,14 +2305,41 @@ function redactDoctorReport(report) {
|
|
|
2261
2305
|
[os.homedir(), "<home>"]
|
|
2262
2306
|
].filter(([search], index, entries) => search.length > 0 && entries.findIndex(([value]) => value === search) === index).sort(([left], [right]) => right.length - left.length));
|
|
2263
2307
|
}
|
|
2308
|
+
//#endregion
|
|
2309
|
+
//#region src/cli/commands/doctor/render/text.ts
|
|
2310
|
+
function formatStatus(status) {
|
|
2311
|
+
return status === "pass" ? pc.green("PASS") : status === "warn" ? pc.yellow("WARN") : pc.red("FAIL");
|
|
2312
|
+
}
|
|
2313
|
+
function formatDoctorText(report, color = false) {
|
|
2314
|
+
const status = color ? formatStatus : (value) => value.toUpperCase();
|
|
2315
|
+
const lines = [
|
|
2316
|
+
localize(`workspace: ${report.workspaceDir}`, `工作区:${report.workspaceDir}`),
|
|
2317
|
+
localize(`packages: ${report.packageCount}`, `包数量:${report.packageCount}`),
|
|
2318
|
+
""
|
|
2319
|
+
];
|
|
2320
|
+
for (const { check, paths, count } of groupDoctorChecks(report.checks)) {
|
|
2321
|
+
const occurrences = count > 1 ? localize(` (${count} checks)`, `(${count} 项检查)`) : "";
|
|
2322
|
+
lines.push(`[${status(check.status)}] [${check.id}] ${check.title}${occurrences}`);
|
|
2323
|
+
for (const filename of paths) lines.push(localize(` path: ${filename}`, ` 路径:${filename}`));
|
|
2324
|
+
if (check.field !== void 0) lines.push(localize(` field: ${check.field}`, ` 字段:${check.field}`));
|
|
2325
|
+
lines.push(` ${check.detail}`);
|
|
2326
|
+
if (check.suppression) lines.push(` suppression: ${check.suppression.state}; reason: ${check.suppression.reason}; expires: ${check.suppression.expires ?? "never"}`);
|
|
2327
|
+
if (check.fix) lines.push(localize(` fix: ${check.fix}`, ` 修复:${check.fix}`));
|
|
2328
|
+
}
|
|
2329
|
+
for (const item of report.suppressions ?? []) lines.push(`suppression ${item.id}: ${item.state}; matched: ${item.matched}; reason: ${item.reason}; expires: ${item.expires ?? "never"}`);
|
|
2330
|
+
lines.push("");
|
|
2331
|
+
lines.push(color ? localize(`summary: ${pc.green(String(report.summary.pass))} pass, ${pc.yellow(String(report.summary.warn))} warn, ${pc.red(String(report.summary.fail))} fail`, `摘要:${pc.green(String(report.summary.pass))} 通过,${pc.yellow(String(report.summary.warn))} 警告,${pc.red(String(report.summary.fail))} 失败`) : localize(`summary: ${report.summary.pass} pass, ${report.summary.warn} warn, ${report.summary.fail} fail`, `摘要:${report.summary.pass} 通过,${report.summary.warn} 警告,${report.summary.fail} 失败`));
|
|
2332
|
+
return lines.join("\n");
|
|
2333
|
+
}
|
|
2334
|
+
//#endregion
|
|
2335
|
+
//#region src/cli/commands/doctor/render/index.ts
|
|
2264
2336
|
function createDoctorReportOutput(report, opts) {
|
|
2265
2337
|
const outputReport = opts.redact ? redactDoctorReport(report) : report;
|
|
2266
2338
|
if (opts.json) return JSON.stringify(outputReport, null, 2);
|
|
2267
|
-
|
|
2268
|
-
return formatDoctorReport(outputReport);
|
|
2339
|
+
return opts.markdown ? formatDoctorMarkdown(outputReport) : formatDoctorText(outputReport);
|
|
2269
2340
|
}
|
|
2270
2341
|
function createInteractiveDoctorReportOutput(report, opts) {
|
|
2271
|
-
return
|
|
2342
|
+
return formatDoctorText(opts.redact ? redactDoctorReport(report) : report, true);
|
|
2272
2343
|
}
|
|
2273
2344
|
function hasDoctorBlockingIssues(report, opts) {
|
|
2274
2345
|
return report.summary.fail > 0 || opts.strict === true && report.summary.warn > 0;
|
|
@@ -2338,7 +2409,7 @@ async function emitDoctorReport(report, opts, cwd) {
|
|
|
2338
2409
|
}
|
|
2339
2410
|
function registerDoctorCommand(program, cwd) {
|
|
2340
2411
|
registerInstallSecurityCommand(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 门禁")).option("--rules <ids>", localize("Select exact check IDs, separated by commas", "选择精确检查 ID,以逗号分隔")).option("--list-rules", localize("List all available check IDs", "列出全部可用检查 ID")).option("--fix", localize("Preview safe fixes without writing", "预览安全修复,不写入文件")).option("--apply <plan>", localize("Apply a reviewed doctor fix JSON plan", "应用已审核的 doctor 修复 JSON 计划")).action(async (opts) => {
|
|
2341
|
-
const commands = await import("./commands-
|
|
2412
|
+
const commands = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2342
2413
|
if (opts.fix && opts.apply || opts.apply && opts.rules !== void 0 || opts.listRules && (opts.fix || opts.apply || opts.rules !== void 0)) throw new Error("Use one of --list-rules, --fix, or --apply; --apply cannot change the reviewed rule selection.");
|
|
2343
2414
|
if (opts.listRules || opts.fix || opts.apply) {
|
|
2344
2415
|
if (opts.markdown || opts.redact) throw new Error("--markdown and --redact apply to diagnostic reports, not rule lists or executable plans.");
|
|
@@ -2407,7 +2478,7 @@ function registerUpgradeCommand(parent, cwd, alias) {
|
|
|
2407
2478
|
//#region src/cli/commands/top-level.ts
|
|
2408
2479
|
function registerTopLevelCommands(program, cwd) {
|
|
2409
2480
|
program.command("init").description(localize("Initialize the current workspace with recommended configuration", "初始化当前 workspace,并生成推荐配置")).option("--preset <preset>", localize("Initialization preset: minimal or standard", "初始化预设:minimal / 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) => {
|
|
2410
|
-
const { init } = await import("./commands-
|
|
2481
|
+
const { init } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2411
2482
|
const config = await loadMonorepoConfig(cwd);
|
|
2412
2483
|
const { preset } = resolveCommandValues("init", config.commands?.init, { preset: opts.preset }, { entry: "cli" }).values;
|
|
2413
2484
|
await init(cwd, {
|
|
@@ -2420,7 +2491,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
2420
2491
|
logger.info(localize("Next: run `pnpm install` and `pnpm build`.", "下一步:运行 `pnpm install` 和 `pnpm build`。"));
|
|
2421
2492
|
});
|
|
2422
2493
|
program.command("new").description(localize("Create a new package or application", "创建新的 package / app")).argument("[name]").option("--offline", localize("Use only verified cached remote assets", "只使用通过校验的远程资产缓存")).option("--data <file>", localize("Read typed template parameters from a JSON file", "从 JSON 文件读取类型化模板参数")).option("--cache-dir <directory>", localize("Template asset cache directory", "模板资产缓存目录")).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) => {
|
|
2423
|
-
const { runCreateFlow } = await import("./create-flow-
|
|
2494
|
+
const { runCreateFlow } = await import("./create-flow-CqtNwZs7.mjs");
|
|
2424
2495
|
const result = await runCreateFlow(cwd, inputName, {
|
|
2425
2496
|
...opts.offline !== void 0 ? { offline: opts.offline } : {},
|
|
2426
2497
|
...opts.cacheDir ? { cacheDir: opts.cacheDir } : {},
|
|
@@ -2443,22 +2514,22 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
2443
2514
|
function registerVerifyCommands(program, cwd) {
|
|
2444
2515
|
const verifyCommand = program.command("verify").alias("v").description(localize("Local verification commands", "本地校验工具集"));
|
|
2445
2516
|
verifyCommand.command("pre-push").description(localize("Run build, test, and tsd checks for pushed changes", "按推送变更范围执行 build/test/tsd 校验")).alias("push").action(async () => {
|
|
2446
|
-
const { verifyPrePush } = await import("./commands-
|
|
2517
|
+
const { verifyPrePush } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2447
2518
|
await verifyPrePush({ cwd });
|
|
2448
2519
|
});
|
|
2449
2520
|
verifyCommand.command("pre-commit").description(localize("Run Lefthook verification", "执行 Lefthook 校验")).alias("commit").action(async () => {
|
|
2450
|
-
const { verifyPreCommit } = await import("./commands-
|
|
2521
|
+
const { verifyPreCommit } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2451
2522
|
await verifyPreCommit({ cwd });
|
|
2452
2523
|
});
|
|
2453
2524
|
verifyCommand.command("commit-msg").description(localize("Run commitlint verification", "执行 commitlint 校验")).alias("msg").argument("<edit-file>").action(async (editFile) => {
|
|
2454
|
-
const { verifyCommitMsg } = await import("./commands-
|
|
2525
|
+
const { verifyCommitMsg } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2455
2526
|
await verifyCommitMsg({
|
|
2456
2527
|
cwd,
|
|
2457
2528
|
editFile
|
|
2458
2529
|
});
|
|
2459
2530
|
});
|
|
2460
2531
|
verifyCommand.command("staged-typecheck").description(localize("Run typecheck in workspaces containing staged files", "按暂存文件所在 workspace 执行 typecheck")).alias("tc").argument("[files...]").action(async (files = []) => {
|
|
2461
|
-
const { verifyStagedTypecheck } = await import("./commands-
|
|
2532
|
+
const { verifyStagedTypecheck } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2462
2533
|
verifyStagedTypecheck(files.length ? files : void 0, { cwd });
|
|
2463
2534
|
});
|
|
2464
2535
|
}
|
|
@@ -2822,12 +2893,12 @@ function registerWorkspaceCommands(program, cwd) {
|
|
|
2822
2893
|
registerWorkspaceRemoval(workspaceCommand, cwd);
|
|
2823
2894
|
registerWorkspaceMove(workspaceCommand, cwd);
|
|
2824
2895
|
workspaceCommand.command("init").description(localize("Initialize workspace metadata and repository files", "初始化工作区元信息(README、package.json、pnpm intent、issue template)")).alias("i").action(async () => {
|
|
2825
|
-
const { initMetadata } = await import("./commands-
|
|
2896
|
+
const { initMetadata } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2826
2897
|
await initMetadata(cwd);
|
|
2827
2898
|
logger.success(localize("Workspace initialization finished.", "Workspace 初始化完成。"));
|
|
2828
2899
|
});
|
|
2829
2900
|
workspaceCommand.command("list").description(localize("List workspace packages", "列出 workspace 包")).alias("ls").option("--json", localize("Output JSON", "输出 JSON")).option("--markdown", localize("Output Markdown", "输出 Markdown,方便粘贴到 issue 或 PR")).option("--redact", localize("Redact workspace, cwd, and home paths", "脱敏 workspace/cwd/home 绝对路径后再输出")).option("--include-private", localize("Include private packages", "包含 private 包")).option("--include-root", localize("Include the workspace root package", "包含 workspace 根包")).option("-p, --pattern <glob>", localize("Append a workspace glob; repeatable", "追加自定义 workspace glob,可重复"), collectValues).option("--out <file>", localize("Write the package list to a file", "把当前列表输出写入文件")).action(async (opts) => {
|
|
2830
|
-
const { getWorkspacePackageSummaries } = await import("./workspace-tasks
|
|
2901
|
+
const { getWorkspacePackageSummaries } = await import("./workspace-tasks-CbetXdoh.mjs").then((n) => n.Kt);
|
|
2831
2902
|
await emitWorkspaceList(await getWorkspacePackageSummaries(cwd, {
|
|
2832
2903
|
ignorePrivatePackage: !opts.includePrivate,
|
|
2833
2904
|
ignoreRootPackage: !opts.includeRoot,
|
|
@@ -2835,7 +2906,7 @@ function registerWorkspaceCommands(program, cwd) {
|
|
|
2835
2906
|
}), opts);
|
|
2836
2907
|
});
|
|
2837
2908
|
workspaceCommand.command("clean").description(localize("Remove selected workspace packages", "清除选中的包")).alias("rm").option("-y, --yes", localize("Select all eligible workspace packages without prompting", "跳过交互并选择所有符合条件的工作区包")).option("--dry-run", localize("Preview directory deletions and metadata changes without writing", "预览目录删除和元数据变更,不写入文件")).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) => {
|
|
2838
|
-
const { cleanProjects } = await import("./commands-
|
|
2909
|
+
const { cleanProjects } = await import("./commands-C8PiGh9h.mjs").then((n) => n.t);
|
|
2839
2910
|
await cleanProjects(cwd, normalizeCleanOptions(opts));
|
|
2840
2911
|
});
|
|
2841
2912
|
}
|