@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { N as ConfigValidationError, f as loadMonorepoConfigDetails, j as version, u as getRepoctlConfigCandidates } from "./tsconfig-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.mjs";
|
|
2
|
+
import { N as ConfigValidationError, f as loadMonorepoConfigDetails, j as version, u as getRepoctlConfigCandidates } from "./tsconfig-KnvwNzkL.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import gitUrlParse from "git-url-parse";
|
|
5
5
|
import { simpleGit } from "simple-git";
|
|
@@ -26,7 +26,7 @@ import { parse as parse$1 } from "comment-json";
|
|
|
26
26
|
import micromatch from "micromatch";
|
|
27
27
|
import { performance } from "node:perf_hooks";
|
|
28
28
|
import { parse as parse$2 } from "@babel/parser";
|
|
29
|
-
|
|
29
|
+
// src/core/git.ts
|
|
30
30
|
/**
|
|
31
31
|
* 对 simple-git 的轻量封装,集中处理配置缓存与常用查询。
|
|
32
32
|
*/
|
|
@@ -93,8 +93,7 @@ var GitClient = class {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
};
|
|
96
|
-
|
|
97
|
-
//#region src/core/workspace/discovery.ts
|
|
96
|
+
// src/core/workspace/discovery.ts
|
|
98
97
|
/** Discover manifests, including foreign-platform packages, without installing them. */
|
|
99
98
|
async function findWorkspacePackages(root, options = {}) {
|
|
100
99
|
return (await findPackages(root, {
|
|
@@ -103,14 +102,8 @@ async function findWorkspacePackages(root, options = {}) {
|
|
|
103
102
|
includeRoot: true
|
|
104
103
|
})).sort((left, right) => left.rootDir < right.rootDir ? -1 : left.rootDir > right.rootDir ? 1 : 0);
|
|
105
104
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
var workspace_exports = /* @__PURE__ */ __exportAll({
|
|
109
|
-
clearWorkspaceCache: () => clearWorkspaceCache,
|
|
110
|
-
getWorkspaceData: () => getWorkspaceData,
|
|
111
|
-
getWorkspacePackageSummaries: () => getWorkspacePackageSummaries,
|
|
112
|
-
getWorkspacePackages: () => getWorkspacePackages
|
|
113
|
-
});
|
|
105
|
+
// src/core/workspace.ts
|
|
106
|
+
var workspace_exports = /* @__PURE__ */ __exportAll({ getWorkspacePackageSummaries: () => getWorkspacePackageSummaries });
|
|
114
107
|
const workspaceDirCache = /* @__PURE__ */ new Map();
|
|
115
108
|
const workspaceManifestCache = /* @__PURE__ */ new Map();
|
|
116
109
|
const workspacePackagesCache = /* @__PURE__ */ new Map();
|
|
@@ -220,8 +213,7 @@ async function getWorkspacePackageSummaries(cwd, options) {
|
|
|
220
213
|
packages: summaries
|
|
221
214
|
};
|
|
222
215
|
}
|
|
223
|
-
|
|
224
|
-
//#region src/utils/fs.ts
|
|
216
|
+
// src/utils/fs.ts
|
|
225
217
|
function stringifyJson(data, options) {
|
|
226
218
|
const content = JSON.stringify(data, void 0, options?.spaces);
|
|
227
219
|
return options?.spaces ? `${content}\n` : content;
|
|
@@ -350,8 +342,7 @@ const fs$2 = {
|
|
|
350
342
|
writeJSON,
|
|
351
343
|
writeJson
|
|
352
344
|
};
|
|
353
|
-
|
|
354
|
-
//#region src/i18n/locales/en/error.ts
|
|
345
|
+
// src/i18n/locales/en/error.ts
|
|
355
346
|
const errorMessages$1 = {
|
|
356
347
|
commanderAllowedChoices: "Allowed choices are",
|
|
357
348
|
commanderArgumentMissing: "argument missing",
|
|
@@ -370,8 +361,7 @@ const errorMessages$1 = {
|
|
|
370
361
|
missingPackageJsonForTooling: "Cannot initialize tooling because package.json was not found: {path}",
|
|
371
362
|
missingDependencyVersion: "No version information was found for dependency {name}."
|
|
372
363
|
};
|
|
373
|
-
|
|
374
|
-
//#region src/i18n/locales/en/help.ts
|
|
364
|
+
// src/i18n/locales/en/help.ts
|
|
375
365
|
const helpMessages$1 = {
|
|
376
366
|
argumentsTitle: "Arguments:",
|
|
377
367
|
cliDescription: "Task-first repository initialization and maintenance for pnpm and Turborepo workspaces.",
|
|
@@ -406,8 +396,7 @@ Quick start:
|
|
|
406
396
|
usageTitle: "Usage:",
|
|
407
397
|
versionOption: "Output the version number"
|
|
408
398
|
};
|
|
409
|
-
|
|
410
|
-
//#region src/i18n/locales/en/prompt.ts
|
|
399
|
+
// src/i18n/locales/en/prompt.ts
|
|
411
400
|
const promptMessages$1 = {
|
|
412
401
|
createIntent: "What do you want to create?",
|
|
413
402
|
createName: "Enter a name",
|
|
@@ -418,8 +407,7 @@ const promptMessages$1 = {
|
|
|
418
407
|
overwriteFiles: "Select changed managed files to overwrite",
|
|
419
408
|
skillTargets: "Select skill synchronization targets"
|
|
420
409
|
};
|
|
421
|
-
|
|
422
|
-
//#region src/i18n/locales/en/report.ts
|
|
410
|
+
// src/i18n/locales/en/report.ts
|
|
423
411
|
const reportMessages$1 = {
|
|
424
412
|
wrote: "Wrote {path}",
|
|
425
413
|
dryRunOnly: "Dry run only; no files were written.",
|
|
@@ -429,16 +417,14 @@ const reportMessages$1 = {
|
|
|
429
417
|
doctorStrictWarnings: "Doctor found {count} warning(s) in strict mode.",
|
|
430
418
|
doctorSuggestions: "Doctor found {count} suggestion(s)."
|
|
431
419
|
};
|
|
432
|
-
|
|
433
|
-
//#region src/i18n/locales/en/index.ts
|
|
420
|
+
// src/i18n/locales/en/index.ts
|
|
434
421
|
const enMessages = {
|
|
435
422
|
...helpMessages$1,
|
|
436
423
|
...promptMessages$1,
|
|
437
424
|
...reportMessages$1,
|
|
438
425
|
...errorMessages$1
|
|
439
426
|
};
|
|
440
|
-
|
|
441
|
-
//#region src/i18n/locales/zh-CN/error.ts
|
|
427
|
+
// src/i18n/locales/zh-CN/error.ts
|
|
442
428
|
const errorMessages = {
|
|
443
429
|
commanderAllowedChoices: "可选值为",
|
|
444
430
|
commanderArgumentMissing: "缺少参数",
|
|
@@ -457,8 +443,7 @@ const errorMessages = {
|
|
|
457
443
|
missingPackageJsonForTooling: "未找到 package.json,无法初始化 tooling:{path}",
|
|
458
444
|
missingDependencyVersion: "未找到依赖 {name} 的版本信息。"
|
|
459
445
|
};
|
|
460
|
-
|
|
461
|
-
//#region src/i18n/locales/zh-CN/help.ts
|
|
446
|
+
// src/i18n/locales/zh-CN/help.ts
|
|
462
447
|
const helpMessages = {
|
|
463
448
|
argumentsTitle: "参数:",
|
|
464
449
|
cliDescription: "面向 pnpm 与 Turborepo 工作区的任务型仓库初始化与维护工具。",
|
|
@@ -493,8 +478,7 @@ const helpMessages = {
|
|
|
493
478
|
usageTitle: "用法:",
|
|
494
479
|
versionOption: "输出版本号"
|
|
495
480
|
};
|
|
496
|
-
|
|
497
|
-
//#region src/i18n/locales/zh-CN/prompt.ts
|
|
481
|
+
// src/i18n/locales/zh-CN/prompt.ts
|
|
498
482
|
const promptMessages = {
|
|
499
483
|
createIntent: "你要创建什么?",
|
|
500
484
|
createName: "请输入名称",
|
|
@@ -505,8 +489,7 @@ const promptMessages = {
|
|
|
505
489
|
overwriteFiles: "检测到受管文件内容变化,请选择要覆盖的文件",
|
|
506
490
|
skillTargets: "请选择需要同步的技能目标"
|
|
507
491
|
};
|
|
508
|
-
|
|
509
|
-
//#region src/i18n/locales/zh-CN/report.ts
|
|
492
|
+
// src/i18n/locales/zh-CN/report.ts
|
|
510
493
|
const reportMessages = {
|
|
511
494
|
wrote: "已写入 {path}",
|
|
512
495
|
dryRunOnly: "仅执行预览;未写入任何文件。",
|
|
@@ -516,16 +499,14 @@ const reportMessages = {
|
|
|
516
499
|
doctorStrictWarnings: "严格模式下 doctor 发现 {count} 个警告。",
|
|
517
500
|
doctorSuggestions: "Doctor 提供了 {count} 条建议。"
|
|
518
501
|
};
|
|
519
|
-
|
|
520
|
-
//#region src/i18n/locales/zh-CN/index.ts
|
|
502
|
+
// src/i18n/locales/zh-CN/index.ts
|
|
521
503
|
const zhCNMessages = {
|
|
522
504
|
...helpMessages,
|
|
523
505
|
...promptMessages,
|
|
524
506
|
...reportMessages,
|
|
525
507
|
...errorMessages
|
|
526
508
|
};
|
|
527
|
-
|
|
528
|
-
//#region src/i18n/index.ts
|
|
509
|
+
// src/i18n/index.ts
|
|
529
510
|
const supportedLocales = ["en", "zh-CN"];
|
|
530
511
|
function isRepoctlLocale(value) {
|
|
531
512
|
return supportedLocales.includes(value);
|
|
@@ -550,8 +531,7 @@ function message(key, values = {}) {
|
|
|
550
531
|
const catalog = repoctlLocale === "zh-CN" ? zhCNMessages : enMessages;
|
|
551
532
|
return Object.entries(values).reduce((result, [name, value]) => result.replaceAll(`{${name}}`, value), catalog[key]);
|
|
552
533
|
}
|
|
553
|
-
|
|
554
|
-
//#region src/constants.ts
|
|
534
|
+
// src/constants.ts
|
|
555
535
|
const require = createRequire(import.meta.url);
|
|
556
536
|
/**
|
|
557
537
|
* 用户默认看到的 CLI 名称,帮助文案和生成脚本都统一引导到 repo。
|
|
@@ -576,8 +556,7 @@ const templatesDir = path$2.join(templatesPackageDir, "templates");
|
|
|
576
556
|
* monorepo 根目录,方便需要跳出当前包的逻辑(例如定位工作区文件)。
|
|
577
557
|
*/
|
|
578
558
|
const rootDir = path$2.resolve(packageDir$1, "..", "..");
|
|
579
|
-
|
|
580
|
-
//#region src/commands/clean/safety.ts
|
|
559
|
+
// src/commands/clean/safety.ts
|
|
581
560
|
function unsafe(target) {
|
|
582
561
|
return new Error(localize(`Unsafe cleanup target: ${target}`, `清理目标不安全:${target}`));
|
|
583
562
|
}
|
|
@@ -610,8 +589,7 @@ async function validateCleanTargets(workspace, selected) {
|
|
|
610
589
|
}
|
|
611
590
|
}
|
|
612
591
|
}
|
|
613
|
-
|
|
614
|
-
//#region src/core/file-transaction/index.ts
|
|
592
|
+
// src/core/file-transaction/index.ts
|
|
615
593
|
/** Keep preparation, replacement and cleanup separate for transactions that also move directories. */
|
|
616
594
|
async function stageFileTransaction(updates, validate, namespace) {
|
|
617
595
|
const id = randomUUID();
|
|
@@ -715,8 +693,7 @@ async function stageFileTransaction(updates, validate, namespace) {
|
|
|
715
693
|
}
|
|
716
694
|
};
|
|
717
695
|
}
|
|
718
|
-
|
|
719
|
-
//#region src/utils/object.ts
|
|
696
|
+
// src/utils/object.ts
|
|
720
697
|
const arrayIndexPattern = /^\d+$/;
|
|
721
698
|
function isArrayIndex(value) {
|
|
722
699
|
return arrayIndexPattern.test(value);
|
|
@@ -762,8 +739,7 @@ function setByPath(target, path, value) {
|
|
|
762
739
|
current[lastKey] = value;
|
|
763
740
|
return target;
|
|
764
741
|
}
|
|
765
|
-
|
|
766
|
-
//#region src/commands/tooling-migration.ts
|
|
742
|
+
// src/commands/tooling-migration.ts
|
|
767
743
|
const legacyToolingLoaderImportPattern = /import\s+\{\s*load(?:Repoctl|Monorepo)ToolingModule\s*\}\s+from\s+['"][^'"]*tooling\/load-tooling-module\.mjs['"]\s*;?\n?/g;
|
|
768
744
|
const legacyToolingLoaderCallPattern = /const\s+\{\s*([\w$]+(?:\s*,\s*[\w$]+)*)\s*\}\s*=\s*await\s+load(?:Repoctl|Monorepo)ToolingModule\(\)\s*;?\n?/g;
|
|
769
745
|
const legacyToolingEntryPattern = /packages\/(?:monorepo|repoctl)\/dist\/tooling-entry\.mjs/;
|
|
@@ -935,8 +911,7 @@ function migrateLegacyToolingReferences(content, importSource = "repoctl/tooling
|
|
|
935
911
|
nextContent = nextContent.replace(legacyToolingLoaderImportPattern, "");
|
|
936
912
|
return migrateDirectToolingReferences(`${`import { ${normalizeNamedImports(importNames.join(",")).join(", ")} } from '${importSource}'\n`}${nextContent}`, importSource).replace(/\n{3,}/g, "\n\n").trimStart();
|
|
937
913
|
}
|
|
938
|
-
|
|
939
|
-
//#region src/commands/create/render.ts
|
|
914
|
+
// src/commands/create/render.ts
|
|
940
915
|
const rootReferenceExtensions = /* @__PURE__ */ new Set([
|
|
941
916
|
".cjs",
|
|
942
917
|
".cts",
|
|
@@ -1052,8 +1027,7 @@ async function renderCreateNewProject(plan, gitMetadata = true) {
|
|
|
1052
1027
|
await fs$2.outputJson(path.resolve(plan.targetDir, plan.packageJsonFileName), sourceJson, { spaces: 2 });
|
|
1053
1028
|
}
|
|
1054
1029
|
}
|
|
1055
|
-
|
|
1056
|
-
//#region src/commands/deps/files.ts
|
|
1030
|
+
// src/commands/deps/files.ts
|
|
1057
1031
|
function hash(content) {
|
|
1058
1032
|
return createHash("sha256").update(content).digest("hex");
|
|
1059
1033
|
}
|
|
@@ -1084,8 +1058,7 @@ function updateManifest(original, section, dependency, target) {
|
|
|
1084
1058
|
const newline = original.includes("\r\n") ? "\r\n" : "\n";
|
|
1085
1059
|
return `${JSON.stringify(manifest, null, indentation).replaceAll("\n", newline)}${original.endsWith("\n") ? newline : ""}`;
|
|
1086
1060
|
}
|
|
1087
|
-
|
|
1088
|
-
//#region src/core/workspace-graph/shared.ts
|
|
1061
|
+
// src/core/workspace-graph/shared.ts
|
|
1089
1062
|
const workspaceDependencyTypes = [
|
|
1090
1063
|
"dependencies",
|
|
1091
1064
|
"devDependencies",
|
|
@@ -1120,8 +1093,7 @@ function resolveWorkspaceGraphNode(graph, selector) {
|
|
|
1120
1093
|
if (!node) throw new WorkspaceGraphQueryError("package_not_found", selector, []);
|
|
1121
1094
|
return node;
|
|
1122
1095
|
}
|
|
1123
|
-
|
|
1124
|
-
//#region src/core/workspace-graph/query.ts
|
|
1096
|
+
// src/core/workspace-graph/query.ts
|
|
1125
1097
|
function edgeKey(edge) {
|
|
1126
1098
|
return JSON.stringify([
|
|
1127
1099
|
edge.source,
|
|
@@ -1229,8 +1201,7 @@ function getWorkspaceImpact(graph, selector, options = {}) {
|
|
|
1229
1201
|
diagnostics: filtered.diagnostics
|
|
1230
1202
|
};
|
|
1231
1203
|
}
|
|
1232
|
-
|
|
1233
|
-
//#region src/core/workspace-graph/resolve.ts
|
|
1204
|
+
// src/core/workspace-graph/resolve.ts
|
|
1234
1205
|
function parseDependencyReference(dependency, specifier, rootDir) {
|
|
1235
1206
|
const workspace = specifier.startsWith("workspace:");
|
|
1236
1207
|
if (specifier.startsWith("link:") || specifier.startsWith("file:") || workspace && specifier.slice(10).startsWith(".")) return {
|
|
@@ -1307,8 +1278,7 @@ function resolveGraphDependency(source, sourceId, dependency, specifier, type, p
|
|
|
1307
1278
|
};
|
|
1308
1279
|
return reference.required ? diagnostic("incompatible_version") : {};
|
|
1309
1280
|
}
|
|
1310
|
-
|
|
1311
|
-
//#region src/core/workspace-graph/index.ts
|
|
1281
|
+
// src/core/workspace-graph/index.ts
|
|
1312
1282
|
/** Read manifest relationships, including private packages by default; never writes files. */
|
|
1313
1283
|
async function getWorkspaceGraph(cwd, options = {}) {
|
|
1314
1284
|
clearWorkspaceCache();
|
|
@@ -1360,8 +1330,7 @@ async function getWorkspaceGraph(cwd, options = {}) {
|
|
|
1360
1330
|
}
|
|
1361
1331
|
return filterWorkspaceGraph(graph, options);
|
|
1362
1332
|
}
|
|
1363
|
-
|
|
1364
|
-
//#region src/core/operation-lock/index.ts
|
|
1333
|
+
// src/core/operation-lock/index.ts
|
|
1365
1334
|
/** Serialize validation, mutation, rollback and cleanup, including identical concurrent plans. */
|
|
1366
1335
|
async function withOperationLock(root, name, run) {
|
|
1367
1336
|
if (!/^[a-z][a-z0-9-]*$/.test(name)) throw new Error("Invalid operation lock name");
|
|
@@ -1420,8 +1389,7 @@ async function withOperationLock(root, name, run) {
|
|
|
1420
1389
|
if (failures.length) throw failures[0];
|
|
1421
1390
|
return result;
|
|
1422
1391
|
}
|
|
1423
|
-
|
|
1424
|
-
//#region src/core/merge-text/index.ts
|
|
1392
|
+
// src/core/merge-text/index.ts
|
|
1425
1393
|
function decode(content) {
|
|
1426
1394
|
if (content.includes(0)) return null;
|
|
1427
1395
|
try {
|
|
@@ -1480,8 +1448,7 @@ function mergeText(base, local, upstream) {
|
|
|
1480
1448
|
conflicts
|
|
1481
1449
|
};
|
|
1482
1450
|
}
|
|
1483
|
-
|
|
1484
|
-
//#region src/commands/check/cache/compare.ts
|
|
1451
|
+
// src/commands/check/cache/compare.ts
|
|
1485
1452
|
function group(field) {
|
|
1486
1453
|
if (field.startsWith("global.files.")) return "global.files";
|
|
1487
1454
|
if (field.startsWith("global.environment.")) return "global.environment";
|
|
@@ -1536,8 +1503,7 @@ function analyzeTask(id, now, before) {
|
|
|
1536
1503
|
evidence: before && current && previous && supported ? differences(current, previous) : []
|
|
1537
1504
|
};
|
|
1538
1505
|
}
|
|
1539
|
-
|
|
1540
|
-
//#region src/commands/check/cache/critical-path.ts
|
|
1506
|
+
// src/commands/check/cache/critical-path.ts
|
|
1541
1507
|
const unavailable = (reason) => ({
|
|
1542
1508
|
available: false,
|
|
1543
1509
|
reason,
|
|
@@ -1592,8 +1558,7 @@ function criticalPath(summary) {
|
|
|
1592
1558
|
observedSpanMs: tasks.reduce((latest, task) => Math.max(latest, task.end), 0) - tasks.reduce((earliest, task) => Math.min(earliest, task.start), Infinity)
|
|
1593
1559
|
};
|
|
1594
1560
|
}
|
|
1595
|
-
|
|
1596
|
-
//#region src/commands/check/cache/evidence.ts
|
|
1561
|
+
// src/commands/check/cache/evidence.ts
|
|
1597
1562
|
function record$1(value) {
|
|
1598
1563
|
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
1599
1564
|
}
|
|
@@ -1693,8 +1658,7 @@ function configurationEvidence(output, task) {
|
|
|
1693
1658
|
else complete = false;
|
|
1694
1659
|
return complete;
|
|
1695
1660
|
}
|
|
1696
|
-
|
|
1697
|
-
//#region src/commands/check/cache/parse.ts
|
|
1661
|
+
// src/commands/check/cache/parse.ts
|
|
1698
1662
|
const finite = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
1699
1663
|
function parseTask(task, id) {
|
|
1700
1664
|
const execution = record$1(task["execution"]);
|
|
@@ -1846,8 +1810,7 @@ async function readTurboSummary(filename, summary) {
|
|
|
1846
1810
|
});
|
|
1847
1811
|
return result;
|
|
1848
1812
|
}
|
|
1849
|
-
|
|
1850
|
-
//#region src/commands/check/cache/index.ts
|
|
1813
|
+
// src/commands/check/cache/index.ts
|
|
1851
1814
|
var cache_exports = /* @__PURE__ */ __exportAll({ analyzeTurboRuns: () => analyzeTurboRuns });
|
|
1852
1815
|
/** Analyze existing evidence only. Never invoke Turbo, package scripts, or cache mutation. */
|
|
1853
1816
|
async function analyzeTurboRuns(current, options = {}) {
|
|
@@ -1903,8 +1866,7 @@ async function analyzeTurboRuns(current, options = {}) {
|
|
|
1903
1866
|
limitations
|
|
1904
1867
|
};
|
|
1905
1868
|
}
|
|
1906
|
-
|
|
1907
|
-
//#region src/commands/check/process.ts
|
|
1869
|
+
// src/commands/check/process.ts
|
|
1908
1870
|
function signalExitCode(signal) {
|
|
1909
1871
|
return 128 + (constants$1.signals[signal] ?? 1);
|
|
1910
1872
|
}
|
|
@@ -1977,8 +1939,7 @@ async function executeCheckTask(task, signal) {
|
|
|
1977
1939
|
}
|
|
1978
1940
|
});
|
|
1979
1941
|
}
|
|
1980
|
-
|
|
1981
|
-
//#region src/commands/check/knip/index.ts
|
|
1942
|
+
// src/commands/check/knip/index.ts
|
|
1982
1943
|
var knip_exports = /* @__PURE__ */ __exportAll({
|
|
1983
1944
|
getKnipConfigurationSuggestions: () => getKnipConfigurationSuggestions,
|
|
1984
1945
|
planKnipCheck: () => planKnipCheck,
|
|
@@ -1986,19 +1947,18 @@ var knip_exports = /* @__PURE__ */ __exportAll({
|
|
|
1986
1947
|
saveKnipBaseline: () => saveKnipBaseline
|
|
1987
1948
|
});
|
|
1988
1949
|
async function planKnipCheck(cwd, options = {}) {
|
|
1989
|
-
return (await import("./plan-
|
|
1950
|
+
return (await import("./plan-lepevajA.mjs")).planKnipCheck(cwd, options);
|
|
1990
1951
|
}
|
|
1991
1952
|
async function runKnipCheck(cwd, options = {}) {
|
|
1992
|
-
return (await import("./run-
|
|
1953
|
+
return (await import("./run-Coc92Trs.mjs")).runKnipCheck(cwd, options);
|
|
1993
1954
|
}
|
|
1994
1955
|
async function getKnipConfigurationSuggestions(cwd) {
|
|
1995
|
-
return (await import("./config-
|
|
1956
|
+
return (await import("./config-CnB1hpD_.mjs")).getKnipConfigurationSuggestions(cwd);
|
|
1996
1957
|
}
|
|
1997
1958
|
async function saveKnipBaseline(cwd, report, file) {
|
|
1998
|
-
return (await import("./save-
|
|
1959
|
+
return (await import("./save-6C5t4ZGp.mjs")).saveKnipBaseline(cwd, report, file);
|
|
1999
1960
|
}
|
|
2000
|
-
|
|
2001
|
-
//#region src/commands/env-cache/config.ts
|
|
1961
|
+
// src/commands/env-cache/config.ts
|
|
2002
1962
|
const arrays = [
|
|
2003
1963
|
"env",
|
|
2004
1964
|
"passThroughEnv",
|
|
@@ -2108,8 +2068,7 @@ async function loadTurboConfigurations(root, packages) {
|
|
|
2108
2068
|
};
|
|
2109
2069
|
};
|
|
2110
2070
|
}
|
|
2111
|
-
|
|
2112
|
-
//#region src/commands/env-cache/patterns.ts
|
|
2071
|
+
// src/commands/env-cache/patterns.ts
|
|
2113
2072
|
function envRegex(pattern) {
|
|
2114
2073
|
let expression = "";
|
|
2115
2074
|
let wildcard = false;
|
|
@@ -2139,8 +2098,7 @@ function matchesFile(filename, patterns) {
|
|
|
2139
2098
|
function negativeFileMatch(filename, patterns) {
|
|
2140
2099
|
return patterns.some((pattern) => pattern.startsWith("!") && matchesFile(filename, [pattern.slice(1)]));
|
|
2141
2100
|
}
|
|
2142
|
-
|
|
2143
|
-
//#region src/commands/env-cache/scan.ts
|
|
2101
|
+
// src/commands/env-cache/scan.ts
|
|
2144
2102
|
const record = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
2145
2103
|
const variableName = (name) => typeof name === "string" && /^[A-Z_]\w*$/iu.test(name);
|
|
2146
2104
|
function property(node) {
|
|
@@ -2258,8 +2216,7 @@ function scanExample(filename, source) {
|
|
|
2258
2216
|
}
|
|
2259
2217
|
return result;
|
|
2260
2218
|
}
|
|
2261
|
-
|
|
2262
|
-
//#region src/commands/env-cache/files.ts
|
|
2219
|
+
// src/commands/env-cache/files.ts
|
|
2263
2220
|
const ignored = [
|
|
2264
2221
|
"**/node_modules/**",
|
|
2265
2222
|
"**/.git/**",
|
|
@@ -2365,8 +2322,7 @@ function defaultInputs(root, files) {
|
|
|
2365
2322
|
});
|
|
2366
2323
|
return result.status === 0 ? new Set(result.stdout.split("\0").filter(Boolean)) : null;
|
|
2367
2324
|
}
|
|
2368
|
-
|
|
2369
|
-
//#region src/commands/env-cache/turbo-environment.ts
|
|
2325
|
+
// src/commands/env-cache/turbo-environment.ts
|
|
2370
2326
|
const globalHash = ["VERCEL_ANALYTICS_ID", "VERCEL_TARGET_ENV"];
|
|
2371
2327
|
const passthrough = [
|
|
2372
2328
|
"HOME",
|
|
@@ -2442,8 +2398,7 @@ const builtinPassThroughEnv = passthrough.map((pattern) => ({
|
|
|
2442
2398
|
field: "passThroughEnv",
|
|
2443
2399
|
path: "turbo:built-in"
|
|
2444
2400
|
}));
|
|
2445
|
-
|
|
2446
|
-
//#region src/commands/env-cache/evaluate.ts
|
|
2401
|
+
// src/commands/env-cache/evaluate.ts
|
|
2447
2402
|
const frameworks = [
|
|
2448
2403
|
[["next"], ["NEXT_PUBLIC_*"]],
|
|
2449
2404
|
[["@sveltejs/kit"], ["PUBLIC_*"]],
|
|
@@ -2567,8 +2522,7 @@ function evaluate(pkg, directory, task, config, references, dynamic, files, defa
|
|
|
2567
2522
|
findings
|
|
2568
2523
|
};
|
|
2569
2524
|
}
|
|
2570
|
-
|
|
2571
|
-
//#region src/commands/env-cache/settings.ts
|
|
2525
|
+
// src/commands/env-cache/settings.ts
|
|
2572
2526
|
const list = (value) => Array.isArray(value) && value.every((item) => typeof item === "string" && item.length > 0 && item.length <= 1024 && !/[\p{Cc}\p{Cf}]/u.test(item));
|
|
2573
2527
|
const object = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
2574
2528
|
function settings(value, options) {
|
|
@@ -2628,8 +2582,7 @@ function suppress(findings, suppressions = []) {
|
|
|
2628
2582
|
message: `Environment suppression ${index} did not match any finding.`
|
|
2629
2583
|
});
|
|
2630
2584
|
}
|
|
2631
|
-
|
|
2632
|
-
//#region src/commands/env-cache/index.ts
|
|
2585
|
+
// src/commands/env-cache/index.ts
|
|
2633
2586
|
var env_cache_exports = /* @__PURE__ */ __exportAll({ checkEnvironmentCache: () => checkEnvironmentCache });
|
|
2634
2587
|
async function checkEnvironmentCache(cwd, options = {}) {
|
|
2635
2588
|
const report = {
|
|
@@ -2702,8 +2655,7 @@ async function checkEnvironmentCache(cwd, options = {}) {
|
|
|
2702
2655
|
report.status = report.summary.fail ? "fail" : report.summary.warn ? "warn" : "pass";
|
|
2703
2656
|
return report;
|
|
2704
2657
|
}
|
|
2705
|
-
|
|
2706
|
-
//#region src/commands/env-cache/format.ts
|
|
2658
|
+
// src/commands/env-cache/format.ts
|
|
2707
2659
|
var format_exports = /* @__PURE__ */ __exportAll({ formatEnvironmentCache: () => formatEnvironmentCache });
|
|
2708
2660
|
const cell = (value) => (value ?? "—").replace(/[\r\n|]/g, " ").replace(/</g, "<").replace(/>/g, ">").replace(/`/g, "`");
|
|
2709
2661
|
function formatEnvironmentCache(report, markdown = false) {
|
|
@@ -2725,8 +2677,7 @@ function formatEnvironmentCache(report, markdown = false) {
|
|
|
2725
2677
|
lines.push("", markdown ? "## Scan limits" : "Scan limits", ...report.limitations.map((item) => `- ${item}`));
|
|
2726
2678
|
return lines.join("\n");
|
|
2727
2679
|
}
|
|
2728
|
-
|
|
2729
|
-
//#region src/commands/generate/files.ts
|
|
2680
|
+
// src/commands/generate/files.ts
|
|
2730
2681
|
function generatorPath(value) {
|
|
2731
2682
|
if (typeof value !== "string" || !value || value.includes("\\") || path.isAbsolute(value) || value.split("/").some((part) => !part || part === "." || part === ".." || /[<>:"|?*]/.test(part) || [...part].some((character) => character.charCodeAt(0) < 32) || /[. ]$/.test(part) || /^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(part)) || value.split("/").some((part) => [
|
|
2732
2683
|
"node_modules",
|
|
@@ -2752,8 +2703,7 @@ async function generatorFile(root, relative) {
|
|
|
2752
2703
|
}
|
|
2753
2704
|
return readFile(await safeFile(root, relative), "utf8");
|
|
2754
2705
|
}
|
|
2755
|
-
|
|
2756
|
-
//#region src/commands/project-references/files.ts
|
|
2706
|
+
// src/commands/project-references/files.ts
|
|
2757
2707
|
const ownershipFile = ".repoctl/typescript-references.json";
|
|
2758
2708
|
const compare$1 = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
2759
2709
|
function relativeFile(value, glob = false) {
|
|
@@ -2791,8 +2741,7 @@ function referencePath(source, target) {
|
|
|
2791
2741
|
const relative = path.relative(path.dirname(source), target);
|
|
2792
2742
|
return relative.startsWith(".") ? relative : `./${relative}`;
|
|
2793
2743
|
}
|
|
2794
|
-
|
|
2795
|
-
//#region src/commands/project-references/compiler.ts
|
|
2744
|
+
// src/commands/project-references/compiler.ts
|
|
2796
2745
|
function loadCompiler(root) {
|
|
2797
2746
|
try {
|
|
2798
2747
|
return createRequire(path.join(root, "package.json"))("typescript");
|
|
@@ -2916,8 +2865,7 @@ async function validateGraph(starts, projected, read, diagnostics) {
|
|
|
2916
2865
|
};
|
|
2917
2866
|
for (const file of starts) await visit(file);
|
|
2918
2867
|
}
|
|
2919
|
-
|
|
2920
|
-
//#region src/commands/generate/exports.ts
|
|
2868
|
+
// src/commands/generate/exports.ts
|
|
2921
2869
|
function updateGeneratorExports(workspace, barrel, original, source, symbol, vue) {
|
|
2922
2870
|
const ts = loadCompiler(workspace);
|
|
2923
2871
|
const parsed = ts.createSourceFile(barrel, original, ts.ScriptTarget.Latest, true, ts.ScriptKind.TS);
|
|
@@ -2961,8 +2909,7 @@ function updateGeneratorExports(workspace, barrel, original, source, symbol, vue
|
|
|
2961
2909
|
}
|
|
2962
2910
|
return `${original}${original && !original.endsWith("\n") ? newline : ""}${printed}${newline}`;
|
|
2963
2911
|
}
|
|
2964
|
-
|
|
2965
|
-
//#region src/commands/generate/render.ts
|
|
2912
|
+
// src/commands/generate/render.ts
|
|
2966
2913
|
const generators = [
|
|
2967
2914
|
"vue-component",
|
|
2968
2915
|
"react-component",
|
|
@@ -3068,8 +3015,7 @@ it('does not accept unsupported methods', async () => {
|
|
|
3068
3015
|
`
|
|
3069
3016
|
};
|
|
3070
3017
|
}
|
|
3071
|
-
|
|
3072
|
-
//#region src/commands/generate/plan.ts
|
|
3018
|
+
// src/commands/generate/plan.ts
|
|
3073
3019
|
function declared(manifest, dependency) {
|
|
3074
3020
|
return [
|
|
3075
3021
|
"dependencies",
|
|
@@ -3165,8 +3111,7 @@ async function planGenerate(options) {
|
|
|
3165
3111
|
nextSteps
|
|
3166
3112
|
};
|
|
3167
3113
|
}
|
|
3168
|
-
|
|
3169
|
-
//#region src/commands/generate/apply.ts
|
|
3114
|
+
// src/commands/generate/apply.ts
|
|
3170
3115
|
async function applyLocked(plan) {
|
|
3171
3116
|
const fresh = await planGenerate(plan.options);
|
|
3172
3117
|
if (JSON.stringify(fresh) !== JSON.stringify(plan)) throw new Error("Generator plan is stale or modified; create and review a fresh plan.");
|
|
@@ -3251,15 +3196,12 @@ async function applyGeneratePlan(plan) {
|
|
|
3251
3196
|
if (JSON.stringify(fresh) !== JSON.stringify(plan)) throw new Error("Generator plan is stale or modified; create and review a fresh plan.");
|
|
3252
3197
|
return withOperationLock(plan.packageDir, "generate", () => applyLocked(plan));
|
|
3253
3198
|
}
|
|
3254
|
-
|
|
3255
|
-
//#region src/commands/generate/index.ts
|
|
3199
|
+
// src/commands/generate/index.ts
|
|
3256
3200
|
var generate_exports = /* @__PURE__ */ __exportAll({
|
|
3257
3201
|
applyGeneratePlan: () => applyGeneratePlan,
|
|
3258
|
-
generators: () => generators,
|
|
3259
3202
|
planGenerate: () => planGenerate
|
|
3260
3203
|
});
|
|
3261
|
-
|
|
3262
|
-
//#region src/commands/template-instances/source.ts
|
|
3204
|
+
// src/commands/template-instances/source.ts
|
|
3263
3205
|
async function renderHistoricalTemplate(options) {
|
|
3264
3206
|
const sourcePackageDir = options.sourceDir ? path.resolve(options.cwd, options.sourceDir) : packageDir;
|
|
3265
3207
|
const definition = getTemplateDefinition(options.template) ?? {
|
|
@@ -3348,8 +3290,7 @@ async function renderHistoricalTemplate(options) {
|
|
|
3348
3290
|
});
|
|
3349
3291
|
}
|
|
3350
3292
|
}
|
|
3351
|
-
|
|
3352
|
-
//#region src/commands/template-instances/link.ts
|
|
3293
|
+
// src/commands/template-instances/link.ts
|
|
3353
3294
|
function digest(value) {
|
|
3354
3295
|
return createHash("sha256").update(JSON.stringify(value)).digest("hex");
|
|
3355
3296
|
}
|
|
@@ -3495,8 +3436,7 @@ async function applyTemplateLinkPlan(plan) {
|
|
|
3495
3436
|
applied: true
|
|
3496
3437
|
};
|
|
3497
3438
|
}
|
|
3498
|
-
|
|
3499
|
-
//#region src/commands/template-instances/upgrade/current.ts
|
|
3439
|
+
// src/commands/template-instances/upgrade/current.ts
|
|
3500
3440
|
/** Inspect only template-owned candidates; unrelated and explicitly unmanaged business data is not a template snapshot. */
|
|
3501
3441
|
async function captureUpgradeTarget(root, paths, excluded = []) {
|
|
3502
3442
|
if (!(await fs.stat(root)).isDirectory()) throw new Error("A template upgrade target must be an existing directory.");
|
|
@@ -3535,11 +3475,9 @@ async function captureUpgradeTarget(root, paths, excluded = []) {
|
|
|
3535
3475
|
}
|
|
3536
3476
|
return snapshot;
|
|
3537
3477
|
}
|
|
3538
|
-
|
|
3539
|
-
//#region src/commands/template-instances/upgrade/digest.ts
|
|
3478
|
+
// src/commands/template-instances/upgrade/digest.ts
|
|
3540
3479
|
const upgradeDigest = (value) => createHash("sha256").update(JSON.stringify(value)).digest("hex");
|
|
3541
|
-
|
|
3542
|
-
//#region src/commands/template-instances/upgrade/changes.ts
|
|
3480
|
+
// src/commands/template-instances/upgrade/changes.ts
|
|
3543
3481
|
function snapshotEntries(snapshot) {
|
|
3544
3482
|
const result = /* @__PURE__ */ new Map();
|
|
3545
3483
|
for (const directory of snapshot.directories) result.set(directory, { kind: "directory" });
|
|
@@ -3613,8 +3551,7 @@ function computeTemplateUpgradeChanges(base, local, upstream, excluded) {
|
|
|
3613
3551
|
}
|
|
3614
3552
|
return changes;
|
|
3615
3553
|
}
|
|
3616
|
-
|
|
3617
|
-
//#region src/commands/template-instances/upgrade/source.ts
|
|
3554
|
+
// src/commands/template-instances/upgrade/source.ts
|
|
3618
3555
|
/** Retain the original generation identity rather than sampling the current machine's Git configuration. */
|
|
3619
3556
|
function preserveGenerationMetadata(snapshot, previous, instance) {
|
|
3620
3557
|
if (!["repo-new-v1", "repo-new-parameters-v1"].includes(instance.generator.profile)) return snapshot;
|
|
@@ -3649,8 +3586,7 @@ async function renderTemplateUpgradeSource(options, instance, previous) {
|
|
|
3649
3586
|
rendered: preserveGenerationMetadata(rendered.rendered, previous, instance)
|
|
3650
3587
|
};
|
|
3651
3588
|
}
|
|
3652
|
-
|
|
3653
|
-
//#region src/commands/template-instances/upgrade/transaction/state.ts
|
|
3589
|
+
// src/commands/template-instances/upgrade/transaction/state.ts
|
|
3654
3590
|
async function readUpgradeFileState(root, relative) {
|
|
3655
3591
|
const filename = await safeInstancePath(root, relative);
|
|
3656
3592
|
try {
|
|
@@ -3704,8 +3640,7 @@ function validateUpgradeFileState(state) {
|
|
|
3704
3640
|
if (!state || !Number.isInteger(state.mode) || state.mode < 0 || state.mode > 511 || !Number.isFinite(state.atimeMs) || !Number.isFinite(state.mtimeMs) || !state.entry || !["directory", "file"].includes(state.entry.kind)) throw new Error("Invalid template upgrade recovery file metadata.");
|
|
3705
3641
|
if (state.entry.kind === "file" && (typeof state.entry.content !== "string" || typeof state.entry.executable !== "boolean" || Buffer.from(state.entry.content, "base64").toString("base64") !== state.entry.content || (state.mode & 73) !== 0 !== state.entry.executable)) throw new Error("Invalid template upgrade recovery file content.");
|
|
3706
3642
|
}
|
|
3707
|
-
|
|
3708
|
-
//#region src/commands/template-instances/upgrade/transaction/journal.ts
|
|
3643
|
+
// src/commands/template-instances/upgrade/transaction/journal.ts
|
|
3709
3644
|
function templateUpgradeJournalPath(instanceId) {
|
|
3710
3645
|
if (!/^[a-f0-9]{24}$/u.test(instanceId)) throw new Error("Invalid template instance recovery identity.");
|
|
3711
3646
|
return `.repoctl/template-upgrades/${instanceId}.json`;
|
|
@@ -3791,8 +3726,7 @@ async function removeTemplateUpgradeJournal(cwd, journal) {
|
|
|
3791
3726
|
if (current.token !== journal.token || current.digest !== journal.digest) throw new Error("The template recovery record was replaced; preserve it for its owning operation.");
|
|
3792
3727
|
await fs.unlink(await safeInstancePath(cwd, templateUpgradeJournalPath(journal.instanceId)));
|
|
3793
3728
|
}
|
|
3794
|
-
|
|
3795
|
-
//#region src/commands/template-instances/upgrade/plan.ts
|
|
3729
|
+
// src/commands/template-instances/upgrade/plan.ts
|
|
3796
3730
|
function nextInstance(previous, draft, excludedPaths) {
|
|
3797
3731
|
return {
|
|
3798
3732
|
...previous,
|
|
@@ -3884,8 +3818,7 @@ async function prepareTemplateUpgrade(input) {
|
|
|
3884
3818
|
async function planTemplateUpgrade(options) {
|
|
3885
3819
|
return (await prepareTemplateUpgrade(options)).plan;
|
|
3886
3820
|
}
|
|
3887
|
-
|
|
3888
|
-
//#region src/commands/template-instances/upgrade/transaction/files.ts
|
|
3821
|
+
// src/commands/template-instances/upgrade/transaction/files.ts
|
|
3889
3822
|
const temporaryPath = (operation, token) => `${operation.path}.repoctl-template-${token}.tmp`;
|
|
3890
3823
|
async function removeTemporary(root, operation, token) {
|
|
3891
3824
|
const relative = temporaryPath(operation, token);
|
|
@@ -3939,8 +3872,7 @@ async function restoreUpgradeOperations(root, operations, token) {
|
|
|
3939
3872
|
}
|
|
3940
3873
|
if (failures.length) throw new Error(`Template file recovery is incomplete; preserve concurrent changes and the recovery record. Inspect: ${failures.join(", ")}`);
|
|
3941
3874
|
}
|
|
3942
|
-
|
|
3943
|
-
//#region src/commands/template-instances/upgrade/apply.ts
|
|
3875
|
+
// src/commands/template-instances/upgrade/apply.ts
|
|
3944
3876
|
async function applyTemplateUpgradePlan(plan) {
|
|
3945
3877
|
const { fingerprint, ...content } = plan;
|
|
3946
3878
|
const current = await prepareTemplateUpgrade(plan.options);
|
|
@@ -3992,8 +3924,7 @@ async function applyTemplateUpgradePlan(plan) {
|
|
|
3992
3924
|
].includes(item.status)).map((item) => item.path)
|
|
3993
3925
|
};
|
|
3994
3926
|
}
|
|
3995
|
-
|
|
3996
|
-
//#region src/commands/template-instances/upgrade/recover.ts
|
|
3927
|
+
// src/commands/template-instances/upgrade/recover.ts
|
|
3997
3928
|
/** Inspect or restore one interrupted operation, retaining every concurrent business edit. */
|
|
3998
3929
|
async function recoverTemplateUpgrade(cwd, selector, apply = false) {
|
|
3999
3930
|
cwd = await fs.realpath(path.resolve(cwd));
|
|
@@ -4049,22 +3980,18 @@ async function recoverTemplateUpgrade(cwd, selector, apply = false) {
|
|
|
4049
3980
|
files: await inspect()
|
|
4050
3981
|
};
|
|
4051
3982
|
}
|
|
4052
|
-
|
|
4053
|
-
//#region src/commands/template-instances/index.ts
|
|
3983
|
+
// src/commands/template-instances/index.ts
|
|
4054
3984
|
var template_instances_exports = /* @__PURE__ */ __exportAll({
|
|
4055
3985
|
applyTemplateLinkPlan: () => applyTemplateLinkPlan,
|
|
4056
3986
|
applyTemplateUpgradePlan: () => applyTemplateUpgradePlan,
|
|
4057
3987
|
listTemplateInstances: () => listTemplateInstances,
|
|
4058
|
-
loadTemplateBaseline: () => loadTemplateBaseline$1,
|
|
4059
|
-
loadTemplateInstanceRegistry: () => loadTemplateInstanceRegistry$1,
|
|
4060
3988
|
planTemplateLink: () => planTemplateLink,
|
|
4061
3989
|
planTemplateUpgrade: () => planTemplateUpgrade,
|
|
4062
3990
|
rebuildTemplateInstanceBaseline: () => rebuildTemplateInstanceBaseline,
|
|
4063
3991
|
recoverTemplateUpgrade: () => recoverTemplateUpgrade,
|
|
4064
3992
|
relocateTemplateInstance: () => relocateTemplateInstance
|
|
4065
3993
|
});
|
|
4066
|
-
|
|
4067
|
-
//#region src/core/codeowners/block.ts
|
|
3994
|
+
// src/core/codeowners/block.ts
|
|
4068
3995
|
const beginMarker = "# BEGIN repoctl workspace owners";
|
|
4069
3996
|
const endMarker = "# END repoctl workspace owners";
|
|
4070
3997
|
function mayOverlap(pattern, directory) {
|
|
@@ -4130,8 +4057,7 @@ function ownersDiff(file, before, after) {
|
|
|
4130
4057
|
...after.split("\n").map((line) => `+${line}`)
|
|
4131
4058
|
].join("\n");
|
|
4132
4059
|
}
|
|
4133
|
-
|
|
4134
|
-
//#region src/core/codeowners/files.ts
|
|
4060
|
+
// src/core/codeowners/files.ts
|
|
4135
4061
|
const codeownersPaths = [
|
|
4136
4062
|
".github/CODEOWNERS",
|
|
4137
4063
|
"CODEOWNERS",
|
|
@@ -4186,8 +4112,7 @@ async function replaceOwnersFile(workspaceDir, file, before, after) {
|
|
|
4186
4112
|
await rm(temp, { force: true });
|
|
4187
4113
|
}
|
|
4188
4114
|
}
|
|
4189
|
-
|
|
4190
|
-
//#region src/core/codeowners/ownership.ts
|
|
4115
|
+
// src/core/codeowners/ownership.ts
|
|
4191
4116
|
const ownerPattern = /^(?:@[a-z\d](?:[a-z\d-]*[a-z\d])?(?:\/[a-z\d](?:[\w-]*[a-z\d])?)?|[^\s@#]+@[^\s#@][^\s#.@]*\.[^\s#@]+)$/iu;
|
|
4192
4117
|
async function inspectWorkspaceOwners(options) {
|
|
4193
4118
|
clearWorkspaceCache();
|
|
@@ -4277,8 +4202,7 @@ async function inspectWorkspaceOwners(options) {
|
|
|
4277
4202
|
if (options.query) report.packages = report.packages.filter((pkg) => pkg.name === options.query || pkg.path === options.query);
|
|
4278
4203
|
return report;
|
|
4279
4204
|
}
|
|
4280
|
-
|
|
4281
|
-
//#region src/core/codeowners/index.ts
|
|
4205
|
+
// src/core/codeowners/index.ts
|
|
4282
4206
|
/** Read-only preview; the output file must be explicitly selected. */
|
|
4283
4207
|
async function planCodeowners(options) {
|
|
4284
4208
|
const report = await inspectWorkspaceOwners(options);
|
|
@@ -4336,8 +4260,7 @@ async function applyCodeownersPlan(plan) {
|
|
|
4336
4260
|
file: fresh.file
|
|
4337
4261
|
};
|
|
4338
4262
|
}
|
|
4339
|
-
|
|
4340
|
-
//#region src/core/workspace-tasks/location.ts
|
|
4263
|
+
// src/core/workspace-tasks/location.ts
|
|
4341
4264
|
/** Absolute directory queries never fall through to package-name fuzzy search. */
|
|
4342
4265
|
async function locationCandidates(packages, query) {
|
|
4343
4266
|
const normalizedPath = path.normalize(query);
|
|
@@ -4366,8 +4289,7 @@ async function locationCandidates(packages, query) {
|
|
|
4366
4289
|
pkg.description
|
|
4367
4290
|
].some((value) => value?.toLowerCase().includes(lower)));
|
|
4368
4291
|
}
|
|
4369
|
-
|
|
4370
|
-
//#region src/core/workspace-tasks/index.ts
|
|
4292
|
+
// src/core/workspace-tasks/index.ts
|
|
4371
4293
|
function order(left, right) {
|
|
4372
4294
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
4373
4295
|
}
|
|
@@ -4440,5 +4362,4 @@ async function locateWorkspace(cwd, query) {
|
|
|
4440
4362
|
candidates
|
|
4441
4363
|
};
|
|
4442
4364
|
}
|
|
4443
|
-
//#endregion
|
|
4444
4365
|
export { WorkspaceGraphQueryError as $, referenceTarget as A, exists$1 as At, saveKnipBaseline as B, writeJSON as Bt, loadCompiler as C, message as Ct, ownershipFile as D, copy as Dt, exists as E, supportedLocales as Et, env_cache_exports as F, outputJson as Ft, cache_exports as G, getWorkspacePackages as Gt, signalExitCode as H, clearWorkspaceCache as Ht, getKnipConfigurationSuggestions as I, pathExists as It, getWorkspaceGraph as J, GitClient as Jt, mergeText as K, workspace_exports as Kt, knip_exports as L, readJSON as Lt, formatEnvironmentCache as M, isIgnorableFsError as Mt, format_exports as N, outputFile as Nt, readText as O, ensureDir as Ot, checkEnvironmentCache as P, outputJSON as Pt, whyWorkspaceDependency as Q, planKnipCheck as R, readJson as Rt, configReader as S, localize as St, compare$1 as T, resolveRepoctlLocale as Tt, stopCheckProcessTree as U, getWorkspaceData as Ut, executeCheckTask as V, writeJson as Vt, analyzeTurboRuns as W, getWorkspacePackageSummaries as Wt, filterWorkspaceGraph as X, parseDependencyReference as Y, getWorkspaceImpact as Z, planTemplateLink as _, assetsDir$1 as _t, inspectWorkspaceOwners as a, record$2 as at, planGenerate as b, rootDir as bt, loadTemplateInstanceRegistry$1 as c, renderCreateNewProject as ct, template_instances_exports as d, migrateLegacyToolingReferences as dt, compareGraphValues as et, recoverTemplateUpgrade as f, setByPath as ft, applyTemplateLinkPlan as g, validateCleanTargets as gt, loadTemplateUpgradeJournal as h, isWithin as ht, planCodeowners as i, readInput as it, relativeFile as j, fs$2 as jt, referencePath as k, ensureFile as kt, rebuildTemplateInstanceBaseline as l, rewriteTemplateSnapshotReferences as lt, planTemplateUpgrade as m, assertSafePath as mt, locateWorkspace as n, workspaceDependencyTypes as nt, listTemplateInstances as o, safeFile as ot, applyTemplateUpgradePlan as p, stageFileTransaction as pt, withOperationLock as q, findWorkspacePackages as qt, applyCodeownersPlan as r, hash as rt, loadTemplateBaseline$1 as s, updateManifest as st, getWorkspaceTaskCatalog as t, resolveWorkspaceGraphNode as tt, relocateTemplateInstance as u, hasLegacyToolingReference as ut, generate_exports as v, cliName as vt, validateGraph as w, repoctlLocale as wt, generators as x, templatesDir as xt, applyGeneratePlan as y, packageDir$1 as yt, runKnipCheck as z, remove as zt };
|