@geekmidas/cli 2.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 -623
  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
@@ -1,943 +0,0 @@
1
- import type { AwsRegion, StateConfig } from '../deploy/StateProvider.js';
2
-
3
- export type { AwsRegion };
4
-
5
- import type {
6
- GkmConfig,
7
- HooksConfig,
8
- OpenApiConfig,
9
- ProvidersConfig,
10
- Routes,
11
- Runtime,
12
- StudioConfig,
13
- TelescopeConfig,
14
- } from '../types.js';
15
- import type {
16
- BackendFramework,
17
- BackupsConfig,
18
- DnsConfig,
19
- DnsProvider,
20
- Framework,
21
- FrontendFramework,
22
- MobileFramework,
23
- } from './schema.js';
24
-
25
- export type {
26
- BackendFramework,
27
- BackupsConfig,
28
- DnsConfig,
29
- DnsProvider,
30
- Framework,
31
- FrontendFramework,
32
- MobileFramework,
33
- };
34
-
35
- /**
36
- * Deploy target for an app.
37
- *
38
- * Specifies where the app will be deployed.
39
- *
40
- * @example
41
- * ```ts
42
- * // Currently supported
43
- * deploy: 'dokploy'
44
- *
45
- * // Future support (not yet implemented)
46
- * deploy: 'vercel'
47
- * deploy: 'cloudflare'
48
- * ```
49
- */
50
- export type DeployTarget = 'dokploy' | 'vercel' | 'cloudflare';
51
-
52
- /**
53
- * Service image configuration for custom Docker images.
54
- *
55
- * @example
56
- * ```ts
57
- * // Use specific version
58
- * db: { version: '18-alpine' }
59
- *
60
- * // Use custom image
61
- * db: { image: 'timescale/timescaledb:latest-pg16' }
62
- * ```
63
- */
64
- export interface ServiceImageConfig {
65
- /** Docker image version/tag (e.g., '18-alpine') */
66
- version?: string;
67
- /** Full Docker image reference (overrides version) */
68
- image?: string;
69
- }
70
-
71
- /**
72
- * Mail service configuration.
73
- *
74
- * In development, uses Mailpit for email testing.
75
- * In production, uses SMTP configuration.
76
- *
77
- * @example
78
- * ```ts
79
- * services: {
80
- * mail: {
81
- * smtp: {
82
- * host: 'smtp.sendgrid.net',
83
- * port: 587,
84
- * user: 'apikey',
85
- * pass: process.env.SENDGRID_API_KEY,
86
- * }
87
- * }
88
- * }
89
- * ```
90
- */
91
- export interface MailServiceConfig extends ServiceImageConfig {
92
- /** SMTP configuration for production */
93
- smtp?: {
94
- host: string;
95
- port: number;
96
- user?: string;
97
- pass?: string;
98
- };
99
- }
100
-
101
- /**
102
- * Development services configuration.
103
- *
104
- * Configures shared infrastructure services like databases and caches.
105
- * These are automatically provisioned in Dokploy during deployment.
106
- *
107
- * @example
108
- * ```ts
109
- * // Enable with defaults
110
- * services: {
111
- * db: true, // postgres:18-alpine
112
- * cache: true, // redis:8-alpine
113
- * }
114
- *
115
- * // Custom versions
116
- * services: {
117
- * db: { version: '18-alpine' },
118
- * cache: { version: '7-alpine' },
119
- * }
120
- *
121
- * // Custom images
122
- * services: {
123
- * db: { image: 'timescale/timescaledb:latest-pg16' },
124
- * }
125
- *
126
- * // With mail service
127
- * services: {
128
- * db: true,
129
- * cache: true,
130
- * mail: true, // Mailpit in dev
131
- * }
132
- *
133
- * // With event backend
134
- * services: {
135
- * db: true,
136
- * cache: true,
137
- * events: 'pgboss', // reuses postgres (auto-enables db)
138
- * // events: 'sns', // adds LocalStack container
139
- * // events: 'rabbitmq', // adds RabbitMQ container
140
- * }
141
- * ```
142
- */
143
- export interface ServicesConfig {
144
- /** PostgreSQL database (default: postgres:18-alpine) */
145
- db?: boolean | ServiceImageConfig;
146
- /** Redis cache (default: redis:8-alpine) */
147
- cache?: boolean | ServiceImageConfig;
148
- /** Mail service (mailpit for dev) */
149
- mail?: boolean | MailServiceConfig;
150
- /** MinIO S3-compatible object storage (default: minio/minio:latest) */
151
- storage?: boolean | ServiceImageConfig;
152
- /** Event backend: pgboss (reuses postgres), sns (LocalStack), or rabbitmq */
153
- events?: import('../types.js').EventsBackend;
154
- }
155
-
156
- /**
157
- * Stage-based domain configuration.
158
- *
159
- * Maps deployment stages to base domains. The main frontend app
160
- * gets the base domain, other apps get `{appName}.{baseDomain}`.
161
- *
162
- * @example
163
- * ```ts
164
- * domains: {
165
- * development: 'dev.myapp.com',
166
- * staging: 'staging.myapp.com',
167
- * production: 'myapp.com',
168
- * }
169
- *
170
- * // Result for production stage:
171
- * // - web (main frontend): myapp.com
172
- * // - api: api.myapp.com
173
- * // - auth: auth.myapp.com
174
- * ```
175
- */
176
- export type DokployDomainsConfig = Record<string, string>;
177
-
178
- /**
179
- * Per-app domain override configuration.
180
- *
181
- * Can be a single domain string (used for all stages) or
182
- * stage-specific domains.
183
- *
184
- * @example
185
- * ```ts
186
- * // Single domain for all stages
187
- * domain: 'api.custom.com'
188
- *
189
- * // Stage-specific domains
190
- * domain: {
191
- * development: 'api.dev.custom.com',
192
- * staging: 'api.staging.custom.com',
193
- * production: 'api.custom.com',
194
- * }
195
- * ```
196
- */
197
- export type AppDomainConfig = string | Record<string, string>;
198
-
199
- /**
200
- * Dokploy workspace deployment configuration.
201
- *
202
- * Configures how the workspace is deployed to a Dokploy server.
203
- * One workspace maps to one Dokploy project with stage-based environments.
204
- * Project IDs are stored in deploy state (not config) and created on first deploy.
205
- *
206
- * @example Single endpoint for all stages:
207
- * ```ts
208
- * deploy: {
209
- * default: 'dokploy',
210
- * dokploy: {
211
- * endpoint: 'https://dokploy.myserver.com',
212
- * registry: 'ghcr.io/myorg',
213
- * },
214
- * }
215
- * ```
216
- *
217
- * @example Per-stage endpoints (different Dokploy servers):
218
- * ```ts
219
- * deploy: {
220
- * default: 'dokploy',
221
- * dokploy: {
222
- * endpoints: {
223
- * development: 'https://dev-dokploy.myserver.com',
224
- * production: 'https://dokploy.myserver.com',
225
- * },
226
- * registry: 'ghcr.io/myorg',
227
- * },
228
- * }
229
- * ```
230
- */
231
- export interface DokployWorkspaceConfig {
232
- /** Dokploy API endpoint for all stages */
233
- endpoint?: string;
234
- /** Per-stage Dokploy API endpoints (overrides endpoint) */
235
- endpoints?: Record<string, string>;
236
- /** Container registry for Docker images (e.g., 'ghcr.io/myorg') */
237
- registry?: string;
238
- /** Registry ID in Dokploy (auto-configured) */
239
- registryId?: string;
240
- /**
241
- * Stage-based domain configuration.
242
- * The main frontend app gets the base domain.
243
- * Other apps get {appName}.{baseDomain} by default.
244
- */
245
- domains?: DokployDomainsConfig;
246
- }
247
-
248
- /**
249
- * DNS provider types for automatic DNS record creation.
250
- */
251
- export type DnsProviderType = 'hostinger' | 'route53' | 'cloudflare' | 'manual';
252
-
253
- /**
254
- * Deployment configuration for the workspace.
255
- *
256
- * @example
257
- * ```ts
258
- * // Minimal - just set default target
259
- * deploy: {
260
- * default: 'dokploy',
261
- * }
262
- *
263
- * // Full configuration with DNS and backups
264
- * deploy: {
265
- * default: 'dokploy',
266
- * dokploy: {
267
- * endpoint: 'https://dokploy.myserver.com',
268
- * projectId: 'proj_abc123',
269
- * registry: 'ghcr.io/myorg',
270
- * domains: {
271
- * production: 'myapp.com',
272
- * },
273
- * },
274
- * dns: {
275
- * provider: 'hostinger',
276
- * domain: 'myapp.com',
277
- * },
278
- * backups: {
279
- * type: 's3',
280
- * region: 'us-east-1',
281
- * },
282
- * }
283
- * ```
284
- */
285
- export interface DeployConfig {
286
- /** Default deploy target for all apps (default: 'dokploy') */
287
- default?: DeployTarget;
288
- /** Dokploy-specific configuration */
289
- dokploy?: DokployWorkspaceConfig;
290
- /** DNS configuration for automatic record creation */
291
- dns?: DnsConfig;
292
- /** Backup destination configuration for database services */
293
- backups?: BackupsConfig;
294
- }
295
-
296
- /**
297
- * Models package configuration for shared schemas.
298
- *
299
- * Configures a shared models package containing Zod schemas
300
- * that can be used across backend and frontend apps.
301
- *
302
- * @example
303
- * ```ts
304
- * shared: {
305
- * models: {
306
- * path: 'packages/models',
307
- * schema: 'zod',
308
- * },
309
- * }
310
- * ```
311
- */
312
- export interface ModelsConfig {
313
- /** Path to models package relative to workspace root (default: 'packages/models') */
314
- path?: string;
315
- /**
316
- * Schema library to use (default: 'zod').
317
- * Currently only 'zod' is supported.
318
- * Future: any StandardSchema-compatible library
319
- */
320
- schema?: 'zod';
321
- }
322
-
323
- /**
324
- * Shared packages configuration.
325
- *
326
- * Configures shared packages in the monorepo that are
327
- * used by multiple apps.
328
- *
329
- * @example
330
- * ```ts
331
- * shared: {
332
- * packages: ['packages/*', 'libs/*'],
333
- * models: {
334
- * path: 'packages/models',
335
- * schema: 'zod',
336
- * },
337
- * }
338
- * ```
339
- */
340
- export interface SharedConfig {
341
- /** Glob patterns for shared packages (default: ['packages/*']) */
342
- packages?: string[];
343
- /** Models package configuration */
344
- models?: ModelsConfig;
345
- }
346
-
347
- /**
348
- * Secrets encryption configuration.
349
- *
350
- * Configures how secrets are encrypted for deployment.
351
- * Secrets are stored encrypted in `.gkm/secrets/{stage}.json`
352
- * with keys stored separately in `~/.gkm/{project}/{stage}.key`.
353
- *
354
- * @example
355
- * ```ts
356
- * secrets: {
357
- * enabled: true,
358
- * algorithm: 'aes-256-gcm',
359
- * kdf: 'scrypt',
360
- * }
361
- * ```
362
- */
363
- export interface SecretsConfig {
364
- /** Enable encrypted secrets (default: true) */
365
- enabled?: boolean;
366
- /** Encryption algorithm (default: 'aes-256-gcm') */
367
- algorithm?: string;
368
- /** Key derivation function (default: 'scrypt') */
369
- kdf?: 'scrypt' | 'pbkdf2';
370
- }
371
-
372
- /**
373
- * Base app configuration properties (shared between input and normalized).
374
- *
375
- * @example
376
- * ```ts
377
- * // Backend app with gkm routes
378
- * api: {
379
- * type: 'backend',
380
- * path: 'apps/api',
381
- * port: 3000,
382
- * routes: './src/endpoints/**\/*.ts',
383
- * envParser: './src/config/env',
384
- * logger: './src/config/logger',
385
- * }
386
- *
387
- * // Backend app with entry point (e.g., Better Auth)
388
- * auth: {
389
- * type: 'backend',
390
- * path: 'apps/auth',
391
- * port: 3001,
392
- * entry: './src/index.ts',
393
- * framework: 'better-auth',
394
- * requiredEnv: ['DATABASE_URL', 'BETTER_AUTH_SECRET'],
395
- * }
396
- *
397
- * // Frontend app
398
- * web: {
399
- * type: 'web',
400
- * path: 'apps/web',
401
- * port: 3002,
402
- * framework: 'nextjs',
403
- * dependencies: ['api', 'auth'],
404
- * }
405
- * ```
406
- */
407
- interface AppConfigBase {
408
- /**
409
- * App type.
410
- * - 'backend': Server-side app (API, auth service, etc.)
411
- * - 'web': Client-side web app (Next.js, Vite, TanStack Start, etc.)
412
- * - 'mobile': Native mobile app (Expo). Built/deployed via its own
413
- * toolchain (e.g. EAS Build) — Docker/Dokploy steps are skipped.
414
- * @default 'backend'
415
- */
416
- type?: 'backend' | 'web' | 'mobile';
417
-
418
- /**
419
- * Path to the app relative to workspace root.
420
- * @example 'apps/api', 'apps/web', 'services/auth'
421
- */
422
- path: string;
423
-
424
- /**
425
- * Development server port.
426
- * Must be unique across all apps in the workspace.
427
- * @example 3000, 3001, 3002
428
- */
429
- port: number;
430
-
431
- /**
432
- * Per-app deploy target override.
433
- * Overrides `deploy.default` for this specific app.
434
- * @example 'dokploy', 'vercel'
435
- */
436
- deploy?: DeployTarget;
437
-
438
- // ─────────────────────────────────────────────────────────────────
439
- // Backend-specific (gkm routes mode)
440
- // ─────────────────────────────────────────────────────────────────
441
-
442
- /**
443
- * Routes glob pattern for gkm endpoints.
444
- * @example './src/endpoints/**\/*.ts'
445
- */
446
- routes?: Routes;
447
-
448
- /**
449
- * Functions glob pattern for Lambda functions.
450
- * @example './src/functions/**\/*.ts'
451
- */
452
- functions?: Routes;
453
-
454
- /**
455
- * Crons glob pattern for scheduled tasks.
456
- * @example './src/crons/**\/*.ts'
457
- */
458
- crons?: Routes;
459
-
460
- /**
461
- * Subscribers glob pattern for event handlers.
462
- * @example './src/subscribers/**\/*.ts'
463
- */
464
- subscribers?: Routes;
465
-
466
- /**
467
- * Path to environment parser module.
468
- * @example './src/config/env'
469
- */
470
- envParser?: string;
471
-
472
- /**
473
- * Path to logger module.
474
- * @example './src/config/logger'
475
- */
476
- logger?: string;
477
-
478
- /** Provider configuration (AWS, Docker, etc.) */
479
- providers?: ProvidersConfig;
480
-
481
- /**
482
- * Server lifecycle hooks.
483
- * @example { beforeSetup: './src/hooks/setup.ts' }
484
- */
485
- hooks?: HooksConfig;
486
-
487
- /**
488
- * Telescope debugging dashboard configuration.
489
- * @example true, './src/config/telescope', { enabled: true, path: '/__telescope' }
490
- */
491
- telescope?: string | boolean | TelescopeConfig;
492
-
493
- /**
494
- * Studio admin panel configuration.
495
- * @example true, './src/config/studio'
496
- */
497
- studio?: string | boolean | StudioConfig;
498
-
499
- /**
500
- * OpenAPI documentation configuration.
501
- * @example true, { output: './src/openapi.ts' }
502
- */
503
- openapi?: boolean | OpenApiConfig;
504
-
505
- /**
506
- * Runtime environment.
507
- * @default 'node'
508
- */
509
- runtime?: Runtime;
510
-
511
- /**
512
- * Environment file(s) to load during development.
513
- * @example '.env', ['.env', '.env.local']
514
- */
515
- env?: string | string[];
516
-
517
- // ─────────────────────────────────────────────────────────────────
518
- // Entry point mode (non-gkm apps)
519
- // ─────────────────────────────────────────────────────────────────
520
-
521
- /**
522
- * Entry file path for apps that don't use gkm routes.
523
- *
524
- * When specified, the app is run directly with tsx in development
525
- * and bundled with esbuild for production Docker builds.
526
- *
527
- * Use this for:
528
- * - Better Auth servers
529
- * - Custom Hono/Express apps
530
- * - Any backend that doesn't use gkm's endpoint builder
531
- *
532
- * @example './src/index.ts', './src/server.ts'
533
- */
534
- entry?: string;
535
-
536
- // ─────────────────────────────────────────────────────────────────
537
- // Frontend-specific
538
- // ─────────────────────────────────────────────────────────────────
539
-
540
- /**
541
- * Framework for the app.
542
- *
543
- * Backend frameworks: 'hono', 'better-auth', 'express', 'fastify'
544
- * Frontend frameworks: 'nextjs', 'remix', 'vite', 'tanstack-start'
545
- * Mobile frameworks: 'expo'
546
- *
547
- * @example 'nextjs', 'better-auth', 'hono', 'expo'
548
- */
549
- framework?: Framework;
550
-
551
- /**
552
- * Config file paths for frontend environment sniffing.
553
- *
554
- * Points to file(s) that call EnvironmentParser.parse() at import time.
555
- * The sniffer imports these files and captures all env vars accessed.
556
- *
557
- * Dependencies are auto-generated as public-prefixed URL vars based on
558
- * the app's framework (e.g. `NEXT_PUBLIC_{DEP}_URL` for Next.js,
559
- * `VITE_{DEP}_URL` for Vite/TanStack Start, `EXPO_PUBLIC_{DEP}_URL`
560
- * for Expo).
561
- *
562
- * @example
563
- * ```ts
564
- * config: {
565
- * client: './src/config/client.ts', // public-prefixed vars for browser
566
- * server: './src/config/server.ts', // server-only vars for SSR
567
- * }
568
- * ```
569
- */
570
- config?: {
571
- /** Client-side config (public-prefixed vars, available in browser/device) */
572
- client?: string;
573
- /** Server-side config (all env vars, for SSR/API routes) */
574
- server?: string;
575
- };
576
-
577
- // ─────────────────────────────────────────────────────────────────
578
- // Deployment
579
- // ─────────────────────────────────────────────────────────────────
580
-
581
- /**
582
- * Override domain for this app.
583
- *
584
- * By default, apps get `{appName}.{baseDomain}` (or just `{baseDomain}`
585
- * for the main frontend). Use this to specify a custom domain.
586
- *
587
- * @example
588
- * ```ts
589
- * // Single domain for all stages
590
- * domain: 'api.custom.com'
591
- *
592
- * // Stage-specific domains
593
- * domain: {
594
- * production: 'api.custom.com',
595
- * staging: 'api.staging.custom.com',
596
- * }
597
- * ```
598
- */
599
- domain?: AppDomainConfig;
600
-
601
- /**
602
- * Required environment variables for entry-based apps.
603
- *
604
- * Use this instead of envParser for apps that don't use gkm routes.
605
- * The deploy command uses this list to filter which secrets to embed
606
- * in the Docker image.
607
- *
608
- * @example ['DATABASE_URL', 'BETTER_AUTH_SECRET', 'REDIS_URL']
609
- */
610
- requiredEnv?: string[];
611
- }
612
-
613
- /**
614
- * App configuration input with type-safe dependencies.
615
- *
616
- * @template TAppNames - Union of valid app names in the workspace (auto-inferred)
617
- *
618
- * @example
619
- * ```ts
620
- * // Dependencies are type-checked against app names
621
- * apps: {
622
- * api: { path: 'apps/api', port: 3000 },
623
- * auth: { path: 'apps/auth', port: 3001 },
624
- * web: {
625
- * path: 'apps/web',
626
- * port: 3002,
627
- * type: 'web',
628
- * dependencies: ['api', 'auth'], // ✓ Valid
629
- * // dependencies: ['invalid'], // ✗ Type error
630
- * },
631
- * }
632
- * ```
633
- */
634
- export interface AppConfigInput<TAppNames extends string = string>
635
- extends AppConfigBase {
636
- /** Dependencies on other apps in the workspace (type-safe) */
637
- dependencies?: TAppNames[];
638
- }
639
-
640
- /**
641
- * App configuration (legacy, for backwards compatibility).
642
- * @deprecated Use AppConfigInput for new code
643
- */
644
- export interface AppConfig extends AppConfigBase {
645
- /** Dependencies on other apps in the workspace */
646
- dependencies?: string[];
647
- }
648
-
649
- /**
650
- * Base app input type for type inference.
651
- */
652
- export type AppInput = AppConfigBase & {
653
- dependencies?: readonly string[];
654
- };
655
-
656
- /**
657
- * Apps record type for workspace configuration.
658
- */
659
- export type AppsRecord = Record<string, AppInput>;
660
-
661
- /**
662
- * Constrain apps so dependencies only reference valid app names.
663
- * Dependencies must be an array of valid app names from the workspace.
664
- */
665
- export type ConstrainedApps<TApps extends AppsRecord> = {
666
- [K in keyof TApps]: Omit<TApps[K], 'dependencies'> & {
667
- dependencies?: readonly (keyof TApps & string)[];
668
- };
669
- };
670
-
671
- /**
672
- * Full workspace input type with constrained dependencies.
673
- *
674
- * @example
675
- * ```ts
676
- * import { defineWorkspace } from '@geekmidas/cli';
677
- *
678
- * export default defineWorkspace({
679
- * name: 'my-app',
680
- * apps: {
681
- * api: {
682
- * path: 'apps/api',
683
- * port: 3000,
684
- * routes: './src/endpoints/**\/*.ts',
685
- * },
686
- * web: {
687
- * type: 'web',
688
- * path: 'apps/web',
689
- * port: 3001,
690
- * framework: 'nextjs',
691
- * dependencies: ['api'],
692
- * },
693
- * },
694
- * services: {
695
- * db: true,
696
- * cache: true,
697
- * },
698
- * deploy: {
699
- * default: 'dokploy',
700
- * },
701
- * });
702
- * ```
703
- */
704
- export type WorkspaceInput<TApps extends AppsRecord> = {
705
- /** Workspace name (defaults to root package.json name) */
706
- name?: string;
707
- /** App definitions */
708
- apps: ConstrainedApps<TApps>;
709
- /** Shared packages configuration */
710
- shared?: SharedConfig;
711
- /** Deployment configuration */
712
- deploy?: DeployConfig;
713
- /** Development services (db, cache, mail, storage, events) */
714
- services?: ServicesConfig;
715
- /** Encrypted secrets configuration */
716
- secrets?: SecretsConfig;
717
- /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
718
- state?: StateConfig;
719
- };
720
-
721
- /**
722
- * Extract app names from apps record.
723
- */
724
- export type InferAppNames<TApps extends AppsRecord> = keyof TApps & string;
725
-
726
- /**
727
- * Inferred workspace config with proper app name types.
728
- */
729
- export type InferredWorkspaceConfig<TApps extends AppsRecord> = {
730
- name?: string;
731
- apps: {
732
- [K in keyof TApps]: Omit<TApps[K], 'dependencies'> & {
733
- dependencies?: InferAppNames<TApps>[];
734
- };
735
- };
736
- shared?: SharedConfig;
737
- deploy?: DeployConfig;
738
- services?: ServicesConfig;
739
- secrets?: SecretsConfig;
740
- state?: StateConfig;
741
- };
742
-
743
- // Legacy types for backwards compatibility
744
- /** @deprecated Use WorkspaceInput */
745
- export type RawWorkspaceInput = {
746
- name?: string;
747
- apps: AppsRecord;
748
- shared?: SharedConfig;
749
- deploy?: DeployConfig;
750
- services?: ServicesConfig;
751
- secrets?: SecretsConfig;
752
- state?: StateConfig;
753
- };
754
-
755
- /** @deprecated Use WorkspaceInput */
756
- export type WorkspaceConfigInput<
757
- T extends RawWorkspaceInput = RawWorkspaceInput,
758
- > = WorkspaceInput<T['apps']>;
759
-
760
- /**
761
- * Workspace configuration for multi-app monorepos.
762
- *
763
- * Use `defineWorkspace()` helper for type-safe configuration with
764
- * auto-completion and dependency validation.
765
- *
766
- * @example
767
- * ```ts
768
- * // gkm.config.ts
769
- * import { defineWorkspace } from '@geekmidas/cli';
770
- *
771
- * export default defineWorkspace({
772
- * name: 'my-saas',
773
- *
774
- * // App definitions
775
- * apps: {
776
- * // Backend API with gkm routes
777
- * api: {
778
- * path: 'apps/api',
779
- * port: 3000,
780
- * routes: './src/endpoints/**\/*.ts',
781
- * envParser: './src/config/env',
782
- * logger: './src/config/logger',
783
- * telescope: true,
784
- * },
785
- *
786
- * // Better Auth service
787
- * auth: {
788
- * path: 'apps/auth',
789
- * port: 3001,
790
- * entry: './src/index.ts',
791
- * framework: 'better-auth',
792
- * requiredEnv: ['DATABASE_URL', 'BETTER_AUTH_SECRET'],
793
- * },
794
- *
795
- * // Next.js frontend
796
- * web: {
797
- * type: 'web',
798
- * path: 'apps/web',
799
- * port: 3002,
800
- * framework: 'nextjs',
801
- * dependencies: ['api', 'auth'],
802
- * },
803
- * },
804
- *
805
- * // Infrastructure services
806
- * services: {
807
- * db: true, // PostgreSQL
808
- * cache: true, // Redis
809
- * },
810
- *
811
- * // Deployment configuration
812
- * deploy: {
813
- * default: 'dokploy',
814
- * dokploy: {
815
- * endpoint: 'https://dokploy.myserver.com',
816
- * projectId: 'proj_abc123',
817
- * registry: 'ghcr.io/myorg',
818
- * domains: {
819
- * production: 'myapp.com',
820
- * staging: 'staging.myapp.com',
821
- * },
822
- * },
823
- * },
824
- *
825
- * // Shared packages
826
- * shared: {
827
- * packages: ['packages/*'],
828
- * models: { path: 'packages/models' },
829
- * },
830
- * });
831
- * ```
832
- *
833
- * @deprecated Use WorkspaceInput with defineWorkspace for type inference
834
- */
835
- export interface WorkspaceConfig {
836
- /** Workspace name (defaults to root package.json name) */
837
- name?: string;
838
-
839
- /** App definitions */
840
- apps: Record<string, AppConfig>;
841
-
842
- /** Shared packages configuration */
843
- shared?: SharedConfig;
844
-
845
- /** Default deployment configuration */
846
- deploy?: DeployConfig;
847
-
848
- /** Development services (db, cache, mail, storage, events) */
849
- services?: ServicesConfig;
850
-
851
- /** Encrypted secrets configuration */
852
- secrets?: SecretsConfig;
853
-
854
- /** State provider configuration (local filesystem by default, or SSM for team collaboration) */
855
- state?: StateConfig;
856
- }
857
-
858
- /**
859
- * Normalized app configuration with resolved defaults.
860
- *
861
- * This is the internal representation after processing user input.
862
- * All optional fields have been resolved to their defaults.
863
- */
864
- export interface NormalizedAppConfig extends Omit<AppConfigBase, 'type'> {
865
- /** App type (always defined after normalization) */
866
- type: 'backend' | 'web' | 'mobile';
867
- /** Path to the app */
868
- path: string;
869
- /** Development server port */
870
- port: number;
871
- /** Resolved dependencies array (empty array if none) */
872
- dependencies: string[];
873
- /** Resolved deploy target (app.deploy > deploy.default > 'dokploy') */
874
- resolvedDeployTarget: DeployTarget;
875
- /** Entry file path for non-gkm apps */
876
- entry?: string;
877
- /** Framework for the app */
878
- framework?: Framework;
879
- /** Override domain for this app */
880
- domain?: AppDomainConfig;
881
- /** Required environment variables for entry-based apps */
882
- requiredEnv?: string[];
883
- }
884
-
885
- /**
886
- * Normalized workspace configuration with resolved defaults.
887
- *
888
- * This is the internal representation after processing user input.
889
- * All optional fields have been resolved to their defaults.
890
- */
891
- export interface NormalizedWorkspace {
892
- /** Workspace name (resolved from package.json if not specified) */
893
- name: string;
894
- /** Absolute path to workspace root */
895
- root: string;
896
- /** Normalized app configurations */
897
- apps: Record<string, NormalizedAppConfig>;
898
- /** Services configuration (empty object if not specified) */
899
- services: ServicesConfig;
900
- /** Deploy configuration (empty object if not specified) */
901
- deploy: DeployConfig;
902
- /** Shared packages configuration (empty object if not specified) */
903
- shared: SharedConfig;
904
- /** Secrets configuration (empty object if not specified) */
905
- secrets: SecretsConfig;
906
- /** State provider configuration (undefined = local filesystem) */
907
- state?: StateConfig;
908
- }
909
-
910
- /**
911
- * Result of loading and processing a configuration.
912
- */
913
- export interface LoadedConfig {
914
- /** Whether this is a single-app or workspace config */
915
- type: 'single' | 'workspace';
916
- /** The raw configuration as loaded */
917
- raw: GkmConfig | WorkspaceConfig;
918
- /** Normalized workspace (always available) */
919
- workspace: NormalizedWorkspace;
920
- }
921
-
922
- /**
923
- * Type guard to check if a config is a WorkspaceConfig.
924
- *
925
- * @example
926
- * ```ts
927
- * const config = await loadConfig();
928
- * if (isWorkspaceConfig(config)) {
929
- * // config.apps is available
930
- * console.log(Object.keys(config.apps));
931
- * }
932
- * ```
933
- */
934
- export function isWorkspaceConfig(
935
- config: GkmConfig | WorkspaceConfig,
936
- ): config is WorkspaceConfig {
937
- return (
938
- typeof config === 'object' &&
939
- config !== null &&
940
- 'apps' in config &&
941
- typeof config.apps === 'object'
942
- );
943
- }