@akanjs/devkit 3.2.0-rc.9 → 3.3.0-rc.0

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 (341) hide show
  1. package/CHANGELOG.md +57 -516
  2. package/DEV_RUNTIME_KNOBS.md +4 -3
  3. package/README.ko.md +3 -2
  4. package/README.md +4 -2
  5. package/akanApp/BackendImportGraph.test.ts +1 -1
  6. package/akanApp/akanApp.host.test.ts +132 -3
  7. package/akanApp/akanApp.host.ts +146 -1216
  8. package/akanApp/akanApp.host.wiring.test.ts +727 -0
  9. package/akanApp/builderGap.ts +68 -0
  10. package/akanApp/builderRequestRelay.test.ts +93 -0
  11. package/akanApp/builderRequestRelay.ts +100 -0
  12. package/akanApp/builderRssRecycler.ts +182 -0
  13. package/akanApp/devBackend.ts +392 -0
  14. package/akanApp/devBuildStatusBoard.ts +128 -0
  15. package/akanApp/devBuilder.ts +196 -0
  16. package/akanApp/devIdleSuspend.test.ts +221 -0
  17. package/akanApp/devIdleSuspend.ts +192 -0
  18. package/akanApp/devIdleSuspend.watcher.test.ts +120 -0
  19. package/akanApp/devRecycler.test.ts +66 -0
  20. package/akanApp/devRecycler.ts +305 -0
  21. package/akanApp/processRss.ts +61 -0
  22. package/akanConfig/akanConfig.test.ts +45 -17
  23. package/akanConfig/akanConfig.ts +10 -10
  24. package/akanConfig/akanWorkspaceConfig.ts +1 -1
  25. package/akanConfig/productionLockfile.ts +1 -1
  26. package/apiReport/apiReport.test.ts +34 -3
  27. package/apiReport/apiReportDiff.ts +35 -1
  28. package/apiReport/apiReportPolicy.ts +3 -2
  29. package/{applicationBuildReporter.ts → app/applicationBuildReporter.ts} +2 -49
  30. package/{applicationBuildRunner.test.ts → app/applicationBuildRunner.test.ts} +71 -8
  31. package/{applicationBuildRunner.ts → app/applicationBuildRunner.ts} +60 -21
  32. package/{applicationTestPreload.ts → app/applicationTestPreload.ts} +1 -1
  33. package/{routeJsBudget.test.ts → app/routeJsBudget.test.ts} +17 -1
  34. package/{routeJsBudget.ts → app/routeJsBudget.ts} +9 -3
  35. package/{routeSourceValidator.test.ts → app/routeSourceValidator.test.ts} +17 -0
  36. package/{routeSourceValidator.ts → app/routeSourceValidator.ts} +5 -1
  37. package/artifact/implicitRootLayout.test.ts +71 -3
  38. package/artifact/implicitRootLayout.ts +9 -3
  39. package/artifact/implicitRootLayoutRender.test.tsx +297 -0
  40. package/biome.base.json +2 -1
  41. package/cloud/cloudApi.test.ts +1 -1
  42. package/cloud/configLock.test.ts +1 -1
  43. package/cloud/globalConfig.test.ts +1 -1
  44. package/cloud/globalConfig.ts +1 -1
  45. package/cloud/updatePackUpload.test.ts +1 -1
  46. package/codeAgent/agent/AkanCodeEnv.ts +1 -1
  47. package/codeAgent/agent/AkanCodeServices.ts +23 -0
  48. package/codeAgent/agent/akanCodePaths.ts +1 -1
  49. package/codeAgent/agent/akanCodeServices.test.ts +54 -0
  50. package/codeAgent/agent/akanSystemPrompt.ts +1 -1
  51. package/codeAgent/agent/codeAgent.test.ts +1 -1
  52. package/codeAgent/skills/akan-debug/SKILL.md +8 -5
  53. package/codeAgent/skills/akan-err/SKILL.md +7 -0
  54. package/codeAgent/skills/akan-mcp/SKILL.md +19 -1
  55. package/codeAgent/skills/akan-scaffold/SKILL.md +1 -1
  56. package/codeAgent/skills/akan-validate/SKILL.md +3 -3
  57. package/codeAgent/tools/AkanCli.ts +1 -1
  58. package/codeAgent/tools/AkanToolPack.ts +2 -2
  59. package/codeAgent/tools/akanCodePlugins.test.ts +1 -1
  60. package/commandDecorators/command.ts +35 -6
  61. package/commandDecorators/commandBuilder.ts +1 -1
  62. package/commandDecorators/commandDecorators.test.ts +107 -6
  63. package/commandDecorators/targetMeta.ts +2 -0
  64. package/commandDecorators/workspaceVersionCheck.test.ts +70 -1
  65. package/commandDecorators/workspaceVersionCheck.ts +64 -14
  66. package/context/akanContext.ts +576 -0
  67. package/context/akanContextInspection.ts +296 -0
  68. package/{akanMcpContract.test.ts → context/akanMcpContract.test.ts} +1 -1
  69. package/{akanMcpContract.ts → context/akanMcpContract.ts} +16 -256
  70. package/context/doctor/agentGuideCheck.ts +81 -0
  71. package/context/doctor/configLeftoverCheck.ts +35 -0
  72. package/context/doctor/doctorFindings.ts +70 -0
  73. package/context/doctor/generatedFreshness.ts +56 -0
  74. package/context/doctor/moduleShapeCheck.ts +88 -0
  75. package/context/doctor/recipeDuplicateCheck.ts +42 -0
  76. package/context/doctor/recipeIndexCheck.ts +87 -0
  77. package/context/doctor/rootShapeCheck.ts +55 -0
  78. package/context/doctor/workflowScope.ts +97 -0
  79. package/{recipeScanner.test.ts → context/recipeScanner.test.ts} +1 -1
  80. package/context/safeRead.ts +9 -0
  81. package/csrE2e/csrE2eHarness.fixture.ts +1 -1
  82. package/devkitUtils.test.ts +39 -5
  83. package/{apiReference.test.ts → docs/apiReference.test.ts} +4 -4
  84. package/{apiReference.ts → docs/apiReference.ts} +2 -2
  85. package/docs/errorCodeReference.test.ts +282 -0
  86. package/docs/errorCodeReference.ts +71 -0
  87. package/docs/errorCodeScan.ts +551 -0
  88. package/{frameworkGraph.test.ts → docs/frameworkGraph.test.ts} +1 -1
  89. package/executors/appExecutor.ts +448 -0
  90. package/executors/commandExecutionError.ts +53 -0
  91. package/executors/executor.ts +527 -0
  92. package/{executors.linkFallback.test.ts → executors/executors.linkFallback.test.ts} +1 -1
  93. package/{executors.test.ts → executors/executors.test.ts} +76 -15
  94. package/executors/index.ts +8 -0
  95. package/executors/libExecutor.ts +23 -0
  96. package/executors/moduleExecutor.ts +18 -0
  97. package/executors/pkgExecutor.ts +129 -0
  98. package/executors/sysExecutor.ts +301 -0
  99. package/executors/workspaceExecutor.ts +277 -0
  100. package/frontendBuild/allRoutesBuilder.test.ts +1 -1
  101. package/frontendBuild/autoImportSync.test.ts +1 -1
  102. package/frontendBuild/autoImportSync.ts +1 -1
  103. package/frontendBuild/buildRouteClient.test.ts +1 -1
  104. package/frontendBuild/clientEntriesBundler.test.ts +1 -1
  105. package/frontendBuild/csrArtifactBuilder.test.ts +1 -1
  106. package/frontendBuild/csrDevArtifactWriter.ts +1 -1
  107. package/frontendBuild/cssCompiler.test.ts +3 -2
  108. package/frontendBuild/devGeneratedIndexSync.test.ts +1 -1
  109. package/frontendBuild/devGeneratedIndexSync.ts +7 -38
  110. package/frontendBuild/dictionaryAssetBuilder.test.ts +1 -1
  111. package/frontendBuild/fontOptimizer.test.ts +1 -1
  112. package/frontendBuild/fontPruner.test.ts +1 -1
  113. package/frontendBuild/frontendBuild.test.ts +3 -3
  114. package/frontendBuild/hmrWatcher.stop.test.ts +63 -0
  115. package/frontendBuild/hmrWatcher.test.ts +1 -1
  116. package/frontendBuild/hmrWatcher.ts +22 -1
  117. package/frontendBuild/mcpAppViewBuilder.test.ts +1 -1
  118. package/frontendBuild/mcpAppViewBuilder.ts +1 -1
  119. package/frontendBuild/nativeCore.test.ts +1 -1
  120. package/frontendBuild/optionalPeers.test.ts +36 -8
  121. package/frontendBuild/pagesBundleBuilder.test.ts +2 -3
  122. package/frontendBuild/pagesBundleBuilder.ts +1 -1
  123. package/frontendBuild/precompressArtifacts.test.ts +1 -1
  124. package/frontendBuild/precompressArtifacts.ts +19 -6
  125. package/frontendBuild/serverGraphFile.ts +1 -1
  126. package/frontendBuild/sourceMtimeIndex.test.ts +1 -1
  127. package/frontendBuild/ssrDevBundler.test.ts +1 -1
  128. package/frontendBuild/vendorImportScanner.test.ts +1 -1
  129. package/frontendBuild/vendorNarrowing.test.ts +1 -1
  130. package/frontendBuild/watchRootResolver.test.ts +1 -1
  131. package/{agentAssets.test.ts → guideline/agentAssets.test.ts} +1 -1
  132. package/{agentAssets.ts → guideline/agentAssets.ts} +2 -2
  133. package/{agentsIndex.test.ts → guideline/agentsIndex.test.ts} +2 -2
  134. package/{agentsIndex.ts → guideline/agentsIndex.ts} +13 -10
  135. package/{conventionSet.test.ts → guideline/conventionSet.test.ts} +7 -4
  136. package/{conventionSet.ts → guideline/conventionSet.ts} +1 -1
  137. package/{prompter.ts → guideline/prompter.ts} +2 -3
  138. package/incrementalBuilder/buildBatch.proc.ts +14 -4
  139. package/incrementalBuilder/buildBatchProtocol.ts +2 -0
  140. package/incrementalBuilder/buildBatchRunner.test.ts +122 -2
  141. package/incrementalBuilder/buildBatchRunner.ts +17 -4
  142. package/incrementalBuilder/builderBoot.ts +106 -0
  143. package/incrementalBuilder/builderBuildStatus.ts +23 -0
  144. package/incrementalBuilder/builderChannel.test.ts +1 -1
  145. package/incrementalBuilder/builderChannel.ts +11 -0
  146. package/incrementalBuilder/builderGraphPayloads.ts +3 -3
  147. package/incrementalBuilder/builderLanes.ts +157 -0
  148. package/incrementalBuilder/builderWatch.ts +213 -0
  149. package/incrementalBuilder/csrRegistry.ts +234 -0
  150. package/incrementalBuilder/incrementalBuilder.proc.test.ts +101 -7
  151. package/incrementalBuilder/incrementalBuilder.proc.ts +81 -823
  152. package/incrementalBuilder/ssrRegistry.ts +282 -0
  153. package/index.ts +22 -22
  154. package/integration/devStability.integration.test.ts +62 -56
  155. package/integration/devStabilityHarness.test.ts +1 -1
  156. package/lint/__fixtures__/no-import-common-err/bad.tsx +13 -0
  157. package/lint/__fixtures__/no-import-common-err/good.tsx +12 -0
  158. package/{biomeBase.test.ts → lint/biomeBase.test.ts} +1 -1
  159. package/lint/gritRules.test.ts +1 -1
  160. package/{linter.test.ts → lint/linter.test.ts} +1 -1
  161. package/lint/no-import-common-err.grit +31 -0
  162. package/lint/no-init-fetch-in-client.grit +1 -1
  163. package/mobile/desktopBin.test.ts +1 -1
  164. package/mobile/desktopRelease.test.ts +1 -1
  165. package/mobile/desktopServerStage.test.ts +2 -2
  166. package/mobile/desktopServerStage.ts +1 -1
  167. package/mobile/nativeApi.test.ts +1 -1
  168. package/mobile/nativeApp.test.ts +1 -1
  169. package/mobile/nativeConfig.test.ts +1 -1
  170. package/mobile/nativePluginFolders.test.ts +1 -1
  171. package/mobile/nativePublicEnv.test.ts +1 -1
  172. package/mobile/nativeWebDir.test.ts +1 -1
  173. package/mobile/serverBundleSecrets.test.ts +1 -1
  174. package/mobile/tarWriter.test.ts +1 -1
  175. package/mobile/updatePackFolder.test.ts +1 -1
  176. package/package.json +173 -9
  177. package/packageExports.test.ts +20 -2
  178. package/piDependencyPins.test.ts +1 -1
  179. package/pipeline/PipelineDefinition.ts +1 -1
  180. package/platformTest/IdleWatchedProcess.test.ts +1 -1
  181. package/platformTest/LinuxDockerTarget.ts +1 -1
  182. package/platformTest/PlatformTestRun.test.ts +1 -1
  183. package/platformTest/TestSnapshot.test.ts +1 -1
  184. package/platformTest/WindowsSshTarget.ts +1 -1
  185. package/preview/previewView.test.ts +23 -1
  186. package/{abstractDoc.test.ts → quality/abstractDoc.test.ts} +2 -2
  187. package/{abstractDoc.ts → quality/abstractDoc.ts} +1 -1
  188. package/quality/bareErrorScanner.ts +126 -0
  189. package/{maintainabilityBaseline.test.ts → quality/maintainabilityBaseline.test.ts} +73 -0
  190. package/{maintainabilityBaseline.ts → quality/maintainabilityBaseline.ts} +97 -9
  191. package/{maintainabilityContract.test.ts → quality/maintainabilityContract.test.ts} +383 -2
  192. package/{maintainabilityContract.ts → quality/maintainabilityContract.ts} +151 -29
  193. package/{maintainabilityExceptionScanner.test.ts → quality/maintainabilityExceptionScanner.test.ts} +15 -1
  194. package/{maintainabilityExceptionScanner.ts → quality/maintainabilityExceptionScanner.ts} +5 -1
  195. package/{maintainabilityLimits.ts → quality/maintainabilityLimits.ts} +12 -0
  196. package/{maintainabilityReport.ts → quality/maintainabilityReport.ts} +20 -3
  197. package/{qualityScanner.test.ts → quality/qualityScanner.test.ts} +41 -1
  198. package/{qualityScanner.ts → quality/qualityScanner.ts} +25 -91
  199. package/{storeAccessScanner.ts → quality/storeAccessScanner.ts} +15 -2
  200. package/quality/workspaceSourceFiles.ts +82 -0
  201. package/{subspace.test.ts → subspace/subspace.test.ts} +25 -4
  202. package/{subspace.ts → subspace/subspace.ts} +5 -5
  203. package/{subspaceClone.ts → subspace/subspaceClone.ts} +8 -8
  204. package/{subspaceConfig.ts → subspace/subspaceConfig.ts} +5 -1
  205. package/{testHelpers.ts → test/testHelpers.ts} +37 -1
  206. package/transforms/barrelAnalyzer.ts +31 -10
  207. package/transforms/browserDirnamePlugin.test.ts +1 -1
  208. package/transforms/externalizeFrameworkPlugin.test.ts +1 -1
  209. package/transforms/mcpAppPageTrimmer.test.ts +1 -1
  210. package/transforms/pureLazyMarker.test.ts +1 -1
  211. package/transforms/serverEnvPlugin.test.ts +1 -1
  212. package/transforms/serverEnvProfile.test.ts +1 -1
  213. package/transforms/sideEffectImportOrder.test.ts +1 -1
  214. package/transforms/transforms.test.ts +52 -2
  215. package/transforms/tsconfigPackageResolver.test.ts +1 -1
  216. package/{createTunnel.test.ts → tunnel/createTunnel.test.ts} +1 -1
  217. package/{createTunnel.ts → tunnel/createTunnel.ts} +2 -2
  218. package/{sshHostKeys.ts → tunnel/sshHostKeys.ts} +2 -2
  219. package/typecheck/projectTypecheck.test.ts +23 -1
  220. package/typecheck/projectTypecheck.ts +10 -2
  221. package/{typeChecker.test.ts → typecheck/typeChecker.test.ts} +1 -1
  222. package/{typeChecker.ts → typecheck/typeChecker.ts} +5 -4
  223. package/typecheck/typecheck.proc.ts +6 -2
  224. package/typecheck/typecheckFailure.ts +1 -1
  225. package/util/errorReport.ts +66 -0
  226. package/{jsonFormatter.test.ts → util/jsonFormatter.test.ts} +1 -1
  227. package/workflow/constantSource.ts +187 -0
  228. package/workflow/dictionarySource.ts +184 -0
  229. package/workflow/executor.ts +6 -9
  230. package/workflow/fieldExpression.ts +153 -0
  231. package/workflow/fieldLabel.ts +61 -0
  232. package/workflow/fieldOrder.ts +117 -0
  233. package/workflow/fieldType.ts +2 -1
  234. package/workflow/guardCatalog.test.ts +1 -1
  235. package/workflow/keyRename.ts +1 -1
  236. package/workflow/moduleIndex.test.ts +2 -2
  237. package/workflow/moduleIndex.ts +2 -2
  238. package/workflow/modulePaths.ts +27 -0
  239. package/workflow/mutationScaffold.ts +7 -15
  240. package/workflow/mutationSource.ts +2 -1
  241. package/workflow/plan.ts +2 -1
  242. package/workflow/primitiveReport.ts +78 -0
  243. package/workflow/rolloutGate.test.ts +1 -1
  244. package/workflow/rolloutGate.ts +1 -1
  245. package/workflow/serviceSource.ts +33 -0
  246. package/workflow/signalSource.ts +96 -0
  247. package/workflow/source.ts +50 -1100
  248. package/workflow/sourceAst.ts +30 -0
  249. package/workflow/sourceImports.ts +105 -0
  250. package/workflow/sourceText.ts +13 -0
  251. package/workflow/templateSource.ts +30 -0
  252. package/workflow/testSource.ts +31 -0
  253. package/workflow/types.ts +1 -1
  254. package/workflow/uiPolicy.ts +1 -1
  255. package/{appSelectionMemory.ts → workspace/appSelectionMemory.ts} +1 -1
  256. package/{codegenLock.test.ts → workspace/codegenLock.test.ts} +1 -1
  257. package/{dependencyScanner.test.ts → workspace/dependencyScanner.test.ts} +1 -1
  258. package/{dependencyScanner.ts → workspace/dependencyScanner.ts} +2 -2
  259. package/{envSeed.test.ts → workspace/envSeed.test.ts} +2 -2
  260. package/{envSeed.ts → workspace/envSeed.ts} +1 -1
  261. package/{libSource.test.ts → workspace/libSource.test.ts} +2 -2
  262. package/{libSource.ts → workspace/libSource.ts} +1 -1
  263. package/{scanInfo.ts → workspace/scanInfo.ts} +21 -10
  264. package/{slicePlanner.test.ts → workspace/slicePlanner.test.ts} +2 -2
  265. package/{slicePlanner.ts → workspace/slicePlanner.ts} +1 -1
  266. package/{workspaceGraph.test.ts → workspace/workspaceGraph.test.ts} +1 -1
  267. package/{workspaceGraph.ts → workspace/workspaceGraph.ts} +1 -1
  268. package/{workspaceLayout.test.ts → workspace/workspaceLayout.test.ts} +1 -1
  269. package/{workspaceLayout.ts → workspace/workspaceLayout.ts} +3 -1
  270. package/akanContext.ts +0 -1083
  271. package/executors.ts +0 -1749
  272. /package/{applicationBuildReporter.test.ts → app/applicationBuildReporter.test.ts} +0 -0
  273. /package/{akanMcpToolError.ts → context/akanMcpToolError.ts} +0 -0
  274. /package/{moduleFieldNames.test.ts → context/moduleFieldNames.test.ts} +0 -0
  275. /package/{moduleFieldNames.ts → context/moduleFieldNames.ts} +0 -0
  276. /package/{recipeScanner.ts → context/recipeScanner.ts} +0 -0
  277. /package/{declarationReader.ts → docs/declarationReader.ts} +0 -0
  278. /package/{frameworkGraph.ts → docs/frameworkGraph.ts} +0 -0
  279. /package/{biomeBase.ts → lint/biomeBase.ts} +0 -0
  280. /package/{linter.ts → lint/linter.ts} +0 -0
  281. /package/{commentDensityScanner.test.ts → quality/commentDensityScanner.test.ts} +0 -0
  282. /package/{commentDensityScanner.ts → quality/commentDensityScanner.ts} +0 -0
  283. /package/{componentSizeScanner.test.ts → quality/componentSizeScanner.test.ts} +0 -0
  284. /package/{componentSizeScanner.ts → quality/componentSizeScanner.ts} +0 -0
  285. /package/{componentWriteChainScanner.test.ts → quality/componentWriteChainScanner.test.ts} +0 -0
  286. /package/{componentWriteChainScanner.ts → quality/componentWriteChainScanner.ts} +0 -0
  287. /package/{deprecatedCommentScanner.test.ts → quality/deprecatedCommentScanner.test.ts} +0 -0
  288. /package/{deprecatedCommentScanner.ts → quality/deprecatedCommentScanner.ts} +0 -0
  289. /package/{endpointReach.test.ts → quality/endpointReach.test.ts} +0 -0
  290. /package/{endpointReach.ts → quality/endpointReach.ts} +0 -0
  291. /package/{formSetterScanner.test.ts → quality/formSetterScanner.test.ts} +0 -0
  292. /package/{formSetterScanner.ts → quality/formSetterScanner.ts} +0 -0
  293. /package/{kindBranchScanner.test.ts → quality/kindBranchScanner.test.ts} +0 -0
  294. /package/{kindBranchScanner.ts → quality/kindBranchScanner.ts} +0 -0
  295. /package/{maintainabilityReport.test.ts → quality/maintainabilityReport.test.ts} +0 -0
  296. /package/{renderMutationScanner.test.ts → quality/renderMutationScanner.test.ts} +0 -0
  297. /package/{renderMutationScanner.ts → quality/renderMutationScanner.ts} +0 -0
  298. /package/{serviceLoopCallScanner.test.ts → quality/serviceLoopCallScanner.test.ts} +0 -0
  299. /package/{serviceLoopCallScanner.ts → quality/serviceLoopCallScanner.ts} +0 -0
  300. /package/{signalMutationIndex.test.ts → quality/signalMutationIndex.test.ts} +0 -0
  301. /package/{signalMutationIndex.ts → quality/signalMutationIndex.ts} +0 -0
  302. /package/{sourceComments.test.ts → quality/sourceComments.test.ts} +0 -0
  303. /package/{sourceComments.ts → quality/sourceComments.ts} +0 -0
  304. /package/{ssrScanner.test.ts → quality/ssrScanner.test.ts} +0 -0
  305. /package/{ssrScanner.ts → quality/ssrScanner.ts} +0 -0
  306. /package/{storeAccessScanner.test.ts → quality/storeAccessScanner.test.ts} +0 -0
  307. /package/{storeSource.ts → quality/storeSource.ts} +0 -0
  308. /package/{storeWriteScanner.test.ts → quality/storeWriteScanner.test.ts} +0 -0
  309. /package/{storeWriteScanner.ts → quality/storeWriteScanner.ts} +0 -0
  310. /package/{structureScanner.test.ts → quality/structureScanner.test.ts} +0 -0
  311. /package/{structureScanner.ts → quality/structureScanner.ts} +0 -0
  312. /package/{testOnlyExportScanner.test.ts → quality/testOnlyExportScanner.test.ts} +0 -0
  313. /package/{testOnlyExportScanner.ts → quality/testOnlyExportScanner.ts} +0 -0
  314. /package/{writePath.test.ts → quality/writePath.test.ts} +0 -0
  315. /package/{writePath.ts → quality/writePath.ts} +0 -0
  316. /package/{writePlacementScanner.test.ts → quality/writePlacementScanner.test.ts} +0 -0
  317. /package/{writePlacementScanner.ts → quality/writePlacementScanner.ts} +0 -0
  318. /package/{writingActionIndex.test.ts → quality/writingActionIndex.test.ts} +0 -0
  319. /package/{writingActionIndex.ts → quality/writingActionIndex.ts} +0 -0
  320. /package/{subspaceReport.ts → subspace/subspaceReport.ts} +0 -0
  321. /package/{sshTunnel.ts → tunnel/sshTunnel.ts} +0 -0
  322. /package/{fileEditor.ts → util/fileEditor.ts} +0 -0
  323. /package/{fileSys.test.ts → util/fileSys.test.ts} +0 -0
  324. /package/{fileSys.ts → util/fileSys.ts} +0 -0
  325. /package/{jsonFormatter.ts → util/jsonFormatter.ts} +0 -0
  326. /package/{selectModel.ts → util/selectModel.ts} +0 -0
  327. /package/{semver.test.ts → util/semver.test.ts} +0 -0
  328. /package/{semver.ts → util/semver.ts} +0 -0
  329. /package/{shellOnlyEnv.test.ts → util/shellOnlyEnv.test.ts} +0 -0
  330. /package/{shellOnlyEnv.ts → util/shellOnlyEnv.ts} +0 -0
  331. /package/{spinner.test.ts → util/spinner.test.ts} +0 -0
  332. /package/{spinner.ts → util/spinner.ts} +0 -0
  333. /package/{stripAnsi.ts → util/stripAnsi.ts} +0 -0
  334. /package/{codegenLock.ts → workspace/codegenLock.ts} +0 -0
  335. /package/{getRelatedCnsts.ts → workspace/getRelatedCnsts.ts} +0 -0
  336. /package/{gitRevision.test.ts → workspace/gitRevision.test.ts} +0 -0
  337. /package/{gitRevision.ts → workspace/gitRevision.ts} +0 -0
  338. /package/{manifestDependencies.ts → workspace/manifestDependencies.ts} +0 -0
  339. /package/{packageExportsMap.ts → workspace/packageExportsMap.ts} +0 -0
  340. /package/{repoIdentity.ts → workspace/repoIdentity.ts} +0 -0
  341. /package/{types.ts → workspace/types.ts} +0 -0
@@ -0,0 +1,23 @@
1
+ import { AkanLibConfig } from "../akanConfig";
2
+ import { Executor, execEmoji } from "./executor";
3
+ import { type NamedExecutorOptions, SysExecutor } from "./sysExecutor";
4
+ import { WorkspaceExecutor } from "./workspaceExecutor";
5
+
6
+ export class LibExecutor extends SysExecutor {
7
+ dist: Executor;
8
+ override emoji = execEmoji.lib;
9
+ constructor({ workspace, name }: NamedExecutorOptions) {
10
+ super({ workspace, name, type: "lib" });
11
+ this.dist = new Executor(`dist/${name}`, `${this.workspace.workspaceRoot}/dist/libs/${name}`);
12
+ }
13
+ static from(executor: SysExecutor | WorkspaceExecutor, name: string) {
14
+ return new LibExecutor({ workspace: executor instanceof WorkspaceExecutor ? executor : executor.workspace, name });
15
+ }
16
+
17
+ #akanConfig: AkanLibConfig | null = null;
18
+ override async getConfig({ refresh }: { refresh?: boolean } = {}) {
19
+ if (this.#akanConfig && !refresh) return this.#akanConfig;
20
+ this.#akanConfig = await AkanLibConfig.from(this, { bustImportCache: refresh });
21
+ return this.#akanConfig;
22
+ }
23
+ }
@@ -0,0 +1,18 @@
1
+ import { Executor, execEmoji } from "./executor";
2
+ import type { SysExecutor } from "./sysExecutor";
3
+
4
+ interface ModuleExecutorOptions {
5
+ sys: SysExecutor;
6
+ name: string;
7
+ }
8
+ export class ModuleExecutor extends Executor {
9
+ sys: SysExecutor;
10
+ override emoji = execEmoji.module;
11
+ constructor({ sys, name }: ModuleExecutorOptions) {
12
+ super(name, `${sys.workspace.workspaceRoot}/${sys.type}s/${sys.name}/lib/${name}`);
13
+ this.sys = sys;
14
+ }
15
+ static from(sysExecutor: SysExecutor, name: string) {
16
+ return new ModuleExecutor({ sys: sysExecutor, name });
17
+ }
18
+ }
@@ -0,0 +1,129 @@
1
+ import path from "node:path";
2
+ import { PkgInfo } from "../workspace/scanInfo";
3
+ import type { PackageJson, TsConfigJson } from "../workspace/types";
4
+ import { Executor, execEmoji } from "./executor";
5
+ import type { NamedExecutorOptions, SysExecutor } from "./sysExecutor";
6
+ import { WorkspaceExecutor } from "./workspaceExecutor";
7
+
8
+ export class PkgExecutor extends Executor {
9
+ workspace: WorkspaceExecutor;
10
+ override name: string;
11
+ dist: Executor;
12
+ override emoji = execEmoji.pkg;
13
+ constructor({ workspace = WorkspaceExecutor.fromRoot(), name }: NamedExecutorOptions) {
14
+ super(name, `${workspace.workspaceRoot}/pkgs/${name}`);
15
+ this.workspace = workspace;
16
+ this.name = name;
17
+ this.dist = new Executor(`dist/${name}`, `${this.workspace.workspaceRoot}/dist/pkgs/${name}`);
18
+ }
19
+ static from(executor: SysExecutor | WorkspaceExecutor, name: string) {
20
+ return new PkgExecutor({ workspace: executor instanceof WorkspaceExecutor ? executor : executor.workspace, name });
21
+ }
22
+
23
+ #scanInfo: PkgInfo | null = null;
24
+ async scan({ refresh }: { refresh?: boolean } = {}): Promise<PkgInfo> {
25
+ if (this.#scanInfo && !refresh) return this.#scanInfo;
26
+ const scanInfo = await PkgInfo.fromExecutor(this, { refresh });
27
+ this.#scanInfo = scanInfo;
28
+ return scanInfo;
29
+ }
30
+ async #getDependencyVersion(rootPackageJson: PackageJson, dep: string): Promise<string | undefined> {
31
+ const rootDeps = {
32
+ ...rootPackageJson.dependencies,
33
+ ...rootPackageJson.devDependencies,
34
+ };
35
+ const rootVersion = rootDeps[dep];
36
+ if (rootVersion) return rootVersion;
37
+ // Overrides never reach a consumer's install, so a pinned transitive dep is published as a dependency.
38
+ const overrideVersion = rootPackageJson.overrides?.[dep];
39
+ if (typeof overrideVersion === "string") return overrideVersion;
40
+
41
+ try {
42
+ const packageJsonPath = `pkgs/${dep}/package.json`;
43
+ if (!(await Bun.file(path.join(this.workspace.workspaceRoot, packageJsonPath)).exists())) return undefined;
44
+ const packageJson = await this.workspace.readJson(packageJsonPath);
45
+ if ((packageJson as PackageJson).name === dep) return (packageJson as PackageJson).version;
46
+ } catch {
47
+ return undefined;
48
+ }
49
+ }
50
+ async #toDependencyMap(
51
+ rootPackageJson: PackageJson,
52
+ dependencies: string[] = [],
53
+ devDependencies: string[] = [],
54
+ ): Promise<Pick<PackageJson, "dependencies" | "devDependencies">> {
55
+ const dependencyNames = [...new Set(dependencies)].sort();
56
+ const devDependencyNames = [...new Set(devDependencies)]
57
+ .filter((dep) => !dependencyNames.includes(dep))
58
+ .sort((a, b) => (a < b ? -1 : a > b ? 1 : 0));
59
+ const dependencyVersions = new Map<string, string>();
60
+ const missingDeps: string[] = [];
61
+ for (const dep of [...dependencyNames, ...devDependencyNames]) {
62
+ const version = await this.#getDependencyVersion(rootPackageJson, dep);
63
+ if (version) dependencyVersions.set(dep, version);
64
+ else missingDeps.push(dep);
65
+ }
66
+ if (missingDeps.length > 0)
67
+ throw new Error(`Missing dependency versions in root package.json: ${missingDeps.join(", ")}`);
68
+
69
+ const toDependencyMap = (names: string[]) =>
70
+ Object.fromEntries(names.map((dep) => [dep, dependencyVersions.get(dep) as string]));
71
+ return { dependencies: toDependencyMap(dependencyNames), devDependencies: toDependencyMap(devDependencyNames) };
72
+ }
73
+ async updatePackageJsonDependencies(
74
+ dependencies: string[] = [],
75
+ devDependencies: string[] = [],
76
+ ): Promise<PackageJson> {
77
+ const [rootPackageJson, pkgJson] = await Promise.all([this.workspace.getPackageJson(), this.getPackageJson()]);
78
+ const dependencyMaps = await this.#toDependencyMap(rootPackageJson, dependencies, devDependencies);
79
+ const newPkgJson = {
80
+ ...pkgJson,
81
+ ...dependencyMaps,
82
+ };
83
+ await this.writeJson("package.json", newPkgJson);
84
+ return newPkgJson;
85
+ }
86
+ async generateDistPackageJson(dependencies: string[] = [], devDependencies: string[] = []): Promise<PackageJson> {
87
+ const [rootPackageJson, pkgJson] = await Promise.all([this.workspace.getPackageJson(), this.getPackageJson()]);
88
+ const dependencyMaps = await this.#toDependencyMap(rootPackageJson, dependencies, devDependencies);
89
+ const distPkgJson: PackageJson = {
90
+ ...pkgJson,
91
+ type: "module",
92
+ exports: {
93
+ ...pkgJson.exports,
94
+ ".": {
95
+ import: "./index.ts",
96
+ types: "./index.ts",
97
+ default: "./index.ts",
98
+ },
99
+ },
100
+ engines: { bun: ">=1.4.4" },
101
+ ...dependencyMaps,
102
+ };
103
+ await Promise.all([this.dist.writeJson("package.json", distPkgJson), this.writeJson("package.json", distPkgJson)]);
104
+ return distPkgJson;
105
+ }
106
+ async build(): Promise<void> {
107
+ await Bun.build({
108
+ root: this.cwdPath,
109
+ entrypoints: [`${this.cwdPath}/index.ts`],
110
+ splitting: false,
111
+ target: "bun",
112
+ });
113
+ await this.cp(`${this.cwdPath}/dist`, this.dist.cwdPath);
114
+ }
115
+ async generateTsconfigJson(): Promise<TsConfigJson> {
116
+ const [rootTsconfig, pkgTsconfig] = await Promise.all([this.workspace.getTsConfig(), this.getTsConfig()]);
117
+ const tsconfig: TsConfigJson = {
118
+ ...rootTsconfig,
119
+ ...pkgTsconfig,
120
+ compilerOptions: {
121
+ ...rootTsconfig.compilerOptions,
122
+ ...pkgTsconfig.compilerOptions,
123
+ paths: {},
124
+ },
125
+ };
126
+ await this.dist.writeJson("tsconfig.json", tsconfig);
127
+ return tsconfig;
128
+ }
129
+ }
@@ -0,0 +1,301 @@
1
+ import { existsSync } from "node:fs";
2
+ import path from "node:path";
3
+ import { capitalize, getPageSourceFileViolation } from "akanjs/common";
4
+ import { AkanAppConfig, AkanLibConfig } from "../akanConfig";
5
+ import {
6
+ renderScopeAgentBlock,
7
+ renderScopeAgentsMd,
8
+ renderScopeClaudeMd,
9
+ scanScopeRecipes,
10
+ upsertAgentBlock,
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
+ import type { AppExecutor } from "./appExecutor";
19
+ import { Executor, execEmoji } from "./executor";
20
+ import type { LibExecutor } from "./libExecutor";
21
+ import { WorkspaceExecutor } from "./workspaceExecutor";
22
+
23
+ export interface NamedExecutorOptions {
24
+ workspace?: WorkspaceExecutor;
25
+ name: string;
26
+ }
27
+ interface SysExecutorOptions extends NamedExecutorOptions {
28
+ type: "app" | "lib";
29
+ }
30
+
31
+ export class SysExecutor extends Executor {
32
+ workspace: WorkspaceExecutor;
33
+ override name: string;
34
+ type: "app" | "lib";
35
+ override emoji: string;
36
+ constructor({ workspace = WorkspaceExecutor.fromRoot(), name, type }: SysExecutorOptions) {
37
+ super(name, `${workspace.workspaceRoot}/${type}s/${name}`);
38
+ this.workspace = workspace;
39
+ this.name = name;
40
+ this.type = type;
41
+ this.emoji = execEmoji[type];
42
+ }
43
+ #akanConfig: AkanAppConfig | AkanLibConfig | null = null;
44
+ async getConfig({ refresh }: { refresh?: boolean } = {}) {
45
+ if (this.#akanConfig && !refresh) return this.#akanConfig;
46
+ this.#akanConfig =
47
+ this.type === "app"
48
+ ? await AkanAppConfig.from(this as unknown as AppExecutor)
49
+ : await AkanLibConfig.from(this as unknown as LibExecutor);
50
+ return this.#akanConfig;
51
+ }
52
+ async getModules() {
53
+ const path = this.type === "app" ? `apps/${this.name}/lib` : `libs/${this.name}/lib`;
54
+ return await this.workspace.getDirInModule(path, this.name);
55
+ }
56
+ async getPageConventionViolations(): Promise<{ relativePath: string; reason: string }[]> {
57
+ if (!(await this.exists("page"))) return [];
58
+ const violations: { relativePath: string; reason: string }[] = [];
59
+ for (const entry of await this.getAllFiles("**/*", { cwd: this.getPath("page") })) {
60
+ const relativePath = entry.split(path.sep).join("/");
61
+ const reason = getPageSourceFileViolation(relativePath);
62
+ if (reason) violations.push({ relativePath: `page/${relativePath}`, reason });
63
+ }
64
+ return violations;
65
+ }
66
+
67
+ #scanInfo: AppInfo | LibInfo | null = null;
68
+ hasScanInfo() {
69
+ return this.#scanInfo !== null;
70
+ }
71
+ getScanInfo<AllowEmpty extends boolean = false>({
72
+ allowEmpty,
73
+ }: {
74
+ allowEmpty?: AllowEmpty;
75
+ } = {}): AllowEmpty extends true ? AppInfo | LibInfo | null : AppInfo | LibInfo {
76
+ if (!this.hasScanInfo() && !allowEmpty) throw new Error("Scan info is not available");
77
+ return this.#scanInfo as AllowEmpty extends true ? AppInfo | LibInfo | null : AppInfo | LibInfo;
78
+ }
79
+ async #seedEnvFiles(): Promise<FileContent[]> {
80
+ const envDir = path.join(this.cwdPath, "env");
81
+ const missing = await new EnvSeed(envDir).missing();
82
+ if (!missing.length) return [];
83
+ const written = await Promise.all(
84
+ missing.map(({ fileName, content }) =>
85
+ this.writeFile(path.join(envDir, fileName), content, { overwrite: false, silent: true }),
86
+ ),
87
+ );
88
+ this.logger.info(
89
+ `${missing.map(({ fileName }) => `env/${fileName}`).join(", ")} were missing (gitignored, so a clone has none) and now hold local defaults: put this machine's values in them, or fetch the team's with \`akan download-env\`.`,
90
+ );
91
+ return written;
92
+ }
93
+ #getScanTemplateTasks(scanInfo: AppInfo | LibInfo): (Promise<FileContent[]> | null)[] {
94
+ return [
95
+ this.#seedEnvFiles(),
96
+ this._applyTemplate({ basePath: "env", template: "env", scanInfo }),
97
+ this._applyTemplate({ basePath: "lib", template: "lib", scanInfo }),
98
+ this._applyTemplate({ basePath: ".", template: "server.ts", scanInfo }),
99
+ this._applyTemplate({ basePath: ".", template: "client.ts", scanInfo }),
100
+ this.type === "lib" ? this._applyTemplate({ basePath: ".", template: "index.ts", scanInfo }) : null,
101
+ ...barrelFacetDirs.map((facet) =>
102
+ this._applyTemplate({
103
+ basePath: facet,
104
+ template: "facetIndex/index.ts",
105
+ scanInfo,
106
+ options: { exec: this, facet },
107
+ }),
108
+ ),
109
+ ...[
110
+ ...scanInfo.getDatabaseModules().map((model) => [model, `lib/${model}`]),
111
+ ...scanInfo.getServiceModules().map((model) => [model, `lib/_${model}`]),
112
+ ...scanInfo.getScalarModules().map((model) => [model, `lib/__scalar/${model}`]),
113
+ ].map(([model, basePath]) =>
114
+ this._applyTemplate({ basePath, template: "moduleRoot", scanInfo, dict: { model, Model: capitalize(model) } }),
115
+ ),
116
+ ];
117
+ }
118
+ async scan({
119
+ refresh = false,
120
+ write = true,
121
+ writeLib = write,
122
+ }: {
123
+ refresh?: boolean;
124
+ write?: boolean;
125
+ writeLib?: boolean;
126
+ } = {}): Promise<AppInfo | LibInfo> {
127
+ if (this.#scanInfo && !refresh) return this.#scanInfo;
128
+ const scanInfo =
129
+ this.type === "app"
130
+ ? await AppInfo.fromExecutor(this as unknown as AppExecutor, {
131
+ refresh,
132
+ })
133
+ : await LibInfo.fromExecutor(this as unknown as LibExecutor, {
134
+ refresh,
135
+ });
136
+ //* Locked: `writeLib` rewrites dependency-lib barrels that other dev servers regenerate and watch too.
137
+ if (write)
138
+ await CodegenLock.run(this.workspace.workspaceRoot, `scan:${this.name}`, async () => {
139
+ await Promise.all(this.#getScanTemplateTasks(scanInfo));
140
+ await this.writeJson(`akan.${this.type}.json`, scanInfo.getScanResult());
141
+ await this.#updateDependencies(scanInfo);
142
+ if (writeLib) {
143
+ const libInfos = [...scanInfo.getLibInfos().values()];
144
+ await Promise.all(libInfos.flatMap((libInfo) => libInfo.exec.#getScanTemplateTasks(libInfo)));
145
+ }
146
+ await this.syncAgentsIndex(scanInfo);
147
+ });
148
+ this.#scanInfo = scanInfo;
149
+ return scanInfo;
150
+ }
151
+ /** Rewrites only the marker block of the scoped AGENTS.md; content outside the markers belongs to the user. */
152
+ async syncAgentsIndex(scanInfo?: AppInfo | LibInfo) {
153
+ const info = scanInfo ?? (await this.scan({ write: false }));
154
+ const scope = { type: this.type, name: this.name };
155
+ const recipes = await scanScopeRecipes(this.workspace.workspaceRoot, scope, info.getScanResult().libDeps);
156
+ const block = renderScopeAgentBlock(scope, recipes);
157
+ const existing = (await this.exists("AGENTS.md")) ? await this.readFile("AGENTS.md") : null;
158
+ await this.writeFile(
159
+ "AGENTS.md",
160
+ existing?.trim() ? upsertAgentBlock(existing, block) : renderScopeAgentsMd(scope, block),
161
+ );
162
+ // CLAUDE.md 는 얇은 포인터라 최초 1회만 깔아준다 — 사용자가 지우거나 고친 것을 되살리지 않는다.
163
+ if (!(await this.exists("CLAUDE.md"))) await this.writeFile("CLAUDE.md", renderScopeClaudeMd(scope));
164
+ }
165
+ //* The root is the cached copy the dependency scan read, so a name it declares is judged by the same snapshot.
166
+ async #updateDependencies(scanInfo: AppInfo | LibInfo) {
167
+ const [rootPackageJson, packageJson] = await Promise.all([
168
+ this.workspace.getPackageJson(),
169
+ this.getPackageJson({ refresh: true }),
170
+ ]);
171
+ const { dependencies: runtime, devDependencies: typeOnly, akanConfig } = scanInfo.getScanResult();
172
+ const kept = new Set([
173
+ ...ManifestDependencies.keptBy(packageJson),
174
+ ...akanConfig.externalLibs,
175
+ ...akanConfig.trustedDependencies,
176
+ ]);
177
+ //? The scan leaves the framework out of its imports on purpose, so it is never a prune candidate.
178
+ const isKept = (dep: string) => kept.has(dep) || isAkanFrameworkDependency(dep);
179
+ const { dependencies, devDependencies, removed, unverifiable } = new ManifestDependencies(
180
+ rootPackageJson,
181
+ { runtime, typeOnly },
182
+ isKept,
183
+ ).realign(packageJson);
184
+ const manifestPath = `${this.type}s/${this.name}/package.json`;
185
+ if (removed.length)
186
+ this.logger.info(
187
+ `Removed from ${manifestPath}, declared by the root and imported nowhere: ${removed.join(", ")} (list one in akan.keepDependencies to keep it)`,
188
+ );
189
+ if (unverifiable.length)
190
+ this.logger.warn(
191
+ `${manifestPath} lists ${unverifiable.join(", ")}, which the root package.json does not declare, so sync cannot tell whether it is used; kept as is`,
192
+ );
193
+ await this.setPackageJson({ ...packageJson, dependencies, devDependencies });
194
+ }
195
+ override async getLocalFile(targetPath: string) {
196
+ const filePath = path.isAbsolute(targetPath) ? targetPath : `${this.type}s/${this.name}/${targetPath}`;
197
+ const content = await this.workspace.readFile(filePath);
198
+ return { filePath, content };
199
+ }
200
+
201
+ async getDatabaseModules() {
202
+ return (await this.readdir("lib"))
203
+ .filter((name) => !name.startsWith("_") && !name.endsWith(".ts"))
204
+ .filter((name) => existsSync(`${this.cwdPath}/lib/${name}/${name}.constant.ts`));
205
+ }
206
+
207
+ async getServiceModules() {
208
+ return (await this.readdir("lib"))
209
+ .filter((name) => name.startsWith("_") && !name.startsWith("__"))
210
+ .filter((name) => existsSync(`${this.cwdPath}/lib/${name}/${name.slice(1)}.service.ts`));
211
+ }
212
+
213
+ async getScalarModules() {
214
+ return (await this.readdir("lib/__scalar"))
215
+ .filter((name) => !name.startsWith("_"))
216
+ .filter((name) => existsSync(`${this.cwdPath}/lib/__scalar/${name}/${name}.constant.ts`));
217
+ }
218
+
219
+ async #getComponentModules(role: "View" | "Unit" | "Template") {
220
+ return (await this.readdir("lib"))
221
+ .filter((name) => !name.startsWith("_") && !name.endsWith(".ts"))
222
+ .filter((name) => existsSync(`${this.cwdPath}/lib/${name}/${capitalize(name)}.${role}.tsx`));
223
+ }
224
+ async #getComponentSources(role: "View" | "Unit" | "Template") {
225
+ const modules = await this.#getComponentModules(role);
226
+ return Promise.all(modules.map((name) => this.getLocalFile(`lib/${name}/${capitalize(name)}.${role}.tsx`)));
227
+ }
228
+ async getViewComponents() {
229
+ return await this.#getComponentModules("View");
230
+ }
231
+ async getUnitComponents() {
232
+ return await this.#getComponentModules("Unit");
233
+ }
234
+ async getTemplateComponents() {
235
+ return await this.#getComponentModules("Template");
236
+ }
237
+ async getViewsSourceCode() {
238
+ return await this.#getComponentSources("View");
239
+ }
240
+ async getUnitsSourceCode() {
241
+ return await this.#getComponentSources("Unit");
242
+ }
243
+ async getTemplatesSourceCode() {
244
+ return await this.#getComponentSources("Template");
245
+ }
246
+
247
+ async getScalarConstantFiles() {
248
+ const scalarModules = await this.getScalarModules();
249
+ return Promise.all(
250
+ scalarModules.map((scalarModule) =>
251
+ this.getLocalFile(`lib/__scalar/${scalarModule}/${scalarModule}.constant.ts`),
252
+ ),
253
+ );
254
+ }
255
+
256
+ async getScalarDictionaryFiles() {
257
+ const scalarModules = await this.getScalarModules();
258
+ return Promise.all(
259
+ scalarModules.map((scalarModule) =>
260
+ this.getLocalFile(`lib/__scalar/${scalarModule}/${scalarModule}.dictionary.ts`),
261
+ ),
262
+ );
263
+ }
264
+
265
+ async getConstantFiles() {
266
+ const modules = await this.getModules();
267
+ return Promise.all(modules.map((module) => this.getLocalFile(`lib/${module}/${module}.constant.ts`)));
268
+ }
269
+ async getConstantFilesWithLibs() {
270
+ const scanInfo =
271
+ this.type === "app"
272
+ ? await AppInfo.fromExecutor(this as unknown as AppExecutor)
273
+ : await LibInfo.fromExecutor(this as unknown as LibExecutor);
274
+ const sysContantFiles = await this.getConstantFiles();
275
+ const sysScalarConstantFiles = await this.getScalarConstantFiles();
276
+ const libDeps = scanInfo.getLibs();
277
+ const libConstantFiles = await Promise.all(
278
+ //? Not LibExecutor.from: libExecutor.ts extends this file's class, so importing it here would load it first.
279
+ libDeps.map(async (lib) => {
280
+ const libSys = new SysExecutor({ workspace: this.workspace, name: lib, type: "lib" });
281
+ return [...(await libSys.getConstantFiles()), ...(await libSys.getScalarConstantFiles())];
282
+ }),
283
+ );
284
+ return [...sysContantFiles, ...sysScalarConstantFiles, ...libConstantFiles.flat()];
285
+ }
286
+ async getDictionaryFiles() {
287
+ const modules = await this.getModules();
288
+ return Promise.all(modules.map((module) => this.getLocalFile(`lib/${module}/${module}.dictionary.ts`)));
289
+ }
290
+ override async applyTemplate(options: {
291
+ basePath: string;
292
+ template: string;
293
+ dict?: { [key: string]: string };
294
+ overwrite?: boolean;
295
+ }): Promise<FileContent[]> {
296
+ const scanInfo = await this.scan();
297
+ const fileContents = await super.applyTemplate({ ...options, scanInfo });
298
+ await this.scan();
299
+ return fileContents;
300
+ }
301
+ }