@icebreakers/monorepo 6.4.4 → 6.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/{baseline-CDK5S6ZW.mjs → baseline-CQVDciG4.mjs} +1 -1
  2. package/dist/{catalog-DGNEXpLv.mjs → catalog-6_tT0U3p.mjs} +4 -4
  3. package/dist/cli.mjs +63 -63
  4. package/dist/{commands-Dmb6rHT4.mjs → commands-CeEzfoW8.mjs} +141 -261
  5. package/dist/{config-CS8bKmur.mjs → config-CT_nsp4o.mjs} +3 -3
  6. package/dist/{create-flow-D2qerhKE.mjs → create-flow-Dw27OLYT.mjs} +3 -3
  7. package/dist/{deps-DYRGuzg7.mjs → deps-CIrWBABk.mjs} +4 -4
  8. package/dist/{execute-BZEh5hv0.mjs → execute-Y_6G_tEl.mjs} +2 -2
  9. package/dist/{execute-Kt3jCIFG.mjs → execute-e7SGX_Y0.mjs} +2 -2
  10. package/dist/{format-BzyiA7aM.mjs → format-jsSjadNe.mjs} +1 -1
  11. package/dist/{index-CyUOTGW4.d.mts → index-C7KR7hT8.d.mts} +1 -1
  12. package/dist/index.d.mts +20 -21
  13. package/dist/index.mjs +10 -10
  14. package/dist/{inputs-mUJQYN3g.mjs → inputs-DOUYGoHq.mjs} +1 -1
  15. package/dist/{npm-EfMYAoVh.mjs → npm-tUIGIuFQ.mjs} +1 -1
  16. package/dist/{plan-DGfos4Wg.mjs → plan-DC33-_or.mjs} +2 -1
  17. package/dist/{run-BBN7BB2_.mjs → run-DT6Q-jbq.mjs} +4 -4
  18. package/dist/{save-7etYAM7X.mjs → save-Foea-Ao9.mjs} +3 -3
  19. package/dist/{scan-BxDY-M_i.mjs → scan-DA7VmNjC.mjs} +2 -2
  20. package/dist/{template-drift-D7X1YsG7.mjs → template-drift-B18bgxT6.mjs} +3 -4
  21. package/dist/tooling-entry.d.mts +1 -1
  22. package/dist/tooling-entry.mjs +2 -2
  23. package/dist/{transaction-tscI6vJX.mjs → transaction-B4vPaBcK.mjs} +2 -2
  24. package/dist/{tsconfig-BGyabp3n.mjs → tsconfig-DpOi_7HA.mjs} +46 -152
  25. package/dist/{vitest-DjBZRWbO.mjs → vitest-Dh5Qm_3L.mjs} +1 -1
  26. package/dist/{workspace-tasks-nNbJAF4u.mjs → workspace-tasks-Ca1zWNKr.mjs} +14 -36
  27. package/package.json +18 -14
  28. package/dist/rolldown-runtime-BJohB4LM.mjs +0 -13
@@ -1,12 +1,11 @@
1
- import { t as __exportAll } from "./rolldown-runtime-BJohB4LM.mjs";
2
- import { A as referenceTarget, B as saveKnipBaseline, C as loadCompiler, D as ownershipFile, E as exists$1, Gt as getWorkspacePackages, Ht as clearWorkspaceCache, I as getKnipConfigurationSuggestions, J as getWorkspaceGraph, Jt as GitClient, K as mergeText, M as formatEnvironmentCache, O as readText, P as checkEnvironmentCache, R as planKnipCheck, S as configReader, St as localize, T as compare$1, Tt as resolveRepoctlLocale, Ut as getWorkspaceData, W as analyzeTurboRuns, Wt as getWorkspacePackageSummaries, Z as getWorkspaceImpact, _ as planTemplateLink, _t as assetsDir$1, at as record$6, b as planGenerate, c as loadTemplateInstanceRegistry$1, ct as renderCreateNewProject, dt as migrateLegacyToolingReferences, et as compareGraphValues, f as recoverTemplateUpgrade, ft as setByPath, g as applyTemplateLinkPlan, gt as validateCleanTargets, h as loadTemplateUpgradeJournal, ht as isWithin, it as readInput, j as relativeFile, jt as fs$2, k as referencePath, l as rebuildTemplateInstanceBaseline, lt as rewriteTemplateSnapshotReferences, m as planTemplateUpgrade, mt as assertSafePath, nt as workspaceDependencyTypes, o as listTemplateInstances, ot as safeFile, p as applyTemplateUpgradePlan, pt as stageFileTransaction, q as withOperationLock, qt as findWorkspacePackages, rt as hash$1, s as loadTemplateBaseline$1, tt as resolveWorkspaceGraphNode, u as relocateTemplateInstance, w as validateGraph, x as generators, xt as templatesDir, y as applyGeneratePlan, yt as packageDir$1, z as runKnipCheck } from "./workspace-tasks-nNbJAF4u.mjs";
3
- import { a as resolveFullWorkspaceCheckPlan, c as verifyCommitMsg, d as logger, i as getKnownRepoCheckCommands, l as verifyPreCommit, n as resolveAffectedCheckContext, o as resolveRecommendedCheckPlan, r as resolveAffectedCheckPlan, s as runRecommendedCheck, t as runCheckWithReport, u as runPnpmCommand } from "./execute-BZEh5hv0.mjs";
4
- import { $ as commandConfigDirectory, A as package_default$1, B as templateSourcePath, C as checkedFile, D as relativeFile$1, E as readOptionalSource, G as presetPackageName, H as isUpgradeExpiry, I as normalizeTemplateRemoteSource, K as presetVersion, L as normalizeTemplateSourceRequest, N as ConfigValidationError, O as engines$1, S as canonicalDirectory, T as readOptional$1, U as defaultNightlyQualityTimeoutMs, W as resolveNightlyConfig, Y as isRecord$2, Z as appendConfigPath, _ as listToolingCapabilities, b as presetRelativePath, d as loadMonorepoConfig, f as loadMonorepoConfigDetails, g as presetAssetTarget, j as version$2, n as defineTsconfigConfig, p as resolveCommandConfig, q as withLegacyHookConfig, u as getRepoctlConfigCandidates, v as installedPresetDirectory, w as hash$2, x as readPresetFile, y as parsePresetJson, z as sourceRequestKey } from "./tsconfig-BGyabp3n.mjs";
5
- import { c as selectCommandOverrides, i as rangesOverlap, l as chinaMirrorsEnvs, o as matchGroup, r as parseSpecifier, s as resolveCommandValues, t as scanDependencies } from "./scan-BxDY-M_i.mjs";
6
- import { A as isRootAsset, B as toWorkspaceAssetPath, C as lockfileRecord, D as baselineDirectory, E as checkDependencyAdmission, F as getWorkspacePatterns, I as summarizeChecks, L as legacyStagedConfigNames, M as templatePackage, N as getAssetTargets, O as baselinePath, P as record$7, S as inspectPnpmRuntime, a as applyDoctorSuppressions, b as resolveReleaseBranches, c as collectSelectedDoctorChecks, d as recommendedRepoScripts, f as inspectInstallSecurity, g as isLegacyReleaseWorkflow, h as supportedVersion, i as hasTemplateDriftIssues, j as parseBaseline, k as encodeBaseline, l as getDoctorRuleIds, m as settingState, o as validateDoctorSuppressions, p as readSecuritySources, r as formatTemplateDriftReport, s as validateDoctorConfiguration, t as checkTemplateDrift, u as selectDoctorRules, v as renderReleaseWorkflow, w as parseWorkspaceLockfile, x as ReleaseCommandError, y as releasePullRequestHead } from "./template-drift-D7X1YsG7.mjs";
7
- import { t as writeDependencyTransaction } from "./transaction-tscI6vJX.mjs";
8
- import { i as applyDependencyFixPlan, r as planDependencyFix, t as checkDependencies } from "./deps-DYRGuzg7.mjs";
9
- import { i as applyCatalogMigrationPlan, n as checkCatalogs, r as planCatalogMigration } from "./catalog-DGNEXpLv.mjs";
1
+ import { A as packageDir$1, B as normalizeTemplateSourceRequest, C as checkedFile, D as relativeFile, E as readOptionalSource, G as isUpgradeExpiry, H as sourceRequestKey, I as ConfigValidationError, J as presetPackageName, K as defaultNightlyQualityTimeoutMs, M as rootDir, N as templatesDir, O as assetsDir$1, P as version$1, Q as isRecord$2, S as canonicalDirectory, T as readOptional$1, U as templateSourcePath, X as withLegacyHookConfig, Y as presetVersion, _ as listToolingCapabilities, b as presetRelativePath, d as loadMonorepoConfig, et as appendConfigPath, f as loadMonorepoConfigDetails, g as presetAssetTarget, n as defineTsconfigConfig, nt as commandConfigDirectory, p as resolveCommandConfig, q as resolveNightlyConfig, rt as __exportAll, u as getRepoctlConfigCandidates, v as installedPresetDirectory, w as hash$1, x as readPresetFile, y as parsePresetJson, z as normalizeTemplateRemoteSource } from "./tsconfig-DpOi_7HA.mjs";
2
+ import { A as referenceTarget, B as saveKnipBaseline, Bt as getWorkspacePackages, C as loadCompiler, D as ownershipFile, E as exists$1, Et as fs$2, Ht as findWorkspacePackages, I as getKnipConfigurationSuggestions, J as getWorkspaceGraph, K as mergeText, Lt as clearWorkspaceCache, M as formatEnvironmentCache, O as readText, P as checkEnvironmentCache, R as planKnipCheck, Rt as getWorkspaceData, S as configReader, T as compare$1, Ut as GitClient, W as analyzeTurboRuns, Z as getWorkspaceImpact, _ as planTemplateLink, _t as localize, at as record$6, b as planGenerate, bt as resolveRepoctlLocale, c as loadTemplateInstanceRegistry$1, ct as renderCreateNewProject, dt as migrateLegacyToolingReferences, et as compareGraphValues, f as recoverTemplateUpgrade, ft as setByPath, g as applyTemplateLinkPlan, gt as validateCleanTargets, h as loadTemplateUpgradeJournal, ht as isWithin, it as readInput, j as relativeFile$1, k as referencePath, l as rebuildTemplateInstanceBaseline, lt as rewriteTemplateSnapshotReferences, m as planTemplateUpgrade, mt as assertSafePath, nt as workspaceDependencyTypes, o as listTemplateInstances, ot as safeFile, p as applyTemplateUpgradePlan, pt as stageFileTransaction, q as withOperationLock, rt as hash$2, s as loadTemplateBaseline$1, tt as resolveWorkspaceGraphNode, u as relocateTemplateInstance, w as validateGraph, x as generators, y as applyGeneratePlan, z as runKnipCheck, zt as getWorkspacePackageSummaries } from "./workspace-tasks-Ca1zWNKr.mjs";
3
+ import { a as resolveFullWorkspaceCheckPlan, c as verifyCommitMsg, d as logger, i as getKnownRepoCheckCommands, l as verifyPreCommit, n as resolveAffectedCheckContext, o as resolveRecommendedCheckPlan, r as resolveAffectedCheckPlan, s as runRecommendedCheck, t as runCheckWithReport, u as runPnpmCommand } from "./execute-Y_6G_tEl.mjs";
4
+ import { c as selectCommandOverrides, i as rangesOverlap, l as chinaMirrorsEnvs, o as matchGroup, r as parseSpecifier, s as resolveCommandValues, t as scanDependencies } from "./scan-DA7VmNjC.mjs";
5
+ import { A as isRootAsset, B as toWorkspaceAssetPath, C as lockfileRecord, D as baselineDirectory, E as checkDependencyAdmission, F as getWorkspacePatterns, I as summarizeChecks, L as legacyStagedConfigNames, M as templatePackage, N as getAssetTargets, O as baselinePath, P as record$7, S as inspectPnpmRuntime, a as applyDoctorSuppressions, b as resolveReleaseBranches, c as collectSelectedDoctorChecks, d as recommendedRepoScripts, f as inspectInstallSecurity, g as isLegacyReleaseWorkflow, h as supportedVersion, i as hasTemplateDriftIssues, j as parseBaseline, k as encodeBaseline, l as getDoctorRuleIds, m as settingState, o as validateDoctorSuppressions, p as readSecuritySources, r as formatTemplateDriftReport, s as validateDoctorConfiguration, t as checkTemplateDrift, u as selectDoctorRules, v as renderReleaseWorkflow, w as parseWorkspaceLockfile, x as ReleaseCommandError, y as releasePullRequestHead } from "./template-drift-B18bgxT6.mjs";
6
+ import { t as writeDependencyTransaction } from "./transaction-B4vPaBcK.mjs";
7
+ import { i as applyDependencyFixPlan, r as planDependencyFix, t as checkDependencies } from "./deps-CIrWBABk.mjs";
8
+ import { i as applyCatalogMigrationPlan, n as checkCatalogs, r as planCatalogMigration } from "./catalog-6_tT0U3p.mjs";
10
9
  import { createRequire, isBuiltin } from "node:module";
11
10
  import { findWorkspaceDir } from "@pnpm/find-workspace-dir";
12
11
  import { readWorkspaceManifest } from "@pnpm/workspace.read-manifest";
@@ -14,7 +13,7 @@ import path, { normalize } from "pathe";
14
13
  import process from "node:process";
15
14
  import { access, appendFile, copyFile, link, lstat, mkdir, mkdtemp, open, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, symlink, unlink, utimes, writeFile } from "node:fs/promises";
16
15
  import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
17
- import fs$1, { constants, createReadStream, existsSync } from "node:fs";
16
+ import fs$1, { constants, createReadStream, existsSync, readFileSync } from "node:fs";
18
17
  import semver, { coerce, compare, gt, gte, intersects, lte, maxSatisfying, minVersion, parse, prerelease, satisfies, subset, valid, validRange } from "semver";
19
18
  import validatePackageName from "validate-npm-package-name";
20
19
  import { createHash, randomUUID } from "node:crypto";
@@ -276,7 +275,11 @@ function findRepositoryRoot(startDir) {
276
275
  current = next;
277
276
  }
278
277
  }
279
- function resolveTypecheckWorkspaceDir(filePath, workspaceRoot) {
278
+ function resolveTypecheckWorkspaceDir(filePath, workspaceRoot, workspaceDirs) {
279
+ if (workspaceDirs) {
280
+ const absoluteFile = path$1.resolve(filePath);
281
+ return workspaceDirs.filter((dir) => absoluteFile === dir || absoluteFile.startsWith(`${dir}${path$1.sep}`)).sort((left, right) => right.length - left.length).find(hasTypecheckScript) ?? workspaceRoot;
282
+ }
280
283
  let current = path$1.dirname(path$1.resolve(workspaceRoot, filePath));
281
284
  while (current === workspaceRoot || current.startsWith(`${workspaceRoot}${path$1.sep}`)) {
282
285
  if (hasTypecheckScript(current)) return current;
@@ -294,15 +297,17 @@ function resolveTypecheckWorkspaceDir(filePath, workspaceRoot) {
294
297
  * @param stagedFiles 相对于 cwd 的暂存区文件路径列表;省略时从 Git 根目录读取暂存区
295
298
  * @param options 运行参数
296
299
  */
297
- function verifyStagedTypecheck(stagedFiles, options = {}) {
300
+ async function verifyStagedTypecheck(stagedFiles, options = {}) {
298
301
  const cwd = path$1.resolve(options.cwd ?? process.cwd());
299
302
  const workspaceRoot = findRepositoryRoot(cwd);
300
303
  const spawn = options.spawn ?? spawnSync;
304
+ const workspaceManifest = await readWorkspaceManifest(workspaceRoot);
305
+ const workspacePackageDirs = workspaceManifest?.packages ? (await findWorkspacePackages(workspaceRoot, { patterns: workspaceManifest.packages })).map((pkg) => path$1.resolve(pkg.rootDir)) : void 0;
301
306
  const files = stagedFiles === void 0 ? readStagedFiles(workspaceRoot).map((file) => path$1.resolve(workspaceRoot, file)) : stagedFiles.map((file) => path$1.resolve(cwd, file));
302
307
  const workspaceDirs = [...new Set(files.filter((file) => {
303
308
  const basename = path$1.basename(file);
304
309
  return typecheckExtensions.has(path$1.extname(file)) || typecheckBasenames.has(basename);
305
- }).map((file) => resolveTypecheckWorkspaceDir(file, workspaceRoot)))];
310
+ }).map((file) => resolveTypecheckWorkspaceDir(file, workspaceRoot, workspacePackageDirs)))];
306
311
  if (workspaceDirs.length === 0) return;
307
312
  for (const workspaceDir of workspaceDirs) {
308
313
  const label = path$1.relative(cwd, workspaceDir) || ".";
@@ -588,7 +593,7 @@ async function verifyOwnedFile(root, file) {
588
593
  if (!file.owned || !file.identity) throw new Error(`Unowned upgrade recovery file: ${file.path}`);
589
594
  const target = await checkedFile(root, path.relative(root, file.path), file.identity);
590
595
  const info = await lstat(target, { bigint: true });
591
- if (info.ino !== file.identity.ino || info.dev !== file.identity.dev || hash$2(await readFile(target)) !== file.hash) throw new Error(`Upgrade recovery file changed: ${file.path}`);
596
+ if (info.ino !== file.identity.ino || info.dev !== file.identity.dev || hash$1(await readFile(target)) !== file.hash) throw new Error(`Upgrade recovery file changed: ${file.path}`);
592
597
  }
593
598
  async function removeOwnedFile(root, file) {
594
599
  if (file.owned) {
@@ -604,7 +609,7 @@ async function rollback(root, staged) {
604
609
  try {
605
610
  if (item.applied) {
606
611
  const current = await readOptional$1(root, item.file.path, item.appliedIdentity);
607
- if ((current === null ? null : hash$2(current)) !== item.file.afterHash) throw new Error("Concurrent edit must be retained");
612
+ if ((current === null ? null : hash$1(current)) !== item.file.afterHash) throw new Error("Concurrent edit must be retained");
608
613
  if (current !== null && item.appliedIdentity) {
609
614
  const info = await lstat(item.target, { bigint: true });
610
615
  if (info.ino !== item.appliedIdentity.ino || info.dev !== item.appliedIdentity.dev) throw new Error("Concurrent replacement must be retained");
@@ -641,7 +646,7 @@ async function writeFileTransaction(root, files, options = {}) {
641
646
  for (const file of files) {
642
647
  const target = await checkedFile(root, file.path);
643
648
  const original = await readOptional$1(root, file.path);
644
- if ((original === null ? null : hash$2(original)) !== file.beforeHash) throw new Error(`Upgrade conflict: ${file.path}`);
649
+ if ((original === null ? null : hash$1(original)) !== file.beforeHash) throw new Error(`Upgrade conflict: ${file.path}`);
645
650
  await ensureParent(path.dirname(target), directories);
646
651
  const item = {
647
652
  file,
@@ -669,7 +674,7 @@ async function writeFileTransaction(root, files, options = {}) {
669
674
  for (const item of staged) {
670
675
  await options.verify?.();
671
676
  const current = await readOptional$1(root, item.file.path);
672
- if ((current === null ? null : hash$2(current)) !== item.file.beforeHash) throw new Error(`Concurrent upgrade edit: ${item.file.path}`);
677
+ if ((current === null ? null : hash$1(current)) !== item.file.beforeHash) throw new Error(`Concurrent upgrade edit: ${item.file.path}`);
673
678
  if (item.file.content === null) {
674
679
  await rm(item.target);
675
680
  item.applied = true;
@@ -690,7 +695,7 @@ async function writeFileTransaction(root, files, options = {}) {
690
695
  }
691
696
  for (const item of staged) {
692
697
  const current = await readOptional$1(root, item.file.path, item.appliedIdentity);
693
- if ((current === null ? null : hash$2(current)) !== item.file.afterHash) throw new Error(`Concurrent edit after transaction write: ${item.file.path}`);
698
+ if ((current === null ? null : hash$1(current)) !== item.file.afterHash) throw new Error(`Concurrent edit after transaction write: ${item.file.path}`);
694
699
  if (current !== null && item.appliedIdentity) {
695
700
  const info = await lstat(item.target, { bigint: true });
696
701
  if (info.ino !== item.appliedIdentity.ino || info.dev !== item.appliedIdentity.dev) throw new Error(`Concurrent replacement after transaction write: ${item.file.path}`);
@@ -859,7 +864,7 @@ async function stageParameterizedProject(plan, prepared, target, gitMetadata) {
859
864
  sensitiveParameters: prepared.parameters.sensitive
860
865
  },
861
866
  excludedPaths,
862
- generatorVersion: version$2
867
+ generatorVersion: version$1
863
868
  })
864
869
  };
865
870
  } finally {
@@ -884,13 +889,13 @@ async function applyParameterizedProject(plan, gitMetadata) {
884
889
  const updates = staged.snapshot.files.map((file) => ({
885
890
  path: `${target}/${file.path}`,
886
891
  beforeHash: null,
887
- afterHash: hash$2(Buffer.from(file.content, "base64")),
892
+ afterHash: hash$1(Buffer.from(file.content, "base64")),
888
893
  content: file.content
889
894
  }));
890
895
  if ((workspace.before?.toString("base64") ?? null) !== (workspace.after?.toString("base64") ?? null)) updates.push({
891
896
  path: "pnpm-workspace.yaml",
892
- beforeHash: workspace.before ? hash$2(workspace.before) : null,
893
- afterHash: workspace.after ? hash$2(workspace.after) : null,
897
+ beforeHash: workspace.before ? hash$1(workspace.before) : null,
898
+ afterHash: workspace.after ? hash$1(workspace.after) : null,
894
899
  content: workspace.after?.toString("base64") ?? null
895
900
  });
896
901
  const directories = [];
@@ -918,7 +923,7 @@ async function applyParameterizedProject(plan, gitMetadata) {
918
923
  const reversed = [];
919
924
  for (const update of [...updates].reverse()) {
920
925
  const current = await readOptional$1(root, update.path);
921
- const currentHash = current ? hash$2(current) : null;
926
+ const currentHash = current ? hash$1(current) : null;
922
927
  if (currentHash === update.beforeHash) continue;
923
928
  if (currentHash !== update.afterHash) throw new Error(`Concurrent edit retained; review creation recovery at ${target}`);
924
929
  await verifyFile(update.path);
@@ -1516,7 +1521,7 @@ async function downloadGitTemplate(source, directory, timeout) {
1516
1521
  async function resolveRemoteTemplateSource(source, templatePath = ".", options = {}) {
1517
1522
  const request = normalizeTemplateSourceRequest(source, templatePath);
1518
1523
  const cwd = path$1.resolve(options.cwd ?? process.cwd());
1519
- const npm = request.source.kind === "npm" ? await import("./npm-EfMYAoVh.mjs") : void 0;
1524
+ const npm = request.source.kind === "npm" ? await import("./npm-tUIGIuFQ.mjs") : void 0;
1520
1525
  const configuration = request.source.kind === "npm" ? await npm.npmTemplateConfiguration(request.source, cwd) : void 0;
1521
1526
  if (request.source.kind === "npm") request.source.registry = configuration.registry;
1522
1527
  const cacheDir = path$1.resolve(cwd, options.cacheDir ?? path$1.join(process.env["XDG_CACHE_HOME"] ?? path$1.join(homedir(), ".cache"), "repoctl", "template-sources-v1"));
@@ -1727,7 +1732,7 @@ async function applyCreateNewProjectPlan(plan, includeGitMetadata = true) {
1727
1732
  packageName: plan.packageName,
1728
1733
  renameJson: plan.renameJson
1729
1734
  },
1730
- generatorVersion: version$2
1735
+ generatorVersion: version$1
1731
1736
  });
1732
1737
  } catch (error) {
1733
1738
  throw new Error(`Generated project remains at ${plan.targetDir}, but provenance registration failed. Registry recovery path: ${path.join(plan.cwd, ".repoctl/template-instances.json")}. Inspect the error and use repo templates link ${target} --template ${plan.template} to recover an explicit association.`, { cause: error });
@@ -1921,7 +1926,7 @@ function validateBaselineChange(file, plan) {
1921
1926
  return;
1922
1927
  }
1923
1928
  const content = Buffer.from(change.content, "base64");
1924
- if (content.toString("base64") !== change.content || hash$2(content) !== change.afterHash || file.afterHash === null) throw new Error(`Invalid baseline content: ${file.path}`);
1929
+ if (content.toString("base64") !== change.content || hash$1(content) !== change.afterHash || file.afterHash === null) throw new Error(`Invalid baseline content: ${file.path}`);
1925
1930
  const record = parseBaseline(content, change.path);
1926
1931
  if (!plan.inputs.some((input) => input.area === "asset" && input.path === record.source.assetPath && input.hash === record.source.hash)) throw new Error(`Missing baseline source precondition: ${file.path}`);
1927
1932
  }
@@ -2147,25 +2152,25 @@ const emptyLedger = () => ({
2147
2152
  attempt: null
2148
2153
  });
2149
2154
  const encodeLedger = (ledger) => Buffer.from(`${JSON.stringify(ledger, null, 2)}\n`);
2150
- const version$1 = (value) => typeof value === "string" && valid(value) === value;
2155
+ const version = (value) => typeof value === "string" && valid(value) === value;
2151
2156
  function parseLedger$1(content) {
2152
2157
  if (content === null) return emptyLedger();
2153
2158
  const ledger = JSON.parse(content.toString());
2154
- if (!ledger || ledger.schemaVersion !== 1 || ledger.evaluatedVersion !== null && !version$1(ledger.evaluatedVersion) || !ledger.entries || typeof ledger.entries !== "object" || Array.isArray(ledger.entries)) throw new Error("Invalid migration ledger.");
2155
- for (const [id, entry] of Object.entries(ledger.entries)) if (!/^[a-z][a-z\d-]*$/.test(id) || !entry || !version$1(entry.version) || !version$1(entry.toVersion) || gt(entry.version, entry.toVersion) || entry.fromVersion !== null && (!version$1(entry.fromVersion) || gt(entry.fromVersion, entry.toVersion)) || ![
2159
+ if (!ledger || ledger.schemaVersion !== 1 || ledger.evaluatedVersion !== null && !version(ledger.evaluatedVersion) || !ledger.entries || typeof ledger.entries !== "object" || Array.isArray(ledger.entries)) throw new Error("Invalid migration ledger.");
2160
+ for (const [id, entry] of Object.entries(ledger.entries)) if (!/^[a-z][a-z\d-]*$/.test(id) || !entry || !version(entry.version) || !version(entry.toVersion) || gt(entry.version, entry.toVersion) || entry.fromVersion !== null && (!version(entry.fromVersion) || gt(entry.fromVersion, entry.toVersion)) || ![
2156
2161
  "pending",
2157
2162
  "completed",
2158
2163
  "failed"
2159
2164
  ].includes(entry.status)) throw new Error(`Invalid migration record: ${id}`);
2160
2165
  if (ledger.attempt !== null) {
2161
2166
  const attempt = ledger.attempt;
2162
- if (!attempt || !/^[\da-f]{64}$/.test(attempt.id) || !Array.isArray(attempt.files) || !Array.isArray(attempt.inputs) || !attempt.files.length || new Set(attempt.files.map((file) => file.path)).size !== attempt.files.length || !Object.values(ledger.entries).some((entry) => entry.status !== "completed") || hash$2(Buffer.from(JSON.stringify({
2167
+ if (!attempt || !/^[\da-f]{64}$/.test(attempt.id) || !Array.isArray(attempt.files) || !Array.isArray(attempt.inputs) || !attempt.files.length || new Set(attempt.files.map((file) => file.path)).size !== attempt.files.length || !Object.values(ledger.entries).some((entry) => entry.status !== "completed") || hash$1(Buffer.from(JSON.stringify({
2163
2168
  files: attempt.files,
2164
2169
  inputs: attempt.inputs,
2165
2170
  discovery: attempt.discovery
2166
2171
  }))) !== attempt.id) throw new Error("Invalid migration recovery journal.");
2167
2172
  for (const file of attempt.files) {
2168
- relativeFile$1(file.path);
2173
+ relativeFile(file.path);
2169
2174
  if (file.path === ".repoctl/migrations/ledger.json" || file.group !== "legacy-versioning") throw new Error(`Invalid migration recovery path: ${file.path}`);
2170
2175
  }
2171
2176
  } else if (Object.values(ledger.entries).some((entry) => entry.status !== "completed")) throw new Error("Pending or failed migration has no recovery journal.");
@@ -2177,7 +2182,7 @@ function ledgerOperation(beforeHash, content) {
2177
2182
  return {
2178
2183
  path: ledgerPath,
2179
2184
  beforeHash,
2180
- afterHash: hash$2(Buffer.from(content, "base64")),
2185
+ afterHash: hash$1(Buffer.from(content, "base64")),
2181
2186
  content,
2182
2187
  status: beforeHash === null ? "add" : "modify",
2183
2188
  reason: "migration-attempt-state",
@@ -2209,7 +2214,7 @@ async function applyMigrationFiles(plan, files) {
2209
2214
  await writeUpgradeTransaction(plan.rootDir, operations, attempt.id);
2210
2215
  } catch (error) {
2211
2216
  const current = await readOptional$1(plan.rootDir, ledgerPath);
2212
- if (current !== null && hash$2(current) === pending.afterHash) try {
2217
+ if (current !== null && hash$1(current) === pending.afterHash) try {
2213
2218
  await writeUpgradeTransaction(plan.rootDir, [ledgerOperation(pending.afterHash, reviewed.failed)]);
2214
2219
  } catch (ledgerError) {
2215
2220
  throw new AggregateError([error, ledgerError], "Migration failed and its failure record could not be saved. Retain the pending journal and preview recovery.");
@@ -2229,7 +2234,7 @@ function validateUpgradePlanFiles(plan) {
2229
2234
  "config"
2230
2235
  ].includes(input.area) || typeof input.path !== "string" || !digest$2(input.hash) || input.area === "package" && input.path !== "package.json") throw new Error("Invalid upgrade input.");
2231
2236
  for (const file of plan.files) {
2232
- relativeFile$1(file.path);
2237
+ relativeFile(file.path);
2233
2238
  if (![
2234
2239
  "add",
2235
2240
  "modify",
@@ -2243,7 +2248,7 @@ function validateUpgradePlanFiles(plan) {
2243
2248
  validateBaselineChange(file, plan);
2244
2249
  if (writesAsset(file)) {
2245
2250
  if (file.beforeHash === file.afterHash) throw new Error(`Unchanged file cannot be an upgrade action: ${file.path}`);
2246
- if (file.status === "delete" ? file.afterHash !== null || file.content !== null || file.beforeHash === null : file.content === null || hash$2(Buffer.from(file.content, "base64")) !== file.afterHash || (file.status === "add" ? file.beforeHash !== null : file.beforeHash === null)) throw new Error(`Invalid upgrade content: ${file.path}`);
2251
+ if (file.status === "delete" ? file.afterHash !== null || file.content !== null || file.beforeHash === null : file.content === null || hash$1(Buffer.from(file.content, "base64")) !== file.afterHash || (file.status === "add" ? file.beforeHash !== null : file.beforeHash === null)) throw new Error(`Invalid upgrade content: ${file.path}`);
2247
2252
  }
2248
2253
  }
2249
2254
  }
@@ -2291,13 +2296,13 @@ function validateMigrationPlan(plan) {
2291
2296
  }
2292
2297
  for (const original of pending.attempt.files) {
2293
2298
  const planned = plan.files.find((file) => file.path === original.path);
2294
- if (!planned || planned.group !== "legacy-versioning" || planned.afterHash !== original.afterHash || planned.content !== null && hash$2(Buffer.from(planned.content, "base64")) !== original.afterHash) throw new Error(`Migration output changed since journal review: ${original.path}`);
2299
+ if (!planned || planned.group !== "legacy-versioning" || planned.afterHash !== original.afterHash || planned.content !== null && hash$1(Buffer.from(planned.content, "base64")) !== original.afterHash) throw new Error(`Migration output changed since journal review: ${original.path}`);
2295
2300
  }
2296
2301
  }
2297
2302
  // src/commands/upgrade/workspace/decisions.ts
2298
2303
  /** Override values are strings. Include presence so absence and YAML null differ. */
2299
2304
  function overrideFingerprint(values, selector) {
2300
- return hash$2(Buffer.from(JSON.stringify(Object.hasOwn(values, selector) ? {
2305
+ return hash$1(Buffer.from(JSON.stringify(Object.hasOwn(values, selector) ? {
2301
2306
  present: true,
2302
2307
  value: values[selector]
2303
2308
  } : { present: false })));
@@ -2365,7 +2370,7 @@ async function applyLocked$2(cwd, plan, options) {
2365
2370
  ...normalizeUpgradeInput(plan, original)
2366
2371
  };
2367
2372
  const current = await readUpgradeInput(plan, input);
2368
- const currentHash = current === null ? null : hash$2(current);
2373
+ const currentHash = current === null ? null : hash$1(current);
2369
2374
  const relative = input.area === "config" ? path.relative(plan.rootDir, input.path) : input.path;
2370
2375
  const file = ["target", "config"].includes(input.area) ? files.find((item) => item.path === relative) : void 0;
2371
2376
  if (currentHash === input.hash) {
@@ -2435,7 +2440,7 @@ async function planMigrationRecovery(context, attempt) {
2435
2440
  const states = /* @__PURE__ */ new Map();
2436
2441
  for (const input of attempt.inputs) {
2437
2442
  const current = await context.read(input.area, input.path);
2438
- const currentHash = current === null ? null : hash$2(current);
2443
+ const currentHash = current === null ? null : hash$1(current);
2439
2444
  const operation = input.area === "target" ? operations.find((file) => file.path === input.path) : void 0;
2440
2445
  if (operation && currentHash === operation.afterHash) states.set(input.path, "after");
2441
2446
  else if (currentHash === input.hash) {
@@ -2451,7 +2456,7 @@ async function planMigrationRecovery(context, attempt) {
2451
2456
  const filename = `${file.path}.repoctl-upgrade-${attempt.id}.${extension}`;
2452
2457
  const content = await context.read("target", filename);
2453
2458
  if (content === null) continue;
2454
- if (hash$2(content) !== expected) context.plan.blockers.push({
2459
+ if (hash$1(content) !== expected) context.plan.blockers.push({
2455
2460
  id: "migration-backup-conflict",
2456
2461
  path: filename,
2457
2462
  detail: "The retained recovery file does not match the reviewed journal. Preserve it for manual inspection."
@@ -2869,10 +2874,12 @@ async function planMigrations(context, registry = migrationRegistry) {
2869
2874
  plan.migrations.recovery = await planMigrationRecovery(context, ledger.attempt);
2870
2875
  if (plan.blockers.length) return;
2871
2876
  }
2872
- const files = plan.files.filter((file) => file.group === "legacy-versioning" && (actionable(file) || file.status === "identical"));
2877
+ const migrationGroupFiles = plan.files.filter((file) => file.group === migrationGroup);
2878
+ const files = migrationGroupFiles.filter((file) => actionable(file) || file.status === "identical");
2879
+ if (files.length > 0 && files.length === migrationGroupFiles.length) for (const file of files) file.automatic = true;
2873
2880
  const inputs = plan.inputs.filter((input) => !(input.area === "target" && input.path === ".repoctl/migrations/ledger.json"));
2874
2881
  const attempt = {
2875
- id: hash$2(Buffer.from(JSON.stringify({
2882
+ id: hash$1(Buffer.from(JSON.stringify({
2876
2883
  files,
2877
2884
  inputs,
2878
2885
  discovery: plan.discovery
@@ -2995,10 +3002,10 @@ function isAgentsMarkdownEquivalent(left, right) {
2995
3002
  }
2996
3003
  // src/core/presets/asset-plan/baseline.ts
2997
3004
  /** A separate provider record; never adopts or broadens repoctl's root baseline ownership. */
2998
- const presetBaselinePath = (target) => `.repoctl/baselines/presets/${hash$2(Buffer.from(target))}.json`;
3005
+ const presetBaselinePath = (target) => `.repoctl/baselines/presets/${hash$1(Buffer.from(target))}.json`;
2999
3006
  function parsePresetBaseline(content, filename) {
3000
3007
  const value = parsePresetJson(content, filename);
3001
- if (!value || value.schemaVersion !== 1 || typeof value.path !== "string" || presetAssetTarget(value.path) !== value.path || filename !== presetBaselinePath(value.path) || !value.source || !presetPackageName.accepts(value.source.packageName) || !presetVersion.accepts(value.source.version) || typeof value.source.path !== "string" || !presetRelativePath(value.source.path) || !value.upstream || typeof value.upstream.content !== "string" || Buffer.from(value.upstream.content, "base64").toString("base64") !== value.upstream.content || hash$2(Buffer.from(value.upstream.content, "base64")) !== value.upstream.hash) throw new Error(`Invalid organization preset asset baseline: ${filename}`);
3008
+ if (!value || value.schemaVersion !== 1 || typeof value.path !== "string" || presetAssetTarget(value.path) !== value.path || filename !== presetBaselinePath(value.path) || !value.source || !presetPackageName.accepts(value.source.packageName) || !presetVersion.accepts(value.source.version) || typeof value.source.path !== "string" || !presetRelativePath(value.source.path) || !value.upstream || typeof value.upstream.content !== "string" || Buffer.from(value.upstream.content, "base64").toString("base64") !== value.upstream.content || hash$1(Buffer.from(value.upstream.content, "base64")) !== value.upstream.hash) throw new Error(`Invalid organization preset asset baseline: ${filename}`);
3002
3009
  return value;
3003
3010
  }
3004
3011
  function encodePresetBaseline(asset, source, content) {
@@ -3011,7 +3018,7 @@ function encodePresetBaseline(asset, source, content) {
3011
3018
  path: asset.source
3012
3019
  },
3013
3020
  upstream: {
3014
- hash: hash$2(content),
3021
+ hash: hash$1(content),
3015
3022
  content: content.toString("base64")
3016
3023
  }
3017
3024
  };
@@ -3024,9 +3031,9 @@ function mergeRootAsset(base, local, upstream) {
3024
3031
  return {
3025
3032
  content,
3026
3033
  details: {
3027
- baseHash: hash$2(base),
3028
- localHash: hash$2(local),
3029
- upstreamHash: hash$2(upstream),
3034
+ baseHash: hash$1(base),
3035
+ localHash: hash$1(local),
3036
+ upstreamHash: hash$1(upstream),
3030
3037
  conflicts
3031
3038
  },
3032
3039
  reason
@@ -3078,10 +3085,10 @@ async function createBaselinePlanner(context) {
3078
3085
  package: templatePackage,
3079
3086
  version: metadata.version,
3080
3087
  assetPath,
3081
- hash: hash$2(source)
3088
+ hash: hash$1(source)
3082
3089
  },
3083
3090
  upstream: {
3084
- hash: hash$2(upstream),
3091
+ hash: hash$1(upstream),
3085
3092
  content: upstream.toString("base64")
3086
3093
  }
3087
3094
  };
@@ -3097,8 +3104,8 @@ async function createBaselinePlanner(context) {
3097
3104
  const file = await conflict(filename, upstream, "baseline-missing", "No historical upstream baseline exists. Review the diff and use --overwrite to explicitly adopt the current template.");
3098
3105
  file.merge = {
3099
3106
  baseHash: null,
3100
- localHash: hash$2(before),
3101
- upstreamHash: hash$2(upstream),
3107
+ localHash: hash$1(before),
3108
+ upstreamHash: hash$1(upstream),
3102
3109
  conflicts: []
3103
3110
  };
3104
3111
  return null;
@@ -3124,7 +3131,7 @@ async function createBaselinePlanner(context) {
3124
3131
  }
3125
3132
  if (await read("asset", record.source.assetPath) !== null) continue;
3126
3133
  const before = await read("target", filename);
3127
- if (before === null || hash$2(before) === record.upstream.hash) {
3134
+ if (before === null || hash$1(before) === record.upstream.hash) {
3128
3135
  await put(filename, null, "upstream-asset-removed", "The upstream asset was removed and has no local modifications.");
3129
3136
  proposed.set(filename, null);
3130
3137
  } else await conflict(filename, null, "upstream-removal-conflict", "Upstream removed this asset, but it contains local modifications. Both the file and baseline are retained.");
@@ -3138,8 +3145,8 @@ async function createBaselinePlanner(context) {
3138
3145
  const destination = baselinePath(filename);
3139
3146
  const before = await read("target", destination);
3140
3147
  const after = next === null ? null : encodeBaseline(next);
3141
- const beforeHash = before === null ? null : hash$2(before);
3142
- const afterHash = after === null ? null : hash$2(after);
3148
+ const beforeHash = before === null ? null : hash$1(before);
3149
+ const afterHash = after === null ? null : hash$1(after);
3143
3150
  if (beforeHash !== afterHash) file.baseline = {
3144
3151
  path: destination,
3145
3152
  beforeHash,
@@ -3228,7 +3235,7 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
3228
3235
  if (typeof depVersion !== "string") continue;
3229
3236
  if (isCatalogSpecifier(depVersion)) continue;
3230
3237
  if (depName === "repoctl") {
3231
- const nextVersion = `^${version$2}`;
3238
+ const nextVersion = `^${version$1}`;
3232
3239
  const targetVersion = targetDevDeps[depName];
3233
3240
  if (!hasNonOverridablePrefix(targetVersion) && shouldAssignVersion(targetVersion, nextVersion)) targetDevDeps[depName] = nextVersion;
3234
3241
  } else if (depName === legacyToolPackageName) delete targetDevDeps[legacyToolPackageName];
@@ -3244,7 +3251,7 @@ function setPkgJson(sourcePkgJson, targetPkgJson, options) {
3244
3251
  delete targetDevDeps[dependency];
3245
3252
  }
3246
3253
  if (shouldEnsureRepoctl) {
3247
- const nextVersion = `^${version$2}`;
3254
+ const nextVersion = `^${version$1}`;
3248
3255
  const targetVersion = targetDevDeps["repoctl"];
3249
3256
  if (!hasNonOverridablePrefix(targetVersion) && shouldAssignVersion(targetVersion, nextVersion)) targetDevDeps["repoctl"] = nextVersion;
3250
3257
  delete targetDevDeps[legacyToolPackageName];
@@ -3490,7 +3497,7 @@ async function createContext$1(opts) {
3490
3497
  const targetConfig = rootDir === cwd ? loaded : await loadMonorepoConfigDetails(rootDir, { refresh: true });
3491
3498
  const base = getAssetTargets(options.core ?? false);
3492
3499
  const configured = config.targets?.length ? options.mergeTargets === false ? config.targets : [...base, ...config.targets] : base;
3493
- const targets = [...new Set(opts.targets ?? configured)].map(relativeFile$1).sort();
3500
+ const targets = [...new Set(opts.targets ?? configured)].map(relativeFile).sort();
3494
3501
  const plan = {
3495
3502
  schemaVersion: 1,
3496
3503
  cwd,
@@ -3515,7 +3522,7 @@ async function createContext$1(opts) {
3515
3522
  buffers.set(key, content);
3516
3523
  plan.inputs.push({
3517
3524
  ...input,
3518
- hash: content === null ? null : hash$2(content)
3525
+ hash: content === null ? null : hash$1(content)
3519
3526
  });
3520
3527
  return content;
3521
3528
  }
@@ -3548,8 +3555,8 @@ async function createContext$1(opts) {
3548
3555
  }
3549
3556
  async function put(filename, after, reason, detail, flags = {}) {
3550
3557
  const before = await read("target", filename);
3551
- const beforeHash = before === null ? null : hash$2(before);
3552
- const afterHash = after === null ? null : hash$2(after);
3558
+ const beforeHash = before === null ? null : hash$1(before);
3559
+ const afterHash = after === null ? null : hash$1(after);
3553
3560
  const protectedFile = before !== null && !flags.force && (options.noOverwrite || options.skipOverwrite);
3554
3561
  const status = flags.skip || protectedFile ? "skip" : beforeHash === afterHash ? "identical" : after === null ? "delete" : before === null ? "add" : "modify";
3555
3562
  const unchanged = ["skip", "identical"].includes(status);
@@ -3678,9 +3685,9 @@ function planMissingRootScripts(original) {
3678
3685
  risk: "low",
3679
3686
  path: "package.json",
3680
3687
  before: original,
3681
- beforeHash: hash$1(original),
3688
+ beforeHash: hash$2(original),
3682
3689
  after,
3683
- afterHash: hash$1(after),
3690
+ afterHash: hash$2(after),
3684
3691
  additions,
3685
3692
  diff
3686
3693
  },
@@ -3887,7 +3894,8 @@ async function createContext(cwd) {
3887
3894
  };
3888
3895
  }
3889
3896
  // src/core/runtime/node.ts
3890
- const supportedNodeRange = engines$1.node;
3897
+ const { engines } = JSON.parse(readFileSync(path$1.join(packageDir$1, "package.json"), "utf8"));
3898
+ const supportedNodeRange = engines.node;
3891
3899
  const defaultNodeVersion = "24.22.1";
3892
3900
  const devContainerNodeVersions = [
3893
3901
  defaultNodeVersion,
@@ -3996,151 +4004,23 @@ async function ensureLefthookBuildApproval(cwd) {
3996
4004
  }
3997
4005
  await fs$2.outputFile(workspacePath, YAML.stringify(merged, { singleQuote: true }));
3998
4006
  }
3999
- // ../../package.json
4000
- var package_default = {
4001
- name: "repoctl-workspace",
4002
- type: "module",
4003
- version: "0.0.0",
4004
- "private": true,
4005
- packageManager: "pnpm@12.17.0",
4006
- description: "Source workspace for repoctl and Icebreaker's shared development packages",
4007
- author: "ice breaker <hi@sonofmagic.top>",
4008
- license: "MIT",
4009
- homepage: "https://repo.icebreaker.top",
4010
- repository: {
4011
- "type": "git",
4012
- "url": "git+https://github.com/icelib/repoctl.git"
4013
- },
4014
- bugs: { "url": "https://github.com/icelib/repoctl/issues" },
4015
- keywords: [
4016
- "repoctl",
4017
- "monorepo",
4018
- "pnpm",
4019
- "turborepo",
4020
- "typescript"
4021
- ],
4022
- engines: { "node": "^22.23.4 || ^24.22.1 || >=26.12.1" },
4023
- scripts: {
4024
- "build": "turbo run build",
4025
- "tooling:build": "turbo run build --filter=@icebreakers/monorepo --filter=repoctl",
4026
- "dev": "pnpm run dev:repoctl",
4027
- "dev:repoctl": "turbo run build --filter=repoctl && node packages/monorepo-templates/dist/cli.mjs && turbo watch build --filter=repoctl",
4028
- "dev:create": "turbo run build --filter=create-icebreaker && node packages/monorepo-templates/dist/cli.mjs && turbo watch build --filter=create-icebreaker",
4029
- "dev:configs": "turbo watch build --filter=@icebreakers/eslint-config --filter=@icebreakers/commitlint-config --filter=lightningcss-tailwindcss --filter=@icebreakers/changelog-github",
4030
- "dev:packages": "turbo run build \"--filter=./packages/*\" && node packages/monorepo-templates/dist/cli.mjs && turbo watch build \"--filter=./packages/*\"",
4031
- "dev:assets": "pnpm --filter @icebreakers/monorepo-templates sync:assets",
4032
- "dev:client": "pnpm run tooling:build && turbo run dev --filter=@icebreakers/client",
4033
- "dev:server": "pnpm run tooling:build && turbo run dev --filter=@icebreakers/server",
4034
- "dev:docs": "pnpm run tooling:build && turbo run dev --filter=@icebreakers/website",
4035
- "dev:server:node": "pnpm run tooling:build && pnpm --filter @icebreakers/server node:dev",
4036
- "dev:cli": "turbo watch build --filter=@icebreakers/cli",
4037
- "dev:tsdown": "turbo watch build --filter=@icebreakers/tsdown-template",
4038
- "dev:vue-lib": "turbo run build --filter=@icebreakers/vue-lib-template && pnpm --filter @icebreakers/vue-lib-template test:dev",
4039
- "test": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest run && pnpm test:types && pnpm test:dev-scenarios && pnpm docs:test",
4040
- "test:packaged-doctor": "node scripts/smoke-packaged-doctor.mjs",
4041
- "test:packaged-create": "node scripts/smoke-packaged-create.mjs",
4042
- "test:packaged-docs": "node scripts/docs/index.mjs",
4043
- "test:worker-types": "node scripts/worker-types/index.mjs",
4044
- "test:dev-scenarios": "vitest run --config scripts/dev/vitest.config.mjs",
4045
- "test:dev": "node -e \"require('node:fs').mkdirSync('coverage/.tmp', { recursive: true })\" && pnpm check:no-tracked-build-artifacts && vitest",
4046
- "lint": "pnpm run tooling:build && turbo run lint && pnpm docs:lint",
4047
- "tsd": "turbo run tsd",
4048
- "test:types": "turbo run test:types",
4049
- "check:no-tracked-build-artifacts": "node ./scripts/check-no-tracked-build-artifacts.mjs",
4050
- "check:workflows": "node ./scripts/check-workflows.mjs",
4051
- "check:nimbus-upgrade": "node ./scripts/nimbus/check-upgrade.mjs",
4052
- "audit": "pnpm audit --audit-level=moderate",
4053
- "audit:fix": "pnpm audit --fix",
4054
- "cf-typegen": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen",
4055
- "cf-typegen:check": "pnpm --filter @icebreakers/client --filter @icebreakers/server run cf-typegen:check",
4056
- "typecheck": "turbo run typecheck",
4057
- "format": "eslint . --fix",
4058
- "validate": "pnpm run build && pnpm run lint && pnpm run typecheck && pnpm run tsd && pnpm run test",
4059
- "release": "pnpm change",
4060
- "version-packages": "pnpm version -r",
4061
- "publish-packages": "repo release stable publish",
4062
- "release:pre": "repo release pre publish",
4063
- "------": "--------------",
4064
- "preinstall": "npx only-allow pnpm",
4065
- "postinstall": "pnpm run build",
4066
- "commit": "commit",
4067
- "commitlint": "commitlint --edit",
4068
- "sync": "pnpm sync:npmmirror",
4069
- "sync:npmmirror": "repo release sync-npmmirror --all",
4070
- "release:sync-npmmirror": "repo release sync-npmmirror --published",
4071
- "inspector": "npx @eslint/config-inspector",
4072
- "build:inspector": "pnpm build && npx @eslint/config-inspector build",
4073
- "-------": "---------------",
4074
- "repo:init": "repo init",
4075
- "repo:new": "repo new",
4076
- "repo:check": "repo check",
4077
- "repo:doctor": "repo doctor",
4078
- "------simple": "--------------",
4079
- "pr:alpha": "repo release pre enter alpha",
4080
- "pr:beta": "repo release pre enter beta",
4081
- "pr:rc": "repo release pre enter rc",
4082
- "pr:next": "repo release pre enter next",
4083
- "pr:exit": "repo release pre exit",
4084
- "--------": "----------------",
4085
- "test:packaged-nimbus": "node scripts/nimbus/index.mjs",
4086
- "test:packaged-react": "node scripts/react/index.mjs",
4087
- "test:packaged-devcontainer": "node scripts/devcontainer/index.mjs",
4088
- "test:packaged-next": "node scripts/next/index.mjs",
4089
- "test:packaged-capability": "node scripts/capabilities/index.mjs",
4090
- "test:packaged-storybook": "node scripts/storybook/index.mjs",
4091
- "test:packaged-react-lib": "node scripts/react-lib/index.mjs",
4092
- "test:packaged-template-validation": "node scripts/template-validation/index.mjs",
4093
- "test:packaged-template-sources": "node scripts/template-sources/index.mjs",
4094
- "test:packaged-presets": "node scripts/presets/index.mjs",
4095
- "test:packaged-maintenance-presets": "vitest run --config scripts/maintenance-presets/vitest.config.mjs && node scripts/maintenance-presets/index.mjs",
4096
- "test:packaged-generators": "node scripts/generate/index.mjs",
4097
- "test:packaged-template-parameters": "node scripts/template-parameters/index.mjs",
4098
- "docs:build": "node scripts/docs-deployment/build.mjs",
4099
- "docs:test": "node --test scripts/docs-deployment/deployment.test.mjs scripts/docs-deployment/release-inputs.test.mjs",
4100
- "docs:lint": "eslint scripts/docs-deployment repoctl.config.ts"
4101
- },
4102
- devDependencies: {
4103
- "@commitlint/cli": "^21.2.4",
4104
- "@eslint/config-inspector": "^3.5.0",
4105
- "@icebreakers/commitlint-config": "workspace:*",
4106
- "@icebreakers/eslint-config": "workspace:*",
4107
- "@icebreakers/monorepo": "workspace:*",
4108
- "@icebreakers/stylelint-config": "workspace:*",
4109
- "@types/node": "^26.6.6",
4110
- "@vitest/coverage-v8": "~5.0.5",
4111
- "eslint": "^10.14.0",
4112
- "execa": "^10.2.1",
4113
- "lefthook": "2.2.2",
4114
- "make-fetch-happen": "15.0.6",
4115
- "only-allow": "^1.2.2",
4116
- "playwright": "^1.64.1",
4117
- "repoctl": "workspace:*",
4118
- "stylelint": "^18.0.0",
4119
- "tailwindcss": "^4.3.3",
4120
- "tsd": "^0.33.0",
4121
- "tsdown": "0.23.4",
4122
- "turbo": "^2.11.10",
4123
- "typescript": "^6.0.3",
4124
- "vitest": "~5.0.5",
4125
- "yaml": "^2.9.1"
4126
- },
4127
- publishConfig: {
4128
- "access": "public",
4129
- "registry": "https://registry.npmjs.org"
4130
- }
4131
- };
4132
4007
  // src/commands/init/tooling/presets.ts
4133
4008
  function isConcreteNpmSpecifier(version) {
4134
4009
  return !version.startsWith("catalog:") && !version.startsWith("workspace:");
4135
4010
  }
4136
4011
  function collectConcreteDependencyVersions(pkg) {
4137
4012
  const versions = {};
4138
- for (const group of [pkg.dependencies, pkg.devDependencies]) for (const [name, version] of Object.entries(group ?? {})) if (typeof version === "string" && version.length > 0 && isConcreteNpmSpecifier(version)) versions[name] = version;
4013
+ for (const group of [
4014
+ pkg.dependencies,
4015
+ pkg.devDependencies,
4016
+ pkg.peerDependencies
4017
+ ]) for (const [name, version] of Object.entries(group ?? {})) if (typeof version === "string" && version.length > 0 && isConcreteNpmSpecifier(version)) versions[name] = version;
4139
4018
  return versions;
4140
4019
  }
4020
+ const packageManifest = JSON.parse(readFileSync(path$1.join(packageDir$1, "package.json"), "utf8"));
4141
4021
  const packageDependencies = {
4142
- ...collectConcreteDependencyVersions(package_default),
4143
- ...collectConcreteDependencyVersions(package_default$1)
4022
+ ...collectConcreteDependencyVersions(JSON.parse(readFileSync(path$1.join(rootDir, "package.json"), "utf8"))),
4023
+ ...collectConcreteDependencyVersions(packageManifest)
4144
4024
  };
4145
4025
  function getDependencyVersion(name) {
4146
4026
  const version = packageDependencies[name];
@@ -4149,7 +4029,7 @@ function getDependencyVersion(name) {
4149
4029
  return version;
4150
4030
  }
4151
4031
  function getToolingPackageVersion() {
4152
- return `^${version$2}`;
4032
+ return `^${version$1}`;
4153
4033
  }
4154
4034
  function createConfigModule(functionName, source) {
4155
4035
  return [
@@ -4882,7 +4762,7 @@ async function getAutoChangesetWorkflow(options = {}) {
4882
4762
  const configuration = workflowConfiguration(options);
4883
4763
  const template = await readFile(path$1.join(packageDir$1, "resources/release-auto-changeset/workflow.yml"), "utf8");
4884
4764
  const values = {
4885
- __VERSION__: version$2,
4765
+ __VERSION__: version$1,
4886
4766
  __ENVIRONMENT__: JSON.stringify(configuration.environment),
4887
4767
  __WORKFLOW_NAME__: JSON.stringify(configuration.workflowName),
4888
4768
  __WORKFLOW_PATH__: JSON.stringify(configuration.workflowPath),
@@ -12635,7 +12515,7 @@ async function publicApiIntents(root) {
12635
12515
  }
12636
12516
  // src/commands/api-report/paths.ts
12637
12517
  function reportPath(value) {
12638
- relativeFile$1(value);
12518
+ relativeFile(value);
12639
12519
  if ([...value].some((char) => char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127 || char === ":") || value.split("/").some((part) => [
12640
12520
  "node_modules",
12641
12521
  ".repoctl",
@@ -12719,7 +12599,7 @@ async function apiReportSettings(cwd, options) {
12719
12599
  timeoutMs,
12720
12600
  entries,
12721
12601
  selection: [...selected].sort().map((id) => `./${id}`),
12722
- configurationHash: hash$1(JSON.stringify(entries.map((item) => [
12602
+ configurationHash: hash$2(JSON.stringify(entries.map((item) => [
12723
12603
  item.node.id,
12724
12604
  item.node.name,
12725
12605
  item.config
@@ -12746,7 +12626,7 @@ async function resolveApiExtractor(root) {
12746
12626
  return {
12747
12627
  module,
12748
12628
  version: manifest.version,
12749
- moduleHash: hash$1(await readFile(module, "utf8"))
12629
+ moduleHash: hash$2(await readFile(module, "utf8"))
12750
12630
  };
12751
12631
  }
12752
12632
  async function extractPublicApi(root, tool, packageJson, entryPoint, tsconfig, options) {
@@ -12877,7 +12757,7 @@ async function applyPublicApiUpdate(cwd, plan, options = {}) {
12877
12757
  if (applied && files.length) throw new Error("API baseline plan is partially applied; recover retained backups or review a fresh plan.");
12878
12758
  options.signal?.throwIfAborted();
12879
12759
  const verify = async () => {
12880
- for (const entry of current.entries) for (const input of entry.inputs) if (hash$1(await readFile(input.path, "utf8")) !== input.hash) throw new Error(`API compiler input changed during update: ${input.path}`);
12760
+ for (const entry of current.entries) for (const input of entry.inputs) if (hash$2(await readFile(input.path, "utf8")) !== input.hash) throw new Error(`API compiler input changed during update: ${input.path}`);
12881
12761
  };
12882
12762
  await verify();
12883
12763
  if (files.length) await writeFileTransaction(settings.root, files, { verify });
@@ -12957,7 +12837,7 @@ async function checkPublicApi(cwd, options = {}) {
12957
12837
  const files = await entryPaths(settings.root, node.id, subpath, definition, config.tsconfig);
12958
12838
  entry.entryPoint = files.entryRelative;
12959
12839
  entry.before = files.before;
12960
- entry.beforeHash = files.before === null ? null : hash$1(files.before);
12840
+ entry.beforeHash = files.before === null ? null : hash$2(files.before);
12961
12841
  const extracted = await extractPublicApi(settings.root, tool.module, files.packageJson, files.entryPoint, files.tsconfig, {
12962
12842
  ...options,
12963
12843
  timeoutMs: settings.timeoutMs
@@ -12967,7 +12847,7 @@ async function checkPublicApi(cwd, options = {}) {
12967
12847
  entry.inputs = extracted.inputs;
12968
12848
  if (extracted.succeeded && extracted.report !== null) {
12969
12849
  entry.after = extracted.report;
12970
- entry.afterHash = hash$1(extracted.report);
12850
+ entry.afterHash = hash$2(extracted.report);
12971
12851
  entry.status = files.before === null ? "new" : files.before.replaceAll("\r\n", "\n") === extracted.report ? "unchanged" : "changed";
12972
12852
  entry.diff = entry.status === "unchanged" ? "" : fileDiff(files.baseline, files.before === null ? null : Buffer.from(files.before), Buffer.from(extracted.report)).diff;
12973
12853
  }
@@ -14670,9 +14550,9 @@ async function planInstallSecurityPreset(cwd, options = {}) {
14670
14550
  preset: "balanced",
14671
14551
  workspaceDir: sources.workspaceDir,
14672
14552
  pnpmVersion: sources.version,
14673
- policyHash: hash$1(JSON.stringify([...sources.values])),
14674
- beforeHash: hash$1(original),
14675
- afterHash: hash$1(content),
14553
+ policyHash: hash$2(JSON.stringify([...sources.values])),
14554
+ beforeHash: hash$2(original),
14555
+ afterHash: hash$2(content),
14676
14556
  additions,
14677
14557
  preserved,
14678
14558
  diff: Object.entries(additions).map(([key, value]) => `+ ${key}: ${JSON.stringify(value)}`).join("\n")
@@ -14683,13 +14563,13 @@ async function applyInstallSecurityPreset(cwd, plan) {
14683
14563
  const current = await planInstallSecurityPreset(cwd);
14684
14564
  if (current.workspaceDir !== plan.workspaceDir || current.pnpmVersion !== plan.pnpmVersion) throw new Error("Security preset belongs to a different workspace or pnpm version.");
14685
14565
  const original = await readInput(current.workspaceDir, "pnpm-workspace.yaml");
14686
- if (hash$1(original) === plan.afterHash) return {
14566
+ if (hash$2(original) === plan.afterHash) return {
14687
14567
  status: "unchanged",
14688
14568
  changed: []
14689
14569
  };
14690
14570
  if (!isDeepStrictEqual(current, plan)) throw new Error("Security preset inputs changed; preview again before applying.");
14691
14571
  const content = renderAdditions(original, plan.additions);
14692
- if (hash$1(content) !== plan.afterHash) throw new Error("Security preset output changed; preview again before applying.");
14572
+ if (hash$2(content) !== plan.afterHash) throw new Error("Security preset output changed; preview again before applying.");
14693
14573
  await writeDependencyTransaction(current.workspaceDir, [{
14694
14574
  path: "pnpm-workspace.yaml",
14695
14575
  original,
@@ -15026,7 +14906,7 @@ async function planOrganizationPresetAssets(cwd, targets) {
15026
14906
  const loaded = await loadMonorepoConfigDetails(rootDir, { refresh: true });
15027
14907
  const inputs = new Map(loaded.presets.inputs.map((input) => [input.path, input.hash]));
15028
14908
  for (const filename of loaded.files) {
15029
- const current = hash$2(await readFile(filename));
14909
+ const current = hash$1(await readFile(filename));
15030
14910
  if (inputs.has(filename) && inputs.get(filename) !== current) throw new Error("Preset input changed while planning");
15031
14911
  inputs.set(filename, current);
15032
14912
  }
@@ -15064,7 +14944,7 @@ async function planOrganizationPresetAssets(cwd, targets) {
15064
14944
  const rootOwner = await readOptional$1(rootDir, rootOwnerPath);
15065
14945
  plan.ownership.push({
15066
14946
  path: rootOwnerPath,
15067
- hash: rootOwner ? hash$2(rootOwner) : null
14947
+ hash: rootOwner ? hash$1(rootOwner) : null
15068
14948
  });
15069
14949
  let reason = "preset-asset-added";
15070
14950
  let after = upstream.content;
@@ -15087,7 +14967,7 @@ async function planOrganizationPresetAssets(cwd, targets) {
15087
14967
  reason = merged.reason;
15088
14968
  merge = merged.details;
15089
14969
  }
15090
- const beforeHash = before ? hash$2(before) : null;
14970
+ const beforeHash = before ? hash$1(before) : null;
15091
14971
  const file = {
15092
14972
  path: asset.target,
15093
14973
  source: {
@@ -15095,9 +14975,9 @@ async function planOrganizationPresetAssets(cwd, targets) {
15095
14975
  version: layer.source.version,
15096
14976
  path: asset.source
15097
14977
  },
15098
- status: after === null ? "conflict" : beforeHash === hash$2(after) ? "identical" : before === null ? "add" : "modify",
14978
+ status: after === null ? "conflict" : beforeHash === hash$1(after) ? "identical" : before === null ? "add" : "modify",
15099
14979
  beforeHash,
15100
- afterHash: after ? hash$2(after) : beforeHash,
14980
+ afterHash: after ? hash$1(after) : beforeHash,
15101
14981
  content: after?.toString("base64") ?? null,
15102
14982
  diff: fileDiff(asset.target, before, after ?? upstream.content).diff,
15103
14983
  reason,
@@ -15111,8 +14991,8 @@ async function planOrganizationPresetAssets(cwd, targets) {
15111
14991
  const next = encodePresetBaseline(asset, layer.source, upstream.content);
15112
14992
  file.baseline = {
15113
14993
  path: baselineFile,
15114
- beforeHash: baselineContent ? hash$2(baselineContent) : null,
15115
- afterHash: hash$2(next),
14994
+ beforeHash: baselineContent ? hash$1(baselineContent) : null,
14995
+ afterHash: hash$1(next),
15116
14996
  content: next.toString("base64")
15117
14997
  };
15118
14998
  }
@@ -15186,11 +15066,11 @@ async function applyOrganizationPresetAssets(plan) {
15186
15066
  }] : [])
15187
15067
  ];
15188
15068
  const verify = async () => {
15189
- for (const input of fresh.inputs) if (path.normalize(await realpath(input.path)) !== input.path || hash$2(await readFile(input.path)) !== input.hash) throw new Error("Preset source or configuration changed during application");
15069
+ for (const input of fresh.inputs) if (path.normalize(await realpath(input.path)) !== input.path || hash$1(await readFile(input.path)) !== input.hash) throw new Error("Preset source or configuration changed during application");
15190
15070
  for (const location of fresh.locations) if (await installedPresetDirectory(location.packageName, location.fromDirectory) !== location.directory) throw new Error("Installed preset location changed during application");
15191
15071
  for (const file of stableFiles) {
15192
15072
  const current = await readOptional$1(fresh.rootDir, file.path);
15193
- if ((current ? hash$2(current) : null) !== file.hash) throw new Error(`Preset ownership or unchanged asset changed: ${file.path}`);
15073
+ if ((current ? hash$1(current) : null) !== file.hash) throw new Error(`Preset ownership or unchanged asset changed: ${file.path}`);
15194
15074
  }
15195
15075
  };
15196
15076
  await writeFileTransaction(fresh.rootDir, updates, { verify });
@@ -15890,7 +15770,7 @@ async function readOwnership(root, inputs) {
15890
15770
  if (record$6(state) && Object.hasOwn(state, "transaction")) throw new Error("Pending TypeScript references transaction. Verify no writer is active, preserve backups and reconcile the registry before retrying.");
15891
15771
  if (!record$6(state) || state.schemaVersion !== 1 || Object.keys(state).some((key) => !["schemaVersion", "configs"].includes(key)) || !record$6(state.configs)) throw new Error("Invalid TypeScript reference ownership registry.");
15892
15772
  for (const [file, references] of Object.entries(state.configs)) {
15893
- relativeFile(file);
15773
+ relativeFile$1(file);
15894
15774
  if (!Array.isArray(references) || references.length !== new Set(references).size || references.some((ref) => typeof ref !== "string" || referencePath(file, referenceTarget(file, ref)) !== ref)) throw new Error(`Invalid managed project references: ${file}`);
15895
15775
  }
15896
15776
  return {
@@ -15958,15 +15838,15 @@ function parseSettings(value) {
15958
15838
  "relations"
15959
15839
  ].includes(key))) throw new Error("Invalid tooling.projectReferences configuration.");
15960
15840
  if (config["enabled"] !== void 0 && typeof config["enabled"] !== "boolean") throw new Error("projectReferences.enabled must be a boolean.");
15961
- if (config["root"] !== void 0) relativeFile(config["root"]);
15962
- for (const field of ["projects", "exclude"]) if (config[field] !== void 0 && (!Array.isArray(config[field]) || config[field].some((item) => !relativeFile(item, true)))) throw new Error(`projectReferences.${field} must contain relative config patterns.`);
15841
+ if (config["root"] !== void 0) relativeFile$1(config["root"]);
15842
+ for (const field of ["projects", "exclude"]) if (config[field] !== void 0 && (!Array.isArray(config[field]) || config[field].some((item) => !relativeFile$1(item, true)))) throw new Error(`projectReferences.${field} must contain relative config patterns.`);
15963
15843
  if (config["relations"] !== void 0) {
15964
15844
  if (!Array.isArray(config["relations"])) throw new TypeError("projectReferences.relations must be an array.");
15965
15845
  for (const value of config["relations"]) {
15966
15846
  const edge = record$6(value);
15967
15847
  if (!edge || Object.keys(edge).some((key) => !["source", "target"].includes(key))) throw new Error("Invalid projectReferences relation.");
15968
- relativeFile(edge["source"]);
15969
- relativeFile(edge["target"]);
15848
+ relativeFile$1(edge["source"]);
15849
+ relativeFile$1(edge["target"]);
15970
15850
  }
15971
15851
  }
15972
15852
  return config;
@@ -15983,8 +15863,8 @@ function operation(file, before, after) {
15983
15863
  path: file,
15984
15864
  before,
15985
15865
  after,
15986
- beforeHash: before === null ? null : hash$1(before),
15987
- afterHash: hash$1(after),
15866
+ beforeHash: before === null ? null : hash$2(before),
15867
+ afterHash: hash$2(after),
15988
15868
  diff: fileDiff(file, before === null ? null : Buffer.from(before), Buffer.from(after)).diff
15989
15869
  };
15990
15870
  }
@@ -16008,8 +15888,8 @@ async function planProjectReferences(cwd) {
16008
15888
  inputs: {},
16009
15889
  validation: []
16010
15890
  };
16011
- for (const file of loaded.files) plan.inputs[`configuration:${file}`] = hash$1(await readFile(file, "utf8"));
16012
- plan.inputs["settings"] = hash$1(JSON.stringify(settings));
15891
+ for (const file of loaded.files) plan.inputs[`configuration:${file}`] = hash$2(await readFile(file, "utf8"));
15892
+ plan.inputs["settings"] = hash$2(JSON.stringify(settings));
16013
15893
  if (await exists$1(workspaceDir, "pnpm-workspace.yaml")) await readText(workspaceDir, "pnpm-workspace.yaml", plan.inputs);
16014
15894
  const packages = data.packages.map((pkg) => ({
16015
15895
  ...pkg,
@@ -16047,7 +15927,7 @@ async function planProjectReferences(cwd) {
16047
15927
  message: `Project pattern does not match a workspace package configuration: ${pattern}`
16048
15928
  });
16049
15929
  }
16050
- plan.inputs["discovery"] = hash$1(JSON.stringify({
15930
+ plan.inputs["discovery"] = hash$2(JSON.stringify({
16051
15931
  packages: packages.map((pkg) => pkg.relative),
16052
15932
  projects: plan.projects
16053
15933
  }));
@@ -17207,7 +17087,7 @@ async function inspectPkgPrNew(report, options) {
17207
17087
  async function pinnedPublisher() {
17208
17088
  const manifestPath = createRequire(import.meta.url).resolve("pkg-pr-new/package.json");
17209
17089
  const manifest = JSON.parse(await readFile(manifestPath, "utf8"));
17210
- if (manifest.version !== "0.0.91" || typeof manifest.bin?.["pkg-pr-new"] !== "string") throw new Error("Nightly requires its own pinned pkg-pr-new@0.0.91 dependency.");
17090
+ if (manifest.version !== "0.0.93" || typeof manifest.bin?.["pkg-pr-new"] !== "string") throw new Error("Nightly requires its own pinned pkg-pr-new@0.0.93 dependency.");
17211
17091
  const root = await realpath(path$1.dirname(manifestPath));
17212
17092
  const executable = await realpath(path$1.resolve(root, manifest.bin["pkg-pr-new"]));
17213
17093
  const relative = path$1.relative(root, executable);
@@ -18408,7 +18288,7 @@ async function getSnapshotWorkflows(options = {}) {
18408
18288
  const directory = path$1.join(packageDir$1, "resources/release-snapshot");
18409
18289
  const [buildTemplate, publishTemplate] = await Promise.all([readFile(path$1.join(directory, "build.yml"), "utf8"), readFile(path$1.join(directory, "publish.yml"), "utf8")]);
18410
18290
  const replacements = {
18411
- __VERSION__: version$2,
18291
+ __VERSION__: version$1,
18412
18292
  __PNPM_VERSION__: configuration.pnpmVersion,
18413
18293
  __ENVIRONMENT__: JSON.stringify(configuration.environment),
18414
18294
  __BUILDER_WORKFLOW_PATH__: JSON.stringify(configuration.builderWorkflowPath),
@@ -18950,7 +18830,7 @@ function playwrightFiles(settings) {
18950
18830
  "@playwright/test": "1.63.0",
18951
18831
  "@types/node": "^22.0.0",
18952
18832
  "eslint": "^10.0.0",
18953
- "repoctl": `^${version$2}`,
18833
+ "repoctl": `^${version$1}`,
18954
18834
  "typescript": "^6.0.2",
18955
18835
  [target.name]: "workspace:*"
18956
18836
  };
@@ -19060,7 +18940,7 @@ function playwrightWorkflow({ workspace }) {
19060
18940
  "env": { CI: "true" },
19061
18941
  "steps": [
19062
18942
  { uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" },
19063
- { uses: "pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413" },
18943
+ { uses: "pnpm/action-setup@9bbca1e9dc2902adb87e8780fe5c98796985a62d" },
19064
18944
  {
19065
18945
  uses: "actions/setup-node@820762786026740c76f36085b0efc47a31fe5020",
19066
18946
  with: { "node-version": defaultNodeVersion }
@@ -19226,7 +19106,7 @@ async function resolveStorybookSettings(cwd, input) {
19226
19106
  const root = await canonicalDirectory(data.workspaceDir);
19227
19107
  const matches = data.packages.filter((pkg) => pkg.manifest.name === selector || path.relative(root, pkg.rootDir) === selector);
19228
19108
  if (matches.length !== 1) throw new Error(`Expected one exact Storybook target for ${selector}; found ${matches.length}`);
19229
- const targetDirectory = relativeFile$1(path.relative(root, matches[0].rootDir));
19109
+ const targetDirectory = relativeFile(path.relative(root, matches[0].rootDir));
19230
19110
  const raw = await readOptional$1(root, `${targetDirectory}/package.json`);
19231
19111
  const manifest = JSON.parse(raw.toString());
19232
19112
  const name = text$1(manifest.name, "package name");
@@ -19234,7 +19114,7 @@ async function resolveStorybookSettings(cwd, input) {
19234
19114
  const range = manifest.devDependencies?.[runtime] ?? manifest.dependencies?.[runtime] ?? manifest.peerDependencies?.[runtime];
19235
19115
  if (!range || !semver.validRange(range) || !semver.subset(range, runtime === "vue" ? ">=3 <4" : ">=18 <20") || !manifest.scripts?.["build"] || !manifest.exports && !manifest["main"] && !manifest["module"]) throw new Error(`Unsupported Storybook target ${name}: require a Vue 3 or React 18/19 library export, concrete runtime range and build script`);
19236
19116
  const slug = name.replace(/^@/, "").replace(/[^a-z0-9-]+/gi, "-").toLowerCase();
19237
- const directory = relativeFile$1(input.directory ?? `stories/${slug}`);
19117
+ const directory = relativeFile(input.directory ?? `stories/${slug}`);
19238
19118
  if (directory.startsWith(".") || directory === targetDirectory || directory.startsWith(`${targetDirectory}/`) || targetDirectory.startsWith(`${directory}/`)) throw new Error("Storybook workspace must be separate from the component library and hidden configuration");
19239
19119
  const workspaceName = `@repoctl-stories/${slug}`;
19240
19120
  if (data.packages.some((pkg) => pkg.manifest.name === workspaceName && path.relative(root, pkg.rootDir) !== directory)) throw new Error(`Workspace name already exists: ${workspaceName}`);
@@ -19252,7 +19132,7 @@ async function resolveStorybookSettings(cwd, input) {
19252
19132
  target: {
19253
19133
  name,
19254
19134
  directory: targetDirectory,
19255
- manifestHash: hash$2(raw)
19135
+ manifestHash: hash$1(raw)
19256
19136
  },
19257
19137
  workspace: {
19258
19138
  name: workspaceName,
@@ -19280,7 +19160,7 @@ async function resolvePlaywrightSettings(cwd, input) {
19280
19160
  if (matches.length !== 1) throw new Error(`Expected one exact target workspace for ${target}; found ${matches.length}`);
19281
19161
  const pkg = matches[0];
19282
19162
  const name = text(pkg.manifest.name, "target package name");
19283
- const targetDirectory = relativeFile$1(path.relative(root, pkg.rootDir));
19163
+ const targetDirectory = relativeFile(path.relative(root, pkg.rootDir));
19284
19164
  await checkedFile(root, `${targetDirectory}/package.json`);
19285
19165
  const manifest = JSON.parse((await readOptional$1(root, `${targetDirectory}/package.json`)).toString());
19286
19166
  const deps = {
@@ -19289,7 +19169,7 @@ async function resolvePlaywrightSettings(cwd, input) {
19289
19169
  };
19290
19170
  if (!deps["vite"] || !deps["vue"] && !deps["react"] || !manifest.scripts?.["build"] || !manifest.scripts["preview"] || !/\bvite\s+preview\b/.test(manifest.scripts["preview"])) throw new Error(`Unsupported E2E target ${name}: require Vue/React, Vite, build and a vite preview script`);
19291
19171
  const slug = name.replace(/^@/, "").replace(/[^a-z0-9-]+/gi, "-").toLowerCase();
19292
- const directory = relativeFile$1(input.directory ?? `e2e/${slug}`);
19172
+ const directory = relativeFile(input.directory ?? `e2e/${slug}`);
19293
19173
  if (directory === targetDirectory || directory.startsWith(`${targetDirectory}/`) || targetDirectory.startsWith(`${directory}/`) || directory.startsWith(".")) throw new Error("E2E workspace must be outside the target application and hidden configuration directories");
19294
19174
  const e2eName = `@repoctl-e2e/${slug}`;
19295
19175
  if (workspace.packages.some((pkg) => pkg.manifest.name === e2eName && path.relative(root, pkg.rootDir) !== directory)) throw new Error(`Workspace name already exists: ${e2eName}`);
@@ -19325,7 +19205,7 @@ async function resolvePlaywrightSettings(cwd, input) {
19325
19205
  target: {
19326
19206
  name,
19327
19207
  directory: targetDirectory,
19328
- manifestHash: hash$2(await readOptional$1(root, `${targetDirectory}/package.json`))
19208
+ manifestHash: hash$1(await readOptional$1(root, `${targetDirectory}/package.json`))
19329
19209
  },
19330
19210
  workspace: {
19331
19211
  name: e2eName,
@@ -19434,7 +19314,7 @@ function storybookFiles(settings) {
19434
19314
  [`@vitejs/plugin-${options.framework}`]: options.framework === "vue" ? "^6.0.9" : "^6.1.1",
19435
19315
  "eslint": "^10.0.0",
19436
19316
  "playwright": "1.63.0",
19437
- "repoctl": `^${version$2}`,
19317
+ "repoctl": `^${version$1}`,
19438
19318
  "storybook": "10.6.1",
19439
19319
  "typescript": "^6.0.3",
19440
19320
  "vite": "^8.3.2",
@@ -19571,7 +19451,7 @@ function storybookWorkflow({ workspace }) {
19571
19451
  "env": { CI: "true" },
19572
19452
  "steps": [
19573
19453
  { uses: "actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1" },
19574
- { uses: "pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413" },
19454
+ { uses: "pnpm/action-setup@9bbca1e9dc2902adb87e8780fe5c98796985a62d" },
19575
19455
  {
19576
19456
  uses: "actions/setup-node@820762786026740c76f36085b0efc47a31fe5020",
19577
19457
  with: { "node-version": defaultNodeVersion }
@@ -19640,8 +19520,8 @@ async function planToolingCapability(cwd, input) {
19640
19520
  for (const [file, content] of Object.entries(desired).sort(([a], [b]) => a.localeCompare(b))) {
19641
19521
  const current = await readOptional$1(settings.root, file);
19642
19522
  const before = current?.toString() ?? null;
19643
- const beforeHash = current ? hash$2(current) : null;
19644
- const afterHash = hash$2(Buffer.from(content));
19523
+ const beforeHash = current ? hash$1(current) : null;
19524
+ const afterHash = hash$1(Buffer.from(content));
19645
19525
  let status = beforeHash === afterHash ? "identical" : before === null ? "add" : "modify";
19646
19526
  if (before !== null && beforeHash !== afterHash && file !== "package.json" && file !== "pnpm-workspace.yaml" && file !== "turbo.json") {
19647
19527
  conflicts.push({
@@ -19712,10 +19592,10 @@ async function applyToolingCapability(plan) {
19712
19592
  }));
19713
19593
  const verify = async () => {
19714
19594
  const target = await readOptional$1(plan.rootDir, `${plan.target.directory}/package.json`);
19715
- if (!target || hash$2(target) !== plan.target.manifestHash) throw new Error("Target workspace changed during capability application");
19595
+ if (!target || hash$1(target) !== plan.target.manifestHash) throw new Error("Target workspace changed during capability application");
19716
19596
  for (const file of fresh.files.filter((file) => file.status === "identical")) {
19717
19597
  const current = await readOptional$1(plan.rootDir, file.path);
19718
- if (!current || hash$2(current) !== file.beforeHash) throw new Error(`Capability input changed during application: ${file.path}`);
19598
+ if (!current || hash$1(current) !== file.beforeHash) throw new Error(`Capability input changed during application: ${file.path}`);
19719
19599
  }
19720
19600
  };
19721
19601
  await writeFileTransaction(plan.rootDir, changes, { verify });
@@ -20701,8 +20581,8 @@ function changedFile(file, before, after, fields) {
20701
20581
  path: file,
20702
20582
  before,
20703
20583
  after,
20704
- beforeHash: hash$1(before),
20705
- afterHash: hash$1(after),
20584
+ beforeHash: hash$2(before),
20585
+ afterHash: hash$2(after),
20706
20586
  fields: fields.sort()
20707
20587
  };
20708
20588
  }
@@ -21077,7 +20957,7 @@ async function planWorkspaceMove(cwd, options) {
21077
20957
  files,
21078
20958
  inputs: [...contents].sort(([a], [b]) => a.localeCompare(b)).map(([file, content]) => ({
21079
20959
  path: file,
21080
- hash: hash$1(content)
20960
+ hash: hash$2(content)
21081
20961
  })),
21082
20962
  inventory: inventory.entries,
21083
20963
  workspaces: graph.nodes,
@@ -21093,7 +20973,7 @@ async function planWorkspaceMove(cwd, options) {
21093
20973
  }
21094
20974
  // src/commands/workspace/move/verify.ts
21095
20975
  function validateMovePlan(plan) {
21096
- if (!record$6(plan) || plan.schemaVersion !== 1 || plan.kind !== "workspace-move" || typeof plan.workspaceDir !== "string" || !record$6(plan.selection) || !record$6(plan.target) || !record$6(plan.destination) || typeof plan.target.id !== "string" || typeof plan.destination.id !== "string" || plan.selection.target !== `./${plan.target.id}` || plan.selection.to !== plan.destination.id || plan.selection.name !== plan.destination.name || typeof plan.canApply !== "boolean" || !Array.isArray(plan.blockers) || !Array.isArray(plan.inputs) || !Array.isArray(plan.files) || !Array.isArray(plan.inventory) || !Array.isArray(plan.workspaces) || plan.inputs.some((item) => !record$6(item) || typeof item.path !== "string" || !/^[a-f\d]{64}$/u.test(item.hash)) || plan.files.some((item) => !record$6(item) || typeof item.path !== "string" || typeof item.before !== "string" || typeof item.after !== "string" || item.beforeHash !== hash$1(item.before) || item.afterHash !== hash$1(item.after) || !plan.inputs.some((input) => input.path === item.path && input.hash === item.beforeHash)) || new Set(plan.inputs.map((item) => item.path)).size !== plan.inputs.length || new Set(plan.files.map((item) => item.path)).size !== plan.files.length || !record$6(plan.templateInstances) || plan.templateInstances.from !== plan.target.id || plan.templateInstances.to !== plan.destination.id || !/^[a-f\d]{64}$/u.test(plan.templateInstances.beforeHash) || !/^[a-f\d]{64}$/u.test(plan.templateInstances.afterHash) || !Array.isArray(plan.templateInstances.relocations) || plan.templateInstances.relocations.some((item) => !record$6(item) || !/^[a-f\d]{24}$/u.test(item.id) || typeof item.from !== "string" || item.to !== movedPath(item.from, plan.target.id, plan.destination.id))) throw new Error("Invalid workspace move plan.");
20976
+ if (!record$6(plan) || plan.schemaVersion !== 1 || plan.kind !== "workspace-move" || typeof plan.workspaceDir !== "string" || !record$6(plan.selection) || !record$6(plan.target) || !record$6(plan.destination) || typeof plan.target.id !== "string" || typeof plan.destination.id !== "string" || plan.selection.target !== `./${plan.target.id}` || plan.selection.to !== plan.destination.id || plan.selection.name !== plan.destination.name || typeof plan.canApply !== "boolean" || !Array.isArray(plan.blockers) || !Array.isArray(plan.inputs) || !Array.isArray(plan.files) || !Array.isArray(plan.inventory) || !Array.isArray(plan.workspaces) || plan.inputs.some((item) => !record$6(item) || typeof item.path !== "string" || !/^[a-f\d]{64}$/u.test(item.hash)) || plan.files.some((item) => !record$6(item) || typeof item.path !== "string" || typeof item.before !== "string" || typeof item.after !== "string" || item.beforeHash !== hash$2(item.before) || item.afterHash !== hash$2(item.after) || !plan.inputs.some((input) => input.path === item.path && input.hash === item.beforeHash)) || new Set(plan.inputs.map((item) => item.path)).size !== plan.inputs.length || new Set(plan.files.map((item) => item.path)).size !== plan.files.length || !record$6(plan.templateInstances) || plan.templateInstances.from !== plan.target.id || plan.templateInstances.to !== plan.destination.id || !/^[a-f\d]{64}$/u.test(plan.templateInstances.beforeHash) || !/^[a-f\d]{64}$/u.test(plan.templateInstances.afterHash) || !Array.isArray(plan.templateInstances.relocations) || plan.templateInstances.relocations.some((item) => !record$6(item) || !/^[a-f\d]{24}$/u.test(item.id) || typeof item.from !== "string" || item.to !== movedPath(item.from, plan.target.id, plan.destination.id))) throw new Error("Invalid workspace move plan.");
21097
20977
  }
21098
20978
  async function verifyMovePostState(plan, recoveryPaths = [], requireHead = true) {
21099
20979
  const root = plan.workspaceDir;
@@ -21102,7 +20982,7 @@ async function verifyMovePostState(plan, recoveryPaths = [], requireHead = true)
21102
20982
  for (const input of plan.inputs) {
21103
20983
  const file = movedPath(input.path, plan.target.id, to);
21104
20984
  const expected = plan.files.find((change) => change.path === input.path)?.afterHash ?? input.hash;
21105
- if (hash$1(await readInput(root, file)) !== expected) throw new Error(`Move input changed: ${file}`);
20985
+ if (hash$2(await readInput(root, file)) !== expected) throw new Error(`Move input changed: ${file}`);
21106
20986
  }
21107
20987
  const entries = (await workspaceInventory(root, path.join(root, to))).entries;
21108
20988
  const retained = [];
@@ -21204,7 +21084,7 @@ async function applyMove(cwd, plan) {
21204
21084
  if (root !== plan.workspaceDir || !isWithin(root, source) || !isWithin(root, destination)) throw new Error("Move plan must select directories inside this workspace.");
21205
21085
  if (!plan.canApply) throw new Error(`Workspace move is blocked: ${plan.blockers.map((item) => item.code).join(", ")}.`);
21206
21086
  const nameChange = plan.files.find((file) => file.path === `${plan.target.id}/package.json`);
21207
- if (source !== destination ? !await exists(source) && await exists(destination) : !!nameChange && hash$1(await readInput(root, nameChange.path)) === nameChange.afterHash) {
21087
+ if (source !== destination ? !await exists(source) && await exists(destination) : !!nameChange && hash$2(await readInput(root, nameChange.path)) === nameChange.afterHash) {
21208
21088
  let cleanupPending = [];
21209
21089
  const registryCleanup = await moveTemplateInstances(root, plan.templateInstances, {
21210
21090
  apply: async () => {
@@ -21298,8 +21178,8 @@ function removalManifestChanges(contents, references) {
21298
21178
  path: file,
21299
21179
  before,
21300
21180
  after,
21301
- beforeHash: hash$1(before),
21302
- afterHash: hash$1(after),
21181
+ beforeHash: hash$2(before),
21182
+ afterHash: hash$2(after),
21303
21183
  fields: fields.sort()
21304
21184
  };
21305
21185
  });
@@ -21354,7 +21234,7 @@ async function removalReview(root, target, name, tracked, changes) {
21354
21234
  review.scanned.push(file);
21355
21235
  inputs.push({
21356
21236
  path: file,
21357
- hash: hash$1(original)
21237
+ hash: hash$2(original)
21358
21238
  });
21359
21239
  const content = changes.find((change) => change.path === file)?.after ?? original;
21360
21240
  const matches = values.filter((value) => content.includes(value));
@@ -21420,8 +21300,8 @@ async function planWorkspaceRemoval(cwd, options) {
21420
21300
  const reviewed = await removalReview(root, target.id, target.name, state.tracked, files);
21421
21301
  const inputs = new Map(reviewed.inputs.map((item) => [item.path, item.hash]));
21422
21302
  for (const [file, content] of contents) {
21423
- if (inputs.has(file) && inputs.get(file) !== hash$1(content)) throw new Error(`Removal input changed while planning: ${file}`);
21424
- inputs.set(file, hash$1(content));
21303
+ if (inputs.has(file) && inputs.get(file) !== hash$2(content)) throw new Error(`Removal input changed while planning: ${file}`);
21304
+ inputs.set(file, hash$2(content));
21425
21305
  }
21426
21306
  if (!isDeepStrictEqual(graph, await getWorkspaceGraph(root, {
21427
21307
  ignoreRootPackage: false,
@@ -21536,7 +21416,7 @@ async function cleanupRemovalRecovery(root, recovery, inventory) {
21536
21416
  }
21537
21417
  // src/commands/workspace/remove/verify.ts
21538
21418
  function validateRemovalPlan(plan) {
21539
- if (!record$6(plan) || plan.schemaVersion !== 1 || plan.kind !== "workspace-removal" || typeof plan.workspaceDir !== "string" || !record$6(plan.selection) || !record$6(plan.target) || typeof plan.target.id !== "string" || typeof plan.selection.target !== "string" || typeof plan.selection.removeReferences !== "boolean" || typeof plan.canApply !== "boolean" || !Array.isArray(plan.inputs) || !Array.isArray(plan.files) || !Array.isArray(plan.inventory) || !Array.isArray(plan.workspaces) || !Array.isArray(plan.blockers) || !record$6(plan.review) || !Array.isArray(plan.nextSteps) || plan.nextSteps.some((step) => typeof step !== "string") || plan.inputs.some((item) => !record$6(item) || typeof item.path !== "string" || typeof item.hash !== "string") || plan.files.some((item) => !record$6(item) || typeof item.path !== "string" || typeof item.before !== "string" || typeof item.after !== "string" || item.beforeHash !== hash$1(item.before) || item.afterHash !== hash$1(item.after) || !plan.inputs.some((input) => input.path === item.path && input.hash === item.beforeHash)) || plan.workspaces.some((item) => typeof item !== "string") || !plan.workspaces.includes(plan.target.id) || plan.selection.target !== `./${plan.target.id}` || plan.review.scope !== "git-tracked-text-literal-matches" || !Array.isArray(plan.review.scanned) || !Array.isArray(plan.review.matches) || !Array.isArray(plan.review.skipped) || new Set(plan.inputs.map((item) => item.path)).size !== plan.inputs.length || new Set(plan.files.map((item) => item.path)).size !== plan.files.length) throw new Error("Invalid workspace removal plan.");
21419
+ if (!record$6(plan) || plan.schemaVersion !== 1 || plan.kind !== "workspace-removal" || typeof plan.workspaceDir !== "string" || !record$6(plan.selection) || !record$6(plan.target) || typeof plan.target.id !== "string" || typeof plan.selection.target !== "string" || typeof plan.selection.removeReferences !== "boolean" || typeof plan.canApply !== "boolean" || !Array.isArray(plan.inputs) || !Array.isArray(plan.files) || !Array.isArray(plan.inventory) || !Array.isArray(plan.workspaces) || !Array.isArray(plan.blockers) || !record$6(plan.review) || !Array.isArray(plan.nextSteps) || plan.nextSteps.some((step) => typeof step !== "string") || plan.inputs.some((item) => !record$6(item) || typeof item.path !== "string" || typeof item.hash !== "string") || plan.files.some((item) => !record$6(item) || typeof item.path !== "string" || typeof item.before !== "string" || typeof item.after !== "string" || item.beforeHash !== hash$2(item.before) || item.afterHash !== hash$2(item.after) || !plan.inputs.some((input) => input.path === item.path && input.hash === item.beforeHash)) || plan.workspaces.some((item) => typeof item !== "string") || !plan.workspaces.includes(plan.target.id) || plan.selection.target !== `./${plan.target.id}` || plan.review.scope !== "git-tracked-text-literal-matches" || !Array.isArray(plan.review.scanned) || !Array.isArray(plan.review.matches) || !Array.isArray(plan.review.skipped) || new Set(plan.inputs.map((item) => item.path)).size !== plan.inputs.length || new Set(plan.files.map((item) => item.path)).size !== plan.files.length) throw new Error("Invalid workspace removal plan.");
21540
21420
  }
21541
21421
  async function verifyRemovalPostState(plan, requireHead = true) {
21542
21422
  const root = plan.workspaceDir;
@@ -21549,7 +21429,7 @@ async function verifyRemovalPostState(plan, requireHead = true) {
21549
21429
  for (const input of plan.inputs) {
21550
21430
  if (input.path.startsWith(`${plan.target.id}/`)) continue;
21551
21431
  const expected = plan.files.find((file) => file.path === input.path)?.afterHash ?? input.hash;
21552
- if (hash$1(await readInput(root, input.path)) !== expected) throw new Error(`Removal input changed: ${input.path}`);
21432
+ if (hash$2(await readInput(root, input.path)) !== expected) throw new Error(`Removal input changed: ${input.path}`);
21553
21433
  }
21554
21434
  const state = await workspaceGit(root, target);
21555
21435
  if (requireHead && !isDeepStrictEqual(state.git, plan.git)) throw new Error("Git HEAD or repository identity changed during removal.");