@akanjs/devkit 3.2.0-rc.14 → 3.2.0-rc.15

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 (249) hide show
  1. package/CHANGELOG.md +13 -1
  2. package/README.ko.md +3 -2
  3. package/README.md +4 -2
  4. package/akanApp/BackendImportGraph.test.ts +1 -1
  5. package/akanApp/akanApp.host.test.ts +1 -1
  6. package/akanApp/akanApp.host.ts +1 -1
  7. package/akanConfig/akanConfig.test.ts +1 -1
  8. package/akanConfig/akanConfig.ts +1 -1
  9. package/akanConfig/akanWorkspaceConfig.ts +1 -1
  10. package/akanConfig/productionLockfile.ts +1 -1
  11. package/apiReport/apiReport.test.ts +1 -1
  12. package/{applicationBuildRunner.test.ts → app/applicationBuildRunner.test.ts} +8 -8
  13. package/{applicationBuildRunner.ts → app/applicationBuildRunner.ts} +14 -14
  14. package/{applicationTestPreload.ts → app/applicationTestPreload.ts} +1 -1
  15. package/{routeJsBudget.test.ts → app/routeJsBudget.test.ts} +1 -1
  16. package/{routeJsBudget.ts → app/routeJsBudget.ts} +2 -2
  17. package/artifact/implicitRootLayout.test.ts +1 -1
  18. package/cloud/cloudApi.test.ts +1 -1
  19. package/cloud/configLock.test.ts +1 -1
  20. package/cloud/globalConfig.test.ts +1 -1
  21. package/cloud/globalConfig.ts +1 -1
  22. package/cloud/updatePackUpload.test.ts +1 -1
  23. package/codeAgent/agent/AkanCodeEnv.ts +1 -1
  24. package/codeAgent/agent/akanCodePaths.ts +1 -1
  25. package/codeAgent/agent/codeAgent.test.ts +1 -1
  26. package/codeAgent/skills/akan-debug/SKILL.md +8 -5
  27. package/codeAgent/tools/AkanCli.ts +1 -1
  28. package/codeAgent/tools/AkanToolPack.ts +1 -1
  29. package/codeAgent/tools/akanCodePlugins.test.ts +1 -1
  30. package/commandDecorators/command.ts +3 -3
  31. package/commandDecorators/commandDecorators.test.ts +1 -1
  32. package/commandDecorators/workspaceVersionCheck.test.ts +1 -1
  33. package/commandDecorators/workspaceVersionCheck.ts +1 -1
  34. package/{akanContext.ts → context/akanContext.ts} +8 -8
  35. package/{akanMcpContract.test.ts → context/akanMcpContract.test.ts} +1 -1
  36. package/{akanMcpContract.ts → context/akanMcpContract.ts} +5 -5
  37. package/{recipeScanner.test.ts → context/recipeScanner.test.ts} +1 -1
  38. package/devkitUtils.test.ts +5 -5
  39. package/{apiReference.test.ts → docs/apiReference.test.ts} +4 -4
  40. package/{apiReference.ts → docs/apiReference.ts} +2 -2
  41. package/{errorCodeReference.test.ts → docs/errorCodeReference.test.ts} +4 -4
  42. package/{errorCodeReference.ts → docs/errorCodeReference.ts} +2 -2
  43. package/{errorCodeScan.ts → docs/errorCodeScan.ts} +1 -1
  44. package/{frameworkGraph.test.ts → docs/frameworkGraph.test.ts} +1 -1
  45. package/executors/appExecutor.ts +5 -5
  46. package/executors/executor.ts +9 -9
  47. package/{executors.linkFallback.test.ts → executors/executors.linkFallback.test.ts} +1 -1
  48. package/{executors.test.ts → executors/executors.test.ts} +11 -18
  49. package/executors/index.ts +8 -0
  50. package/executors/pkgExecutor.ts +2 -2
  51. package/executors/sysExecutor.ts +8 -8
  52. package/executors/workspaceExecutor.ts +4 -4
  53. package/frontendBuild/allRoutesBuilder.test.ts +1 -1
  54. package/frontendBuild/autoImportSync.test.ts +1 -1
  55. package/frontendBuild/autoImportSync.ts +1 -1
  56. package/frontendBuild/buildRouteClient.test.ts +1 -1
  57. package/frontendBuild/clientEntriesBundler.test.ts +1 -1
  58. package/frontendBuild/csrArtifactBuilder.test.ts +1 -1
  59. package/frontendBuild/csrDevArtifactWriter.ts +1 -1
  60. package/frontendBuild/cssCompiler.test.ts +1 -1
  61. package/frontendBuild/devGeneratedIndexSync.test.ts +1 -1
  62. package/frontendBuild/devGeneratedIndexSync.ts +1 -1
  63. package/frontendBuild/dictionaryAssetBuilder.test.ts +1 -1
  64. package/frontendBuild/fontOptimizer.test.ts +1 -1
  65. package/frontendBuild/fontPruner.test.ts +1 -1
  66. package/frontendBuild/frontendBuild.test.ts +1 -1
  67. package/frontendBuild/hmrWatcher.test.ts +1 -1
  68. package/frontendBuild/mcpAppViewBuilder.test.ts +1 -1
  69. package/frontendBuild/mcpAppViewBuilder.ts +1 -1
  70. package/frontendBuild/nativeCore.test.ts +1 -1
  71. package/frontendBuild/optionalPeers.test.ts +1 -1
  72. package/frontendBuild/precompressArtifacts.test.ts +1 -1
  73. package/frontendBuild/serverGraphFile.ts +1 -1
  74. package/frontendBuild/sourceMtimeIndex.test.ts +1 -1
  75. package/frontendBuild/ssrDevBundler.test.ts +1 -1
  76. package/frontendBuild/vendorImportScanner.test.ts +1 -1
  77. package/frontendBuild/vendorNarrowing.test.ts +1 -1
  78. package/frontendBuild/watchRootResolver.test.ts +1 -1
  79. package/{agentAssets.test.ts → guideline/agentAssets.test.ts} +1 -1
  80. package/{agentAssets.ts → guideline/agentAssets.ts} +1 -1
  81. package/{agentsIndex.test.ts → guideline/agentsIndex.test.ts} +2 -2
  82. package/{agentsIndex.ts → guideline/agentsIndex.ts} +12 -9
  83. package/{conventionSet.test.ts → guideline/conventionSet.test.ts} +3 -3
  84. package/{prompter.ts → guideline/prompter.ts} +2 -3
  85. package/incrementalBuilder/buildBatch.proc.ts +1 -1
  86. package/incrementalBuilder/buildBatchRunner.test.ts +1 -1
  87. package/incrementalBuilder/builderChannel.test.ts +1 -1
  88. package/incrementalBuilder/builderGraphPayloads.ts +3 -3
  89. package/incrementalBuilder/incrementalBuilder.proc.test.ts +1 -1
  90. package/incrementalBuilder/incrementalBuilder.proc.ts +2 -2
  91. package/index.ts +22 -22
  92. package/integration/devStabilityHarness.test.ts +1 -1
  93. package/{biomeBase.test.ts → lint/biomeBase.test.ts} +1 -1
  94. package/lint/gritRules.test.ts +1 -1
  95. package/{linter.test.ts → lint/linter.test.ts} +1 -1
  96. package/mobile/desktopBin.test.ts +1 -1
  97. package/mobile/desktopRelease.test.ts +1 -1
  98. package/mobile/desktopServerStage.test.ts +2 -2
  99. package/mobile/desktopServerStage.ts +1 -1
  100. package/mobile/nativeApi.test.ts +1 -1
  101. package/mobile/nativeApp.test.ts +1 -1
  102. package/mobile/nativeConfig.test.ts +1 -1
  103. package/mobile/nativePluginFolders.test.ts +1 -1
  104. package/mobile/nativePublicEnv.test.ts +1 -1
  105. package/mobile/nativeWebDir.test.ts +1 -1
  106. package/mobile/serverBundleSecrets.test.ts +1 -1
  107. package/mobile/tarWriter.test.ts +1 -1
  108. package/mobile/updatePackFolder.test.ts +1 -1
  109. package/package.json +167 -3
  110. package/packageExports.test.ts +20 -2
  111. package/piDependencyPins.test.ts +1 -1
  112. package/pipeline/PipelineDefinition.ts +1 -1
  113. package/platformTest/IdleWatchedProcess.test.ts +1 -1
  114. package/platformTest/PlatformTestRun.test.ts +1 -1
  115. package/platformTest/TestSnapshot.test.ts +1 -1
  116. package/{abstractDoc.test.ts → quality/abstractDoc.test.ts} +2 -2
  117. package/{abstractDoc.ts → quality/abstractDoc.ts} +1 -1
  118. package/{maintainabilityBaseline.test.ts → quality/maintainabilityBaseline.test.ts} +24 -0
  119. package/{maintainabilityBaseline.ts → quality/maintainabilityBaseline.ts} +24 -1
  120. package/{maintainabilityContract.test.ts → quality/maintainabilityContract.test.ts} +82 -2
  121. package/{maintainabilityContract.ts → quality/maintainabilityContract.ts} +65 -8
  122. package/{maintainabilityExceptionScanner.test.ts → quality/maintainabilityExceptionScanner.test.ts} +1 -1
  123. package/{qualityScanner.test.ts → quality/qualityScanner.test.ts} +1 -1
  124. package/{qualityScanner.ts → quality/qualityScanner.ts} +8 -8
  125. package/{subspace.test.ts → subspace/subspace.test.ts} +3 -3
  126. package/{subspace.ts → subspace/subspace.ts} +4 -4
  127. package/{subspaceClone.ts → subspace/subspaceClone.ts} +5 -5
  128. package/{subspaceConfig.ts → subspace/subspaceConfig.ts} +1 -1
  129. package/{testHelpers.ts → test/testHelpers.ts} +1 -1
  130. package/transforms/browserDirnamePlugin.test.ts +1 -1
  131. package/transforms/externalizeFrameworkPlugin.test.ts +1 -1
  132. package/transforms/mcpAppPageTrimmer.test.ts +1 -1
  133. package/transforms/pureLazyMarker.test.ts +1 -1
  134. package/transforms/serverEnvPlugin.test.ts +1 -1
  135. package/transforms/serverEnvProfile.test.ts +1 -1
  136. package/transforms/sideEffectImportOrder.test.ts +1 -1
  137. package/transforms/transforms.test.ts +2 -2
  138. package/transforms/tsconfigPackageResolver.test.ts +1 -1
  139. package/{createTunnel.test.ts → tunnel/createTunnel.test.ts} +1 -1
  140. package/{createTunnel.ts → tunnel/createTunnel.ts} +2 -2
  141. package/{sshHostKeys.ts → tunnel/sshHostKeys.ts} +2 -2
  142. package/typecheck/projectTypecheck.test.ts +1 -1
  143. package/typecheck/projectTypecheck.ts +1 -1
  144. package/{typeChecker.test.ts → typecheck/typeChecker.test.ts} +1 -1
  145. package/{typeChecker.ts → typecheck/typeChecker.ts} +1 -1
  146. package/typecheck/typecheck.proc.ts +1 -1
  147. package/typecheck/typecheckFailure.ts +1 -1
  148. package/{jsonFormatter.test.ts → util/jsonFormatter.test.ts} +1 -1
  149. package/workflow/executor.ts +1 -1
  150. package/workflow/guardCatalog.test.ts +1 -1
  151. package/workflow/moduleIndex.test.ts +2 -2
  152. package/workflow/moduleIndex.ts +1 -1
  153. package/workflow/rolloutGate.test.ts +1 -1
  154. package/workflow/rolloutGate.ts +1 -1
  155. package/{appSelectionMemory.ts → workspace/appSelectionMemory.ts} +1 -1
  156. package/{codegenLock.test.ts → workspace/codegenLock.test.ts} +1 -1
  157. package/{dependencyScanner.test.ts → workspace/dependencyScanner.test.ts} +1 -1
  158. package/{dependencyScanner.ts → workspace/dependencyScanner.ts} +2 -2
  159. package/{envSeed.test.ts → workspace/envSeed.test.ts} +2 -2
  160. package/{envSeed.ts → workspace/envSeed.ts} +1 -1
  161. package/{libSource.test.ts → workspace/libSource.test.ts} +2 -2
  162. package/{libSource.ts → workspace/libSource.ts} +1 -1
  163. package/{scanInfo.ts → workspace/scanInfo.ts} +7 -7
  164. package/{slicePlanner.test.ts → workspace/slicePlanner.test.ts} +2 -2
  165. package/{slicePlanner.ts → workspace/slicePlanner.ts} +1 -1
  166. package/{workspaceGraph.test.ts → workspace/workspaceGraph.test.ts} +1 -1
  167. package/{workspaceGraph.ts → workspace/workspaceGraph.ts} +1 -1
  168. package/{workspaceLayout.test.ts → workspace/workspaceLayout.test.ts} +1 -1
  169. package/executors.ts +0 -8
  170. /package/{applicationBuildReporter.test.ts → app/applicationBuildReporter.test.ts} +0 -0
  171. /package/{applicationBuildReporter.ts → app/applicationBuildReporter.ts} +0 -0
  172. /package/{routeSourceValidator.test.ts → app/routeSourceValidator.test.ts} +0 -0
  173. /package/{routeSourceValidator.ts → app/routeSourceValidator.ts} +0 -0
  174. /package/{akanMcpToolError.ts → context/akanMcpToolError.ts} +0 -0
  175. /package/{moduleFieldNames.test.ts → context/moduleFieldNames.test.ts} +0 -0
  176. /package/{moduleFieldNames.ts → context/moduleFieldNames.ts} +0 -0
  177. /package/{recipeScanner.ts → context/recipeScanner.ts} +0 -0
  178. /package/{declarationReader.ts → docs/declarationReader.ts} +0 -0
  179. /package/{frameworkGraph.ts → docs/frameworkGraph.ts} +0 -0
  180. /package/{conventionSet.ts → guideline/conventionSet.ts} +0 -0
  181. /package/{biomeBase.ts → lint/biomeBase.ts} +0 -0
  182. /package/{linter.ts → lint/linter.ts} +0 -0
  183. /package/{bareErrorScanner.ts → quality/bareErrorScanner.ts} +0 -0
  184. /package/{commentDensityScanner.test.ts → quality/commentDensityScanner.test.ts} +0 -0
  185. /package/{commentDensityScanner.ts → quality/commentDensityScanner.ts} +0 -0
  186. /package/{componentSizeScanner.test.ts → quality/componentSizeScanner.test.ts} +0 -0
  187. /package/{componentSizeScanner.ts → quality/componentSizeScanner.ts} +0 -0
  188. /package/{componentWriteChainScanner.test.ts → quality/componentWriteChainScanner.test.ts} +0 -0
  189. /package/{componentWriteChainScanner.ts → quality/componentWriteChainScanner.ts} +0 -0
  190. /package/{deprecatedCommentScanner.test.ts → quality/deprecatedCommentScanner.test.ts} +0 -0
  191. /package/{deprecatedCommentScanner.ts → quality/deprecatedCommentScanner.ts} +0 -0
  192. /package/{endpointReach.test.ts → quality/endpointReach.test.ts} +0 -0
  193. /package/{endpointReach.ts → quality/endpointReach.ts} +0 -0
  194. /package/{formSetterScanner.test.ts → quality/formSetterScanner.test.ts} +0 -0
  195. /package/{formSetterScanner.ts → quality/formSetterScanner.ts} +0 -0
  196. /package/{kindBranchScanner.test.ts → quality/kindBranchScanner.test.ts} +0 -0
  197. /package/{kindBranchScanner.ts → quality/kindBranchScanner.ts} +0 -0
  198. /package/{maintainabilityExceptionScanner.ts → quality/maintainabilityExceptionScanner.ts} +0 -0
  199. /package/{maintainabilityLimits.ts → quality/maintainabilityLimits.ts} +0 -0
  200. /package/{maintainabilityReport.test.ts → quality/maintainabilityReport.test.ts} +0 -0
  201. /package/{maintainabilityReport.ts → quality/maintainabilityReport.ts} +0 -0
  202. /package/{renderMutationScanner.test.ts → quality/renderMutationScanner.test.ts} +0 -0
  203. /package/{renderMutationScanner.ts → quality/renderMutationScanner.ts} +0 -0
  204. /package/{serviceLoopCallScanner.test.ts → quality/serviceLoopCallScanner.test.ts} +0 -0
  205. /package/{serviceLoopCallScanner.ts → quality/serviceLoopCallScanner.ts} +0 -0
  206. /package/{signalMutationIndex.test.ts → quality/signalMutationIndex.test.ts} +0 -0
  207. /package/{signalMutationIndex.ts → quality/signalMutationIndex.ts} +0 -0
  208. /package/{sourceComments.test.ts → quality/sourceComments.test.ts} +0 -0
  209. /package/{sourceComments.ts → quality/sourceComments.ts} +0 -0
  210. /package/{ssrScanner.test.ts → quality/ssrScanner.test.ts} +0 -0
  211. /package/{ssrScanner.ts → quality/ssrScanner.ts} +0 -0
  212. /package/{storeAccessScanner.test.ts → quality/storeAccessScanner.test.ts} +0 -0
  213. /package/{storeAccessScanner.ts → quality/storeAccessScanner.ts} +0 -0
  214. /package/{storeSource.ts → quality/storeSource.ts} +0 -0
  215. /package/{storeWriteScanner.test.ts → quality/storeWriteScanner.test.ts} +0 -0
  216. /package/{storeWriteScanner.ts → quality/storeWriteScanner.ts} +0 -0
  217. /package/{structureScanner.test.ts → quality/structureScanner.test.ts} +0 -0
  218. /package/{structureScanner.ts → quality/structureScanner.ts} +0 -0
  219. /package/{testOnlyExportScanner.test.ts → quality/testOnlyExportScanner.test.ts} +0 -0
  220. /package/{testOnlyExportScanner.ts → quality/testOnlyExportScanner.ts} +0 -0
  221. /package/{writePath.test.ts → quality/writePath.test.ts} +0 -0
  222. /package/{writePath.ts → quality/writePath.ts} +0 -0
  223. /package/{writePlacementScanner.test.ts → quality/writePlacementScanner.test.ts} +0 -0
  224. /package/{writePlacementScanner.ts → quality/writePlacementScanner.ts} +0 -0
  225. /package/{writingActionIndex.test.ts → quality/writingActionIndex.test.ts} +0 -0
  226. /package/{writingActionIndex.ts → quality/writingActionIndex.ts} +0 -0
  227. /package/{subspaceReport.ts → subspace/subspaceReport.ts} +0 -0
  228. /package/{sshTunnel.ts → tunnel/sshTunnel.ts} +0 -0
  229. /package/{fileEditor.ts → util/fileEditor.ts} +0 -0
  230. /package/{fileSys.test.ts → util/fileSys.test.ts} +0 -0
  231. /package/{fileSys.ts → util/fileSys.ts} +0 -0
  232. /package/{jsonFormatter.ts → util/jsonFormatter.ts} +0 -0
  233. /package/{selectModel.ts → util/selectModel.ts} +0 -0
  234. /package/{semver.test.ts → util/semver.test.ts} +0 -0
  235. /package/{semver.ts → util/semver.ts} +0 -0
  236. /package/{shellOnlyEnv.test.ts → util/shellOnlyEnv.test.ts} +0 -0
  237. /package/{shellOnlyEnv.ts → util/shellOnlyEnv.ts} +0 -0
  238. /package/{spinner.test.ts → util/spinner.test.ts} +0 -0
  239. /package/{spinner.ts → util/spinner.ts} +0 -0
  240. /package/{stripAnsi.ts → util/stripAnsi.ts} +0 -0
  241. /package/{codegenLock.ts → workspace/codegenLock.ts} +0 -0
  242. /package/{getRelatedCnsts.ts → workspace/getRelatedCnsts.ts} +0 -0
  243. /package/{gitRevision.test.ts → workspace/gitRevision.test.ts} +0 -0
  244. /package/{gitRevision.ts → workspace/gitRevision.ts} +0 -0
  245. /package/{manifestDependencies.ts → workspace/manifestDependencies.ts} +0 -0
  246. /package/{packageExportsMap.ts → workspace/packageExportsMap.ts} +0 -0
  247. /package/{repoIdentity.ts → workspace/repoIdentity.ts} +0 -0
  248. /package/{types.ts → workspace/types.ts} +0 -0
  249. /package/{workspaceLayout.ts → workspace/workspaceLayout.ts} +0 -0
@@ -1,5 +1,5 @@
1
1
  import path from "node:path";
2
- import type { SysExecutor } from "./executors";
2
+ import type { SysExecutor } from "../executors";
3
3
 
4
4
  export type AbstractKind = "domain" | "service" | "scalar" | "other";
5
5
 
@@ -225,6 +225,30 @@ describe("MaintainabilityBaseline", () => {
225
225
  expect(baseline.tightenedBy([]).reasons.size).toBe(0);
226
226
  });
227
227
 
228
+ test("moves a moved file's entries and reasons to its new path, matching the file before the first #", () => {
229
+ const reason = "The canvas is one pointer state machine.";
230
+ const baseline = baselineOf(
231
+ {
232
+ "akan.size.file": { "lib/a/A.Zone.tsx": 900, "lib/a/A.Zone.tsxx": 700 },
233
+ "akan.component.store-access": { "lib/a/A.Zone.tsx#Canvas": 30, "lib/a/A.Zone.tsx#Canvas#2": 25 },
234
+ },
235
+ { "lib/a/A.Zone.tsx#Canvas": reason },
236
+ );
237
+
238
+ const moved = baseline.movedBy(new Map([["lib/a/A.Zone.tsx", "lib/b/A.Zone.tsx"]]));
239
+
240
+ expect([...(moved.sections.get("akan.size.file") ?? [])]).toEqual([
241
+ ["lib/b/A.Zone.tsx", 900],
242
+ ["lib/a/A.Zone.tsxx", 700],
243
+ ]);
244
+ expect([...(moved.sections.get("akan.component.store-access") ?? [])]).toEqual([
245
+ ["lib/b/A.Zone.tsx#Canvas", 30],
246
+ ["lib/b/A.Zone.tsx#Canvas#2", 25],
247
+ ]);
248
+ expect([...moved.reasons]).toEqual([["lib/b/A.Zone.tsx#Canvas", reason]]);
249
+ expect(baseline.movedBy(new Map())).toBe(baseline);
250
+ });
251
+
228
252
  test("holds a total rule to the sum of its section: a moved count passes, a raised sum names the files that rose", () => {
229
253
  const baseline = baselineOf({ "akan.error.bare-error": { "server/a.ts": 2, "server/b.ts": 1 } });
230
254
 
@@ -1,4 +1,4 @@
1
- import { JsonFormatter } from "./jsonFormatter";
1
+ import { JsonFormatter } from "../util/jsonFormatter";
2
2
  import type { DebtRuleId, MaintainabilityViolation } from "./maintainabilityContract";
3
3
 
4
4
  export interface BaselineEntryGrowth {
@@ -194,6 +194,29 @@ export class MaintainabilityBaseline {
194
194
  return new MaintainabilityBaseline(sections, this.reasons);
195
195
  }
196
196
 
197
+ movedBy(moves: ReadonlyMap<string, string>) {
198
+ if (!moves.size) return this;
199
+ const movedKey = (key: string) => {
200
+ const file = key.split("#", 1)[0] ?? key;
201
+ const to = moves.get(file);
202
+ return to === undefined ? key : `${to}${key.slice(file.length)}`;
203
+ };
204
+ const sections = new Map(
205
+ [...this.sections].map(([rule, counts]) => {
206
+ const moved = new Map<string, number>();
207
+ for (const [key, count] of counts) {
208
+ const to = movedKey(key);
209
+ moved.set(to, Math.max(moved.get(to) ?? 0, count));
210
+ }
211
+ return [rule, moved];
212
+ }),
213
+ );
214
+ return new MaintainabilityBaseline(
215
+ sections,
216
+ new Map([...this.reasons].map(([key, reason]) => [movedKey(key), reason])),
217
+ );
218
+ }
219
+
197
220
  tightenedBy(violations: MaintainabilityViolation[]) {
198
221
  const current = MaintainabilityBaseline.of(violations);
199
222
  const sections = new Map(
@@ -1,11 +1,11 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { existsSync } from "node:fs";
3
- import { readFile, rm } from "node:fs/promises";
3
+ import { mkdir, readFile, rename, rm } from "node:fs/promises";
4
4
  import path from "node:path";
5
+ import { tempDirs, writeText } from "../test/testHelpers";
5
6
  import { MaintainabilityBaseline } from "./maintainabilityBaseline";
6
7
  import { MaintainabilityContract } from "./maintainabilityContract";
7
8
  import { MaintainabilityLimits } from "./maintainabilityLimits";
8
- import { tempDirs, writeText } from "./testHelpers";
9
9
 
10
10
  const makeTempRoot = tempDirs("akan-maintainability-");
11
11
 
@@ -957,6 +957,86 @@ describe("MaintainabilityContract packages", () => {
957
957
  " function: Split it by family into named functions or a collaborator class, each under the limit, keeping its signature for callers.",
958
958
  );
959
959
  });
960
+
961
+ test("keeps a moved file's entries under its new path, and still fails one that grew in the move", async () => {
962
+ const recordOf = (key: string, count: number, reason?: string) =>
963
+ `{\n "akan.size.function": {\n ${JSON.stringify(key)}: ${count}\n }${reason ? `,\n "reasons": {\n ${JSON.stringify(key)}: ${JSON.stringify(reason)}\n }` : ""}\n}\n`;
964
+ const reason = "boot reads every flag in one pass";
965
+ const root = await makeWorkspace({
966
+ "pkgs/@demo/core/server/host.ts": functionOf("boot", 200),
967
+ "pkgs/@demo/core/akan.baseline.json": recordOf("server/host.ts#boot", 200, reason),
968
+ });
969
+ await commitAll(root);
970
+ await mkdir(path.join(root, "pkgs/@demo/core/gateway"));
971
+ await git(root, "mv", "pkgs/@demo/core/server/host.ts", "pkgs/@demo/core/gateway/host.ts");
972
+ const baselinePath = path.join(root, "pkgs/@demo/core/akan.baseline.json");
973
+
974
+ expect(await packageOf(root).enforce({ fix: true })).toEqual([]);
975
+ expect(await readFile(baselinePath, "utf8")).toBe(recordOf("gateway/host.ts#boot", 200, reason));
976
+
977
+ expect(await packageOf(root).enforce({ fix: false })).toEqual([]);
978
+
979
+ await writeText(path.join(root, "pkgs/@demo/core/gateway/host.ts"), functionOf("boot", 210));
980
+ await writeText(baselinePath, recordOf("gateway/host.ts#boot", 210));
981
+ expect(await packageOf(root).enforce({ fix: false })).toMatchObject([
982
+ { kind: "baselineGrowth", key: "gateway/host.ts#boot", count: 210, committed: 200 },
983
+ ]);
984
+ });
985
+
986
+ test("follows a move git has not staged, without staging it, and reads an entry left at the old key as the reference's", async () => {
987
+ const recordOf = (key: string) => `{\n "akan.size.function": {\n ${JSON.stringify(key)}: 200\n }\n}\n`;
988
+ const root = await makeWorkspace({
989
+ "pkgs/@demo/core/server/host.ts": functionOf("boot", 200),
990
+ "pkgs/@demo/core/akan.baseline.json": recordOf("server/host.ts#boot"),
991
+ });
992
+ await commitAll(root);
993
+ await mkdir(path.join(root, "pkgs/@demo/core/gateway"));
994
+ await rename(path.join(root, "pkgs/@demo/core/server/host.ts"), path.join(root, "pkgs/@demo/core/gateway/host.ts"));
995
+
996
+ expect(await packageOf(root).enforce({ fix: false })).toMatchObject([
997
+ { rule: "akan.size.function", key: "gateway/host.ts#boot" },
998
+ ]);
999
+ expect(Bun.spawnSync(["git", "status", "--porcelain"], { cwd: root }).stdout.toString()).toBe(
1000
+ " D pkgs/@demo/core/server/host.ts\n?? pkgs/@demo/core/gateway/\n",
1001
+ );
1002
+
1003
+ await writeText(path.join(root, "pkgs/@demo/core/gateway/host.ts"), functionOf("boot", 120));
1004
+ expect(await packageOf(root).enforce({ fix: false })).toEqual([]);
1005
+
1006
+ await writeText(path.join(root, "pkgs/@demo/core/gateway/host.ts"), functionOf("boot", 200));
1007
+ expect(await packageOf(root).enforce({ fix: true })).toEqual([]);
1008
+ expect(await readFile(path.join(root, "pkgs/@demo/core/akan.baseline.json"), "utf8")).toBe(
1009
+ recordOf("gateway/host.ts#boot"),
1010
+ );
1011
+ });
1012
+
1013
+ test("still reads a staged move where it cannot stage, and stores no untracked file but a source", async () => {
1014
+ const recordOf = (key: string) => `{\n "akan.size.function": {\n ${JSON.stringify(key)}: 200\n }\n}\n`;
1015
+ const root = await makeWorkspace({
1016
+ "pkgs/@demo/core/server/host.ts": functionOf("boot", 200),
1017
+ "pkgs/@demo/core/akan.baseline.json": recordOf("server/host.ts#boot"),
1018
+ });
1019
+ await commitAll(root);
1020
+ await mkdir(path.join(root, "pkgs/@demo/core/gateway"));
1021
+ await git(root, "mv", "pkgs/@demo/core/server/host.ts", "pkgs/@demo/core/gateway/host.ts");
1022
+ await writeText(path.join(root, "pkgs/@demo/core/local.db"), "rows that change on every run");
1023
+
1024
+ const tmpdirBefore = process.env.TMPDIR;
1025
+ process.env.TMPDIR = path.join(root, "missing-tmp");
1026
+ try {
1027
+ expect(await packageOf(root).enforce({ fix: true })).toEqual([]);
1028
+ } finally {
1029
+ if (tmpdirBefore === undefined) delete process.env.TMPDIR;
1030
+ else process.env.TMPDIR = tmpdirBefore;
1031
+ }
1032
+ expect(await readFile(path.join(root, "pkgs/@demo/core/akan.baseline.json"), "utf8")).toBe(
1033
+ recordOf("gateway/host.ts#boot"),
1034
+ );
1035
+
1036
+ expect(await packageOf(root).enforce({ fix: false })).toEqual([]);
1037
+ const hash = Bun.spawnSync(["git", "hash-object", "pkgs/@demo/core/local.db"], { cwd: root }).stdout.toString();
1038
+ expect(Bun.spawnSync(["git", "cat-file", "-e", hash.trim()], { cwd: root }).exitCode).not.toBe(0);
1039
+ });
960
1040
  });
961
1041
 
962
1042
  describe("MaintainabilityContract bare errors", () => {
@@ -1,12 +1,13 @@
1
1
  import { existsSync } from "node:fs";
2
- import { readFile, rm, writeFile } from "node:fs/promises";
2
+ import { copyFile, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
3
+ import { tmpdir } from "node:os";
3
4
  import path from "node:path";
4
5
  import ts from "typescript";
6
+ import { GitRevision } from "../workspace/gitRevision";
5
7
  import { BareErrorScanner } from "./bareErrorScanner";
6
8
  import { ComponentSizeScanner } from "./componentSizeScanner";
7
9
  import { ComponentWriteChainScanner } from "./componentWriteChainScanner";
8
10
  import { EndpointReach } from "./endpointReach";
9
- import { GitRevision } from "./gitRevision";
10
11
  import { MaintainabilityBaseline } from "./maintainabilityBaseline";
11
12
  import { MaintainabilityLimits } from "./maintainabilityLimits";
12
13
  import { MaintainabilityReport } from "./maintainabilityReport";
@@ -199,10 +200,12 @@ export class MaintainabilityContract {
199
200
  this.#readBaseline(),
200
201
  this.#readReferenceBaseline(),
201
202
  ]);
202
- const baseline =
203
+ const moves = await this.#movesSince(reference.ref);
204
+ const onDisk =
203
205
  existing === null ? new MaintainabilityBaseline() : MaintainabilityBaseline.parse(existing, this.baselinePath);
206
+ const baseline = fix ? onDisk.movedBy(moves) : onDisk;
204
207
  const tightened = baseline.tightenedBy(violations);
205
- if (fix && existing !== null) await this.#tighten(baseline, tightened);
208
+ if (fix && existing !== null) await this.#tighten(onDisk, tightened);
206
209
  //? Without fix the file on disk is what merges, so an entry it holds above the measured count is checked as written.
207
210
  const working = fix ? tightened : baseline;
208
211
  const lines = ((await this.#readBaseline()) ?? "").split(/\r?\n/);
@@ -229,8 +232,9 @@ export class MaintainabilityContract {
229
232
  const unrecorded = new Set(working.rulesOutside(recorded));
230
233
  const measured = unrecorded.size ? await this.#measuredAt(reference.ref) : null;
231
234
  if (recorded === null && measured === null) return failures;
232
- const committed = (recorded ?? new MaintainabilityBaseline()).withSectionsOf(measured, unrecorded);
233
- const growths = working
235
+ const committed = (recorded ?? new MaintainabilityBaseline()).withSectionsOf(measured, unrecorded).movedBy(moves);
236
+ //? Without fix the entries on disk keep their old keys, so they are compared under the moved ones the reference took.
237
+ const growths = (fix ? working : working.movedBy(moves))
234
238
  .grownFrom(committed)
235
239
  .map(
236
240
  ({ rule, ...growth }): BaselineGrowth => ({
@@ -519,6 +523,53 @@ export class MaintainabilityContract {
519
523
  return "HEAD";
520
524
  }
521
525
 
526
+ //? A move that also rewrote more than half the file, or left a file at the old path, reads as an add and fails as new.
527
+ async #movesSince(ref: string) {
528
+ const staged = await this.#stagedScope();
529
+ try {
530
+ const diff = ["diff", ...(staged ? ["--cached"] : []), "--relative", "--name-status", "-z", "-M", ref];
531
+ const fields = (await this.#git([...diff, "--", this.sysPath], staged?.env))?.split("\0") ?? [];
532
+ const prefix = `${this.sysPath}/`;
533
+ const moves = new Map<string, string>();
534
+ for (let idx = 0; idx < fields.length; idx += fields[idx]?.startsWith("R") ? 3 : 2) {
535
+ const [from, to] = [fields[idx + 1], fields[idx + 2]];
536
+ if (!fields[idx]?.startsWith("R") || !from?.startsWith(prefix) || !to?.startsWith(prefix)) continue;
537
+ moves.set(from.slice(prefix.length), to.slice(prefix.length));
538
+ }
539
+ return moves;
540
+ } finally {
541
+ if (staged) await rm(staged.dir, { recursive: true, force: true });
542
+ }
543
+ }
544
+
545
+ //? Git pairs moves only between staged paths, so a plain rename is staged too, in a copy of the user's index.
546
+ async #stagedScope() {
547
+ const indexPath = (await this.#git(["rev-parse", "--git-path", "index"]))?.trim();
548
+ //? Only sources: staging writes each file into .git/objects, where a local database or a log would pile up.
549
+ const untracked = (await this.#git(["ls-files", "-o", "--exclude-standard", "-z", "--", this.sysPath]))
550
+ ?.split("\0")
551
+ .filter((file) => /\.(tsx?|md)$/.test(file));
552
+ if (!indexPath || !untracked) return null;
553
+ const dir = await mkdtemp(path.join(tmpdir(), "akan-moves-")).catch(() => null);
554
+ if (!dir) return null;
555
+ const env = { GIT_INDEX_FILE: path.join(dir, "index") };
556
+ const listPath = path.join(dir, "untracked");
557
+ try {
558
+ const indexFile = path.resolve(this.#workspaceRoot, indexPath);
559
+ if (existsSync(indexFile)) await copyFile(indexFile, env.GIT_INDEX_FILE);
560
+ await writeFile(listPath, untracked.join("\0"));
561
+ const added =
562
+ (await this.#git(["add", "-u", "--", this.sysPath], env)) !== null &&
563
+ (!untracked.length ||
564
+ (await this.#git(["add", "--pathspec-from-file", listPath, "--pathspec-file-nul"], env)) !== null);
565
+ if (added) return { dir, env };
566
+ } catch {
567
+ //? A full or read-only temp dir: fall back to the moves the user's own index holds.
568
+ }
569
+ await rm(dir, { recursive: true, force: true });
570
+ return null;
571
+ }
572
+
522
573
  static #missingHistory(sysPath: string, cause: string) {
523
574
  return (
524
575
  `${sysPath}/${MaintainabilityBaseline.fileName} is compared with its copy where this branch forked from the default branch, ` +
@@ -526,9 +577,15 @@ export class MaintainabilityContract {
526
577
  );
527
578
  }
528
579
 
529
- async #git(args: string[]) {
580
+ //? GIT_OPTIONAL_LOCKS=0 keeps a read from refreshing the index under the user's own git, which would then fail on index.lock.
581
+ async #git(args: string[], env: Record<string, string> = {}) {
530
582
  try {
531
- const proc = Bun.spawn(["git", ...args], { cwd: this.#workspaceRoot, stdout: "pipe", stderr: "ignore" });
583
+ const proc = Bun.spawn(["git", ...args], {
584
+ cwd: this.#workspaceRoot,
585
+ env: { ...process.env, GIT_OPTIONAL_LOCKS: "0", ...env },
586
+ stdout: "pipe",
587
+ stderr: "ignore",
588
+ });
532
589
  const [text, exitCode] = await Promise.all([new Response(proc.stdout).text(), proc.exited]);
533
590
  return exitCode === 0 ? text : null;
534
591
  } catch {
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
+ import { tempDirs, writeText } from "../test/testHelpers";
3
4
  import { MaintainabilityExceptionScanner } from "./maintainabilityExceptionScanner";
4
- import { tempDirs, writeText } from "./testHelpers";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-maintainability-exceptions-");
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
+ import { tempDirs, writeText } from "../test/testHelpers";
3
4
  import { AbstractDoc } from "./abstractDoc";
4
5
  import { AkanQualityScanner, type QualityScanResult } from "./qualityScanner";
5
- import { tempDirs, writeText } from "./testHelpers";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-quality-scanner-");
8
8
 
@@ -4,6 +4,14 @@ import path from "node:path";
4
4
  import { RESERVED_ROUTE_CONFIG_EXPORTS } from "akanjs/common";
5
5
  import ignore from "ignore";
6
6
  import ts from "typescript";
7
+ import {
8
+ facetIndexShadowOf,
9
+ isAllowedLibFacetRootFile,
10
+ libFacetRootHintOf,
11
+ rootAllowedDirs,
12
+ rootAllowedFiles,
13
+ rootEntryHintOf,
14
+ } from "../workspace/workspaceLayout";
7
15
  import { AbstractDoc } from "./abstractDoc";
8
16
  import { CommentDensityScanner } from "./commentDensityScanner";
9
17
  import { DeprecatedCommentScanner } from "./deprecatedCommentScanner";
@@ -12,14 +20,6 @@ import { KindBranchScanner } from "./kindBranchScanner";
12
20
  import { MaintainabilityExceptionScanner } from "./maintainabilityExceptionScanner";
13
21
  import { fileWarning, formatSsrBalance, type SsrBalanceEntry, SsrScanner } from "./ssrScanner";
14
22
  import { TestOnlyExportScanner } from "./testOnlyExportScanner";
15
- import {
16
- facetIndexShadowOf,
17
- isAllowedLibFacetRootFile,
18
- libFacetRootHintOf,
19
- rootAllowedDirs,
20
- rootAllowedFiles,
21
- rootEntryHintOf,
22
- } from "./workspaceLayout";
23
23
 
24
24
  type QualitySeverity = "warning";
25
25
  type QualityScope = "global" | "file" | "convention" | "layout" | "ssr" | "agent" | "comment";
@@ -1,13 +1,13 @@
1
1
  import { describe, expect, setDefaultTimeout, test } from "bun:test";
2
2
  import { mkdir, readdir, rm } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { Executor, WorkspaceExecutor } from "./executors";
5
- import { FileSys } from "./fileSys";
4
+ import { Executor, WorkspaceExecutor } from "../executors";
5
+ import { isolateEnv, tempDirs, writeText as write } from "../test/testHelpers";
6
+ import { FileSys } from "../util/fileSys";
6
7
  import { Subspace } from "./subspace";
7
8
  import { SubspaceClone } from "./subspaceClone";
8
9
  import { SubspaceConfig } from "./subspaceConfig";
9
10
  import { SubspaceReport } from "./subspaceReport";
10
- import { isolateEnv, tempDirs, writeText as write } from "./testHelpers";
11
11
 
12
12
  //? Each case drives several real git clones and pushes; on a 4-core Windows VM that alone lands at 2-5s.
13
13
  setDefaultTimeout(20_000);
@@ -1,10 +1,10 @@
1
1
  import { mkdir } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { toError } from "akanjs/common";
4
- import { AppExecutor, type WorkspaceExecutor } from "./executors";
5
- import { FileSys } from "./fileSys";
6
- import { LibSource } from "./libSource";
7
- import { SlicePlanner } from "./slicePlanner";
4
+ import { AppExecutor, type WorkspaceExecutor } from "../executors";
5
+ import { FileSys } from "../util/fileSys";
6
+ import { LibSource } from "../workspace/libSource";
7
+ import { SlicePlanner } from "../workspace/slicePlanner";
8
8
  import { SubspaceClone } from "./subspaceClone";
9
9
  import type { SubspaceConfig, SubspaceDeclaration } from "./subspaceConfig";
10
10
 
@@ -1,12 +1,12 @@
1
1
  import { mkdir, readdir, rename, rm } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { toError } from "akanjs/common";
4
- import { Executor, WorkspaceExecutor } from "./executors";
5
- import { FileSys } from "./fileSys";
6
- import { LibSource } from "./libSource";
7
- import { type SlicePlan, SlicePlanner } from "./slicePlanner";
4
+ import { Executor, WorkspaceExecutor } from "../executors";
5
+ import { FileSys } from "../util/fileSys";
6
+ import { LibSource } from "../workspace/libSource";
7
+ import { type SlicePlan, SlicePlanner } from "../workspace/slicePlanner";
8
+ import type { PackageJson } from "../workspace/types";
8
9
  import { SubspaceConfig, type SubspaceDeclaration } from "./subspaceConfig";
9
- import type { PackageJson } from "./types";
10
10
 
11
11
  export class SubspaceClone {
12
12
  static readonly anchorFile = "akan.subspace.json";
@@ -1,5 +1,5 @@
1
1
  import type { SubspaceConfigInput, SubspaceDeclaration } from "akanjs";
2
- import type { WorkspaceExecutor } from "./executors";
2
+ import type { WorkspaceExecutor } from "../executors";
3
3
 
4
4
  export type { SubspaceConfigInput, SubspaceDeclaration };
5
5
 
@@ -129,7 +129,7 @@ export const writeJson = async (filePath: string, value: object) => {
129
129
  await writeText(filePath, `${JSON.stringify(value, null, 2)}\n`);
130
130
  };
131
131
 
132
- const repoRoot = path.resolve(import.meta.dir, "../../..");
132
+ const repoRoot = path.resolve(import.meta.dir, "../../../..");
133
133
  const biomeBin = path.join(repoRoot, "node_modules", ".bin", process.platform === "win32" ? "biome.exe" : "biome");
134
134
  export const hasBiome = existsSync(biomeBin);
135
135
 
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { realpathSync } from "node:fs";
3
3
  import path from "node:path";
4
- import { tempDirs, writeText } from "../testHelpers";
4
+ import { tempDirs, writeText } from "../test/testHelpers";
5
5
  import { createBrowserDirnamePlugin } from "./browserDirnamePlugin";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-devkit-browser-dirname-");
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
- import { tempDirs, writeText as write } from "../testHelpers";
3
+ import { tempDirs, writeText as write } from "../test/testHelpers";
4
4
  import { createExternalizeFrameworkPlugin } from "./externalizeFrameworkPlugin";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-devkit-externalize-");
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { symlink } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { tempDirs, writeText } from "../testHelpers";
4
+ import { tempDirs, writeText } from "../test/testHelpers";
5
5
  import { createBarrelImportsPlugin } from "./barrelImportsPlugin";
6
6
  import { McpAppPageTrimmer } from "./mcpAppPageTrimmer";
7
7
 
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
- import { tempDirs, writeText } from "../testHelpers";
3
+ import { tempDirs, writeText } from "../test/testHelpers";
4
4
  import { PureLazyMarker } from "./pureLazyMarker";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-pure-lazy-");
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
- import { tempDirs, writeText as write } from "../testHelpers";
3
+ import { tempDirs, writeText as write } from "../test/testHelpers";
4
4
  import { createServerEnvPlugin } from "./serverEnvPlugin";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-devkit-server-env-");
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
3
  import { Logger } from "akanjs/common";
4
- import { tempDirs, writeText as write } from "../testHelpers";
4
+ import { tempDirs, writeText as write } from "../test/testHelpers";
5
5
  import { ServerEnvProfile } from "./serverEnvProfile";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-devkit-server-env-profile-");
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
- import { tempDirs, writeText } from "../testHelpers";
3
+ import { tempDirs, writeText } from "../test/testHelpers";
4
4
  import { SideEffectImportOrder } from "./sideEffectImportOrder";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-devkit-side-effect-order-");
@@ -1,8 +1,8 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
- import { ApplicationBuildReporter } from "../applicationBuildReporter";
5
- import { tempDirs, writeText as write } from "../testHelpers";
4
+ import { ApplicationBuildReporter } from "../app/applicationBuildReporter";
5
+ import { tempDirs, writeText as write } from "../test/testHelpers";
6
6
  import { BarrelAnalyzer, type BarrelExportTarget } from "./barrelAnalyzer";
7
7
  import { createTsconfigPackageResolver, rewriteBarrelImports } from "./barrelImportsPlugin";
8
8
  import {
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { tempDirs } from "../testHelpers";
4
+ import { tempDirs } from "../test/testHelpers";
5
5
  import { createTsconfigPackageResolver } from "./barrelImportsPlugin";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-devkit-resolver-");
@@ -3,9 +3,9 @@ import { readFile, stat, writeFile } from "node:fs/promises";
3
3
  import type { AddressInfo } from "node:net";
4
4
  import path from "node:path";
5
5
  import { Client, type Connection, Server, utils } from "ssh2";
6
+ import { createTempApp, isolateEnv, tempRoots } from "../test/testHelpers";
6
7
  import { createTunnel } from "./createTunnel";
7
8
  import { SshHostKeys } from "./sshHostKeys";
8
- import { createTempApp, isolateEnv, tempRoots } from "./testHelpers";
9
9
 
10
10
  const freePort = () => {
11
11
  const listener = Bun.listen({ hostname: "127.0.0.1", port: 0, socket: { data() {} } });
@@ -1,7 +1,7 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import type { ConnectConfig } from "ssh2";
3
- import { type AppExecutor, WorkspaceExecutor } from "./executors";
4
- import { ShellOnlyEnv } from "./shellOnlyEnv";
3
+ import { type AppExecutor, WorkspaceExecutor } from "../executors";
4
+ import { ShellOnlyEnv } from "../util/shellOnlyEnv";
5
5
  import { SshHostKeys } from "./sshHostKeys";
6
6
  import { createSshTunnel } from "./sshTunnel";
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { mkdir, rm, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { ConfigLock } from "./cloud/configLock";
5
- import { FileSys } from "./fileSys";
4
+ import { ConfigLock } from "../cloud/configLock";
5
+ import { FileSys } from "../util/fileSys";
6
6
 
7
7
  type KnownHosts = Record<string, string>;
8
8
 
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
- import { tempDirs, writeText as write } from "../testHelpers";
3
+ import { tempDirs, writeText as write } from "../test/testHelpers";
4
4
  import { ProjectTypecheck } from "./projectTypecheck";
5
5
  import { TypecheckFailure } from "./typecheckFailure";
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { mkdir, rm } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { CliError } from "../commandDecorators/cliError";
4
- import type { TypecheckRecord } from "../typeChecker";
4
+ import type { TypecheckRecord } from "./typeChecker";
5
5
  import { TypecheckFailure } from "./typecheckFailure";
6
6
 
7
7
  export interface ProjectTypecheckOptions {
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
3
  import * as ts from "typescript";
4
- import { tempDirs, writeJson, writeText } from "./testHelpers";
4
+ import { tempDirs, writeJson, writeText } from "../test/testHelpers";
5
5
  import { TypeChecker } from "./typeChecker";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-devkit-type-checker-");
@@ -3,7 +3,7 @@ import * as path from "node:path";
3
3
  import chalk from "chalk";
4
4
  import * as ts from "typescript";
5
5
 
6
- import type { Executor } from "./executors";
6
+ import type { Executor } from "../executors";
7
7
 
8
8
  export interface ProjectTypecheckResult {
9
9
  configPath: string;
@@ -1,5 +1,5 @@
1
1
  import { Logger } from "akanjs/common";
2
- import { TypeChecker } from "../typeChecker";
2
+ import { TypeChecker } from "./typeChecker";
3
3
  import { TypecheckFailure } from "./typecheckFailure";
4
4
 
5
5
  try {
@@ -1,5 +1,5 @@
1
1
  import { CliError } from "../commandDecorators/cliError";
2
- import type { TypecheckRecord } from "../typeChecker";
2
+ import type { TypecheckRecord } from "./typeChecker";
3
3
 
4
4
  export class TypecheckFailure extends CliError<"checkFailed"> {
5
5
  //? The worker's exit when the project has type errors, so its crash, which exits 1, is told apart.
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
+ import { formatWithBiome, hasBiome } from "../test/testHelpers";
2
3
  import { JsonFormatter } from "./jsonFormatter";
3
- import { formatWithBiome, hasBiome } from "./testHelpers";
4
4
 
5
5
  const pad = (length: number) => "x".repeat(length);
6
6
  const thousands = Array.from({ length: 40 }, (_, idx) => idx * 1000);
@@ -1,7 +1,7 @@
1
1
  import { capitalize } from "akanjs/common";
2
2
  import ts from "typescript";
3
- import type { AkanModuleContext } from "../akanContext";
4
3
  import type { Sys, Workspace } from "../commandDecorators";
4
+ import type { AkanModuleContext } from "../context/akanContext";
5
5
  import { AppExecutor, LibExecutor } from "../executors";
6
6
  import { createWorkflowApplyReport, workflowCommandsForPlan } from "./artifacts";
7
7
  import { buildAkanModuleContextIndex } from "./moduleIndex";
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
- import { createTempApp, tempRoots, writeJson, writeText } from "../testHelpers";
3
+ import { createTempApp, tempRoots, writeJson, writeText } from "../test/testHelpers";
4
4
  import { GuardCatalog } from "./guardCatalog";
5
5
 
6
6
  const track = tempRoots();