@icebreakers/monorepo 6.4.0 → 6.4.1
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-BahTYIy-.mjs → baseline-CgvgNCUI.mjs} +3 -5
- package/dist/{bundle-B9vRch4R.mjs → bundle-BT26jZsH.mjs} +1 -2
- package/dist/{catalog-CXITrKhb.mjs → catalog-zafyCCYH.mjs} +11 -18
- package/dist/cli.mjs +141 -220
- package/dist/{commands-1ApnhvJF.mjs → commands-By0wXIqB.mjs} +371 -725
- package/dist/{config-BmK7bacv.mjs → config-CnB1hpD_.mjs} +4 -5
- package/dist/{create-flow-B2sFa_5j.mjs → create-flow-B6mkhe47.mjs} +6 -9
- package/dist/{deps-BbkQSTqk.mjs → deps-BJyokXyG.mjs} +6 -8
- package/dist/docs-context-entry.d.mts +0 -4
- package/dist/docs-context-entry.mjs +2 -4
- package/dist/{execute-0NGtp4hR.mjs → execute-By0DFwdk.mjs} +12 -22
- package/dist/{execute-BdnLU2-t.mjs → execute-dyUt94Dv.mjs} +4 -6
- package/dist/{format-BcU-hzT_.mjs → format-qyk-2EXc.mjs} +2 -3
- package/dist/{index-BBYRSLAi.d.mts → index-CyUOTGW4.d.mts} +1 -85
- package/dist/index.d.mts +3 -345
- package/dist/index.mjs +11 -13
- package/dist/{inputs-DCMUM9kz.mjs → inputs-D0jkn1xJ.mjs} +2 -3
- package/dist/{npm-DB-0FHcW.mjs → npm-BkilS3Rx.mjs} +2 -3
- package/dist/{plan-C47MSubl.mjs → plan-lepevajA.mjs} +2 -3
- package/dist/{rolldown-runtime-8H4AJuhK.mjs → rolldown-runtime-BJohB4LM.mjs} +1 -2
- package/dist/{run-5IdtzJJR.mjs → run-Coc92Trs.mjs} +6 -8
- package/dist/{save-cKCfFQrh.mjs → save-6C5t4ZGp.mjs} +4 -5
- package/dist/{scan-Diyd5MkZ.mjs → scan-DsiJldTw.mjs} +7 -12
- package/dist/{template-drift-C8gMh7d5.mjs → template-drift-DOG6iGjV.mjs} +60 -113
- package/dist/tooling-entry.d.mts +1 -1
- package/dist/tooling-entry.mjs +2 -2
- package/dist/{transaction-B33_Cacq.mjs → transaction-DWst6RWq.mjs} +6 -10
- package/dist/{tsconfig-B32VPzfD.mjs → tsconfig-KnvwNzkL.mjs} +36 -63
- package/dist/{vitest-HFe4zq1M.mjs → vitest-YHXyRHui.mjs} +6 -9
- package/dist/{workspace-tasks-xyIJwdmH.mjs → workspace-tasks-i69iIhom.mjs} +78 -157
- package/package.json +10 -10
package/dist/cli.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { d as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { E as checkDependencyAdmission, T as checkWorkspaceBoundaries, f as inspectInstallSecurity } from "./template-drift-
|
|
1
|
+
import { $ as formatUpgradePlan, A as applyProjectReferencesPlan, At as renderReleasePullRequest, B as installGitHooks, E as releaseSnapshot, Et as validateSnapshotSource, G as planDocsDeployment, H as planInstallSecurityPreset, I as applyOrganizationPresetAssets, J as checkPublicApi, Jt as planUpgrade, K as checkPeerDependencies, L as planOrganizationPresetAssets, M as checkPackages, Mt as createAutoChangesetPlan, N as getMaintenanceWorkflow, Nt as getAutoChangesetWorkflow, O as checkProjectReferences, Ot as parsePublishSummary, P as prepareMaintenanceUpgrade, Q as upgradeMonorepo, S as createReleasePlan, T as formatNightlySummary, Tt as validateSnapshotBuildPlan, U as deployDocs, V as applyInstallSecurityPreset, W as DocsDeploymentError, X as planPublicApiUpdate, Y as applyPublicApiUpdate, Yt as applyUpgradePlan, Z as formatPublicApiReport, _ as createSnapshotBuildPlan, a as planWorkspaceMove, an as resolveTemplateCatalog, at as readReleasePreparationPolicy, b as createSnapshotFreezeRecord, c as applyToolingCapability, d as planTemplateValidation, dn as validateConfigFile, f as getSnapshotWorkflows, g as prepareSnapshot, h as publishPreparedSnapshot, i as applyWorkspaceMovePlan, in as createTemplateCatalog, it as validateReleasePreparation, j as planProjectReferences, jt as applyAutoChangeset, k as syncProjectReferences, kt as resolveReleaseMode, l as planToolingCapability, ln as explainMonorepoConfig, m as snapshotWorkflowDefaults, n as applyWorkspaceRemovalPlan, o as applyWorkspaceArtifactPlan, on as loadTemplateCatalogContext, p as resolveSnapshotWorkflowOptions, r as planWorkspaceRemoval, rn as resolveRemoteTemplateSource, s as planWorkspaceArtifact, u as validateTemplate, un as sanitizeConfigReport, v as verifySnapshotRun, w as releaseNightly, x as verifyPreparedSnapshotConsumer, y as freezeSnapshotSource, yt as releaseBootstrap, zt as initToolingTargets } from "./commands-By0wXIqB.mjs";
|
|
2
|
+
import { N as ConfigValidationError, Q as splitConfigPath, S as canonicalDirectory, _ as listToolingCapabilities, d as loadMonorepoConfig, f as loadMonorepoConfigDetails, j as version, p as resolveCommandConfig, q as withLegacyHookConfig } from "./tsconfig-KnvwNzkL.mjs";
|
|
3
|
+
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-i69iIhom.mjs";
|
|
4
|
+
import { s as resolveCommandValues } from "./scan-DsiJldTw.mjs";
|
|
5
|
+
import { d as logger } from "./execute-By0DFwdk.mjs";
|
|
6
|
+
import { E as checkDependencyAdmission, T as checkWorkspaceBoundaries, f as inspectInstallSecurity } from "./template-drift-DOG6iGjV.mjs";
|
|
7
7
|
import { findWorkspaceDir } from "@pnpm/find-workspace-dir";
|
|
8
8
|
import path from "pathe";
|
|
9
9
|
import process from "node:process";
|
|
@@ -16,7 +16,7 @@ import os from "node:os";
|
|
|
16
16
|
import { performance } from "node:perf_hooks";
|
|
17
17
|
import { setTimeout } from "node:timers/promises";
|
|
18
18
|
import { Command, Option } from "commander";
|
|
19
|
-
|
|
19
|
+
// src/cli/config-preflight.ts
|
|
20
20
|
function registerConfigPreflight(program, cwd) {
|
|
21
21
|
program.hook("preAction", async (_parent, action) => {
|
|
22
22
|
if (action.name() === "templates" && action.parent === program) return;
|
|
@@ -52,13 +52,12 @@ function reportCliFailure(error) {
|
|
|
52
52
|
process.stderr.write(`${output}\n`);
|
|
53
53
|
process.exitCode = 1;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
//#region src/cli/commands/ai.ts
|
|
55
|
+
// src/cli/commands/ai.ts
|
|
57
56
|
async function handleAiPromptCreate(cwd, opts) {
|
|
58
57
|
const [{ input }, { createTimestampFolderName, defaultAgenticBaseDir, generateAgenticTemplate, generateAgenticTemplates, loadAgenticTasks }, { resolveCommandConfig }] = await Promise.all([
|
|
59
58
|
import("@icebreakers/monorepo-templates"),
|
|
60
|
-
import("./commands-
|
|
61
|
-
import("./tsconfig-
|
|
59
|
+
import("./commands-By0wXIqB.mjs").then((n) => n.t),
|
|
60
|
+
import("./tsconfig-KnvwNzkL.mjs").then((n) => n.c)
|
|
62
61
|
]);
|
|
63
62
|
const aiConfig = await resolveCommandConfig("ai", cwd);
|
|
64
63
|
const resolved = resolveCommandValues("ai", aiConfig, {
|
|
@@ -108,8 +107,7 @@ function registerAiCommands(program, cwd) {
|
|
|
108
107
|
await handleAiPromptCreate(cwd, opts);
|
|
109
108
|
});
|
|
110
109
|
}
|
|
111
|
-
|
|
112
|
-
//#region src/cli/commands/config-explanation.ts
|
|
110
|
+
// src/cli/commands/config-explanation.ts
|
|
113
111
|
function parseConfigOverrides(inputs = []) {
|
|
114
112
|
const result = {};
|
|
115
113
|
for (const input of inputs) {
|
|
@@ -159,8 +157,7 @@ function formatConfigExplanation(report) {
|
|
|
159
157
|
return `${field}: ${JSON.stringify(value)} (${identity?.kind === "preset" ? `${identity.packageName}@${identity.version}` : source})`;
|
|
160
158
|
})].join("\n");
|
|
161
159
|
}
|
|
162
|
-
|
|
163
|
-
//#region src/cli/commands/config.ts
|
|
160
|
+
// src/cli/commands/config.ts
|
|
164
161
|
function formatConfigInspection(inspection) {
|
|
165
162
|
const commandKeys = Object.keys(inspection.config.commands ?? {});
|
|
166
163
|
const toolingKeys = Object.keys(inspection.config.tooling ?? {});
|
|
@@ -247,7 +244,7 @@ function registerConfigCommands(program, cwd) {
|
|
|
247
244
|
if (!report.valid) throw new ConfigValidationError(report.diagnostics);
|
|
248
245
|
await emitConfigInspection(report, opts, cwd, report);
|
|
249
246
|
} else {
|
|
250
|
-
const { inspectMonorepoConfig } = await import("./commands-
|
|
247
|
+
const { inspectMonorepoConfig } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
251
248
|
await emitConfigInspection(await inspectMonorepoConfig(cwd), opts, cwd);
|
|
252
249
|
}
|
|
253
250
|
} catch (error) {
|
|
@@ -268,8 +265,7 @@ function registerConfigCommands(program, cwd) {
|
|
|
268
265
|
if (!report.valid) process.exitCode = 1;
|
|
269
266
|
});
|
|
270
267
|
}
|
|
271
|
-
|
|
272
|
-
//#region src/cli/commands/deps/admission.ts
|
|
268
|
+
// src/cli/commands/deps/admission.ts
|
|
273
269
|
function registerDependencyAdmission(deps, cwd) {
|
|
274
270
|
deps.command("policy").description(localize("Check direct third-party dependency admission", "检查第三方直接依赖准入规则")).option("--json", localize("Output stable JSON", "输出稳定 JSON")).option("--baseline <file>", localize("Compare a reviewed report; missing or incompatible baselines fail", "对比已审核报告;缺失或不兼容基线将失败")).option("--full", localize("Explicitly check all violations, ignoring a baseline", "显式检查全部违规,不使用基线")).option("--strict", localize("Also fail on warnings", "警告也返回失败")).action(async (options) => {
|
|
275
271
|
let baseline;
|
|
@@ -294,13 +290,12 @@ function registerDependencyAdmission(deps, cwd) {
|
|
|
294
290
|
if (report.summary.fail || options.strict && report.summary.warn) process.exitCode = 1;
|
|
295
291
|
});
|
|
296
292
|
}
|
|
297
|
-
|
|
298
|
-
//#region src/cli/commands/deps/catalog.ts
|
|
293
|
+
// src/cli/commands/deps/catalog.ts
|
|
299
294
|
const output$2 = (value) => process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
300
295
|
function registerCatalogCommands(deps, cwd) {
|
|
301
296
|
const catalog = deps.command("catalog").description(localize("Inspect pnpm catalogs and review coordinated migrations", "巡检 pnpm catalog 并审阅联动迁移"));
|
|
302
297
|
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) => {
|
|
303
|
-
const { checkCatalogs } = await import("./catalog-
|
|
298
|
+
const { checkCatalogs } = await import("./catalog-zafyCCYH.mjs").then((n) => n.t);
|
|
304
299
|
const report = await checkCatalogs(cwd, options);
|
|
305
300
|
if (options.json) output$2(report);
|
|
306
301
|
else {
|
|
@@ -310,7 +305,7 @@ function registerCatalogCommands(deps, cwd) {
|
|
|
310
305
|
if (report.summary.missing || report.summary.direct) process.exitCode = 1;
|
|
311
306
|
});
|
|
312
307
|
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) => {
|
|
313
|
-
const { planCatalogMigration } = await import("./catalog-
|
|
308
|
+
const { planCatalogMigration } = await import("./catalog-zafyCCYH.mjs").then((n) => n.t);
|
|
314
309
|
const plan = await planCatalogMigration(cwd, {
|
|
315
310
|
dependency,
|
|
316
311
|
...options
|
|
@@ -322,14 +317,13 @@ function registerCatalogCommands(deps, cwd) {
|
|
|
322
317
|
}
|
|
323
318
|
});
|
|
324
319
|
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) => {
|
|
325
|
-
const { applyCatalogMigrationPlan } = await import("./catalog-
|
|
320
|
+
const { applyCatalogMigrationPlan } = await import("./catalog-zafyCCYH.mjs").then((n) => n.t);
|
|
326
321
|
const result = await applyCatalogMigrationPlan(cwd, JSON.parse(await readFile(file, "utf8")));
|
|
327
322
|
if (options.json) output$2(result);
|
|
328
323
|
else process.stdout.write(`${result.status}: ${result.changed.join(", ")}\n${result.nextSteps.join("\n")}\n`);
|
|
329
324
|
});
|
|
330
325
|
}
|
|
331
|
-
|
|
332
|
-
//#region src/cli/commands/deps/peers.ts
|
|
326
|
+
// src/cli/commands/deps/peers.ts
|
|
333
327
|
function registerPeerChecks(deps, cwd) {
|
|
334
328
|
deps.command("peers").description(localize("Check peer promises against development/test versions", "检查 peer 支持范围与开发测试版本是否兼容")).option("--json", localize("Output a versioned JSON report", "输出带版本的 JSON 报告")).option("--strict", localize("Also fail on unknown compatibility", "无法确定兼容性时也失败")).action(async (options) => {
|
|
335
329
|
const report = await checkPeerDependencies(cwd);
|
|
@@ -338,8 +332,7 @@ function registerPeerChecks(deps, cwd) {
|
|
|
338
332
|
if (report.summary.fail || options.strict && report.summary.unknown) process.exitCode = 1;
|
|
339
333
|
});
|
|
340
334
|
}
|
|
341
|
-
|
|
342
|
-
//#region src/cli/commands/deps.ts
|
|
335
|
+
// src/cli/commands/deps.ts
|
|
343
336
|
function output$1(value) {
|
|
344
337
|
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
345
338
|
}
|
|
@@ -349,7 +342,7 @@ function registerDepsCommands(program, cwd) {
|
|
|
349
342
|
registerDependencyAdmission(deps, cwd);
|
|
350
343
|
registerCatalogCommands(deps, cwd);
|
|
351
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) => {
|
|
352
|
-
const { checkDependencies } = await import("./deps-
|
|
345
|
+
const { checkDependencies } = await import("./deps-BJyokXyG.mjs").then((n) => n.n);
|
|
353
346
|
const report = await checkDependencies(cwd);
|
|
354
347
|
if (options.json) output$1(report);
|
|
355
348
|
else for (const group of report.groups) {
|
|
@@ -359,7 +352,7 @@ function registerDepsCommands(program, cwd) {
|
|
|
359
352
|
if (report.summary.equivalent + report.summary.compatible + report.summary.conflict > 0) process.exitCode = 1;
|
|
360
353
|
});
|
|
361
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) => {
|
|
362
|
-
const { planDependencyFix } = await import("./deps-
|
|
355
|
+
const { planDependencyFix } = await import("./deps-BJyokXyG.mjs").then((n) => n.n);
|
|
363
356
|
const plan = await planDependencyFix(cwd, {
|
|
364
357
|
dependency,
|
|
365
358
|
section: options.section,
|
|
@@ -374,7 +367,7 @@ function registerDepsCommands(program, cwd) {
|
|
|
374
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"));
|
|
375
368
|
});
|
|
376
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) => {
|
|
377
|
-
const { applyDependencyFixPlan } = await import("./deps-
|
|
370
|
+
const { applyDependencyFixPlan } = await import("./deps-BJyokXyG.mjs").then((n) => n.n);
|
|
378
371
|
const result = await applyDependencyFixPlan(cwd, JSON.parse(await readFile(file, "utf8")));
|
|
379
372
|
if (options.json) output$1(result);
|
|
380
373
|
else {
|
|
@@ -383,8 +376,7 @@ function registerDepsCommands(program, cwd) {
|
|
|
383
376
|
}
|
|
384
377
|
});
|
|
385
378
|
}
|
|
386
|
-
|
|
387
|
-
//#region src/cli/commands/docs.ts
|
|
379
|
+
// src/cli/commands/docs.ts
|
|
388
380
|
function registerDocsCommands(program, cwd) {
|
|
389
381
|
const docs = program.command("docs").description(localize("Preview and publish release-aligned documentation", "预览及发布与稳定版本一致的文档"));
|
|
390
382
|
for (const action of ["plan", "deploy"]) docs.command(action).description(action === "plan" ? localize("Inspect documentation publication without side effects", "只读检查文档发布计划") : localize("Build and deploy a verified documentation snapshot", "构建并部署经验证的文档快照")).argument("<site>", localize("Configured documentation site ID", "已配置的文档站点 ID")).requiredOption("--channel <channel>", localize("preview or stable", "preview 或 stable")).option("--source-sha <sha>", localize("Exact preview commit", "预览源的完整提交 SHA")).option("--release <id>", localize("Persisted stable release completion ID", "稳定发布完成记录 ID")).option("--commits <sha...>", localize("Selected documentation correction commits", "明确挑选的文档修正提交")).option("--json", localize("Print machine-readable JSON", "输出 JSON")).action(async (site, input) => {
|
|
@@ -409,13 +401,12 @@ function registerDocsCommands(program, cwd) {
|
|
|
409
401
|
}
|
|
410
402
|
});
|
|
411
403
|
}
|
|
412
|
-
|
|
413
|
-
//#region src/cli/commands/env/check.ts
|
|
404
|
+
// src/cli/commands/env/check.ts
|
|
414
405
|
function registerEnvironmentCheck(command, cwd) {
|
|
415
406
|
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) => {
|
|
416
407
|
if (options.json && options.markdown) throw new Error("--json and --markdown cannot be combined");
|
|
417
|
-
const { checkEnvironmentCache } = await import("./workspace-tasks-
|
|
418
|
-
const { formatEnvironmentCache } = await import("./workspace-tasks-
|
|
408
|
+
const { checkEnvironmentCache } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.F);
|
|
409
|
+
const { formatEnvironmentCache } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.N);
|
|
419
410
|
const report = await checkEnvironmentCache(cwd, {
|
|
420
411
|
...tasks.length ? { tasks } : {},
|
|
421
412
|
...action.getOptionValueSource("frameworkInference") === "cli" ? { frameworkInference: options.frameworkInference } : {}
|
|
@@ -424,8 +415,7 @@ function registerEnvironmentCheck(command, cwd) {
|
|
|
424
415
|
if (report.status === "fail" || options.strict && report.status === "warn") process.exitCode = 1;
|
|
425
416
|
});
|
|
426
417
|
}
|
|
427
|
-
|
|
428
|
-
//#region src/cli/commands/env/output.ts
|
|
418
|
+
// src/cli/commands/env/output.ts
|
|
429
419
|
function formatMarkdownTable$3(rows) {
|
|
430
420
|
const formatCell = (value) => String(value ?? "-").split("|").join("\\|").split("\n").join("<br>");
|
|
431
421
|
return [
|
|
@@ -589,8 +579,7 @@ function createEnvSnapshotOutput(snapshot, opts) {
|
|
|
589
579
|
function hasStrictEnvSnapshotIssues(snapshot) {
|
|
590
580
|
return snapshot.doctor.summary.fail > 0 || snapshot.doctor.summary.warn > 0;
|
|
591
581
|
}
|
|
592
|
-
|
|
593
|
-
//#region src/cli/commands/env/support.ts
|
|
582
|
+
// src/cli/commands/env/support.ts
|
|
594
583
|
function formatEnvInfo(info) {
|
|
595
584
|
return [
|
|
596
585
|
`cwd: ${info.cwd}`,
|
|
@@ -695,8 +684,7 @@ function createEnvSupportBundleOutput(bundle, opts) {
|
|
|
695
684
|
function hasStrictSupportBundleIssues(bundle) {
|
|
696
685
|
return bundle.doctor.summary.fail > 0 || bundle.doctor.summary.warn > 0;
|
|
697
686
|
}
|
|
698
|
-
|
|
699
|
-
//#region src/cli/commands/env.ts
|
|
687
|
+
// src/cli/commands/env.ts
|
|
700
688
|
async function emitEnvInfo(info, opts, cwd) {
|
|
701
689
|
const content = createEnvInfoOutput(info, opts);
|
|
702
690
|
if (!opts.out) {
|
|
@@ -741,33 +729,32 @@ function registerEnvCommands(program, cwd) {
|
|
|
741
729
|
const envCommand = program.command("env").alias("e").description(localize("Environment and support commands", "环境命令"));
|
|
742
730
|
registerEnvironmentCheck(envCommand, cwd);
|
|
743
731
|
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) => {
|
|
744
|
-
const { collectEnvInfo } = await import("./commands-
|
|
732
|
+
const { collectEnvInfo } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
745
733
|
await emitEnvInfo(await collectEnvInfo(cwd), opts, cwd);
|
|
746
734
|
});
|
|
747
735
|
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) => {
|
|
748
|
-
const { collectEnvSnapshot } = await import("./commands-
|
|
736
|
+
const { collectEnvSnapshot } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
749
737
|
await emitEnvSnapshot(await collectEnvSnapshot(cwd), opts, cwd);
|
|
750
738
|
});
|
|
751
739
|
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) => {
|
|
752
|
-
const { collectEnvPaths } = await import("./commands-
|
|
740
|
+
const { collectEnvPaths } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
753
741
|
await emitEnvPaths(await collectEnvPaths(cwd), opts, cwd);
|
|
754
742
|
});
|
|
755
743
|
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) => {
|
|
756
|
-
const { collectEnvSupportBundle } = await import("./commands-
|
|
744
|
+
const { collectEnvSupportBundle } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
757
745
|
await emitEnvSupportBundle(await collectEnvSupportBundle(cwd), opts, cwd);
|
|
758
746
|
});
|
|
759
747
|
envCommand.command("mirror").description(localize("Configure the VS Code binary mirror", "设置 VS Code binary mirror")).alias("m").action(async () => {
|
|
760
|
-
const { setVscodeBinaryMirror } = await import("./commands-
|
|
748
|
+
const { setVscodeBinaryMirror } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
761
749
|
await setVscodeBinaryMirror(cwd);
|
|
762
750
|
logger.success(localize("Environment mirror finished.", "环境镜像完成。"));
|
|
763
751
|
});
|
|
764
752
|
}
|
|
765
|
-
|
|
766
|
-
//#region src/cli/commands/generate.ts
|
|
753
|
+
// src/cli/commands/generate.ts
|
|
767
754
|
function registerGenerateCommand(program, cwd) {
|
|
768
755
|
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) => {
|
|
769
756
|
try {
|
|
770
|
-
const { applyGeneratePlan, planGenerate } = await import("./workspace-tasks-
|
|
757
|
+
const { applyGeneratePlan, planGenerate } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.v);
|
|
771
758
|
const extra = options.params ? JSON.parse(options.params) : {};
|
|
772
759
|
if (!extra || typeof extra !== "object" || Array.isArray(extra)) throw new Error("--params must contain a JSON object.");
|
|
773
760
|
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.");
|
|
@@ -800,8 +787,7 @@ function registerGenerateCommand(program, cwd) {
|
|
|
800
787
|
}
|
|
801
788
|
});
|
|
802
789
|
}
|
|
803
|
-
|
|
804
|
-
//#region src/cli/commands/maintenance.ts
|
|
790
|
+
// src/cli/commands/maintenance.ts
|
|
805
791
|
function registerMaintenanceCommands(program, cwd) {
|
|
806
792
|
const maintenance = program.command("maintenance").description(localize("Prepare reviewed managed asset upgrades", "准备可审核的受管资产升级"));
|
|
807
793
|
maintenance.command("upgrade").description(localize("Generate a validated patch in a disposable clean checkout", "在一次性干净 checkout 中生成经过校验的补丁")).requiredOption("--base <sha>", localize("Full trusted source commit before the dependency update", "依赖升级前的完整可信提交 SHA")).option("--head <sha>", localize("Exact current source commit (default: HEAD)", "当前精确源码提交(默认 HEAD)")).requiredOption("--out <directory>", localize("Empty artifact directory outside the repository", "仓库外的空产物目录")).action(async (options) => {
|
|
@@ -821,8 +807,7 @@ function registerMaintenanceCommands(program, cwd) {
|
|
|
821
807
|
process.stdout.write(`${filename}\n`);
|
|
822
808
|
});
|
|
823
809
|
}
|
|
824
|
-
|
|
825
|
-
//#region src/cli/commands/package/api-report.ts
|
|
810
|
+
// src/cli/commands/package/api-report.ts
|
|
826
811
|
function registerPublicApiCommands(command, cwd) {
|
|
827
812
|
const api = command.command("api").description(localize("Review built public API signatures", "审核构建后的公共 API 签名"));
|
|
828
813
|
api.command("check").description(localize("Read-only comparison with declared API baselines", "只读比较显式声明的 API 基线")).option("--package <selector...>", localize("Exact workspace names or ./paths", "精确工作区名称或 ./路径")).option("--json", localize("Output a stable JSON report", "输出稳定 JSON 报告")).action(async (opts) => {
|
|
@@ -842,8 +827,7 @@ function registerPublicApiCommands(command, cwd) {
|
|
|
842
827
|
if (plan.report.status === "failed") process.exitCode = 1;
|
|
843
828
|
});
|
|
844
829
|
}
|
|
845
|
-
|
|
846
|
-
//#region src/cli/commands/package/check.ts
|
|
830
|
+
// src/cli/commands/package/check.ts
|
|
847
831
|
function registerPackageCheckCommand(command, cwd) {
|
|
848
832
|
command.command("check").description(localize("Build, pack, and test packages as consumers receive them", "构建并校验消费者实际收到的发布 tarball")).option("--filter <selector>", localize("Select packages using pnpm filters (repeatable)", "用 pnpm filter 选择包,可重复传入"), (value, values = []) => [...values, value]).option("--include-private", localize("Also check private packages", "同时校验 private 包")).option("--build-script <script>", localize("Workspace build script (default: build)", "workspace 构建脚本,默认为 build")).option("--strict", localize("Treat warnings as failures", "将 warning 视为失败")).option("--keep-temp", localize("Preserve tarballs and consumers for reproduction", "保留 tarball 和临时消费者,便于复现")).option("--json", localize("Output the complete machine-readable report", "输出完整 JSON 报告")).action(async (options) => {
|
|
849
833
|
const report = await checkPackages({
|
|
@@ -862,14 +846,13 @@ function registerPackageCheckCommand(command, cwd) {
|
|
|
862
846
|
if (report.status === "failed") process.exitCode = 1;
|
|
863
847
|
});
|
|
864
848
|
}
|
|
865
|
-
|
|
866
|
-
//#region src/cli/commands/package.ts
|
|
849
|
+
// src/cli/commands/package.ts
|
|
867
850
|
function registerPackageCommands(program, cwd) {
|
|
868
851
|
const packageCommand = program.command("package").alias("pkg").description(localize("Package commands", "子包命令"));
|
|
869
852
|
registerPackageCheckCommand(packageCommand, cwd);
|
|
870
853
|
registerPublicApiCommands(packageCommand, cwd);
|
|
871
854
|
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) => {
|
|
872
|
-
const { runCreateFlow } = await import("./create-flow-
|
|
855
|
+
const { runCreateFlow } = await import("./create-flow-B6mkhe47.mjs");
|
|
873
856
|
const result = await runCreateFlow(cwd, inputName, {
|
|
874
857
|
...opts.offline !== void 0 ? { offline: opts.offline } : {},
|
|
875
858
|
...opts.cacheDir ? { cacheDir: opts.cacheDir } : {},
|
|
@@ -883,8 +866,7 @@ function registerPackageCommands(program, cwd) {
|
|
|
883
866
|
logger.success(localize("Package creation finished.", "包创建完成。"));
|
|
884
867
|
});
|
|
885
868
|
}
|
|
886
|
-
|
|
887
|
-
//#region src/cli/commands/presets.ts
|
|
869
|
+
// src/cli/commands/presets.ts
|
|
888
870
|
function registerPresetCommands(program, cwd) {
|
|
889
871
|
const presets = program.command("presets").description(localize("Inspect installed organization presets and review engineering asset updates", "检查已安装的组织预设并审阅工程文件更新"));
|
|
890
872
|
presets.command("inspect").description(localize("Show installed package identities and recommendations without running package code", "只读查看预设包身份及推荐能力,不运行包代码")).option("--json", localize("Output JSON", "输出 JSON")).action(async (options) => {
|
|
@@ -920,8 +902,7 @@ function registerPresetCommands(program, cwd) {
|
|
|
920
902
|
process.stdout.write(`${options.json ? JSON.stringify(result, null, 2) : `${result.status}: ${result.changed.length} files`}\n`);
|
|
921
903
|
});
|
|
922
904
|
}
|
|
923
|
-
|
|
924
|
-
//#region src/cli/commands/release/auto-changeset.ts
|
|
905
|
+
// src/cli/commands/release/auto-changeset.ts
|
|
925
906
|
function registerAutoChangeset(release, cwd) {
|
|
926
907
|
release.command("auto-changeset").description(localize("Plan or apply approved automatic changesets from immutable GitHub metadata", "从不可变 GitHub 元数据规划或审批写入自动 changeset")).option("--repository <owner/repository>", localize("GitHub repository", "GitHub 仓库")).option("--pr <number>", localize("Pull request number", "Pull request 编号")).option("--policy-path <path>", localize("JSON policy on the trusted default branch", "可信默认分支上的 JSON 策略路径")).option("--head <sha>", localize("Expected PR head SHA", "预期 PR head SHA")).option("--base <sha>", localize("Expected PR base SHA", "预期 PR base SHA")).option("--apply", localize("Apply within the protected default-branch workflow", "在受保护的默认分支工作流中写入")).option("--expected <file>", localize("Frozen JSON plan required when applying", "写入时必需的冻结 JSON 计划")).option("--environment <name>", localize("Protected approval environment", "受保护的审批环境")).option("--workflow-path <path>", localize("Trusted workflow repository path", "可信工作流仓库路径")).option("--workflow-name <name>", localize("Exported workflow display name", "导出的工作流名称")).option("--plan-job-name <name>", localize("Trusted plan job name", "可信规划任务名称")).option("--apply-job-name <name>", localize("Protected apply job name", "受保护的写入任务名称")).option("--workflow", localize("Export the thin plan/approval workflow", "导出规划与审批的薄工作流")).option("--out <file>", localize("Write the report or workflow to a file", "将报告或工作流写入文件")).option("--json", localize("Output a versioned JSON report", "输出有版本结构的 JSON 报告")).action(async (options) => {
|
|
927
908
|
const approval = {
|
|
@@ -965,8 +946,7 @@ function registerAutoChangeset(release, cwd) {
|
|
|
965
946
|
else process.stdout.write(output);
|
|
966
947
|
});
|
|
967
948
|
}
|
|
968
|
-
|
|
969
|
-
//#region src/cli/commands/release/bootstrap.ts
|
|
949
|
+
// src/cli/commands/release/bootstrap.ts
|
|
970
950
|
function runNumber(value, label) {
|
|
971
951
|
if (value === void 0) return;
|
|
972
952
|
const result = Number(value);
|
|
@@ -1013,8 +993,7 @@ function registerBootstrap(release, cwd) {
|
|
|
1013
993
|
}
|
|
1014
994
|
});
|
|
1015
995
|
}
|
|
1016
|
-
|
|
1017
|
-
//#region src/cli/commands/release/nightly.ts
|
|
996
|
+
// src/cli/commands/release/nightly.ts
|
|
1018
997
|
function registerNightly(release, cwd) {
|
|
1019
998
|
release.command("nightly").description(localize("Prepare or publish nightly packages from the default branch in GitHub Actions", "在 GitHub Actions 中从默认分支准备或发布 nightly 包")).option("--publish", localize("Upload verified packages using the configured nightly provider", "使用配置的 nightly 后端上传已验证的包")).option("--dry-run", localize("Only inspect the source, packages and publication state", "只检查源码、候选包和发布状态")).option("--output <directory>", localize("Artifact directory outside the checkout", "源码仓库以外的产物目录")).option("--json", localize("Output a versioned JSON report", "输出有版本结构的 JSON 报告")).action(async (options) => {
|
|
1020
999
|
try {
|
|
@@ -1034,8 +1013,7 @@ function registerNightly(release, cwd) {
|
|
|
1034
1013
|
}
|
|
1035
1014
|
});
|
|
1036
1015
|
}
|
|
1037
|
-
|
|
1038
|
-
//#region src/commands/release/npmmirror/http.ts
|
|
1016
|
+
// src/commands/release/npmmirror/http.ts
|
|
1039
1017
|
const sourceRegistry = "https://registry.npmjs.org";
|
|
1040
1018
|
const mirrorRegistry = "https://registry.npmmirror.com";
|
|
1041
1019
|
const syncRegistry = "https://registry-direct.npmmirror.com";
|
|
@@ -1111,8 +1089,7 @@ function taskEndpoint(name) {
|
|
|
1111
1089
|
validatePackageName(name);
|
|
1112
1090
|
return `${syncRegistry}/-/package/${encodeURIComponent(name)}/syncs`;
|
|
1113
1091
|
}
|
|
1114
|
-
|
|
1115
|
-
//#region src/commands/release/npmmirror/sync.ts
|
|
1092
|
+
// src/commands/release/npmmirror/sync.ts
|
|
1116
1093
|
function object(value) {
|
|
1117
1094
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1118
1095
|
}
|
|
@@ -1176,8 +1153,7 @@ async function syncTarget(target, context, dryRun, result) {
|
|
|
1176
1153
|
if (task.state !== "success") task = parseTask(await requestJson(`${endpoint}/${encodeURIComponent(task.id)}`, context));
|
|
1177
1154
|
}
|
|
1178
1155
|
}
|
|
1179
|
-
|
|
1180
|
-
//#region src/commands/release/npmmirror/targets.ts
|
|
1156
|
+
// src/commands/release/npmmirror/targets.ts
|
|
1181
1157
|
function validateOptions(options) {
|
|
1182
1158
|
if ([
|
|
1183
1159
|
options.published,
|
|
@@ -1236,8 +1212,7 @@ async function selectTargets(options) {
|
|
|
1236
1212
|
versions: [...versions]
|
|
1237
1213
|
}));
|
|
1238
1214
|
}
|
|
1239
|
-
|
|
1240
|
-
//#region src/commands/release/npmmirror/index.ts
|
|
1215
|
+
// src/commands/release/npmmirror/index.ts
|
|
1241
1216
|
/** 同步结果逐包汇总;镜像失败由调用方决定是否阻断发布。 */
|
|
1242
1217
|
async function syncNpmMirror(options, runtime = {}) {
|
|
1243
1218
|
const timeout = validateOptions(options);
|
|
@@ -1278,8 +1253,7 @@ async function syncNpmMirror(options, runtime = {}) {
|
|
|
1278
1253
|
await Promise.all([worker(), worker()]);
|
|
1279
1254
|
return results;
|
|
1280
1255
|
}
|
|
1281
|
-
|
|
1282
|
-
//#region src/commands/release/npmmirror/report.ts
|
|
1256
|
+
// src/commands/release/npmmirror/report.ts
|
|
1283
1257
|
function retryCommand(result) {
|
|
1284
1258
|
const version = result.versions.length === 1 ? ` --version ${result.versions[0]}` : "";
|
|
1285
1259
|
return `pnpm exec repo release sync-npmmirror --package ${result.name}${version}`;
|
|
@@ -1321,8 +1295,7 @@ async function reportSync(results, env, dryRun = false, error) {
|
|
|
1321
1295
|
""
|
|
1322
1296
|
].join("\n"));
|
|
1323
1297
|
}
|
|
1324
|
-
|
|
1325
|
-
//#region src/cli/commands/release/npmmirror.ts
|
|
1298
|
+
// src/cli/commands/release/npmmirror.ts
|
|
1326
1299
|
function registerNpmMirror(release, cwd) {
|
|
1327
1300
|
release.command("sync-npmmirror").description(localize("Sync published npm packages to npmmirror using its HTTP API", "通过 HTTP API 同步已发布 npm 包到 npmmirror")).option("--published", localize("Use the afterPublish package list or summary", "使用 afterPublish 发布包列表或摘要")).option("--all", localize("Sync all public workspace packages from npm dist-tags", "按 npm dist-tag 同步 workspace 全部公开包")).option("--package <name>", localize("Sync one public npm package", "同步一个公开 npm 包")).option("--version <version>", localize("Specific published version; requires --package", "指定已发布版本,须配合 --package")).option("--dry-run", localize("Preview targets without creating sync tasks", "预览目标,不创建同步任务")).option("--timeout <seconds>", localize("Total time budget in seconds", "本次同步的总时间上限(秒)"), "300").action(async (opts) => {
|
|
1328
1301
|
try {
|
|
@@ -1340,8 +1313,7 @@ function registerNpmMirror(release, cwd) {
|
|
|
1340
1313
|
}
|
|
1341
1314
|
});
|
|
1342
1315
|
}
|
|
1343
|
-
|
|
1344
|
-
//#region src/cli/commands/release/plan.ts
|
|
1316
|
+
// src/cli/commands/release/plan.ts
|
|
1345
1317
|
function formatReleasePlan(plan) {
|
|
1346
1318
|
const cell = (value) => String(value).replaceAll("|", "\\|").replaceAll("\n", "<br>");
|
|
1347
1319
|
return [
|
|
@@ -1375,8 +1347,7 @@ function registerReleasePlan(release, cwd) {
|
|
|
1375
1347
|
if (plan.status === "blocked") process.exitCode = 1;
|
|
1376
1348
|
});
|
|
1377
1349
|
}
|
|
1378
|
-
|
|
1379
|
-
//#region src/cli/commands/release/snapshot/legacy.ts
|
|
1350
|
+
// src/cli/commands/release/snapshot/legacy.ts
|
|
1380
1351
|
function formatSnapshotReport(report) {
|
|
1381
1352
|
return [
|
|
1382
1353
|
`Snapshot: ${report.status}`,
|
|
@@ -1419,8 +1390,7 @@ function registerLegacySnapshot(snapshot, cwd) {
|
|
|
1419
1390
|
}
|
|
1420
1391
|
});
|
|
1421
1392
|
}
|
|
1422
|
-
|
|
1423
|
-
//#region src/cli/commands/release/snapshot/output.ts
|
|
1393
|
+
// src/cli/commands/release/snapshot/output.ts
|
|
1424
1394
|
async function writeSnapshotOutput(value, options, summary) {
|
|
1425
1395
|
const json = `${JSON.stringify(value, null, 2)}\n`;
|
|
1426
1396
|
if (options.out) {
|
|
@@ -1439,8 +1409,7 @@ function snapshotRepository(value) {
|
|
|
1439
1409
|
if (!repository || !/^[\w.-]+\/[\w.-]+$/.test(repository)) throw new Error("Provide --repository <owner/repo> or GITHUB_REPOSITORY.");
|
|
1440
1410
|
return repository;
|
|
1441
1411
|
}
|
|
1442
|
-
|
|
1443
|
-
//#region src/cli/commands/release/snapshot/source.ts
|
|
1412
|
+
// src/cli/commands/release/snapshot/source.ts
|
|
1444
1413
|
const snapshotBuilderPath = ".github/workflows/repoctl-snapshot-build.yml";
|
|
1445
1414
|
function registerSnapshotSource(snapshot, cwd) {
|
|
1446
1415
|
snapshot.command("source").description(localize("Resolve the approved same-repository PR and immutable GitHub run identity", "读取已审批的同仓库 PR 与不可变 GitHub 运行身份")).requiredOption("--pr <number>", localize("Same-repository PR number", "同仓库 PR 编号")).option("--repository <owner/repo>", localize("Source repository; defaults to GITHUB_REPOSITORY", "来源仓库;默认 GITHUB_REPOSITORY")).option("--run-id <number>", localize("Builder run ID; defaults to GITHUB_RUN_ID", "构建运行 ID;默认 GITHUB_RUN_ID")).option("--run-attempt <number>", localize("Builder attempt; defaults to GITHUB_RUN_ATTEMPT", "构建尝试;默认 GITHUB_RUN_ATTEMPT")).option("--builder-workflow <path>", localize("Trusted builder workflow path", "可信构建工作流路径"), snapshotBuilderPath).requiredOption("--out <file>", localize("New source identity JSON file", "新的来源身份 JSON 文件")).option("--json", localize("Output JSON", "输出 JSON")).action(async (options) => {
|
|
@@ -1470,8 +1439,7 @@ function registerSnapshotSource(snapshot, cwd) {
|
|
|
1470
1439
|
process.stdout.write(`${record}\n`);
|
|
1471
1440
|
});
|
|
1472
1441
|
}
|
|
1473
|
-
|
|
1474
|
-
//#region src/cli/commands/release/snapshot/publication.ts
|
|
1442
|
+
// src/cli/commands/release/snapshot/publication.ts
|
|
1475
1443
|
function registerVerificationOptions(command) {
|
|
1476
1444
|
return command.option("--repository <owner/repo>", localize("Source repository; defaults to GITHUB_REPOSITORY", "来源仓库;默认 GITHUB_REPOSITORY")).requiredOption("--run-id <number>", localize("Completed builder workflow run ID", "已完成的构建工作流运行 ID")).requiredOption("--run-attempt <number>", localize("Exact completed builder attempt", "已完成的精确构建尝试")).option("--artifact-id <number>", localize("Expected immutable build artifact ID", "预期的不可变构建 artifact ID")).option("--builder-workflow <path>", localize("Trusted builder workflow path", "可信构建工作流路径"), snapshotBuilderPath).requiredOption("--builder-sha256 <sha256>", localize("Reviewed builder workflow SHA256 from the trusted publisher policy", "可信发布策略中的已审核构建工作流 SHA256")).option("--environment <name>", localize("Required protected build environment", "构建所需的受保护环境"), "pr-snapshot").option("--out <file>", localize("Write the result to a new JSON file", "将结果写入新的 JSON 文件")).option("--json", localize("Output JSON", "输出 JSON"));
|
|
1477
1445
|
}
|
|
@@ -1507,8 +1475,7 @@ function registerSnapshotPublication(snapshot, cwd) {
|
|
|
1507
1475
|
if (report.status === "failed") process.exitCode = 1;
|
|
1508
1476
|
});
|
|
1509
1477
|
}
|
|
1510
|
-
|
|
1511
|
-
//#region src/cli/commands/release/snapshot/workflow.ts
|
|
1478
|
+
// src/cli/commands/release/snapshot/workflow.ts
|
|
1512
1479
|
async function exportWorkflows(directory, dryRun, options) {
|
|
1513
1480
|
const configuration = resolveSnapshotWorkflowOptions(options);
|
|
1514
1481
|
const workflows = await getSnapshotWorkflows(configuration);
|
|
@@ -1578,8 +1545,7 @@ function registerSnapshotWorkflow(snapshot, cwd) {
|
|
|
1578
1545
|
await writeSnapshotOutput(report, options.json ? { json: true } : {}, report.files.map((file) => `${file.status}: ${file.path}`).join("\n"));
|
|
1579
1546
|
});
|
|
1580
1547
|
}
|
|
1581
|
-
|
|
1582
|
-
//#region src/cli/commands/release/snapshot/prepared.ts
|
|
1548
|
+
// src/cli/commands/release/snapshot/prepared.ts
|
|
1583
1549
|
function registerPreparedSnapshot(snapshot, cwd) {
|
|
1584
1550
|
registerSnapshotSource(snapshot, cwd);
|
|
1585
1551
|
registerSnapshotPublication(snapshot, cwd);
|
|
@@ -1603,15 +1569,13 @@ function registerPreparedSnapshot(snapshot, cwd) {
|
|
|
1603
1569
|
if (result.status === "failed") process.exitCode = 1;
|
|
1604
1570
|
});
|
|
1605
1571
|
}
|
|
1606
|
-
|
|
1607
|
-
//#region src/cli/commands/release/snapshot/index.ts
|
|
1572
|
+
// src/cli/commands/release/snapshot/index.ts
|
|
1608
1573
|
function registerSnapshot(release, cwd) {
|
|
1609
1574
|
const snapshot = release.command("snapshot");
|
|
1610
1575
|
registerLegacySnapshot(snapshot, cwd);
|
|
1611
1576
|
registerPreparedSnapshot(snapshot, cwd);
|
|
1612
1577
|
}
|
|
1613
|
-
|
|
1614
|
-
//#region src/cli/commands/release/validation.ts
|
|
1578
|
+
// src/cli/commands/release/validation.ts
|
|
1615
1579
|
function registerReleasePreparationValidation(release, cwd) {
|
|
1616
1580
|
release.command("validate-preparation").description(localize("Validate a frozen version-preparation PR without executing candidate code", "只读校验冻结的版本准备 PR,不执行候选代码")).requiredOption("--base <sha>", localize("Trusted full base commit SHA", "可信 base 完整提交 SHA")).requiredOption("--head <sha>", localize("Candidate full head commit SHA", "候选 head 完整提交 SHA")).option("--branch <branch>", localize("Trusted release target line (defaults to main)", "可信目标发布线(默认 main)")).option("--policy <path>", localize("Repository-relative JSON policy read from the frozen base", "从冻结 base 读取的仓库相对 JSON 策略路径")).option("--json", localize("Output a versioned JSON report (default)", "输出带 schema 版本的 JSON 报告(默认)")).action(async (options) => {
|
|
1617
1581
|
const policy = options.policy ? readReleasePreparationPolicy({
|
|
@@ -1630,8 +1594,7 @@ function registerReleasePreparationValidation(release, cwd) {
|
|
|
1630
1594
|
if (report.status !== "valid") process.exitCode = 1;
|
|
1631
1595
|
});
|
|
1632
1596
|
}
|
|
1633
|
-
|
|
1634
|
-
//#region src/cli/commands/release.ts
|
|
1597
|
+
// src/cli/commands/release.ts
|
|
1635
1598
|
async function runReleaseAction(action) {
|
|
1636
1599
|
try {
|
|
1637
1600
|
await action();
|
|
@@ -1658,7 +1621,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1658
1621
|
registerAutoChangeset(releaseCommand, cwd);
|
|
1659
1622
|
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("Exact package for recovery or OIDC audit", "恢复发布或 OIDC 审计精确指定的 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) => {
|
|
1660
1623
|
await runReleaseAction(async () => {
|
|
1661
|
-
const { releaseCi } = await import("./commands-
|
|
1624
|
+
const { releaseCi } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1662
1625
|
const mode = resolveReleaseMode(opts);
|
|
1663
1626
|
await releaseCi({
|
|
1664
1627
|
...mode === "oidc-audit" ? { cwd } : await resolveReleaseOptions(cwd),
|
|
@@ -1674,7 +1637,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1674
1637
|
});
|
|
1675
1638
|
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) => {
|
|
1676
1639
|
await runReleaseAction(async () => {
|
|
1677
|
-
const { repairReleaseNotes } = await import("./commands-
|
|
1640
|
+
const { repairReleaseNotes } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1678
1641
|
const result = await repairReleaseNotes({
|
|
1679
1642
|
cwd,
|
|
1680
1643
|
...opts.all ? { all: true } : {},
|
|
@@ -1687,7 +1650,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1687
1650
|
});
|
|
1688
1651
|
const stableCommand = releaseCommand.command("stable").description(localize("Run a stable release from the configured release line", "在配置的正式发布线执行发布")).action(async () => {
|
|
1689
1652
|
await runReleaseAction(async () => {
|
|
1690
|
-
const { releaseCi } = await import("./commands-
|
|
1653
|
+
const { releaseCi } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1691
1654
|
await releaseCi({
|
|
1692
1655
|
...await resolveReleaseOptions(cwd),
|
|
1693
1656
|
mode: "publish"
|
|
@@ -1697,7 +1660,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1697
1660
|
});
|
|
1698
1661
|
stableCommand.command("prepare").description(localize("Consume pnpm change intents and prepare a Release PR", "消费 pnpm change intents 并准备 Release PR")).action(async () => {
|
|
1699
1662
|
await runReleaseAction(async () => {
|
|
1700
|
-
const { releaseCi } = await import("./commands-
|
|
1663
|
+
const { releaseCi } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1701
1664
|
await releaseCi({
|
|
1702
1665
|
...await resolveReleaseOptions(cwd),
|
|
1703
1666
|
mode: "prepare"
|
|
@@ -1707,7 +1670,7 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1707
1670
|
});
|
|
1708
1671
|
stableCommand.command("publish").description(localize("Publish prepared versions from the configured release line", "发布所选发布线已经准备的包版本")).action(async () => {
|
|
1709
1672
|
await runReleaseAction(async () => {
|
|
1710
|
-
const { releaseCi } = await import("./commands-
|
|
1673
|
+
const { releaseCi } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1711
1674
|
await releaseCi({
|
|
1712
1675
|
...await resolveReleaseOptions(cwd),
|
|
1713
1676
|
mode: "publish"
|
|
@@ -1718,28 +1681,27 @@ function registerReleaseCommands(program, cwd) {
|
|
|
1718
1681
|
const preCommand = releaseCommand.command("pre").description(localize("Run or manage prereleases", "执行或管理 prerelease 发布"));
|
|
1719
1682
|
preCommand.command("publish").alias("run").description(localize("Publish from a configured prerelease branch", "在已配置的预发布分支发布 prerelease")).action(async () => {
|
|
1720
1683
|
await runReleaseAction(async () => {
|
|
1721
|
-
const { releaseCi } = await import("./commands-
|
|
1684
|
+
const { releaseCi } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1722
1685
|
await releaseCi(await resolveReleaseOptions(cwd));
|
|
1723
1686
|
logger.success(localize("Prerelease finished.", "预发布完成。"));
|
|
1724
1687
|
});
|
|
1725
1688
|
});
|
|
1726
1689
|
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) => {
|
|
1727
1690
|
await runReleaseAction(async () => {
|
|
1728
|
-
const { enterPrerelease } = await import("./commands-
|
|
1691
|
+
const { enterPrerelease } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1729
1692
|
await enterPrerelease(tag, { cwd });
|
|
1730
1693
|
logger.success(localize(`Entered ${tag} prerelease mode.`, `已进入 ${tag} 预发布模式。`));
|
|
1731
1694
|
});
|
|
1732
1695
|
});
|
|
1733
1696
|
preCommand.command("exit").description(localize("Exit the pnpm prerelease lane", "退出 pnpm prerelease lane")).action(async () => {
|
|
1734
1697
|
await runReleaseAction(async () => {
|
|
1735
|
-
const { exitPrerelease } = await import("./commands-
|
|
1698
|
+
const { exitPrerelease } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1736
1699
|
const target = await exitPrerelease({ cwd });
|
|
1737
1700
|
logger.success(localize(`Exited prerelease mode. Stable target: ${target.branch}.`, `已退出预发布模式,正式目标分支:${target.branch}。`));
|
|
1738
1701
|
});
|
|
1739
1702
|
});
|
|
1740
1703
|
}
|
|
1741
|
-
|
|
1742
|
-
//#region src/cli/commands/skills.ts
|
|
1704
|
+
// src/cli/commands/skills.ts
|
|
1743
1705
|
const skillTargets = [
|
|
1744
1706
|
"codex",
|
|
1745
1707
|
"claude",
|
|
@@ -1749,7 +1711,7 @@ const skillTargets = [
|
|
|
1749
1711
|
];
|
|
1750
1712
|
function registerSkillsCommands(program, cwd) {
|
|
1751
1713
|
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) => {
|
|
1752
|
-
const { syncSkills } = await import("./commands-
|
|
1714
|
+
const { syncSkills } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
1753
1715
|
const selected = /* @__PURE__ */ new Set();
|
|
1754
1716
|
if (opts.all) for (const target of skillTargets) selected.add(target);
|
|
1755
1717
|
else {
|
|
@@ -1771,8 +1733,7 @@ function registerSkillsCommands(program, cwd) {
|
|
|
1771
1733
|
logger.success(localize("Skill synchronization finished.", "Skill 同步完成。"));
|
|
1772
1734
|
});
|
|
1773
1735
|
}
|
|
1774
|
-
|
|
1775
|
-
//#region src/cli/commands/template-instances/output.ts
|
|
1736
|
+
// src/cli/commands/template-instances/output.ts
|
|
1776
1737
|
async function templateWorkspaceRoot() {
|
|
1777
1738
|
return await findWorkspaceDir(process.cwd()) ?? process.cwd();
|
|
1778
1739
|
}
|
|
@@ -1781,11 +1742,10 @@ async function emitTemplateReport(value, options) {
|
|
|
1781
1742
|
if (options.out) await fs$1.outputFile(path.resolve(options.out), `${content}\n`);
|
|
1782
1743
|
else process.stdout.write(`${content}\n`);
|
|
1783
1744
|
}
|
|
1784
|
-
|
|
1785
|
-
//#region src/cli/commands/template-instances/drift.ts
|
|
1745
|
+
// src/cli/commands/template-instances/drift.ts
|
|
1786
1746
|
function registerTemplateDriftCommand(templates) {
|
|
1787
1747
|
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) => {
|
|
1788
|
-
const { checkTemplateDrift, formatTemplateDriftReport, hasTemplateDriftIssues } = await import("./template-drift-
|
|
1748
|
+
const { checkTemplateDrift, formatTemplateDriftReport, hasTemplateDriftIssues } = await import("./template-drift-DOG6iGjV.mjs").then((n) => n.n);
|
|
1789
1749
|
const merged = {
|
|
1790
1750
|
...command.optsWithGlobals(),
|
|
1791
1751
|
...options
|
|
@@ -1800,11 +1760,10 @@ function registerTemplateDriftCommand(templates) {
|
|
|
1800
1760
|
if (hasTemplateDriftIssues(report, merged.strict)) process.exitCode = 1;
|
|
1801
1761
|
});
|
|
1802
1762
|
}
|
|
1803
|
-
|
|
1804
|
-
//#region src/cli/commands/template-instances/upgrade.ts
|
|
1763
|
+
// src/cli/commands/template-instances/upgrade.ts
|
|
1805
1764
|
function registerTemplateUpgradeCommands(templates) {
|
|
1806
1765
|
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) => {
|
|
1807
|
-
const { planTemplateUpgrade, applyTemplateUpgradePlan } = await import("./workspace-tasks-
|
|
1766
|
+
const { planTemplateUpgrade, applyTemplateUpgradePlan } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.d);
|
|
1808
1767
|
const plan = await planTemplateUpgrade({
|
|
1809
1768
|
cwd: await templateWorkspaceRoot(),
|
|
1810
1769
|
instance,
|
|
@@ -1818,20 +1777,19 @@ function registerTemplateUpgradeCommands(templates) {
|
|
|
1818
1777
|
});
|
|
1819
1778
|
});
|
|
1820
1779
|
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) => {
|
|
1821
|
-
const { recoverTemplateUpgrade } = await import("./workspace-tasks-
|
|
1780
|
+
const { recoverTemplateUpgrade } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.d);
|
|
1822
1781
|
await emitTemplateReport(await recoverTemplateUpgrade(await templateWorkspaceRoot(), instance, options.apply), {
|
|
1823
1782
|
...command.optsWithGlobals(),
|
|
1824
1783
|
...options
|
|
1825
1784
|
});
|
|
1826
1785
|
});
|
|
1827
1786
|
}
|
|
1828
|
-
|
|
1829
|
-
//#region src/cli/commands/template-instances/index.ts
|
|
1787
|
+
// src/cli/commands/template-instances/index.ts
|
|
1830
1788
|
function registerTemplateInstanceCommands(templates) {
|
|
1831
1789
|
registerTemplateDriftCommand(templates);
|
|
1832
1790
|
registerTemplateUpgradeCommands(templates);
|
|
1833
1791
|
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) => {
|
|
1834
|
-
const { listTemplateInstances } = await import("./workspace-tasks-
|
|
1792
|
+
const { listTemplateInstances } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.d);
|
|
1835
1793
|
const instances = await listTemplateInstances(await templateWorkspaceRoot());
|
|
1836
1794
|
const selected = target ? instances.filter((item) => item.instance.id === target || item.instance.target === target) : instances;
|
|
1837
1795
|
if (target && !selected.length) throw new Error(`Unknown template instance: ${target}`);
|
|
@@ -1844,7 +1802,7 @@ function registerTemplateInstanceCommands(templates) {
|
|
|
1844
1802
|
});
|
|
1845
1803
|
});
|
|
1846
1804
|
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) => {
|
|
1847
|
-
const { applyTemplateLinkPlan, planTemplateLink } = await import("./workspace-tasks-
|
|
1805
|
+
const { applyTemplateLinkPlan, planTemplateLink } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.d);
|
|
1848
1806
|
const plan = await planTemplateLink({
|
|
1849
1807
|
cwd: await templateWorkspaceRoot(),
|
|
1850
1808
|
target,
|
|
@@ -1864,22 +1822,21 @@ function registerTemplateInstanceCommands(templates) {
|
|
|
1864
1822
|
});
|
|
1865
1823
|
});
|
|
1866
1824
|
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) => {
|
|
1867
|
-
const { relocateTemplateInstance } = await import("./workspace-tasks-
|
|
1825
|
+
const { relocateTemplateInstance } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.d);
|
|
1868
1826
|
await emitTemplateReport(await relocateTemplateInstance(await templateWorkspaceRoot(), instance, target, options.apply), {
|
|
1869
1827
|
...command.optsWithGlobals(),
|
|
1870
1828
|
...options
|
|
1871
1829
|
});
|
|
1872
1830
|
});
|
|
1873
1831
|
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) => {
|
|
1874
|
-
const { rebuildTemplateInstanceBaseline } = await import("./workspace-tasks-
|
|
1832
|
+
const { rebuildTemplateInstanceBaseline } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.d);
|
|
1875
1833
|
await emitTemplateReport({
|
|
1876
1834
|
instance: (await rebuildTemplateInstanceBaseline(await templateWorkspaceRoot(), instance, path.resolve(options.destination), options.original ? "original" : "rendered")).id,
|
|
1877
1835
|
destination: path.resolve(options.destination)
|
|
1878
1836
|
}, {});
|
|
1879
1837
|
});
|
|
1880
1838
|
}
|
|
1881
|
-
|
|
1882
|
-
//#region src/cli/commands/template-catalog/fetch.ts
|
|
1839
|
+
// src/cli/commands/template-catalog/fetch.ts
|
|
1883
1840
|
function registerTemplateFetch(templates) {
|
|
1884
1841
|
templates.command("fetch").description(localize("Fetch and verify fixed remote template assets", "获取并验证固定的远程模板资产")).argument("<key>").option("--offline", localize("Read only an exact verified cache entry", "只读取精确匹配且通过校验的缓存")).option("--cache-dir <directory>", localize("Template asset cache directory", "模板资产缓存目录")).option("--json", localize("Print resolved source identity as JSON", "以 JSON 输出固定来源身份")).action(async (key, _local, command) => {
|
|
1885
1842
|
const options = command.optsWithGlobals();
|
|
@@ -1904,8 +1861,7 @@ function registerTemplateFetch(templates) {
|
|
|
1904
1861
|
}
|
|
1905
1862
|
});
|
|
1906
1863
|
}
|
|
1907
|
-
|
|
1908
|
-
//#region src/cli/commands/template-catalog/format.ts
|
|
1864
|
+
// src/cli/commands/template-catalog/format.ts
|
|
1909
1865
|
function formatTemplateTable(choices) {
|
|
1910
1866
|
const rows = choices.map((choice) => ({
|
|
1911
1867
|
key: choice.key,
|
|
@@ -2005,8 +1961,7 @@ function formatTemplateHealthReport(report, color = false) {
|
|
|
2005
1961
|
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} 失败`));
|
|
2006
1962
|
return lines.join("\n");
|
|
2007
1963
|
}
|
|
2008
|
-
|
|
2009
|
-
//#region src/cli/commands/template-catalog/validate.ts
|
|
1964
|
+
// src/cli/commands/template-catalog/validate.ts
|
|
2010
1965
|
async function readParameterMatrix(filename) {
|
|
2011
1966
|
const content = await readFile(path$1.resolve(filename));
|
|
2012
1967
|
if (content.length > 1048576) throw new Error("Template parameter matrix exceeds 1 MiB.");
|
|
@@ -2060,8 +2015,7 @@ function registerTemplateValidation(templates) {
|
|
|
2060
2015
|
}
|
|
2061
2016
|
});
|
|
2062
2017
|
}
|
|
2063
|
-
|
|
2064
|
-
//#region src/cli/commands/template-catalog/index.ts
|
|
2018
|
+
// src/cli/commands/template-catalog/index.ts
|
|
2065
2019
|
async function emitTemplateOutput(content, options) {
|
|
2066
2020
|
if (!options.out) {
|
|
2067
2021
|
if (options.json) process.stdout.write(`${content}\n`);
|
|
@@ -2076,7 +2030,7 @@ function registerTemplatesCommands(program) {
|
|
|
2076
2030
|
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) => {
|
|
2077
2031
|
const { isTemplateCategory, suggestTemplateKey, templateCategories } = await import("@icebreakers/monorepo-templates");
|
|
2078
2032
|
if (opts.check) {
|
|
2079
|
-
const { checkTemplates } = await import("./commands-
|
|
2033
|
+
const { checkTemplates } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2080
2034
|
const report = await checkTemplates();
|
|
2081
2035
|
if (opts.json) await emitTemplateOutput(JSON.stringify(report, null, 2), opts);
|
|
2082
2036
|
else await emitTemplateOutput(formatTemplateHealthReport(report, !opts.out), opts);
|
|
@@ -2134,8 +2088,7 @@ function registerTemplatesCommands(program) {
|
|
|
2134
2088
|
registerTemplateValidation(templates);
|
|
2135
2089
|
registerTemplateFetch(templates);
|
|
2136
2090
|
}
|
|
2137
|
-
|
|
2138
|
-
//#region src/cli/utils.ts
|
|
2091
|
+
// src/cli/utils.ts
|
|
2139
2092
|
function normalizeCleanOptions(opts) {
|
|
2140
2093
|
const overrides = {};
|
|
2141
2094
|
if (opts.dryRun) overrides.dryRun = true;
|
|
@@ -2150,8 +2103,7 @@ function normalizeToolingTargets(tooling) {
|
|
|
2150
2103
|
if (unknown.length > 0) throw new Error(localize(`Unknown init tooling target: ${unknown.join(", ")}`, `未知的 init tooling 目标: ${unknown.join(", ")}`));
|
|
2151
2104
|
return tooling;
|
|
2152
2105
|
}
|
|
2153
|
-
|
|
2154
|
-
//#region src/cli/commands/tooling/capabilities.ts
|
|
2106
|
+
// src/cli/commands/tooling/capabilities.ts
|
|
2155
2107
|
function registerCapabilityCommands(toolingCommand, cwd) {
|
|
2156
2108
|
const capabilities = toolingCommand.command("capability").description(localize("Add an incremental tooling capability", "增量接入工程化能力包"));
|
|
2157
2109
|
capabilities.command("list").option("--json").action((options) => {
|
|
@@ -2195,12 +2147,11 @@ function registerCapabilityCommands(toolingCommand, cwd) {
|
|
|
2195
2147
|
else logger.success(localize("Tooling capability applied.", "工程化能力包已应用。"));
|
|
2196
2148
|
});
|
|
2197
2149
|
}
|
|
2198
|
-
|
|
2199
|
-
//#region src/cli/commands/tooling/devcontainer.ts
|
|
2150
|
+
// src/cli/commands/tooling/devcontainer.ts
|
|
2200
2151
|
function registerDevContainerCommand(command, cwd) {
|
|
2201
2152
|
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) => {
|
|
2202
2153
|
const options = current.optsWithGlobals();
|
|
2203
|
-
const { applyDevContainerPlan, planDevContainer } = await import("./commands-
|
|
2154
|
+
const { applyDevContainerPlan, planDevContainer } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2204
2155
|
if (options.apply) {
|
|
2205
2156
|
if (options.nodeVersion || options.dryRun || options.out) throw new Error("--apply cannot be combined with preview or selection options.");
|
|
2206
2157
|
const filename = path.resolve(cwd, options.apply);
|
|
@@ -2227,8 +2178,7 @@ function registerDevContainerCommand(command, cwd) {
|
|
|
2227
2178
|
if (plan.status === "blocked") process.exitCode = 1;
|
|
2228
2179
|
});
|
|
2229
2180
|
}
|
|
2230
|
-
|
|
2231
|
-
//#region src/cli/commands/tooling/hooks.ts
|
|
2181
|
+
// src/cli/commands/tooling/hooks.ts
|
|
2232
2182
|
function registerHooksCommands(toolingCommand, cwd) {
|
|
2233
2183
|
toolingCommand.command("hooks").description(localize("Install native Git hooks safely", "安全安装原生 Git hooks")).command("install").option("--json").action(async (options) => {
|
|
2234
2184
|
const result = await installGitHooks(cwd);
|
|
@@ -2237,8 +2187,7 @@ function registerHooksCommands(toolingCommand, cwd) {
|
|
|
2237
2187
|
else logger.info(localize(`Git hooks installation skipped: ${result.reason}.`, `已跳过 Git hooks 安装:${result.reason}。`));
|
|
2238
2188
|
});
|
|
2239
2189
|
}
|
|
2240
|
-
|
|
2241
|
-
//#region src/cli/commands/tooling/references.ts
|
|
2190
|
+
// src/cli/commands/tooling/references.ts
|
|
2242
2191
|
function output(value) {
|
|
2243
2192
|
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`);
|
|
2244
2193
|
}
|
|
@@ -2253,8 +2202,7 @@ function registerProjectReferencesCommands(tooling, cwd) {
|
|
|
2253
2202
|
command.command("sync").option("--dry-run", localize("Preview without writing", "预览但不写入")).description(localize("Synchronize explicitly enabled references", "同步显式启用的引用")).action(async (options) => output(options.dryRun ? await planProjectReferences(cwd) : await syncProjectReferences(cwd)));
|
|
2254
2203
|
command.command("apply <plan>").description(localize("Apply a reviewed JSON plan", "应用已审阅的 JSON 计划")).action(async (file) => output(await applyProjectReferencesPlan(JSON.parse(await readFile(file, "utf8")))));
|
|
2255
2204
|
}
|
|
2256
|
-
|
|
2257
|
-
//#region src/cli/commands/tooling.ts
|
|
2205
|
+
// src/cli/commands/tooling.ts
|
|
2258
2206
|
function registerToolingCommands(program, cwd) {
|
|
2259
2207
|
const toolingCommand = program.command("tooling").alias("tg").description(localize("Tooling configuration commands", "工程化配置命令"));
|
|
2260
2208
|
registerProjectReferencesCommands(toolingCommand, cwd);
|
|
@@ -2263,7 +2211,7 @@ function registerToolingCommands(program, cwd) {
|
|
|
2263
2211
|
registerHooksCommands(toolingCommand, cwd);
|
|
2264
2212
|
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) => {
|
|
2265
2213
|
const normalizedTooling = normalizeToolingTargets(tooling);
|
|
2266
|
-
const { initTooling } = await import("./commands-
|
|
2214
|
+
const { initTooling } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2267
2215
|
await initTooling(cwd, {
|
|
2268
2216
|
...normalizedTooling ? { targets: normalizedTooling } : {},
|
|
2269
2217
|
...opts.all !== void 0 ? { all: opts.all } : {},
|
|
@@ -2272,8 +2220,7 @@ function registerToolingCommands(program, cwd) {
|
|
|
2272
2220
|
logger.success(localize("Tooling initialization finished.", "Tooling 初始化完成。"));
|
|
2273
2221
|
});
|
|
2274
2222
|
}
|
|
2275
|
-
|
|
2276
|
-
//#region src/cli/commands/check/cache.ts
|
|
2223
|
+
// src/cli/commands/check/cache.ts
|
|
2277
2224
|
function registerCacheAnalysis(check, cwd) {
|
|
2278
2225
|
check.command("cache <current> [previous]").description(localize("Analyze existing Turbo run summaries without running tasks", "只读分析已有 Turbo run summaries")).option("--json", localize("Output structured analysis", "输出结构化分析")).option("--markdown", localize("Output a Markdown report to stdout", "向标准输出写入 Markdown 报告")).option("--slowest <count>", localize("Number of slow tasks (1–100)", "最慢任务数量(1–100)")).option("--dry-run", localize("Read-only analysis (always enabled)", "只读分析(始终启用)")).action(async (current, previous, options, command) => {
|
|
2279
2226
|
const parent = check.opts();
|
|
@@ -2287,8 +2234,8 @@ function registerCacheAnalysis(check, cwd) {
|
|
|
2287
2234
|
const markdown = options.markdown || parent["markdown"] === true;
|
|
2288
2235
|
if (json && markdown) throw new Error("--json and --markdown cannot be combined");
|
|
2289
2236
|
const own = command.opts();
|
|
2290
|
-
const { analyzeTurboRuns } = await import("./workspace-tasks-
|
|
2291
|
-
const { formatTurboAnalysis } = await import("./format-
|
|
2237
|
+
const { analyzeTurboRuns } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.G);
|
|
2238
|
+
const { formatTurboAnalysis } = await import("./format-qyk-2EXc.mjs");
|
|
2292
2239
|
const result = await analyzeTurboRuns(path.resolve(cwd, current), {
|
|
2293
2240
|
...previous !== void 0 ? { previous: path.resolve(cwd, previous) } : {},
|
|
2294
2241
|
...own.slowest !== void 0 ? { slowest: Number(own.slowest) } : {}
|
|
@@ -2296,8 +2243,7 @@ function registerCacheAnalysis(check, cwd) {
|
|
|
2296
2243
|
process.stdout.write(`${json ? JSON.stringify(result, null, 2) : formatTurboAnalysis(result, markdown)}\n`);
|
|
2297
2244
|
});
|
|
2298
2245
|
}
|
|
2299
|
-
|
|
2300
|
-
//#region src/cli/commands/check/knip.ts
|
|
2246
|
+
// src/cli/commands/check/knip.ts
|
|
2301
2247
|
function formatReport(report) {
|
|
2302
2248
|
return [
|
|
2303
2249
|
`Knip ${report.plan.tool.version ?? "(not installed)"}: ${report.status}; ${report.summary.errors} errors, ${report.summary.warnings} warnings`,
|
|
@@ -2316,7 +2262,7 @@ function registerKnipCheck(check, cwd) {
|
|
|
2316
2262
|
};
|
|
2317
2263
|
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.");
|
|
2318
2264
|
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.");
|
|
2319
|
-
const { getKnipConfigurationSuggestions, planKnipCheck, runKnipCheck, saveKnipBaseline } = await import("./workspace-tasks-
|
|
2265
|
+
const { getKnipConfigurationSuggestions, planKnipCheck, runKnipCheck, saveKnipBaseline } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.L);
|
|
2320
2266
|
if (opts.recommendConfig) {
|
|
2321
2267
|
process.stdout.write(`${JSON.stringify(await getKnipConfigurationSuggestions(cwd), null, 2)}\n`);
|
|
2322
2268
|
return;
|
|
@@ -2358,8 +2304,7 @@ function registerKnipCheck(check, cwd) {
|
|
|
2358
2304
|
}
|
|
2359
2305
|
});
|
|
2360
2306
|
}
|
|
2361
|
-
|
|
2362
|
-
//#region src/cli/commands/check/affected.ts
|
|
2307
|
+
// src/cli/commands/check/affected.ts
|
|
2363
2308
|
function formatAffectedCheckPlan(plan, markdown = false) {
|
|
2364
2309
|
return [
|
|
2365
2310
|
...markdown ? [localize("# Affected check plan", "# Affected 校验计划"), ""] : [],
|
|
@@ -2380,8 +2325,7 @@ function formatAffectedCheckPlan(plan, markdown = false) {
|
|
|
2380
2325
|
])
|
|
2381
2326
|
].join("\n");
|
|
2382
2327
|
}
|
|
2383
|
-
|
|
2384
|
-
//#region src/cli/commands/check/output.ts
|
|
2328
|
+
// src/cli/commands/check/output.ts
|
|
2385
2329
|
function formatCheckPlan(plan) {
|
|
2386
2330
|
const lines = [
|
|
2387
2331
|
localize(`cwd: ${plan.cwd}`, `当前目录:${plan.cwd}`),
|
|
@@ -2436,8 +2380,7 @@ function createCheckPlanOutput(plan, opts) {
|
|
|
2436
2380
|
if (opts.markdown) return formatCheckPlanMarkdown(outputPlan);
|
|
2437
2381
|
return formatCheckPlan(outputPlan);
|
|
2438
2382
|
}
|
|
2439
|
-
|
|
2440
|
-
//#region src/cli/commands/check/index.ts
|
|
2383
|
+
// src/cli/commands/check/index.ts
|
|
2441
2384
|
const collect$1 = (value, previous = []) => [...previous, value];
|
|
2442
2385
|
async function emitCheckOutput(content, opts, cwd, stdout) {
|
|
2443
2386
|
if (!opts.out) {
|
|
@@ -2471,7 +2414,7 @@ function registerCheckCommand(program, cwd) {
|
|
|
2471
2414
|
...opts.globalInput ? { globalInputs: opts.globalInput } : {}
|
|
2472
2415
|
};
|
|
2473
2416
|
if (opts.matrix) {
|
|
2474
|
-
const { resolveAffectedCheckMatrix } = await import("./commands-
|
|
2417
|
+
const { resolveAffectedCheckMatrix } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2475
2418
|
const matrix = await resolveAffectedCheckMatrix({
|
|
2476
2419
|
...options,
|
|
2477
2420
|
...opts.shards !== void 0 ? { shards: Number(opts.shards) } : {}
|
|
@@ -2485,19 +2428,19 @@ function registerCheckCommand(program, cwd) {
|
|
|
2485
2428
|
if (opts.dryRun || opts.json || opts.markdown || opts.out) throw new Error("--report cannot be combined with preview options: --dry-run, --json, --markdown, --out");
|
|
2486
2429
|
const format = opts.reportFormat ?? "json";
|
|
2487
2430
|
if (format !== "json" && format !== "markdown") throw new Error("--report-format must be json or markdown");
|
|
2488
|
-
const { runCheckExecution } = await import("./execute-
|
|
2431
|
+
const { runCheckExecution } = await import("./execute-dyUt94Dv.mjs");
|
|
2489
2432
|
await runCheckExecution(options, opts.report, format, opts.redact);
|
|
2490
2433
|
return;
|
|
2491
2434
|
}
|
|
2492
|
-
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-
|
|
2435
|
+
const { resolveRecommendedCheckPlan, runRecommendedCheck } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2493
2436
|
if (opts.dryRun || opts.json || opts.markdown || opts.out) {
|
|
2494
2437
|
if (opts.affected) {
|
|
2495
|
-
const { resolveAffectedCheckPlan } = await import("./commands-
|
|
2438
|
+
const { resolveAffectedCheckPlan } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2496
2439
|
await emitCheckPlan(await resolveAffectedCheckPlan(options), opts, cwd);
|
|
2497
2440
|
return;
|
|
2498
2441
|
}
|
|
2499
2442
|
if (opts.full) {
|
|
2500
|
-
const { resolveFullWorkspaceCheckPlan } = await import("./commands-
|
|
2443
|
+
const { resolveFullWorkspaceCheckPlan } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2501
2444
|
await emitCheckPlan(await resolveFullWorkspaceCheckPlan(cwd), opts, cwd);
|
|
2502
2445
|
return;
|
|
2503
2446
|
}
|
|
@@ -2505,7 +2448,7 @@ function registerCheckCommand(program, cwd) {
|
|
|
2505
2448
|
return;
|
|
2506
2449
|
}
|
|
2507
2450
|
if (opts.affected) {
|
|
2508
|
-
const { runCheckExecution } = await import("./execute-
|
|
2451
|
+
const { runCheckExecution } = await import("./execute-dyUt94Dv.mjs");
|
|
2509
2452
|
await runCheckExecution(options);
|
|
2510
2453
|
return;
|
|
2511
2454
|
}
|
|
@@ -2515,8 +2458,7 @@ function registerCheckCommand(program, cwd) {
|
|
|
2515
2458
|
registerCacheAnalysis(check, cwd);
|
|
2516
2459
|
registerKnipCheck(check, cwd);
|
|
2517
2460
|
}
|
|
2518
|
-
|
|
2519
|
-
//#region src/cli/commands/doctor/render/groups.ts
|
|
2461
|
+
// src/cli/commands/doctor/render/groups.ts
|
|
2520
2462
|
/** Group presentation only; preserve every check occurrence and the report's original counts. */
|
|
2521
2463
|
function groupDoctorChecks(checks) {
|
|
2522
2464
|
const groups = [];
|
|
@@ -2554,8 +2496,7 @@ function groupDoctorChecks(checks) {
|
|
|
2554
2496
|
}
|
|
2555
2497
|
return groups;
|
|
2556
2498
|
}
|
|
2557
|
-
|
|
2558
|
-
//#region src/cli/commands/doctor/render/markdown.ts
|
|
2499
|
+
// src/cli/commands/doctor/render/markdown.ts
|
|
2559
2500
|
/** Render data as text, including paths that contain Markdown syntax or Windows separators. */
|
|
2560
2501
|
function escape(value) {
|
|
2561
2502
|
return String(value ?? "-").replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replace(/[\\`*_{}[\]()#+.!|~\-]/g, "\\$&").replace(/\r\n|\r|\n/g, "<br>");
|
|
@@ -2612,8 +2553,7 @@ function formatDoctorMarkdown(report) {
|
|
|
2612
2553
|
] : []
|
|
2613
2554
|
].join("\n");
|
|
2614
2555
|
}
|
|
2615
|
-
|
|
2616
|
-
//#region src/cli/commands/doctor/render/redact.ts
|
|
2556
|
+
// src/cli/commands/doctor/render/redact.ts
|
|
2617
2557
|
function replaceAll$1(value, search, replacement) {
|
|
2618
2558
|
return search.length > 0 ? value.split(search).join(replacement) : value;
|
|
2619
2559
|
}
|
|
@@ -2630,8 +2570,7 @@ function redactDoctorReport(report) {
|
|
|
2630
2570
|
[os.homedir(), "<home>"]
|
|
2631
2571
|
].filter(([search], index, entries) => search.length > 0 && entries.findIndex(([value]) => value === search) === index).sort(([left], [right]) => right.length - left.length));
|
|
2632
2572
|
}
|
|
2633
|
-
|
|
2634
|
-
//#region src/cli/commands/doctor/render/text.ts
|
|
2573
|
+
// src/cli/commands/doctor/render/text.ts
|
|
2635
2574
|
function formatStatus(status) {
|
|
2636
2575
|
return status === "pass" ? pc.green("PASS") : status === "warn" ? pc.yellow("WARN") : pc.red("FAIL");
|
|
2637
2576
|
}
|
|
@@ -2656,8 +2595,7 @@ function formatDoctorText(report, color = false) {
|
|
|
2656
2595
|
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} 失败`));
|
|
2657
2596
|
return lines.join("\n");
|
|
2658
2597
|
}
|
|
2659
|
-
|
|
2660
|
-
//#region src/cli/commands/doctor/render/index.ts
|
|
2598
|
+
// src/cli/commands/doctor/render/index.ts
|
|
2661
2599
|
function createDoctorReportOutput(report, opts) {
|
|
2662
2600
|
const outputReport = opts.redact ? redactDoctorReport(report) : report;
|
|
2663
2601
|
if (opts.json) return JSON.stringify(outputReport, null, 2);
|
|
@@ -2669,8 +2607,7 @@ function createInteractiveDoctorReportOutput(report, opts) {
|
|
|
2669
2607
|
function hasDoctorBlockingIssues(report, opts) {
|
|
2670
2608
|
return report.summary.fail > 0 || opts.strict === true && report.summary.warn > 0;
|
|
2671
2609
|
}
|
|
2672
|
-
|
|
2673
|
-
//#region src/cli/commands/doctor/security.ts
|
|
2610
|
+
// src/cli/commands/doctor/security.ts
|
|
2674
2611
|
async function readJson(filename) {
|
|
2675
2612
|
try {
|
|
2676
2613
|
return JSON.parse(await readFile(filename, "utf8"));
|
|
@@ -2719,8 +2656,7 @@ function registerInstallSecurityCommand(doctor, cwd) {
|
|
|
2719
2656
|
if (report.summary.fail || options.strict && report.summary.warn) process.exitCode = 1;
|
|
2720
2657
|
});
|
|
2721
2658
|
}
|
|
2722
|
-
|
|
2723
|
-
//#region src/cli/commands/doctor/index.ts
|
|
2659
|
+
// src/cli/commands/doctor/index.ts
|
|
2724
2660
|
async function emitDoctorReport(report, opts, cwd) {
|
|
2725
2661
|
const content = opts.json || opts.markdown || opts.out ? createDoctorReportOutput(report, opts) : createInteractiveDoctorReportOutput(report, opts);
|
|
2726
2662
|
if (!opts.out) {
|
|
@@ -2734,7 +2670,7 @@ async function emitDoctorReport(report, opts, cwd) {
|
|
|
2734
2670
|
}
|
|
2735
2671
|
function registerDoctorCommand(program, cwd) {
|
|
2736
2672
|
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) => {
|
|
2737
|
-
const commands = await import("./commands-
|
|
2673
|
+
const commands = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2738
2674
|
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.");
|
|
2739
2675
|
if (opts.listRules || opts.fix || opts.apply) {
|
|
2740
2676
|
if (opts.markdown || opts.redact) throw new Error("--markdown and --redact apply to diagnostic reports, not rule lists or executable plans.");
|
|
@@ -2767,8 +2703,7 @@ function registerDoctorCommand(program, cwd) {
|
|
|
2767
2703
|
logger.success(localize("Doctor finished.", "Doctor 诊断完成。"));
|
|
2768
2704
|
}), cwd);
|
|
2769
2705
|
}
|
|
2770
|
-
|
|
2771
|
-
//#region src/cli/commands/upgrade.ts
|
|
2706
|
+
// src/cli/commands/upgrade.ts
|
|
2772
2707
|
function registerUpgradeCommand(parent, cwd, alias) {
|
|
2773
2708
|
const command = parent.command("upgrade").description(localize("Plan or apply standard repository asset upgrades", "预览或应用仓库标准资产升级")).option("-i,--interactive", localize("Select managed files interactively", "交互式选择受管文件")).option("-c,--core", localize("Synchronize core configuration without GitHub assets", "仅同步核心配置,跳过 GitHub 相关资产")).option("--outDir <dir>", localize("Output directory", "输出目录")).option("-s,--skip-overwrite", localize("Preserve existing files", "保留已存在文件")).option("-y, --yes", localize("Approve changed managed assets", "接受受管资产变更")).option("--overwrite", localize("Explicitly replace differing managed assets and adopt upstream baselines", "显式替换有差异的受管资产并登记上游基线")).option("--no-overwrite", localize("Preserve existing assets and legacy metadata", "保留既有资产和旧版迁移元数据")).option("--overwrite-release", localize("Replace a custom release workflow", "替换自定义 release workflow")).option("--dry-run", localize("Preview every change without writes or asset preparation", "预览全部变更,不写文件或准备资产")).option("--from-version <version>", localize("Attest an exact previous template version for migration selection", "提供明确的旧模板版本,用于选择版本迁移")).option("--json", localize("Output a read-only JSON plan", "输出只读 JSON 计划")).option("--markdown", localize("Output a read-only Markdown plan with diffs", "输出含 diff 的只读 Markdown 计划")).option("--apply <file>", localize("Apply all actionable entries from a reviewed JSON plan", "应用已审核 JSON 计划中的全部变更")).action(async (options) => {
|
|
2774
2709
|
if (options.apply) {
|
|
@@ -2799,11 +2734,10 @@ function registerUpgradeCommand(parent, cwd, alias) {
|
|
|
2799
2734
|
if (alias) command.alias(alias);
|
|
2800
2735
|
return command;
|
|
2801
2736
|
}
|
|
2802
|
-
|
|
2803
|
-
//#region src/cli/commands/top-level.ts
|
|
2737
|
+
// src/cli/commands/top-level.ts
|
|
2804
2738
|
function registerTopLevelCommands(program, cwd) {
|
|
2805
2739
|
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) => {
|
|
2806
|
-
const { init } = await import("./commands-
|
|
2740
|
+
const { init } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2807
2741
|
const config = await loadMonorepoConfig(cwd);
|
|
2808
2742
|
const { preset } = resolveCommandValues("init", config.commands?.init, { preset: opts.preset }, { entry: "cli" }).values;
|
|
2809
2743
|
await init(cwd, {
|
|
@@ -2816,7 +2750,7 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
2816
2750
|
logger.info(localize("Next: run `pnpm install` and `pnpm build`.", "下一步:运行 `pnpm install` 和 `pnpm build`。"));
|
|
2817
2751
|
});
|
|
2818
2752
|
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) => {
|
|
2819
|
-
const { runCreateFlow } = await import("./create-flow-
|
|
2753
|
+
const { runCreateFlow } = await import("./create-flow-B6mkhe47.mjs");
|
|
2820
2754
|
const result = await runCreateFlow(cwd, inputName, {
|
|
2821
2755
|
...opts.offline !== void 0 ? { offline: opts.offline } : {},
|
|
2822
2756
|
...opts.cacheDir ? { cacheDir: opts.cacheDir } : {},
|
|
@@ -2834,32 +2768,30 @@ function registerTopLevelCommands(program, cwd) {
|
|
|
2834
2768
|
registerDoctorCommand(program, cwd);
|
|
2835
2769
|
registerUpgradeCommand(program, cwd);
|
|
2836
2770
|
}
|
|
2837
|
-
|
|
2838
|
-
//#region src/cli/commands/verify.ts
|
|
2771
|
+
// src/cli/commands/verify.ts
|
|
2839
2772
|
function registerVerifyCommands(program, cwd) {
|
|
2840
2773
|
const verifyCommand = program.command("verify").alias("v").description(localize("Local verification commands", "本地校验工具集"));
|
|
2841
2774
|
verifyCommand.command("pre-push").description(localize("Run build, test, and tsd checks for pushed changes", "按推送变更范围执行 build/test/tsd 校验")).alias("push").action(async () => {
|
|
2842
|
-
const { verifyPrePush } = await import("./commands-
|
|
2775
|
+
const { verifyPrePush } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2843
2776
|
await verifyPrePush({ cwd });
|
|
2844
2777
|
});
|
|
2845
2778
|
verifyCommand.command("pre-commit").description(localize("Run Lefthook verification", "执行 Lefthook 校验")).alias("commit").action(async () => {
|
|
2846
|
-
const { verifyPreCommit } = await import("./commands-
|
|
2779
|
+
const { verifyPreCommit } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2847
2780
|
await verifyPreCommit({ cwd });
|
|
2848
2781
|
});
|
|
2849
2782
|
verifyCommand.command("commit-msg").description(localize("Run commitlint verification", "执行 commitlint 校验")).alias("msg").argument("<edit-file>").action(async (editFile) => {
|
|
2850
|
-
const { verifyCommitMsg } = await import("./commands-
|
|
2783
|
+
const { verifyCommitMsg } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2851
2784
|
await verifyCommitMsg({
|
|
2852
2785
|
cwd,
|
|
2853
2786
|
editFile
|
|
2854
2787
|
});
|
|
2855
2788
|
});
|
|
2856
2789
|
verifyCommand.command("staged-typecheck").description(localize("Run typecheck in workspaces containing staged files", "按暂存文件所在 workspace 执行 typecheck")).alias("tc").argument("[files...]").action(async (files = []) => {
|
|
2857
|
-
const { verifyStagedTypecheck } = await import("./commands-
|
|
2790
|
+
const { verifyStagedTypecheck } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
2858
2791
|
verifyStagedTypecheck(files.length ? files : void 0, { cwd });
|
|
2859
2792
|
});
|
|
2860
2793
|
}
|
|
2861
|
-
|
|
2862
|
-
//#region src/cli/commands/workspace/boundaries.ts
|
|
2794
|
+
// src/cli/commands/workspace/boundaries.ts
|
|
2863
2795
|
function registerWorkspaceBoundaries(workspaceCommand, cwd) {
|
|
2864
2796
|
workspaceCommand.command("boundaries").description(localize("Check internal dependency cycles and architecture rules", "检查内部依赖循环与架构规则")).option("--json", localize("Output stable JSON", "输出稳定 JSON")).option("--strict", localize("Fail on warnings as well as errors", "警告和错误均返回失败")).action(async (options) => {
|
|
2865
2797
|
const report = await checkWorkspaceBoundaries(cwd);
|
|
@@ -2870,8 +2802,7 @@ function registerWorkspaceBoundaries(workspaceCommand, cwd) {
|
|
|
2870
2802
|
if (report.summary.fail || options.strict && report.summary.warn) process.exitCode = 1;
|
|
2871
2803
|
});
|
|
2872
2804
|
}
|
|
2873
|
-
|
|
2874
|
-
//#region src/cli/commands/workspace/format.ts
|
|
2805
|
+
// src/cli/commands/workspace/format.ts
|
|
2875
2806
|
function redactWorkspaceGraph(graph) {
|
|
2876
2807
|
let serialized = JSON.stringify(graph);
|
|
2877
2808
|
const replacements = [
|
|
@@ -2920,8 +2851,7 @@ function formatWorkspaceImpact(result) {
|
|
|
2920
2851
|
...formatGraphDiagnostics(result.diagnostics)
|
|
2921
2852
|
].join("\n");
|
|
2922
2853
|
}
|
|
2923
|
-
|
|
2924
|
-
//#region src/cli/commands/workspace/graph.ts
|
|
2854
|
+
// src/cli/commands/workspace/graph.ts
|
|
2925
2855
|
function collect(value, previous = []) {
|
|
2926
2856
|
return [...previous, value];
|
|
2927
2857
|
}
|
|
@@ -2952,8 +2882,7 @@ function registerWorkspaceGraphCommands(workspaceCommand, cwd) {
|
|
|
2952
2882
|
process.stdout.write(`${options.json ? JSON.stringify(result, null, 2) : formatWorkspaceImpact(result)}\n`);
|
|
2953
2883
|
});
|
|
2954
2884
|
}
|
|
2955
|
-
|
|
2956
|
-
//#region src/cli/commands/workspace/move.ts
|
|
2885
|
+
// src/cli/commands/workspace/move.ts
|
|
2957
2886
|
function formatPlan$1(plan) {
|
|
2958
2887
|
return [
|
|
2959
2888
|
localize(`Move preview: ${plan.target.id} → ${plan.destination.id}`, `移动预览:${plan.target.id} → ${plan.destination.id}`),
|
|
@@ -2992,8 +2921,7 @@ function registerWorkspaceMove(workspace, cwd) {
|
|
|
2992
2921
|
if (!plan.canApply) process.exitCode = 1;
|
|
2993
2922
|
});
|
|
2994
2923
|
}
|
|
2995
|
-
|
|
2996
|
-
//#region src/cli/commands/workspace/owners.ts
|
|
2924
|
+
// src/cli/commands/workspace/owners.ts
|
|
2997
2925
|
function registerWorkspaceOwnersCommand(command, cwd) {
|
|
2998
2926
|
command.command("owners [workspace]").description(localize("Inspect workspace owners and preview CODEOWNERS changes", "查询包负责人并预览 CODEOWNERS 变更")).option("--file <file>", localize("Explicit CODEOWNERS path relative to the workspace root", "显式指定相对工作区根目录的 CODEOWNERS 路径")).option("--sync", localize("Apply the validated preview to the selected file", "把校验过的预览写入指定文件")).option("--dry-run", localize("Preview without writing, including with --sync", "只预览不写入,包括与 --sync 一起使用时")).option("--json", localize("Output JSON", "输出 JSON")).action(async (query, options) => {
|
|
2999
2927
|
if (options.sync && !options.file) throw new Error("--sync requires an explicit --file.");
|
|
@@ -3020,8 +2948,7 @@ function registerWorkspaceOwnersCommand(command, cwd) {
|
|
|
3020
2948
|
if (report.diagnostics.some((item) => item.severity === "error") || query && !report.packages.length) process.exitCode = 1;
|
|
3021
2949
|
});
|
|
3022
2950
|
}
|
|
3023
|
-
|
|
3024
|
-
//#region src/cli/commands/workspace/prepare.ts
|
|
2951
|
+
// src/cli/commands/workspace/prepare.ts
|
|
3025
2952
|
function registerWorkspacePrepare(command, cwd) {
|
|
3026
2953
|
command.command("prepare [target]").description(localize("Preview isolated Turbo prune or production pnpm deploy artifacts", "预览隔离的 Turbo prune 或生产 pnpm deploy 产物")).option("--mode <mode>", localize("prune for a build context; deploy for a production directory", "prune 生成构建上下文,deploy 生成生产目录")).option("--out <directory>", localize("Explicit empty output directory outside the workspace", "工作区外的显式空输出目录")).option("--entry <file>", localize("Built deploy entry relative to the package", "相对包目录的已构建部署入口")).option("--docker", localize("Split prune output into Docker layers", "将 prune 产物分成 Docker 缓存层")).option("--offline", localize("Deploy only from local package stores", "部署仅使用本地包存储")).option("--legacy", localize("Explicitly select native legacy deploy", "显式使用原生 legacy deploy")).option("--json", localize("Output the portable JSON plan", "输出可保存的 JSON 计划")).option("--dry-run", localize("Explicitly preview without creating artifacts (default)", "显式只读预览,不创建产物(默认)")).option("--apply <plan.json>", localize("Apply a reviewed saved plan", "应用已审查的保存计划")).action(async (target, options, current) => {
|
|
3027
2954
|
const inherited = current.optsWithGlobals();
|
|
@@ -3053,8 +2980,7 @@ function registerWorkspacePrepare(command, cwd) {
|
|
|
3053
2980
|
].join("\n")}\n`);
|
|
3054
2981
|
});
|
|
3055
2982
|
}
|
|
3056
|
-
|
|
3057
|
-
//#region src/cli/commands/workspace/remove.ts
|
|
2983
|
+
// src/cli/commands/workspace/remove.ts
|
|
3058
2984
|
function formatPlan(plan) {
|
|
3059
2985
|
return [
|
|
3060
2986
|
localize(`Removal preview: ${plan.target.name ?? "(unnamed)"} (${plan.target.id})`, `移除预览:${plan.target.name ?? "(未命名)"}(${plan.target.id})`),
|
|
@@ -3094,8 +3020,7 @@ function registerWorkspaceRemoval(workspace, cwd) {
|
|
|
3094
3020
|
if (!plan.canApply) process.exitCode = 1;
|
|
3095
3021
|
});
|
|
3096
3022
|
}
|
|
3097
|
-
|
|
3098
|
-
//#region src/cli/commands/workspace/tasks.ts
|
|
3023
|
+
// src/cli/commands/workspace/tasks.ts
|
|
3099
3024
|
function formatCatalog(catalog) {
|
|
3100
3025
|
return catalog.packages.flatMap((pkg) => [`${pkg.name ?? "(unnamed)"} (${pkg.id})${pkg.root ? " [root]" : ""}${pkg.private ? " [private]" : ""}`, ...pkg.tasks.length ? pkg.tasks.map((task) => ` ${task.name}: ${task.command}`) : [localize(" (no scripts)", " (无脚本)")]]).join("\n") || localize("No workspace matches the requested query/script.", "没有工作区符合指定查询或脚本。");
|
|
3101
3026
|
}
|
|
@@ -3135,8 +3060,7 @@ function registerWorkspaceTasks(workspace, cwd) {
|
|
|
3135
3060
|
if (result.status !== "found") process.exitCode = 1;
|
|
3136
3061
|
});
|
|
3137
3062
|
}
|
|
3138
|
-
|
|
3139
|
-
//#region src/cli/commands/workspace.ts
|
|
3063
|
+
// src/cli/commands/workspace.ts
|
|
3140
3064
|
function collectValues(value, previous = []) {
|
|
3141
3065
|
return [...previous, value];
|
|
3142
3066
|
}
|
|
@@ -3218,12 +3142,12 @@ function registerWorkspaceCommands(program, cwd) {
|
|
|
3218
3142
|
registerWorkspaceRemoval(workspaceCommand, cwd);
|
|
3219
3143
|
registerWorkspaceMove(workspaceCommand, cwd);
|
|
3220
3144
|
workspaceCommand.command("init").description(localize("Initialize workspace metadata and repository files", "初始化工作区元信息(README、package.json、pnpm intent、issue template)")).alias("i").action(async () => {
|
|
3221
|
-
const { initMetadata } = await import("./commands-
|
|
3145
|
+
const { initMetadata } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
3222
3146
|
await initMetadata(cwd);
|
|
3223
3147
|
logger.success(localize("Workspace initialization finished.", "Workspace 初始化完成。"));
|
|
3224
3148
|
});
|
|
3225
3149
|
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) => {
|
|
3226
|
-
const { getWorkspacePackageSummaries } = await import("./workspace-tasks-
|
|
3150
|
+
const { getWorkspacePackageSummaries } = await import("./workspace-tasks-i69iIhom.mjs").then((n) => n.Kt);
|
|
3227
3151
|
await emitWorkspaceList(await getWorkspacePackageSummaries(cwd, {
|
|
3228
3152
|
ignorePrivatePackage: !opts.includePrivate,
|
|
3229
3153
|
ignoreRootPackage: !opts.includeRoot,
|
|
@@ -3231,12 +3155,11 @@ function registerWorkspaceCommands(program, cwd) {
|
|
|
3231
3155
|
}), opts);
|
|
3232
3156
|
});
|
|
3233
3157
|
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) => {
|
|
3234
|
-
const { cleanProjects } = await import("./commands-
|
|
3158
|
+
const { cleanProjects } = await import("./commands-By0wXIqB.mjs").then((n) => n.t);
|
|
3235
3159
|
await cleanProjects(cwd, normalizeCleanOptions(opts));
|
|
3236
3160
|
});
|
|
3237
3161
|
}
|
|
3238
|
-
|
|
3239
|
-
//#region src/cli/program.ts
|
|
3162
|
+
// src/cli/program.ts
|
|
3240
3163
|
const cwd = process.cwd();
|
|
3241
3164
|
const program = new Command();
|
|
3242
3165
|
const activeCliName = path$1.basename(process.argv[1] ?? "", path$1.extname(process.argv[1] ?? "")) === "repoctl" ? "repoctl" : cliName;
|
|
@@ -3283,10 +3206,8 @@ registerGenerateCommand(program, cwd);
|
|
|
3283
3206
|
registerMaintenanceCommands(program, cwd);
|
|
3284
3207
|
configureLocalizedHelp(program);
|
|
3285
3208
|
program.addHelpText("after", message("quickStart", { cliName: activeCliName }));
|
|
3286
|
-
|
|
3287
|
-
//#region src/cli.ts
|
|
3209
|
+
// src/cli.ts
|
|
3288
3210
|
registerConfigPreflight(program, process.cwd());
|
|
3289
3211
|
if (process.argv.length <= 2) program.outputHelp();
|
|
3290
3212
|
else program.parseAsync().catch(reportCliFailure);
|
|
3291
|
-
//#endregion
|
|
3292
3213
|
export { formatAffectedCheckPlan as t };
|