@geekmidas/cli 10.0.0-alpha.6 → 10.0.0-alpha.60

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 (303) hide show
  1. package/README.md +225 -268
  2. package/bin/adjacent-tsconfig.mjs +97 -0
  3. package/bin/gkm.mjs +16 -2
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BTZd2u0f.cjs} +21 -22
  7. package/dist/HostingerProvider-BTZd2u0f.cjs.map +1 -0
  8. package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-DgzKa_Tj.mjs} +20 -21
  9. package/dist/HostingerProvider-DgzKa_Tj.mjs.map +1 -0
  10. package/dist/LegacyStateStore-CToa2hga.mjs +89 -0
  11. package/dist/LegacyStateStore-CToa2hga.mjs.map +1 -0
  12. package/dist/LegacyStateStore-CidlPT0N.cjs +89 -0
  13. package/dist/LegacyStateStore-CidlPT0N.cjs.map +1 -0
  14. package/dist/LocalStateStore-BFLiOocU.mjs +165 -0
  15. package/dist/LocalStateStore-BFLiOocU.mjs.map +1 -0
  16. package/dist/LocalStateStore-Dpuqka1N.cjs +176 -0
  17. package/dist/LocalStateStore-Dpuqka1N.cjs.map +1 -0
  18. package/dist/{openapi-D-dx9Akj.cjs → OpenApiTsGenerator-BTuUumsV.cjs} +330 -469
  19. package/dist/OpenApiTsGenerator-BTuUumsV.cjs.map +1 -0
  20. package/dist/{openapi-Bw8DWFWz.mjs → OpenApiTsGenerator-CvVr1Ilz.mjs} +295 -403
  21. package/dist/OpenApiTsGenerator-CvVr1Ilz.mjs.map +1 -0
  22. package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
  23. package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
  24. package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
  25. package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
  26. package/dist/S3StateStore-aaGkjcxO.mjs +161 -0
  27. package/dist/S3StateStore-aaGkjcxO.mjs.map +1 -0
  28. package/dist/S3StateStore-cnm813Xn.cjs +160 -0
  29. package/dist/S3StateStore-cnm813Xn.cjs.map +1 -0
  30. package/dist/SSMStateStore-BllaJKGo.mjs +154 -0
  31. package/dist/SSMStateStore-BllaJKGo.mjs.map +1 -0
  32. package/dist/SSMStateStore-DwaGprVX.cjs +153 -0
  33. package/dist/SSMStateStore-DwaGprVX.cjs.map +1 -0
  34. package/dist/appPorts-C9z9Pzn9.mjs +223 -0
  35. package/dist/appPorts-C9z9Pzn9.mjs.map +1 -0
  36. package/dist/appPorts-Cu79hJF6.cjs +264 -0
  37. package/dist/appPorts-Cu79hJF6.cjs.map +1 -0
  38. package/dist/aws-DkHdTV-p.cjs +61 -0
  39. package/dist/aws-DkHdTV-p.cjs.map +1 -0
  40. package/dist/aws-DojzQnLd.mjs +61 -0
  41. package/dist/aws-DojzQnLd.mjs.map +1 -0
  42. package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
  43. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
  44. package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
  45. package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
  46. package/dist/{bundler-BY1OmV1e.cjs → bundler-CzXZPSBJ.cjs} +20 -32
  47. package/dist/bundler-CzXZPSBJ.cjs.map +1 -0
  48. package/dist/{bundler-Be8Zg4Wd.mjs → bundler-DJVR4QlW.mjs} +18 -29
  49. package/dist/bundler-DJVR4QlW.mjs.map +1 -0
  50. package/dist/cli-D_qTl20Z.cjs +69 -0
  51. package/dist/cli-D_qTl20Z.cjs.map +1 -0
  52. package/dist/cli-DzR1hpum.mjs +69 -0
  53. package/dist/cli-DzR1hpum.mjs.map +1 -0
  54. package/dist/{config-CxP7P-qG.mjs → config-C5-EEdmr.mjs} +144 -127
  55. package/dist/config-C5-EEdmr.mjs.map +1 -0
  56. package/dist/{config-CNz5KaSR.cjs → config-DXnkCEq0.cjs} +212 -184
  57. package/dist/config-DXnkCEq0.cjs.map +1 -0
  58. package/dist/config.cjs +9 -6
  59. package/dist/config.d.cts +124 -33
  60. package/dist/config.d.cts.map +1 -1
  61. package/dist/config.d.mts +124 -33
  62. package/dist/config.d.mts.map +1 -1
  63. package/dist/config.mjs +3 -5
  64. package/dist/deploy/public.cjs +22 -0
  65. package/dist/deploy/public.d.cts +459 -0
  66. package/dist/deploy/public.d.cts.map +1 -0
  67. package/dist/deploy/public.d.mts +459 -0
  68. package/dist/deploy/public.d.mts.map +1 -0
  69. package/dist/deploy/public.mjs +5 -0
  70. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  71. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  72. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  73. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  74. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  75. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  76. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  77. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  78. package/dist/deploy/sniffer-hooks.cjs +13 -7
  79. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  80. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  81. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  82. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  83. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  84. package/dist/deploy/sniffer-hooks.mjs +10 -3
  85. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  86. package/dist/deploy/sniffer-loader.cjs +16 -7
  87. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  88. package/dist/deploy/sniffer-loader.d.cts +1 -1
  89. package/dist/deploy/sniffer-loader.d.mts +1 -1
  90. package/dist/deploy/sniffer-loader.mjs +14 -3
  91. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  92. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  93. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  94. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  95. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  96. package/dist/deploy/sniffer-routes-worker.mjs +3 -3
  97. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  98. package/dist/deploy/sniffer-worker.cjs +15 -6
  99. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  100. package/dist/deploy/sniffer-worker.d.cts +1 -3
  101. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  102. package/dist/deploy/sniffer-worker.d.mts +1 -3
  103. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  104. package/dist/deploy/sniffer-worker.mjs +15 -4
  105. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  106. package/dist/deploy-0fBVeWO-.cjs +3518 -0
  107. package/dist/deploy-0fBVeWO-.cjs.map +1 -0
  108. package/dist/deploy-D6Q09OkA.mjs +3429 -0
  109. package/dist/deploy-D6Q09OkA.mjs.map +1 -0
  110. package/dist/{discover-DTmFeloL.cjs → discover-Bc-4eA_p.cjs} +131 -103
  111. package/dist/discover-Bc-4eA_p.cjs.map +1 -0
  112. package/dist/{discover-CAlFgYec.mjs → discover-FrYvzkeC.mjs} +91 -58
  113. package/dist/discover-FrYvzkeC.mjs.map +1 -0
  114. package/dist/{emit-CiZS_5Ub.mjs → emit-C1e8qD08.mjs} +13 -26
  115. package/dist/emit-C1e8qD08.mjs.map +1 -0
  116. package/dist/{emit-CbcRolsa.cjs → emit-Dmc1nvdS.cjs} +31 -57
  117. package/dist/emit-Dmc1nvdS.cjs.map +1 -0
  118. package/dist/encryption-CML4UaPi.cjs +91 -0
  119. package/dist/encryption-CML4UaPi.cjs.map +1 -0
  120. package/dist/encryption-aDA2AzVx.mjs +90 -0
  121. package/dist/encryption-aDA2AzVx.mjs.map +1 -0
  122. package/dist/fakes-C9RiT6XG.mjs +125 -0
  123. package/dist/fakes-C9RiT6XG.mjs.map +1 -0
  124. package/dist/fakes-zW-jNAbQ.cjs +148 -0
  125. package/dist/fakes-zW-jNAbQ.cjs.map +1 -0
  126. package/dist/github-Cq57poPj.cjs +213 -0
  127. package/dist/github-Cq57poPj.cjs.map +1 -0
  128. package/dist/github-DmCj2u95.mjs +213 -0
  129. package/dist/github-DmCj2u95.mjs.map +1 -0
  130. package/dist/home-DOzBaWaL.cjs +33 -0
  131. package/dist/home-DOzBaWaL.cjs.map +1 -0
  132. package/dist/home-GI7pJl1M.mjs +22 -0
  133. package/dist/home-GI7pJl1M.mjs.map +1 -0
  134. package/dist/{index-DEbaleny.d.mts → index-Da1-oa9W.d.mts} +4 -23
  135. package/dist/index-Da1-oa9W.d.mts.map +1 -0
  136. package/dist/{index-BGGdjueF.d.cts → index-UiWCaGzU.d.cts} +4 -23
  137. package/dist/index-UiWCaGzU.d.cts.map +1 -0
  138. package/dist/index.cjs +9096 -12213
  139. package/dist/index.cjs.map +1 -1
  140. package/dist/index.d.cts +1 -1
  141. package/dist/index.d.mts +1 -1
  142. package/dist/index.mjs +9067 -12192
  143. package/dist/index.mjs.map +1 -1
  144. package/dist/migrate-BTqIflwc.cjs +743 -0
  145. package/dist/migrate-BTqIflwc.cjs.map +1 -0
  146. package/dist/migrate-B_6KofUo.mjs +736 -0
  147. package/dist/migrate-B_6KofUo.mjs.map +1 -0
  148. package/dist/openapi.cjs +198 -10
  149. package/dist/openapi.cjs.map +1 -0
  150. package/dist/openapi.d.cts +21 -19
  151. package/dist/openapi.d.cts.map +1 -1
  152. package/dist/openapi.d.mts +21 -19
  153. package/dist/openapi.d.mts.map +1 -1
  154. package/dist/openapi.mjs +193 -5
  155. package/dist/openapi.mjs.map +1 -0
  156. package/dist/ready-CCLIAkwR.cjs +807 -0
  157. package/dist/ready-CCLIAkwR.cjs.map +1 -0
  158. package/dist/ready-CIHpnUc5.mjs +760 -0
  159. package/dist/ready-CIHpnUc5.mjs.map +1 -0
  160. package/dist/reconcile/public.cjs +3 -5
  161. package/dist/reconcile/public.d.cts +30 -33
  162. package/dist/reconcile/public.d.cts.map +1 -1
  163. package/dist/reconcile/public.d.mts +30 -33
  164. package/dist/reconcile/public.d.mts.map +1 -1
  165. package/dist/reconcile/public.mjs +3 -4
  166. package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
  167. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  168. package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  169. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  170. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  171. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  172. package/dist/sniffer-BM8fpCas.mjs +6321 -0
  173. package/dist/sniffer-BM8fpCas.mjs.map +1 -0
  174. package/dist/sniffer-DIv12ncU.cjs +6707 -0
  175. package/dist/sniffer-DIv12ncU.cjs.map +1 -0
  176. package/dist/storage-BzaUxmqe.mjs +124 -0
  177. package/dist/storage-BzaUxmqe.mjs.map +1 -0
  178. package/dist/storage-CSGoC3bK.cjs +152 -0
  179. package/dist/storage-CSGoC3bK.cjs.map +1 -0
  180. package/dist/store-BS8A7NcA.mjs +415 -0
  181. package/dist/store-BS8A7NcA.mjs.map +1 -0
  182. package/dist/store-KvNQwYaB.cjs +510 -0
  183. package/dist/store-KvNQwYaB.cjs.map +1 -0
  184. package/dist/types-Bp1mVxG0.d.mts +6410 -0
  185. package/dist/types-Bp1mVxG0.d.mts.map +1 -0
  186. package/dist/types-efNLu9xu.d.cts +6411 -0
  187. package/dist/types-efNLu9xu.d.cts.map +1 -0
  188. package/dist/vitest.cjs +65 -0
  189. package/dist/vitest.cjs.map +1 -0
  190. package/dist/vitest.d.cts +29 -0
  191. package/dist/vitest.d.cts.map +1 -0
  192. package/dist/vitest.d.mts +29 -0
  193. package/dist/vitest.d.mts.map +1 -0
  194. package/dist/vitest.mjs +65 -0
  195. package/dist/vitest.mjs.map +1 -0
  196. package/dist/workspace/index.cjs +3 -4
  197. package/dist/workspace/index.d.cts +3 -3
  198. package/dist/workspace/index.d.mts +3 -3
  199. package/dist/workspace/index.mjs +2 -3
  200. package/dist/{workspace-LKiNyaDy.cjs → workspace-B64Xk1Mb.cjs} +1070 -1118
  201. package/dist/workspace-B64Xk1Mb.cjs.map +1 -0
  202. package/dist/{workspace-DIuZx-cc.mjs → workspace-Bp1xVaOz.mjs} +901 -972
  203. package/dist/workspace-Bp1xVaOz.mjs.map +1 -0
  204. package/package.json +38 -20
  205. package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
  206. package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
  207. package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
  208. package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
  209. package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
  210. package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
  211. package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
  212. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
  213. package/dist/LocalStateProvider-Bn6tS-oL.mjs +0 -42
  214. package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
  215. package/dist/LocalStateProvider-Db9SEjyH.cjs +0 -43
  216. package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
  217. package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
  218. package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
  219. package/dist/SSMStateProvider-BRt2py-A.mjs +0 -66
  220. package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
  221. package/dist/SSMStateProvider-DyX8s9HI.cjs +0 -66
  222. package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
  223. package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
  224. package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
  225. package/dist/bundler-BY1OmV1e.cjs.map +0 -1
  226. package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
  227. package/dist/chunk-Duj1WY3L.mjs +0 -7
  228. package/dist/config-CNz5KaSR.cjs.map +0 -1
  229. package/dist/config-CxP7P-qG.mjs.map +0 -1
  230. package/dist/credentials-B5zRHdAl.mjs +0 -141
  231. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  232. package/dist/credentials-BK3Z93MX.mjs +0 -2548
  233. package/dist/credentials-BK3Z93MX.mjs.map +0 -1
  234. package/dist/credentials-BapzjyV5.cjs +0 -195
  235. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  236. package/dist/credentials-DzsXZzkx.cjs +0 -2680
  237. package/dist/credentials-DzsXZzkx.cjs.map +0 -1
  238. package/dist/discover-CAlFgYec.mjs.map +0 -1
  239. package/dist/discover-DTmFeloL.cjs.map +0 -1
  240. package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
  241. package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
  242. package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
  243. package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
  244. package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
  245. package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
  246. package/dist/emit-CbcRolsa.cjs.map +0 -1
  247. package/dist/emit-CiZS_5Ub.mjs.map +0 -1
  248. package/dist/encryption-C6jaU0hE.cjs +0 -54
  249. package/dist/encryption-C6jaU0hE.cjs.map +0 -1
  250. package/dist/encryption-CHzzeR8a.cjs +0 -4
  251. package/dist/encryption-CQUncu7v.mjs +0 -3
  252. package/dist/encryption-D-abyhZx.mjs +0 -42
  253. package/dist/encryption-D-abyhZx.mjs.map +0 -1
  254. package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
  255. package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
  256. package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
  257. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
  258. package/dist/generator-CNzBw7g5.cjs +0 -289
  259. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  260. package/dist/generator-VE2JrFlY.mjs +0 -253
  261. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  262. package/dist/index-BGGdjueF.d.cts.map +0 -1
  263. package/dist/index-DEbaleny.d.mts.map +0 -1
  264. package/dist/openapi-Bw8DWFWz.mjs.map +0 -1
  265. package/dist/openapi-D-dx9Akj.cjs.map +0 -1
  266. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  267. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  268. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  269. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  270. package/dist/openapi-react-query.cjs +0 -4
  271. package/dist/openapi-react-query.d.cts +0 -11
  272. package/dist/openapi-react-query.d.cts.map +0 -1
  273. package/dist/openapi-react-query.d.mts +0 -11
  274. package/dist/openapi-react-query.d.mts.map +0 -1
  275. package/dist/openapi-react-query.mjs +0 -4
  276. package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
  277. package/dist/reconcile-D0pimNiy.cjs.map +0 -1
  278. package/dist/setup-8IWPsRIN.cjs +0 -11
  279. package/dist/setup-BWMhbW-p.mjs +0 -443
  280. package/dist/setup-BWMhbW-p.mjs.map +0 -1
  281. package/dist/setup-D7L4BgBT.cjs +0 -473
  282. package/dist/setup-D7L4BgBT.cjs.map +0 -1
  283. package/dist/setup-DGIPd2fh.mjs +0 -11
  284. package/dist/storage-BJmzYxt8.cjs +0 -363
  285. package/dist/storage-BJmzYxt8.cjs.map +0 -1
  286. package/dist/storage-BM9hGpgv.cjs +0 -7
  287. package/dist/storage-Bi24WfoW.mjs +0 -297
  288. package/dist/storage-Bi24WfoW.mjs.map +0 -1
  289. package/dist/storage-CYlGwWTj.mjs +0 -3
  290. package/dist/sync-CmEuNZsB.mjs +0 -76
  291. package/dist/sync-CmEuNZsB.mjs.map +0 -1
  292. package/dist/sync-D306yOWu.cjs +0 -4
  293. package/dist/sync-SizaChmC.cjs +0 -93
  294. package/dist/sync-SizaChmC.cjs.map +0 -1
  295. package/dist/sync-hOqAWHR6.mjs +0 -3
  296. package/dist/types-BLSNdrk0.d.cts +0 -2176
  297. package/dist/types-BLSNdrk0.d.cts.map +0 -1
  298. package/dist/types-C3POXhw3.d.mts +0 -2176
  299. package/dist/types-C3POXhw3.d.mts.map +0 -1
  300. package/dist/workspace-CGaUAw5A.cjs +0 -9
  301. package/dist/workspace-CnTqIlB3.mjs +0 -8
  302. package/dist/workspace-DIuZx-cc.mjs.map +0 -1
  303. package/dist/workspace-LKiNyaDy.cjs.map +0 -1
@@ -1,11 +1,26 @@
1
- const require_chunk = require('./chunk-CUT6urMc.cjs');
2
- const require_discover = require('./discover-DTmFeloL.cjs');
3
- const require_workspace = require('./workspace-LKiNyaDy.cjs');
4
- const node_fs = require_chunk.__toESM(require("node:fs"));
5
- const node_path = require_chunk.__toESM(require("node:path"));
6
- const __geekmidas_manifest = require_chunk.__toESM(require("@geekmidas/manifest"));
7
-
1
+ const require_discover = require("./discover-Bc-4eA_p.cjs");
2
+ const require_workspace = require("./workspace-B64Xk1Mb.cjs");
3
+ let node_path = require("node:path");
4
+ let node_fs = require("node:fs");
5
+ let _geekmidas_manifest = require("@geekmidas/manifest");
8
6
  //#region src/workspace/derive.ts
7
+ /**
8
+ * The apps a manifest implies.
9
+ *
10
+ * `gkm.config.ts` used to carry an `apps` block naming every app: its type, its
11
+ * path, its port, its framework, which other apps it depended on. Every one of
12
+ * those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`
13
+ * and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',
14
+ * dependencies: ['api'] }` are the same statement written twice, and only one of
15
+ * them was checked against anything — so the copy in config was free to drift,
16
+ * and a surface config had no entry for simply never deployed.
17
+ *
18
+ * So the list comes from the graph. A `site` is an app, and so is every
19
+ * `rest-api` — one surface, one container, at the `path` it declared.
20
+ *
21
+ * What config still supplies is what no graph can answer: the backends a cache
22
+ * and a mailer resolve to, the deploy endpoint, the stage's domain.
23
+ */
9
24
  /** Which frontend framework builds each site variant. */
10
25
  const FRAMEWORKS = {
11
26
  static: "vite",
@@ -20,7 +35,7 @@ const FRAMEWORKS = {
20
35
  * environment — one id, three renderings, no second list.
21
36
  */
22
37
  function appKey(id) {
23
- return (0, __geekmidas_manifest.kebabCase)(id);
38
+ return (0, _geekmidas_manifest.kebabCase)(id);
24
39
  }
25
40
  /**
26
41
  * The app serving a surface: its own, always.
@@ -77,60 +92,23 @@ function markRoot(apps) {
77
92
  const chosen = sites.find(([name]) => name === "web") ?? (sites.length === 1 ? sites[0] : void 0);
78
93
  if (chosen) chosen[1].root = true;
79
94
  }
80
- /**
81
- * What `app: true` means, and what the object form leaves out.
82
- *
83
- * Both fields follow from the construct's own id, so neither was worth making
84
- * someone write down:
85
- *
86
- * - `path` is `apps/<kebab-id>` where that directory exists, and the workspace
87
- * root otherwise. `Api` means `apps/api` in a monorepo and `.` in a
88
- * single-app project, and which of the two you are in is answerable by
89
- * looking.
90
- * - `code` is the conventional directories under `path`. A glob is worth
91
- * writing only when the code is somewhere else, which is the case the field
92
- * still exists for.
93
- *
94
- * A site takes no `code`: its build is its framework's, not ours.
95
- */
96
- /**
97
- * Where an app lives when it did not say.
98
- *
99
- * `apps/<kebab-id>`, which is what the id already said — or the project root
100
- * when there is no such directory, because then there is one app and it is the
101
- * project.
102
- *
103
- * This refused, briefly, when a workspace had an `apps/` directory with nothing
104
- * under this name — on the grounds that answering `.` makes the app the whole
105
- * repository. That was the wrong place for the guard twice over. It throws
106
- * inside discovery, which is caught, so one misplaced app lost the whole
107
- * manifest and every other app with it. And the hazard it guards — the build
108
- * filtering turbo onto the root package, whose `build` is `gkm build` — is the
109
- * build's question, asked where the answer is actionable.
110
- */
111
- function conventionalPath(id, workspaceRoot) {
112
- const conventional = (0, node_path.join)("apps", appKey(id));
113
- return (0, node_fs.existsSync)((0, node_path.join)(workspaceRoot, conventional)) ? conventional : ".";
114
- }
115
- function resolveAppSpec(id, spec, workspaceRoot) {
116
- return {
117
- ...spec,
118
- path: spec.path ?? conventionalPath(id, workspaceRoot)
119
- };
120
- }
121
95
  function derivedApps(manifest, workspace) {
122
96
  const apps = {};
123
97
  const defaultTarget = workspace.deploy?.default ?? "dokploy";
124
98
  for (const [id, declaration] of Object.entries(manifest)) {
125
- if (declaration.kind !== "site" && declaration.kind !== "rest-api") continue;
126
- const spec = resolveAppSpec(id, declaration.app ?? {}, workspace.root);
99
+ if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api") continue;
100
+ const spec = declaration.kind === "site" || declaration.kind === "mobile-app" ? declaration.app : {
101
+ path: declaration.path,
102
+ ...declaration.telescope ? { telescope: true } : {}
103
+ };
127
104
  const name = appKey(id);
128
105
  const configured = workspace.apps[name];
129
106
  apps[name] = {
130
107
  ...configured,
131
- type: declaration.kind === "site" ? "web" : "backend",
108
+ type: declaration.kind === "site" ? "web" : declaration.kind === "mobile-app" ? "mobile" : "backend",
132
109
  path: spec.path,
133
110
  port: spec.port ?? configured?.port ?? 0,
111
+ ...(declaration.kind === "rest-api" || declaration.kind === "site") && declaration.subdomain ? { subdomain: declaration.subdomain } : {},
134
112
  dependencies: [],
135
113
  resolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,
136
114
  ...declaration.kind === "site" ? {
@@ -138,8 +116,11 @@ function derivedApps(manifest, workspace) {
138
116
  ...declaration.root ? { root: true } : {},
139
117
  ...spec.config ? { config: spec.config } : {}
140
118
  } : {},
119
+ ...declaration.kind === "mobile-app" ? {
120
+ framework: configured?.framework ?? declaration.variant,
121
+ ...spec.config ? { config: spec.config } : {}
122
+ } : {},
141
123
  ...spec.telescope !== void 0 ? { telescope: spec.telescope } : {},
142
- ...spec.studio !== void 0 ? { studio: spec.studio } : {},
143
124
  ...spec.openapi !== void 0 ? { openapi: spec.openapi } : {},
144
125
  ...spec.runtime !== void 0 ? { runtime: spec.runtime } : {},
145
126
  ...spec.env !== void 0 ? { env: spec.env } : {},
@@ -148,7 +129,7 @@ function derivedApps(manifest, workspace) {
148
129
  };
149
130
  }
150
131
  for (const [id, declaration] of Object.entries(manifest)) {
151
- if (declaration.kind !== "site" && declaration.kind !== "rest-api") continue;
132
+ if (declaration.kind !== "site" && declaration.kind !== "mobile-app" && declaration.kind !== "rest-api") continue;
152
133
  const app = apps[appKey(id)];
153
134
  if (!app) continue;
154
135
  const edges = declaration.kind === "rest-api" ? declaration.calls ?? [] : declaration.dependencies ?? [];
@@ -167,7 +148,6 @@ function derivedApps(manifest, workspace) {
167
148
  for (const [name, app] of Object.entries(workspace.apps)) if (!apps[name]) apps[name] = app;
168
149
  return apps;
169
150
  }
170
-
171
151
  //#endregion
172
152
  //#region src/config.ts
173
153
  /**
@@ -211,10 +191,9 @@ function parseModuleConfig(configString, defaultAlias) {
211
191
  const parts = configString.split("#");
212
192
  const path = parts[0] ?? configString;
213
193
  const exportName = parts[1];
214
- const importPattern = !exportName ? defaultAlias : exportName === defaultAlias ? `{ ${defaultAlias} }` : `{ ${exportName} as ${defaultAlias} }`;
215
194
  return {
216
195
  path,
217
- importPattern
196
+ importPattern: !exportName ? defaultAlias : exportName === defaultAlias ? `{ ${defaultAlias} }` : `{ ${exportName} as ${defaultAlias} }`
218
197
  };
219
198
  }
220
199
  /**
@@ -247,39 +226,25 @@ function findConfigPath(cwd) {
247
226
  }
248
227
  currentDir = (0, node_path.dirname)(currentDir);
249
228
  }
250
- throw new Error("Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.");
229
+ throw new ConfigNotFound(cwd);
251
230
  }
252
- /**
253
- * Get app name from package.json in the given directory.
254
- * Handles scoped packages by extracting the name after the scope.
255
- *
256
- * @example
257
- * getAppNameFromCwd('/path/to/apps/api')
258
- * // package.json: { "name": "@myorg/api" }
259
- * // Returns: 'api'
260
- */
261
- function getAppNameFromCwd(cwd = process.cwd()) {
262
- const packageJsonPath = (0, node_path.join)(cwd, "package.json");
263
- if (!(0, node_fs.existsSync)(packageJsonPath)) return null;
264
- try {
265
- const packageJson = JSON.parse((0, node_fs.readFileSync)(packageJsonPath, "utf-8"));
266
- const name = packageJson.name;
267
- if (!name) return null;
268
- if (name.startsWith("@") && name.includes("/")) return name.split("/")[1] ?? null;
269
- return name;
270
- } catch {
271
- return null;
231
+ /** No gkm config in a directory or any of its parents. */
232
+ var ConfigNotFound = class extends Error {
233
+ cwd;
234
+ constructor(cwd) {
235
+ super("Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.");
236
+ this.cwd = cwd;
237
+ this.name = "ConfigNotFound";
272
238
  }
273
- }
239
+ };
274
240
  /**
275
241
  * Load raw configuration from file.
276
242
  */
277
243
  async function loadRawConfig(cwd) {
278
244
  const { configPath, workspaceRoot } = findConfigPath(cwd);
279
245
  try {
280
- const config = await import(configPath);
281
246
  return {
282
- config: config.default,
247
+ config: (await import(configPath)).default,
283
248
  workspaceRoot
284
249
  };
285
250
  } catch (error) {
@@ -314,6 +279,19 @@ async function loadConfig(cwd = process.cwd()) {
314
279
  * }
315
280
  * ```
316
281
  */
282
+ /**
283
+ * The workspace a directory belongs to, as its config states it — without
284
+ * discovering its constructs.
285
+ *
286
+ * For callers that need a fact the config holds (where a stage's secrets are
287
+ * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every
288
+ * construct module to derive the apps, which is a cost a secrets read should
289
+ * not pay.
290
+ */
291
+ async function loadWorkspaceSettings(cwd = process.cwd()) {
292
+ const { config, workspaceRoot } = await loadRawConfig(cwd);
293
+ return require_workspace.processConfig(config, workspaceRoot).workspace;
294
+ }
317
295
  async function loadWorkspaceConfig(cwd = process.cwd()) {
318
296
  const { config, workspaceRoot } = await loadRawConfig(cwd);
319
297
  return withDerivedApps(require_workspace.processConfig(config, workspaceRoot));
@@ -339,7 +317,7 @@ async function loadWorkspaceConfig(cwd = process.cwd()) {
339
317
  */
340
318
  async function withDerivedApps(loaded) {
341
319
  const globs = require_workspace.allConstructGlobs(loaded.workspace);
342
- if (globs.length === 0) return loaded;
320
+ if (globs.length === 0) throw new WorkspaceDeclaresNoConstructs(loaded.workspace.root);
343
321
  try {
344
322
  const manifest = await require_discover.discover({
345
323
  patterns: globs,
@@ -355,152 +333,202 @@ async function withDerivedApps(loaded) {
355
333
  };
356
334
  } catch (error) {
357
335
  const message = error instanceof Error ? error.message : String(error);
358
- console.warn(`⚠️ Could not read constructs, so apps come from config alone: ${message}`);
336
+ require_discover.output.warn(`⚠️ Could not read constructs, so apps come from config alone: ${message}`);
359
337
  return loaded;
360
338
  }
361
339
  }
362
340
  /**
363
- * The app a package directory refers to, and what the workspace calls it.
341
+ * A workspace with no `constructs` glob.
342
+ *
343
+ * In v10 every address, container and app comes from what the workspace
344
+ * declares — there is no second path that reads a hand-written compose file or
345
+ * an `apps` block's ports. A config that declares nothing has nothing to run.
346
+ */
347
+ var WorkspaceDeclaresNoConstructs = class extends Error {
348
+ root;
349
+ constructor(root) {
350
+ 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.`);
351
+ this.root = root;
352
+ this.name = "WorkspaceDeclaresNoConstructs";
353
+ }
354
+ };
355
+ /**
356
+ * The app a directory is part of: the one whose `path` contains it.
364
357
  *
365
- * A single-app config is wrapped as a one-app workspace keyed `api`, which is
366
- * almost never the package name. Matching on the key alone means an app like
367
- * `@geekmidas/example` resolves to nothing and silently loses everything that
368
- * comes from the workspace — including the URLs its constructs declare.
358
+ * An app's path is the one its construct declares — `new RestApi('Api',
359
+ * { path: 'apps/api' })` — read off the workspace the constructs were derived
360
+ * into, never off the filesystem's package names. The deepest match wins, so
361
+ * an app inside another app's folder is its own; the workspace root belongs to
362
+ * no app unless one lives there.
369
363
  */
370
- function resolveWorkspaceApp(loadedConfig, appName) {
371
- const apps = loadedConfig.workspace.apps;
372
- const named = apps[appName];
373
- if (named) return {
374
- key: appName,
375
- app: named
364
+ function resolveWorkspaceApp(loadedConfig, cwd) {
365
+ const here = real(cwd);
366
+ let found;
367
+ for (const [key, app] of Object.entries(loadedConfig.workspace.apps)) {
368
+ const dir = real((0, node_path.join)(loadedConfig.workspace.root, app.path));
369
+ if ((here === dir || here.startsWith(`${dir}${node_path.sep}`)) && (!found || dir.length > found.dir.length)) found = {
370
+ key,
371
+ app,
372
+ dir
373
+ };
374
+ }
375
+ return found && {
376
+ key: found.key,
377
+ app: found.app
376
378
  };
377
- const names = Object.keys(apps);
378
- const only = names[0];
379
- if (loadedConfig.type !== "single" || names.length !== 1 || !only) return void 0;
380
- const app = apps[only];
381
- return app ? {
382
- key: only,
383
- app
384
- } : void 0;
379
+ }
380
+ /** A path with its symlinks resolved, where it exists — `/tmp` is `/private/tmp`. */
381
+ function real(path) {
382
+ const absolute = (0, node_path.resolve)(path);
383
+ return (0, node_fs.existsSync)(absolute) ? (0, node_fs.realpathSync)(absolute) : absolute;
384
+ }
385
+ /** A directory that no app in the workspace lives in. */
386
+ var NotInAnApp = class extends Error {
387
+ cwd;
388
+ apps;
389
+ constructor(cwd, apps) {
390
+ super(`${cwd} is not inside any app's path. Apps: ` + Object.entries(apps).map(([key, path]) => `${key} (${path})`).join(", ") + ".");
391
+ this.cwd = cwd;
392
+ this.apps = apps;
393
+ this.name = "NotInAnApp";
394
+ }
395
+ };
396
+ /** Every app's path, by key — what `NotInAnApp` lists. */
397
+ function appPaths(loadedConfig) {
398
+ return Object.fromEntries(Object.entries(loadedConfig.workspace.apps).map(([key, app]) => [key, app.path]));
385
399
  }
386
400
  /**
387
- * Load app-specific configuration from workspace.
388
- * Uses the app name from package.json to find the correct app config.
401
+ * The backend app a directory is part of, with its gkm config — found by the
402
+ * `path` its construct declares.
389
403
  *
390
404
  * @example
391
405
  * ```ts
392
- * // From apps/api directory with package.json: { "name": "@myorg/api" }
406
+ * // From apps/api, where a construct declares `path: 'apps/api'`
393
407
  * const { app, workspace, workspaceRoot } = await loadAppConfig();
394
- * console.log(app.routes); // './src/endpoints/**\/*.ts'
395
408
  * ```
409
+ *
410
+ * @throws {NotInAnApp} when no app's path contains the directory.
411
+ * @throws {NotABackendApp} when the app it is in has no gkm config to run.
396
412
  */
397
413
  async function loadAppConfig(cwd = process.cwd()) {
398
- const appName = getAppNameFromCwd(cwd);
399
- if (!appName) throw new Error("Could not determine app name. Ensure package.json exists with a \"name\" field.");
400
- const { config, workspaceRoot } = await loadRawConfig(cwd);
401
- const loadedConfig = await withDerivedApps(require_workspace.processConfig(config, workspaceRoot));
402
- const resolved = resolveWorkspaceApp(loadedConfig, appName);
403
- if (!resolved) throw new Error(`App "${appName}" not found in workspace config. Available apps: ${Object.keys(loadedConfig.workspace.apps).join(", ")}. Ensure the package.json name matches the app key in gkm.config.ts.`);
404
- const { key, app } = resolved;
405
- const gkmConfig = require_workspace.getAppGkmConfig(loadedConfig.workspace, key);
406
- if (!gkmConfig) throw new Error(`App "${appName}" is not a backend app and cannot be run with gkm dev.`);
414
+ const { appName, app, workspace, workspaceRoot } = await loadWorkspaceAppInfo(cwd);
415
+ const gkmConfig = require_workspace.getAppGkmConfig(workspace, appName);
416
+ if (!gkmConfig) throw new NotABackendApp(appName);
407
417
  return {
408
418
  appName,
409
419
  app,
410
420
  gkmConfig,
411
- workspace: loadedConfig.workspace,
421
+ workspace,
412
422
  workspaceRoot,
413
423
  appRoot: (0, node_path.join)(workspaceRoot, app.path)
414
424
  };
415
425
  }
426
+ /** The app a directory is in has no gkm config — a site, or an entry app. */
427
+ var NotABackendApp = class extends Error {
428
+ appName;
429
+ constructor(appName) {
430
+ super(`App "${appName}" is not a backend app and cannot be run with gkm dev.`);
431
+ this.appName = appName;
432
+ this.name = "NotABackendApp";
433
+ }
434
+ };
416
435
  /**
417
- * Load workspace info for any app (frontend or backend).
418
- * Unlike loadAppConfig, this does NOT require the app to have a gkm config
419
- * (routes, entry, etc.), making it suitable for gkm exec/test from frontend apps.
436
+ * The app a directory is part of, frontend or backend — found by the `path`
437
+ * its construct declares. Unlike `loadAppConfig`, the app need not have a
438
+ * gkm config, which is what `gkm exec` and `gkm test` from a site need.
439
+ *
440
+ * @throws {NotInAnApp} when no app's path contains the directory.
420
441
  */
421
442
  async function loadWorkspaceAppInfo(cwd = process.cwd()) {
422
- const appName = getAppNameFromCwd(cwd);
423
- if (!appName) throw new Error("Could not determine app name. Ensure package.json exists with a \"name\" field.");
424
443
  const { config, workspaceRoot } = await loadRawConfig(cwd);
425
444
  const loadedConfig = await withDerivedApps(require_workspace.processConfig(config, workspaceRoot));
426
- const resolved = resolveWorkspaceApp(loadedConfig, appName);
427
- if (!resolved) {
428
- const availableApps = Object.keys(loadedConfig.workspace.apps).join(", ");
429
- throw new Error(`App "${appName}" not found in workspace config. Available apps: ${availableApps}. Ensure the package.json name matches the app key in gkm.config.ts.`);
430
- }
445
+ const resolved = resolveWorkspaceApp(loadedConfig, cwd);
446
+ if (!resolved) throw new NotInAnApp(cwd, appPaths(loadedConfig));
431
447
  return {
432
- appName,
448
+ appName: resolved.key,
433
449
  app: resolved.app,
434
450
  workspace: loadedConfig.workspace,
435
451
  workspaceRoot
436
452
  };
437
453
  }
438
-
439
454
  //#endregion
440
- Object.defineProperty(exports, 'appKey', {
441
- enumerable: true,
442
- get: function () {
443
- return appKey;
444
- }
455
+ Object.defineProperty(exports, "ConfigNotFound", {
456
+ enumerable: true,
457
+ get: function() {
458
+ return ConfigNotFound;
459
+ }
445
460
  });
446
- Object.defineProperty(exports, 'defineConfig', {
447
- enumerable: true,
448
- get: function () {
449
- return defineConfig;
450
- }
461
+ Object.defineProperty(exports, "NotABackendApp", {
462
+ enumerable: true,
463
+ get: function() {
464
+ return NotABackendApp;
465
+ }
451
466
  });
452
- Object.defineProperty(exports, 'derivedApps', {
453
- enumerable: true,
454
- get: function () {
455
- return derivedApps;
456
- }
467
+ Object.defineProperty(exports, "NotInAnApp", {
468
+ enumerable: true,
469
+ get: function() {
470
+ return NotInAnApp;
471
+ }
472
+ });
473
+ Object.defineProperty(exports, "WorkspaceDeclaresNoConstructs", {
474
+ enumerable: true,
475
+ get: function() {
476
+ return WorkspaceDeclaresNoConstructs;
477
+ }
478
+ });
479
+ Object.defineProperty(exports, "appKey", {
480
+ enumerable: true,
481
+ get: function() {
482
+ return appKey;
483
+ }
457
484
  });
458
- Object.defineProperty(exports, 'getAppNameFromCwd', {
459
- enumerable: true,
460
- get: function () {
461
- return getAppNameFromCwd;
462
- }
485
+ Object.defineProperty(exports, "defineConfig", {
486
+ enumerable: true,
487
+ get: function() {
488
+ return defineConfig;
489
+ }
463
490
  });
464
- Object.defineProperty(exports, 'hostOf', {
465
- enumerable: true,
466
- get: function () {
467
- return hostOf;
468
- }
491
+ Object.defineProperty(exports, "derivedApps", {
492
+ enumerable: true,
493
+ get: function() {
494
+ return derivedApps;
495
+ }
469
496
  });
470
- Object.defineProperty(exports, 'loadAppConfig', {
471
- enumerable: true,
472
- get: function () {
473
- return loadAppConfig;
474
- }
497
+ Object.defineProperty(exports, "loadAppConfig", {
498
+ enumerable: true,
499
+ get: function() {
500
+ return loadAppConfig;
501
+ }
475
502
  });
476
- Object.defineProperty(exports, 'loadConfig', {
477
- enumerable: true,
478
- get: function () {
479
- return loadConfig;
480
- }
503
+ Object.defineProperty(exports, "loadConfig", {
504
+ enumerable: true,
505
+ get: function() {
506
+ return loadConfig;
507
+ }
481
508
  });
482
- Object.defineProperty(exports, 'loadWorkspaceAppInfo', {
483
- enumerable: true,
484
- get: function () {
485
- return loadWorkspaceAppInfo;
486
- }
509
+ Object.defineProperty(exports, "loadWorkspaceAppInfo", {
510
+ enumerable: true,
511
+ get: function() {
512
+ return loadWorkspaceAppInfo;
513
+ }
487
514
  });
488
- Object.defineProperty(exports, 'loadWorkspaceConfig', {
489
- enumerable: true,
490
- get: function () {
491
- return loadWorkspaceConfig;
492
- }
515
+ Object.defineProperty(exports, "loadWorkspaceConfig", {
516
+ enumerable: true,
517
+ get: function() {
518
+ return loadWorkspaceConfig;
519
+ }
493
520
  });
494
- Object.defineProperty(exports, 'parseModuleConfig', {
495
- enumerable: true,
496
- get: function () {
497
- return parseModuleConfig;
498
- }
521
+ Object.defineProperty(exports, "loadWorkspaceSettings", {
522
+ enumerable: true,
523
+ get: function() {
524
+ return loadWorkspaceSettings;
525
+ }
499
526
  });
500
- Object.defineProperty(exports, 'resolveAppSpec', {
501
- enumerable: true,
502
- get: function () {
503
- return resolveAppSpec;
504
- }
527
+ Object.defineProperty(exports, "parseModuleConfig", {
528
+ enumerable: true,
529
+ get: function() {
530
+ return parseModuleConfig;
531
+ }
505
532
  });
506
- //# sourceMappingURL=config-CNz5KaSR.cjs.map
533
+
534
+ //# sourceMappingURL=config-DXnkCEq0.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-DXnkCEq0.cjs","names":["kebabCase","existsSync","dirname","parse","join","isWorkspaceConfig","processConfig","allConstructGlobs","discover","sep","resolve","realpathSync","getAppGkmConfig"],"sources":["../src/workspace/derive.ts","../src/config.ts"],"sourcesContent":["/**\n * The apps a manifest implies.\n *\n * `gkm.config.ts` used to carry an `apps` block naming every app: its type, its\n * path, its port, its framework, which other apps it depended on. Every one of\n * those facts was already declared. A `StaticSite('Web', { path: 'apps/web' })`\n * and an `apps.web = { type: 'web', path: 'apps/web', framework: 'vite',\n * dependencies: ['api'] }` are the same statement written twice, and only one of\n * them was checked against anything — so the copy in config was free to drift,\n * and a surface config had no entry for simply never deployed.\n *\n * So the list comes from the graph. A `site` is an app, and so is every\n * `rest-api` — one surface, one container, at the `path` it declared.\n *\n * What config still supplies is what no graph can answer: the backends a cache\n * and a mailer resolve to, the deploy endpoint, the stage's domain.\n */\n\nimport {\n\ttype AppSpec,\n\ttype ConstructManifest,\n\tkebabCase,\n} from '@geekmidas/manifest';\nimport type {\n\tAppDomainConfig,\n\tDeployTarget,\n\tFramework,\n\tNormalizedAppConfig,\n\tNormalizedWorkspace,\n} from './types.js';\n\n/** Which frontend framework builds each site variant. */\nconst FRAMEWORKS: Record<string, Framework> = {\n\tstatic: 'vite',\n\tnext: 'nextjs',\n\ttanstack: 'tanstack-start',\n};\n\n/**\n * The app key a construct id becomes.\n *\n * The same kebab form every physical name is built from, so `Api` is `api` in\n * the config, `production-kitchen-sink-api` on Dokploy, and `API_URL` in an\n * environment — one id, three renderings, no second list.\n */\nexport function appKey(id: string): string {\n\treturn kebabCase(id);\n}\n\n/**\n * The app serving a surface: its own, always.\n *\n * Every surface gets a container. There is no arrangement in which one runs\n * inside another — two surfaces in a process share a filesystem, an\n * environment, and every credential either was granted, so an auth server\n * beside an API is one bug in the API away from being read by it.\n */\nexport function hostOf(\n\tmanifest: ConstructManifest,\n\tid: string,\n): string | undefined {\n\tconst declaration = manifest[id];\n\tif (!declaration || declaration.kind !== 'rest-api') return undefined;\n\n\treturn id;\n}\n\n/**\n * Local ports, assigned so that adding a site does not renumber the others.\n *\n * Backends first, then the site holding the base domain, then the rest\n * alphabetically. The ordering is arbitrary but it is *fixed*, which is the\n * property that matters: a port that moves when an unrelated app is added is a\n * port nobody can put in a bookmark. A construct that names its own port keeps\n * it, and is skipped here.\n */\nfunction assignPorts(apps: Record<string, NormalizedAppConfig>): void {\n\tconst rank = (\n\t\tname: string,\n\t\tapp: NormalizedAppConfig,\n\t): [number, number, string] => [\n\t\tapp.type === 'backend' ? 0 : app.type === 'web' ? 1 : 2,\n\t\tapp.root ? 0 : 1,\n\t\tname,\n\t];\n\n\tconst ordered = Object.entries(apps).sort(([aName, a], [bName, b]) => {\n\t\tconst [at, ar, an] = rank(aName, a);\n\t\tconst [bt, br, bn] = rank(bName, b);\n\t\treturn at - bt || ar - br || an.localeCompare(bn);\n\t});\n\n\tconst taken = new Set(\n\t\tordered.map(([, app]) => app.port).filter((p): p is number => !!p),\n\t);\n\n\tlet next = 3000;\n\tfor (const [, app] of ordered) {\n\t\tif (app.port) continue;\n\t\twhile (taken.has(next)) next += 1;\n\t\tapp.port = next;\n\t\ttaken.add(next);\n\t}\n}\n\n/**\n * Whichever site holds the base domain.\n *\n * The convention first — a site named `web` — because it is one people already\n * rely on. Then an explicit `root: true`. A project with one site needs neither.\n */\nfunction markRoot(apps: Record<string, NormalizedAppConfig>): void {\n\tconst sites = Object.entries(apps).filter(([, a]) => a.type === 'web');\n\tif (sites.length === 0) return;\n\tif (sites.some(([, a]) => a.root)) return;\n\n\tconst chosen =\n\t\tsites.find(([name]) => name === 'web') ??\n\t\t(sites.length === 1 ? sites[0] : undefined);\n\tif (chosen) chosen[1].root = true;\n}\n\nexport function derivedApps(\n\tmanifest: ConstructManifest,\n\tworkspace: NormalizedWorkspace,\n): Record<string, NormalizedAppConfig> {\n\tconst apps: Record<string, NormalizedAppConfig> = {};\n\tconst defaultTarget: DeployTarget = workspace.deploy?.default ?? 'dokploy';\n\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\t// Three kinds are apps: a site, a mobile app and an HTTP surface. A worker\n\t\t// is not one — it names the process that runs a cron or a subscriber, and\n\t\t// that process is the app's server, which already exists. Everything else\n\t\t// is a resource one of them uses.\n\t\tif (\n\t\t\tdeclaration.kind !== 'site' &&\n\t\t\tdeclaration.kind !== 'mobile-app' &&\n\t\t\tdeclaration.kind !== 'rest-api'\n\t\t)\n\t\t\tcontinue;\n\n\t\t// No opt-in to be had. Each says where it lives.\n\t\tconst spec: AppSpec =\n\t\t\tdeclaration.kind === 'site' || declaration.kind === 'mobile-app'\n\t\t\t\t? declaration.app\n\t\t\t\t: {\n\t\t\t\t\t\tpath: declaration.path,\n\t\t\t\t\t\t...(declaration.telescope ? { telescope: true } : {}),\n\t\t\t\t\t};\n\n\t\tconst name = appKey(id);\n\t\t// A config entry of the same name still wins, so a workspace can override\n\t\t// one field without restating the app. Nothing in this repo needs to.\n\t\tconst configured = workspace.apps[name];\n\n\t\tapps[name] = {\n\t\t\t...configured,\n\t\t\ttype:\n\t\t\t\tdeclaration.kind === 'site'\n\t\t\t\t\t? 'web'\n\t\t\t\t\t: declaration.kind === 'mobile-app'\n\t\t\t\t\t\t? 'mobile'\n\t\t\t\t\t\t: 'backend',\n\t\t\tpath: spec.path,\n\t\t\tport: spec.port ?? configured?.port ?? 0,\n\t\t\t// The label it answers on, under a stage's domain and locally alike.\n\t\t\t...((declaration.kind === 'rest-api' || declaration.kind === 'site') &&\n\t\t\tdeclaration.subdomain\n\t\t\t\t? { subdomain: declaration.subdomain }\n\t\t\t\t: {}),\n\t\t\tdependencies: [],\n\t\t\tresolvedDeployTarget: configured?.resolvedDeployTarget ?? defaultTarget,\n\t\t\t...(declaration.kind === 'site'\n\t\t\t\t? {\n\t\t\t\t\t\tframework: configured?.framework ?? FRAMEWORKS[declaration.variant],\n\t\t\t\t\t\t...(declaration.root ? { root: true } : {}),\n\t\t\t\t\t\t...(spec.config ? { config: spec.config } : {}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t...(declaration.kind === 'mobile-app'\n\t\t\t\t? {\n\t\t\t\t\t\tframework: configured?.framework ?? declaration.variant,\n\t\t\t\t\t\t...(spec.config ? { config: spec.config } : {}),\n\t\t\t\t\t}\n\t\t\t\t: {}),\n\t\t\t// One glob fans out to the six the build reads, because each generator\n\t\t\t// already inspects every export and keeps what it recognises. A\n\t\t\t// per-kind field still wins where one was given.\n\t\t\t...(spec.telescope !== undefined ? { telescope: spec.telescope } : {}),\n\t\t\t...(spec.openapi !== undefined ? { openapi: spec.openapi } : {}),\n\t\t\t...(spec.runtime !== undefined ? { runtime: spec.runtime } : {}),\n\t\t\t...(spec.env !== undefined ? { env: spec.env } : {}),\n\t\t\t...(spec.entry !== undefined ? { entry: spec.entry } : {}),\n\t\t\t...(configured?.domain\n\t\t\t\t? { domain: configured.domain as AppDomainConfig }\n\t\t\t\t: {}),\n\t\t} as NormalizedAppConfig;\n\t}\n\n\t// Build order, from the edges rather than from a hand-kept list. A site that\n\t// depends on a surface depends on the app that serves it — which for a\n\t// mounted auth server is its host, not a container that does not exist.\n\tfor (const [id, declaration] of Object.entries(manifest)) {\n\t\tif (\n\t\t\tdeclaration.kind !== 'site' &&\n\t\t\tdeclaration.kind !== 'mobile-app' &&\n\t\t\tdeclaration.kind !== 'rest-api'\n\t\t)\n\t\t\tcontinue;\n\n\t\tconst app = apps[appKey(id)];\n\t\tif (!app) continue;\n\n\t\t// A site names its edges `dependencies`; a surface names them `calls`.\n\t\tconst edges =\n\t\t\tdeclaration.kind === 'rest-api'\n\t\t\t\t? (declaration.calls ?? [])\n\t\t\t\t: (declaration.dependencies ?? []);\n\n\t\tconst names = new Set<string>();\n\t\tfor (const edge of edges) {\n\t\t\tif (edge.kind !== 'rest-api') continue;\n\t\t\tconst host = hostOf(manifest, edge.target);\n\t\t\tif (!host) continue;\n\t\t\tconst key = appKey(host);\n\t\t\tif (key !== appKey(id) && apps[key]) names.add(key);\n\t\t}\n\n\t\tapp.dependencies = [...names].sort();\n\t}\n\n\tmarkRoot(apps);\n\tassignPorts(apps);\n\n\t// Apps config declared that the graph knows nothing about — a `type: 'mobile'`\n\t// entry, or a hand-run process. Kept rather than dropped: config is still the\n\t// escape hatch for what nothing declares.\n\tfor (const [name, app] of Object.entries(workspace.apps)) {\n\t\tif (!apps[name]) apps[name] = app;\n\t}\n\n\treturn apps;\n}\n","import { existsSync, realpathSync } from 'node:fs';\nimport { dirname, join, parse, resolve, sep } from 'node:path';\nimport { output } from './output.js';\nimport { discover } from './reconcile/discover.js';\nimport type { GkmConfig } from './types.js';\nimport { derivedApps } from './workspace/derive.js';\nimport {\n\tallConstructGlobs,\n\tgetAppGkmConfig,\n\tisWorkspaceConfig,\n\ttype LoadedConfig,\n\ttype NormalizedAppConfig,\n\ttype NormalizedWorkspace,\n\tprocessConfig,\n\ttype WorkspaceConfig,\n} from './workspace/index.js';\n\n// What `gkm dev`'s discovery endpoint answers, for the tools that read it.\nexport type {\n\tAppStatus,\n\tDataApiKind,\n\tDiscoveredApp,\n\tDiscoveredDataApi,\n\tDiscoveredWorkspace,\n\tDiscoveryEvent,\n\tDiscoveryResponse,\n} from './dev/discovery.js';\nexport type { GkmConfig } from './types.js';\nexport type { LoadedConfig, WorkspaceConfig } from './workspace/index.js';\nexport { defineWorkspace } from './workspace/index.js';\nexport type { DevConfig } from './workspace/types.js';\n/**\n * Define GKM configuration with full TypeScript support.\n * This is an identity function that provides type safety and autocomplete.\n *\n * @example\n * ```ts\n * // gkm.config.ts\n * import { defineConfig } from '@geekmidas/cli/config';\n *\n * export default defineConfig({\n * routes: './src/endpoints/**\\/*.ts',\n * envParser: './src/config/env',\n * logger: './src/config/logger',\n * telescope: true,\n * });\n * ```\n */\nexport function defineConfig(config: GkmConfig): GkmConfig {\n\treturn config;\n}\n\nexport interface ParsedModuleConfig {\n\tpath: string;\n\timportPattern: string;\n}\n\n/**\n * Parse a module config string into path and import pattern.\n *\n * @param configString - Config string in format \"./path/to/module\" or \"./path/to/module#exportName\"\n * @param defaultAlias - The default alias name to use if no export name specified\n * @returns Object with path and import pattern\n *\n * @example\n * parseModuleConfig('./src/config/env', 'envParser')\n * // { path: './src/config/env', importPattern: 'envParser' }\n *\n * parseModuleConfig('./src/config/env#envParser', 'envParser')\n * // { path: './src/config/env', importPattern: '{ envParser }' }\n *\n * parseModuleConfig('./src/config/env#myEnv', 'envParser')\n * // { path: './src/config/env', importPattern: '{ myEnv as envParser }' }\n */\nexport function parseModuleConfig(\n\tconfigString: string,\n\tdefaultAlias: string,\n): ParsedModuleConfig {\n\tconst parts = configString.split('#');\n\tconst path = parts[0] ?? configString;\n\tconst exportName = parts[1];\n\tconst importPattern = !exportName\n\t\t? defaultAlias\n\t\t: exportName === defaultAlias\n\t\t\t? `{ ${defaultAlias} }`\n\t\t\t: `{ ${exportName} as ${defaultAlias} }`;\n\n\treturn { path, importPattern };\n}\n\nexport interface ConfigDiscoveryResult {\n\tconfigPath: string;\n\tworkspaceRoot: string;\n}\n\n/**\n * Find and return the path to the config file.\n *\n * Resolution order:\n * 1. GKM_CONFIG_PATH env var (set by workspace dev command)\n * 2. Walk up directory tree from cwd\n */\nfunction findConfigPath(cwd: string): ConfigDiscoveryResult {\n\tconst files = ['gkm.config.json', 'gkm.config.ts', 'gkm.config.js'];\n\n\t// Check GKM_CONFIG_PATH env var first (set by workspace dev command)\n\tconst envConfigPath = process.env.GKM_CONFIG_PATH;\n\tif (envConfigPath && existsSync(envConfigPath)) {\n\t\treturn {\n\t\t\tconfigPath: envConfigPath,\n\t\t\tworkspaceRoot: dirname(envConfigPath),\n\t\t};\n\t}\n\n\t// Walk up directory tree to find config\n\tlet currentDir = cwd;\n\tconst { root } = parse(currentDir);\n\n\twhile (currentDir !== root) {\n\t\tfor (const file of files) {\n\t\t\tconst configPath = join(currentDir, file);\n\t\t\tif (existsSync(configPath)) {\n\t\t\t\treturn {\n\t\t\t\t\tconfigPath,\n\t\t\t\t\tworkspaceRoot: currentDir,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\tcurrentDir = dirname(currentDir);\n\t}\n\n\tthrow new ConfigNotFound(cwd);\n}\n\n/** No gkm config in a directory or any of its parents. */\nexport class ConfigNotFound extends Error {\n\tconstructor(readonly cwd: string) {\n\t\tsuper(\n\t\t\t'Configuration file not found. Please create gkm.config.json, gkm.config.ts, or gkm.config.js in the project root.',\n\t\t);\n\t\tthis.name = 'ConfigNotFound';\n\t}\n}\n\ninterface RawConfigResult {\n\tconfig: GkmConfig | WorkspaceConfig;\n\tworkspaceRoot: string;\n}\n\n/**\n * Load raw configuration from file.\n */\nasync function loadRawConfig(cwd: string): Promise<RawConfigResult> {\n\tconst { configPath, workspaceRoot } = findConfigPath(cwd);\n\n\ttry {\n\t\tconst config = await import(configPath);\n\t\treturn {\n\t\t\tconfig: config.default,\n\t\t\tworkspaceRoot,\n\t\t};\n\t} catch (error) {\n\t\tthrow new Error(`Failed to load config: ${(error as Error).message}`);\n\t}\n}\n\n/**\n * Load configuration file (single-app format).\n * For backwards compatibility with existing code.\n *\n * @deprecated Use loadWorkspaceConfig for new code\n */\nexport async function loadConfig(\n\tcwd: string = process.cwd(),\n): Promise<GkmConfig> {\n\tconst { config } = await loadRawConfig(cwd);\n\n\t// If it's a workspace config, throw an error\n\tif (isWorkspaceConfig(config)) {\n\t\tthrow new Error(\n\t\t\t'Workspace configuration detected. Use loadWorkspaceConfig() instead.',\n\t\t);\n\t}\n\n\treturn config;\n}\n\n/**\n * Load configuration file and process it as a workspace.\n * Works with both single-app and workspace configurations.\n *\n * Single-app configs are automatically wrapped as a workspace with one app.\n *\n * @example\n * ```ts\n * const { type, workspace } = await loadWorkspaceConfig();\n *\n * if (type === 'workspace') {\n * console.log('Multi-app workspace:', workspace.apps);\n * } else {\n * console.log('Single app wrapped as workspace');\n * }\n * ```\n */\n/**\n * The workspace a directory belongs to, as its config states it — without\n * discovering its constructs.\n *\n * For callers that need a fact the config holds (where a stage's secrets are\n * stored) and nothing the graph adds. `loadWorkspaceConfig` imports every\n * construct module to derive the apps, which is a cost a secrets read should\n * not pay.\n */\nexport async function loadWorkspaceSettings(\n\tcwd: string = process.cwd(),\n): Promise<LoadedConfig['workspace']> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\treturn processConfig(config, workspaceRoot).workspace;\n}\n\nexport async function loadWorkspaceConfig(\n\tcwd: string = process.cwd(),\n): Promise<LoadedConfig> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\treturn withDerivedApps(processConfig(config, workspaceRoot));\n}\n\n/**\n * The loaded config, with its apps read off the graph.\n *\n * Here rather than at each call site because every command needs the same\n * answer, and the ones that forgot to ask were exactly the bugs: a site that\n * never deployed, a surface that could not be its own process. `gkm dev`,\n * `gkm build`, `gkm docker` and `gkm deploy` now all see the same apps without\n * any of them knowing a derivation happened.\n *\n * Discovery imports the construct modules — declarations only, not endpoints —\n * which is the same import the reconciler and the build already do. A workspace\n * with no `constructs` glob discovers nothing and keeps whatever its config\n * said, so nothing that worked before changes.\n *\n * A construct file that throws is reported and skipped rather than taking the\n * command down: `gkm dev` failing to start because a half-written declaration\n * cannot be imported is a worse failure than starting with the app it does not\n * describe yet.\n */\nasync function withDerivedApps(loaded: LoadedConfig): Promise<LoadedConfig> {\n\tconst globs = allConstructGlobs(loaded.workspace);\n\tif (globs.length === 0) {\n\t\tthrow new WorkspaceDeclaresNoConstructs(loaded.workspace.root);\n\t}\n\n\ttry {\n\t\tconst manifest = await discover({\n\t\t\tpatterns: globs,\n\t\t\tcwd: loaded.workspace.root,\n\t\t});\n\n\t\treturn {\n\t\t\t...loaded,\n\t\t\tmanifest,\n\t\t\tworkspace: {\n\t\t\t\t...loaded.workspace,\n\t\t\t\tapps: derivedApps(manifest, loaded.workspace),\n\t\t\t},\n\t\t};\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\toutput.warn(\n\t\t\t`⚠️ Could not read constructs, so apps come from config alone: ${message}`,\n\t\t);\n\t\treturn loaded;\n\t}\n}\n\n/**\n * A workspace with no `constructs` glob.\n *\n * In v10 every address, container and app comes from what the workspace\n * declares — there is no second path that reads a hand-written compose file or\n * an `apps` block's ports. A config that declares nothing has nothing to run.\n */\nexport class WorkspaceDeclaresNoConstructs extends Error {\n\tconstructor(readonly root: string) {\n\t\tsuper(\n\t\t\t`The workspace at ${root} declares no constructs. Every workspace names ` +\n\t\t\t\t\"where its constructs live — `constructs: ['./constructs/**/*.ts', \" +\n\t\t\t\t\"'./apps/*/endpoints/**/*.ts']` in gkm.config.ts — and its apps, \" +\n\t\t\t\t'containers and URLs are derived from them.',\n\t\t);\n\t\tthis.name = 'WorkspaceDeclaresNoConstructs';\n\t}\n}\n\nexport interface AppConfigResult {\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tgkmConfig: GkmConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n\tappRoot: string;\n}\n\n/**\n * The app a directory is part of: the one whose `path` contains it.\n *\n * An app's path is the one its construct declares — `new RestApi('Api',\n * { path: 'apps/api' })` — read off the workspace the constructs were derived\n * into, never off the filesystem's package names. The deepest match wins, so\n * an app inside another app's folder is its own; the workspace root belongs to\n * no app unless one lives there.\n */\nfunction resolveWorkspaceApp(\n\tloadedConfig: LoadedConfig,\n\tcwd: string,\n): { key: string; app: NormalizedAppConfig } | undefined {\n\tconst here = real(cwd);\n\tlet found: { key: string; app: NormalizedAppConfig; dir: string } | undefined;\n\n\tfor (const [key, app] of Object.entries(loadedConfig.workspace.apps)) {\n\t\tconst dir = real(join(loadedConfig.workspace.root, app.path));\n\t\tconst inside = here === dir || here.startsWith(`${dir}${sep}`);\n\t\tif (inside && (!found || dir.length > found.dir.length)) {\n\t\t\tfound = { key, app, dir };\n\t\t}\n\t}\n\n\treturn found && { key: found.key, app: found.app };\n}\n\n/** A path with its symlinks resolved, where it exists — `/tmp` is `/private/tmp`. */\nfunction real(path: string): string {\n\tconst absolute = resolve(path);\n\treturn existsSync(absolute) ? realpathSync(absolute) : absolute;\n}\n\n/** A directory that no app in the workspace lives in. */\nexport class NotInAnApp extends Error {\n\tconstructor(\n\t\treadonly cwd: string,\n\t\treadonly apps: Readonly<Record<string, string>>,\n\t) {\n\t\tsuper(\n\t\t\t`${cwd} is not inside any app's path. Apps: ` +\n\t\t\t\tObject.entries(apps)\n\t\t\t\t\t.map(([key, path]) => `${key} (${path})`)\n\t\t\t\t\t.join(', ') +\n\t\t\t\t'.',\n\t\t);\n\t\tthis.name = 'NotInAnApp';\n\t}\n}\n\n/** Every app's path, by key — what `NotInAnApp` lists. */\nfunction appPaths(loadedConfig: LoadedConfig): Record<string, string> {\n\treturn Object.fromEntries(\n\t\tObject.entries(loadedConfig.workspace.apps).map(([key, app]) => [\n\t\t\tkey,\n\t\t\tapp.path,\n\t\t]),\n\t);\n}\n\n/**\n * The backend app a directory is part of, with its gkm config — found by the\n * `path` its construct declares.\n *\n * @example\n * ```ts\n * // From apps/api, where a construct declares `path: 'apps/api'`\n * const { app, workspace, workspaceRoot } = await loadAppConfig();\n * ```\n *\n * @throws {NotInAnApp} when no app's path contains the directory.\n * @throws {NotABackendApp} when the app it is in has no gkm config to run.\n */\nexport async function loadAppConfig(\n\tcwd: string = process.cwd(),\n): Promise<AppConfigResult> {\n\tconst { appName, app, workspace, workspaceRoot } =\n\t\tawait loadWorkspaceAppInfo(cwd);\n\n\tconst gkmConfig = getAppGkmConfig(workspace, appName);\n\tif (!gkmConfig) throw new NotABackendApp(appName);\n\n\treturn {\n\t\tappName,\n\t\tapp,\n\t\tgkmConfig,\n\t\tworkspace,\n\t\tworkspaceRoot,\n\t\tappRoot: join(workspaceRoot, app.path),\n\t};\n}\n\n/** The app a directory is in has no gkm config — a site, or an entry app. */\nexport class NotABackendApp extends Error {\n\tconstructor(readonly appName: string) {\n\t\tsuper(\n\t\t\t`App \"${appName}\" is not a backend app and cannot be run with gkm dev.`,\n\t\t);\n\t\tthis.name = 'NotABackendApp';\n\t}\n}\n\nexport interface WorkspaceAppInfo {\n\t/** The app's key in the workspace. */\n\tappName: string;\n\tapp: NormalizedAppConfig;\n\tworkspace: NormalizedWorkspace;\n\tworkspaceRoot: string;\n}\n\n/**\n * The app a directory is part of, frontend or backend — found by the `path`\n * its construct declares. Unlike `loadAppConfig`, the app need not have a\n * gkm config, which is what `gkm exec` and `gkm test` from a site need.\n *\n * @throws {NotInAnApp} when no app's path contains the directory.\n */\nexport async function loadWorkspaceAppInfo(\n\tcwd: string = process.cwd(),\n): Promise<WorkspaceAppInfo> {\n\tconst { config, workspaceRoot } = await loadRawConfig(cwd);\n\tconst loadedConfig = await withDerivedApps(\n\t\tprocessConfig(config, workspaceRoot),\n\t);\n\n\tconst resolved = resolveWorkspaceApp(loadedConfig, cwd);\n\tif (!resolved) throw new NotInAnApp(cwd, appPaths(loadedConfig));\n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M,YAAYC,kBAAAA,gBAAgB,WAAW,OAAO;CACpD,IAAI,CAAC,WAAW,MAAM,IAAI,eAAe,OAAO;CAEhD,OAAO;EACN;EACA;EACA;EACA;EACA;EACA,UAAA,GAASR,UAAAA,KAAAA,CAAK,eAAe,IAAI,IAAI;CACtC;AACD;;AAGA,IAAa,iBAAb,cAAoC,MAAM;CACpB;CAArB,YAAY,SAA0B;EACrC,MACC,QAAQ,QAAQ,uDACjB;EAHoB,KAAA,UAAA;EAIpB,KAAK,OAAO;CACb;AACD;;;;;;;;AAiBA,eAAsB,qBACrB,MAAc,QAAQ,IAAI,GACE;CAC5B,MAAM,EAAE,QAAQ,kBAAkB,MAAM,cAAc,GAAG;CACzD,MAAM,eAAe,MAAM,gBAC1BE,kBAAAA,cAAc,QAAQ,aAAa,CACpC;CAEA,MAAM,WAAW,oBAAoB,cAAc,GAAG;CACtD,IAAI,CAAC,UAAU,MAAM,IAAI,WAAW,KAAK,SAAS,YAAY,CAAC;CAE/D,OAAO;EACN,SAAS,SAAS;EAClB,KAAK,SAAS;EACd,WAAW,aAAa;EACxB;CACD;AACD"}
package/dist/config.cjs CHANGED
@@ -1,12 +1,15 @@
1
- require('./discover-DTmFeloL.cjs');
2
- const require_config = require('./config-CNz5KaSR.cjs');
3
- const require_workspace = require('./workspace-LKiNyaDy.cjs');
4
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_config = require("./config-DXnkCEq0.cjs");
3
+ const require_workspace = require("./workspace-B64Xk1Mb.cjs");
4
+ exports.ConfigNotFound = require_config.ConfigNotFound;
5
+ exports.NotABackendApp = require_config.NotABackendApp;
6
+ exports.NotInAnApp = require_config.NotInAnApp;
7
+ exports.WorkspaceDeclaresNoConstructs = require_config.WorkspaceDeclaresNoConstructs;
5
8
  exports.defineConfig = require_config.defineConfig;
6
9
  exports.defineWorkspace = require_workspace.defineWorkspace;
7
- exports.getAppNameFromCwd = require_config.getAppNameFromCwd;
8
10
  exports.loadAppConfig = require_config.loadAppConfig;
9
11
  exports.loadConfig = require_config.loadConfig;
10
12
  exports.loadWorkspaceAppInfo = require_config.loadWorkspaceAppInfo;
11
13
  exports.loadWorkspaceConfig = require_config.loadWorkspaceConfig;
12
- exports.parseModuleConfig = require_config.parseModuleConfig;
14
+ exports.loadWorkspaceSettings = require_config.loadWorkspaceSettings;
15
+ exports.parseModuleConfig = require_config.parseModuleConfig;