akanjs 2.0.6 → 2.1.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 (530) hide show
  1. package/README.ko.md +5 -5
  2. package/README.md +5 -5
  3. package/client/router.ts +10 -3
  4. package/constant/serialize.ts +1 -1
  5. package/document/documentSchema.ts +9 -1
  6. package/index.ts +187 -0
  7. package/package.json +6 -50
  8. package/server/akanApp.ts +49 -30
  9. package/server/akanAppHeaders.ts +30 -0
  10. package/server/di/predefinedAdaptor.ts +1 -1
  11. package/server/processMetricsCollector.ts +79 -1
  12. package/server/resolver/database.resolver.ts +82 -31
  13. package/server/resolver/signal.resolver.ts +67 -28
  14. package/service/ipcTypes.ts +5 -0
  15. package/service/predefinedAdaptor/database.adaptor.ts +95 -27
  16. package/service/predefinedAdaptor/solidSqlite.ts +7 -7
  17. package/service/predefinedAdaptor/storage.adaptor.ts +35 -9
  18. package/signal/index.ts +1 -0
  19. package/signal/middleware.ts +5 -1
  20. package/signal/signalContext.ts +85 -31
  21. package/signal/trace.ts +279 -0
  22. package/types/dictionary/base.dictionary.d.ts +1 -1
  23. package/types/dictionary/dictionary.d.ts +8 -8
  24. package/types/document/documentSchema.d.ts +33 -0
  25. package/types/document/index.d.ts +1 -1
  26. package/types/document/schema.d.ts +1 -1
  27. package/types/document/types.d.ts +1 -1
  28. package/types/{devkit/akanConfig/types.d.ts → index.d.ts} +45 -54
  29. package/types/server/akanAppHeaders.d.ts +1 -0
  30. package/types/server/di/predefinedAdaptor.d.ts +1 -1
  31. package/types/server/processMetricsCollector.d.ts +2 -0
  32. package/types/service/ipcTypes.d.ts +5 -0
  33. package/types/service/predefinedAdaptor/database.adaptor.d.ts +26 -32
  34. package/types/service/predefinedAdaptor/solidSqlite.d.ts +3 -3
  35. package/types/service/predefinedAdaptor/storage.adaptor.d.ts +8 -2
  36. package/types/signal/index.d.ts +1 -0
  37. package/types/signal/signalContext.d.ts +4 -1
  38. package/types/signal/trace.d.ts +97 -0
  39. package/types/store/baseSt.d.ts +2 -2
  40. package/types/ui/Signal/style.d.ts +15 -0
  41. package/ui/Link/SsrLink.tsx +2 -2
  42. package/ui/Signal/Arg.tsx +22 -15
  43. package/ui/Signal/Doc.tsx +28 -21
  44. package/ui/Signal/Listener.tsx +15 -39
  45. package/ui/Signal/Message.tsx +32 -50
  46. package/ui/Signal/Object.tsx +16 -13
  47. package/ui/Signal/PubSub.tsx +29 -47
  48. package/ui/Signal/Response.tsx +7 -17
  49. package/ui/Signal/RestApi.tsx +41 -57
  50. package/ui/Signal/WebSocket.tsx +1 -1
  51. package/ui/Signal/style.ts +36 -0
  52. package/webkit/useCodepush.tsx +1 -1
  53. package/webkit/useCsrValues.ts +147 -37
  54. package/cli/application/application.command.ts +0 -221
  55. package/cli/application/application.interface.tsx +0 -225
  56. package/cli/application/application.runner.ts +0 -357
  57. package/cli/application/application.script.ts +0 -244
  58. package/cli/build.ts +0 -26
  59. package/cli/cloud/cloud.command.ts +0 -48
  60. package/cli/cloud/cloud.runner.ts +0 -157
  61. package/cli/cloud/cloud.script.ts +0 -40
  62. package/cli/guideline/guideline.command.ts +0 -31
  63. package/cli/guideline/guideline.prompt.ts +0 -212
  64. package/cli/guideline/guideline.runner.ts +0 -53
  65. package/cli/guideline/guideline.script.ts +0 -33
  66. package/cli/guidelines/___library/sharedUiStructureDescription.en.md +0 -767
  67. package/cli/guidelines/___library/utilUiStructureDescription.en.md +0 -395
  68. package/cli/guidelines/___lint/lintRuleDescription.en.md +0 -64
  69. package/cli/guidelines/___module/moduleStructureDescription.en.md +0 -80
  70. package/cli/guidelines/componentRule/componentRule.generate.json +0 -131
  71. package/cli/guidelines/componentRule/componentRule.instruction.md +0 -637
  72. package/cli/guidelines/cssRule/cssRule.generate.json +0 -93
  73. package/cli/guidelines/cssRule/cssRule.instruction.md +0 -435
  74. package/cli/guidelines/databaseModule/databaseModule.generate.json +0 -51
  75. package/cli/guidelines/databaseModule/databaseModule.instruction.md +0 -612
  76. package/cli/guidelines/docPageRule/docPageRule.generate.json +0 -72
  77. package/cli/guidelines/docPageRule/docPageRule.instruction.md +0 -389
  78. package/cli/guidelines/enumConstant/enumConstant.generate.json +0 -24
  79. package/cli/guidelines/enumConstant/enumConstant.instruction.md +0 -232
  80. package/cli/guidelines/framework/framework.generate.json +0 -119
  81. package/cli/guidelines/framework/framework.instruction.md +0 -1110
  82. package/cli/guidelines/howToUseStore/howToUseStore.generate.json +0 -0
  83. package/cli/guidelines/modelConstant/modelConstant.generate.json +0 -128
  84. package/cli/guidelines/modelConstant/modelConstant.instruction.md +0 -506
  85. package/cli/guidelines/modelDictionary/modelDictionary.generate.json +0 -108
  86. package/cli/guidelines/modelDictionary/modelDictionary.instruction.md +0 -547
  87. package/cli/guidelines/modelDocument/modelDocument.generate.json +0 -129
  88. package/cli/guidelines/modelDocument/modelDocument.instruction.md +0 -509
  89. package/cli/guidelines/modelService/modelService.generate.json +0 -135
  90. package/cli/guidelines/modelService/modelService.instruction.md +0 -708
  91. package/cli/guidelines/modelSignal/modelSignal.generate.json +0 -201
  92. package/cli/guidelines/modelSignal/modelSignal.instruction.md +0 -552
  93. package/cli/guidelines/modelStore/modelStore.generate.json +0 -130
  94. package/cli/guidelines/modelStore/modelStore.instruction.md +0 -585
  95. package/cli/guidelines/modelTemplate/modelTemplate.generate.json +0 -104
  96. package/cli/guidelines/modelTemplate/modelTemplate.instruction.md +0 -604
  97. package/cli/guidelines/modelUnit/modelUnit.generate.json +0 -92
  98. package/cli/guidelines/modelUnit/modelUnit.instruction.md +0 -541
  99. package/cli/guidelines/modelUtil/modelUtil.generate.json +0 -93
  100. package/cli/guidelines/modelUtil/modelUtil.instruction.md +0 -752
  101. package/cli/guidelines/modelView/modelView.generate.json +0 -80
  102. package/cli/guidelines/modelView/modelView.instruction.md +0 -1005
  103. package/cli/guidelines/modelZone/modelZone.generate.json +0 -126
  104. package/cli/guidelines/modelZone/modelZone.instruction.md +0 -528
  105. package/cli/guidelines/scalarConstant/scalarConstant.generate.json +0 -106
  106. package/cli/guidelines/scalarConstant/scalarConstant.instruction.md +0 -442
  107. package/cli/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -83
  108. package/cli/guidelines/scalarDictionary/scalarDictionary.instruction.md +0 -273
  109. package/cli/guidelines/scalarModule/scalarModule.generate.json +0 -35
  110. package/cli/guidelines/scalarModule/scalarModule.instruction.md +0 -81
  111. package/cli/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -108
  112. package/cli/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -310
  113. package/cli/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -140
  114. package/cli/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -339
  115. package/cli/index.js +0 -184404
  116. package/cli/index.ts +0 -24
  117. package/cli/library/library.command.ts +0 -28
  118. package/cli/library/library.runner.ts +0 -66
  119. package/cli/library/library.script.ts +0 -39
  120. package/cli/module/module.command.ts +0 -35
  121. package/cli/module/module.prompt.ts +0 -18
  122. package/cli/module/module.request.ts +0 -319
  123. package/cli/module/module.runner.ts +0 -76
  124. package/cli/module/module.script.ts +0 -161
  125. package/cli/npmRegistry.ts +0 -13
  126. package/cli/openBrowser.ts +0 -15
  127. package/cli/package/package.command.ts +0 -32
  128. package/cli/package/package.runner.ts +0 -94
  129. package/cli/package/package.script.ts +0 -35
  130. package/cli/page/page.command.ts +0 -14
  131. package/cli/page/page.runner.ts +0 -14
  132. package/cli/page/page.script.ts +0 -12
  133. package/cli/pluralizeName.ts +0 -5
  134. package/cli/scalar/scalar.command.ts +0 -21
  135. package/cli/scalar/scalar.prompt.ts +0 -131
  136. package/cli/scalar/scalar.runner.ts +0 -38
  137. package/cli/scalar/scalar.script.ts +0 -16
  138. package/cli/semver.ts +0 -18
  139. package/cli/templates/__scalar/__model__/__model__.constant.ts +0 -15
  140. package/cli/templates/__scalar/__model__/__model__.dictionary.ts +0 -19
  141. package/cli/templates/__scalar/__model__/__model__.document.ts +0 -15
  142. package/cli/templates/app/akan.config.ts +0 -14
  143. package/cli/templates/app/env/env.client.debug.ts.template +0 -7
  144. package/cli/templates/app/env/env.client.develop.ts.template +0 -7
  145. package/cli/templates/app/env/env.client.local.ts.template +0 -7
  146. package/cli/templates/app/env/env.client.main.ts.template +0 -7
  147. package/cli/templates/app/env/env.client.testing.ts.template +0 -7
  148. package/cli/templates/app/env/env.client.ts +0 -21
  149. package/cli/templates/app/env/env.client.type.ts +0 -16
  150. package/cli/templates/app/env/env.server.debug.ts.template +0 -7
  151. package/cli/templates/app/env/env.server.develop.ts.template +0 -7
  152. package/cli/templates/app/env/env.server.local.ts.template +0 -7
  153. package/cli/templates/app/env/env.server.main.ts.template +0 -7
  154. package/cli/templates/app/env/env.server.testing.ts.template +0 -6
  155. package/cli/templates/app/env/env.server.ts +0 -20
  156. package/cli/templates/app/lib/___appName__/__appName__.dictionary.ts +0 -17
  157. package/cli/templates/app/lib/___appName__/__appName__.service.ts +0 -13
  158. package/cli/templates/app/lib/___appName__/__appName__.signal.ts +0 -17
  159. package/cli/templates/app/lib/___appName__/__appName__.store.ts +0 -15
  160. package/cli/templates/app/lib/option.ts +0 -17
  161. package/cli/templates/app/main.ts +0 -16
  162. package/cli/templates/app/package.json.template +0 -5
  163. package/cli/templates/app/page/_index.tsx +0 -296
  164. package/cli/templates/app/page/_layout.tsx +0 -31
  165. package/cli/templates/app/page/styles.css.template +0 -53
  166. package/cli/templates/app/public/favicon.ico +0 -0
  167. package/cli/templates/app/public/logo.png +0 -0
  168. package/cli/templates/app/tsconfig.json.template +0 -21
  169. package/cli/templates/client.ts +0 -46
  170. package/cli/templates/crudPages/[__model__Id]/edit/page.tsx +0 -47
  171. package/cli/templates/crudPages/[__model__Id]/page.tsx +0 -52
  172. package/cli/templates/crudPages/new/page.tsx +0 -42
  173. package/cli/templates/crudPages/page.tsx +0 -43
  174. package/cli/templates/crudSinglePage/page.tsx +0 -37
  175. package/cli/templates/env/_env.server.type.ts +0 -16
  176. package/cli/templates/facetIndex/index.ts +0 -32
  177. package/cli/templates/index.ts +0 -10
  178. package/cli/templates/lib/__lib/lib.constant.ts +0 -38
  179. package/cli/templates/lib/__lib/lib.dictionary.ts +0 -33
  180. package/cli/templates/lib/__lib/lib.document.ts +0 -35
  181. package/cli/templates/lib/__lib/lib.service.ts +0 -33
  182. package/cli/templates/lib/__lib/lib.signal.ts +0 -34
  183. package/cli/templates/lib/__lib/lib.store.ts +0 -33
  184. package/cli/templates/lib/cnst.ts +0 -29
  185. package/cli/templates/lib/db.ts +0 -32
  186. package/cli/templates/lib/dict.ts +0 -49
  187. package/cli/templates/lib/sig.ts +0 -60
  188. package/cli/templates/lib/srv.ts +0 -34
  189. package/cli/templates/lib/st.ts +0 -31
  190. package/cli/templates/lib/useClient.ts +0 -19
  191. package/cli/templates/lib/useServer.ts +0 -7
  192. package/cli/templates/libRoot/.gitignore.template +0 -16
  193. package/cli/templates/libRoot/akan.config.ts +0 -12
  194. package/cli/templates/libRoot/base/baseLogic.ts +0 -10
  195. package/cli/templates/libRoot/base/index.ts +0 -8
  196. package/cli/templates/libRoot/common/commonLogic.ts +0 -10
  197. package/cli/templates/libRoot/common/index.ts +0 -8
  198. package/cli/templates/libRoot/env/env.server.example.ts.template +0 -6
  199. package/cli/templates/libRoot/env/env.server.testing.ts.template +0 -6
  200. package/cli/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +0 -15
  201. package/cli/templates/libRoot/lib/___libName__/__libName__.service.ts +0 -11
  202. package/cli/templates/libRoot/lib/___libName__/__libName__.store.ts +0 -13
  203. package/cli/templates/libRoot/lib/option.ts +0 -17
  204. package/cli/templates/libRoot/package.json.template +0 -5
  205. package/cli/templates/libRoot/srvkit/backendLogic.ts +0 -10
  206. package/cli/templates/libRoot/srvkit/index.ts +0 -8
  207. package/cli/templates/libRoot/tsconfig.json.template +0 -11
  208. package/cli/templates/libRoot/ui/index.ts +0 -7
  209. package/cli/templates/libRoot/webkit/frontendLogic.ts +0 -10
  210. package/cli/templates/libRoot/webkit/index.ts +0 -8
  211. package/cli/templates/localDev/docker-compose.yaml.template +0 -37
  212. package/cli/templates/module/__Model__.Template.tsx +0 -36
  213. package/cli/templates/module/__Model__.Unit.tsx +0 -26
  214. package/cli/templates/module/__Model__.Util.tsx +0 -30
  215. package/cli/templates/module/__Model__.View.tsx +0 -29
  216. package/cli/templates/module/__Model__.Zone.tsx +0 -43
  217. package/cli/templates/module/__model__.constant.ts +0 -24
  218. package/cli/templates/module/__model__.dictionary.ts +0 -30
  219. package/cli/templates/module/__model__.document.ts +0 -23
  220. package/cli/templates/module/__model__.service.ts +0 -16
  221. package/cli/templates/module/__model__.signal.ts +0 -27
  222. package/cli/templates/module/__model__.store.ts +0 -19
  223. package/cli/templates/moduleRoot/index.tsx +0 -31
  224. package/cli/templates/pkgRoot/tsconfig.json.template +0 -10
  225. package/cli/templates/server.ts +0 -45
  226. package/cli/templates/workspaceRoot/.env.template +0 -14
  227. package/cli/templates/workspaceRoot/.gitignore.template +0 -120
  228. package/cli/templates/workspaceRoot/.vscode/settings.json.template +0 -23
  229. package/cli/templates/workspaceRoot/biome.json.template +0 -191
  230. package/cli/templates/workspaceRoot/bunfig.toml +0 -4
  231. package/cli/templates/workspaceRoot/package.json.template +0 -7
  232. package/cli/templates/workspaceRoot/tsconfig.json.template +0 -29
  233. package/cli/testHelpers.ts +0 -171
  234. package/cli/workspace/workspace.command.ts +0 -55
  235. package/cli/workspace/workspace.runner.ts +0 -79
  236. package/cli/workspace/workspace.script.ts +0 -74
  237. package/devkit/aiEditor.ts +0 -299
  238. package/devkit/akanApp/akanApp.host.ts +0 -393
  239. package/devkit/akanApp/index.ts +0 -1
  240. package/devkit/akanConfig/akanConfig.ts +0 -360
  241. package/devkit/akanConfig/index.ts +0 -2
  242. package/devkit/akanConfig/types.ts +0 -187
  243. package/devkit/applicationBuildReporter.ts +0 -69
  244. package/devkit/applicationBuildRunner.ts +0 -302
  245. package/devkit/applicationReleasePackager.ts +0 -205
  246. package/devkit/artifact/implicitRootLayout.ts +0 -155
  247. package/devkit/artifact/index.ts +0 -1
  248. package/devkit/artifact/routeSeedIndex.ts +0 -128
  249. package/devkit/auth.ts +0 -41
  250. package/devkit/builder.ts +0 -164
  251. package/devkit/capacitor.base.config.ts +0 -74
  252. package/devkit/capacitorApp.ts +0 -389
  253. package/devkit/commandDecorators/argMeta.ts +0 -102
  254. package/devkit/commandDecorators/command.ts +0 -340
  255. package/devkit/commandDecorators/commandBuilder.ts +0 -224
  256. package/devkit/commandDecorators/commandMeta.ts +0 -6
  257. package/devkit/commandDecorators/dependencyBuilder.ts +0 -100
  258. package/devkit/commandDecorators/helpFormatter.ts +0 -220
  259. package/devkit/commandDecorators/index.ts +0 -8
  260. package/devkit/commandDecorators/targetMeta.ts +0 -31
  261. package/devkit/commandDecorators/types.ts +0 -10
  262. package/devkit/constants.ts +0 -25
  263. package/devkit/createTunnel.ts +0 -36
  264. package/devkit/dependencyScanner.ts +0 -339
  265. package/devkit/executors.ts +0 -1362
  266. package/devkit/extractDeps.ts +0 -85
  267. package/devkit/fileEditor.ts +0 -106
  268. package/devkit/fileSys.ts +0 -39
  269. package/devkit/frontendBuild/allRoutesBuilder.ts +0 -103
  270. package/devkit/frontendBuild/clientBuildTypes.ts +0 -114
  271. package/devkit/frontendBuild/clientEntriesBundler.ts +0 -300
  272. package/devkit/frontendBuild/clientEntryDiscovery.ts +0 -196
  273. package/devkit/frontendBuild/csrArtifactBuilder.ts +0 -237
  274. package/devkit/frontendBuild/cssCompiler.ts +0 -285
  275. package/devkit/frontendBuild/cssImportResolver.ts +0 -116
  276. package/devkit/frontendBuild/fontOptimizer.ts +0 -427
  277. package/devkit/frontendBuild/hmrChangeClassifier.ts +0 -28
  278. package/devkit/frontendBuild/hmrWatcher.ts +0 -101
  279. package/devkit/frontendBuild/index.ts +0 -18
  280. package/devkit/frontendBuild/pagesBundleBuilder.ts +0 -137
  281. package/devkit/frontendBuild/pagesEntrySourceGenerator.ts +0 -37
  282. package/devkit/frontendBuild/precompressArtifacts.ts +0 -59
  283. package/devkit/frontendBuild/routeClientBuilder.ts +0 -290
  284. package/devkit/frontendBuild/routesManifestArtifactSerializer.ts +0 -62
  285. package/devkit/frontendBuild/ssrBaseArtifactBuilder.ts +0 -139
  286. package/devkit/frontendBuild/vendorSpecifiers.ts +0 -16
  287. package/devkit/frontendBuild/watchRootResolver.ts +0 -28
  288. package/devkit/getCredentials.ts +0 -19
  289. package/devkit/getDirname.ts +0 -3
  290. package/devkit/getModelFileData.ts +0 -59
  291. package/devkit/getRelatedCnsts.ts +0 -300
  292. package/devkit/guideline.ts +0 -19
  293. package/devkit/incrementalBuilder/incrementalBuilder.host.ts +0 -152
  294. package/devkit/incrementalBuilder/incrementalBuilder.proc.ts +0 -331
  295. package/devkit/incrementalBuilder/index.ts +0 -1
  296. package/devkit/index.ts +0 -36
  297. package/devkit/lint/no-deep-internal-import.grit +0 -25
  298. package/devkit/lint/no-import-client-functions.grit +0 -32
  299. package/devkit/lint/no-import-external-library.grit +0 -21
  300. package/devkit/lint/no-js-private-class-method.grit +0 -42
  301. package/devkit/lint/no-use-client-in-server.grit +0 -7
  302. package/devkit/lint/non-scalar-props-restricted.grit +0 -13
  303. package/devkit/linter.ts +0 -248
  304. package/devkit/mobile/index.ts +0 -1
  305. package/devkit/mobile/mobileTarget.ts +0 -87
  306. package/devkit/prompter.ts +0 -71
  307. package/devkit/scanInfo.ts +0 -605
  308. package/devkit/selectModel.ts +0 -11
  309. package/devkit/spinner.ts +0 -54
  310. package/devkit/src/capacitorApp.ts +0 -277
  311. package/devkit/sshTunnel.ts +0 -151
  312. package/devkit/streamAi.ts +0 -45
  313. package/devkit/transforms/barrelAnalyzer.ts +0 -249
  314. package/devkit/transforms/barrelImportsPlugin.ts +0 -457
  315. package/devkit/transforms/externalizeFrameworkPlugin.ts +0 -159
  316. package/devkit/transforms/index.ts +0 -5
  317. package/devkit/transforms/rscUseClientTransform.ts +0 -52
  318. package/devkit/transforms/useClientBundlePlugin.ts +0 -47
  319. package/devkit/typeChecker.ts +0 -260
  320. package/devkit/types.ts +0 -44
  321. package/devkit/ui/MultiScrollList.tsx +0 -228
  322. package/devkit/ui/ScrollList.tsx +0 -106
  323. package/devkit/ui/index.ts +0 -2
  324. package/devkit/uploadRelease.ts +0 -95
  325. package/devkit/useStdoutDimensions.ts +0 -20
  326. package/types/cli/application/application.command.d.ts +0 -7
  327. package/types/cli/application/application.interface.d.ts +0 -40
  328. package/types/cli/application/application.runner.d.ts +0 -66
  329. package/types/cli/application/application.script.d.ts +0 -72
  330. package/types/cli/build.d.ts +0 -1
  331. package/types/cli/cloud/cloud.command.d.ts +0 -7
  332. package/types/cli/cloud/cloud.runner.d.ts +0 -13
  333. package/types/cli/cloud/cloud.script.d.ts +0 -23
  334. package/types/cli/guideline/guideline.command.d.ts +0 -7
  335. package/types/cli/guideline/guideline.prompt.d.ts +0 -29
  336. package/types/cli/guideline/guideline.runner.d.ts +0 -21
  337. package/types/cli/guideline/guideline.script.d.ts +0 -16
  338. package/types/cli/index.d.ts +0 -2
  339. package/types/cli/library/library.command.d.ts +0 -7
  340. package/types/cli/library/library.runner.d.ts +0 -11
  341. package/types/cli/library/library.script.d.ts +0 -13
  342. package/types/cli/module/module.command.d.ts +0 -7
  343. package/types/cli/module/module.prompt.d.ts +0 -13
  344. package/types/cli/module/module.request.d.ts +0 -63
  345. package/types/cli/module/module.runner.d.ts +0 -55
  346. package/types/cli/module/module.script.d.ts +0 -22
  347. package/types/cli/npmRegistry.d.ts +0 -1
  348. package/types/cli/openBrowser.d.ts +0 -1
  349. package/types/cli/package/package.command.d.ts +0 -7
  350. package/types/cli/package/package.runner.d.ts +0 -13
  351. package/types/cli/package/package.script.d.ts +0 -18
  352. package/types/cli/page/page.command.d.ts +0 -7
  353. package/types/cli/page/page.runner.d.ts +0 -10
  354. package/types/cli/page/page.script.d.ts +0 -13
  355. package/types/cli/pluralizeName.d.ts +0 -1
  356. package/types/cli/scalar/scalar.command.d.ts +0 -7
  357. package/types/cli/scalar/scalar.prompt.d.ts +0 -23
  358. package/types/cli/scalar/scalar.runner.d.ts +0 -16
  359. package/types/cli/scalar/scalar.script.d.ts +0 -11
  360. package/types/cli/semver.d.ts +0 -1
  361. package/types/cli/templates/__scalar/__model__/__model__.constant.d.ts +0 -7
  362. package/types/cli/templates/__scalar/__model__/__model__.dictionary.d.ts +0 -7
  363. package/types/cli/templates/__scalar/__model__/__model__.document.d.ts +0 -7
  364. package/types/cli/templates/app/akan.config.d.ts +0 -6
  365. package/types/cli/templates/app/env/env.client.d.ts +0 -6
  366. package/types/cli/templates/app/env/env.client.type.d.ts +0 -6
  367. package/types/cli/templates/app/env/env.server.d.ts +0 -6
  368. package/types/cli/templates/app/lib/___appName__/__appName__.dictionary.d.ts +0 -7
  369. package/types/cli/templates/app/lib/___appName__/__appName__.service.d.ts +0 -7
  370. package/types/cli/templates/app/lib/___appName__/__appName__.signal.d.ts +0 -7
  371. package/types/cli/templates/app/lib/___appName__/__appName__.store.d.ts +0 -7
  372. package/types/cli/templates/app/lib/option.d.ts +0 -6
  373. package/types/cli/templates/app/main.d.ts +0 -6
  374. package/types/cli/templates/app/page/_index.d.ts +0 -9
  375. package/types/cli/templates/app/page/_layout.d.ts +0 -11
  376. package/types/cli/templates/client.d.ts +0 -4
  377. package/types/cli/templates/crudPages/[__model__Id]/edit/page.d.ts +0 -11
  378. package/types/cli/templates/crudPages/[__model__Id]/page.d.ts +0 -11
  379. package/types/cli/templates/crudPages/new/page.d.ts +0 -11
  380. package/types/cli/templates/crudPages/page.d.ts +0 -11
  381. package/types/cli/templates/crudSinglePage/page.d.ts +0 -11
  382. package/types/cli/templates/env/_env.server.type.d.ts +0 -7
  383. package/types/cli/templates/facetIndex/index.d.ts +0 -13
  384. package/types/cli/templates/facetIndex.d.ts +0 -1
  385. package/types/cli/templates/index.d.ts +0 -6
  386. package/types/cli/templates/lib/__lib/lib.constant.d.ts +0 -4
  387. package/types/cli/templates/lib/__lib/lib.dictionary.d.ts +0 -4
  388. package/types/cli/templates/lib/__lib/lib.document.d.ts +0 -4
  389. package/types/cli/templates/lib/__lib/lib.service.d.ts +0 -4
  390. package/types/cli/templates/lib/__lib/lib.signal.d.ts +0 -4
  391. package/types/cli/templates/lib/__lib/lib.store.d.ts +0 -4
  392. package/types/cli/templates/lib/cnst.d.ts +0 -4
  393. package/types/cli/templates/lib/db.d.ts +0 -4
  394. package/types/cli/templates/lib/dict.d.ts +0 -4
  395. package/types/cli/templates/lib/sig.d.ts +0 -4
  396. package/types/cli/templates/lib/srv.d.ts +0 -4
  397. package/types/cli/templates/lib/st.d.ts +0 -4
  398. package/types/cli/templates/lib/useClient.d.ts +0 -4
  399. package/types/cli/templates/lib/useServer.d.ts +0 -4
  400. package/types/cli/templates/libRoot/akan.config.d.ts +0 -5
  401. package/types/cli/templates/libRoot/base/baseLogic.d.ts +0 -5
  402. package/types/cli/templates/libRoot/base/index.d.ts +0 -5
  403. package/types/cli/templates/libRoot/base.d.ts +0 -1
  404. package/types/cli/templates/libRoot/common/commonLogic.d.ts +0 -5
  405. package/types/cli/templates/libRoot/common/index.d.ts +0 -5
  406. package/types/cli/templates/libRoot/common.d.ts +0 -1
  407. package/types/cli/templates/libRoot/lib/___libName__/__libName__.dictionary.d.ts +0 -6
  408. package/types/cli/templates/libRoot/lib/___libName__/__libName__.service.d.ts +0 -6
  409. package/types/cli/templates/libRoot/lib/___libName__/__libName__.store.d.ts +0 -6
  410. package/types/cli/templates/libRoot/lib/option.d.ts +0 -6
  411. package/types/cli/templates/libRoot/srvkit/backendLogic.d.ts +0 -5
  412. package/types/cli/templates/libRoot/srvkit/index.d.ts +0 -5
  413. package/types/cli/templates/libRoot/srvkit.d.ts +0 -1
  414. package/types/cli/templates/libRoot/ui/index.d.ts +0 -5
  415. package/types/cli/templates/libRoot/ui.d.ts +0 -1
  416. package/types/cli/templates/libRoot/webkit/frontendLogic.d.ts +0 -5
  417. package/types/cli/templates/libRoot/webkit/index.d.ts +0 -5
  418. package/types/cli/templates/libRoot/webkit.d.ts +0 -1
  419. package/types/cli/templates/module/__Model__.Template.d.ts +0 -11
  420. package/types/cli/templates/module/__Model__.Unit.d.ts +0 -11
  421. package/types/cli/templates/module/__Model__.Util.d.ts +0 -11
  422. package/types/cli/templates/module/__Model__.View.d.ts +0 -11
  423. package/types/cli/templates/module/__Model__.Zone.d.ts +0 -11
  424. package/types/cli/templates/module/__model__.constant.d.ts +0 -8
  425. package/types/cli/templates/module/__model__.dictionary.d.ts +0 -8
  426. package/types/cli/templates/module/__model__.document.d.ts +0 -8
  427. package/types/cli/templates/module/__model__.service.d.ts +0 -8
  428. package/types/cli/templates/module/__model__.signal.d.ts +0 -9
  429. package/types/cli/templates/module/__model__.store.d.ts +0 -8
  430. package/types/cli/templates/moduleRoot/index.d.ts +0 -11
  431. package/types/cli/templates/moduleRoot.d.ts +0 -1
  432. package/types/cli/templates/server.d.ts +0 -4
  433. package/types/cli/templates.d.ts +0 -1
  434. package/types/cli/testHelpers.d.ts +0 -64
  435. package/types/cli/workspace/workspace.command.d.ts +0 -7
  436. package/types/cli/workspace/workspace.runner.d.ts +0 -14
  437. package/types/cli/workspace/workspace.script.d.ts +0 -29
  438. package/types/cli.d.ts +0 -1
  439. package/types/devkit/aiEditor.d.ts +0 -50
  440. package/types/devkit/akanApp/akanApp.host.d.ts +0 -16
  441. package/types/devkit/akanApp/index.d.ts +0 -1
  442. package/types/devkit/akanApp.d.ts +0 -1
  443. package/types/devkit/akanConfig/akanConfig.d.ts +0 -36
  444. package/types/devkit/akanConfig/index.d.ts +0 -2
  445. package/types/devkit/akanConfig.d.ts +0 -1
  446. package/types/devkit/applicationBuildReporter.d.ts +0 -25
  447. package/types/devkit/applicationBuildRunner.d.ts +0 -29
  448. package/types/devkit/applicationReleasePackager.d.ts +0 -17
  449. package/types/devkit/artifact/implicitRootLayout.d.ts +0 -17
  450. package/types/devkit/artifact/index.d.ts +0 -1
  451. package/types/devkit/artifact/routeSeedIndex.d.ts +0 -38
  452. package/types/devkit/artifact.d.ts +0 -1
  453. package/types/devkit/auth.d.ts +0 -9
  454. package/types/devkit/builder.d.ts +0 -18
  455. package/types/devkit/capacitor.base.config.d.ts +0 -3
  456. package/types/devkit/capacitorApp.d.ts +0 -49
  457. package/types/devkit/commandDecorators/argMeta.d.ts +0 -68
  458. package/types/devkit/commandDecorators/command.d.ts +0 -2
  459. package/types/devkit/commandDecorators/commandBuilder.d.ts +0 -60
  460. package/types/devkit/commandDecorators/commandMeta.d.ts +0 -2
  461. package/types/devkit/commandDecorators/dependencyBuilder.d.ts +0 -22
  462. package/types/devkit/commandDecorators/helpFormatter.d.ts +0 -3
  463. package/types/devkit/commandDecorators/index.d.ts +0 -8
  464. package/types/devkit/commandDecorators/targetMeta.d.ts +0 -21
  465. package/types/devkit/commandDecorators/types.d.ts +0 -8
  466. package/types/devkit/commandDecorators.d.ts +0 -1
  467. package/types/devkit/constants.d.ts +0 -25
  468. package/types/devkit/createTunnel.d.ts +0 -8
  469. package/types/devkit/dependencyScanner.d.ts +0 -33
  470. package/types/devkit/executors.d.ts +0 -320
  471. package/types/devkit/extractDeps.d.ts +0 -7
  472. package/types/devkit/fileEditor.d.ts +0 -16
  473. package/types/devkit/fileSys.d.ts +0 -12
  474. package/types/devkit/frontendBuild/allRoutesBuilder.d.ts +0 -18
  475. package/types/devkit/frontendBuild/clientBuildTypes.d.ts +0 -107
  476. package/types/devkit/frontendBuild/clientEntriesBundler.d.ts +0 -12
  477. package/types/devkit/frontendBuild/clientEntryDiscovery.d.ts +0 -19
  478. package/types/devkit/frontendBuild/csrArtifactBuilder.d.ts +0 -16
  479. package/types/devkit/frontendBuild/cssCompiler.d.ts +0 -25
  480. package/types/devkit/frontendBuild/cssImportResolver.d.ts +0 -9
  481. package/types/devkit/frontendBuild/fontOptimizer.d.ts +0 -14
  482. package/types/devkit/frontendBuild/hmrChangeClassifier.d.ts +0 -5
  483. package/types/devkit/frontendBuild/hmrWatcher.d.ts +0 -21
  484. package/types/devkit/frontendBuild/index.d.ts +0 -18
  485. package/types/devkit/frontendBuild/pagesBundleBuilder.d.ts +0 -28
  486. package/types/devkit/frontendBuild/pagesEntrySourceGenerator.d.ts +0 -9
  487. package/types/devkit/frontendBuild/precompressArtifacts.d.ts +0 -7
  488. package/types/devkit/frontendBuild/routeClientBuilder.d.ts +0 -50
  489. package/types/devkit/frontendBuild/routesManifestArtifactSerializer.d.ts +0 -12
  490. package/types/devkit/frontendBuild/ssrBaseArtifactBuilder.d.ts +0 -16
  491. package/types/devkit/frontendBuild/vendorSpecifiers.d.ts +0 -2
  492. package/types/devkit/frontendBuild/watchRootResolver.d.ts +0 -6
  493. package/types/devkit/frontendBuild.d.ts +0 -1
  494. package/types/devkit/getCredentials.d.ts +0 -12
  495. package/types/devkit/getDirname.d.ts +0 -1
  496. package/types/devkit/getModelFileData.d.ts +0 -16
  497. package/types/devkit/getRelatedCnsts.d.ts +0 -53
  498. package/types/devkit/guideline.d.ts +0 -19
  499. package/types/devkit/incrementalBuilder/incrementalBuilder.host.d.ts +0 -30
  500. package/types/devkit/incrementalBuilder/incrementalBuilder.proc.d.ts +0 -1
  501. package/types/devkit/incrementalBuilder/index.d.ts +0 -1
  502. package/types/devkit/incrementalBuilder.d.ts +0 -1
  503. package/types/devkit/index.d.ts +0 -36
  504. package/types/devkit/linter.d.ts +0 -108
  505. package/types/devkit/mobile/index.d.ts +0 -1
  506. package/types/devkit/mobile/mobileTarget.d.ts +0 -14
  507. package/types/devkit/mobile.d.ts +0 -1
  508. package/types/devkit/prompter.d.ts +0 -15
  509. package/types/devkit/scanInfo.d.ts +0 -82
  510. package/types/devkit/selectModel.d.ts +0 -1
  511. package/types/devkit/spinner.d.ts +0 -20
  512. package/types/devkit/src/capacitorApp.d.ts +0 -39
  513. package/types/devkit/sshTunnel.d.ts +0 -14
  514. package/types/devkit/streamAi.d.ts +0 -6
  515. package/types/devkit/transforms/barrelAnalyzer.d.ts +0 -27
  516. package/types/devkit/transforms/barrelImportsPlugin.d.ts +0 -26
  517. package/types/devkit/transforms/externalizeFrameworkPlugin.d.ts +0 -49
  518. package/types/devkit/transforms/index.d.ts +0 -5
  519. package/types/devkit/transforms/rscUseClientTransform.d.ts +0 -10
  520. package/types/devkit/transforms/useClientBundlePlugin.d.ts +0 -19
  521. package/types/devkit/transforms.d.ts +0 -1
  522. package/types/devkit/typeChecker.d.ts +0 -62
  523. package/types/devkit/types.d.ts +0 -43
  524. package/types/devkit/ui/MultiScrollList.d.ts +0 -13
  525. package/types/devkit/ui/ScrollList.d.ts +0 -7
  526. package/types/devkit/ui/index.d.ts +0 -2
  527. package/types/devkit/ui.d.ts +0 -1
  528. package/types/devkit/uploadRelease.d.ts +0 -10
  529. package/types/devkit/useStdoutDimensions.d.ts +0 -1
  530. package/types/devkit.d.ts +0 -1
package/README.ko.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Akan.js
2
2
 
3
- [English](./README.md) | [Docs](https://akanjs.com/docs) | [npm](https://www.npmjs.com/package/akanjs)
3
+ [English](https://unpkg.com/akanjs@latest/README.md) | [Docs](https://akanjs.com/docs) | [npm](https://www.npmjs.com/package/akanjs)
4
4
 
5
5
  **코드가 아니라, 비즈니스를 씁니다.**
6
6
  **Write the business, not the plumbing.**
@@ -50,7 +50,7 @@ akan start <app-name> --open
50
50
  가장 작은 앱은 설정이 거의 없어도 시작할 수 있습니다.
51
51
 
52
52
  ```ts
53
- import type { AppConfig } from "akanjs/devkit";
53
+ import type { AppConfig } from "akanjs";
54
54
 
55
55
  const config: AppConfig = {};
56
56
 
@@ -161,9 +161,9 @@ UI barrel import를 leaf import로 다시 써서 클라이언트 번들을 작
161
161
  | `akanjs/client` | client routing, cookie, storage, locale, device, CSR type, page helper. |
162
162
  | `akanjs/client` | Akan page runtime에서 사용하는 client bootstrap과 location helper. |
163
163
  | `akanjs/server` | server app runtime, route composition, SSR/RSC artifact, proxy, sitemap, server type. |
164
- | `akanjs/devkit` | build runner, config loader, code generation, scanner, transform, CLI helper, tooling. |
164
+ | `@akanjs/devkit` | build runner, config loader, code generation, scanner, transform, CLI helper, tooling. |
165
165
  | `akanjs/test` | test helper와 sample generation utility. |
166
- | `akanjs/cli` | programmatic CLI entrypoint. 실행 명령은 `akan`입니다. |
166
+ | `@akanjs/cli` | programmatic CLI entrypoint. 실행 명령은 `akan`입니다. |
167
167
 
168
168
  특수 public surface:
169
169
 
@@ -202,7 +202,7 @@ akan update
202
202
  routes, domains, base paths, mobile settings로 확장됩니다.
203
203
 
204
204
  ```ts
205
- import type { AppConfig } from "akanjs/devkit";
205
+ import type { AppConfig } from "akanjs";
206
206
 
207
207
  const config: AppConfig = {
208
208
  routes: [
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Akan.js
2
2
 
3
- [한국어](./README.ko.md) | [Docs](https://akanjs.com/docs) | [npm](https://www.npmjs.com/package/akanjs)
3
+ [한국어](https://unpkg.com/akanjs@latest/README.ko.md) | [Docs](https://akanjs.com/docs) | [npm](https://www.npmjs.com/package/akanjs)
4
4
 
5
5
  **Write the business, not the plumbing.**
6
6
 
@@ -49,7 +49,7 @@ akan start <app-name> --open
49
49
  A minimal app can start with almost no configuration:
50
50
 
51
51
  ```ts
52
- import type { AppConfig } from "akanjs/devkit";
52
+ import type { AppConfig } from "akanjs";
53
53
 
54
54
  const config: AppConfig = {};
55
55
 
@@ -159,9 +159,9 @@ frontend build to rewrite UI barrel imports into leaf imports.
159
159
  | `akanjs/client` | Client routing, cookies, storage, locale, device, CSR types, and page helpers. |
160
160
  | `akanjs/client` | Client bootstrapping and location helpers used by Akan page runtimes. |
161
161
  | `akanjs/server` | Server app runtime, route composition, SSR/RSC artifacts, proxying, sitemap, and server types. |
162
- | `akanjs/devkit` | Build runners, config loaders, code generation, scanners, transforms, CLI helpers, and tooling. |
162
+ | `@akanjs/devkit` | Build runners, config loaders, code generation, scanners, transforms, CLI helpers, and tooling. |
163
163
  | `akanjs/test` | Test helpers and sample generation utilities. |
164
- | `akanjs/cli` | Programmatic CLI entrypoint. The executable command is `akan`. |
164
+ | `@akanjs/cli` | Programmatic CLI entrypoint. The executable command is `akan`. |
165
165
 
166
166
  Special public surfaces:
167
167
 
@@ -200,7 +200,7 @@ Common areas:
200
200
  grow only when the app needs routes, domains, base paths, or mobile settings.
201
201
 
202
202
  ```ts
203
- import type { AppConfig } from "akanjs/devkit";
203
+ import type { AppConfig } from "akanjs";
204
204
 
205
205
  const config: AppConfig = {
206
206
  routes: [
package/client/router.ts CHANGED
@@ -62,6 +62,8 @@ function getServerRequestContext() {
62
62
 
63
63
  const getConfiguredBasePaths = () => new Set(parseBasePaths(process.env.AKAN_PUBLIC_BASE_PATHS));
64
64
 
65
+ const shouldExposeBasePath = () => getEnv().operationMode === "local";
66
+
65
67
  const getServerBasePath = (reqPathname: string, lang: string, headerBasePath: string | undefined, fallback: string) => {
66
68
  return (
67
69
  getBasePathFromPathname(reqPathname, {
@@ -131,14 +133,16 @@ class Router {
131
133
  push: (href: string, routeOptions) => {
132
134
  const router = options.router;
133
135
  const pathInfo = this.#getPathInfo(href);
136
+ const navigationPathInfo = this.#getNavigationPathInfo(href);
134
137
  this.#postPathChange(pathInfo);
135
- router.push(pathInfo.href, routeOptions);
138
+ router.push(navigationPathInfo.href, routeOptions);
136
139
  },
137
140
  replace: (href: string, routeOptions) => {
138
141
  const router = options.router;
139
142
  const pathInfo = this.#getPathInfo(href);
143
+ const navigationPathInfo = this.#getNavigationPathInfo(href);
140
144
  this.#postPathChange(pathInfo);
141
- router.replace(pathInfo.href, routeOptions);
145
+ router.replace(navigationPathInfo.href, routeOptions);
142
146
  },
143
147
  back: () => {
144
148
  const router = options.router;
@@ -188,6 +192,9 @@ class Router {
188
192
  #getPathInfo(href: string, prefix = this.#prefix) {
189
193
  return getPathInfo(href, this.#lang, prefix);
190
194
  }
195
+ #getNavigationPathInfo(href: string) {
196
+ return this.#getPathInfo(href, shouldExposeBasePath() ? this.#prefix : "");
197
+ }
191
198
  #postPathChange({ path, pathname, hash }: { path: string; pathname: string; hash: string }) {
192
199
  Logger.log(`pathChange-start:${path}${hash ? `#${hash}` : ""}`);
193
200
  window.parent.postMessage({ type: "pathChange", path, pathname, hash }, "*");
@@ -224,7 +231,7 @@ class Router {
224
231
  const langFromPath = reqPathname.split("/").filter(Boolean)[0];
225
232
  const lang = (h.get("x-locale") ?? langFromPath ?? this.#lang) as string;
226
233
  const basePath = getServerBasePath(reqPathname, lang, h.get("x-base-path") ?? undefined, this.#prefix);
227
- const { pathname, href: fullHref } = getPathInfo(href, lang, basePath);
234
+ const { pathname, href: fullHref } = getPathInfo(href, lang, shouldExposeBasePath() ? basePath : "");
228
235
  Logger.log(`redirect to:${pathname}`);
229
236
  throw new AkanRedirectError(fullHref, "replace");
230
237
  } else {
@@ -53,7 +53,7 @@ const serializeInput = <Input = unknown>(
53
53
  return Object.fromEntries(
54
54
  Object.entries(modelRef[FIELD_META]).map(([key, field]) => [
55
55
  key,
56
- field.isClass && !field.isScalar
56
+ serializeType === "input" && field.isClass && !field.isScalar
57
57
  ? serialize(ID, field.arrDepth, getRelationId((value as Record<string, unknown>)?.[key]), serializeType, {
58
58
  nullable: field.nullable,
59
59
  key,
@@ -13,6 +13,14 @@ export interface DocumentIndexDescriptor {
13
13
  where?: DocumentQuery;
14
14
  }
15
15
 
16
+ export interface DocumentIndexBuilder<Schema> {
17
+ path(path: string, order?: 1 | -1): DocumentIndexBuilder<Schema>;
18
+ text(path: string): DocumentIndexBuilder<Schema>;
19
+ unique(): DocumentIndexBuilder<Schema>;
20
+ where(where: DocumentQuery | ((q: DocumentQueryHelper) => DocumentQuery)): DocumentIndexBuilder<Schema>;
21
+ done(): Schema;
22
+ }
23
+
16
24
  export type DocumentSaveHook<Doc = unknown> = (
17
25
  this: Doc,
18
26
  next?: () => void,
@@ -58,7 +66,7 @@ export class DocumentSchema<Doc = unknown> {
58
66
  return this;
59
67
  }
60
68
 
61
- createIndex(name: string) {
69
+ createIndex(name: string): DocumentIndexBuilder<this> {
62
70
  const schema = this;
63
71
  const descriptor: DocumentIndexDescriptor = { name, fields: {} };
64
72
  const api = {
package/index.ts ADDED
@@ -0,0 +1,187 @@
1
+ import type { AkanI18nConfig } from "akanjs/common";
2
+ import type { AkanImageConfig } from "akanjs/server";
3
+
4
+ export const archs = ["amd64", "arm64"] as const;
5
+ export type Arch = (typeof archs)[number];
6
+
7
+ export interface DockerConfig {
8
+ content: string;
9
+ image: string | { [key in Arch]?: string };
10
+ preRuns: (string | { [key in Arch]?: string })[];
11
+ postRuns: (string | { [key in Arch]?: string })[];
12
+ command: string[];
13
+ }
14
+
15
+ export interface AkanRouteDomains {
16
+ main?: string[];
17
+ develop?: string[];
18
+ debug?: string[];
19
+ [branch: string]: string[] | undefined;
20
+ }
21
+
22
+ export interface AkanRouteConfig {
23
+ basePath?: string;
24
+ domains: AkanRouteDomains;
25
+ }
26
+
27
+ export type DatabaseMode = "single" | "multiple" | "cluster";
28
+ export type MobileEnv = "local" | "debug" | "develop" | "main";
29
+ export type MobilePermission = "camera" | "contacts" | "location" | "push";
30
+
31
+ export interface AkanMobileTargetAssets {
32
+ icon?: string;
33
+ splash?: string;
34
+ }
35
+
36
+ export interface AkanMobileTargetLinks {
37
+ schemes?: string[];
38
+ associatedDomains?: string[];
39
+ androidHosts?: string[];
40
+ }
41
+
42
+ export interface AkanMobileTargetFiles {
43
+ ios?: Record<string, string>;
44
+ android?: Record<string, string>;
45
+ }
46
+
47
+ export interface AkanCapacitorLikeConfig {
48
+ plugins?: Record<string, unknown>;
49
+ android?: Record<string, unknown>;
50
+ ios?: Record<string, unknown>;
51
+ [key: string]: unknown;
52
+ }
53
+
54
+ export interface AkanMobileTargetConfig extends AkanCapacitorLikeConfig {
55
+ name: string;
56
+ basePath?: string;
57
+ appName: string;
58
+ appId: string;
59
+ version: string;
60
+ buildNum: number;
61
+ assets?: AkanMobileTargetAssets;
62
+ permissions?: MobilePermission[];
63
+ links?: AkanMobileTargetLinks;
64
+ files?: AkanMobileTargetFiles;
65
+ }
66
+
67
+ export interface AkanMobileConfig extends AkanCapacitorLikeConfig {
68
+ appName: string;
69
+ appId: string;
70
+ version: string;
71
+ buildNum: number;
72
+ targets: Record<string, AkanMobileTargetConfig>;
73
+ }
74
+
75
+ export interface AppConfigResult {
76
+ docker: DockerConfig;
77
+ defaultDatabaseMode: DatabaseMode;
78
+ routes?: AkanRouteConfig[];
79
+ externalLibs: string[];
80
+ barrelImports: string[];
81
+ optimizeImports: string[];
82
+ images: AkanImageConfig;
83
+ i18n: AkanI18nConfig;
84
+ publicEnv: string[];
85
+ mobile: AkanMobileConfig;
86
+ }
87
+
88
+ export interface LibConfigResult {
89
+ externalLibs: string[];
90
+ }
91
+
92
+ export type DeepPartial<T> = {
93
+ [P in keyof T]?: T[P] extends unknown[] ? T[P] : T[P] extends object ? DeepPartial<T[P]> : T[P];
94
+ };
95
+
96
+ export interface AppConfigContext {
97
+ readonly name: string;
98
+ readonly type: "app";
99
+ }
100
+
101
+ export interface LibConfigContext {
102
+ readonly name: string;
103
+ readonly type: "lib";
104
+ }
105
+
106
+ export type AppConfig = DeepPartial<AppConfigResult> | ((app: AppConfigContext) => DeepPartial<AppConfigResult>);
107
+ export type LibConfig = DeepPartial<LibConfigResult> | ((lib: LibConfigContext) => DeepPartial<LibConfigResult>);
108
+ export type AkanConfigFile = object;
109
+
110
+ export interface FileConventionScanResult {
111
+ constant: { databases: string[]; scalars: string[] };
112
+ dictionary: { databases: string[]; services: string[]; scalars: string[] };
113
+ document: { databases: string[]; scalars: string[] };
114
+ service: { databases: string[]; services: string[] };
115
+ signal: { databases: string[]; services: string[] };
116
+ store: { databases: string[]; services: string[] };
117
+ template: { databases: string[]; services: string[]; scalars: string[] };
118
+ unit: { databases: string[]; services: string[]; scalars: string[] };
119
+ util: { databases: string[]; services: string[]; scalars: string[] };
120
+ view: { databases: string[]; services: string[]; scalars: string[] };
121
+ zone: { databases: string[]; services: string[]; scalars: string[] };
122
+ }
123
+
124
+ export interface ScanResult {
125
+ name: string;
126
+ type: "app" | "lib";
127
+ repoName: string;
128
+ serveDomain: string;
129
+ files: FileConventionScanResult;
130
+ libDeps: string[];
131
+ pkgDeps: string[];
132
+ dependencies: string[];
133
+ devDependencies: string[];
134
+ }
135
+
136
+ export interface AppScanResult extends ScanResult {
137
+ akanConfig: AppConfigResult;
138
+ routes: string[];
139
+ }
140
+
141
+ export interface LibScanResult extends ScanResult {
142
+ akanConfig: LibConfigResult;
143
+ }
144
+
145
+ export interface PkgScanResult {
146
+ name: string;
147
+ pkgDeps: string[];
148
+ dependencies: string[];
149
+ }
150
+
151
+ export interface WorkspaceScanResult {
152
+ appNames: string[];
153
+ libNames: string[];
154
+ pkgNames: string[];
155
+ apps: { [key: string]: AppScanResult };
156
+ libs: { [key: string]: LibScanResult };
157
+ pkgs: { [key: string]: PkgScanResult };
158
+ }
159
+
160
+ export interface AppInfo {
161
+ readonly name: string;
162
+ readonly type: "app";
163
+ readonly database: Map<string, Set<string>>;
164
+ readonly service: Map<string, Set<string>>;
165
+ readonly scalar: Map<string, Set<string>>;
166
+ readonly file: FileConventionScanResult;
167
+ getLibs(): string[];
168
+ getLibInfos(): Map<string, LibInfo>;
169
+ getDatabaseModules(): string[];
170
+ getScalarModules(): string[];
171
+ getServiceModules(): string[];
172
+ }
173
+
174
+ export interface LibInfo {
175
+ readonly name: string;
176
+ readonly type: "lib";
177
+ readonly database: Map<string, Set<string>>;
178
+ readonly service: Map<string, Set<string>>;
179
+ readonly scalar: Map<string, Set<string>>;
180
+ readonly file: FileConventionScanResult;
181
+ getLibs(): string[];
182
+ getLibInfos(): Map<string, LibInfo>;
183
+ getLibInfo(libName: string): LibInfo | undefined;
184
+ getDatabaseModules(): string[];
185
+ getScalarModules(): string[];
186
+ getServiceModules(): string[];
187
+ }
package/package.json CHANGED
@@ -1,12 +1,8 @@
1
1
  {
2
2
  "name": "akanjs",
3
- "version": "2.0.6",
3
+ "version": "2.1.0-rc.0",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
- "bin": {
7
- "akan": "./cli/index.js",
8
- "akan2": "./cli/index.js"
9
- },
10
6
  "publishConfig": {
11
7
  "access": "public"
12
8
  },
@@ -24,11 +20,6 @@
24
20
  "default": "./index.ts"
25
21
  },
26
22
  "./package.json": "./package.json",
27
- "./capacitor.base.config": {
28
- "types": "./types/devkit/capacitor.base.config.d.ts",
29
- "import": "./devkit/capacitor.base.config.ts",
30
- "default": "./devkit/capacitor.base.config.ts"
31
- },
32
23
  "./base": {
33
24
  "types": "./types/base/index.d.ts",
34
25
  "import": "./base/index.ts",
@@ -139,21 +130,11 @@
139
130
  "import": "./dictionary/index.ts",
140
131
  "default": "./dictionary/index.ts"
141
132
  },
142
- "./devkit": {
143
- "types": "./types/devkit/index.d.ts",
144
- "import": "./devkit/index.ts",
145
- "default": "./devkit/index.ts"
146
- },
147
133
  "./test": {
148
134
  "types": "./types/test/index.d.ts",
149
135
  "import": "./test/index.ts",
150
136
  "default": "./test/index.ts"
151
137
  },
152
- "./cli": {
153
- "types": "./types/cli/index.d.ts",
154
- "import": "./cli/index.ts",
155
- "default": "./cli/index.ts"
156
- },
157
138
  "./ui/styles.css": "./ui/styles.css",
158
139
  "./server/rsc-worker": {
159
140
  "types": "./types/server/rscWorker.d.ts",
@@ -162,27 +143,10 @@
162
143
  }
163
144
  },
164
145
  "dependencies": {
165
- "@inquirer/prompts": "^8.4.3",
166
- "@langchain/core": "^1.1.47",
167
- "@langchain/deepseek": "^1.0.26",
168
- "@langchain/openai": "^1.4.6",
169
- "@trapezedev/project": "^7.1.4",
170
- "chalk": "^5.6.2",
171
146
  "clsx": "^2.1.1",
172
- "commander": "^14.0.3",
173
147
  "dayjs": "^1.11.20",
174
- "fontaine": "^0.8.0",
175
- "fonteditor-core": "^2.6.3",
176
- "ignore": "^7.0.5",
177
148
  "immer": "^11.1.8",
178
- "ink": "^6.8.0",
179
- "js-yaml": "^4.1.1",
180
- "ora": "^9.4.0",
181
- "qrcode": "^1.5.4",
182
- "sharp": "^0.34.5",
183
- "ssh2": "^1.17.0",
184
- "subset-font": "^2.5.0",
185
- "tailwindcss": "^4.3.0"
149
+ "sharp": "^0.34.5"
186
150
  },
187
151
  "peerDependencies": {
188
152
  "@capacitor-community/contacts": "^7.2.0",
@@ -190,7 +154,6 @@
190
154
  "@capacitor/app": "^8.1.0",
191
155
  "@capacitor/browser": "^8.0.3",
192
156
  "@capacitor/camera": "^8.2.0",
193
- "@capacitor/cli": "^8.3.4",
194
157
  "@capacitor/core": "^8.3.4",
195
158
  "@capacitor/device": "^8.0.2",
196
159
  "@capacitor/geolocation": "^8.2.0",
@@ -202,7 +165,7 @@
202
165
  "@libsql/client": "^0.17.3",
203
166
  "@playwright/test": "^1.60.0",
204
167
  "@radix-ui/react-dialog": "^1.1.15",
205
- "@react-spring/web": "^9.7.5",
168
+ "@react-spring/web": "^10.1.0",
206
169
  "@use-gesture/react": "^10.3.1",
207
170
  "bullmq": "^5.76.10",
208
171
  "capacitor-plugin-safe-area": "^5.0.0",
@@ -211,27 +174,23 @@
211
174
  "croner": "^10.0.1",
212
175
  "daisyui": "^5.5.20",
213
176
  "file-saver": "^2.0.5",
214
- "fontaine": "^0.8.0",
215
- "fonteditor-core": "^2.6.3",
216
177
  "ioredis": "^5.10.1",
217
178
  "mermaid": "^11.15.0",
218
179
  "postgres": "^3.4.9",
219
180
  "protobufjs": "^8.4.0",
220
- "react": "19.2.4",
181
+ "react": "19.2.6",
221
182
  "react-copy-to-clipboard": "^5.1.1",
222
183
  "react-datepicker": "^9.1.0",
223
184
  "react-device-detect": "^2.2.3",
224
- "react-dom": "19.2.4",
185
+ "react-dom": "19.2.6",
225
186
  "react-icons": "^5.6.0",
226
187
  "react-refresh": "^0.18.0",
227
188
  "react-server-dom-webpack": "^19.2.6",
228
189
  "react-simple-pull-to-refresh": "^1.3.4",
229
- "react-spring": "^9.7.5",
190
+ "react-spring": "^10.0.4",
230
191
  "scheduler": "^0.27.0",
231
192
  "sharp": "^0.34.5",
232
- "subset-font": "^2.5.0",
233
193
  "tailwind-scrollbar": "^4.0.2",
234
- "tailwindcss": "^4.3.0",
235
194
  "typescript": "^6.0.3"
236
195
  },
237
196
  "peerDependenciesMeta": {
@@ -250,9 +209,6 @@
250
209
  "@capacitor/camera": {
251
210
  "optional": true
252
211
  },
253
- "@capacitor/cli": {
254
- "optional": true
255
- },
256
212
  "@capacitor/core": {
257
213
  "optional": true
258
214
  },
package/server/akanApp.ts CHANGED
@@ -2,6 +2,8 @@ import { mkdir, rm } from "node:fs/promises";
2
2
  import path from "node:path";
3
3
  import { Logger } from "akanjs/common";
4
4
  import type { AkanChildRole, AkanChildStatus, AkanIpcMessage, AkanMetricsReport, AkanUpstream } from "akanjs/service";
5
+ import { isTraceEnabled } from "akanjs/signal";
6
+ import { makeAkanChildProxyHeaders } from "./akanAppHeaders";
5
7
  import type { BuilderMessage, BuilderReq, BuilderRes } from "./artifact";
6
8
  import { RotatingLogWriter } from "./logging/rotatingLogWriter";
7
9
  import { ProcessMetricsCollector } from "./processMetricsCollector";
@@ -59,16 +61,6 @@ export class AkanApp {
59
61
  static readonly #childRestartBaseDelayMs = 1_000;
60
62
  static readonly #childRestartMaxDelayMs = 30_000;
61
63
  static readonly #childRestartGraceMs = 5_000;
62
- static readonly #hopByHopHeaders = new Set([
63
- "connection",
64
- "keep-alive",
65
- "proxy-authenticate",
66
- "proxy-authorization",
67
- "te",
68
- "trailer",
69
- "transfer-encoding",
70
- "upgrade",
71
- ]);
72
64
 
73
65
  readonly logger = new Logger("AkanApp");
74
66
  readonly #serverPath: string;
@@ -85,6 +77,7 @@ export class AkanApp {
85
77
  readonly #builderReqMap = new Map<number, { childIdx: number; childLocalId: number }>();
86
78
  #server: Bun.Server<GatewayWsData> | null = null;
87
79
  #rrIdx = 0;
80
+ #federationChildCache: ChildState[] | null = null;
88
81
  #snapshotTimer: Timer | null = null;
89
82
  #healthTimer: Timer | null = null;
90
83
  #metricsTimer: Timer | null = null;
@@ -93,6 +86,9 @@ export class AkanApp {
93
86
  readonly #childOutputBuffers = new Map<string, string>();
94
87
  static readonly #ansiPattern = new RegExp(`${String.fromCharCode(27)}\\[[0-?]*[ -/]*[@-~]`, "g");
95
88
  #gatewayMetrics: AkanMetricsReport = {};
89
+ #proxyHopCount = 0;
90
+ #proxyHopSumMs = 0;
91
+ #proxyHopMaxMs = 0;
96
92
  #resolveStopped: (() => void) | null = null;
97
93
  #exitAfterStop = false;
98
94
  #stopping = false;
@@ -248,6 +244,7 @@ export class AkanApp {
248
244
  lastRestartAt: previous?.lastRestartAt,
249
245
  lastRestartReason: previous?.lastRestartReason,
250
246
  });
247
+ this.#invalidateFederationChildCache();
251
248
  this.#pipeOutput(idx, role, proc.stdout, "stdout");
252
249
  this.#pipeOutput(idx, role, proc.stderr, "stderr");
253
250
  proc.exited.then((code) => this.#handleChildExit(idx, proc, code));
@@ -258,6 +255,7 @@ export class AkanApp {
258
255
  if (!child || child.proc !== proc) return;
259
256
  child.status = "exited";
260
257
  child.lastExitCode = code;
258
+ this.#invalidateFederationChildCache();
261
259
  this.#removeChildRooms(idx);
262
260
  if (this.#stopping) return;
263
261
  void this.#scheduleChildRestart(child, proc, `exit:${code ?? "unknown"}`);
@@ -276,6 +274,7 @@ export class AkanApp {
276
274
  child.status = reason === "health-timeout" ? "unhealthy" : "exited";
277
275
  child.upstream = undefined;
278
276
  child.healthPath = undefined;
277
+ this.#invalidateFederationChildCache();
279
278
  child.lastRestartReason = reason;
280
279
  child.lastRestartAt = Date.now();
281
280
  this.#removeChildRooms(child.idx);
@@ -403,6 +402,7 @@ export class AkanApp {
403
402
  const url = new URL(req.url);
404
403
  if (url.pathname === "/_akan/app/health") return Response.json(this.#getHealthStatus());
405
404
  if (url.pathname === "/_akan/app/metrics") return Response.json(this.#getMetricsStatus());
405
+ if (url.pathname === "/_akan/bench/ping") return new Response("ok");
406
406
  if (this.#isWebSocketPath(url.pathname)) return this.#upgradeWebSocket(req, server);
407
407
  const assetResponse = await this.#serveImmutableArtifact(req, url);
408
408
  if (assetResponse) return assetResponse;
@@ -526,6 +526,13 @@ export class AkanApp {
526
526
  rooms: this.#roomChildren.size,
527
527
  sockets: this.#socketRooms.size,
528
528
  gateway: this.#gatewayMetrics,
529
+ proxyHop: this.#proxyHopCount
530
+ ? {
531
+ count: this.#proxyHopCount,
532
+ meanMs: Math.round((this.#proxyHopSumMs / this.#proxyHopCount) * 1000) / 1000,
533
+ maxMs: Math.round(this.#proxyHopMaxMs * 1000) / 1000,
534
+ }
535
+ : null,
529
536
  children: [...this.#children.values()].map((child) => ({
530
537
  idx: child.idx,
531
538
  role: child.role,
@@ -551,6 +558,8 @@ export class AkanApp {
551
558
  const headers = this.#makeProxyHeaders(req, child.idx);
552
559
  child.metrics.activeRequests = (child.metrics.activeRequests ?? 0) + 1;
553
560
  child.metrics.totalRequests = (child.metrics.totalRequests ?? 0) + 1;
561
+ const traced = isTraceEnabled();
562
+ const hopStart = traced ? performance.now() : 0;
554
563
  try {
555
564
  const upstreamRes = await fetch(upstreamUrl, {
556
565
  unix: child.upstream.socketPath,
@@ -563,9 +572,20 @@ export class AkanApp {
563
572
  return this.#proxyResponse(upstreamRes);
564
573
  } finally {
565
574
  child.metrics.activeRequests = Math.max(0, (child.metrics.activeRequests ?? 1) - 1);
575
+ if (traced) this.#recordProxyHop(performance.now() - hopStart);
566
576
  }
567
577
  }
568
578
 
579
+ /**
580
+ * Gateway-observed upstream round-trip time. The pure proxy overhead is this value
581
+ * minus the child handler time captured in the per-request trace.
582
+ */
583
+ #recordProxyHop(durationMs: number) {
584
+ this.#proxyHopCount += 1;
585
+ this.#proxyHopSumMs += durationMs;
586
+ this.#proxyHopMaxMs = Math.max(this.#proxyHopMaxMs, durationMs);
587
+ }
588
+
569
589
  #proxyResponse(upstreamRes: Response): Response {
570
590
  const headers = new Headers(upstreamRes.headers);
571
591
 
@@ -650,29 +670,25 @@ export class AkanApp {
650
670
  }
651
671
 
652
672
  #makeProxyHeaders(req: Request, childIdx: number) {
653
- const headers = new Headers(req.headers);
654
- for (const key of AkanApp.#hopByHopHeaders) headers.delete(key);
655
- const url = new URL(req.url);
656
- const forwardedFor = headers.get("x-forwarded-for");
657
- const clientAddress = headers.get("x-real-ip") ?? "127.0.0.1";
658
- headers.set("x-forwarded-for", forwardedFor ? `${forwardedFor}, ${clientAddress}` : clientAddress);
659
- headers.set("x-forwarded-host", headers.get("host") ?? url.host);
660
- headers.set("x-forwarded-proto", url.protocol.replace(":", ""));
661
- headers.set("x-akan-child-idx", String(childIdx));
662
- headers.set("x-request-id", headers.get("x-request-id") ?? crypto.randomUUID());
663
- headers.set("host", "akan-child");
664
- return headers;
673
+ return makeAkanChildProxyHeaders(req, childIdx);
674
+ }
675
+
676
+ #invalidateFederationChildCache() {
677
+ this.#federationChildCache = null;
665
678
  }
666
679
 
667
680
  #pickFederationChild() {
668
- const candidates = [...this.#children.values()].filter(
669
- (child) =>
670
- (child.role === "federation" || child.role === "all") &&
671
- child.ready &&
672
- child.status !== "unhealthy" &&
673
- child.status !== "exited" &&
674
- !child.proc.killed,
675
- );
681
+ const candidates =
682
+ this.#federationChildCache ??
683
+ [...this.#children.values()].filter(
684
+ (child) =>
685
+ (child.role === "federation" || child.role === "all") &&
686
+ child.ready &&
687
+ child.status !== "unhealthy" &&
688
+ child.status !== "exited" &&
689
+ !child.proc.killed,
690
+ );
691
+ this.#federationChildCache = candidates;
676
692
  if (candidates.length === 0) return null;
677
693
  const child = candidates[this.#rrIdx % candidates.length];
678
694
  this.#rrIdx++;
@@ -761,6 +777,7 @@ export class AkanApp {
761
777
  child.lastPongAt = Date.now();
762
778
  child.restartAttempts = 0;
763
779
  child.restartPending = false;
780
+ this.#invalidateFederationChildCache();
764
781
  if ([...this.#children.values()].every((item) => item.ready)) {
765
782
  process.send?.({ type: "backend-ready", pid: process.pid } satisfies AkanIpcMessage);
766
783
  this.logger.verbose(`All ${this.#children.size} child process(es) are ready`);
@@ -772,6 +789,7 @@ export class AkanApp {
772
789
  if (!child) return;
773
790
  child.status = "healthy";
774
791
  child.lastPongAt = Date.now();
792
+ this.#invalidateFederationChildCache();
775
793
  }
776
794
 
777
795
  #deliverPubsub(originIdx: number, message: Extract<AkanIpcMessage, { type: "pubsub.publish" }>) {
@@ -903,6 +921,7 @@ export class AkanApp {
903
921
  if (child.proc.killed || child.status === "exited") continue;
904
922
  if (child.lastPongAt && now - child.lastPongAt > 5_000) {
905
923
  child.status = "unhealthy";
924
+ this.#invalidateFederationChildCache();
906
925
  void this.#scheduleChildRestart(child, child.proc, "health-timeout");
907
926
  return;
908
927
  }