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

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 (438) 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-C9dDlH9I.mjs +412 -0
  11. package/dist/GoDaddyProvider-C9dDlH9I.mjs.map +1 -0
  12. package/dist/GoDaddyProvider-DkUMcMYy.cjs +412 -0
  13. package/dist/GoDaddyProvider-DkUMcMYy.cjs.map +1 -0
  14. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-9faYOQnQ.cjs} +23 -9
  15. package/dist/HostingerProvider-9faYOQnQ.cjs.map +1 -0
  16. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-BEuKG2gz.mjs} +23 -9
  17. package/dist/HostingerProvider-BEuKG2gz.mjs.map +1 -0
  18. package/dist/LegacyStateStore-C44jUnMH.cjs +124 -0
  19. package/dist/LegacyStateStore-C44jUnMH.cjs.map +1 -0
  20. package/dist/LegacyStateStore-DPKhjUR6.mjs +124 -0
  21. package/dist/LegacyStateStore-DPKhjUR6.mjs.map +1 -0
  22. package/dist/LocalStateStore-B95WE99i.cjs +178 -0
  23. package/dist/LocalStateStore-B95WE99i.cjs.map +1 -0
  24. package/dist/LocalStateStore-BU3fWkcT.mjs +167 -0
  25. package/dist/LocalStateStore-BU3fWkcT.mjs.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-Cpbeijr5.mjs +223 -0
  35. package/dist/S3StateStore-Cpbeijr5.mjs.map +1 -0
  36. package/dist/S3StateStore-zU5kClhd.cjs +222 -0
  37. package/dist/S3StateStore-zU5kClhd.cjs.map +1 -0
  38. package/dist/SSMStateStore-BxkKMBi_.mjs +205 -0
  39. package/dist/SSMStateStore-BxkKMBi_.mjs.map +1 -0
  40. package/dist/SSMStateStore-D9uviQ3T.cjs +204 -0
  41. package/dist/SSMStateStore-D9uviQ3T.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-Bb2IL3Yq.cjs +713 -0
  47. package/dist/add-Bb2IL3Yq.cjs.map +1 -0
  48. package/dist/add-Dj-gtqTO.mjs +711 -0
  49. package/dist/add-Dj-gtqTO.mjs.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-0vc4Oz9_.cjs +6247 -0
  55. package/dist/apps-0vc4Oz9_.cjs.map +1 -0
  56. package/dist/apps-FRNlECwi.mjs +5621 -0
  57. package/dist/apps-FRNlECwi.mjs.map +1 -0
  58. package/dist/aws-8QQ8n-t6.mjs +89 -0
  59. package/dist/aws-8QQ8n-t6.mjs.map +1 -0
  60. package/dist/aws-DY9NqQIT.cjs +100 -0
  61. package/dist/aws-DY9NqQIT.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-BodTL4kf.mjs → bundler-9EM4ZHcu.mjs} +59 -14
  79. package/dist/bundler-9EM4ZHcu.mjs.map +1 -0
  80. package/dist/{bundler-BeNDZdHQ.cjs → bundler-Bg2eEFEh.cjs} +59 -14
  81. package/dist/bundler-Bg2eEFEh.cjs.map +1 -0
  82. package/dist/cli-CmoSOzNq.mjs +80 -0
  83. package/dist/cli-CmoSOzNq.mjs.map +1 -0
  84. package/dist/cli-YtLjcAZT.cjs +80 -0
  85. package/dist/cli-YtLjcAZT.cjs.map +1 -0
  86. package/dist/compose-3AtZF7ul.mjs +1560 -0
  87. package/dist/compose-3AtZF7ul.mjs.map +1 -0
  88. package/dist/compose-CW1DGfYc.cjs +1919 -0
  89. package/dist/compose-CW1DGfYc.cjs.map +1 -0
  90. package/dist/compose-CnXZAYNM.mjs +3068 -0
  91. package/dist/compose-CnXZAYNM.mjs.map +1 -0
  92. package/dist/compose-D7gOSspy.cjs +3157 -0
  93. package/dist/compose-D7gOSspy.cjs.map +1 -0
  94. package/dist/config-B5Hi3mLK.cjs +821 -0
  95. package/dist/config-B5Hi3mLK.cjs.map +1 -0
  96. package/dist/config-BNmLn0dw.d.mts +291 -0
  97. package/dist/config-BNmLn0dw.d.mts.map +1 -0
  98. package/dist/config-CkuiD9Jv.d.cts +291 -0
  99. package/dist/config-CkuiD9Jv.d.cts.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-CjFtNBVH.mjs +1834 -0
  111. package/dist/credentials-CjFtNBVH.mjs.map +1 -0
  112. package/dist/credentials-DwIRfeBL.cjs +2289 -0
  113. package/dist/credentials-DwIRfeBL.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-3bsiWJxj.cjs +3925 -0
  143. package/dist/deploy-3bsiWJxj.cjs.map +1 -0
  144. package/dist/deploy-BI3fHnyb.mjs +3869 -0
  145. package/dist/deploy-BI3fHnyb.mjs.map +1 -0
  146. package/dist/discover-CRywE7yc.cjs +1085 -0
  147. package/dist/discover-CRywE7yc.cjs.map +1 -0
  148. package/dist/discover-DbDrCQ8h.mjs +940 -0
  149. package/dist/discover-DbDrCQ8h.mjs.map +1 -0
  150. package/dist/docker-CwayjAF2.cjs +1515 -0
  151. package/dist/docker-CwayjAF2.cjs.map +1 -0
  152. package/dist/docker-DPdn7tYJ.mjs +1408 -0
  153. package/dist/docker-DPdn7tYJ.mjs.map +1 -0
  154. package/dist/dokploy-BMBL-_Xu.cjs +38 -0
  155. package/dist/dokploy-BMBL-_Xu.cjs.map +1 -0
  156. package/dist/dokploy-tmnH0Du_.mjs +38 -0
  157. package/dist/dokploy-tmnH0Du_.mjs.map +1 -0
  158. package/dist/drivers-BhdC9Efj.cjs +248 -0
  159. package/dist/drivers-BhdC9Efj.cjs.map +1 -0
  160. package/dist/drivers-wcDnzf7l.mjs +213 -0
  161. package/dist/drivers-wcDnzf7l.mjs.map +1 -0
  162. package/dist/eas-BVGQAUDc.mjs +334 -0
  163. package/dist/eas-BVGQAUDc.mjs.map +1 -0
  164. package/dist/eas-meN1xady.cjs +337 -0
  165. package/dist/eas-meN1xady.cjs.map +1 -0
  166. package/dist/emit-C4KSXOeS.mjs +153 -0
  167. package/dist/emit-C4KSXOeS.mjs.map +1 -0
  168. package/dist/emit-DiW0kbue.cjs +164 -0
  169. package/dist/emit-DiW0kbue.cjs.map +1 -0
  170. package/dist/encryption-C8AMbomA.mjs +89 -0
  171. package/dist/encryption-C8AMbomA.mjs.map +1 -0
  172. package/dist/encryption-DvFVZdGz.cjs +90 -0
  173. package/dist/encryption-DvFVZdGz.cjs.map +1 -0
  174. package/dist/engine-BbWj0w3F.mjs +3217 -0
  175. package/dist/engine-BbWj0w3F.mjs.map +1 -0
  176. package/dist/engine-BmiIUVWa.cjs +3330 -0
  177. package/dist/engine-BmiIUVWa.cjs.map +1 -0
  178. package/dist/errors-D8Gwp5kU.mjs +23 -0
  179. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  180. package/dist/errors-DMC4Umsb.cjs +34 -0
  181. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  182. package/dist/github-BWqQr8q6.cjs +901 -0
  183. package/dist/github-BWqQr8q6.cjs.map +1 -0
  184. package/dist/github-Dc1daUbH.mjs +900 -0
  185. package/dist/github-Dc1daUbH.mjs.map +1 -0
  186. package/dist/googlePlay-ByaFUly7.mjs +931 -0
  187. package/dist/googlePlay-ByaFUly7.mjs.map +1 -0
  188. package/dist/googlePlay-CdVCdfU8.cjs +931 -0
  189. package/dist/googlePlay-CdVCdfU8.cjs.map +1 -0
  190. package/dist/{index-C-VLwB_Y.d.mts → index-B35vTdAW.d.cts} +38 -14
  191. package/dist/index-B35vTdAW.d.cts.map +1 -0
  192. package/dist/{index-C-HkOEBt.d.cts → index-Dv1Zj86i.d.mts} +38 -14
  193. package/dist/index-Dv1Zj86i.d.mts.map +1 -0
  194. package/dist/index.cjs +13730 -12325
  195. package/dist/index.cjs.map +1 -1
  196. package/dist/index.mjs +13771 -12364
  197. package/dist/index.mjs.map +1 -1
  198. package/dist/local-CnVFHJjS.mjs +224 -0
  199. package/dist/local-CnVFHJjS.mjs.map +1 -0
  200. package/dist/local-qevrV6dZ.cjs +241 -0
  201. package/dist/local-qevrV6dZ.cjs.map +1 -0
  202. package/dist/migrate-BEuCcCwN.mjs +267 -0
  203. package/dist/migrate-BEuCcCwN.mjs.map +1 -0
  204. package/dist/migrate-CRRps1i6.cjs +272 -0
  205. package/dist/migrate-CRRps1i6.cjs.map +1 -0
  206. package/dist/migrate-CU8_ZWP1.cjs +181 -0
  207. package/dist/migrate-CU8_ZWP1.cjs.map +1 -0
  208. package/dist/migrate-DgfKZB41.mjs +181 -0
  209. package/dist/migrate-DgfKZB41.mjs.map +1 -0
  210. package/dist/notes-BrBnyZz5.cjs +500 -0
  211. package/dist/notes-BrBnyZz5.cjs.map +1 -0
  212. package/dist/notes-CIzrdBKE.mjs +399 -0
  213. package/dist/notes-CIzrdBKE.mjs.map +1 -0
  214. package/dist/openapi.cjs +213 -7
  215. package/dist/openapi.cjs.map +1 -0
  216. package/dist/openapi.d.cts +32 -8
  217. package/dist/openapi.d.cts.map +1 -1
  218. package/dist/openapi.d.mts +32 -8
  219. package/dist/openapi.d.mts.map +1 -1
  220. package/dist/openapi.mjs +208 -2
  221. package/dist/openapi.mjs.map +1 -0
  222. package/dist/projectBucket-CDJd3prK.mjs +222 -0
  223. package/dist/projectBucket-CDJd3prK.mjs.map +1 -0
  224. package/dist/projectBucket-CKr_zObJ.cjs +263 -0
  225. package/dist/projectBucket-CKr_zObJ.cjs.map +1 -0
  226. package/dist/provider-BqpjG9QM.cjs +57 -0
  227. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  228. package/dist/provider-CEOKk8NS.mjs +46 -0
  229. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  230. package/dist/publish-Bq96_QnK.mjs +123 -0
  231. package/dist/publish-Bq96_QnK.mjs.map +1 -0
  232. package/dist/publish-DMKXh1Tb.cjs +124 -0
  233. package/dist/publish-DMKXh1Tb.cjs.map +1 -0
  234. package/dist/ready-BjFMu_1J.mjs +375 -0
  235. package/dist/ready-BjFMu_1J.mjs.map +1 -0
  236. package/dist/ready-eVMJIcWn.cjs +404 -0
  237. package/dist/ready-eVMJIcWn.cjs.map +1 -0
  238. package/dist/reconcile/public.cjs +3 -5
  239. package/dist/reconcile/public.d.cts +33 -89
  240. package/dist/reconcile/public.d.cts.map +1 -1
  241. package/dist/reconcile/public.d.mts +33 -89
  242. package/dist/reconcile/public.d.mts.map +1 -1
  243. package/dist/reconcile/public.mjs +3 -3
  244. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  245. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  246. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  247. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  248. package/dist/resolve-CSsE7frp.mjs +263 -0
  249. package/dist/resolve-CSsE7frp.mjs.map +1 -0
  250. package/dist/resolve-DF9GrosZ.cjs +316 -0
  251. package/dist/resolve-DF9GrosZ.cjs.map +1 -0
  252. package/dist/rollback-BBFGGmMa.cjs +165 -0
  253. package/dist/rollback-BBFGGmMa.cjs.map +1 -0
  254. package/dist/rollback-CZthwqus.mjs +136 -0
  255. package/dist/rollback-CZthwqus.mjs.map +1 -0
  256. package/dist/runtime-CFvcLEJW.d.cts +82 -0
  257. package/dist/runtime-CFvcLEJW.d.cts.map +1 -0
  258. package/dist/runtime-dwsH6ddo.d.mts +82 -0
  259. package/dist/runtime-dwsH6ddo.d.mts.map +1 -0
  260. package/dist/s3-BBRkezf7.mjs +215 -0
  261. package/dist/s3-BBRkezf7.mjs.map +1 -0
  262. package/dist/s3-CI2QYgXH.cjs +215 -0
  263. package/dist/s3-CI2QYgXH.cjs.map +1 -0
  264. package/dist/sandbox/config-worker.cjs +43 -0
  265. package/dist/sandbox/config-worker.cjs.map +1 -0
  266. package/dist/sandbox/config-worker.d.cts +1 -0
  267. package/dist/sandbox/config-worker.d.mts +1 -0
  268. package/dist/sandbox/config-worker.mjs +44 -0
  269. package/dist/sandbox/config-worker.mjs.map +1 -0
  270. package/dist/sandbox/credentials-worker.cjs +53 -0
  271. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  272. package/dist/sandbox/credentials-worker.d.cts +1 -0
  273. package/dist/sandbox/credentials-worker.d.mts +1 -0
  274. package/dist/sandbox/credentials-worker.mjs +54 -0
  275. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  276. package/dist/sandbox/discover-worker.cjs +47 -0
  277. package/dist/sandbox/discover-worker.cjs.map +1 -0
  278. package/dist/sandbox/discover-worker.d.cts +1 -0
  279. package/dist/sandbox/discover-worker.d.mts +1 -0
  280. package/dist/sandbox/discover-worker.mjs +48 -0
  281. package/dist/sandbox/discover-worker.mjs.map +1 -0
  282. package/dist/sandbox/migrate-worker.cjs +75 -0
  283. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  284. package/dist/sandbox/migrate-worker.d.cts +1 -0
  285. package/dist/sandbox/migrate-worker.d.mts +1 -0
  286. package/dist/sandbox/migrate-worker.mjs +76 -0
  287. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  288. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  289. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  290. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  291. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  292. package/dist/secretsManager-CQORubp9.mjs +97 -0
  293. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  294. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  295. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  296. package/dist/seeds-B3xvUAQf.cjs +363 -0
  297. package/dist/seeds-B3xvUAQf.cjs.map +1 -0
  298. package/dist/seeds-BCC8vAXR.mjs +298 -0
  299. package/dist/seeds-BCC8vAXR.mjs.map +1 -0
  300. package/dist/serverSetup-C4iAABtI.mjs +685 -0
  301. package/dist/serverSetup-C4iAABtI.mjs.map +1 -0
  302. package/dist/serverSetup-Dt2DTlwa.cjs +685 -0
  303. package/dist/serverSetup-Dt2DTlwa.cjs.map +1 -0
  304. package/dist/sniffer-C2Ot1IbK.mjs +1824 -0
  305. package/dist/sniffer-C2Ot1IbK.mjs.map +1 -0
  306. package/dist/sniffer-bTrGuu9z.cjs +1997 -0
  307. package/dist/sniffer-bTrGuu9z.cjs.map +1 -0
  308. package/dist/snsSubscriptions-CFKb7fv0.cjs +1173 -0
  309. package/dist/snsSubscriptions-CFKb7fv0.cjs.map +1 -0
  310. package/dist/snsSubscriptions-QDDDn9Qi.mjs +1048 -0
  311. package/dist/snsSubscriptions-QDDDn9Qi.mjs.map +1 -0
  312. package/dist/sst-DDRWlXdv.mjs +478 -0
  313. package/dist/sst-DDRWlXdv.mjs.map +1 -0
  314. package/dist/sst-iRdMlGKd.cjs +501 -0
  315. package/dist/sst-iRdMlGKd.cjs.map +1 -0
  316. package/dist/stack-B9iDYMrq.cjs +2431 -0
  317. package/dist/stack-B9iDYMrq.cjs.map +1 -0
  318. package/dist/stack-CIOY44aC.mjs +2256 -0
  319. package/dist/stack-CIOY44aC.mjs.map +1 -0
  320. package/dist/stage-DA74aD_V.mjs +302 -0
  321. package/dist/stage-DA74aD_V.mjs.map +1 -0
  322. package/dist/stage-ycFS9mVn.cjs +313 -0
  323. package/dist/stage-ycFS9mVn.cjs.map +1 -0
  324. package/dist/stages-B0yOikgt.cjs +190 -0
  325. package/dist/stages-B0yOikgt.cjs.map +1 -0
  326. package/dist/stages-yA9bhStl.mjs +190 -0
  327. package/dist/stages-yA9bhStl.mjs.map +1 -0
  328. package/dist/target/public.cjs +15 -0
  329. package/dist/target/public.d.cts +28 -0
  330. package/dist/target/public.d.cts.map +1 -0
  331. package/dist/target/public.d.mts +28 -0
  332. package/dist/target/public.d.mts.map +1 -0
  333. package/dist/target/public.mjs +4 -0
  334. package/dist/terminal-DX22WLvT.mjs +85 -0
  335. package/dist/terminal-DX22WLvT.mjs.map +1 -0
  336. package/dist/terminal-RxfbNUwl.cjs +85 -0
  337. package/dist/terminal-RxfbNUwl.cjs.map +1 -0
  338. package/dist/types-Bl_CwZC9.cjs +90 -0
  339. package/dist/types-Bl_CwZC9.cjs.map +1 -0
  340. package/dist/{types-kvBQjpPo.d.mts → types-Dk--xVOT.d.cts} +2159 -364
  341. package/dist/types-Dk--xVOT.d.cts.map +1 -0
  342. package/dist/{types-RhXmHR-e.d.cts → types-DwQYpd_0.d.mts} +2157 -364
  343. package/dist/types-DwQYpd_0.d.mts.map +1 -0
  344. package/dist/types-Y1NfWlyG.mjs +61 -0
  345. package/dist/types-Y1NfWlyG.mjs.map +1 -0
  346. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  347. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  348. package/dist/utils-D_fxUqvU.mjs +156 -0
  349. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  350. package/dist/vitest.cjs +65 -0
  351. package/dist/vitest.cjs.map +1 -0
  352. package/dist/vitest.d.cts +29 -0
  353. package/dist/vitest.d.cts.map +1 -0
  354. package/dist/vitest.d.mts +29 -0
  355. package/dist/vitest.d.mts.map +1 -0
  356. package/dist/vitest.mjs +65 -0
  357. package/dist/vitest.mjs.map +1 -0
  358. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  359. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  360. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  361. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  362. package/dist/workspace/index.cjs +6 -2
  363. package/dist/workspace/index.d.cts +3 -3
  364. package/dist/workspace/index.d.mts +3 -3
  365. package/dist/workspace/index.mjs +2 -2
  366. package/dist/workspace-1szcahj9.cjs +2916 -0
  367. package/dist/workspace-1szcahj9.cjs.map +1 -0
  368. package/dist/workspace-DFGsrjGD.mjs +2480 -0
  369. package/dist/workspace-DFGsrjGD.mjs.map +1 -0
  370. package/package.json +65 -13
  371. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  372. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  373. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  374. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  375. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  376. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  377. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  378. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  379. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  380. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  381. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  382. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  383. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  384. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  385. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  386. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  387. package/dist/config-Q1rvKHvw.cjs +0 -467
  388. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  389. package/dist/config-pqGD3hF9.mjs +0 -414
  390. package/dist/config-pqGD3hF9.mjs.map +0 -1
  391. package/dist/config.d.cts.map +0 -1
  392. package/dist/config.d.mts.map +0 -1
  393. package/dist/credentials-BekkKtY_.mjs +0 -2780
  394. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  395. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  396. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  397. package/dist/discover-BERGFg8v.cjs +0 -288
  398. package/dist/discover-BERGFg8v.cjs.map +0 -1
  399. package/dist/discover-CK-n3w6b.mjs +0 -244
  400. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  401. package/dist/emit-BdoPFjZf.cjs +0 -253
  402. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  403. package/dist/emit-Bzq7JsMP.mjs +0 -224
  404. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  405. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  406. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  407. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  408. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  409. package/dist/generator-LfZU7NlU.mjs +0 -247
  410. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  411. package/dist/generator-Wdfp0jCS.cjs +0 -282
  412. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  413. package/dist/github-BfflNPVe.cjs +0 -203
  414. package/dist/github-BfflNPVe.cjs.map +0 -1
  415. package/dist/github-CRwnxKmD.mjs +0 -203
  416. package/dist/github-CRwnxKmD.mjs.map +0 -1
  417. package/dist/index-C-HkOEBt.d.cts.map +0 -1
  418. package/dist/index-C-VLwB_Y.d.mts.map +0 -1
  419. package/dist/keystore-B4PRlbgE.mjs +0 -81
  420. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  421. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  422. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  423. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  424. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  425. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  426. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  427. package/dist/storage-C-30BD1e.cjs +0 -272
  428. package/dist/storage-C-30BD1e.cjs.map +0 -1
  429. package/dist/storage-P_b3w7uj.mjs +0 -231
  430. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  431. package/dist/sync-B3xxXtJT.mjs +0 -88
  432. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  433. package/dist/sync-D7uTIIEi.cjs +0 -111
  434. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  435. package/dist/types-RhXmHR-e.d.cts.map +0 -1
  436. package/dist/types-kvBQjpPo.d.mts.map +0 -1
  437. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  438. package/dist/workspace-mFpI_ky_.cjs.map +0 -1
@@ -1,107 +1,51 @@
1
- import { n as EmailBackend, t as CacheBackend } from "../types-kvBQjpPo.mjs";
2
- import { ConstructManifest, Declaration, RouteInfo } from "@geekmidas/manifest";
3
- //#region src/reconcile/discover.d.ts
4
- /** The construct face discovery needs: an id, and the ability to declare. */
5
- interface Declarable {
6
- id: string;
7
- declare(): Declaration[];
8
- }
9
- /**
10
- * Whether a module export is a construct.
11
- *
12
- * Deliberately loose about what else it carries — a construct that also has a
13
- * `service` is still a construct, and requiring one would exclude the kinds that
14
- * own no address.
15
- */
16
- export declare function isDeclarable(value: unknown): value is Declarable;
17
- interface DiscoverOptions {
18
- /** The glob(s) to search. One pattern, not one per kind. */
19
- patterns: string | readonly string[];
20
- cwd?: string;
21
- /**
22
- * Re-import changed modules, for the dev watcher.
23
- *
24
- * A single glob makes discovery more central, not less: a new construct file
25
- * has to be picked up on `add`, not only on `change`.
26
- */
27
- bustCache?: boolean;
28
- /**
29
- * Filled in with where each construct was found, when provided.
30
- *
31
- * Discovery is the only thing that knows: it globbed the files and imported
32
- * them. Everything downstream that needs to *write* an import — the build,
33
- * generating a server entry that reads a surface's logger — would otherwise
34
- * have to be told the path in config, which is the string this removes.
35
- *
36
- * An out-parameter rather than a second return value so that every existing
37
- * caller, which wants the manifest and nothing else, is unchanged.
38
- */
39
- sources?: Record<string, ConstructSource>;
40
- }
41
- /** Where a construct was declared, and under what name. */
42
- interface ConstructSource {
43
- /** Absolute path to the module that exported it. */
44
- file: string;
45
- /** The name it was exported as — what an import statement has to say. */
46
- exportName: string;
47
- }
48
- /**
49
- * Build the construct manifest for a project.
50
- *
51
- * Runs the manifest's own validation before returning, so an app is wrong here
52
- * — where the error names a file — rather than at deploy.
53
- *
54
- * @throws {DuplicateConstruct} when two exports claim one id.
55
- */
56
- export declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
57
- //#endregion
1
+ import { Ct as DiscoverOptions, Tt as isDeclarable, n as EmailBackend, t as CacheBackend, wt as discover } from "../types-DwQYpd_0.mjs";
2
+ import { ConstructManifest, CronInfo, FunctionInfo, ProcessorInfo, QueueInfo, RouteInfo, SubscriberInfo, WebSocketRouteInfo } from "@geekmidas/manifest";
58
3
  //#region src/reconcile/emit.d.ts
59
- /** Where the build writes it, relative to the app root. */
60
- export declare const MANIFEST_PATH = ".gkm/manifest.ts";
4
+ /** What a build generated: the entry each handler was written to. */
5
+ interface GeneratedHandlers {
6
+ /** Each route, with the surface the app that generated it serves. */
7
+ routes?: readonly (RouteInfo & {
8
+ surface?: string;
9
+ })[];
10
+ functions?: readonly FunctionInfo[];
11
+ crons?: readonly CronInfo[];
12
+ queues?: readonly QueueInfo[];
13
+ subscribers?: readonly SubscriberInfo[];
14
+ processors?: readonly ProcessorInfo[];
15
+ /** A WebSocket surface's routes, each the Lambda API Gateway invokes. */
16
+ websocketRoutes?: readonly WebSocketRouteInfo[];
17
+ }
61
18
  /**
62
- * Fold the build's generated routes into the surface that serves them.
63
- *
64
- * The routes already exist: `gkm build` generates one handler per endpoint and
65
- * records its path, method and environment. What was missing is that the
66
- * *construct* manifest never learned about them, so a `rest-api` node said
67
- * `endpoints: []` while five handlers sat in `.gkm/`. Two documents describing
68
- * the same routes, one of them wrong.
69
- *
70
- * Merging here rather than making the construct name a glob or import its
71
- * endpoints: the build is the thing that already walked the filesystem and
72
- * already knows where it wrote each handler. Asking the declaration to restate
73
- * any of that is how the two come to disagree.
19
+ * Point each handler discovery found at the entry the build generated for it.
74
20
  *
75
- * Attribution is by exclusion — routes go to the surface that declared none of
76
- * its own. A surface with static endpoints (an auth server's single wildcard)
77
- * keeps them. That is exact while an app has one API of its own, and needs a
78
- * real answer the day it has two; the alternative today would be inventing one
79
- * before anything needs it.
21
+ * Discovery already nested every endpoint, route, cron, function, consumer,
22
+ * subscriber and processor, with its edges — the graph is the same for every
23
+ * command. A build adds one fact: where it wrote each handler. So this
24
+ * replaces `handler` and nothing else, and a handler the build generated no
25
+ * entry of its own for keeps its source.
80
26
  *
81
- * **Only from a provider that generates one handler per route.** The `server`
82
- * provider generates a single catch-all — `ALL *` pointing at the Hono app that
83
- * routes in-process — which is a true description of that build and a false
84
- * description of the application. Merging it wrote `endpoints: [{ method:
85
- * 'ALL', path: '*' }]` into a manifest for an app with five routes, and made the
86
- * document's contents depend on which `--provider` ran last. A manifest must not
87
- * do that.
27
+ * That is the `server` provider's whole application: it generates one
28
+ * catch-all — `ALL *` pointing at the Hono app that routes in-process — which
29
+ * matches no endpoint, so every endpoint keeps the source it was found at.
88
30
  */
89
- export declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
90
- perRoute: boolean;
91
- }): ConstructManifest;
31
+ export declare function withHandlers(manifest: ConstructManifest, generated: GeneratedHandlers): ConstructManifest;
92
32
  /**
93
33
  * The manifest as TypeScript source.
94
34
  *
95
35
  * Pure, so what gets written can be asserted without touching a filesystem.
96
36
  */
97
37
  export declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
98
- /** Write it where the deploy config expects to import it from. */
99
- export declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
100
38
  /** The choices that are deployment config rather than declaration. */
101
39
  interface Backends {
102
40
  cache?: CacheBackend;
103
41
  email?: EmailBackend;
42
+ /**
43
+ * The labels no tenant of the wildcard site may take — every app's own
44
+ * and the workspace's `protectedSubdomains`. Config the AWS target cannot
45
+ * read for itself, so it travels with the manifest.
46
+ */
47
+ protectedSubdomains?: readonly string[];
104
48
  }
105
49
  //#endregion
106
- export type { DiscoverOptions };
50
+ export { type DiscoverOptions, discover, isDeclarable };
107
51
  //# sourceMappingURL=public.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.mts","names":[],"sources":["../../src/reconcile/discover.ts","../../src/reconcile/emit.ts"],"mappings":";;;;UA8BU;EACT;EACA,WAAW;;;;;;;;;wBAUI,aAAa,iBAAiB,SAAS;UAYtC;;EAEhB;EACA;;;;;;;EAOA;;;;;;;;;;;;EAYA,UAAU,eAAe;;;UAIT;;EAEhB;;EAEA;;;;;;;;;;wBAWqB,SACrB,SAAS,kBACP,QAAQ;;;;qBC5DE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBA8BG,WACf,UAAU,mBACV,iBAAiB,aACjB;EAAW;IACT;;;;;;wBA2Ja,eACf,UAAU,mBACV,WAAU;;wBA8BW,oBACrB,UAAU,mBACV,iBACA,WAAU,WACR;;UAUc;EAChB,QAAQ;EACR,QAAQ"}
1
+ {"version":3,"file":"public.d.mts","names":[],"sources":["../../src/reconcile/emit.ts"],"mappings":";;;;UAmCiB;;EAEhB,mBAAmB;IAAc;;EACjC,qBAAqB;EACrB,iBAAiB;EACjB,kBAAkB;EAClB,uBAAuB;EACvB,sBAAsB;;EAEtB,2BAA2B;;;;;;;;;;;;;;;wBAgBZ,aACf,UAAU,mBACV,WAAW,oBACT;;;;;;wBAiHa,eACf,UAAU,mBACV,WAAU;;UA8BM;EAChB,QAAQ;EACR,QAAQ;;;;;;EAMR"}
@@ -1,3 +1,3 @@
1
- import { n as isDeclarable, t as discover } from "../discover-CK-n3w6b.mjs";
2
- import { a as writeManifestModule, i as withRoutes, n as manifestModule, t as MANIFEST_PATH } from "../emit-Bzq7JsMP.mjs";
3
- export { MANIFEST_PATH, discover, isDeclarable, manifestModule, withRoutes, writeManifestModule };
1
+ import { i as discover, o as isDeclarable } from "../discover-DbDrCQ8h.mjs";
2
+ import { n as withHandlers, t as manifestModule } from "../emit-C4KSXOeS.mjs";
3
+ export { discover, isDeclarable, manifestModule, withHandlers };
@@ -1,4 +1,4 @@
1
- import { t as generateFullstackCustomSecrets } from "./fullstack-secrets-BET8gqwK.mjs";
1
+ import { t as generateFullstackCustomSecrets } from "./index.mjs";
2
2
  //#region src/secrets/reconcile.ts
3
3
  /**
4
4
  * Reconcile missing custom secrets for a workspace.
@@ -31,4 +31,4 @@ function reconcileMissingSecrets(secrets, workspace, containers = []) {
31
31
  //#endregion
32
32
  export { reconcileMissingSecrets };
33
33
 
34
- //# sourceMappingURL=reconcile-DhQ00DpU.mjs.map
34
+ //# sourceMappingURL=reconcile--I7V4Klj.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-DhQ00DpU.mjs","names":[],"sources":["../src/secrets/reconcile.ts"],"sourcesContent":["import { generateFullstackCustomSecrets } from '../setup/fullstack-secrets.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface ReconcileResult {\n\t/** The updated secrets with missing keys backfilled */\n\tsecrets: StageSecrets;\n\t/** Keys that were added */\n\taddedKeys: string[];\n}\n\n/**\n * Reconcile missing custom secrets for a workspace.\n *\n * Compares current secrets against what generateFullstackCustomSecrets()\n * would produce and backfills any missing keys without overwriting\n * existing values.\n *\n * @returns ReconcileResult if keys were added, null if secrets are up-to-date\n */\nexport function reconcileMissingSecrets(\n\tsecrets: StageSecrets,\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): ReconcileResult | null {\n\tconst isMultiApp = Object.keys(workspace.apps).length > 1;\n\tif (!isMultiApp) {\n\t\treturn null;\n\t}\n\n\tconst expectedCustom = generateFullstackCustomSecrets(workspace, containers);\n\tconst addedKeys: string[] = [];\n\tconst mergedCustom = { ...secrets.custom };\n\n\tfor (const [key, value] of Object.entries(expectedCustom)) {\n\t\tif (!(key in mergedCustom)) {\n\t\t\tmergedCustom[key] = value;\n\t\t\taddedKeys.push(key);\n\t\t}\n\t}\n\n\tif (addedKeys.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tsecrets: {\n\t\t\t...secrets,\n\t\t\tupdatedAt: new Date().toISOString(),\n\t\t\tcustom: mergedCustom,\n\t\t},\n\t\taddedKeys,\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAgB,wBACf,SACA,WACA,aAAgC,CAAC,GACR;CAEzB,IAAI,EADe,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,SAAS,IAEvD,OAAO;CAGR,MAAM,iBAAiB,+BAA+B,WAAW,UAAU;CAC3E,MAAM,YAAsB,CAAC;CAC7B,MAAM,eAAe,EAAE,GAAG,QAAQ,OAAO;CAEzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,cAAc,GACvD,IAAI,EAAE,OAAO,eAAe;EAC3B,aAAa,OAAO;EACpB,UAAU,KAAK,GAAG;CACnB;CAGD,IAAI,UAAU,WAAW,GACxB,OAAO;CAGR,OAAO;EACN,SAAS;GACR,GAAG;GACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;GAClC,QAAQ;EACT;EACA;CACD;AACD"}
1
+ {"version":3,"file":"reconcile--I7V4Klj.mjs","names":[],"sources":["../src/secrets/reconcile.ts"],"sourcesContent":["import { generateFullstackCustomSecrets } from '../setup/fullstack-secrets.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface ReconcileResult {\n\t/** The updated secrets with missing keys backfilled */\n\tsecrets: StageSecrets;\n\t/** Keys that were added */\n\taddedKeys: string[];\n}\n\n/**\n * Reconcile missing custom secrets for a workspace.\n *\n * Compares current secrets against what generateFullstackCustomSecrets()\n * would produce and backfills any missing keys without overwriting\n * existing values.\n *\n * @returns ReconcileResult if keys were added, null if secrets are up-to-date\n */\nexport function reconcileMissingSecrets(\n\tsecrets: StageSecrets,\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): ReconcileResult | null {\n\tconst isMultiApp = Object.keys(workspace.apps).length > 1;\n\tif (!isMultiApp) {\n\t\treturn null;\n\t}\n\n\tconst expectedCustom = generateFullstackCustomSecrets(workspace, containers);\n\tconst addedKeys: string[] = [];\n\tconst mergedCustom = { ...secrets.custom };\n\n\tfor (const [key, value] of Object.entries(expectedCustom)) {\n\t\tif (!(key in mergedCustom)) {\n\t\t\tmergedCustom[key] = value;\n\t\t\taddedKeys.push(key);\n\t\t}\n\t}\n\n\tif (addedKeys.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tsecrets: {\n\t\t\t...secrets,\n\t\t\tupdatedAt: new Date().toISOString(),\n\t\t\tcustom: mergedCustom,\n\t\t},\n\t\taddedKeys,\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAgB,wBACf,SACA,WACA,aAAgC,CAAC,GACR;CAEzB,IAAI,EADe,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,SAAS,IAEvD,OAAO;CAGR,MAAM,iBAAiB,+BAA+B,WAAW,UAAU;CAC3E,MAAM,YAAsB,CAAC;CAC7B,MAAM,eAAe,EAAE,GAAG,QAAQ,OAAO;CAEzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,cAAc,GACvD,IAAI,EAAE,OAAO,eAAe;EAC3B,aAAa,OAAO;EACpB,UAAU,KAAK,GAAG;CACnB;CAGD,IAAI,UAAU,WAAW,GACxB,OAAO;CAGR,OAAO;EACN,SAAS;GACR,GAAG;GACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;GAClC,QAAQ;EACT;EACA;CACD;AACD"}
@@ -1,4 +1,4 @@
1
- const require_fullstack_secrets = require("./fullstack-secrets-DXsWO-5m.cjs");
1
+ const require_index = require("./index.cjs");
2
2
  //#region src/secrets/reconcile.ts
3
3
  /**
4
4
  * Reconcile missing custom secrets for a workspace.
@@ -11,7 +11,7 @@ const require_fullstack_secrets = require("./fullstack-secrets-DXsWO-5m.cjs");
11
11
  */
12
12
  function reconcileMissingSecrets(secrets, workspace, containers = []) {
13
13
  if (!(Object.keys(workspace.apps).length > 1)) return null;
14
- const expectedCustom = require_fullstack_secrets.generateFullstackCustomSecrets(workspace, containers);
14
+ const expectedCustom = require_index.generateFullstackCustomSecrets(workspace, containers);
15
15
  const addedKeys = [];
16
16
  const mergedCustom = { ...secrets.custom };
17
17
  for (const [key, value] of Object.entries(expectedCustom)) if (!(key in mergedCustom)) {
@@ -31,4 +31,4 @@ function reconcileMissingSecrets(secrets, workspace, containers = []) {
31
31
  //#endregion
32
32
  exports.reconcileMissingSecrets = reconcileMissingSecrets;
33
33
 
34
- //# sourceMappingURL=reconcile-Dd2iyILf.cjs.map
34
+ //# sourceMappingURL=reconcile-CuCQBa5-.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reconcile-Dd2iyILf.cjs","names":["generateFullstackCustomSecrets"],"sources":["../src/secrets/reconcile.ts"],"sourcesContent":["import { generateFullstackCustomSecrets } from '../setup/fullstack-secrets.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface ReconcileResult {\n\t/** The updated secrets with missing keys backfilled */\n\tsecrets: StageSecrets;\n\t/** Keys that were added */\n\taddedKeys: string[];\n}\n\n/**\n * Reconcile missing custom secrets for a workspace.\n *\n * Compares current secrets against what generateFullstackCustomSecrets()\n * would produce and backfills any missing keys without overwriting\n * existing values.\n *\n * @returns ReconcileResult if keys were added, null if secrets are up-to-date\n */\nexport function reconcileMissingSecrets(\n\tsecrets: StageSecrets,\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): ReconcileResult | null {\n\tconst isMultiApp = Object.keys(workspace.apps).length > 1;\n\tif (!isMultiApp) {\n\t\treturn null;\n\t}\n\n\tconst expectedCustom = generateFullstackCustomSecrets(workspace, containers);\n\tconst addedKeys: string[] = [];\n\tconst mergedCustom = { ...secrets.custom };\n\n\tfor (const [key, value] of Object.entries(expectedCustom)) {\n\t\tif (!(key in mergedCustom)) {\n\t\t\tmergedCustom[key] = value;\n\t\t\taddedKeys.push(key);\n\t\t}\n\t}\n\n\tif (addedKeys.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tsecrets: {\n\t\t\t...secrets,\n\t\t\tupdatedAt: new Date().toISOString(),\n\t\t\tcustom: mergedCustom,\n\t\t},\n\t\taddedKeys,\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAgB,wBACf,SACA,WACA,aAAgC,CAAC,GACR;CAEzB,IAAI,EADe,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,SAAS,IAEvD,OAAO;CAGR,MAAM,iBAAiBA,0BAAAA,+BAA+B,WAAW,UAAU;CAC3E,MAAM,YAAsB,CAAC;CAC7B,MAAM,eAAe,EAAE,GAAG,QAAQ,OAAO;CAEzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,cAAc,GACvD,IAAI,EAAE,OAAO,eAAe;EAC3B,aAAa,OAAO;EACpB,UAAU,KAAK,GAAG;CACnB;CAGD,IAAI,UAAU,WAAW,GACxB,OAAO;CAGR,OAAO;EACN,SAAS;GACR,GAAG;GACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;GAClC,QAAQ;EACT;EACA;CACD;AACD"}
1
+ {"version":3,"file":"reconcile-CuCQBa5-.cjs","names":["generateFullstackCustomSecrets"],"sources":["../src/secrets/reconcile.ts"],"sourcesContent":["import { generateFullstackCustomSecrets } from '../setup/fullstack-secrets.js';\nimport type { NormalizedWorkspace } from '../workspace/types.js';\nimport type { StageSecrets } from './types.js';\n\nexport interface ReconcileResult {\n\t/** The updated secrets with missing keys backfilled */\n\tsecrets: StageSecrets;\n\t/** Keys that were added */\n\taddedKeys: string[];\n}\n\n/**\n * Reconcile missing custom secrets for a workspace.\n *\n * Compares current secrets against what generateFullstackCustomSecrets()\n * would produce and backfills any missing keys without overwriting\n * existing values.\n *\n * @returns ReconcileResult if keys were added, null if secrets are up-to-date\n */\nexport function reconcileMissingSecrets(\n\tsecrets: StageSecrets,\n\tworkspace: NormalizedWorkspace,\n\tcontainers: readonly string[] = [],\n): ReconcileResult | null {\n\tconst isMultiApp = Object.keys(workspace.apps).length > 1;\n\tif (!isMultiApp) {\n\t\treturn null;\n\t}\n\n\tconst expectedCustom = generateFullstackCustomSecrets(workspace, containers);\n\tconst addedKeys: string[] = [];\n\tconst mergedCustom = { ...secrets.custom };\n\n\tfor (const [key, value] of Object.entries(expectedCustom)) {\n\t\tif (!(key in mergedCustom)) {\n\t\t\tmergedCustom[key] = value;\n\t\t\taddedKeys.push(key);\n\t\t}\n\t}\n\n\tif (addedKeys.length === 0) {\n\t\treturn null;\n\t}\n\n\treturn {\n\t\tsecrets: {\n\t\t\t...secrets,\n\t\t\tupdatedAt: new Date().toISOString(),\n\t\t\tcustom: mergedCustom,\n\t\t},\n\t\taddedKeys,\n\t};\n}\n"],"mappings":";;;;;;;;;;;AAoBA,SAAgB,wBACf,SACA,WACA,aAAgC,CAAC,GACR;CAEzB,IAAI,EADe,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,SAAS,IAEvD,OAAO;CAGR,MAAM,iBAAiBA,cAAAA,+BAA+B,WAAW,UAAU;CAC3E,MAAM,YAAsB,CAAC;CAC7B,MAAM,eAAe,EAAE,GAAG,QAAQ,OAAO;CAEzC,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,cAAc,GACvD,IAAI,EAAE,OAAO,eAAe;EAC3B,aAAa,OAAO;EACpB,UAAU,KAAK,GAAG;CACnB;CAGD,IAAI,UAAU,WAAW,GACxB,OAAO;CAGR,OAAO;EACN,SAAS;GACR,GAAG;GACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;GAClC,QAAQ;EACT;EACA;CACD;AACD"}
@@ -0,0 +1,263 @@
1
+ import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
2
+ import { a as UnknownDeployTarget, c as configuredTarget, i as DeployTargetNotYetSupported, n as isDeployTarget, o as builtinTarget, s as configurableBuiltins } from "./define-6poNqm5O.mjs";
3
+ import { dirname, join } from "node:path";
4
+ import { existsSync, readFileSync, realpathSync } from "node:fs";
5
+ import { pathToFileURL } from "node:url";
6
+ //#region src/target/package.ts
7
+ /**
8
+ * A target package, found the way the project would find it.
9
+ *
10
+ * From the workspace root, never from the CLI's own location or the process's
11
+ * working directory: the package is the project's dependency, and a CLI run
12
+ * through `pnpm dlx` — or a host deploying a checkout elsewhere — has neither
13
+ * in common with the project.
14
+ */
15
+ /** A target package the project does not have installed. */
16
+ var TargetPackageNotFound = class extends GkmError {
17
+ target;
18
+ packageName;
19
+ from;
20
+ constructor(target, packageName, from) {
21
+ super(`deploy.targets.${target} names the package "${packageName}", which is not installed in ${from}. Add it to the workspace root: pnpm add -D ${packageName}`);
22
+ this.target = target;
23
+ this.packageName = packageName;
24
+ this.from = from;
25
+ this.name = "TargetPackageNotFound";
26
+ }
27
+ };
28
+ /**
29
+ * `name`'s directory and `package.json`, from the nearest `node_modules` at
30
+ * or above `from` — Node's own lookup, without the exports map getting in
31
+ * the way of reading `package.json`.
32
+ */
33
+ function locatePackage(name, from) {
34
+ let dir = from;
35
+ while (true) {
36
+ const manifestPath = join(dir, "node_modules", name, "package.json");
37
+ if (existsSync(manifestPath)) return {
38
+ dir: realpathSync(dirname(manifestPath)),
39
+ manifest: JSON.parse(readFileSync(manifestPath, "utf-8"))
40
+ };
41
+ const parent = dirname(dir);
42
+ if (parent === dir) return void 0;
43
+ dir = parent;
44
+ }
45
+ }
46
+ /** The first file a conditions object leads to, as an `import` would. */
47
+ function pick(node) {
48
+ if (typeof node === "string") return node;
49
+ if (Array.isArray(node)) {
50
+ for (const option of node) {
51
+ const found = pick(option);
52
+ if (found) return found;
53
+ }
54
+ return;
55
+ }
56
+ if (node && typeof node === "object") {
57
+ const conditions = node;
58
+ for (const condition of [
59
+ "import",
60
+ "node",
61
+ "default",
62
+ "require"
63
+ ]) if (condition in conditions) {
64
+ const found = pick(conditions[condition]);
65
+ if (found) return found;
66
+ }
67
+ }
68
+ }
69
+ /** The file `import(name)` loads, relative to the package directory. */
70
+ function packageEntry(manifest) {
71
+ const { exports } = manifest;
72
+ let root = exports;
73
+ if (exports && typeof exports === "object" && !Array.isArray(exports)) {
74
+ if (Object.keys(exports).some((key) => key.startsWith("."))) root = exports["."];
75
+ }
76
+ return pick(root) ?? manifest.module ?? manifest.main ?? "index.js";
77
+ }
78
+ /** The module `name` is, imported from where the project would import it. */
79
+ async function importPackage(target, name, from) {
80
+ const located = locatePackage(name, from);
81
+ if (!located) throw new TargetPackageNotFound(target, name, from);
82
+ const entry = join(located.dir, packageEntry(located.manifest));
83
+ return await import(pathToFileURL(entry).href);
84
+ }
85
+ //#endregion
86
+ //#region src/target/runtime.ts
87
+ /**
88
+ * A target's runtime, without loading the target.
89
+ *
90
+ * `gkm dev` and `gkm build` choose a project's backends by it on every start,
91
+ * synchronously, and must not import a deploy plugin to do so — a plugin may
92
+ * pull in a cloud SDK, and a broken one would stop `gkm dev` for a project
93
+ * that is only being developed. So a built-in's runtime is in the table, an
94
+ * inline target carries its own, and a package declares it in its
95
+ * `package.json`:
96
+ *
97
+ * ```json
98
+ * { "name": "@acme/gkm-target", "gkm": { "runtime": "server" } }
99
+ * ```
100
+ */
101
+ const RUNTIMES = ["server", "aws"];
102
+ /** A target package whose `package.json` does not say where it runs. */
103
+ var TargetRuntimeUndeclared = class extends GkmError {
104
+ target;
105
+ packageName;
106
+ found;
107
+ constructor(target, packageName, found) {
108
+ super(`The deploy target "${target}" (${packageName}) does not declare its runtime${found === void 0 ? "" : ` (gkm.runtime is ${JSON.stringify(found)})`}. Its package.json needs "gkm": { "runtime": "server" } or "aws", so gkm dev and gkm build can choose backends without loading it.`);
109
+ this.target = target;
110
+ this.packageName = packageName;
111
+ this.found = found;
112
+ this.name = "TargetRuntimeUndeclared";
113
+ }
114
+ };
115
+ /** The runtime a target package declares in `package.json#gkm.runtime`. */
116
+ function declaredRuntime(target, packageName, root) {
117
+ const located = root ? locatePackage(packageName, root) : void 0;
118
+ if (!located) throw new TargetPackageNotFound(target, packageName, root ?? "the workspace");
119
+ const runtime = located.manifest.gkm?.runtime;
120
+ if (!RUNTIMES.includes(runtime)) throw new TargetRuntimeUndeclared(target, packageName, runtime);
121
+ return runtime;
122
+ }
123
+ /** The runtime of the target `name`, as the workspace resolves it. */
124
+ function runtimeOf(name, workspace) {
125
+ const builtin = builtinTarget(name);
126
+ if (builtin) return builtin.runtime;
127
+ const entry = configuredTarget(workspace.deploy, name);
128
+ if (entry === void 0) throw new UnknownDeployTarget(name, [...configurableBuiltins(), ...Object.keys(workspace.deploy?.targets ?? {})]);
129
+ const implementation = Array.isArray(entry) ? entry[0] : entry;
130
+ return typeof implementation === "string" ? declaredRuntime(name, implementation, workspace.root) : implementation.runtime;
131
+ }
132
+ //#endregion
133
+ //#region src/target/resolve.ts
134
+ /**
135
+ * From a target's name to the target.
136
+ *
137
+ * In this order, the first that has the name wins:
138
+ *
139
+ * 1. the host's own targets — what a program calling `deploy()` passes
140
+ * 2. the built-ins — `dokploy`, `compose`, `sst`
141
+ * 3. `deploy.targets` in gkm.config.ts — a package, an object, or either
142
+ * with options
143
+ *
144
+ * Built-ins come before the config so that a dependency cannot take over
145
+ * `dokploy` by being listed under its name. A name nothing has is
146
+ * `UnknownDeployTarget`. There is deliberately no fourth step that guesses a
147
+ * package from the name (`acme` → `@acme/gkm-target`): an npm scope nobody
148
+ * has claimed can be claimed by anyone, and a deploy would then run their
149
+ * code with the stage's credentials. A target is installed and named.
150
+ */
151
+ /** A target package whose default export is not a target. */
152
+ var TargetPackageInvalid = class extends GkmError {
153
+ target;
154
+ packageName;
155
+ constructor(target, packageName) {
156
+ super(`deploy.targets.${target} names "${packageName}", whose default export is not a deploy target. A target package exports one as default: export default defineTarget({ … }) from '@geekmidas/cli/target'.`);
157
+ this.target = target;
158
+ this.packageName = packageName;
159
+ this.name = "TargetPackageInvalid";
160
+ }
161
+ };
162
+ /** A `deploy.targets` entry that is not a target, a package name or a pair. */
163
+ var TargetEntryInvalid = class extends GkmError {
164
+ target;
165
+ constructor(target) {
166
+ super(`deploy.targets.${target} must be a package name, a target object (defineTarget), or [package or target, options].`);
167
+ this.target = target;
168
+ this.name = "TargetEntryInvalid";
169
+ }
170
+ };
171
+ /** A target whose `runtime` is not the one its package declares. */
172
+ var TargetRuntimeMismatch = class extends GkmError {
173
+ target;
174
+ packageName;
175
+ declared;
176
+ actual;
177
+ constructor(target, packageName, declared, actual) {
178
+ super(`The deploy target "${target}" runs on "${actual}", but ${packageName}'s package.json declares gkm.runtime "${declared}". gkm dev and gkm build chose backends for "${declared}", so the two must agree — fix the package.`);
179
+ this.target = target;
180
+ this.packageName = packageName;
181
+ this.declared = declared;
182
+ this.actual = actual;
183
+ this.name = "TargetRuntimeMismatch";
184
+ }
185
+ };
186
+ /** Options a target's schema rejected. */
187
+ var InvalidTargetOptions = class extends GkmError {
188
+ target;
189
+ issues;
190
+ constructor(target, issues) {
191
+ const lines = issues.map((issue) => {
192
+ const path = (issue.path ?? []).map((segment) => typeof segment === "object" ? String(segment.key) : String(segment)).join(".");
193
+ return ` - ${path ? `${path}: ` : ""}${issue.message}`;
194
+ });
195
+ super(`The options for deploy target "${target}" are invalid — fix them in deploy.targets.${target} in gkm.config.ts:\n${lines.join("\n")}`);
196
+ this.target = target;
197
+ this.issues = issues;
198
+ this.name = "InvalidTargetOptions";
199
+ }
200
+ };
201
+ /** The built-ins `gkm deploy` deploys through, loaded only when used. */
202
+ const BUILTIN_LOADERS = {
203
+ dokploy: async () => (await import("./dokploy-tmnH0Du_.mjs")).dokployTarget,
204
+ compose: async () => (await import("./compose-CnXZAYNM.mjs").then((n) => n.n)).composeTarget(),
205
+ sst: async () => (await import("./sst-DDRWlXdv.mjs").then((n) => n.n)).sstTarget
206
+ };
207
+ /** The target `name` means, in this workspace, for this host. */
208
+ async function resolveTarget(name, { workspace, host, stage }) {
209
+ if (host && Object.hasOwn(host, name)) return {
210
+ name,
211
+ target: host[name],
212
+ source: "host",
213
+ options: void 0
214
+ };
215
+ const builtin = builtinTarget(name);
216
+ if (builtin) {
217
+ const load = BUILTIN_LOADERS[name];
218
+ if (builtin.status !== "available" || !load) throw new DeployTargetNotYetSupported(name, builtin.instead?.(stage));
219
+ return {
220
+ name,
221
+ target: await load(),
222
+ source: "builtin",
223
+ options: void 0
224
+ };
225
+ }
226
+ const entry = configuredTarget(workspace.deploy, name);
227
+ if (entry === void 0) throw new UnknownDeployTarget(name, [...configurableBuiltins(), ...Object.keys(workspace.deploy?.targets ?? {})]);
228
+ const [implementation, options] = Array.isArray(entry) ? entry : [entry, void 0];
229
+ if (typeof implementation === "string") {
230
+ const declared = declaredRuntime(name, implementation, workspace.root);
231
+ const target = (await importPackage(name, implementation, workspace.root)).default;
232
+ if (!isDeployTarget(target)) throw new TargetPackageInvalid(name, implementation);
233
+ if (target.runtime !== declared) throw new TargetRuntimeMismatch(name, implementation, declared, target.runtime);
234
+ return {
235
+ name,
236
+ target,
237
+ source: "config",
238
+ options
239
+ };
240
+ }
241
+ if (!isDeployTarget(implementation)) throw new TargetEntryInvalid(name);
242
+ return {
243
+ name,
244
+ target: implementation,
245
+ source: "config",
246
+ options
247
+ };
248
+ }
249
+ /** The target's options, parsed by its schema. */
250
+ async function parseTargetOptions(resolved) {
251
+ const { name, target, options } = resolved;
252
+ if (!target.options) {
253
+ if (options !== void 0) throw new InvalidTargetOptions(name, [{ message: "this target takes no options" }]);
254
+ return;
255
+ }
256
+ const result = await target.options["~standard"].validate(options);
257
+ if (result.issues) throw new InvalidTargetOptions(name, result.issues);
258
+ return result.value;
259
+ }
260
+ //#endregion
261
+ export { parseTargetOptions as a, runtimeOf as c, TargetRuntimeMismatch as i, TargetPackageNotFound as l, TargetEntryInvalid as n, resolveTarget as o, TargetPackageInvalid as r, TargetRuntimeUndeclared as s, InvalidTargetOptions as t };
262
+
263
+ //# sourceMappingURL=resolve-CSsE7frp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-CSsE7frp.mjs","names":[],"sources":["../src/target/package.ts","../src/target/runtime.ts","../src/target/resolve.ts"],"sourcesContent":["/**\n * A target package, found the way the project would find it.\n *\n * From the workspace root, never from the CLI's own location or the process's\n * working directory: the package is the project's dependency, and a CLI run\n * through `pnpm dlx` — or a host deploying a checkout elsewhere — has neither\n * in common with the project.\n */\n\nimport { existsSync, readFileSync, realpathSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\nimport { pathToFileURL } from 'node:url';\nimport { GkmError } from '../errors';\n\nexport interface TargetPackageManifest {\n\tname?: string;\n\tmain?: string;\n\tmodule?: string;\n\texports?: unknown;\n\tgkm?: { runtime?: unknown };\n}\n\nexport interface LocatedPackage {\n\t/** The package's directory, symlinks resolved. */\n\tdir: string;\n\tmanifest: TargetPackageManifest;\n}\n\n/** A target package the project does not have installed. */\nexport class TargetPackageNotFound extends GkmError {\n\tconstructor(\n\t\treadonly target: string,\n\t\treadonly packageName: string,\n\t\treadonly from: string,\n\t) {\n\t\tsuper(\n\t\t\t`deploy.targets.${target} names the package \"${packageName}\", which is not installed in ${from}. Add it to the workspace root: pnpm add -D ${packageName}`,\n\t\t);\n\t\tthis.name = 'TargetPackageNotFound';\n\t}\n}\n\n/**\n * `name`'s directory and `package.json`, from the nearest `node_modules` at\n * or above `from` — Node's own lookup, without the exports map getting in\n * the way of reading `package.json`.\n */\nexport function locatePackage(\n\tname: string,\n\tfrom: string,\n): LocatedPackage | undefined {\n\tlet dir = from;\n\twhile (true) {\n\t\tconst manifestPath = join(dir, 'node_modules', name, 'package.json');\n\t\tif (existsSync(manifestPath)) {\n\t\t\treturn {\n\t\t\t\tdir: realpathSync(dirname(manifestPath)),\n\t\t\t\tmanifest: JSON.parse(\n\t\t\t\t\treadFileSync(manifestPath, 'utf-8'),\n\t\t\t\t) as TargetPackageManifest,\n\t\t\t};\n\t\t}\n\t\tconst parent = dirname(dir);\n\t\tif (parent === dir) return undefined;\n\t\tdir = parent;\n\t}\n}\n\n/** The first file a conditions object leads to, as an `import` would. */\nfunction pick(node: unknown): string | undefined {\n\tif (typeof node === 'string') return node;\n\tif (Array.isArray(node)) {\n\t\tfor (const option of node) {\n\t\t\tconst found = pick(option);\n\t\t\tif (found) return found;\n\t\t}\n\t\treturn undefined;\n\t}\n\tif (node && typeof node === 'object') {\n\t\tconst conditions = node as Record<string, unknown>;\n\t\tfor (const condition of ['import', 'node', 'default', 'require']) {\n\t\t\tif (condition in conditions) {\n\t\t\t\tconst found = pick(conditions[condition]);\n\t\t\t\tif (found) return found;\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/** The file `import(name)` loads, relative to the package directory. */\nexport function packageEntry(manifest: TargetPackageManifest): string {\n\tconst { exports } = manifest;\n\tlet root: unknown = exports;\n\tif (exports && typeof exports === 'object' && !Array.isArray(exports)) {\n\t\tconst keys = Object.keys(exports);\n\t\t// A subpath map — `{ \".\": …, \"./x\": … }` — rather than one conditions\n\t\t// object for the root.\n\t\tif (keys.some((key) => key.startsWith('.'))) {\n\t\t\troot = (exports as Record<string, unknown>)['.'];\n\t\t}\n\t}\n\treturn pick(root) ?? manifest.module ?? manifest.main ?? 'index.js';\n}\n\n/** The module `name` is, imported from where the project would import it. */\nexport async function importPackage(\n\ttarget: string,\n\tname: string,\n\tfrom: string,\n): Promise<Record<string, unknown>> {\n\tconst located = locatePackage(name, from);\n\tif (!located) throw new TargetPackageNotFound(target, name, from);\n\n\tconst entry = join(located.dir, packageEntry(located.manifest));\n\treturn (await import(pathToFileURL(entry).href)) as Record<string, unknown>;\n}\n","/**\n * A target's runtime, without loading the target.\n *\n * `gkm dev` and `gkm build` choose a project's backends by it on every start,\n * synchronously, and must not import a deploy plugin to do so — a plugin may\n * pull in a cloud SDK, and a broken one would stop `gkm dev` for a project\n * that is only being developed. So a built-in's runtime is in the table, an\n * inline target carries its own, and a package declares it in its\n * `package.json`:\n *\n * ```json\n * { \"name\": \"@acme/gkm-target\", \"gkm\": { \"runtime\": \"server\" } }\n * ```\n */\n\nimport { GkmError } from '../errors';\nimport {\n\tbuiltinTarget,\n\tconfigurableBuiltins,\n\tconfiguredTarget,\n\tUnknownDeployTarget,\n} from './builtins';\nimport { locatePackage, TargetPackageNotFound } from './package';\nimport type { DeployRuntime, DeployTargetEntry } from './types';\n\nconst RUNTIMES: readonly DeployRuntime[] = ['server', 'aws'];\n\n/** A target package whose `package.json` does not say where it runs. */\nexport class TargetRuntimeUndeclared extends GkmError {\n\tconstructor(\n\t\treadonly target: string,\n\t\treadonly packageName: string,\n\t\t/** What `gkm.runtime` held instead, when it held anything. */\n\t\treadonly found?: unknown,\n\t) {\n\t\tsuper(\n\t\t\t`The deploy target \"${target}\" (${packageName}) does not declare its runtime${found === undefined ? '' : ` (gkm.runtime is ${JSON.stringify(found)})`}. Its package.json needs \"gkm\": { \"runtime\": \"server\" } or \"aws\", so gkm dev and gkm build can choose backends without loading it.`,\n\t\t);\n\t\tthis.name = 'TargetRuntimeUndeclared';\n\t}\n}\n\n/** What a workspace's deploy config is read for here. */\nexport interface TargetSource {\n\t/** Where the target packages are installed from. */\n\troot?: string;\n\tdeploy?:\n\t\t| { default?: string; targets?: Record<string, DeployTargetEntry> }\n\t\t| undefined;\n}\n\n/** The runtime a target package declares in `package.json#gkm.runtime`. */\nexport function declaredRuntime(\n\ttarget: string,\n\tpackageName: string,\n\troot: string | undefined,\n): DeployRuntime {\n\tconst located = root ? locatePackage(packageName, root) : undefined;\n\tif (!located) {\n\t\tthrow new TargetPackageNotFound(\n\t\t\ttarget,\n\t\t\tpackageName,\n\t\t\troot ?? 'the workspace',\n\t\t);\n\t}\n\tconst runtime = located.manifest.gkm?.runtime;\n\tif (!RUNTIMES.includes(runtime as DeployRuntime)) {\n\t\tthrow new TargetRuntimeUndeclared(target, packageName, runtime);\n\t}\n\treturn runtime as DeployRuntime;\n}\n\n/** The runtime of the target `name`, as the workspace resolves it. */\nexport function runtimeOf(\n\tname: string,\n\tworkspace: TargetSource,\n): DeployRuntime {\n\tconst builtin = builtinTarget(name);\n\tif (builtin) return builtin.runtime;\n\n\tconst entry = configuredTarget(workspace.deploy, name);\n\tif (entry === undefined) {\n\t\tthrow new UnknownDeployTarget(name, [\n\t\t\t...configurableBuiltins(),\n\t\t\t...Object.keys(workspace.deploy?.targets ?? {}),\n\t\t]);\n\t}\n\n\tconst implementation = Array.isArray(entry) ? entry[0] : entry;\n\treturn typeof implementation === 'string'\n\t\t? declaredRuntime(name, implementation, workspace.root)\n\t\t: (implementation as { runtime: DeployRuntime }).runtime;\n}\n","/**\n * From a target's name to the target.\n *\n * In this order, the first that has the name wins:\n *\n * 1. the host's own targets — what a program calling `deploy()` passes\n * 2. the built-ins — `dokploy`, `compose`, `sst`\n * 3. `deploy.targets` in gkm.config.ts — a package, an object, or either\n * with options\n *\n * Built-ins come before the config so that a dependency cannot take over\n * `dokploy` by being listed under its name. A name nothing has is\n * `UnknownDeployTarget`. There is deliberately no fourth step that guesses a\n * package from the name (`acme` → `@acme/gkm-target`): an npm scope nobody\n * has claimed can be claimed by anyone, and a deploy would then run their\n * code with the stage's credentials. A target is installed and named.\n */\n\nimport { GkmError } from '../errors';\nimport {\n\tbuiltinTarget,\n\tconfigurableBuiltins,\n\tconfiguredTarget,\n\tDeployTargetNotYetSupported,\n\tUnknownDeployTarget,\n} from './builtins';\nimport { isDeployTarget } from './define';\nimport { importPackage } from './package';\nimport { declaredRuntime } from './runtime';\nimport type {\n\tAnyDeployTarget,\n\tDeployRuntime,\n\tDeployTargetEntry,\n\tTargetOptionsIssue,\n} from './types';\n\n/** Where a target came from. */\nexport type TargetSourceKind = 'host' | 'builtin' | 'config';\n\nexport interface ResolvedTarget {\n\t/** The name it was asked for by. */\n\tname: string;\n\ttarget: AnyDeployTarget;\n\tsource: TargetSourceKind;\n\t/** Its options as written in the config, before its schema parsed them. */\n\toptions: unknown;\n}\n\nexport interface ResolveTargetOptions {\n\t/** The workspace whose `deploy.targets` is consulted. */\n\tworkspace: {\n\t\troot: string;\n\t\tdeploy?: { targets?: Record<string, DeployTargetEntry> } | undefined;\n\t};\n\t/** The host's targets, consulted first. */\n\thost?: Record<string, AnyDeployTarget>;\n\t/** The stage being deployed, for what to do instead of a refused target. */\n\tstage: string;\n}\n\n/** A target package whose default export is not a target. */\nexport class TargetPackageInvalid extends GkmError {\n\tconstructor(\n\t\treadonly target: string,\n\t\treadonly packageName: string,\n\t) {\n\t\tsuper(\n\t\t\t`deploy.targets.${target} names \"${packageName}\", whose default export is not a deploy target. A target package exports one as default: export default defineTarget({ … }) from '@geekmidas/cli/target'.`,\n\t\t);\n\t\tthis.name = 'TargetPackageInvalid';\n\t}\n}\n\n/** A `deploy.targets` entry that is not a target, a package name or a pair. */\nexport class TargetEntryInvalid extends GkmError {\n\tconstructor(readonly target: string) {\n\t\tsuper(\n\t\t\t`deploy.targets.${target} must be a package name, a target object (defineTarget), or [package or target, options].`,\n\t\t);\n\t\tthis.name = 'TargetEntryInvalid';\n\t}\n}\n\n/** A target whose `runtime` is not the one its package declares. */\nexport class TargetRuntimeMismatch extends GkmError {\n\tconstructor(\n\t\treadonly target: string,\n\t\treadonly packageName: string,\n\t\treadonly declared: DeployRuntime,\n\t\treadonly actual: DeployRuntime,\n\t) {\n\t\tsuper(\n\t\t\t`The deploy target \"${target}\" runs on \"${actual}\", but ${packageName}'s package.json declares gkm.runtime \"${declared}\". gkm dev and gkm build chose backends for \"${declared}\", so the two must agree — fix the package.`,\n\t\t);\n\t\tthis.name = 'TargetRuntimeMismatch';\n\t}\n}\n\n/** Options a target's schema rejected. */\nexport class InvalidTargetOptions extends GkmError {\n\tconstructor(\n\t\treadonly target: string,\n\t\treadonly issues: readonly TargetOptionsIssue[],\n\t) {\n\t\tconst lines = issues.map((issue) => {\n\t\t\tconst path = (issue.path ?? [])\n\t\t\t\t.map((segment) =>\n\t\t\t\t\ttypeof segment === 'object' ? String(segment.key) : String(segment),\n\t\t\t\t)\n\t\t\t\t.join('.');\n\t\t\treturn ` - ${path ? `${path}: ` : ''}${issue.message}`;\n\t\t});\n\t\tsuper(\n\t\t\t`The options for deploy target \"${target}\" are invalid — fix them in deploy.targets.${target} in gkm.config.ts:\\n${lines.join('\\n')}`,\n\t\t);\n\t\tthis.name = 'InvalidTargetOptions';\n\t}\n}\n\n/** The built-ins `gkm deploy` deploys through, loaded only when used. */\nconst BUILTIN_LOADERS: Record<string, () => Promise<AnyDeployTarget>> = {\n\tdokploy: async () => (await import('./dokploy')).dokployTarget,\n\tcompose: async () => (await import('./compose/index')).composeTarget(),\n\tsst: async () => (await import('./sst/index')).sstTarget,\n};\n\n/** The target `name` means, in this workspace, for this host. */\nexport async function resolveTarget(\n\tname: string,\n\t{ workspace, host, stage }: ResolveTargetOptions,\n): Promise<ResolvedTarget> {\n\tif (host && Object.hasOwn(host, name)) {\n\t\treturn { name, target: host[name]!, source: 'host', options: undefined };\n\t}\n\n\tconst builtin = builtinTarget(name);\n\tif (builtin) {\n\t\tconst load = BUILTIN_LOADERS[name];\n\t\tif (builtin.status !== 'available' || !load) {\n\t\t\tthrow new DeployTargetNotYetSupported(name, builtin.instead?.(stage));\n\t\t}\n\t\treturn {\n\t\t\tname,\n\t\t\ttarget: await load(),\n\t\t\tsource: 'builtin',\n\t\t\toptions: undefined,\n\t\t};\n\t}\n\n\tconst entry = configuredTarget(workspace.deploy, name);\n\tif (entry === undefined) {\n\t\tthrow new UnknownDeployTarget(name, [\n\t\t\t...configurableBuiltins(),\n\t\t\t...Object.keys(workspace.deploy?.targets ?? {}),\n\t\t]);\n\t}\n\n\tconst [implementation, options] = Array.isArray(entry)\n\t\t? (entry as readonly [unknown, unknown])\n\t\t: [entry, undefined];\n\n\tif (typeof implementation === 'string') {\n\t\t// Before the import: a package that does not say where it runs is\n\t\t// refused without running any of its code.\n\t\tconst declared = declaredRuntime(name, implementation, workspace.root);\n\t\tconst loaded = await importPackage(name, implementation, workspace.root);\n\t\tconst target = loaded.default;\n\t\tif (!isDeployTarget(target)) {\n\t\t\tthrow new TargetPackageInvalid(name, implementation);\n\t\t}\n\t\tif (target.runtime !== declared) {\n\t\t\tthrow new TargetRuntimeMismatch(\n\t\t\t\tname,\n\t\t\t\timplementation,\n\t\t\t\tdeclared,\n\t\t\t\ttarget.runtime,\n\t\t\t);\n\t\t}\n\t\treturn { name, target, source: 'config', options };\n\t}\n\n\tif (!isDeployTarget(implementation)) throw new TargetEntryInvalid(name);\n\treturn { name, target: implementation, source: 'config', options };\n}\n\n/** The target's options, parsed by its schema. */\nexport async function parseTargetOptions(\n\tresolved: ResolvedTarget,\n): Promise<unknown> {\n\tconst { name, target, options } = resolved;\n\tif (!target.options) {\n\t\tif (options !== undefined) {\n\t\t\tthrow new InvalidTargetOptions(name, [\n\t\t\t\t{ message: 'this target takes no options' },\n\t\t\t]);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tconst result = await target.options['~standard'].validate(options);\n\tif (result.issues) throw new InvalidTargetOptions(name, result.issues);\n\treturn result.value;\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6BA,IAAa,wBAAb,cAA2C,SAAS;CAEzC;CACA;CACA;CAHV,YACC,QACA,aACA,MACC;EACD,MACC,kBAAkB,OAAO,sBAAsB,YAAY,+BAA+B,KAAK,8CAA8C,aAC9I;EANS,KAAA,SAAA;EACA,KAAA,cAAA;EACA,KAAA,OAAA;EAKT,KAAK,OAAO;CACb;AACD;;;;;;AAOA,SAAgB,cACf,MACA,MAC6B;CAC7B,IAAI,MAAM;CACV,OAAO,MAAM;EACZ,MAAM,eAAe,KAAK,KAAK,gBAAgB,MAAM,cAAc;EACnE,IAAI,WAAW,YAAY,GAC1B,OAAO;GACN,KAAK,aAAa,QAAQ,YAAY,CAAC;GACvC,UAAU,KAAK,MACd,aA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