@geekmidas/cli 9.0.2 → 10.0.0-alpha.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 (390) hide show
  1. package/README.md +71 -120
  2. package/dist/{CachedStateProvider-BdX7klRc.cjs → CachedStateProvider-BLo7zv7S.cjs} +1 -1
  3. package/dist/CachedStateProvider-BxoAm-B2.mjs +3 -0
  4. package/dist/{CachedStateProvider-klLWZXWF.cjs → CachedStateProvider-CqPdW7CB.cjs} +1 -1
  5. package/dist/{CachedStateProvider-klLWZXWF.cjs.map → CachedStateProvider-CqPdW7CB.cjs.map} +1 -1
  6. package/dist/{CachedStateProvider-CzyFct42.mjs → CachedStateProvider-DTniehMP.mjs} +1 -1
  7. package/dist/{CachedStateProvider-CzyFct42.mjs.map → CachedStateProvider-DTniehMP.mjs.map} +1 -1
  8. package/dist/{HostingerProvider-B2ZYz7Yc.mjs → HostingerProvider-Cft7lEYr.mjs} +4 -3
  9. package/dist/HostingerProvider-Cft7lEYr.mjs.map +1 -0
  10. package/dist/{HostingerProvider-CrHfsgz9.cjs → HostingerProvider-h3EbEp-Z.cjs} +4 -3
  11. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +1 -0
  12. package/dist/{LocalStateProvider-CP49rjzt.mjs → LocalStateProvider-Bn6tS-oL.mjs} +1 -1
  13. package/dist/{LocalStateProvider-CP49rjzt.mjs.map → LocalStateProvider-Bn6tS-oL.mjs.map} +1 -1
  14. package/dist/{LocalStateProvider-CalzNfNA.cjs → LocalStateProvider-Db9SEjyH.cjs} +1 -1
  15. package/dist/{LocalStateProvider-CalzNfNA.cjs.map → LocalStateProvider-Db9SEjyH.cjs.map} +1 -1
  16. package/dist/{Route53Provider-tlgBzrRQ.mjs → Route53Provider-RdpUDJQk.mjs} +1 -1
  17. package/dist/{Route53Provider-tlgBzrRQ.mjs.map → Route53Provider-RdpUDJQk.mjs.map} +1 -1
  18. package/dist/{Route53Provider-DwgXiLxt.cjs → Route53Provider-di2fMM5N.cjs} +1 -1
  19. package/dist/{Route53Provider-DwgXiLxt.cjs.map → Route53Provider-di2fMM5N.cjs.map} +1 -1
  20. package/dist/{SSMStateProvider-BlrTiV5m.mjs → SSMStateProvider-BRt2py-A.mjs} +1 -1
  21. package/dist/{SSMStateProvider-BlrTiV5m.mjs.map → SSMStateProvider-BRt2py-A.mjs.map} +1 -1
  22. package/dist/{SSMStateProvider-Bt6r8CTL.cjs → SSMStateProvider-DyX8s9HI.cjs} +1 -1
  23. package/dist/{SSMStateProvider-Bt6r8CTL.cjs.map → SSMStateProvider-DyX8s9HI.cjs.map} +1 -1
  24. package/dist/{backup-provisioner-Xunq-p_8.mjs → backup-provisioner-Bgj5Vi_L.mjs} +2 -2
  25. package/dist/{backup-provisioner-Xunq-p_8.mjs.map → backup-provisioner-Bgj5Vi_L.mjs.map} +1 -1
  26. package/dist/{backup-provisioner-B3HBN-2k.cjs → backup-provisioner-BrsHwYG0.cjs} +2 -2
  27. package/dist/{backup-provisioner-B3HBN-2k.cjs.map → backup-provisioner-BrsHwYG0.cjs.map} +1 -1
  28. package/dist/{bundler-Dufq3uvI.cjs → bundler-BY1OmV1e.cjs} +44 -14
  29. package/dist/bundler-BY1OmV1e.cjs.map +1 -0
  30. package/dist/{bundler-DkA4qzUD.mjs → bundler-Be8Zg4Wd.mjs} +45 -15
  31. package/dist/bundler-Be8Zg4Wd.mjs.map +1 -0
  32. package/dist/config-D8o6I_7Z.mjs +469 -0
  33. package/dist/config-D8o6I_7Z.mjs.map +1 -0
  34. package/dist/config-DbPE1KXF.cjs +535 -0
  35. package/dist/config-DbPE1KXF.cjs.map +1 -0
  36. package/dist/config.cjs +3 -2
  37. package/dist/config.d.cts +2 -2
  38. package/dist/config.d.cts.map +1 -1
  39. package/dist/config.d.mts +2 -2
  40. package/dist/config.d.mts.map +1 -1
  41. package/dist/config.mjs +3 -2
  42. package/dist/{credentials-s1kLcIzK.mjs → credentials-B5zRHdAl.mjs} +21 -6
  43. package/dist/credentials-B5zRHdAl.mjs.map +1 -0
  44. package/dist/{credentials-C8DWtnMY.cjs → credentials-BapzjyV5.cjs} +26 -5
  45. package/dist/credentials-BapzjyV5.cjs.map +1 -0
  46. package/dist/credentials-Dh0Q6HzY.mjs +2548 -0
  47. package/dist/credentials-Dh0Q6HzY.mjs.map +1 -0
  48. package/dist/credentials-K961ThG3.cjs +2680 -0
  49. package/dist/credentials-K961ThG3.cjs.map +1 -0
  50. package/dist/deploy/sniffer-routes-worker.cjs +6 -2
  51. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  52. package/dist/deploy/sniffer-routes-worker.mjs +6 -2
  53. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  54. package/dist/discover-CAlFgYec.mjs +229 -0
  55. package/dist/discover-CAlFgYec.mjs.map +1 -0
  56. package/dist/discover-DTmFeloL.cjs +271 -0
  57. package/dist/discover-DTmFeloL.cjs.map +1 -0
  58. package/dist/dokploy-api-BS2xnJLZ.mjs +3 -0
  59. package/dist/{dokploy-api-CqOIKHme.cjs → dokploy-api-BsVH0y_s.cjs} +141 -32
  60. package/dist/dokploy-api-BsVH0y_s.cjs.map +1 -0
  61. package/dist/dokploy-api-BuxDRo3l.cjs +3 -0
  62. package/dist/{dokploy-api-sfZFlWuE.mjs → dokploy-api-aTFPz7_4.mjs} +141 -32
  63. package/dist/dokploy-api-aTFPz7_4.mjs.map +1 -0
  64. package/dist/emit-CbcRolsa.cjs +236 -0
  65. package/dist/emit-CbcRolsa.cjs.map +1 -0
  66. package/dist/emit-CiZS_5Ub.mjs +206 -0
  67. package/dist/emit-CiZS_5Ub.mjs.map +1 -0
  68. package/dist/{encryption-MfXAiFTm.cjs → encryption-C6jaU0hE.cjs} +1 -1
  69. package/dist/{encryption-MfXAiFTm.cjs.map → encryption-C6jaU0hE.cjs.map} +1 -1
  70. package/dist/{encryption-BVS7Vmzs.cjs → encryption-CHzzeR8a.cjs} +1 -1
  71. package/dist/encryption-CQUncu7v.mjs +3 -0
  72. package/dist/{encryption-CO5Q4Bhf.mjs → encryption-D-abyhZx.mjs} +1 -1
  73. package/dist/{encryption-CO5Q4Bhf.mjs.map → encryption-D-abyhZx.mjs.map} +1 -1
  74. package/dist/fullstack-secrets-C-GGohke.cjs +111 -0
  75. package/dist/fullstack-secrets-C-GGohke.cjs.map +1 -0
  76. package/dist/fullstack-secrets-D1o9-G5l.mjs +87 -0
  77. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +1 -0
  78. package/dist/{fullstack-secrets-BYzi6Hwl.cjs → generator-CNzBw7g5.cjs} +1 -114
  79. package/dist/generator-CNzBw7g5.cjs.map +1 -0
  80. package/dist/{fullstack-secrets-l8s3II_H.mjs → generator-VE2JrFlY.mjs} +2 -85
  81. package/dist/generator-VE2JrFlY.mjs.map +1 -0
  82. package/dist/index-BThUzEIp.d.mts +175 -0
  83. package/dist/index-BThUzEIp.d.mts.map +1 -0
  84. package/dist/index-CHB4tSzX.d.cts +175 -0
  85. package/dist/index-CHB4tSzX.d.cts.map +1 -0
  86. package/dist/index.cjs +2329 -1584
  87. package/dist/index.cjs.map +1 -1
  88. package/dist/index.mjs +2306 -1561
  89. package/dist/index.mjs.map +1 -1
  90. package/dist/{openapi-Cfwi0fqF.mjs → openapi-CgpMWMmM.mjs} +174 -95
  91. package/dist/openapi-CgpMWMmM.mjs.map +1 -0
  92. package/dist/{openapi-BzNOC7_i.cjs → openapi-CljONd_M.cjs} +175 -108
  93. package/dist/openapi-CljONd_M.cjs.map +1 -0
  94. package/dist/{openapi-react-query-C4iIvpPf.mjs → openapi-react-query-Byltvm_7.mjs} +2 -2
  95. package/dist/openapi-react-query-Byltvm_7.mjs.map +1 -0
  96. package/dist/{openapi-react-query-CYWik72n.cjs → openapi-react-query-CmJ1xDbn.cjs} +2 -2
  97. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +1 -0
  98. package/dist/openapi-react-query.cjs +1 -1
  99. package/dist/openapi-react-query.mjs +1 -1
  100. package/dist/openapi.cjs +4 -3
  101. package/dist/openapi.d.cts +1 -1
  102. package/dist/openapi.d.mts +1 -1
  103. package/dist/openapi.mjs +4 -3
  104. package/dist/reconcile/public.cjs +9 -0
  105. package/dist/reconcile/public.d.cts +125 -0
  106. package/dist/reconcile/public.d.cts.map +1 -0
  107. package/dist/reconcile/public.d.mts +125 -0
  108. package/dist/reconcile/public.d.mts.map +1 -0
  109. package/dist/reconcile/public.mjs +4 -0
  110. package/dist/{reconcile-B2FoJE0a.mjs → reconcile-CFs8C_1a.mjs} +5 -4
  111. package/dist/reconcile-CFs8C_1a.mjs.map +1 -0
  112. package/dist/{reconcile-BzqKJ2Rt.cjs → reconcile-D0pimNiy.cjs} +5 -4
  113. package/dist/reconcile-D0pimNiy.cjs.map +1 -0
  114. package/dist/setup-CJiQM2pX.cjs +473 -0
  115. package/dist/setup-CJiQM2pX.cjs.map +1 -0
  116. package/dist/setup-DMtU3p41.cjs +11 -0
  117. package/dist/setup-DOsYueeQ.mjs +443 -0
  118. package/dist/setup-DOsYueeQ.mjs.map +1 -0
  119. package/dist/setup-DSutDAlt.mjs +11 -0
  120. package/dist/{storage-B1wvztiJ.cjs → storage-BJmzYxt8.cjs} +1 -1
  121. package/dist/{storage-B1wvztiJ.cjs.map → storage-BJmzYxt8.cjs.map} +1 -1
  122. package/dist/{storage-DOEtT2Hr.cjs → storage-BM9hGpgv.cjs} +1 -1
  123. package/dist/{storage-dbb9RyBl.mjs → storage-Bi24WfoW.mjs} +1 -1
  124. package/dist/{storage-dbb9RyBl.mjs.map → storage-Bi24WfoW.mjs.map} +1 -1
  125. package/dist/{storage-Cs4WBsc4.mjs → storage-CYlGwWTj.mjs} +1 -1
  126. package/dist/{sync-CSooqRQ8.mjs → sync-CmEuNZsB.mjs} +2 -2
  127. package/dist/{sync-CSooqRQ8.mjs.map → sync-CmEuNZsB.mjs.map} +1 -1
  128. package/dist/sync-D306yOWu.cjs +4 -0
  129. package/dist/{sync-o_CtEbvR.cjs → sync-SizaChmC.cjs} +2 -2
  130. package/dist/{sync-o_CtEbvR.cjs.map → sync-SizaChmC.cjs.map} +1 -1
  131. package/dist/{sync-B5UHXwRM.mjs → sync-hOqAWHR6.mjs} +1 -1
  132. package/dist/{index-Bw548Bta.d.mts → types-C-arnQ1r.d.mts} +590 -143
  133. package/dist/types-C-arnQ1r.d.mts.map +1 -0
  134. package/dist/{index-DTpkeFb8.d.cts → types-abJQuk7m.d.cts} +590 -143
  135. package/dist/types-abJQuk7m.d.cts.map +1 -0
  136. package/dist/workspace/index.cjs +5 -1
  137. package/dist/workspace/index.d.cts +3 -3
  138. package/dist/workspace/index.d.mts +3 -3
  139. package/dist/workspace/index.mjs +2 -2
  140. package/dist/{workspace-D-37Ylqo.mjs → workspace-7FqprxuJ.mjs} +117 -30
  141. package/dist/workspace-7FqprxuJ.mjs.map +1 -0
  142. package/dist/workspace-8acupeaI.cjs +9 -0
  143. package/dist/{workspace-CQTT7HJQ.cjs → workspace-XvqO9jIv.cjs} +139 -28
  144. package/dist/workspace-XvqO9jIv.cjs.map +1 -0
  145. package/dist/workspace-yP5AHnrn.mjs +8 -0
  146. package/package.json +26 -9
  147. package/CHANGELOG.md +0 -650
  148. package/FUNCTION_CRON_SUPPORT.md +0 -266
  149. package/dist/CachedStateProvider-GcGziXh1.mjs +0 -3
  150. package/dist/HostingerProvider-B2ZYz7Yc.mjs.map +0 -1
  151. package/dist/HostingerProvider-CrHfsgz9.cjs.map +0 -1
  152. package/dist/bundler-DkA4qzUD.mjs.map +0 -1
  153. package/dist/bundler-Dufq3uvI.cjs.map +0 -1
  154. package/dist/config-Bbu1JKvf.mjs +0 -211
  155. package/dist/config-Bbu1JKvf.mjs.map +0 -1
  156. package/dist/config-DujV8DbR.cjs +0 -253
  157. package/dist/config-DujV8DbR.cjs.map +0 -1
  158. package/dist/credentials-C8DWtnMY.cjs.map +0 -1
  159. package/dist/credentials-s1kLcIzK.mjs.map +0 -1
  160. package/dist/dokploy-api-BPYkG-ZZ.cjs +0 -3
  161. package/dist/dokploy-api-BiSzWM4v.mjs +0 -3
  162. package/dist/dokploy-api-CqOIKHme.cjs.map +0 -1
  163. package/dist/dokploy-api-sfZFlWuE.mjs.map +0 -1
  164. package/dist/encryption-Bd_m4q3g.mjs +0 -3
  165. package/dist/fullstack-secrets-BYzi6Hwl.cjs.map +0 -1
  166. package/dist/fullstack-secrets-l8s3II_H.mjs.map +0 -1
  167. package/dist/index-Bw548Bta.d.mts.map +0 -1
  168. package/dist/index-DTpkeFb8.d.cts.map +0 -1
  169. package/dist/openapi-BzNOC7_i.cjs.map +0 -1
  170. package/dist/openapi-Cfwi0fqF.mjs.map +0 -1
  171. package/dist/openapi-react-query-C4iIvpPf.mjs.map +0 -1
  172. package/dist/openapi-react-query-CYWik72n.cjs.map +0 -1
  173. package/dist/reconcile-B2FoJE0a.mjs.map +0 -1
  174. package/dist/reconcile-BzqKJ2Rt.cjs.map +0 -1
  175. package/dist/setup-DDXUXzzl.mjs +0 -765
  176. package/dist/setup-DDXUXzzl.mjs.map +0 -1
  177. package/dist/setup-DLwhfyt-.cjs +0 -8
  178. package/dist/setup-Dh-B7YTX.mjs +0 -8
  179. package/dist/setup-WZ-xqAQO.cjs +0 -849
  180. package/dist/setup-WZ-xqAQO.cjs.map +0 -1
  181. package/dist/sync-BLA94rgC.cjs +0 -4
  182. package/dist/types-B3GQUg3k.d.mts +0 -280
  183. package/dist/types-B3GQUg3k.d.mts.map +0 -1
  184. package/dist/types-BWQDiooe.d.cts +0 -280
  185. package/dist/types-BWQDiooe.d.cts.map +0 -1
  186. package/dist/workspace-CQTT7HJQ.cjs.map +0 -1
  187. package/dist/workspace-D-37Ylqo.mjs.map +0 -1
  188. package/docs/OPENAPI_TYPESCRIPT_DESIGN.md +0 -408
  189. package/docs/dev-server-resilience-design.md +0 -189
  190. package/docs/manifest-refactor-design.md +0 -287
  191. package/examples/cron-example.ts +0 -45
  192. package/examples/env.ts +0 -33
  193. package/examples/function-example.ts +0 -40
  194. package/examples/gkm.config.json +0 -22
  195. package/examples/gkm.config.ts +0 -14
  196. package/examples/gkm.minimal.config.json +0 -7
  197. package/examples/gkm.production.config.json +0 -27
  198. package/examples/logger.ts +0 -10
  199. package/scripts/sync-versions.ts +0 -108
  200. package/src/__tests__/EndpointGenerator.hooks.spec.ts +0 -204
  201. package/src/__tests__/config.spec.ts +0 -422
  202. package/src/__tests__/loadEnvFiles.spec.ts +0 -131
  203. package/src/__tests__/normalizeHooksConfig.spec.ts +0 -63
  204. package/src/__tests__/openapi-react-query.spec.ts +0 -506
  205. package/src/__tests__/openapi.spec.ts +0 -625
  206. package/src/__tests__/test-helpers.ts +0 -181
  207. package/src/auth/__tests__/credentials.spec.ts +0 -331
  208. package/src/auth/__tests__/index.spec.ts +0 -237
  209. package/src/auth/credentials.ts +0 -286
  210. package/src/auth/index.ts +0 -233
  211. package/src/build/__tests__/bundler.spec.ts +0 -446
  212. package/src/build/__tests__/endpoint-analyzer.spec.ts +0 -623
  213. package/src/build/__tests__/handler-templates.spec.ts +0 -1287
  214. package/src/build/__tests__/index-new.spec.ts +0 -550
  215. package/src/build/__tests__/manifests.spec.ts +0 -583
  216. package/src/build/__tests__/partitions.spec.ts +0 -110
  217. package/src/build/__tests__/workspace-build.spec.ts +0 -215
  218. package/src/build/bundler.ts +0 -256
  219. package/src/build/endpoint-analyzer.ts +0 -236
  220. package/src/build/handler-templates.ts +0 -1253
  221. package/src/build/index.ts +0 -616
  222. package/src/build/manifests.ts +0 -285
  223. package/src/build/partitions.ts +0 -58
  224. package/src/build/providerResolver.ts +0 -184
  225. package/src/build/types.ts +0 -104
  226. package/src/config.ts +0 -330
  227. package/src/credentials/__tests__/fullDockerPorts.spec.ts +0 -144
  228. package/src/credentials/__tests__/helpers.ts +0 -112
  229. package/src/credentials/__tests__/prepareEntryCredentials.spec.ts +0 -125
  230. package/src/credentials/__tests__/readonlyDockerPorts.spec.ts +0 -190
  231. package/src/credentials/__tests__/workspaceCredentials.spec.ts +0 -209
  232. package/src/credentials/index.ts +0 -843
  233. package/src/debug.ts +0 -68
  234. package/src/deploy/CachedStateProvider.ts +0 -86
  235. package/src/deploy/LocalStateProvider.ts +0 -57
  236. package/src/deploy/SSMStateProvider.ts +0 -117
  237. package/src/deploy/StateProvider.ts +0 -175
  238. package/src/deploy/__tests__/CachedStateProvider.spec.ts +0 -235
  239. package/src/deploy/__tests__/HostingerProvider.spec.ts +0 -347
  240. package/src/deploy/__tests__/LocalStateProvider.spec.ts +0 -130
  241. package/src/deploy/__tests__/Route53Provider.spec.ts +0 -425
  242. package/src/deploy/__tests__/SSMStateProvider.spec.ts +0 -201
  243. package/src/deploy/__tests__/__fixtures__/entry-apps/async-entry.ts +0 -24
  244. package/src/deploy/__tests__/__fixtures__/entry-apps/nested-config-entry.ts +0 -24
  245. package/src/deploy/__tests__/__fixtures__/entry-apps/no-env-entry.ts +0 -12
  246. package/src/deploy/__tests__/__fixtures__/entry-apps/simple-entry.ts +0 -14
  247. package/src/deploy/__tests__/__fixtures__/entry-apps/throwing-entry.ts +0 -16
  248. package/src/deploy/__tests__/__fixtures__/env-parsers/non-function-export.ts +0 -10
  249. package/src/deploy/__tests__/__fixtures__/env-parsers/optional-env-parser.ts +0 -21
  250. package/src/deploy/__tests__/__fixtures__/env-parsers/parseable-env-parser.ts +0 -18
  251. package/src/deploy/__tests__/__fixtures__/env-parsers/throwing-env-parser.ts +0 -16
  252. package/src/deploy/__tests__/__fixtures__/env-parsers/valid-env-parser.ts +0 -16
  253. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/auth.ts +0 -16
  254. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/health.ts +0 -13
  255. package/src/deploy/__tests__/__fixtures__/route-apps/endpoints/users.ts +0 -15
  256. package/src/deploy/__tests__/__fixtures__/route-apps/services.ts +0 -55
  257. package/src/deploy/__tests__/backup-provisioner.spec.ts +0 -428
  258. package/src/deploy/__tests__/createDnsProvider.spec.ts +0 -195
  259. package/src/deploy/__tests__/createStateProvider.spec.ts +0 -126
  260. package/src/deploy/__tests__/dns-orchestration.spec.ts +0 -192
  261. package/src/deploy/__tests__/dns-verification.spec.ts +0 -229
  262. package/src/deploy/__tests__/docker.spec.ts +0 -149
  263. package/src/deploy/__tests__/dokploy-api.spec.ts +0 -697
  264. package/src/deploy/__tests__/dokploy.spec.ts +0 -435
  265. package/src/deploy/__tests__/domain.spec.ts +0 -235
  266. package/src/deploy/__tests__/env-resolver.spec.ts +0 -903
  267. package/src/deploy/__tests__/index.spec.ts +0 -1091
  268. package/src/deploy/__tests__/init.spec.ts +0 -793
  269. package/src/deploy/__tests__/secrets.spec.ts +0 -303
  270. package/src/deploy/__tests__/sniffer.spec.ts +0 -838
  271. package/src/deploy/__tests__/state-e2e.spec.ts +0 -387
  272. package/src/deploy/__tests__/state.spec.ts +0 -876
  273. package/src/deploy/__tests__/undeploy.spec.ts +0 -758
  274. package/src/deploy/backup-provisioner.ts +0 -316
  275. package/src/deploy/dns/DnsProvider.ts +0 -201
  276. package/src/deploy/dns/HostingerProvider.ts +0 -174
  277. package/src/deploy/dns/Route53Provider.ts +0 -340
  278. package/src/deploy/dns/hostinger-api.ts +0 -261
  279. package/src/deploy/dns/index.ts +0 -627
  280. package/src/deploy/docker.ts +0 -260
  281. package/src/deploy/dokploy-api.ts +0 -1101
  282. package/src/deploy/dokploy.ts +0 -177
  283. package/src/deploy/domain.ts +0 -134
  284. package/src/deploy/env-resolver.ts +0 -305
  285. package/src/deploy/index.ts +0 -2094
  286. package/src/deploy/init.ts +0 -427
  287. package/src/deploy/secrets.ts +0 -187
  288. package/src/deploy/sniffer-envkit-patch.ts +0 -61
  289. package/src/deploy/sniffer-hooks.ts +0 -57
  290. package/src/deploy/sniffer-loader.ts +0 -28
  291. package/src/deploy/sniffer-routes-worker.ts +0 -104
  292. package/src/deploy/sniffer-worker.ts +0 -75
  293. package/src/deploy/sniffer.ts +0 -578
  294. package/src/deploy/state-commands.ts +0 -274
  295. package/src/deploy/state.ts +0 -482
  296. package/src/deploy/types.ts +0 -102
  297. package/src/deploy/undeploy.ts +0 -407
  298. package/src/dev/__tests__/entry-integration.spec.ts +0 -347
  299. package/src/dev/__tests__/entry.spec.ts +0 -144
  300. package/src/dev/__tests__/index.spec.ts +0 -2084
  301. package/src/dev/index.ts +0 -1649
  302. package/src/docker/__tests__/compose.spec.ts +0 -1142
  303. package/src/docker/__tests__/templates.spec.ts +0 -694
  304. package/src/docker/compose.ts +0 -808
  305. package/src/docker/index.ts +0 -523
  306. package/src/docker/templates.ts +0 -1067
  307. package/src/exec/index.ts +0 -118
  308. package/src/generators/CronGenerator.ts +0 -105
  309. package/src/generators/EndpointGenerator.ts +0 -954
  310. package/src/generators/FunctionGenerator.ts +0 -117
  311. package/src/generators/Generator.ts +0 -147
  312. package/src/generators/OpenApiTsGenerator.ts +0 -821
  313. package/src/generators/QueueGenerator.ts +0 -245
  314. package/src/generators/SubscriberGenerator.ts +0 -282
  315. package/src/generators/TopicGenerator.ts +0 -45
  316. package/src/generators/__tests__/CronGenerator.spec.ts +0 -445
  317. package/src/generators/__tests__/EndpointGenerator.spec.ts +0 -544
  318. package/src/generators/__tests__/FunctionGenerator.spec.ts +0 -256
  319. package/src/generators/__tests__/Generator.bustCache.spec.ts +0 -72
  320. package/src/generators/__tests__/OpenApiTsGenerator.registry.spec.ts +0 -98
  321. package/src/generators/__tests__/OpenApiTsGenerator.responseType.spec.ts +0 -56
  322. package/src/generators/__tests__/QueueGenerator.spec.ts +0 -141
  323. package/src/generators/__tests__/SubscriberGenerator.spec.ts +0 -410
  324. package/src/generators/index.ts +0 -11
  325. package/src/index.ts +0 -972
  326. package/src/init/__tests__/generators.spec.ts +0 -1070
  327. package/src/init/__tests__/init.spec.ts +0 -577
  328. package/src/init/__tests__/utils.spec.ts +0 -104
  329. package/src/init/generators/auth.ts +0 -225
  330. package/src/init/generators/config.ts +0 -316
  331. package/src/init/generators/docker.ts +0 -388
  332. package/src/init/generators/env.ts +0 -62
  333. package/src/init/generators/index.ts +0 -6
  334. package/src/init/generators/mobile-expo.ts +0 -576
  335. package/src/init/generators/models.ts +0 -153
  336. package/src/init/generators/monorepo.ts +0 -475
  337. package/src/init/generators/package.ts +0 -95
  338. package/src/init/generators/source.ts +0 -15
  339. package/src/init/generators/test.ts +0 -178
  340. package/src/init/generators/ui.ts +0 -1473
  341. package/src/init/generators/web-tanstack.ts +0 -348
  342. package/src/init/generators/web.ts +0 -363
  343. package/src/init/index.ts +0 -542
  344. package/src/init/templates/api.ts +0 -404
  345. package/src/init/templates/index.ts +0 -342
  346. package/src/init/templates/minimal.ts +0 -207
  347. package/src/init/templates/serverless.ts +0 -148
  348. package/src/init/templates/worker.ts +0 -216
  349. package/src/init/utils.ts +0 -197
  350. package/src/init/versions.ts +0 -52
  351. package/src/openapi-react-query.ts +0 -288
  352. package/src/openapi.ts +0 -259
  353. package/src/secrets/__tests__/encryption.spec.ts +0 -226
  354. package/src/secrets/__tests__/generator.spec.ts +0 -575
  355. package/src/secrets/__tests__/index.spec.ts +0 -91
  356. package/src/secrets/__tests__/reconcile.spec.ts +0 -123
  357. package/src/secrets/__tests__/storage.spec.ts +0 -645
  358. package/src/secrets/encryption.ts +0 -91
  359. package/src/secrets/generator.ts +0 -329
  360. package/src/secrets/index.ts +0 -417
  361. package/src/secrets/keystore.ts +0 -144
  362. package/src/secrets/reconcile.ts +0 -53
  363. package/src/secrets/storage.ts +0 -337
  364. package/src/secrets/sync.ts +0 -136
  365. package/src/secrets/types.ts +0 -70
  366. package/src/setup/__tests__/auto-setup.spec.ts +0 -147
  367. package/src/setup/__tests__/reconcile-secrets.spec.ts +0 -439
  368. package/src/setup/fullstack-secrets.ts +0 -140
  369. package/src/setup/index.ts +0 -411
  370. package/src/test/__tests__/__fixtures__/workspace.ts +0 -104
  371. package/src/test/__tests__/api.spec.ts +0 -199
  372. package/src/test/__tests__/auth.spec.ts +0 -162
  373. package/src/test/__tests__/index.spec.ts +0 -502
  374. package/src/test/__tests__/web.spec.ts +0 -210
  375. package/src/test/index.ts +0 -198
  376. package/src/types.ts +0 -363
  377. package/src/upgrade/__tests__/index.spec.ts +0 -354
  378. package/src/upgrade/index.ts +0 -253
  379. package/src/workspace/__tests__/client-generator.spec.ts +0 -326
  380. package/src/workspace/__tests__/index.spec.ts +0 -766
  381. package/src/workspace/__tests__/publicEnv.spec.ts +0 -64
  382. package/src/workspace/__tests__/schema.spec.ts +0 -737
  383. package/src/workspace/__tests__/type-inference.spec.ts +0 -251
  384. package/src/workspace/client-generator.ts +0 -109
  385. package/src/workspace/index.ts +0 -433
  386. package/src/workspace/publicEnv.ts +0 -57
  387. package/src/workspace/schema.ts +0 -861
  388. package/src/workspace/types.ts +0 -943
  389. package/tsconfig.json +0 -9
  390. package/tsdown.config.ts +0 -22
@@ -0,0 +1,535 @@
1
+ const require_chunk = require('./chunk-CUT6urMc.cjs');
2
+ const require_discover = require('./discover-DTmFeloL.cjs');
3
+ const require_workspace = require('./workspace-XvqO9jIv.cjs');
4
+ const node_fs = require_chunk.__toESM(require("node:fs"));
5
+ const node_path = require_chunk.__toESM(require("node:path"));
6
+ const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
7
+
8
+ //#region src/workspace/derive.ts
9
+ /** Which frontend framework builds each site variant. */
10
+ const FRAMEWORKS = {
11
+ static: "vite",
12
+ next: "nextjs",
13
+ tanstack: "tanstack-start"
14
+ };
15
+ /**
16
+ * The app key a construct id becomes.
17
+ *
18
+ * The same kebab form every physical name is built from, so `Api` is `api` in
19
+ * the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an
20
+ * environment — one id, three renderings, no second list.
21
+ */
22
+ function appKey(id) {
23
+ return (0, __geekmidas_manifest.kebabCase)(id);
24
+ }
25
+ /**
26
+ * The app serving a surface: its own, always.
27
+ *
28
+ * Every surface gets a container. There is no arrangement in which one runs
29
+ * inside another — two surfaces in a process share a filesystem, an
30
+ * environment, and every credential either was granted, so an auth server
31
+ * beside an API is one bug in the API away from being read by it.
32
+ */
33
+ function hostOf(manifest, id) {
34
+ const declaration = manifest[id];
35
+ if (!declaration || declaration.kind !== "rest-api") return void 0;
36
+ return id;
37
+ }
38
+ /**
39
+ * Local ports, assigned so that adding a site does not renumber the others.
40
+ *
41
+ * Backends first, then the site holding the base domain, then the rest
42
+ * alphabetically. The ordering is arbitrary but it is *fixed*, which is the
43
+ * property that matters: a port that moves when an unrelated app is added is a
44
+ * port nobody can put in a bookmark. A construct that names its own port keeps
45
+ * it, and is skipped here.
46
+ */
47
+ function assignPorts(apps) {
48
+ const rank = (name, app) => [
49
+ app.type === "backend" ? 0 : app.type === "web" ? 1 : 2,
50
+ app.root ? 0 : 1,
51
+ name
52
+ ];
53
+ const ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {
54
+ const [at, ar, an] = rank(aName, a);
55
+ const [bt, br, bn] = rank(bName, b);
56
+ return at - bt || ar - br || an.localeCompare(bn);
57
+ });
58
+ const taken = new Set(ordered.map(([, app]) => app.port).filter((p) => !!p));
59
+ let next = 3e3;
60
+ for (const [, app] of ordered) {
61
+ if (app.port) continue;
62
+ while (taken.has(next)) next += 1;
63
+ app.port = next;
64
+ taken.add(next);
65
+ }
66
+ }
67
+ /**
68
+ * Whichever site holds the base domain.
69
+ *
70
+ * The convention first — a site named `web` — because it is one people already
71
+ * rely on. Then an explicit `root: true`. A project with one site needs neither.
72
+ */
73
+ function markRoot(apps) {
74
+ const sites = Object.entries(apps).filter(([, a]) => a.type === "web");
75
+ if (sites.length === 0) return;
76
+ if (sites.some(([, a]) => a.root)) return;
77
+ const chosen = sites.find(([name]) => name === "web") ?? (sites.length === 1 ? sites[0] : void 0);
78
+ if (chosen) chosen[1].root = true;
79
+ }
80
+ /**
81
+ * What `app: true` means, and what the object form leaves out.
82
+ *
83
+ * Both fields follow from the construct's own id, so neither was worth making
84
+ * someone write down:
85
+ *
86
+ * - `path` is `apps/<kebab-id>` where that directory exists, and the workspace
87
+ * root otherwise. `Api` means `apps/api` in a monorepo and `.` in a
88
+ * single-app project, and which of the two you are in is answerable by
89
+ * looking.
90
+ * - `code` is the conventional directories under `path`. A glob is worth
91
+ * writing only when the code is somewhere else, which is the case the field
92
+ * still exists for.
93
+ *
94
+ * A site takes no `code`: its build is its framework's, not ours.
95
+ */
96
+ /**
97
+ * Where an app lives when it did not say.
98
+ *
99
+ * `apps/<kebab-id>`, which is what the id already said — or the project root
100
+ * when there is no `apps/` at all, because then there is one app and it is the
101
+ * project.
102
+ *
103
+ * In between, it refuses. A workspace *with* an `apps/` directory and no
104
+ * `apps/<key>` in it is a construct naming a directory nobody wrote, and
105
+ * quietly answering `.` there makes the app the whole repository: the build
106
+ * filters turbo on the root `package.json` and builds the wrong thing, or
107
+ * itself. A missing directory is a typo or an unconventional layout, and both
108
+ * want saying out loud.
109
+ */
110
+ function conventionalPath(id, workspaceRoot) {
111
+ const conventional = (0, node_path.join)("apps", appKey(id));
112
+ if ((0, node_fs.existsSync)((0, node_path.join)(workspaceRoot, conventional))) return conventional;
113
+ if (!(0, node_fs.existsSync)((0, node_path.join)(workspaceRoot, "apps"))) return ".";
114
+ throw new MisplacedApp(id, conventional);
115
+ }
116
+ /** A construct whose directory is not where its id says it is. */
117
+ var MisplacedApp = class extends Error {
118
+ constructor(construct, expected) {
119
+ super(`"${construct}" has no directory at ${expected}.\nCreate it, or say where it lives:\n new StaticSite('${construct}', { path: 'sites/${appKey(construct)}' })\n new RestApi('${construct}', { …, app: { path: 'services/${appKey(construct)}' } })`);
120
+ this.construct = construct;
121
+ this.expected = expected;
122
+ this.name = "MisplacedApp";
123
+ }
124
+ };
125
+ function resolveAppSpec(id, spec, workspaceRoot, kind) {
126
+ const path = spec.path ?? conventionalPath(id, workspaceRoot);
127
+ const givenAGlob = spec.code !== void 0 || spec.routes !== void 0 || spec.functions !== void 0 || spec.crons !== void 0 || spec.queues !== void 0 || spec.topics !== void 0 || spec.subscribers !== void 0;
128
+ return {
129
+ ...spec,
130
+ path,
131
+ ...kind === "rest-api" && !givenAGlob ? { code: __geekmidas_manifest.DEFAULT_APP_CODE } : {}
132
+ };
133
+ }
134
+ function derivedApps(manifest, workspace) {
135
+ const apps = {};
136
+ const defaultTarget = workspace.deploy?.default ?? "dokploy";
137
+ for (const [id, declaration] of Object.entries(manifest)) {
138
+ if (declaration.kind !== "site" && declaration.kind !== "rest-api") continue;
139
+ const spec = resolveAppSpec(id, declaration.app ?? {}, workspace.root, declaration.kind);
140
+ const name = appKey(id);
141
+ const configured = workspace.apps[name];
142
+ apps[name] = {
143
+ ...configured,
144
+ type: declaration.kind === "site" ? "web" : "backend",
145
+ path: spec.path,
146
+ port: spec.port ?? configured?.port ?? 0,
147
+ dependencies: [],
148
+ resolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,
149
+ ...declaration.kind === "site" ? {
150
+ framework: configured?.framework ?? FRAMEWORKS[declaration.variant],
151
+ ...declaration.root ? { root: true } : {},
152
+ ...spec.config ? { config: spec.config } : {}
153
+ } : {},
154
+ ...spec.code !== void 0 ? {
155
+ routes: spec.code,
156
+ functions: spec.code,
157
+ crons: spec.code,
158
+ queues: spec.code,
159
+ topics: spec.code,
160
+ subscribers: spec.code
161
+ } : {},
162
+ ...spec.routes !== void 0 ? { routes: spec.routes } : {},
163
+ ...spec.functions !== void 0 ? { functions: spec.functions } : {},
164
+ ...spec.crons !== void 0 ? { crons: spec.crons } : {},
165
+ ...spec.queues !== void 0 ? { queues: spec.queues } : {},
166
+ ...spec.topics !== void 0 ? { topics: spec.topics } : {},
167
+ ...spec.subscribers !== void 0 ? { subscribers: spec.subscribers } : {},
168
+ ...spec.envParser !== void 0 ? { envParser: spec.envParser } : {},
169
+ ...spec.logger !== void 0 ? { logger: spec.logger } : {},
170
+ ...spec.telescope !== void 0 ? { telescope: spec.telescope } : {},
171
+ ...spec.studio !== void 0 ? { studio: spec.studio } : {},
172
+ ...spec.openapi !== void 0 ? { openapi: spec.openapi } : {},
173
+ ...spec.runtime !== void 0 ? { runtime: spec.runtime } : {},
174
+ ...spec.env !== void 0 ? { env: spec.env } : {},
175
+ ...spec.entry !== void 0 ? { entry: spec.entry } : {},
176
+ ...configured?.domain ? { domain: configured.domain } : {}
177
+ };
178
+ }
179
+ for (const [id, declaration] of Object.entries(manifest)) {
180
+ if (declaration.kind !== "site" && declaration.kind !== "rest-api") continue;
181
+ const app = apps[appKey(id)];
182
+ if (!app) continue;
183
+ const edges = declaration.kind === "site" ? declaration.dependencies : declaration.calls ?? [];
184
+ const names = /* @__PURE__ */ new Set();
185
+ for (const edge of edges) {
186
+ if (edge.kind !== "rest-api") continue;
187
+ const host = hostOf(manifest, edge.target);
188
+ if (!host) continue;
189
+ const key = appKey(host);
190
+ if (key !== appKey(id) && apps[key]) names.add(key);
191
+ }
192
+ app.dependencies = [...names].sort();
193
+ }
194
+ markRoot(apps);
195
+ assignPorts(apps);
196
+ for (const [name, app] of Object.entries(workspace.apps)) if (!apps[name]) apps[name] = app;
197
+ return apps;
198
+ }
199
+
200
+ //#endregion
201
+ //#region src/config.ts
202
+ /**
203
+ * Define GKM configuration with full TypeScript support.
204
+ * This is an identity function that provides type safety and autocomplete.
205
+ *
206
+ * @example
207
+ * ```ts
208
+ * // gkm.config.ts
209
+ * import { defineConfig } from '@geekmidas/cli/config';
210
+ *
211
+ * export default defineConfig({
212
+ * routes: './src/endpoints/**\/*.ts',
213
+ * envParser: './src/config/env',
214
+ * logger: './src/config/logger',
215
+ * telescope: true,
216
+ * });
217
+ * ```
218
+ */
219
+ function defineConfig(config) {
220
+ return config;
221
+ }
222
+ /**
223
+ * Parse a module config string into path and import pattern.
224
+ *
225
+ * @param configString - Config string in format "./path/to/module" or "./path/to/module#exportName"
226
+ * @param defaultAlias - The default alias name to use if no export name specified
227
+ * @returns Object with path and import pattern
228
+ *
229
+ * @example
230
+ * parseModuleConfig('./src/config/env', 'envParser')
231
+ * // { path: './src/config/env', importPattern: 'envParser' }
232
+ *
233
+ * parseModuleConfig('./src/config/env#envParser', 'envParser')
234
+ * // { path: './src/config/env', importPattern: '{ envParser }' }
235
+ *
236
+ * parseModuleConfig('./src/config/env#myEnv', 'envParser')
237
+ * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
238
+ */
239
+ function parseModuleConfig(configString, defaultAlias) {
240
+ const parts = configString.split("#");
241
+ const path = parts[0] ?? configString;
242
+ const exportName = parts[1];
243
+ const importPattern = !exportName ? defaultAlias : exportName === defaultAlias ? `{ ${defaultAlias} }` : `{ ${exportName} as ${defaultAlias} }`;
244
+ return {
245
+ path,
246
+ importPattern
247
+ };
248
+ }
249
+ /**
250
+ * Find and return the path to the config file.
251
+ *
252
+ * Resolution order:
253
+ * 1. GKM_CONFIG_PATH env var (set by workspace dev command)
254
+ * 2. Walk up directory tree from cwd
255
+ */
256
+ function findConfigPath(cwd) {
257
+ const files = [
258
+ "gkm.config.json",
259
+ "gkm.config.ts",
260
+ "gkm.config.js"
261
+ ];
262
+ const envConfigPath = process.env.GKM_CONFIG_PATH;
263
+ if (envConfigPath && (0, node_fs.existsSync)(envConfigPath)) return {
264
+ configPath: envConfigPath,
265
+ workspaceRoot: (0, node_path.dirname)(envConfigPath)
266
+ };
267
+ let currentDir = cwd;
268
+ const { root } = (0, node_path.parse)(currentDir);
269
+ while (currentDir !== root) {
270
+ for (const file of files) {
271
+ const configPath = (0, node_path.join)(currentDir, file);
272
+ if ((0, node_fs.existsSync)(configPath)) return {
273
+ configPath,
274
+ workspaceRoot: currentDir
275
+ };
276
+ }
277
+ currentDir = (0, node_path.dirname)(currentDir);
278
+ }
279
+ throw new Error("Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.");
280
+ }
281
+ /**
282
+ * Get app name from package.json in the given directory.
283
+ * Handles scoped packages by extracting the name after the scope.
284
+ *
285
+ * @example
286
+ * getAppNameFromCwd('/path/to/apps/api')
287
+ * // package.json: { "name": "@myorg/api" }
288
+ * // Returns: 'api'
289
+ */
290
+ function getAppNameFromCwd(cwd = process.cwd()) {
291
+ const packageJsonPath = (0, node_path.join)(cwd, "package.json");
292
+ if (!(0, node_fs.existsSync)(packageJsonPath)) return null;
293
+ try {
294
+ const packageJson = JSON.parse((0, node_fs.readFileSync)(packageJsonPath, "utf-8"));
295
+ const name = packageJson.name;
296
+ if (!name) return null;
297
+ if (name.startsWith("@") && name.includes("/")) return name.split("/")[1] ?? null;
298
+ return name;
299
+ } catch {
300
+ return null;
301
+ }
302
+ }
303
+ /**
304
+ * Load raw configuration from file.
305
+ */
306
+ async function loadRawConfig(cwd) {
307
+ const { configPath, workspaceRoot } = findConfigPath(cwd);
308
+ try {
309
+ const config = await import(configPath);
310
+ return {
311
+ config: config.default,
312
+ workspaceRoot
313
+ };
314
+ } catch (error) {
315
+ throw new Error(`Failed to load config: ${error.message}`);
316
+ }
317
+ }
318
+ /**
319
+ * Load configuration file (single-app format).
320
+ * For backwards compatibility with existing code.
321
+ *
322
+ * @deprecated Use loadWorkspaceConfig for new code
323
+ */
324
+ async function loadConfig(cwd = process.cwd()) {
325
+ const { config } = await loadRawConfig(cwd);
326
+ if (require_workspace.isWorkspaceConfig(config)) throw new Error("Workspace configuration detected. Use loadWorkspaceConfig() instead.");
327
+ return config;
328
+ }
329
+ /**
330
+ * Load configuration file and process it as a workspace.
331
+ * Works with both single-app and workspace configurations.
332
+ *
333
+ * Single-app configs are automatically wrapped as a workspace with one app.
334
+ *
335
+ * @example
336
+ * ```ts
337
+ * const { type, workspace } = await loadWorkspaceConfig();
338
+ *
339
+ * if (type === 'workspace') {
340
+ * console.log('Multi-app workspace:', workspace.apps);
341
+ * } else {
342
+ * console.log('Single app wrapped as workspace');
343
+ * }
344
+ * ```
345
+ */
346
+ async function loadWorkspaceConfig(cwd = process.cwd()) {
347
+ const { config, workspaceRoot } = await loadRawConfig(cwd);
348
+ return withDerivedApps(require_workspace.processConfig(config, workspaceRoot));
349
+ }
350
+ /**
351
+ * The loaded config, with its apps read off the graph.
352
+ *
353
+ * Here rather than at each call site because every command needs the same
354
+ * answer, and the ones that forgot to ask were exactly the bugs: a site that
355
+ * never deployed, a surface that could not be its own process. `gkm dev`,
356
+ * `gkm build`, `gkm docker` and `gkm deploy` now all see the same apps without
357
+ * any of them knowing a derivation happened.
358
+ *
359
+ * Discovery imports the construct modules — declarations only, not endpoints —
360
+ * which is the same import the reconciler and the build already do. A workspace
361
+ * with no `constructs` glob discovers nothing and keeps whatever its config
362
+ * said, so nothing that worked before changes.
363
+ *
364
+ * A construct file that throws is reported and skipped rather than taking the
365
+ * command down: `gkm dev` failing to start because a half-written declaration
366
+ * cannot be imported is a worse failure than starting with the app it does not
367
+ * describe yet.
368
+ */
369
+ async function withDerivedApps(loaded) {
370
+ const globs = require_workspace.allConstructGlobs(loaded.workspace);
371
+ if (globs.length === 0) return loaded;
372
+ try {
373
+ const manifest = await require_discover.discover({
374
+ patterns: globs,
375
+ cwd: loaded.workspace.root
376
+ });
377
+ return {
378
+ ...loaded,
379
+ manifest,
380
+ workspace: {
381
+ ...loaded.workspace,
382
+ apps: derivedApps(manifest, loaded.workspace)
383
+ }
384
+ };
385
+ } catch (error) {
386
+ const message = error instanceof Error ? error.message : String(error);
387
+ console.warn(`⚠️ Could not read constructs, so apps come from config alone: ${message}`);
388
+ return loaded;
389
+ }
390
+ }
391
+ /**
392
+ * The app a package directory refers to, and what the workspace calls it.
393
+ *
394
+ * A single-app config is wrapped as a one-app workspace keyed `api`, which is
395
+ * almost never the package name. Matching on the key alone means an app like
396
+ * `@geekmidas/example` resolves to nothing and silently loses everything that
397
+ * comes from the workspace — including the URLs its constructs declare.
398
+ */
399
+ function resolveWorkspaceApp(loadedConfig, appName) {
400
+ const apps = loadedConfig.workspace.apps;
401
+ const named = apps[appName];
402
+ if (named) return {
403
+ key: appName,
404
+ app: named
405
+ };
406
+ const names = Object.keys(apps);
407
+ const only = names[0];
408
+ if (loadedConfig.type !== "single" || names.length !== 1 || !only) return void 0;
409
+ const app = apps[only];
410
+ return app ? {
411
+ key: only,
412
+ app
413
+ } : void 0;
414
+ }
415
+ /**
416
+ * Load app-specific configuration from workspace.
417
+ * Uses the app name from package.json to find the correct app config.
418
+ *
419
+ * @example
420
+ * ```ts
421
+ * // From apps/api directory with package.json: { "name": "@myorg/api" }
422
+ * const { app, workspace, workspaceRoot } = await loadAppConfig();
423
+ * console.log(app.routes); // './src/endpoints/**\/*.ts'
424
+ * ```
425
+ */
426
+ async function loadAppConfig(cwd = process.cwd()) {
427
+ const appName = getAppNameFromCwd(cwd);
428
+ if (!appName) throw new Error("Could not determine app name. Ensure package.json exists with a \"name\" field.");
429
+ const { config, workspaceRoot } = await loadRawConfig(cwd);
430
+ const loadedConfig = await withDerivedApps(require_workspace.processConfig(config, workspaceRoot));
431
+ const resolved = resolveWorkspaceApp(loadedConfig, appName);
432
+ if (!resolved) throw new Error(`App "${appName}" not found in workspace config. Available apps: ${Object.keys(loadedConfig.workspace.apps).join(", ")}. Ensure the package.json name matches the app key in gkm.config.ts.`);
433
+ const { key, app } = resolved;
434
+ const gkmConfig = require_workspace.getAppGkmConfig(loadedConfig.workspace, key);
435
+ if (!gkmConfig) throw new Error(`App "${appName}" is not a backend app and cannot be run with gkm dev.`);
436
+ return {
437
+ appName,
438
+ app,
439
+ gkmConfig,
440
+ workspace: loadedConfig.workspace,
441
+ workspaceRoot,
442
+ appRoot: (0, node_path.join)(workspaceRoot, app.path)
443
+ };
444
+ }
445
+ /**
446
+ * Load workspace info for any app (frontend or backend).
447
+ * Unlike loadAppConfig, this does NOT require the app to have a gkm config
448
+ * (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.
449
+ */
450
+ async function loadWorkspaceAppInfo(cwd = process.cwd()) {
451
+ const appName = getAppNameFromCwd(cwd);
452
+ if (!appName) throw new Error("Could not determine app name. Ensure package.json exists with a \"name\" field.");
453
+ const { config, workspaceRoot } = await loadRawConfig(cwd);
454
+ const loadedConfig = await withDerivedApps(require_workspace.processConfig(config, workspaceRoot));
455
+ const resolved = resolveWorkspaceApp(loadedConfig, appName);
456
+ if (!resolved) {
457
+ const availableApps = Object.keys(loadedConfig.workspace.apps).join(", ");
458
+ throw new Error(`App "${appName}" not found in workspace config. Available apps: ${availableApps}. Ensure the package.json name matches the app key in gkm.config.ts.`);
459
+ }
460
+ return {
461
+ appName,
462
+ app: resolved.app,
463
+ workspace: loadedConfig.workspace,
464
+ workspaceRoot
465
+ };
466
+ }
467
+
468
+ //#endregion
469
+ Object.defineProperty(exports, 'appKey', {
470
+ enumerable: true,
471
+ get: function () {
472
+ return appKey;
473
+ }
474
+ });
475
+ Object.defineProperty(exports, 'defineConfig', {
476
+ enumerable: true,
477
+ get: function () {
478
+ return defineConfig;
479
+ }
480
+ });
481
+ Object.defineProperty(exports, 'derivedApps', {
482
+ enumerable: true,
483
+ get: function () {
484
+ return derivedApps;
485
+ }
486
+ });
487
+ Object.defineProperty(exports, 'getAppNameFromCwd', {
488
+ enumerable: true,
489
+ get: function () {
490
+ return getAppNameFromCwd;
491
+ }
492
+ });
493
+ Object.defineProperty(exports, 'hostOf', {
494
+ enumerable: true,
495
+ get: function () {
496
+ return hostOf;
497
+ }
498
+ });
499
+ Object.defineProperty(exports, 'loadAppConfig', {
500
+ enumerable: true,
501
+ get: function () {
502
+ return loadAppConfig;
503
+ }
504
+ });
505
+ Object.defineProperty(exports, 'loadConfig', {
506
+ enumerable: true,
507
+ get: function () {
508
+ return loadConfig;
509
+ }
510
+ });
511
+ Object.defineProperty(exports, 'loadWorkspaceAppInfo', {
512
+ enumerable: true,
513
+ get: function () {
514
+ return loadWorkspaceAppInfo;
515
+ }
516
+ });
517
+ Object.defineProperty(exports, 'loadWorkspaceConfig', {
518
+ enumerable: true,
519
+ get: function () {
520
+ return loadWorkspaceConfig;
521
+ }
522
+ });
523
+ Object.defineProperty(exports, 'parseModuleConfig', {
524
+ enumerable: true,
525
+ get: function () {
526
+ return parseModuleConfig;
527
+ }
528
+ });
529
+ Object.defineProperty(exports, 'resolveAppSpec', {
530
+ enumerable: true,
531
+ get: function () {
532
+ return resolveAppSpec;
533
+ }
534
+ });
535
+ //# sourceMappingURL=config-DbPE1KXF.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-DbPE1KXF.cjs","names":["FRAMEWORKS: Record<string, Framework>","id: string","manifest: ConstructManifest","apps: Record<string, NormalizedAppConfig>","name: string","app: NormalizedAppConfig","workspaceRoot: string","construct: string","expected: string","spec: AppSpec","kind: 'site' | 'rest-api'","DEFAULT_APP_CODE","workspace: NormalizedWorkspace","defaultTarget: DeployTarget","config: GkmConfig","configString: string","defaultAlias: string","cwd: string","loaded: LoadedConfig","loadedConfig: LoadedConfig","appName: string"],"sources":["../src/workspace/derive.ts","../src/config.ts"],"sourcesContent":["/**\n * The apps a manifest implies.\n *\n * `gkm.config.ts` used to carry an `apps` block naming every app: its type, its\n * path, its port, its framework, which other apps it depended on. Every one of\n * those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`\n * and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',\n * dependencies: ['api'] }` are the same statement written twice, and only one of\n * them was checked against anything — so the copy in config was free to drift,\n * and a surface config had no entry for simply never deployed.\n *\n * So the list comes from the graph. A `site` is an app. A `rest-api` that named\n * an `app` is an app. A `rest-api` that did not is served by the surface that\n * named it as its authenticator, which is the same collapsing rule the deploy\n * already used, now stated once and read by everybody.\n *\n * What config still supplies is what no graph can answer: the backends a cache\n * and a mailer resolve to, the deploy endpoint, the stage's domain.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join } from 'node:path';\nimport {\n\ttype AppSpec,\n\ttype ConstructManifest,\n\tDEFAULT_APP_CODE,\n\tkebabCase,\n} from '@geekmidas/manifest';\nimport type {\n\tAppDomainConfig,\n\tDeployTarget,\n\tFramework,\n\tNormalizedAppConfig,\n\tNormalizedWorkspace,\n} from './types.js';\n\n/** Which frontend framework builds each site variant. */\nconst FRAMEWORKS: Record<string, Framework> = {\n\tstatic: 'vite',\n\tnext: 'nextjs',\n\ttanstack: 'tanstack-start',\n};\n\n/**\n * The app key a construct id becomes.\n *\n * The same kebab form every physical name is built from, so `Api` is `api` in\n * the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an\n * environment — one id, three renderings, no second list.\n */\nexport function appKey(id: string): string {\n\treturn kebabCase(id);\n}\n\n/**\n * The app serving a surface: its own, always.\n *\n * Every surface gets a container. There is no arrangement in which one runs\n * inside another — two surfaces in a process share a filesystem, an\n * environment, and every credential either was granted, so an auth server\n * beside an API is one bug in the API away from being read by it.\n */\nexport function hostOf(\n\tmanifest: ConstructManifest,\n\tid: string,\n): string | undefined {\n\tconst declaration = manifest[id];\n\tif (!declaration || declaration.kind !== 'rest-api') return undefined;\n\n\treturn id;\n}\n\n/**\n * Local ports, assigned so that adding a site does not renumber the others.\n *\n * Backends first, then the site holding the base domain, then the rest\n * alphabetically. The ordering is arbitrary but it is *fixed*, which is the\n * property that matters: a port that moves when an unrelated app is added is a\n * port nobody can put in a bookmark. A construct that names its own port keeps\n * it, and is skipped here.\n */\nfunction assignPorts(apps: Record<string, NormalizedAppConfig>): void {\n\tconst rank = (\n\t\tname: string,\n\t\tapp: NormalizedAppConfig,\n\t): [number, number, string] => [\n\t\tapp.type === 'backend' ? 0 : app.type === 'web' ? 1 : 2,\n\t\tapp.root ? 0 : 1,\n\t\tname,\n\t];\n\n\tconst ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {\n\t\tconst [at, ar, an] = rank(aName, a);\n\t\tconst [bt, br, bn] = rank(bName, b);\n\t\treturn at - bt || ar - br || an.localeCompare(bn);\n\t});\n\n\tconst taken = new Set(\n\t\tordered.map(([, app]) => app.port).filter((p): p is number => !!p),\n\t);\n\n\tlet next = 3000;\n\tfor (const [, app] of ordered) {\n\t\tif (app.port) continue;\n\t\twhile (taken.has(next)) next += 1;\n\t\tapp.port = next;\n\t\ttaken.add(next);\n\t}\n}\n\n/**\n * Whichever site holds the base domain.\n *\n * The convention first — a site named `web` — because it is one people already\n * rely on. Then an explicit `root: true`. A project with one site needs neither.\n */\nfunction markRoot(apps: Record<string, NormalizedAppConfig>): void {\n\tconst sites = Object.entries(apps).filter(([, a]) => a.type === 'web');\n\tif (sites.length === 0) return;\n\tif (sites.some(([, a]) => a.root)) return;\n\n\tconst chosen =\n\t\tsites.find(([name]) => name === 'web') ??\n\t\t(sites.length === 1 ? sites[0] : undefined);\n\tif (chosen) chosen[1].root = true;\n}\n\n/**\n * What `app: true` means, and what the object form leaves out.\n *\n * Both fields follow from the construct's own id, so neither was worth making\n * someone write down:\n *\n * - `path` is `apps/<kebab-id>` where that directory exists, and the workspace\n * root otherwise. `Api` means `apps/api` in a monorepo and `.` in a\n * single-app project, and which of the two you are in is answerable by\n * looking.\n * - `code` is the conventional directories under `path`. A glob is worth\n * writing only when the code is somewhere else, which is the case the field\n * still exists for.\n *\n * A site takes no `code`: its build is its framework's, not ours.\n */\n/**\n * Where an app lives when it did not say.\n *\n * `apps/<kebab-id>`, which is what the id already said — or the project root\n * when there is no `apps/` at all, because then there is one app and it is the\n * project.\n *\n * In between, it refuses. A workspace *with* an `apps/` directory and no\n * `apps/<key>` in it is a construct naming a directory nobody wrote, and\n * quietly answering `.` there makes the app the whole repository: the build\n * filters turbo on the root `package.json` and builds the wrong thing, or\n * itself. A missing directory is a typo or an unconventional layout, and both\n * want saying out loud.\n */\nfunction conventionalPath(id: string, workspaceRoot: string): string {\n\tconst conventional = join('apps', appKey(id));\n\tif (existsSync(join(workspaceRoot, conventional))) return conventional;\n\n\t// No `apps/` at all: one app, and it is the project.\n\tif (!existsSync(join(workspaceRoot, 'apps'))) return '.';\n\n\tthrow new MisplacedApp(id, conventional);\n}\n\n/** A construct whose directory is not where its id says it is. */\nexport class MisplacedApp extends Error {\n\tconstructor(\n\t\treadonly construct: string,\n\t\treadonly expected: string,\n\t) {\n\t\tsuper(\n\t\t\t`\"${construct}\" has no directory at ${expected}.\\n` +\n\t\t\t\t`Create it, or say where it lives:\\n` +\n\t\t\t\t` new StaticSite('${construct}', { path: 'sites/${appKey(construct)}' })\\n` +\n\t\t\t\t` new RestApi('${construct}', { …, app: { path: 'services/${appKey(construct)}' } })`,\n\t\t);\n\t\tthis.name = 'MisplacedApp';\n\t}\n}\n\nexport function resolveAppSpec(\n\tid: string,\n\tspec: AppSpec,\n\tworkspaceRoot: string,\n\tkind: 'site' | 'rest-api',\n): AppSpec {\n\tconst path = spec.path ?? conventionalPath(id, workspaceRoot);\n\n\tconst givenAGlob =\n\t\tspec.code !== undefined ||\n\t\tspec.routes !== undefined ||\n\t\tspec.functions !== undefined ||\n\t\tspec.crons !== undefined ||\n\t\tspec.queues !== undefined ||\n\t\tspec.topics !== undefined ||\n\t\tspec.subscribers !== undefined;\n\n\treturn {\n\t\t...spec,\n\t\tpath,\n\t\t...(kind === 'rest-api' && !givenAGlob ? { code: DEFAULT_APP_CODE } : {}),\n\t};\n}\n\nexport function derivedApps(\n\tmanifest: ConstructManifest,\n\tworkspace: NormalizedWorkspace,\n): Record<string, NormalizedAppConfig> {\n\tconst apps: Record<string, NormalizedAppConfig> = {};\n\tconst defaultTarget: DeployTarget = workspace.deploy?.default ?? 'dokploy';\n\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\tif (declaration.kind !== 'site' && declaration.kind !== 'rest-api')\n\t\t\tcontinue;\n\n\t\t// No opt-in to be had. A site is an app and so is a surface; `app` is an\n\t\t// override for a layout that differs, and having none is the ordinary\n\t\t// case rather than a surface with nowhere to run.\n\t\tconst spec = resolveAppSpec(\n\t\t\tid,\n\t\t\tdeclaration.app ?? {},\n\t\t\tworkspace.root,\n\t\t\tdeclaration.kind,\n\t\t);\n\n\t\tconst name = appKey(id);\n\t\t// A config entry of the same name still wins, so a workspace can override\n\t\t// one field without restating the app. Nothing in this repo needs to.\n\t\tconst configured = workspace.apps[name];\n\n\t\tapps[name] = {\n\t\t\t...configured,\n\t\t\ttype: declaration.kind === 'site' ? 'web' : 'backend',\n\t\t\tpath: spec.path,\n\t\t\tport: spec.port ?? configured?.port ?? 0,\n\t\t\tdependencies: [],\n\t\t\tresolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,\n\t\t\t...(declaration.kind === 'site'\n\t\t\t\t? {\n\t\t\t\t\t\tframework: configured?.framework ?? FRAMEWORKS[declaration.variant],\n\t\t\t\t\t\t...(declaration.root ? { root: true } : {}),\n\t\t\t\t\t\t...(spec.config ? { config: spec.config } : {}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t// One glob fans out to the six the build reads, because each generator\n\t\t\t// already inspects every export and keeps what it recognises. A\n\t\t\t// per-kind field still wins where one was given.\n\t\t\t...(spec.code !== undefined\n\t\t\t\t? {\n\t\t\t\t\t\troutes: spec.code,\n\t\t\t\t\t\tfunctions: spec.code,\n\t\t\t\t\t\tcrons: spec.code,\n\t\t\t\t\t\tqueues: spec.code,\n\t\t\t\t\t\ttopics: spec.code,\n\t\t\t\t\t\tsubscribers: spec.code,\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t...(spec.routes !== undefined ? { routes: spec.routes } : {}),\n\t\t\t...(spec.functions !== undefined ? { functions: spec.functions } : {}),\n\t\t\t...(spec.crons !== undefined ? { crons: spec.crons } : {}),\n\t\t\t...(spec.queues !== undefined ? { queues: spec.queues } : {}),\n\t\t\t...(spec.topics !== undefined ? { topics: spec.topics } : {}),\n\t\t\t...(spec.subscribers !== undefined\n\t\t\t\t? { subscribers: spec.subscribers }\n\t\t\t\t: {}),\n\t\t\t...(spec.envParser !== undefined ? { envParser: spec.envParser } : {}),\n\t\t\t...(spec.logger !== undefined ? { logger: spec.logger } : {}),\n\t\t\t...(spec.telescope !== undefined ? { telescope: spec.telescope } : {}),\n\t\t\t...(spec.studio !== undefined ? { studio: spec.studio } : {}),\n\t\t\t...(spec.openapi !== undefined ? { openapi: spec.openapi } : {}),\n\t\t\t...(spec.runtime !== undefined ? { runtime: spec.runtime } : {}),\n\t\t\t...(spec.env !== undefined ? { env: spec.env } : {}),\n\t\t\t...(spec.entry !== undefined ? { entry: spec.entry } : {}),\n\t\t\t...(configured?.domain\n\t\t\t\t? { domain: configured.domain as AppDomainConfig }\n\t\t\t\t: {}),\n\t\t} as NormalizedAppConfig;\n\t}\n\n\t// Build order, from the edges rather than from a hand-kept list. A site that\n\t// depends on a surface depends on the app that serves it — which for a\n\t// mounted auth server is its host, not a container that does not exist.\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\tif (declaration.kind !== 'site' && declaration.kind !== 'rest-api')\n\t\t\tcontinue;\n\n\t\tconst app = apps[appKey(id)];\n\t\tif (!app) continue;\n\n\t\tconst edges =\n\t\t\tdeclaration.kind === 'site'\n\t\t\t\t? declaration.dependencies\n\t\t\t\t: (declaration.calls ?? []);\n\n\t\tconst names = new Set<string>();\n\t\tfor (const edge of edges) {\n\t\t\tif (edge.kind !== 'rest-api') continue;\n\t\t\tconst host = hostOf(manifest, edge.target);\n\t\t\tif (!host) continue;\n\t\t\tconst key = appKey(host);\n\t\t\tif (key !== appKey(id) && apps[key]) names.add(key);\n\t\t}\n\n\t\tapp.dependencies = [...names].sort();\n\t}\n\n\tmarkRoot(apps);\n\tassignPorts(apps);\n\n\t// Apps config declared that the graph knows nothing about — a `type: 'mobile'`\n\t// entry, or a hand-run process. Kept rather than dropped: config is still the\n\t// escape hatch for what nothing declares.\n\tfor (const [name, app] of Object.entries(workspace.apps)) {\n\t\tif (!apps[name]) apps[name] = app;\n\t}\n\n\treturn apps;\n}\n","import { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join, parse } from 'node:path';\nimport { discover } from './reconcile/discover.js';\nimport type { GkmConfig } from './types.js';\nimport { derivedApps } from './workspace/derive.js';\nimport {\n\tallConstructGlobs,\n\tgetAppGkmConfig,\n\tisWorkspaceConfig,\n\ttype LoadedConfig,\n\ttype NormalizedAppConfig,\n\ttype NormalizedWorkspace,\n\tprocessConfig,\n\ttype WorkspaceConfig,\n} from './workspace/index.js';\n\nexport type { GkmConfig } from './types.js';\nexport type { LoadedConfig, WorkspaceConfig } from './workspace/index.js';\nexport { defineWorkspace } from './workspace/index.js';\n/**\n * Define GKM configuration with full TypeScript support.\n * This is an identity function that provides type safety and autocomplete.\n *\n * @example\n * ```ts\n * // gkm.config.ts\n * import { defineConfig } from '@geekmidas/cli/config';\n *\n * export default defineConfig({\n * routes: './src/endpoints/**\\/*.ts',\n * envParser: './src/config/env',\n * logger: './src/config/logger',\n * telescope: true,\n * });\n * ```\n */\nexport function defineConfig(config: GkmConfig): GkmConfig {\n\treturn config;\n}\n\nexport interface ParsedModuleConfig {\n\tpath: string;\n\timportPattern: string;\n}\n\n/**\n * Parse a module config string into path and import pattern.\n *\n * @param configString - Config string in format \"./path/to/module\" or \"./path/to/module#exportName\"\n * @param defaultAlias - The default alias name to use if no export name specified\n * @returns Object with path and import pattern\n *\n * @example\n * parseModuleConfig('./src/config/env', 'envParser')\n * // { path: './src/config/env', importPattern: 'envParser' }\n *\n * parseModuleConfig('./src/config/env#envParser', 'envParser')\n * // { path: './src/config/env', importPattern: '{ envParser }' }\n *\n * parseModuleConfig('./src/config/env#myEnv', 'envParser')\n * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }\n */\nexport function parseModuleConfig(\n\tconfigString: string,\n\tdefaultAlias: string,\n): ParsedModuleConfig {\n\tconst parts = configString.split('#');\n\tconst path = parts[0] ?? configString;\n\tconst exportName = parts[1];\n\tconst importPattern = !exportName\n\t\t? defaultAlias\n\t\t: exportName === defaultAlias\n\t\t\t? `{ ${defaultAlias} }`\n\t\t\t: `{ ${exportName} as ${defaultAlias} }`;\n\n\treturn { path, importPattern };\n}\n\nexport interface ConfigDiscoveryResult {\n\tconfigPath: string;\n\tworkspaceRoot: string;\n}\n\n/**\n * Find and return the path to the config file.\n *\n * Resolution order:\n * 1. GKM_CONFIG_PATH env var (set by workspace dev command)\n * 2. Walk up directory tree from cwd\n */\nfunction findConfigPath(cwd: string): ConfigDiscoveryResult {\n\tconst files = ['gkm.config.json', 'gkm.config.ts', 'gkm.config.js'];\n\n\t// Check GKM_CONFIG_PATH env var first (set by workspace dev command)\n\tconst envConfigPath = process.env.GKM_CONFIG_PATH;\n\tif (envConfigPath && existsSync(envConfigPath)) {\n\t\treturn {\n\t\t\tconfigPath: envConfigPath,\n\t\t\tworkspaceRoot: dirname(envConfigPath),\n\t\t};\n\t}\n\n\t// Walk up directory tree to find config\n\tlet currentDir = cwd;\n\tconst { root } = parse(currentDir);\n\n\twhile (currentDir !== root) {\n\t\tfor (const file of files) {\n\t\t\tconst configPath = join(currentDir, file);\n\t\t\tif (existsSync(configPath)) {\n\t\t\t\treturn {\n\t\t\t\t\tconfigPath,\n\t\t\t\t\tworkspaceRoot: currentDir,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tcurrentDir = dirname(currentDir);\n\t}\n\n\tthrow new Error(\n\t\t'Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.',\n\t);\n}\n\n/**\n * Get app name from package.json in the given directory.\n * Handles scoped packages by extracting the name after the scope.\n *\n * @example\n * getAppNameFromCwd('/path/to/apps/api')\n * // package.json: { \"name\": \"@myorg/api\" }\n * // Returns: 'api'\n */\nexport function getAppNameFromCwd(cwd: string = process.cwd()): string | null {\n\tconst packageJsonPath = join(cwd, 'package.json');\n\n\tif (!existsSync(packageJsonPath)) {\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n\t\tconst name = packageJson.name as string | undefined;\n\n\t\tif (!name) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Handle scoped packages: @scope/name -> name\n\t\tif (name.startsWith('@') && name.includes('/')) {\n\t\t\treturn name.split('/')[1] ?? null;\n\t\t}\n\n\t\treturn name;\n\t} catch {\n\t\treturn null;\n\t}\n}\n\ninterface RawConfigResult {\n\tconfig: GkmConfig | WorkspaceConfig;\n\tworkspaceRoot: string;\n}\n\n/**\n * Load raw configuration from file.\n */\nasync function loadRawConfig(cwd: string): Promise<RawConfigResult> {\n\tconst { configPath, workspaceRoot } = findConfigPath(cwd);\n\n\ttry {\n\t\tconst config = await import(configPath);\n\t\treturn {\n\t\t\tconfig: config.default,\n\t\t\tworkspaceRoot,\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(`Failed to load config: ${(error as Error).message}`);\n\t}\n}\n\n/**\n * Load configuration file (single-app format).\n * For backwards compatibility with existing code.\n *\n * @deprecated Use loadWorkspaceConfig for new code\n */\nexport async function loadConfig(\n\tcwd: string = process.cwd(),\n): Promise<GkmConfig> {\n\tconst { config } = await loadRawConfig(cwd);\n\n\t// If it's a workspace config, throw an error\n\tif (isWorkspaceConfig(config)) {\n\t\tthrow new Error(\n\t\t\t'Workspace configuration detected. Use loadWorkspaceConfig() instead.',\n\t\t);\n\t}\n\n\treturn config;\n}\n\n/**\n * Load configuration file and process it as a workspace.\n * Works with both single-app and workspace configurations.\n *\n * Single-app configs are automatically wrapped as a workspace with one app.\n *\n * @example\n * ```ts\n * const { type, workspace } = await loadWorkspaceConfig();\n *\n * if (type === 'workspace') {\n * console.log('Multi-app workspace:', workspace.apps);\n * } else {\n * console.log('Single app wrapped as workspace');\n * }\n * ```\n */\nexport async function loadWorkspaceConfig(\n\tcwd: string = process.cwd(),\n): Promise<LoadedConfig> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\treturn withDerivedApps(processConfig(config, workspaceRoot));\n}\n\n/**\n * The loaded config, with its apps read off the graph.\n *\n * Here rather than at each call site because every command needs the same\n * answer, and the ones that forgot to ask were exactly the bugs: a site that\n * never deployed, a surface that could not be its own process. `gkm dev`,\n * `gkm build`, `gkm docker` and `gkm deploy` now all see the same apps without\n * any of them knowing a derivation happened.\n *\n * Discovery imports the construct modules — declarations only, not endpoints —\n * which is the same import the reconciler and the build already do. A workspace\n * with no `constructs` glob discovers nothing and keeps whatever its config\n * said, so nothing that worked before changes.\n *\n * A construct file that throws is reported and skipped rather than taking the\n * command down: `gkm dev` failing to start because a half-written declaration\n * cannot be imported is a worse failure than starting with the app it does not\n * describe yet.\n */\nasync function withDerivedApps(loaded: LoadedConfig): Promise<LoadedConfig> {\n\tconst globs = allConstructGlobs(loaded.workspace);\n\tif (globs.length === 0) return loaded;\n\n\ttry {\n\t\tconst manifest = await discover({\n\t\t\tpatterns: globs,\n\t\t\tcwd: loaded.workspace.root,\n\t\t});\n\n\t\treturn {\n\t\t\t...loaded,\n\t\t\tmanifest,\n\t\t\tworkspace: {\n\t\t\t\t...loaded.workspace,\n\t\t\t\tapps: derivedApps(manifest, loaded.workspace),\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(\n\t\t\t`⚠️ Could not read constructs, so apps come from config alone: ${message}`,\n\t\t);\n\t\treturn loaded;\n\t}\n}\n\nexport interface AppConfigResult {\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tgkmConfig: GkmConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n\tappRoot: string;\n}\n\n/**\n * The app a package directory refers to, and what the workspace calls it.\n *\n * A single-app config is wrapped as a one-app workspace keyed `api`, which is\n * almost never the package name. Matching on the key alone means an app like\n * `@geekmidas/example` resolves to nothing and silently loses everything that\n * comes from the workspace — including the URLs its constructs declare.\n */\nfunction resolveWorkspaceApp(\n\tloadedConfig: LoadedConfig,\n\tappName: string,\n): { key: string; app: NormalizedAppConfig } | undefined {\n\tconst apps = loadedConfig.workspace.apps;\n\n\tconst named = apps[appName];\n\tif (named) return { key: appName, app: named };\n\n\tconst names = Object.keys(apps);\n\tconst only = names[0];\n\tif (loadedConfig.type !== 'single' || names.length !== 1 || !only) {\n\t\treturn undefined;\n\t}\n\n\tconst app = apps[only];\n\n\treturn app ? { key: only, app } : undefined;\n}\n\n/**\n * Load app-specific configuration from workspace.\n * Uses the app name from package.json to find the correct app config.\n *\n * @example\n * ```ts\n * // From apps/api directory with package.json: { \"name\": \"@myorg/api\" }\n * const { app, workspace, workspaceRoot } = await loadAppConfig();\n * console.log(app.routes); // './src/endpoints/**\\/*.ts'\n * ```\n */\nexport async function loadAppConfig(\n\tcwd: string = process.cwd(),\n): Promise<AppConfigResult> {\n\tconst appName = getAppNameFromCwd(cwd);\n\n\tif (!appName) {\n\t\tthrow new Error(\n\t\t\t'Could not determine app name. Ensure package.json exists with a \"name\" field.',\n\t\t);\n\t}\n\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\tconst loadedConfig = await withDerivedApps(\n\t\tprocessConfig(config, workspaceRoot),\n\t);\n\n\tconst resolved = resolveWorkspaceApp(loadedConfig, appName);\n\n\tif (!resolved) {\n\t\tthrow new Error(\n\t\t\t`App \"${appName}\" not found in workspace config. Available apps: ${Object.keys(\n\t\t\t\tloadedConfig.workspace.apps,\n\t\t\t).join(', ')}. ` +\n\t\t\t\t`Ensure the package.json name matches the app key in gkm.config.ts.`,\n\t\t);\n\t}\n\n\tconst { key, app } = resolved;\n\n\t// Keyed by what the workspace calls the app, not by the package name — for a\n\t// single-app config those differ.\n\tconst gkmConfig = getAppGkmConfig(loadedConfig.workspace, key);\n\n\tif (!gkmConfig) {\n\t\tthrow new Error(\n\t\t\t`App \"${appName}\" is not a backend app and cannot be run with gkm dev.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tappName,\n\t\tapp,\n\t\tgkmConfig,\n\t\tworkspace: loadedConfig.workspace,\n\t\tworkspaceRoot,\n\t\tappRoot: join(workspaceRoot, app.path),\n\t};\n}\n\nexport interface WorkspaceAppInfo {\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n}\n\n/**\n * Load workspace info for any app (frontend or backend).\n * Unlike loadAppConfig, this does NOT require the app to have a gkm config\n * (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.\n */\nexport async function loadWorkspaceAppInfo(\n\tcwd: string = process.cwd(),\n): Promise<WorkspaceAppInfo> {\n\tconst appName = getAppNameFromCwd(cwd);\n\n\tif (!appName) {\n\t\tthrow new Error(\n\t\t\t'Could not determine app name. Ensure package.json exists with a \"name\" field.',\n\t\t);\n\t}\n\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\tconst loadedConfig = await withDerivedApps(\n\t\tprocessConfig(config, workspaceRoot),\n\t);\n\n\tconst resolved = resolveWorkspaceApp(loadedConfig, appName);\n\n\tif (!resolved) {\n\t\tconst availableApps = Object.keys(loadedConfig.workspace.apps).join(', ');\n\t\tthrow new Error(\n\t\t\t`App \"${appName}\" not found in workspace config. Available apps: ${availableApps}. ` +\n\t\t\t\t`Ensure the package.json name matches the app key in gkm.config.ts.`,\n\t\t);\n\t}\n\n\treturn {\n\t\tappName,\n\t\tapp: resolved.app,\n\t\tworkspace: loadedConfig.workspace,\n\t\tworkspaceRoot,\n\t};\n}\n"],"mappings":";;;;;;;;;AAqCA,MAAMA,aAAwC;CAC7C,QAAQ;CACR,MAAM;CACN,UAAU;AACV;;;;;;;;AASD,SAAgB,OAAOC,IAAoB;AAC1C,QAAO,oCAAU,GAAG;AACpB;;;;;;;;;AAUD,SAAgB,OACfC,UACAD,IACqB;CACrB,MAAM,cAAc,SAAS;AAC7B,MAAK,eAAe,YAAY,SAAS,WAAY;AAErD,QAAO;AACP;;;;;;;;;;AAWD,SAAS,YAAYE,MAAiD;CACrE,MAAM,OAAO,CACZC,MACAC,QAC8B;EAC9B,IAAI,SAAS,YAAY,IAAI,IAAI,SAAS,QAAQ,IAAI;EACtD,IAAI,OAAO,IAAI;EACf;CACA;CAED,MAAM,UAAU,OAAO,QAAQ,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK;EACrE,MAAM,CAAC,IAAI,IAAI,GAAG,GAAG,KAAK,OAAO,EAAE;EACnC,MAAM,CAAC,IAAI,IAAI,GAAG,GAAG,KAAK,OAAO,EAAE;AACnC,SAAO,KAAK,MAAM,KAAK,MAAM,GAAG,cAAc,GAAG;CACjD,EAAC;CAEF,MAAM,QAAQ,IAAI,IACjB,QAAQ,IAAI,CAAC,GAAG,IAAI,KAAK,IAAI,K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AAoB,cAAc,QAAQ;AAE3D,MAAK,UAAU;EACd,MAAM,gBAAgB,OAAO,KAAK,aAAa,UAAU,KAAK,CAAC,KAAK,KAAK;AACzE,QAAM,IAAI,OACR,OAAO,QAAQ,mDAAmD,cAAc;CAGlF;AAED,QAAO;EACN;EACA,KAAK,SAAS;EACd,WAAW,aAAa;EACxB;CACA;AACD"}
package/dist/config.cjs CHANGED
@@ -1,5 +1,6 @@
1
- const require_workspace = require('./workspace-CQTT7HJQ.cjs');
2
- const require_config = require('./config-DujV8DbR.cjs');
1
+ require('./discover-DTmFeloL.cjs');
2
+ const require_config = require('./config-DbPE1KXF.cjs');
3
+ const require_workspace = require('./workspace-XvqO9jIv.cjs');
3
4
 
4
5
  exports.defineConfig = require_config.defineConfig;
5
6
  exports.defineWorkspace = require_workspace.defineWorkspace;
package/dist/config.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { GkmConfig } from "./types-BWQDiooe.cjs";
2
- import { LoadedConfig, NormalizedAppConfig, NormalizedWorkspace, WorkspaceConfig, defineWorkspace } from "./index-DTpkeFb8.cjs";
1
+ import { GkmConfig, LoadedConfig, NormalizedAppConfig, NormalizedWorkspace, WorkspaceConfig } from "./types-abJQuk7m.cjs";
2
+ import { defineWorkspace } from "./index-CHB4tSzX.cjs";
3
3
 
4
4
  //#region src/config.d.ts
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAiC0D;AAI1D;AAsBA;AAgBA;AAuDA;AAsDA;;;;AAEU;AA8BV;;;;AAEU,iBAzLM,YAAA,CAyLN,MAAA,EAzL2B,SAyL3B,CAAA,EAzLuC,SAyLvC;AAKO,UA1LA,kBAAA,CA0Le;EAAA,IAAA,EAAA,MAAA;EAAA,aAE1B,EAAA,MAAA;;;AAEyB;AAgB/B;;;;AAEU;AA0CV;;;;AAG+B;AAS/B;;;;AAEU;iBAlPM,iBAAA,8CAGb;UAac,qBAAA;;;;;;;;;;;;;iBAuDD,iBAAA;;;;;;;iBAsDM,UAAA,gBAEnB,QAAQ;;;;;;;;;;;;;;;;;;iBA8BW,mBAAA,gBAEnB,QAAQ;UAKM,eAAA;;OAEX;aACM;aACA;;;;;;;;;;;;;;;iBAgBU,aAAA,gBAEnB,QAAQ;UA0CM,gBAAA;;OAEX;aACM;;;;;;;;iBASU,oBAAA,gBAEnB,QAAQ"}
1
+ {"version":3,"file":"config.d.cts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoC0D;AAI1D;AAsBA;AAgBA;AAuDA;AAsDA;;;;AAEU;AA8BV;;;;AAEU,iBAzLM,YAAA,CAyLN,MAAA,EAzL2B,SAyL3B,CAAA,EAzLuC,SAyLvC;AAmDO,UAxOA,kBAAA,CAwOe;EAAA,IAAA,EAAA,MAAA;EAAA,aAE1B,EAAA,MAAA;;;AAEyB;AA4C/B;;;;AAEU;AA+CV;;;;AAG+B;AAS/B;;;;AAEU;iBAjUM,iBAAA,8CAGb;UAac,qBAAA;;;;;;;;;;;;;iBAuDD,iBAAA;;;;;;;iBAsDM,UAAA,gBAEnB,QAAQ;;;;;;;;;;;;;;;;;;iBA8BW,mBAAA,gBAEnB,QAAQ;UAmDM,eAAA;;OAEX;aACM;aACA;;;;;;;;;;;;;;;iBA4CU,aAAA,gBAEnB,QAAQ;UA+CM,gBAAA;;OAEX;aACM;;;;;;;;iBASU,oBAAA,gBAEnB,QAAQ"}
package/dist/config.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { GkmConfig } from "./types-B3GQUg3k.mjs";
2
- import { LoadedConfig, NormalizedAppConfig, NormalizedWorkspace, WorkspaceConfig, defineWorkspace } from "./index-Bw548Bta.mjs";
1
+ import { GkmConfig, LoadedConfig, NormalizedAppConfig, NormalizedWorkspace, WorkspaceConfig } from "./types-C-arnQ1r.mjs";
2
+ import { defineWorkspace } from "./index-BThUzEIp.mjs";
3
3
 
4
4
  //#region src/config.d.ts
5
5
 
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAiC0D;AAI1D;AAsBA;AAgBA;AAuDA;AAsDA;;;;AAEU;AA8BV;;;;AAEU,iBAzLM,YAAA,CAyLN,MAAA,EAzL2B,SAyL3B,CAAA,EAzLuC,SAyLvC;AAKO,UA1LA,kBAAA,CA0Le;EAAA,IAAA,EAAA,MAAA;EAAA,aAE1B,EAAA,MAAA;;;AAEyB;AAgB/B;;;;AAEU;AA0CV;;;;AAG+B;AAS/B;;;;AAEU;iBAlPM,iBAAA,8CAGb;UAac,qBAAA;;;;;;;;;;;;;iBAuDD,iBAAA;;;;;;;iBAsDM,UAAA,gBAEnB,QAAQ;;;;;;;;;;;;;;;;;;iBA8BW,mBAAA,gBAEnB,QAAQ;UAKM,eAAA;;OAEX;aACM;aACA;;;;;;;;;;;;;;;iBAgBU,aAAA,gBAEnB,QAAQ;UA0CM,gBAAA;;OAEX;aACM;;;;;;;;iBASU,oBAAA,gBAEnB,QAAQ"}
1
+ {"version":3,"file":"config.d.mts","names":[],"sources":["../src/config.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoC0D;AAI1D;AAsBA;AAgBA;AAuDA;AAsDA;;;;AAEU;AA8BV;;;;AAEU,iBAzLM,YAAA,CAyLN,MAAA,EAzL2B,SAyL3B,CAAA,EAzLuC,SAyLvC;AAmDO,UAxOA,kBAAA,CAwOe;EAAA,IAAA,EAAA,MAAA;EAAA,aAE1B,EAAA,MAAA;;;AAEyB;AA4C/B;;;;AAEU;AA+CV;;;;AAG+B;AAS/B;;;;AAEU;iBAjUM,iBAAA,8CAGb;UAac,qBAAA;;;;;;;;;;;;;iBAuDD,iBAAA;;;;;;;iBAsDM,UAAA,gBAEnB,QAAQ;;;;;;;;;;;;;;;;;;iBA8BW,mBAAA,gBAEnB,QAAQ;UAmDM,eAAA;;OAEX;aACM;aACA;;;;;;;;;;;;;;;iBA4CU,aAAA,gBAEnB,QAAQ;UA+CM,gBAAA;;OAEX;aACM;;;;;;;;iBASU,oBAAA,gBAEnB,QAAQ"}
package/dist/config.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { defineWorkspace } from "./workspace-D-37Ylqo.mjs";
2
- import { defineConfig, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig } from "./config-Bbu1JKvf.mjs";
1
+ import "./discover-CAlFgYec.mjs";
2
+ import { defineConfig, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig } from "./config-D8o6I_7Z.mjs";
3
+ import { defineWorkspace } from "./workspace-7FqprxuJ.mjs";
3
4
 
4
5
  export { defineConfig, defineWorkspace, getAppNameFromCwd, loadAppConfig, loadConfig, loadWorkspaceAppInfo, loadWorkspaceConfig, parseModuleConfig };