@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,12 +1,12 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
- import { AgentAssets } from "./agentAssets";
3
+ import { AgentAssets } from "../guideline/agentAssets";
4
+ import { tempDirs, writeText } from "../test/testHelpers";
4
5
  import { ErrorCodeReference } from "./errorCodeReference";
5
6
  import type { ErrorCodeRow } from "./errorCodeScan";
6
- import { tempDirs, writeText } from "./testHelpers";
7
7
 
8
- const akanjsDir = path.resolve(import.meta.dir, "../../akanjs");
9
- const target = ErrorCodeReference.target(path.resolve(import.meta.dir, "../cli"));
8
+ const akanjsDir = path.resolve(import.meta.dir, "../../../akanjs");
9
+ const target = ErrorCodeReference.target(path.resolve(import.meta.dir, "../../cli"));
10
10
  const makeTempRoot = tempDirs("akan-error-codes-");
11
11
 
12
12
  const git = (root: string, args: string[]) => {
@@ -65,7 +65,7 @@ export class ErrorCodeReference {
65
65
  }
66
66
 
67
67
  if (import.meta.main) {
68
- const akanjsDir = path.resolve(import.meta.dir, "../../akanjs");
69
- const target = ErrorCodeReference.target(path.resolve(import.meta.dir, "../cli"));
68
+ const akanjsDir = path.resolve(import.meta.dir, "../../../akanjs");
69
+ const target = ErrorCodeReference.target(path.resolve(import.meta.dir, "../../cli"));
70
70
  await Bun.write(target, ErrorCodeReference.render(akanjsDir));
71
71
  }
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readFileSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import ts from "typescript";
4
- import { MaintainabilityLimits } from "./maintainabilityLimits";
4
+ import { MaintainabilityLimits } from "../quality/maintainabilityLimits";
5
5
 
6
6
  export interface ErrorCodeRow {
7
7
  code: string | null;
@@ -4,7 +4,7 @@ import { tmpdir } from "node:os";
4
4
  import path from "node:path";
5
5
  import { FrameworkGraph } from "./frameworkGraph";
6
6
 
7
- const workspaceRoot = path.resolve(import.meta.dir, "../../..");
7
+ const workspaceRoot = path.resolve(import.meta.dir, "../../../..");
8
8
  //? The other end of these lies outside the source read here: @akanjs/native's desktop shell answers file and secret
9
9
  //? requests, AkanApp's child reports a boot error from a code string, and the browser tab sends `sync-navigation` and
10
10
  //? handles every HmrMessage in a script string. `ws.*` and HMR `ok` have no site.
@@ -4,10 +4,10 @@ import { pathToFileURL } from "node:url";
4
4
  import type { AkanPlugin, AkanSyncContext } from "akanjs";
5
5
  import { isRouteSourceFile, parseRouteModuleKey, validatePageSourceFile, validateSubRoutePageKey } from "akanjs/common";
6
6
  import { AkanAppConfig, decreaseBuildNum, increaseBuildNum } from "../akanConfig";
7
+ import type { RouteSourceInfo } from "../app/routeSourceValidator";
7
8
  import { getRootBoundarySegments, isRootBoundarySegments } from "../artifact/implicitRootLayout";
8
- import { FileSys } from "../fileSys";
9
- import type { RouteSourceInfo } from "../routeSourceValidator";
10
- import type { AppInfo } from "../scanInfo";
9
+ import { FileSys } from "../util/fileSys";
10
+ import type { AppInfo } from "../workspace/scanInfo";
11
11
  import { Executor, execEmoji } from "./executor";
12
12
  import { LibExecutor } from "./libExecutor";
13
13
  import { type NamedExecutorOptions, SysExecutor } from "./sysExecutor";
@@ -30,9 +30,9 @@ export interface AppRouteSource {
30
30
 
31
31
  export class AppExecutor extends SysExecutor {
32
32
  // Lazy: the validator pulls in `typescript` (~65MB resident).
33
- static #routeSourceValidator: typeof import("../routeSourceValidator").RouteSourceValidator | null = null;
33
+ static #routeSourceValidator: typeof import("../app/routeSourceValidator").RouteSourceValidator | null = null;
34
34
  static async #getRouteSourceValidator() {
35
- AppExecutor.#routeSourceValidator ??= (await import("../routeSourceValidator")).RouteSourceValidator;
35
+ AppExecutor.#routeSourceValidator ??= (await import("../app/routeSourceValidator")).RouteSourceValidator;
36
36
  return AppExecutor.#routeSourceValidator;
37
37
  }
38
38
  dist: Executor;
@@ -12,15 +12,15 @@ import path from "node:path";
12
12
  import { capitalize, Logger, toError } from "akanjs/common";
13
13
  import { $ } from "bun";
14
14
  import chalk from "chalk";
15
- import { FileSys, getDirname } from "../fileSys";
16
- import { JsonFormatter } from "../jsonFormatter";
17
- import { Linter } from "../linter";
18
- import type { AppInfo, LibInfo } from "../scanInfo";
19
- import { Spinner } from "../spinner";
20
- // Type-only: `getTypeChecker` loads it on demand to keep `typescript` out of the resident module graph.
21
- import type { TypeChecker } from "../typeChecker";
15
+ import { Linter } from "../lint/linter";
22
16
  import { ProjectTypecheck } from "../typecheck/projectTypecheck";
23
- import type { FileContent, PackageJson, TsConfigJson } from "../types";
17
+ // Type-only: `getTypeChecker` loads it on demand to keep `typescript` out of the resident module graph.
18
+ import type { TypeChecker } from "../typecheck/typeChecker";
19
+ import { FileSys, getDirname } from "../util/fileSys";
20
+ import { JsonFormatter } from "../util/jsonFormatter";
21
+ import { Spinner } from "../util/spinner";
22
+ import type { AppInfo, LibInfo } from "../workspace/scanInfo";
23
+ import type { FileContent, PackageJson, TsConfigJson } from "../workspace/types";
24
24
  import { CommandExecutionError } from "./commandExecutionError";
25
25
 
26
26
  export interface WrittenFileContent extends FileContent {
@@ -458,7 +458,7 @@ export class Executor {
458
458
  }
459
459
  // Async so `typescript` (~65MB resident) loads only in the commands that typecheck.
460
460
  async getTypeChecker() {
461
- const { TypeChecker } = await import("../typeChecker");
461
+ const { TypeChecker } = await import("../typecheck/typeChecker");
462
462
  this.typeChecker ??= new TypeChecker(this);
463
463
  return this.typeChecker;
464
464
  }
@@ -16,7 +16,7 @@ mock.module("node:fs/promises", () => ({
16
16
  return await realSymlink(...args);
17
17
  },
18
18
  }));
19
- const { AppExecutor, WorkspaceExecutor } = await import("./executors");
19
+ const { AppExecutor, WorkspaceExecutor } = await import("./");
20
20
 
21
21
  const { lstat, mkdir, mkdtemp, readFile, rm, writeFile } = fsPromises;
22
22
  const originalEnv = { ...process.env };
@@ -2,17 +2,8 @@ import { describe, expect, spyOn, test } from "bun:test";
2
2
  import { existsSync } from "node:fs";
3
3
  import { lstat, mkdir, readFile, readlink, rm, stat, writeFile } from "node:fs/promises";
4
4
  import path from "node:path";
5
- import { AkanAppConfig } from "./akanConfig";
6
- import {
7
- AppExecutor,
8
- CommandExecutionError,
9
- Executor,
10
- type LibExecutor,
11
- PkgExecutor,
12
- WorkspaceExecutor,
13
- } from "./executors";
14
- import { DevGeneratedIndexSync } from "./frontendBuild/devGeneratedIndexSync";
15
- import { AppInfo } from "./scanInfo";
5
+ import { AkanAppConfig } from "../akanConfig";
6
+ import { DevGeneratedIndexSync } from "../frontendBuild/devGeneratedIndexSync";
16
7
  import {
17
8
  createTempApp,
18
9
  createTempLib,
@@ -23,8 +14,10 @@ import {
23
14
  tempRoots,
24
15
  writeJson,
25
16
  writeText,
26
- } from "./testHelpers";
27
- import type { PackageJson } from "./types";
17
+ } from "../test/testHelpers";
18
+ import { AppInfo } from "../workspace/scanInfo";
19
+ import type { PackageJson } from "../workspace/types";
20
+ import { AppExecutor, CommandExecutionError, Executor, type LibExecutor, PkgExecutor, WorkspaceExecutor } from "./";
28
21
 
29
22
  isolateEnv();
30
23
  const makeTempRoot = tempDirs("akan-devkit-");
@@ -49,9 +42,9 @@ const rootPackageJson = (extra: Partial<PackageJson> = {}): PackageJson => ({
49
42
  });
50
43
 
51
44
  describe("executors module graph", () => {
52
- test("executors.ts and each file under executors/ load first in a fresh process", async () => {
53
- const entries = ["executors.ts"];
54
- for await (const file of new Bun.Glob("executors/*.ts").scan({ cwd: import.meta.dir }))
45
+ test("the executors barrel and each file beside it load first in a fresh process", async () => {
46
+ const entries: string[] = [];
47
+ for await (const file of new Bun.Glob("*.ts").scan({ cwd: import.meta.dir }))
55
48
  if (!file.endsWith(".test.ts")) entries.push(file);
56
49
  const failures = await Promise.all(
57
50
  entries.map(async (entry) => {
@@ -324,7 +317,7 @@ describe("Executor filesystem helpers", () => {
324
317
  const exec = new Executor("fixture", root);
325
318
 
326
319
  await exec.applyTemplate({ basePath: "app", template: "app", dict: { appName: "demo" }, options: { libs: [] } });
327
- const templateRoot = path.resolve(import.meta.dir, "../cli/templates/app/public");
320
+ const templateRoot = path.resolve(import.meta.dir, "../../cli/templates/app/public");
328
321
  await expect(readFile(path.join(root, "app/public/apple-touch-icon.png"))).resolves.toEqual(
329
322
  await readFile(path.join(templateRoot, "apple-touch-icon.png")),
330
323
  );
@@ -1516,7 +1509,7 @@ describe("SysExecutor scan", () => {
1516
1509
  test.skipIf(!hasBiome)(
1517
1510
  "writes env.server.type.ts the way Biome prints it, spreading libs in dependency order",
1518
1511
  async () => {
1519
- const { default: getContent } = (await import("../cli/templates/env/_env.server.type")) as {
1512
+ const { default: getContent } = (await import("../../cli/templates/env/_env.server.type")) as {
1520
1513
  default: (scanInfo: unknown) => { content: string };
1521
1514
  };
1522
1515
  const libs = ["util", "shared", "shopAdmin", "shop", "a10", "a9"];
@@ -0,0 +1,8 @@
1
+ export { AppExecutor, type AppRouteSource, type PageRoot } from "./appExecutor";
2
+ export { CommandExecutionError, type CommandExecutionErrorOptions } from "./commandExecutionError";
3
+ export { Executor, execEmoji, type WrittenFileContent } from "./executor";
4
+ export { LibExecutor } from "./libExecutor";
5
+ export { ModuleExecutor } from "./moduleExecutor";
6
+ export { PkgExecutor } from "./pkgExecutor";
7
+ export { SysExecutor } from "./sysExecutor";
8
+ export { parseEnvFile, WorkspaceExecutor } from "./workspaceExecutor";
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
- import { PkgInfo } from "../scanInfo";
3
- import type { PackageJson, TsConfigJson } from "../types";
2
+ import { PkgInfo } from "../workspace/scanInfo";
3
+ import type { PackageJson, TsConfigJson } from "../workspace/types";
4
4
  import { Executor, execEmoji } from "./executor";
5
5
  import type { NamedExecutorOptions, SysExecutor } from "./sysExecutor";
6
6
  import { WorkspaceExecutor } from "./workspaceExecutor";
@@ -1,20 +1,20 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { capitalize, getPageSourceFileViolation } from "akanjs/common";
4
+ import { AkanAppConfig, AkanLibConfig } from "../akanConfig";
4
5
  import {
5
6
  renderScopeAgentBlock,
6
7
  renderScopeAgentsMd,
7
8
  renderScopeClaudeMd,
8
9
  scanScopeRecipes,
9
10
  upsertAgentBlock,
10
- } from "../agentsIndex";
11
- import { AkanAppConfig, AkanLibConfig } from "../akanConfig";
12
- import { CodegenLock } from "../codegenLock";
13
- import { EnvSeed } from "../envSeed";
14
- import { ManifestDependencies } from "../manifestDependencies";
15
- import { AppInfo, isAkanFrameworkDependency, LibInfo } from "../scanInfo";
16
- import type { FileContent } from "../types";
17
- import { barrelFacetDirs } from "../workspaceLayout";
11
+ } from "../guideline/agentsIndex";
12
+ import { CodegenLock } from "../workspace/codegenLock";
13
+ import { EnvSeed } from "../workspace/envSeed";
14
+ import { ManifestDependencies } from "../workspace/manifestDependencies";
15
+ import { AppInfo, isAkanFrameworkDependency, LibInfo } from "../workspace/scanInfo";
16
+ import type { FileContent } from "../workspace/types";
17
+ import { barrelFacetDirs } from "../workspace/workspaceLayout";
18
18
  import type { AppExecutor } from "./appExecutor";
19
19
  import { Executor, execEmoji } from "./executor";
20
20
  import type { LibExecutor } from "./libExecutor";
@@ -2,10 +2,10 @@ import { existsSync, readFileSync } from "node:fs";
2
2
  import { stat } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { AkanWorkspaceConfig } from "../akanConfig";
5
- import { FileSys } from "../fileSys";
6
- import { resolveRepoName } from "../repoIdentity";
7
- import { WorkspaceInfo } from "../scanInfo";
8
- import type { BaseDevEnv, TsConfigJson } from "../types";
5
+ import { FileSys } from "../util/fileSys";
6
+ import { resolveRepoName } from "../workspace/repoIdentity";
7
+ import { WorkspaceInfo } from "../workspace/scanInfo";
8
+ import type { BaseDevEnv, TsConfigJson } from "../workspace/types";
9
9
  import { Executor, execEmoji } from "./executor";
10
10
  import { SysExecutor } from "./sysExecutor";
11
11
 
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, realpath, symlink } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { tempDirs, writeText as write } from "../testHelpers";
4
+ import { tempDirs, writeText as write } from "../test/testHelpers";
5
5
  import { AllRoutesBuilder } from "./allRoutesBuilder";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-all-routes-");
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, readFile, 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 { AutoImportSync, transformSource } from "./autoImportSync";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-auto-import-");
@@ -1,7 +1,7 @@
1
1
  import { readdir, readFile, stat } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import ts from "typescript";
4
- import { FileSys } from "../fileSys";
4
+ import { FileSys } from "../util/fileSys";
5
5
 
6
6
  //* Closed-registry scan (no type information); writes only on a real diff, or the watcher loops on its own edits.
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { realpath } from "node:fs/promises";
3
3
  import path from "node:path";
4
- import { tempDirs, writeText as write } from "../testHelpers";
4
+ import { tempDirs, writeText as write } from "../test/testHelpers";
5
5
  import { createTsconfigPackageResolver } from "../transforms/barrelImportsPlugin";
6
6
  import { CLIENT_BUNDLE_NAMING } from "./clientBuildTypes";
7
7
  import { ClientEntriesBundler } from "./clientEntriesBundler";
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
2
2
  import fs from "node:fs";
3
3
  import { realpath } from "node:fs/promises";
4
4
  import path from "node:path";
5
- import { tempDirs, writeText } from "../testHelpers";
5
+ import { tempDirs, writeText } from "../test/testHelpers";
6
6
  import { ClientEntriesBundler } from "./clientEntriesBundler";
7
7
 
8
8
  const makeTempRoot = tempDirs("akan-client-entries-");
@@ -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 { CsrArtifactBuilder } from "./csrArtifactBuilder";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-csr-artifact-");
@@ -11,7 +11,7 @@ import {
11
11
  type CsrDevManifest,
12
12
  csrDevModuleFile,
13
13
  } from "akanjs/server/hmr/csrDevManifest";
14
- import { FileSys } from "../fileSys";
14
+ import { FileSys } from "../util/fileSys";
15
15
  import { CsrDevPaths } from "./csrDevPaths";
16
16
  import type { CsrDevCode, CsrDevCompiledModule, CsrDevGraph } from "./csrDevTypes";
17
17
 
@@ -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 { CssCompiler, declaredCustomProperties } from "./cssCompiler";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-css-compiler-");
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, readFile, rm, 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 { DevGeneratedIndexSync } from "./devGeneratedIndexSync";
6
6
 
7
7
  const makeTempRoot = tempDirs("akan-generated-index-");
@@ -1,7 +1,7 @@
1
1
  import { mkdir, readdir, readFile, rm, stat } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { capitalize } from "akanjs/common";
4
- import { FileSys } from "../fileSys";
4
+ import { FileSys } from "../util/fileSys";
5
5
 
6
6
  const BARREL_FACETS = new Set(["common", "srvkit", "ui", "webkit", "plugin"]);
7
7
  const FACET_SOURCE_FILE_RE = /\.(ts|tsx)$/;
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, readdir, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import type { App } from "../commandDecorators";
5
- import { tempDirs } from "../testHelpers";
5
+ import { tempDirs } from "../test/testHelpers";
6
6
  import { DictionaryAssetBuilder } from "./dictionaryAssetBuilder";
7
7
 
8
8
  const tempRoot = tempDirs("akan-devkit-dict-asset-");
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, rm, stat, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import type { App } from "../commandDecorators";
5
- import { tempDirs } from "../testHelpers";
5
+ import { tempDirs } from "../test/testHelpers";
6
6
  import { FontOptimizer } from "./fontOptimizer";
7
7
 
8
8
  const SOURCE_FONT = path.resolve(import.meta.dir, "../../../../libs/shared/public/fonts/Assistant-Regular.woff2");
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, rm, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import type { App } from "../commandDecorators";
5
- import { tempDirs } from "../testHelpers";
5
+ import { tempDirs } from "../test/testHelpers";
6
6
  import { FontPruner } from "./fontPruner";
7
7
 
8
8
  const tempRoot = tempDirs("akan-devkit-font-prune-");
@@ -3,7 +3,7 @@ import { readFile, rm } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import type { RoutesManifest } from "akanjs/server";
6
- import { tempDirs, writeText as write } from "../testHelpers";
6
+ import { tempDirs, writeText as write } from "../test/testHelpers";
7
7
  import { CsrArtifactBuilder } from "./csrArtifactBuilder";
8
8
  import { CssCompiler, declaredCustomProperties, isIgnoredNodeModuleSource } from "./cssCompiler";
9
9
  import { CssImportResolver } from "./cssImportResolver";
@@ -2,7 +2,7 @@ import { afterEach, describe, expect, test } from "bun:test";
2
2
  import { chmod, mkdir, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import type { Logger } from "akanjs/common";
5
- import { tempDirs } from "../testHelpers";
5
+ import { tempDirs } from "../test/testHelpers";
6
6
  import { type ChangeBatch, HmrWatcher } from "./hmrWatcher";
7
7
 
8
8
  // The real Bun watcher, not a fake: the dropped-event behaviour under test only exists there.
@@ -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 { CsrArtifactBuilder } from "./csrArtifactBuilder";
5
5
  import { McpAppViewBuilder } from "./mcpAppViewBuilder";
6
6
 
@@ -115,7 +115,7 @@ export class McpAppViewBuilder {
115
115
 
116
116
  /** Every `.app()` the pages declare, read off their sources without evaluating them. */
117
117
  static async discover(pageEntries: PageEntry[], basePaths: string[]): Promise<McpAppView[]> {
118
- const { RouteSourceValidator } = await import("../routeSourceValidator");
118
+ const { RouteSourceValidator } = await import("../app/routeSourceValidator");
119
119
  const roots = pageEntries.filter((entry) => parseRouteModuleKey(entry.key).isInternalRootLayout);
120
120
  const overrides = pageEntries.filter((entry) => parseRouteModuleKey(entry.key).kind === "overrides");
121
121
  const layoutNodes = new Set(
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
2
2
  import { existsSync } from "node:fs";
3
3
  import { mkdir, realpath, symlink } from "node:fs/promises";
4
4
  import path from "node:path";
5
- import { tempDirs, writeText as write } from "../testHelpers";
5
+ import { tempDirs, writeText as write } from "../test/testHelpers";
6
6
  import { createBarrelImportsPlugin } from "../transforms/barrelImportsPlugin";
7
7
 
8
8
  const makeTempRoot = tempDirs("akan-native-core-");
@@ -3,7 +3,7 @@ import { mkdir, symlink } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import type { BunPlugin } from "bun";
5
5
  import { resolveSsrPageEntries } from "../artifact/implicitRootLayout";
6
- import { tempDirs, writeText as write } from "../testHelpers";
6
+ import { tempDirs, writeText as write } from "../test/testHelpers";
7
7
  import { CsrArtifactBuilder } from "./csrArtifactBuilder";
8
8
  import { VENDOR_SPECIFIERS } from "./vendorSpecifiers";
9
9
 
@@ -3,7 +3,7 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import zlib from "node:zlib";
5
5
  import type { App } from "../commandDecorators";
6
- import { tempDirs } from "../testHelpers";
6
+ import { tempDirs } from "../test/testHelpers";
7
7
  import { precompressArtifacts } from "./precompressArtifacts";
8
8
 
9
9
  const tempRoot = tempDirs("akan-devkit-precompress-");
@@ -1,7 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- import { FileSys } from "../fileSys";
4
3
  import { hasUseClientDirective, scanUseClientExports } from "../transforms/rscUseClientTransform";
4
+ import { FileSys } from "../util/fileSys";
5
5
  import { CsrDevPaths } from "./csrDevPaths";
6
6
 
7
7
  export interface ServerGraph {
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { chmod, mkdir, readdir, rm, stat, utimes, 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 { SourceMtimeIndex } from "./sourceMtimeIndex";
6
6
 
7
7
  const seed = async (root: string, rel: string, content = "export const x = 1;\n") => {
@@ -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 { SsrDevBundler } from "./ssrDevBundler";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-ssr-dev-bundler-");
@@ -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 { VendorImportScanner } from "./vendorImportScanner";
5
5
 
6
6
  const makeTempRoot = tempDirs("akan-vendor-imports-");
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import { readFileSync } from "node:fs";
3
3
  import path from "node:path";
4
- import { tempDirs, writeText as write } from "../testHelpers";
4
+ import { tempDirs, writeText as write } from "../test/testHelpers";
5
5
  import { ClientEntriesBundler } from "./clientEntriesBundler";
6
6
  import { VendorNarrowing } from "./vendorNarrowing";
7
7
 
@@ -2,7 +2,7 @@ import { describe, expect, test } from "bun:test";
2
2
  import { mkdir, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import type { App } from "../commandDecorators";
5
- import { tempDirs } from "../testHelpers";
5
+ import { tempDirs } from "../test/testHelpers";
6
6
  import { WatchRootResolver } from "./watchRootResolver";
7
7
 
8
8
  const tempRoot = tempDirs("akan-watch-roots-");
@@ -49,7 +49,7 @@ describe("AgentAssets", () => {
49
49
  test("names no rule or skill file that a new workspace's .gitignore would keep out of git", async () => {
50
50
  const assets = [...(await AgentAssets.rules()), ...(await AgentAssets.skills())];
51
51
  const root = await fsPromise.mkdtemp(path.join(os.tmpdir(), "akan-agent-ignore-"));
52
- const template = path.join(import.meta.dir, "../cli/templates/workspaceRoot/.gitignore.template");
52
+ const template = path.join(import.meta.dir, "../../cli/templates/workspaceRoot/.gitignore.template");
53
53
  await fsPromise.copyFile(template, path.join(root, ".gitignore"));
54
54
  Bun.spawnSync(["git", "init", "-q"], { cwd: root });
55
55
  const proc = Bun.spawn(["git", "check-ignore", "--no-index", "--stdin"], {
@@ -1,6 +1,6 @@
1
1
  import fsPromise from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { akanCodePaths } from "./codeAgent/agent/akanCodePaths";
3
+ import { akanCodePaths } from "../codeAgent/agent/akanCodePaths";
4
4
  import { type ConventionRule, ConventionSet } from "./conventionSet";
5
5
  import { Prompter } from "./prompter";
6
6
 
@@ -1,5 +1,7 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import path from "node:path";
3
+ import type { RecipeInfo } from "../context/recipeScanner";
4
+ import { tempDirs, writeText } from "../test/testHelpers";
3
5
  import {
4
6
  AGENT_BLOCK_END,
5
7
  AGENT_BLOCK_START,
@@ -11,8 +13,6 @@ import {
11
13
  renderScopeClaudeMd,
12
14
  upsertAgentBlock,
13
15
  } from "./agentsIndex";
14
- import type { RecipeInfo } from "./recipeScanner";
15
- import { tempDirs, writeText } from "./testHelpers";
16
16
 
17
17
  const button: RecipeInfo = {
18
18
  name: "buttonRecipe",
@@ -1,8 +1,8 @@
1
- import type { RecipeInfo, RecipeSource } from "./recipeScanner";
1
+ import type { RecipeInfo, RecipeSource } from "../context/recipeScanner";
2
2
 
3
3
  // Lazy: recipeScanner loads `typescript` (~65MB) and this module sits in the CLI entry graph (entryModuleGraph test).
4
- let recipeScannerLoad: Promise<typeof import("./recipeScanner")> | null = null;
5
- const loadRecipeScanner = () => (recipeScannerLoad ??= import("./recipeScanner"));
4
+ let recipeScannerLoad: Promise<typeof import("../context/recipeScanner")> | null = null;
5
+ const loadRecipeScanner = () => (recipeScannerLoad ??= import("../context/recipeScanner"));
6
6
 
7
7
  //* Split by ownership (root: framework recipes; each app/lib: what it may import), so always-loaded context does not
8
8
  //* grow with the app count and no unimportable neighbour recipe is listed.
@@ -23,13 +23,16 @@ export const extractBlockVersion = (content: string): string | null =>
23
23
  /** The running `@akanjs/devkit` version; null when its package.json is unreadable, which must not fail a doctor run. */
24
24
  export const readDevkitVersion = async (): Promise<string | null> => {
25
25
  const { readFile } = await import("node:fs/promises");
26
- const { getDirname } = await import("./fileSys");
27
- try {
28
- const raw = await readFile(`${getDirname(import.meta.url)}/package.json`, "utf-8");
29
- return (JSON.parse(raw) as { version?: string }).version ?? null;
30
- } catch {
31
- return null;
26
+ const { getDirname } = await import("../util/fileSys");
27
+ const dirname = getDirname(import.meta.url);
28
+ for (const candidate of [`${dirname}/package.json`, `${dirname}/../package.json`]) {
29
+ try {
30
+ return (JSON.parse(await readFile(candidate, "utf-8")) as { version?: string }).version ?? null;
31
+ } catch {
32
+ //? The bundled CLI sits beside its own package.json; devkit's source sits one folder below its own.
33
+ }
32
34
  }
35
+ return null;
33
36
  };
34
37
 
35
38
  export interface AgentsIndexScope {
@@ -1,9 +1,9 @@
1
1
  import { describe, expect, test } from "bun:test";
2
2
  import fsPromise from "node:fs/promises";
3
3
  import path from "node:path";
4
+ import { MaintainabilityContract } from "../quality/maintainabilityContract";
5
+ import { MaintainabilityLimits } from "../quality/maintainabilityLimits";
4
6
  import { ConventionSet } from "./conventionSet";
5
- import { MaintainabilityContract } from "./maintainabilityContract";
6
- import { MaintainabilityLimits } from "./maintainabilityLimits";
7
7
  import { Prompter } from "./prompter";
8
8
 
9
9
  describe("ConventionSet", () => {
@@ -57,7 +57,7 @@ describe("ConventionSet", () => {
57
57
  [...text.matchAll(/`([^`\s]+)`/g)].map((match) => match[1] ?? ""),
58
58
  ),
59
59
  );
60
- const plugins = (await fsPromise.readdir(path.join(import.meta.dir, "lint")))
60
+ const plugins = (await fsPromise.readdir(path.join(import.meta.dir, "../lint")))
61
61
  .filter((file) => file.endsWith(".grit"))
62
62
  .map((file) => file.slice(0, -".grit".length));
63
63
  const gates: readonly string[] = MaintainabilityContract.ruleIds.filter(