@geekmidas/cli 10.0.0-alpha.16 → 10.0.0-alpha.161

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 (446) hide show
  1. package/README.md +323 -380
  2. package/bin/adjacent-tsconfig.mjs +46 -8
  3. package/bin/gkm.mjs +11 -3
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-B5BKAoLz.mjs +1039 -0
  7. package/dist/EndpointGenerator-B5BKAoLz.mjs.map +1 -0
  8. package/dist/EndpointGenerator-DxrRqfJ3.cjs +1098 -0
  9. package/dist/EndpointGenerator-DxrRqfJ3.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-CBqsvbER.cjs +412 -0
  11. package/dist/GoDaddyProvider-CBqsvbER.cjs.map +1 -0
  12. package/dist/GoDaddyProvider-CwqdLM1E.mjs +412 -0
  13. package/dist/GoDaddyProvider-CwqdLM1E.mjs.map +1 -0
  14. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-DtOtsFkM.cjs} +23 -9
  15. package/dist/HostingerProvider-DtOtsFkM.cjs.map +1 -0
  16. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-gD4uqzMN.mjs} +23 -9
  17. package/dist/HostingerProvider-gD4uqzMN.mjs.map +1 -0
  18. package/dist/LegacyStateStore-6xsGADme.mjs +124 -0
  19. package/dist/LegacyStateStore-6xsGADme.mjs.map +1 -0
  20. package/dist/LegacyStateStore-C0rm5slD.cjs +124 -0
  21. package/dist/LegacyStateStore-C0rm5slD.cjs.map +1 -0
  22. package/dist/LocalStateStore-G0JHXOVW.mjs +167 -0
  23. package/dist/LocalStateStore-G0JHXOVW.mjs.map +1 -0
  24. package/dist/LocalStateStore-NBMF3zCb.cjs +178 -0
  25. package/dist/LocalStateStore-NBMF3zCb.cjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-DOTLKBFf.cjs +539 -0
  27. package/dist/OpenApiTsGenerator-DOTLKBFf.cjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-Vaf0pI8u.mjs +534 -0
  29. package/dist/OpenApiTsGenerator-Vaf0pI8u.mjs.map +1 -0
  30. package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
  31. package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
  32. package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
  33. package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
  34. package/dist/S3StateStore-7n6gIYEJ.cjs +222 -0
  35. package/dist/S3StateStore-7n6gIYEJ.cjs.map +1 -0
  36. package/dist/S3StateStore-B7IPTvu0.mjs +223 -0
  37. package/dist/S3StateStore-B7IPTvu0.mjs.map +1 -0
  38. package/dist/SSMStateStore-CWEShHLS.mjs +205 -0
  39. package/dist/SSMStateStore-CWEShHLS.mjs.map +1 -0
  40. package/dist/SSMStateStore-O12NeGEg.cjs +204 -0
  41. package/dist/SSMStateStore-O12NeGEg.cjs.map +1 -0
  42. package/dist/SubscriberGenerator-BybB6uez.mjs +783 -0
  43. package/dist/SubscriberGenerator-BybB6uez.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-mZpSuSU7.cjs +848 -0
  45. package/dist/SubscriberGenerator-mZpSuSU7.cjs.map +1 -0
  46. package/dist/add-C-nlqQgN.mjs +711 -0
  47. package/dist/add-C-nlqQgN.mjs.map +1 -0
  48. package/dist/add-ktNZmJb-.cjs +713 -0
  49. package/dist/add-ktNZmJb-.cjs.map +1 -0
  50. package/dist/appPorts-BoXMwolc.mjs +249 -0
  51. package/dist/appPorts-BoXMwolc.mjs.map +1 -0
  52. package/dist/appPorts-IW-OZmRi.cjs +296 -0
  53. package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
  54. package/dist/apps-C7SujLV-.mjs +5621 -0
  55. package/dist/apps-C7SujLV-.mjs.map +1 -0
  56. package/dist/apps-CtjYJS9e.cjs +6247 -0
  57. package/dist/apps-CtjYJS9e.cjs.map +1 -0
  58. package/dist/aws-C5LAU_Ii.mjs +97 -0
  59. package/dist/aws-C5LAU_Ii.mjs.map +1 -0
  60. package/dist/aws-DKC2m3sT.cjs +108 -0
  61. package/dist/aws-DKC2m3sT.cjs.map +1 -0
  62. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  63. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  64. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  65. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  66. package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  67. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  68. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  69. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  70. package/dist/backups/runner.cjs +519 -0
  71. package/dist/backups/runner.cjs.map +1 -0
  72. package/dist/backups/runner.d.cts +102 -0
  73. package/dist/backups/runner.d.cts.map +1 -0
  74. package/dist/backups/runner.d.mts +102 -0
  75. package/dist/backups/runner.d.mts.map +1 -0
  76. package/dist/backups/runner.mjs +506 -0
  77. package/dist/backups/runner.mjs.map +1 -0
  78. package/dist/{bundler-BeNDZdHQ.cjs → bundler-DGwgZmim.cjs} +59 -14
  79. package/dist/bundler-DGwgZmim.cjs.map +1 -0
  80. package/dist/{bundler-BodTL4kf.mjs → bundler-DnHKVaZz.mjs} +59 -14
  81. package/dist/bundler-DnHKVaZz.mjs.map +1 -0
  82. package/dist/cli-CI9v138l.mjs +80 -0
  83. package/dist/cli-CI9v138l.mjs.map +1 -0
  84. package/dist/cli-k2G7rG15.cjs +80 -0
  85. package/dist/cli-k2G7rG15.cjs.map +1 -0
  86. package/dist/compose-BD2rwRfn.cjs +1919 -0
  87. package/dist/compose-BD2rwRfn.cjs.map +1 -0
  88. package/dist/compose-Co-Dt-a4.mjs +1560 -0
  89. package/dist/compose-Co-Dt-a4.mjs.map +1 -0
  90. package/dist/compose-nGgRylPu.cjs +3163 -0
  91. package/dist/compose-nGgRylPu.cjs.map +1 -0
  92. package/dist/compose-reJW9x-G.mjs +3074 -0
  93. package/dist/compose-reJW9x-G.mjs.map +1 -0
  94. package/dist/config-B5Hi3mLK.cjs +821 -0
  95. package/dist/config-B5Hi3mLK.cjs.map +1 -0
  96. package/dist/config-C60T2h98.d.cts +291 -0
  97. package/dist/config-C60T2h98.d.cts.map +1 -0
  98. package/dist/config-CfI2g_Ho.d.mts +291 -0
  99. package/dist/config-CfI2g_Ho.d.mts.map +1 -0
  100. package/dist/config-DWTUVGRE.mjs +696 -0
  101. package/dist/config-DWTUVGRE.mjs.map +1 -0
  102. package/dist/config.cjs +13 -3
  103. package/dist/config.d.cts +4 -117
  104. package/dist/config.d.mts +4 -117
  105. package/dist/config.mjs +3 -3
  106. package/dist/credentialSchemas-BAklWDna.cjs +271 -0
  107. package/dist/credentialSchemas-BAklWDna.cjs.map +1 -0
  108. package/dist/credentialSchemas-mz9QZTYh.mjs +236 -0
  109. package/dist/credentialSchemas-mz9QZTYh.mjs.map +1 -0
  110. package/dist/credentials-BG1KOq9I.mjs +1838 -0
  111. package/dist/credentials-BG1KOq9I.mjs.map +1 -0
  112. package/dist/credentials-UlL1n_Rd.cjs +2293 -0
  113. package/dist/credentials-UlL1n_Rd.cjs.map +1 -0
  114. package/dist/databases-C1qqNxTu.mjs +588 -0
  115. package/dist/databases-C1qqNxTu.mjs.map +1 -0
  116. package/dist/databases-CrKh5jw6.cjs +703 -0
  117. package/dist/databases-CrKh5jw6.cjs.map +1 -0
  118. package/dist/define-6poNqm5O.mjs +106 -0
  119. package/dist/define-6poNqm5O.mjs.map +1 -0
  120. package/dist/define-crmMcXFS.cjs +153 -0
  121. package/dist/define-crmMcXFS.cjs.map +1 -0
  122. package/dist/deploy/public.cjs +211 -0
  123. package/dist/deploy/public.cjs.map +1 -0
  124. package/dist/deploy/public.d.cts +658 -0
  125. package/dist/deploy/public.d.cts.map +1 -0
  126. package/dist/deploy/public.d.mts +658 -0
  127. package/dist/deploy/public.d.mts.map +1 -0
  128. package/dist/deploy/public.mjs +144 -0
  129. package/dist/deploy/public.mjs.map +1 -0
  130. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  131. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  132. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  133. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  134. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  135. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  136. package/dist/deploy/sniffer-hooks.cjs +1 -1
  137. package/dist/deploy/sniffer-hooks.mjs +1 -1
  138. package/dist/deploy/sniffer-loader.cjs +2 -2
  139. package/dist/deploy/sniffer-loader.mjs +1 -1
  140. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  141. package/dist/deploy/sniffer-routes-worker.mjs +1 -1
  142. package/dist/deploy-CqIULk0k.cjs +3425 -0
  143. package/dist/deploy-CqIULk0k.cjs.map +1 -0
  144. package/dist/deploy-DRkCNV7f.mjs +3369 -0
  145. package/dist/deploy-DRkCNV7f.mjs.map +1 -0
  146. package/dist/destroy-CMldkiX-.cjs +789 -0
  147. package/dist/destroy-CMldkiX-.cjs.map +1 -0
  148. package/dist/destroy-DXIAL8nF.mjs +788 -0
  149. package/dist/destroy-DXIAL8nF.mjs.map +1 -0
  150. package/dist/discover-CRywE7yc.cjs +1085 -0
  151. package/dist/discover-CRywE7yc.cjs.map +1 -0
  152. package/dist/discover-DbDrCQ8h.mjs +940 -0
  153. package/dist/discover-DbDrCQ8h.mjs.map +1 -0
  154. package/dist/docker-DFFzQe2f.mjs +1408 -0
  155. package/dist/docker-DFFzQe2f.mjs.map +1 -0
  156. package/dist/docker-LwJW3dx_.cjs +1515 -0
  157. package/dist/docker-LwJW3dx_.cjs.map +1 -0
  158. package/dist/dokploy-DYm0D6Tp.mjs +38 -0
  159. package/dist/dokploy-DYm0D6Tp.mjs.map +1 -0
  160. package/dist/dokploy-wTsJqG-N.cjs +38 -0
  161. package/dist/dokploy-wTsJqG-N.cjs.map +1 -0
  162. package/dist/drivers-BhdC9Efj.cjs +248 -0
  163. package/dist/drivers-BhdC9Efj.cjs.map +1 -0
  164. package/dist/drivers-wcDnzf7l.mjs +213 -0
  165. package/dist/drivers-wcDnzf7l.mjs.map +1 -0
  166. package/dist/eas-BJ_Zlvm8.mjs +334 -0
  167. package/dist/eas-BJ_Zlvm8.mjs.map +1 -0
  168. package/dist/eas-C4EkjTGJ.cjs +337 -0
  169. package/dist/eas-C4EkjTGJ.cjs.map +1 -0
  170. package/dist/emit-C4KSXOeS.mjs +153 -0
  171. package/dist/emit-C4KSXOeS.mjs.map +1 -0
  172. package/dist/emit-DiW0kbue.cjs +164 -0
  173. package/dist/emit-DiW0kbue.cjs.map +1 -0
  174. package/dist/encryption-BQEqqrGq.cjs +90 -0
  175. package/dist/encryption-BQEqqrGq.cjs.map +1 -0
  176. package/dist/encryption-Cu5YTs9V.mjs +89 -0
  177. package/dist/encryption-Cu5YTs9V.mjs.map +1 -0
  178. package/dist/engine-DdRauUQC.cjs +3330 -0
  179. package/dist/engine-DdRauUQC.cjs.map +1 -0
  180. package/dist/engine-q8aCVbLH.mjs +3217 -0
  181. package/dist/engine-q8aCVbLH.mjs.map +1 -0
  182. package/dist/errors-D8Gwp5kU.mjs +23 -0
  183. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  184. package/dist/errors-DMC4Umsb.cjs +34 -0
  185. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  186. package/dist/github-CoXirRes.mjs +901 -0
  187. package/dist/github-CoXirRes.mjs.map +1 -0
  188. package/dist/github-OVZF2k0L.cjs +902 -0
  189. package/dist/github-OVZF2k0L.cjs.map +1 -0
  190. package/dist/googlePlay-CUeTUT7s.cjs +931 -0
  191. package/dist/googlePlay-CUeTUT7s.cjs.map +1 -0
  192. package/dist/googlePlay-HXRRVq0l.mjs +931 -0
  193. package/dist/googlePlay-HXRRVq0l.mjs.map +1 -0
  194. package/dist/iam-6LH6wptf.cjs +618 -0
  195. package/dist/iam-6LH6wptf.cjs.map +1 -0
  196. package/dist/iam-c0e8m04X.mjs +509 -0
  197. package/dist/iam-c0e8m04X.mjs.map +1 -0
  198. package/dist/{index-C-VLwB_Y.d.mts → index-DDY0cZCo.d.cts} +38 -14
  199. package/dist/index-DDY0cZCo.d.cts.map +1 -0
  200. package/dist/{index-C-HkOEBt.d.cts → index-DWNwkcy7.d.mts} +38 -14
  201. package/dist/index-DWNwkcy7.d.mts.map +1 -0
  202. package/dist/index.cjs +13752 -12326
  203. package/dist/index.cjs.map +1 -1
  204. package/dist/index.mjs +13791 -12363
  205. package/dist/index.mjs.map +1 -1
  206. package/dist/local-CCJ-T37d.mjs +224 -0
  207. package/dist/local-CCJ-T37d.mjs.map +1 -0
  208. package/dist/local-Dx0o6vfp.cjs +241 -0
  209. package/dist/local-Dx0o6vfp.cjs.map +1 -0
  210. package/dist/migrate-BkwSXhxv.mjs +181 -0
  211. package/dist/migrate-BkwSXhxv.mjs.map +1 -0
  212. package/dist/migrate-CJoKOCGY.cjs +181 -0
  213. package/dist/migrate-CJoKOCGY.cjs.map +1 -0
  214. package/dist/migrate-DEsYfgzn.cjs +272 -0
  215. package/dist/migrate-DEsYfgzn.cjs.map +1 -0
  216. package/dist/migrate-Dr0BeWsY.mjs +267 -0
  217. package/dist/migrate-Dr0BeWsY.mjs.map +1 -0
  218. package/dist/notes-BOyzuPqr.mjs +399 -0
  219. package/dist/notes-BOyzuPqr.mjs.map +1 -0
  220. package/dist/notes-VFPa51Pd.cjs +500 -0
  221. package/dist/notes-VFPa51Pd.cjs.map +1 -0
  222. package/dist/openapi.cjs +213 -7
  223. package/dist/openapi.cjs.map +1 -0
  224. package/dist/openapi.d.cts +32 -8
  225. package/dist/openapi.d.cts.map +1 -1
  226. package/dist/openapi.d.mts +32 -8
  227. package/dist/openapi.d.mts.map +1 -1
  228. package/dist/openapi.mjs +208 -2
  229. package/dist/openapi.mjs.map +1 -0
  230. package/dist/projectBucket-B26ucBRI.mjs +222 -0
  231. package/dist/projectBucket-B26ucBRI.mjs.map +1 -0
  232. package/dist/projectBucket-CWpY3Vxv.cjs +263 -0
  233. package/dist/projectBucket-CWpY3Vxv.cjs.map +1 -0
  234. package/dist/provider-BqpjG9QM.cjs +57 -0
  235. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  236. package/dist/provider-CEOKk8NS.mjs +46 -0
  237. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  238. package/dist/publish-Bg4iffje.mjs +123 -0
  239. package/dist/publish-Bg4iffje.mjs.map +1 -0
  240. package/dist/publish-IjcRoorJ.cjs +124 -0
  241. package/dist/publish-IjcRoorJ.cjs.map +1 -0
  242. package/dist/ready-BjFMu_1J.mjs +375 -0
  243. package/dist/ready-BjFMu_1J.mjs.map +1 -0
  244. package/dist/ready-eVMJIcWn.cjs +404 -0
  245. package/dist/ready-eVMJIcWn.cjs.map +1 -0
  246. package/dist/reconcile/public.cjs +3 -5
  247. package/dist/reconcile/public.d.cts +33 -89
  248. package/dist/reconcile/public.d.cts.map +1 -1
  249. package/dist/reconcile/public.d.mts +33 -89
  250. package/dist/reconcile/public.d.mts.map +1 -1
  251. package/dist/reconcile/public.mjs +3 -3
  252. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  253. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  254. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  255. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  256. package/dist/resolve-CgVDhWW8.cjs +316 -0
  257. package/dist/resolve-CgVDhWW8.cjs.map +1 -0
  258. package/dist/resolve-rw7mLp5E.mjs +263 -0
  259. package/dist/resolve-rw7mLp5E.mjs.map +1 -0
  260. package/dist/rollback-Cv02Cnky.mjs +136 -0
  261. package/dist/rollback-Cv02Cnky.mjs.map +1 -0
  262. package/dist/rollback-vdkPi_Rm.cjs +165 -0
  263. package/dist/rollback-vdkPi_Rm.cjs.map +1 -0
  264. package/dist/runtime-D-rOcRoq.d.cts +82 -0
  265. package/dist/runtime-D-rOcRoq.d.cts.map +1 -0
  266. package/dist/runtime-DG1mNh_5.d.mts +82 -0
  267. package/dist/runtime-DG1mNh_5.d.mts.map +1 -0
  268. package/dist/s3-DIvAtJwk.cjs +240 -0
  269. package/dist/s3-DIvAtJwk.cjs.map +1 -0
  270. package/dist/s3-DmsM_V2R.mjs +240 -0
  271. package/dist/s3-DmsM_V2R.mjs.map +1 -0
  272. package/dist/sandbox/config-worker.cjs +43 -0
  273. package/dist/sandbox/config-worker.cjs.map +1 -0
  274. package/dist/sandbox/config-worker.d.cts +1 -0
  275. package/dist/sandbox/config-worker.d.mts +1 -0
  276. package/dist/sandbox/config-worker.mjs +44 -0
  277. package/dist/sandbox/config-worker.mjs.map +1 -0
  278. package/dist/sandbox/credentials-worker.cjs +53 -0
  279. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  280. package/dist/sandbox/credentials-worker.d.cts +1 -0
  281. package/dist/sandbox/credentials-worker.d.mts +1 -0
  282. package/dist/sandbox/credentials-worker.mjs +54 -0
  283. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  284. package/dist/sandbox/discover-worker.cjs +47 -0
  285. package/dist/sandbox/discover-worker.cjs.map +1 -0
  286. package/dist/sandbox/discover-worker.d.cts +1 -0
  287. package/dist/sandbox/discover-worker.d.mts +1 -0
  288. package/dist/sandbox/discover-worker.mjs +48 -0
  289. package/dist/sandbox/discover-worker.mjs.map +1 -0
  290. package/dist/sandbox/migrate-worker.cjs +75 -0
  291. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  292. package/dist/sandbox/migrate-worker.d.cts +1 -0
  293. package/dist/sandbox/migrate-worker.d.mts +1 -0
  294. package/dist/sandbox/migrate-worker.mjs +76 -0
  295. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  296. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  297. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  298. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  299. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  300. package/dist/secretsManager-CJyxFcBH.mjs +113 -0
  301. package/dist/secretsManager-CJyxFcBH.mjs.map +1 -0
  302. package/dist/secretsManager-D8on44WI.cjs +124 -0
  303. package/dist/secretsManager-D8on44WI.cjs.map +1 -0
  304. package/dist/seeds-D7q1zKCJ.cjs +369 -0
  305. package/dist/seeds-D7q1zKCJ.cjs.map +1 -0
  306. package/dist/seeds-y1rzXlAc.mjs +298 -0
  307. package/dist/seeds-y1rzXlAc.mjs.map +1 -0
  308. package/dist/serverSetup-CvcN4zJQ.mjs +685 -0
  309. package/dist/serverSetup-CvcN4zJQ.mjs.map +1 -0
  310. package/dist/serverSetup-qXIRRhgw.cjs +685 -0
  311. package/dist/serverSetup-qXIRRhgw.cjs.map +1 -0
  312. package/dist/sniffer-CGfL25Bc.cjs +1997 -0
  313. package/dist/sniffer-CGfL25Bc.cjs.map +1 -0
  314. package/dist/sniffer-DuKVVAs_.mjs +1824 -0
  315. package/dist/sniffer-DuKVVAs_.mjs.map +1 -0
  316. package/dist/snsSubscriptions-DPfGjpuB.cjs +1179 -0
  317. package/dist/snsSubscriptions-DPfGjpuB.cjs.map +1 -0
  318. package/dist/snsSubscriptions-nnSUW2Eh.mjs +1048 -0
  319. package/dist/snsSubscriptions-nnSUW2Eh.mjs.map +1 -0
  320. package/dist/sst-Bw7686br.mjs +478 -0
  321. package/dist/sst-Bw7686br.mjs.map +1 -0
  322. package/dist/sst-Md7c1UC_.cjs +501 -0
  323. package/dist/sst-Md7c1UC_.cjs.map +1 -0
  324. package/dist/stack-D2cLLaO-.mjs +2256 -0
  325. package/dist/stack-D2cLLaO-.mjs.map +1 -0
  326. package/dist/stack-DTcnynGb.cjs +2431 -0
  327. package/dist/stack-DTcnynGb.cjs.map +1 -0
  328. package/dist/stage-Bw3bJ7Au.mjs +302 -0
  329. package/dist/stage-Bw3bJ7Au.mjs.map +1 -0
  330. package/dist/stage-RLOenlHV.cjs +313 -0
  331. package/dist/stage-RLOenlHV.cjs.map +1 -0
  332. package/dist/stages-B0yOikgt.cjs +190 -0
  333. package/dist/stages-B0yOikgt.cjs.map +1 -0
  334. package/dist/stages-yA9bhStl.mjs +190 -0
  335. package/dist/stages-yA9bhStl.mjs.map +1 -0
  336. package/dist/target/public.cjs +15 -0
  337. package/dist/target/public.d.cts +28 -0
  338. package/dist/target/public.d.cts.map +1 -0
  339. package/dist/target/public.d.mts +28 -0
  340. package/dist/target/public.d.mts.map +1 -0
  341. package/dist/target/public.mjs +4 -0
  342. package/dist/terminal-C-_cMKTY.cjs +85 -0
  343. package/dist/terminal-C-_cMKTY.cjs.map +1 -0
  344. package/dist/terminal-Dq29bK3u.mjs +85 -0
  345. package/dist/terminal-Dq29bK3u.mjs.map +1 -0
  346. package/dist/types-Bl_CwZC9.cjs +90 -0
  347. package/dist/types-Bl_CwZC9.cjs.map +1 -0
  348. package/dist/{types-RhXmHR-e.d.cts → types-CvucX3yD.d.mts} +2163 -364
  349. package/dist/types-CvucX3yD.d.mts.map +1 -0
  350. package/dist/{types-kvBQjpPo.d.mts → types-D1C8pUyh.d.cts} +2165 -364
  351. package/dist/types-D1C8pUyh.d.cts.map +1 -0
  352. package/dist/types-Y1NfWlyG.mjs +61 -0
  353. package/dist/types-Y1NfWlyG.mjs.map +1 -0
  354. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  355. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  356. package/dist/utils-D_fxUqvU.mjs +156 -0
  357. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  358. package/dist/vitest.cjs +65 -0
  359. package/dist/vitest.cjs.map +1 -0
  360. package/dist/vitest.d.cts +29 -0
  361. package/dist/vitest.d.cts.map +1 -0
  362. package/dist/vitest.d.mts +29 -0
  363. package/dist/vitest.d.mts.map +1 -0
  364. package/dist/vitest.mjs +65 -0
  365. package/dist/vitest.mjs.map +1 -0
  366. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  367. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  368. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  369. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  370. package/dist/workspace/index.cjs +6 -2
  371. package/dist/workspace/index.d.cts +3 -3
  372. package/dist/workspace/index.d.mts +3 -3
  373. package/dist/workspace/index.mjs +2 -2
  374. package/dist/workspace-1szcahj9.cjs +2916 -0
  375. package/dist/workspace-1szcahj9.cjs.map +1 -0
  376. package/dist/workspace-DFGsrjGD.mjs +2480 -0
  377. package/dist/workspace-DFGsrjGD.mjs.map +1 -0
  378. package/package.json +65 -13
  379. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  380. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  381. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  382. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  383. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  384. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  385. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  386. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  387. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  388. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  389. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  390. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  391. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  392. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  393. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  394. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  395. package/dist/config-Q1rvKHvw.cjs +0 -467
  396. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  397. package/dist/config-pqGD3hF9.mjs +0 -414
  398. package/dist/config-pqGD3hF9.mjs.map +0 -1
  399. package/dist/config.d.cts.map +0 -1
  400. package/dist/config.d.mts.map +0 -1
  401. package/dist/credentials-BekkKtY_.mjs +0 -2780
  402. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  403. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  404. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  405. package/dist/discover-BERGFg8v.cjs +0 -288
  406. package/dist/discover-BERGFg8v.cjs.map +0 -1
  407. package/dist/discover-CK-n3w6b.mjs +0 -244
  408. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  409. package/dist/emit-BdoPFjZf.cjs +0 -253
  410. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  411. package/dist/emit-Bzq7JsMP.mjs +0 -224
  412. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  413. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  414. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  415. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  416. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  417. package/dist/generator-LfZU7NlU.mjs +0 -247
  418. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  419. package/dist/generator-Wdfp0jCS.cjs +0 -282
  420. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  421. package/dist/github-BfflNPVe.cjs +0 -203
  422. package/dist/github-BfflNPVe.cjs.map +0 -1
  423. package/dist/github-CRwnxKmD.mjs +0 -203
  424. package/dist/github-CRwnxKmD.mjs.map +0 -1
  425. package/dist/index-C-HkOEBt.d.cts.map +0 -1
  426. package/dist/index-C-VLwB_Y.d.mts.map +0 -1
  427. package/dist/keystore-B4PRlbgE.mjs +0 -81
  428. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  429. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  430. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  431. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  432. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  433. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  434. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  435. package/dist/storage-C-30BD1e.cjs +0 -272
  436. package/dist/storage-C-30BD1e.cjs.map +0 -1
  437. package/dist/storage-P_b3w7uj.mjs +0 -231
  438. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  439. package/dist/sync-B3xxXtJT.mjs +0 -88
  440. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  441. package/dist/sync-D7uTIIEi.cjs +0 -111
  442. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  443. package/dist/types-RhXmHR-e.d.cts.map +0 -1
  444. package/dist/types-kvBQjpPo.d.mts.map +0 -1
  445. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  446. package/dist/workspace-mFpI_ky_.cjs.map +0 -1
@@ -0,0 +1,821 @@
1
+ const require_errors = require("./errors-DMC4Umsb.cjs");
2
+ const require_workspace = require("./workspace-1szcahj9.cjs");
3
+ const require_schemas = require("./schemas-BQ_v0lEX.cjs");
4
+ const require_discover = require("./discover-CRywE7yc.cjs");
5
+ let node_path = require("node:path");
6
+ let node_fs = require("node:fs");
7
+ let _geekmidas_manifest = require("@geekmidas/manifest");
8
+ let node_async_hooks = require("node:async_hooks");
9
+ //#region src/workspace/subdomains.ts
10
+ /**
11
+ * The subdomains of a stage's domain, as a wildcard site sees them.
12
+ *
13
+ * A site declared `subdomain: '*'` answers on every label nothing else does,
14
+ * so the labels something else does answer on are the ones a tenant can never
15
+ * take. They come from two places and from nowhere else: every app's own
16
+ * label, read off the constructs and never listed by hand, and the names no
17
+ * construct declares (`www`, `mail`, `status`), listed once in the workspace
18
+ * config as `protectedSubdomains`.
19
+ */
20
+ /** A `protectedSubdomains` entry an app already answers on. */
21
+ var ProtectedSubdomainIsAnApp = class extends require_errors.GkmError {
22
+ subdomain;
23
+ app;
24
+ constructor(subdomain, app) {
25
+ super(`protectedSubdomains lists '${subdomain}', which '${app}' already answers on — a construct's own subdomain is protected without being listed. Remove it from protectedSubdomains.`);
26
+ this.subdomain = subdomain;
27
+ this.app = app;
28
+ this.name = "ProtectedSubdomainIsAnApp";
29
+ }
30
+ };
31
+ /** Two sites that both answer on every subdomain. */
32
+ var SecondWildcardSite = class extends require_errors.GkmError {
33
+ sites;
34
+ constructor(sites) {
35
+ super(`${sites.join(" and ")} both declare subdomain: '*', and two sites cannot share the same hosts. Keep one wildcard site per project; give the other a subdomain of its own.`);
36
+ this.sites = sites;
37
+ this.name = "SecondWildcardSite";
38
+ }
39
+ };
40
+ /** A wildcard site whose `hosts` route is on no surface the project declares. */
41
+ var SiteHostsEndpointMissing = class extends require_errors.GkmError {
42
+ site;
43
+ surface;
44
+ path;
45
+ constructor(site, surface, path) {
46
+ super(`'${site}' checks its hosts with GET ${path} on '${surface}', but '${surface}' serves no such route. Export the endpoint from the surface's endpoints, or point \`hosts\` at one it serves.`);
47
+ this.site = site;
48
+ this.surface = surface;
49
+ this.path = path;
50
+ this.name = "SiteHostsEndpointMissing";
51
+ }
52
+ };
53
+ /** The project's one wildcard site, or `undefined` when it has none. */
54
+ function wildcardSite(manifest) {
55
+ return Object.values(manifest).find(_geekmidas_manifest.isWildcardSite);
56
+ }
57
+ /**
58
+ * Every label an app answers on, by the app it belongs to — what a deploy
59
+ * puts under the stage's domain: a surface's or site's `subdomain` (or its id
60
+ * kebab-cased), each file server and its processors' origin, and each worker,
61
+ * which SNS may push to on a host of its own.
62
+ *
63
+ * The root site's is kept although it answers on the domain itself: which
64
+ * site is the root can change without a tenant's slug changing meaning. The
65
+ * wildcard site has none — its labels are whatever is left.
66
+ */
67
+ function appSubdomains(manifest) {
68
+ const labels = /* @__PURE__ */ new Map();
69
+ for (const [id, declaration] of Object.entries(manifest)) switch (declaration.kind) {
70
+ case "rest-api":
71
+ case "websocket-api":
72
+ labels.set(declaration.subdomain ?? (0, _geekmidas_manifest.kebabCase)(id), id);
73
+ break;
74
+ case "site":
75
+ if (declaration.subdomain === _geekmidas_manifest.WILDCARD_SUBDOMAIN) break;
76
+ labels.set(declaration.subdomain ?? (0, _geekmidas_manifest.kebabCase)(id), id);
77
+ break;
78
+ case "file-server":
79
+ labels.set((0, _geekmidas_manifest.kebabCase)(id), id);
80
+ if (declaration.processors?.length) labels.set(`${(0, _geekmidas_manifest.kebabCase)(id)}-processors`, id);
81
+ break;
82
+ case "worker": labels.set((0, _geekmidas_manifest.kebabCase)(id), id);
83
+ }
84
+ return labels;
85
+ }
86
+ /**
87
+ * The labels no tenant may take: every app's own and the workspace's
88
+ * `protectedSubdomains`, sorted.
89
+ */
90
+ function protectedSubdomains(manifest, configured = []) {
91
+ return [.../* @__PURE__ */ new Set([...appSubdomains(manifest).keys(), ...configured])].sort();
92
+ }
93
+ /**
94
+ * What a project's subdomains have to satisfy before anything is derived
95
+ * from them.
96
+ *
97
+ * @throws {SecondWildcardSite} when two sites declare `subdomain: '*'`
98
+ * @throws {SiteHostsEndpointMissing} when the wildcard site's `hosts` route is not served
99
+ * @throws {ProtectedSubdomainIsAnApp} when `protectedSubdomains` repeats an app's own
100
+ */
101
+ function assertSubdomains(manifest, configured = []) {
102
+ const wildcards = Object.values(manifest).filter(_geekmidas_manifest.isWildcardSite);
103
+ if (wildcards.length > 1) throw new SecondWildcardSite(wildcards.map((site) => site.id).sort());
104
+ const site = wildcards[0];
105
+ if (site?.hosts) {
106
+ const surface = manifest[site.hosts.surface];
107
+ if (!(surface?.kind === "rest-api" && surface.endpoints.some((endpoint) => endpoint.method.toUpperCase() === "GET" && endpoint.path === site.hosts?.path))) throw new SiteHostsEndpointMissing(site.id, site.hosts.surface, site.hosts.path);
108
+ }
109
+ const labels = appSubdomains(manifest);
110
+ for (const subdomain of configured) {
111
+ const app = labels.get(subdomain);
112
+ if (app) throw new ProtectedSubdomainIsAnApp(subdomain, app);
113
+ }
114
+ }
115
+ //#endregion
116
+ //#region src/workspace/derive.ts
117
+ /**
118
+ * The apps a manifest implies.
119
+ *
120
+ * `gkm.config.ts` used to carry an `apps` block naming every app: its type, its
121
+ * path, its port, its framework, which other apps it depended on. Every one of
122
+ * those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`
123
+ * and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',
124
+ * dependencies: ['api'] }` are the same statement written twice, and only one of
125
+ * them was checked against anything — so the copy in config was free to drift,
126
+ * and a surface config had no entry for simply never deployed.
127
+ *
128
+ * So the list comes from the graph. A `site` is an app, and so is every
129
+ * `rest-api` — one surface, one container, at the `path` it declared.
130
+ *
131
+ * What config still supplies is what no graph can answer: the backends a cache
132
+ * and a mailer resolve to, the deploy endpoint, the stage's domain.
133
+ */
134
+ /** Which frontend framework builds each site variant. */
135
+ const FRAMEWORKS = {
136
+ static: "vite",
137
+ next: "nextjs",
138
+ tanstack: "tanstack-start"
139
+ };
140
+ /**
141
+ * The app key a construct id becomes.
142
+ *
143
+ * The same kebab form every physical name is built from, so `Api` is `api` in
144
+ * the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an
145
+ * environment — one id, three renderings, no second list.
146
+ */
147
+ function appKey(id) {
148
+ return (0, _geekmidas_manifest.kebabCase)(id);
149
+ }
150
+ /**
151
+ * The app serving a surface: its own, always.
152
+ *
153
+ * Every surface gets a container. There is no arrangement in which one runs
154
+ * inside another — two surfaces in a process share a filesystem, an
155
+ * environment, and every credential either was granted, so an auth server
156
+ * beside an API is one bug in the API away from being read by it.
157
+ */
158
+ function hostOf(manifest, id) {
159
+ const declaration = manifest[id];
160
+ if (!declaration || declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") return void 0;
161
+ return id;
162
+ }
163
+ /**
164
+ * Local ports, assigned so that adding a site does not renumber the others.
165
+ *
166
+ * Backends first, then the site holding the base domain, then the rest
167
+ * alphabetically. The ordering is arbitrary but it is *fixed*, which is the
168
+ * property that matters: a port that moves when an unrelated app is added is a
169
+ * port nobody can put in a bookmark. A construct that names its own port keeps
170
+ * it, and is skipped here.
171
+ */
172
+ function assignPorts(apps) {
173
+ const rank = (name, app) => [
174
+ app.type === "backend" ? 0 : app.type === "web" ? 1 : 2,
175
+ app.root ? 0 : 1,
176
+ name
177
+ ];
178
+ const ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {
179
+ const [at, ar, an] = rank(aName, a);
180
+ const [bt, br, bn] = rank(bName, b);
181
+ return at - bt || ar - br || an.localeCompare(bn);
182
+ });
183
+ const taken = new Set(ordered.map(([, app]) => app.port).filter((p) => !!p));
184
+ let next = 3e3;
185
+ for (const [, app] of ordered) {
186
+ if (app.port) continue;
187
+ while (taken.has(next)) next += 1;
188
+ app.port = next;
189
+ taken.add(next);
190
+ }
191
+ }
192
+ /**
193
+ * Whichever site holds the base domain.
194
+ *
195
+ * The convention first — a site named `web` — because it is one people already
196
+ * rely on. Then an explicit `root: true`. A project with one site needs neither.
197
+ */
198
+ function markRoot(apps) {
199
+ const sites = Object.entries(apps).filter(([, a]) => a.type === "web" && a.subdomain !== _geekmidas_manifest.WILDCARD_SUBDOMAIN);
200
+ if (sites.length === 0) return;
201
+ if (sites.some(([, a]) => a.root)) return;
202
+ const chosen = sites.find(([name]) => name === "web") ?? (sites.length === 1 ? sites[0] : void 0);
203
+ if (chosen) chosen[1].root = true;
204
+ }
205
+ function derivedApps(manifest, workspace) {
206
+ assertSubdomains(manifest, workspace.protectedSubdomains);
207
+ const apps = {};
208
+ const defaultTarget = workspace.deploy?.default ?? "dokploy";
209
+ for (const [id, declaration] of Object.entries(manifest)) {
210
+ if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") continue;
211
+ const spec = declaration.kind === "site" || declaration.kind === "mobile-app" ? declaration.app : {
212
+ path: declaration.path,
213
+ ...declaration.kind === "rest-api" && declaration.telescope ? { telescope: true } : {}
214
+ };
215
+ const name = appKey(id);
216
+ const configured = workspace.apps[name];
217
+ apps[name] = {
218
+ ...configured,
219
+ type: declaration.kind === "site" ? "web" : declaration.kind === "mobile-app" ? "mobile" : "backend",
220
+ path: spec.path,
221
+ port: spec.port ?? configured?.port ?? 0,
222
+ ...(declaration.kind === "rest-api" || declaration.kind === "websocket-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
223
+ dependencies: [],
224
+ resolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,
225
+ ...declaration.kind === "site" ? {
226
+ framework: configured?.framework ?? FRAMEWORKS[declaration.variant],
227
+ ...declaration.root ? { root: true } : {},
228
+ ...spec.config ? { config: spec.config } : {}
229
+ } : {},
230
+ ...declaration.kind === "mobile-app" ? {
231
+ framework: configured?.framework ?? declaration.variant,
232
+ ...spec.config ? { config: spec.config } : {}
233
+ } : {},
234
+ ...spec.telescope !== void 0 ? { telescope: spec.telescope } : {},
235
+ ...spec.openapi !== void 0 ? { openapi: spec.openapi } : {},
236
+ ...spec.runtime !== void 0 ? { runtime: spec.runtime } : {},
237
+ ...spec.env !== void 0 ? { env: spec.env } : {},
238
+ ...spec.entry !== void 0 ? { entry: spec.entry } : {},
239
+ ...configured?.domain ? { domain: configured.domain } : {}
240
+ };
241
+ }
242
+ for (const [id, declaration] of Object.entries(manifest)) {
243
+ if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api" && declaration.kind !== "websocket-api") continue;
244
+ const app = apps[appKey(id)];
245
+ if (!app) continue;
246
+ const edges = (0, _geekmidas_manifest.dependenciesOf)(declaration);
247
+ const names = /* @__PURE__ */ new Set();
248
+ for (const edge of edges) {
249
+ if (edge.kind !== "rest-api") continue;
250
+ const host = hostOf(manifest, edge.target);
251
+ if (!host) continue;
252
+ const key = appKey(host);
253
+ if (key !== appKey(id) && apps[key]) names.add(key);
254
+ }
255
+ app.dependencies = [...names].sort();
256
+ }
257
+ markRoot(apps);
258
+ assignPorts(apps);
259
+ for (const [name, app] of Object.entries(workspace.apps)) if (!apps[name]) apps[name] = app;
260
+ return apps;
261
+ }
262
+ //#endregion
263
+ //#region src/config.ts
264
+ /**
265
+ * Define GKM configuration with full TypeScript support.
266
+ * This is an identity function that provides type safety and autocomplete.
267
+ *
268
+ * @example
269
+ * ```ts
270
+ * // gkm.config.ts
271
+ * import { defineConfig } from '@geekmidas/cli/config';
272
+ *
273
+ * export default defineConfig({
274
+ * routes: './src/endpoints/**\/*.ts',
275
+ * envParser: './src/config/env',
276
+ * logger: './src/config/logger',
277
+ * telescope: true,
278
+ * });
279
+ * ```
280
+ */
281
+ function defineConfig(config) {
282
+ return config;
283
+ }
284
+ /**
285
+ * Parse a module config string into path and import pattern.
286
+ *
287
+ * @param configString - Config string in format "./path/to/module" or "./path/to/module#exportName"
288
+ * @param defaultAlias - The default alias name to use if no export name specified
289
+ * @returns Object with path and import pattern
290
+ *
291
+ * @example
292
+ * parseModuleConfig('./src/config/env', 'envParser')
293
+ * // { path: './src/config/env', importPattern: 'envParser' }
294
+ *
295
+ * parseModuleConfig('./src/config/env#envParser', 'envParser')
296
+ * // { path: './src/config/env', importPattern: '{ envParser }' }
297
+ *
298
+ * parseModuleConfig('./src/config/env#myEnv', 'envParser')
299
+ * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }
300
+ */
301
+ function parseModuleConfig(configString, defaultAlias) {
302
+ const parts = configString.split("#");
303
+ const path = parts[0] ?? configString;
304
+ const exportName = parts[1];
305
+ return {
306
+ path,
307
+ importPattern: !exportName ? defaultAlias : exportName === defaultAlias ? `{ ${defaultAlias} }` : `{ ${exportName} as ${defaultAlias} }`
308
+ };
309
+ }
310
+ /**
311
+ * Find and return the path to the config file.
312
+ *
313
+ * Resolution order:
314
+ * 1. GKM_CONFIG_PATH env var (set by workspace dev command)
315
+ * 2. Walk up directory tree from cwd
316
+ */
317
+ function findConfigPath(cwd) {
318
+ const files = [
319
+ "gkm.config.json",
320
+ "gkm.config.ts",
321
+ "gkm.config.js"
322
+ ];
323
+ const envConfigPath = process.env.GKM_CONFIG_PATH;
324
+ if (envConfigPath && (0, node_fs.existsSync)(envConfigPath)) return {
325
+ configPath: envConfigPath,
326
+ workspaceRoot: (0, node_path.dirname)(envConfigPath)
327
+ };
328
+ let currentDir = cwd;
329
+ const { root } = (0, node_path.parse)(currentDir);
330
+ while (currentDir !== root) {
331
+ for (const file of files) {
332
+ const configPath = (0, node_path.join)(currentDir, file);
333
+ if ((0, node_fs.existsSync)(configPath)) return {
334
+ configPath,
335
+ workspaceRoot: currentDir
336
+ };
337
+ }
338
+ currentDir = (0, node_path.dirname)(currentDir);
339
+ }
340
+ throw new ConfigNotFound(cwd);
341
+ }
342
+ /**
343
+ * The directory holding the gkm config that `cwd` belongs to — the project a
344
+ * sandbox for it is confined to.
345
+ *
346
+ * @throws {ConfigNotFound} when neither `cwd` nor any parent has one.
347
+ */
348
+ function findWorkspaceRoot(cwd) {
349
+ return findConfigPath(cwd).workspaceRoot;
350
+ }
351
+ /** No gkm config in a directory or any of its parents. */
352
+ var ConfigNotFound = class extends require_errors.GkmError {
353
+ cwd;
354
+ constructor(cwd) {
355
+ super("Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.");
356
+ this.cwd = cwd;
357
+ this.name = "ConfigNotFound";
358
+ }
359
+ };
360
+ /**
361
+ * How long loading a config, or discovering its constructs, may take in a
362
+ * sandbox: room for tsx to compile a large project cold, and not a deploy
363
+ * held open by a config that never finishes importing.
364
+ */
365
+ const CONFIG_LOAD_TIMEOUT_MS = 6e4;
366
+ /** The config failed to import, or threw while it ran. */
367
+ var ConfigLoadFailed = class extends Error {
368
+ configPath;
369
+ detail;
370
+ constructor(configPath, detail) {
371
+ super(`Failed to load config: ${detail}`);
372
+ this.configPath = configPath;
373
+ this.detail = detail;
374
+ this.name = "ConfigLoadFailed";
375
+ }
376
+ };
377
+ /**
378
+ * The config holds something that is not data — a custom state store, an
379
+ * inline deploy target, a function — and the sandbox it was loaded in hands
380
+ * the deploy nothing but data.
381
+ */
382
+ var ConfigObjectNotSerializable = class extends Error {
383
+ configPath;
384
+ paths;
385
+ constructor(configPath, paths) {
386
+ super(`${configPath} holds values that are not plain data at: ${paths.join(", ")}. It was loaded in an isolating sandbox, which hands the deploy the config as JSON, so a live object — a custom store, an inline target, a function — cannot reach it. Configure these with plain values instead, or deploy this project with a sandbox that is not isolating (the default) if the host trusts it.`);
387
+ this.configPath = configPath;
388
+ this.paths = paths;
389
+ this.name = "ConfigObjectNotSerializable";
390
+ }
391
+ };
392
+ /** What the config worker answers. Checked: the worker ran project code. */
393
+ const ConfigAnswer = require_schemas.discriminatedUnion("reason", [
394
+ require_schemas.object({
395
+ reason: require_schemas.literal("loaded"),
396
+ config: require_schemas.record(require_schemas.string(), require_schemas.unknown())
397
+ }),
398
+ require_schemas.object({
399
+ reason: require_schemas.literal("live"),
400
+ paths: require_schemas.array(require_schemas.string())
401
+ }),
402
+ require_schemas.object({
403
+ reason: require_schemas.literal("failed"),
404
+ error: require_schemas.object({
405
+ name: require_schemas.string(),
406
+ message: require_schemas.string()
407
+ })
408
+ })
409
+ ]);
410
+ /** Import the config in this process — live objects and all. */
411
+ async function importConfig(configPath) {
412
+ try {
413
+ return (await import(configPath)).default;
414
+ } catch (error) {
415
+ throw new ConfigLoadFailed(configPath, error.message);
416
+ }
417
+ }
418
+ /**
419
+ * The config, loaded in `sandbox` and handed back as JSON.
420
+ *
421
+ * A config holding live objects cannot come back that way. An isolating
422
+ * sandbox refuses it with {@link ConfigObjectNotSerializable}; any other
423
+ * imports it here as well, as before, since the host already runs this
424
+ * project's code as its own.
425
+ */
426
+ async function loadConfigInSandbox(sandbox, configPath, workspaceRoot, timeoutMs = CONFIG_LOAD_TIMEOUT_MS) {
427
+ const { value } = await require_discover.runWorker(sandbox, "config load", {
428
+ name: "config-worker",
429
+ args: [configPath],
430
+ cwd: workspaceRoot,
431
+ timeoutMs,
432
+ schema: ConfigAnswer
433
+ });
434
+ switch (value.reason) {
435
+ case "loaded": return value.config;
436
+ case "failed": throw new ConfigLoadFailed(configPath, value.error.message);
437
+ case "live":
438
+ if (sandbox.isolating) throw new ConfigObjectNotSerializable(configPath, value.paths);
439
+ return importConfig(configPath);
440
+ }
441
+ }
442
+ const loadedRun = new node_async_hooks.AsyncLocalStorage();
443
+ /**
444
+ * Run `fn` with `config` as the config of the workspace at `workspaceRoot`:
445
+ * every load of it inside — however deep, sandboxed or not — answers with
446
+ * this one rather than importing the file again.
447
+ *
448
+ * A config is the workspace's settings, and settings may come from the
449
+ * environment it was loaded in (`domains: { prod: process.env.DOMAIN }`). A
450
+ * reload in a sandbox, which passes on an allowlist of the environment, read
451
+ * the same file to a different answer: the deploy saw no domain the command
452
+ * had been given. Loaded once by the caller, every step of the run sees the
453
+ * same settings. The constructs are still discovered in the run's sandbox.
454
+ */
455
+ function withLoadedConfig(workspaceRoot, config, fn) {
456
+ return loadedRun.run({
457
+ workspaceRoot: (0, node_path.resolve)(workspaceRoot),
458
+ config
459
+ }, fn);
460
+ }
461
+ /**
462
+ * The raw config of the workspace a directory belongs to, imported in this
463
+ * process: what a caller hands {@link withLoadedConfig}, or `deploy()` as its
464
+ * `config`.
465
+ */
466
+ async function loadRawWorkspaceConfig(cwd = process.cwd()) {
467
+ const { configPath, workspaceRoot } = findConfigPath(cwd);
468
+ return {
469
+ config: await importConfig(configPath),
470
+ workspaceRoot
471
+ };
472
+ }
473
+ /**
474
+ * Load raw configuration from file.
475
+ */
476
+ async function loadRawConfig(cwd, options = {}) {
477
+ const { configPath, workspaceRoot } = findConfigPath(cwd);
478
+ const loaded = loadedRun.getStore();
479
+ if (loaded && loaded.workspaceRoot === (0, node_path.resolve)(workspaceRoot)) return {
480
+ config: loaded.config,
481
+ workspaceRoot
482
+ };
483
+ const sandbox = options.sandbox ?? require_discover.activeSandbox();
484
+ return {
485
+ config: sandbox ? await loadConfigInSandbox(sandbox, configPath, workspaceRoot, options.timeoutMs) : await importConfig(configPath),
486
+ workspaceRoot
487
+ };
488
+ }
489
+ /**
490
+ * Load configuration file (single-app format).
491
+ * For backwards compatibility with existing code.
492
+ *
493
+ * @deprecated Use loadWorkspaceConfig for new code
494
+ */
495
+ async function loadConfig(cwd = process.cwd()) {
496
+ const { config } = await loadRawConfig(cwd);
497
+ if (require_workspace.isWorkspaceConfig(config)) throw new Error("Workspace configuration detected. Use loadWorkspaceConfig() instead.");
498
+ return config;
499
+ }
500
+ /**
501
+ * Load configuration file and process it as a workspace.
502
+ * Works with both single-app and workspace configurations.
503
+ *
504
+ * Single-app configs are automatically wrapped as a workspace with one app.
505
+ *
506
+ * @example
507
+ * ```ts
508
+ * const { type, workspace } = await loadWorkspaceConfig();
509
+ *
510
+ * if (type === 'workspace') {
511
+ * console.log('Multi-app workspace:', workspace.apps);
512
+ * } else {
513
+ * console.log('Single app wrapped as workspace');
514
+ * }
515
+ * ```
516
+ */
517
+ /**
518
+ * The workspace a directory belongs to, as its config states it — without
519
+ * discovering its constructs.
520
+ *
521
+ * For callers that need a fact the config holds (where a stage's secrets are
522
+ * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
523
+ * construct module to derive the apps, which is a cost a secrets read should
524
+ * not pay.
525
+ */
526
+ async function loadWorkspaceSettings(cwd = process.cwd(), options = {}) {
527
+ const { config, workspaceRoot } = await loadRawConfig(cwd, options);
528
+ return require_workspace.processConfig(config, workspaceRoot).workspace;
529
+ }
530
+ async function loadWorkspaceConfig(cwd = process.cwd(), options = {}) {
531
+ const { config, workspaceRoot } = await loadRawConfig(cwd, options);
532
+ return withDerivedApps(require_workspace.processConfig(config, workspaceRoot), options.sandbox);
533
+ }
534
+ /**
535
+ * The loaded config, with its apps read off the graph.
536
+ *
537
+ * Here rather than at each call site because every command needs the same
538
+ * answer, and the ones that forgot to ask were exactly the bugs: a site that
539
+ * never deployed, a surface that could not be its own process. `gkm dev`,
540
+ * `gkm build`, `gkm docker` and `gkm deploy` now all see the same apps without
541
+ * any of them knowing a derivation happened.
542
+ *
543
+ * Discovery imports the construct modules — declarations only, not endpoints —
544
+ * which is the same import the reconciler and the build already do. A workspace
545
+ * with no `constructs` glob discovers nothing and keeps whatever its config
546
+ * said, so nothing that worked before changes.
547
+ *
548
+ * A construct file that throws is reported and skipped rather than taking the
549
+ * command down: `gkm dev` failing to start because a half-written declaration
550
+ * cannot be imported is a worse failure than starting with the app it does not
551
+ * describe yet.
552
+ */
553
+ async function withDerivedApps(loaded, sandbox) {
554
+ const globs = require_workspace.allConstructGlobs(loaded.workspace);
555
+ if (globs.length === 0) throw new WorkspaceDeclaresNoConstructs(loaded.workspace.root);
556
+ try {
557
+ const background = {};
558
+ const manifest = await require_discover.discover({
559
+ patterns: globs,
560
+ cwd: loaded.workspace.root,
561
+ background,
562
+ ...sandbox ? { sandbox } : {}
563
+ });
564
+ return {
565
+ ...loaded,
566
+ manifest,
567
+ background,
568
+ workspace: {
569
+ ...loaded.workspace,
570
+ apps: derivedApps(manifest, loaded.workspace)
571
+ }
572
+ };
573
+ } catch (error) {
574
+ const message = error instanceof Error ? error.message : String(error);
575
+ require_discover.output.warn(`⚠️ Could not read constructs, so apps come from config alone: ${message}`);
576
+ return loaded;
577
+ }
578
+ }
579
+ /**
580
+ * A workspace with no `constructs` glob.
581
+ *
582
+ * In v10 every address, container and app comes from what the workspace
583
+ * declares — there is no second path that reads a hand-written compose file or
584
+ * an `apps` block's ports. A config that declares nothing has nothing to run.
585
+ */
586
+ var WorkspaceDeclaresNoConstructs = class extends require_errors.GkmError {
587
+ root;
588
+ constructor(root) {
589
+ super(`The workspace at ${root} declares no constructs. Every workspace names where its constructs live — \`constructs: ['./constructs/**/*.ts', './apps/*/endpoints/**/*.ts']\` in gkm.config.ts — and its apps, containers and URLs are derived from them.`);
590
+ this.root = root;
591
+ this.name = "WorkspaceDeclaresNoConstructs";
592
+ }
593
+ };
594
+ /**
595
+ * The app a directory is part of: the one whose `path` contains it.
596
+ *
597
+ * An app's path is the one its construct declares — `new RestApi('Api',
598
+ * { path: 'apps/api' })` — read off the workspace the constructs were derived
599
+ * into, never off the filesystem's package names. The deepest match wins, so
600
+ * an app inside another app's folder is its own; the workspace root belongs to
601
+ * no app unless one lives there.
602
+ */
603
+ function resolveWorkspaceApp(loadedConfig, cwd) {
604
+ const here = real(cwd);
605
+ let found;
606
+ for (const [key, app] of Object.entries(loadedConfig.workspace.apps)) {
607
+ const dir = real((0, node_path.join)(loadedConfig.workspace.root, app.path));
608
+ if ((here === dir || here.startsWith(`${dir}${node_path.sep}`)) && (!found || dir.length > found.dir.length)) found = {
609
+ key,
610
+ app,
611
+ dir
612
+ };
613
+ }
614
+ return found && {
615
+ key: found.key,
616
+ app: found.app
617
+ };
618
+ }
619
+ /** A path with its symlinks resolved, where it exists — `/tmp` is `/private/tmp`. */
620
+ function real(path) {
621
+ const absolute = (0, node_path.resolve)(path);
622
+ return (0, node_fs.existsSync)(absolute) ? (0, node_fs.realpathSync)(absolute) : absolute;
623
+ }
624
+ /** A directory that no app in the workspace lives in. */
625
+ var NotInAnApp = class extends require_errors.GkmError {
626
+ cwd;
627
+ apps;
628
+ constructor(cwd, apps) {
629
+ super(`${cwd} is not inside any app's path. Apps: ` + Object.entries(apps).map(([key, path]) => `${key} (${path})`).join(", ") + ".");
630
+ this.cwd = cwd;
631
+ this.apps = apps;
632
+ this.name = "NotInAnApp";
633
+ }
634
+ };
635
+ /** Every app's path, by key — what `NotInAnApp` lists. */
636
+ function appPaths(loadedConfig) {
637
+ return Object.fromEntries(Object.entries(loadedConfig.workspace.apps).map(([key, app]) => [key, app.path]));
638
+ }
639
+ /**
640
+ * The backend app a directory is part of, with its gkm config — found by the
641
+ * `path` its construct declares.
642
+ *
643
+ * @example
644
+ * ```ts
645
+ * // From apps/api, where a construct declares `path: 'apps/api'`
646
+ * const { app, workspace, workspaceRoot } = await loadAppConfig();
647
+ * ```
648
+ *
649
+ * @throws {NotInAnApp} when no app's path contains the directory.
650
+ * @throws {NotABackendApp} when the app it is in has no gkm config to run.
651
+ */
652
+ async function loadAppConfig(cwd = process.cwd()) {
653
+ const { appName, app, workspace, workspaceRoot } = await loadWorkspaceAppInfo(cwd);
654
+ const gkmConfig = require_workspace.getAppGkmConfig(workspace, appName);
655
+ if (!gkmConfig) throw new NotABackendApp(appName);
656
+ return {
657
+ appName,
658
+ app,
659
+ gkmConfig,
660
+ workspace,
661
+ workspaceRoot,
662
+ appRoot: (0, node_path.join)(workspaceRoot, app.path)
663
+ };
664
+ }
665
+ /** The app a directory is in has no gkm config — a site, or an entry app. */
666
+ var NotABackendApp = class extends require_errors.GkmError {
667
+ appName;
668
+ constructor(appName) {
669
+ super(`App "${appName}" is not a backend app and cannot be run with gkm dev.`);
670
+ this.appName = appName;
671
+ this.name = "NotABackendApp";
672
+ }
673
+ };
674
+ /**
675
+ * The app a directory is part of, frontend or backend — found by the `path`
676
+ * its construct declares. Unlike `loadAppConfig`, the app need not have a
677
+ * gkm config, which is what `gkm exec` and `gkm test` from a site need.
678
+ *
679
+ * @throws {NotInAnApp} when no app's path contains the directory.
680
+ */
681
+ async function loadWorkspaceAppInfo(cwd = process.cwd()) {
682
+ const { config, workspaceRoot } = await loadRawConfig(cwd);
683
+ const loadedConfig = await withDerivedApps(require_workspace.processConfig(config, workspaceRoot));
684
+ const resolved = resolveWorkspaceApp(loadedConfig, cwd);
685
+ if (!resolved) throw new NotInAnApp(cwd, appPaths(loadedConfig));
686
+ return {
687
+ appName: resolved.key,
688
+ app: resolved.app,
689
+ workspace: loadedConfig.workspace,
690
+ workspaceRoot
691
+ };
692
+ }
693
+ //#endregion
694
+ Object.defineProperty(exports, "CONFIG_LOAD_TIMEOUT_MS", {
695
+ enumerable: true,
696
+ get: function() {
697
+ return CONFIG_LOAD_TIMEOUT_MS;
698
+ }
699
+ });
700
+ Object.defineProperty(exports, "ConfigLoadFailed", {
701
+ enumerable: true,
702
+ get: function() {
703
+ return ConfigLoadFailed;
704
+ }
705
+ });
706
+ Object.defineProperty(exports, "ConfigNotFound", {
707
+ enumerable: true,
708
+ get: function() {
709
+ return ConfigNotFound;
710
+ }
711
+ });
712
+ Object.defineProperty(exports, "ConfigObjectNotSerializable", {
713
+ enumerable: true,
714
+ get: function() {
715
+ return ConfigObjectNotSerializable;
716
+ }
717
+ });
718
+ Object.defineProperty(exports, "NotABackendApp", {
719
+ enumerable: true,
720
+ get: function() {
721
+ return NotABackendApp;
722
+ }
723
+ });
724
+ Object.defineProperty(exports, "NotInAnApp", {
725
+ enumerable: true,
726
+ get: function() {
727
+ return NotInAnApp;
728
+ }
729
+ });
730
+ Object.defineProperty(exports, "WorkspaceDeclaresNoConstructs", {
731
+ enumerable: true,
732
+ get: function() {
733
+ return WorkspaceDeclaresNoConstructs;
734
+ }
735
+ });
736
+ Object.defineProperty(exports, "appKey", {
737
+ enumerable: true,
738
+ get: function() {
739
+ return appKey;
740
+ }
741
+ });
742
+ Object.defineProperty(exports, "defineConfig", {
743
+ enumerable: true,
744
+ get: function() {
745
+ return defineConfig;
746
+ }
747
+ });
748
+ Object.defineProperty(exports, "derivedApps", {
749
+ enumerable: true,
750
+ get: function() {
751
+ return derivedApps;
752
+ }
753
+ });
754
+ Object.defineProperty(exports, "findWorkspaceRoot", {
755
+ enumerable: true,
756
+ get: function() {
757
+ return findWorkspaceRoot;
758
+ }
759
+ });
760
+ Object.defineProperty(exports, "loadAppConfig", {
761
+ enumerable: true,
762
+ get: function() {
763
+ return loadAppConfig;
764
+ }
765
+ });
766
+ Object.defineProperty(exports, "loadConfig", {
767
+ enumerable: true,
768
+ get: function() {
769
+ return loadConfig;
770
+ }
771
+ });
772
+ Object.defineProperty(exports, "loadRawWorkspaceConfig", {
773
+ enumerable: true,
774
+ get: function() {
775
+ return loadRawWorkspaceConfig;
776
+ }
777
+ });
778
+ Object.defineProperty(exports, "loadWorkspaceAppInfo", {
779
+ enumerable: true,
780
+ get: function() {
781
+ return loadWorkspaceAppInfo;
782
+ }
783
+ });
784
+ Object.defineProperty(exports, "loadWorkspaceConfig", {
785
+ enumerable: true,
786
+ get: function() {
787
+ return loadWorkspaceConfig;
788
+ }
789
+ });
790
+ Object.defineProperty(exports, "loadWorkspaceSettings", {
791
+ enumerable: true,
792
+ get: function() {
793
+ return loadWorkspaceSettings;
794
+ }
795
+ });
796
+ Object.defineProperty(exports, "parseModuleConfig", {
797
+ enumerable: true,
798
+ get: function() {
799
+ return parseModuleConfig;
800
+ }
801
+ });
802
+ Object.defineProperty(exports, "protectedSubdomains", {
803
+ enumerable: true,
804
+ get: function() {
805
+ return protectedSubdomains;
806
+ }
807
+ });
808
+ Object.defineProperty(exports, "wildcardSite", {
809
+ enumerable: true,
810
+ get: function() {
811
+ return wildcardSite;
812
+ }
813
+ });
814
+ Object.defineProperty(exports, "withLoadedConfig", {
815
+ enumerable: true,
816
+ get: function() {
817
+ return withLoadedConfig;
818
+ }
819
+ });
820
+
821
+ //# sourceMappingURL=config-B5Hi3mLK.cjs.map