@geekmidas/cli 10.0.0-alpha.4 → 10.0.0-alpha.40

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 (257) hide show
  1. package/README.md +52 -74
  2. package/bin/adjacent-tsconfig.mjs +97 -0
  3. package/bin/gkm.mjs +7 -1
  4. package/dist/{HostingerProvider-h3EbEp-Z.cjs → HostingerProvider-BZFGYYVA.cjs} +21 -22
  5. package/dist/HostingerProvider-BZFGYYVA.cjs.map +1 -0
  6. package/dist/{HostingerProvider-Cft7lEYr.mjs → HostingerProvider-Bh6K7QYz.mjs} +20 -21
  7. package/dist/HostingerProvider-Bh6K7QYz.mjs.map +1 -0
  8. package/dist/{LocalStateProvider-Db9SEjyH.cjs → LocalStateProvider-7HR6SS2t.cjs} +11 -6
  9. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +1 -0
  10. package/dist/{LocalStateProvider-Bn6tS-oL.mjs → LocalStateProvider-D7QyJoLM.mjs} +10 -4
  11. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +1 -0
  12. package/dist/{openapi-CA0yJUTN.cjs → OpenApiTsGenerator-B4Kj_qNU.cjs} +142 -303
  13. package/dist/OpenApiTsGenerator-B4Kj_qNU.cjs.map +1 -0
  14. package/dist/{openapi-kkQbsRVj.mjs → OpenApiTsGenerator-CEh3EKN3.mjs} +113 -255
  15. package/dist/OpenApiTsGenerator-CEh3EKN3.mjs.map +1 -0
  16. package/dist/{Route53Provider-RdpUDJQk.mjs → Route53Provider-Cvj40A8I.mjs} +12 -12
  17. package/dist/Route53Provider-Cvj40A8I.mjs.map +1 -0
  18. package/dist/{Route53Provider-di2fMM5N.cjs → Route53Provider-DVILBsvV.cjs} +20 -21
  19. package/dist/Route53Provider-DVILBsvV.cjs.map +1 -0
  20. package/dist/{SSMStateProvider-BRt2py-A.mjs → SSMStateProvider-B0Hu1MKZ.mjs} +13 -4
  21. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +1 -0
  22. package/dist/{SSMStateProvider-DyX8s9HI.cjs → SSMStateProvider-VrQ-yeqd.cjs} +17 -9
  23. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +1 -0
  24. package/dist/aws-DkHdTV-p.cjs +61 -0
  25. package/dist/aws-DkHdTV-p.cjs.map +1 -0
  26. package/dist/aws-DojzQnLd.mjs +61 -0
  27. package/dist/aws-DojzQnLd.mjs.map +1 -0
  28. package/dist/{backup-provisioner-BrsHwYG0.cjs → backup-provisioner-BmhIO_Yr.cjs} +21 -19
  29. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +1 -0
  30. package/dist/{backup-provisioner-Bgj5Vi_L.mjs → backup-provisioner-DIVCbfee.mjs} +10 -7
  31. package/dist/backup-provisioner-DIVCbfee.mjs.map +1 -0
  32. package/dist/{bundler-Be8Zg4Wd.mjs → bundler--fyybf1N.mjs} +19 -30
  33. package/dist/bundler--fyybf1N.mjs.map +1 -0
  34. package/dist/{bundler-BY1OmV1e.cjs → bundler-By6_sXiL.cjs} +20 -32
  35. package/dist/bundler-By6_sXiL.cjs.map +1 -0
  36. package/dist/{config-WRdsQYZK.mjs → config-5watB1D0.mjs} +142 -154
  37. package/dist/config-5watB1D0.mjs.map +1 -0
  38. package/dist/{config-C21ocYNd.cjs → config-CJ-PAb7M.cjs} +209 -210
  39. package/dist/config-CJ-PAb7M.cjs.map +1 -0
  40. package/dist/config.cjs +9 -6
  41. package/dist/config.d.cts +62 -33
  42. package/dist/config.d.cts.map +1 -1
  43. package/dist/config.d.mts +62 -33
  44. package/dist/config.d.mts.map +1 -1
  45. package/dist/config.mjs +3 -5
  46. package/dist/deploy/sniffer-envkit-patch.cjs +18 -10
  47. package/dist/deploy/sniffer-envkit-patch.cjs.map +1 -1
  48. package/dist/deploy/sniffer-envkit-patch.d.cts +0 -2
  49. package/dist/deploy/sniffer-envkit-patch.d.cts.map +1 -1
  50. package/dist/deploy/sniffer-envkit-patch.d.mts +0 -2
  51. package/dist/deploy/sniffer-envkit-patch.d.mts.map +1 -1
  52. package/dist/deploy/sniffer-envkit-patch.mjs +10 -2
  53. package/dist/deploy/sniffer-envkit-patch.mjs.map +1 -1
  54. package/dist/deploy/sniffer-hooks.cjs +13 -7
  55. package/dist/deploy/sniffer-hooks.cjs.map +1 -1
  56. package/dist/deploy/sniffer-hooks.d.cts +1 -2
  57. package/dist/deploy/sniffer-hooks.d.cts.map +1 -1
  58. package/dist/deploy/sniffer-hooks.d.mts +1 -2
  59. package/dist/deploy/sniffer-hooks.d.mts.map +1 -1
  60. package/dist/deploy/sniffer-hooks.mjs +9 -2
  61. package/dist/deploy/sniffer-hooks.mjs.map +1 -1
  62. package/dist/deploy/sniffer-loader.cjs +16 -7
  63. package/dist/deploy/sniffer-loader.cjs.map +1 -1
  64. package/dist/deploy/sniffer-loader.d.cts +1 -1
  65. package/dist/deploy/sniffer-loader.d.mts +1 -1
  66. package/dist/deploy/sniffer-loader.mjs +13 -2
  67. package/dist/deploy/sniffer-loader.mjs.map +1 -1
  68. package/dist/deploy/sniffer-routes-worker.cjs +11 -11
  69. package/dist/deploy/sniffer-routes-worker.cjs.map +1 -1
  70. package/dist/deploy/sniffer-routes-worker.d.cts +1 -1
  71. package/dist/deploy/sniffer-routes-worker.d.mts +1 -1
  72. package/dist/deploy/sniffer-routes-worker.mjs +3 -3
  73. package/dist/deploy/sniffer-routes-worker.mjs.map +1 -1
  74. package/dist/deploy/sniffer-worker.cjs +15 -6
  75. package/dist/deploy/sniffer-worker.cjs.map +1 -1
  76. package/dist/deploy/sniffer-worker.d.cts +1 -3
  77. package/dist/deploy/sniffer-worker.d.cts.map +1 -1
  78. package/dist/deploy/sniffer-worker.d.mts +1 -3
  79. package/dist/deploy/sniffer-worker.d.mts.map +1 -1
  80. package/dist/deploy/sniffer-worker.mjs +15 -4
  81. package/dist/deploy/sniffer-worker.mjs.map +1 -1
  82. package/dist/{discover-DTmFeloL.cjs → discover-B0f_kuNN.cjs} +118 -66
  83. package/dist/discover-B0f_kuNN.cjs.map +1 -0
  84. package/dist/{discover-CAlFgYec.mjs → discover-BLhf7V_J.mjs} +67 -22
  85. package/dist/discover-BLhf7V_J.mjs.map +1 -0
  86. package/dist/{emit-CbcRolsa.cjs → emit-BdoPFjZf.cjs} +53 -36
  87. package/dist/emit-BdoPFjZf.cjs.map +1 -0
  88. package/dist/{emit-CiZS_5Ub.mjs → emit-Bzq7JsMP.mjs} +24 -6
  89. package/dist/emit-Bzq7JsMP.mjs.map +1 -0
  90. package/dist/github-BAr8WGkR.cjs +213 -0
  91. package/dist/github-BAr8WGkR.cjs.map +1 -0
  92. package/dist/github-D5MthUlR.mjs +213 -0
  93. package/dist/github-D5MthUlR.mjs.map +1 -0
  94. package/dist/{index-DCtipn2h.d.cts → index-B3PeGOQp.d.cts} +4 -23
  95. package/dist/index-B3PeGOQp.d.cts.map +1 -0
  96. package/dist/{index-BThUzEIp.d.mts → index-BOyaGcCm.d.mts} +4 -23
  97. package/dist/index-BOyaGcCm.d.mts.map +1 -0
  98. package/dist/index.cjs +7071 -4519
  99. package/dist/index.cjs.map +1 -1
  100. package/dist/index.d.cts +1 -1
  101. package/dist/index.d.mts +1 -1
  102. package/dist/index.mjs +7117 -4586
  103. package/dist/index.mjs.map +1 -1
  104. package/dist/migrate-BVI3yqcE.mjs +736 -0
  105. package/dist/migrate-BVI3yqcE.mjs.map +1 -0
  106. package/dist/migrate-CFOUApUt.cjs +743 -0
  107. package/dist/migrate-CFOUApUt.cjs.map +1 -0
  108. package/dist/openapi.cjs +197 -8
  109. package/dist/openapi.cjs.map +1 -0
  110. package/dist/openapi.d.cts +47 -14
  111. package/dist/openapi.d.cts.map +1 -1
  112. package/dist/openapi.d.mts +47 -14
  113. package/dist/openapi.d.mts.map +1 -1
  114. package/dist/openapi.mjs +191 -5
  115. package/dist/openapi.mjs.map +1 -0
  116. package/dist/ready-D8UXsP6q.mjs +516 -0
  117. package/dist/ready-D8UXsP6q.mjs.map +1 -0
  118. package/dist/ready-mcxamf73.cjs +563 -0
  119. package/dist/ready-mcxamf73.cjs.map +1 -0
  120. package/dist/reconcile/public.cjs +4 -4
  121. package/dist/reconcile/public.d.cts +27 -26
  122. package/dist/reconcile/public.d.cts.map +1 -1
  123. package/dist/reconcile/public.d.mts +27 -26
  124. package/dist/reconcile/public.d.mts.map +1 -1
  125. package/dist/reconcile/public.mjs +3 -4
  126. package/dist/{reconcile-CFs8C_1a.mjs → reconcile--I7V4Klj.mjs} +4 -7
  127. package/dist/reconcile--I7V4Klj.mjs.map +1 -0
  128. package/dist/{reconcile-D0pimNiy.cjs → reconcile-CuCQBa5-.cjs} +5 -8
  129. package/dist/reconcile-CuCQBa5-.cjs.map +1 -0
  130. package/dist/rolldown-runtime-BhDjJH2R.mjs +15 -0
  131. package/dist/{chunk-CUT6urMc.cjs → rolldown-runtime-C0BPl7ul.cjs} +23 -10
  132. package/dist/storage-BzaUxmqe.mjs +124 -0
  133. package/dist/storage-BzaUxmqe.mjs.map +1 -0
  134. package/dist/storage-CSGoC3bK.cjs +152 -0
  135. package/dist/storage-CSGoC3bK.cjs.map +1 -0
  136. package/dist/store-DQgxT_WR.cjs +211 -0
  137. package/dist/store-DQgxT_WR.cjs.map +1 -0
  138. package/dist/store-DeGATCS-.mjs +182 -0
  139. package/dist/store-DeGATCS-.mjs.map +1 -0
  140. package/dist/types-0R124hrY.d.mts +6324 -0
  141. package/dist/types-0R124hrY.d.mts.map +1 -0
  142. package/dist/types-DfdYe31u.d.cts +6325 -0
  143. package/dist/types-DfdYe31u.d.cts.map +1 -0
  144. package/dist/vitest.cjs +65 -0
  145. package/dist/vitest.cjs.map +1 -0
  146. package/dist/vitest.d.cts +29 -0
  147. package/dist/vitest.d.cts.map +1 -0
  148. package/dist/vitest.d.mts +29 -0
  149. package/dist/vitest.d.mts.map +1 -0
  150. package/dist/vitest.mjs +65 -0
  151. package/dist/vitest.mjs.map +1 -0
  152. package/dist/workspace/index.cjs +3 -4
  153. package/dist/workspace/index.d.cts +3 -3
  154. package/dist/workspace/index.d.mts +3 -3
  155. package/dist/workspace/index.mjs +2 -3
  156. package/dist/{credentials-G1JwBoXH.cjs → workspace-BIqeeqcR.cjs} +2248 -1809
  157. package/dist/workspace-BIqeeqcR.cjs.map +1 -0
  158. package/dist/{workspace-BFMrAKqI.mjs → workspace-DOmIhiau.mjs} +863 -952
  159. package/dist/workspace-DOmIhiau.mjs.map +1 -0
  160. package/dist/{credentials-BBIRJVp4.mjs → workspace-DwS1JK5u.mjs} +2114 -1706
  161. package/dist/workspace-DwS1JK5u.mjs.map +1 -0
  162. package/dist/{workspace-BcucjwvA.cjs → workspace-RYSYtHP7.cjs} +1032 -1098
  163. package/dist/workspace-RYSYtHP7.cjs.map +1 -0
  164. package/package.json +29 -20
  165. package/dist/CachedStateProvider-BLo7zv7S.cjs +0 -3
  166. package/dist/CachedStateProvider-BxoAm-B2.mjs +0 -3
  167. package/dist/CachedStateProvider-CqPdW7CB.cjs +0 -60
  168. package/dist/CachedStateProvider-CqPdW7CB.cjs.map +0 -1
  169. package/dist/CachedStateProvider-DTniehMP.mjs +0 -54
  170. package/dist/CachedStateProvider-DTniehMP.mjs.map +0 -1
  171. package/dist/HostingerProvider-Cft7lEYr.mjs.map +0 -1
  172. package/dist/HostingerProvider-h3EbEp-Z.cjs.map +0 -1
  173. package/dist/LocalStateProvider-Bn6tS-oL.mjs.map +0 -1
  174. package/dist/LocalStateProvider-Db9SEjyH.cjs.map +0 -1
  175. package/dist/Route53Provider-RdpUDJQk.mjs.map +0 -1
  176. package/dist/Route53Provider-di2fMM5N.cjs.map +0 -1
  177. package/dist/SSMStateProvider-BRt2py-A.mjs.map +0 -1
  178. package/dist/SSMStateProvider-DyX8s9HI.cjs.map +0 -1
  179. package/dist/backup-provisioner-Bgj5Vi_L.mjs.map +0 -1
  180. package/dist/backup-provisioner-BrsHwYG0.cjs.map +0 -1
  181. package/dist/bundler-BY1OmV1e.cjs.map +0 -1
  182. package/dist/bundler-Be8Zg4Wd.mjs.map +0 -1
  183. package/dist/chunk-Duj1WY3L.mjs +0 -7
  184. package/dist/config-C21ocYNd.cjs.map +0 -1
  185. package/dist/config-WRdsQYZK.mjs.map +0 -1
  186. package/dist/credentials-B5zRHdAl.mjs +0 -141
  187. package/dist/credentials-B5zRHdAl.mjs.map +0 -1
  188. package/dist/credentials-BBIRJVp4.mjs.map +0 -1
  189. package/dist/credentials-BapzjyV5.cjs +0 -195
  190. package/dist/credentials-BapzjyV5.cjs.map +0 -1
  191. package/dist/credentials-G1JwBoXH.cjs.map +0 -1
  192. package/dist/discover-CAlFgYec.mjs.map +0 -1
  193. package/dist/discover-DTmFeloL.cjs.map +0 -1
  194. package/dist/dokploy-api-BS2xnJLZ.mjs +0 -3
  195. package/dist/dokploy-api-BsVH0y_s.cjs +0 -718
  196. package/dist/dokploy-api-BsVH0y_s.cjs.map +0 -1
  197. package/dist/dokploy-api-BuxDRo3l.cjs +0 -3
  198. package/dist/dokploy-api-aTFPz7_4.mjs +0 -706
  199. package/dist/dokploy-api-aTFPz7_4.mjs.map +0 -1
  200. package/dist/emit-CbcRolsa.cjs.map +0 -1
  201. package/dist/emit-CiZS_5Ub.mjs.map +0 -1
  202. package/dist/encryption-C6jaU0hE.cjs +0 -54
  203. package/dist/encryption-C6jaU0hE.cjs.map +0 -1
  204. package/dist/encryption-CHzzeR8a.cjs +0 -4
  205. package/dist/encryption-CQUncu7v.mjs +0 -3
  206. package/dist/encryption-D-abyhZx.mjs +0 -42
  207. package/dist/encryption-D-abyhZx.mjs.map +0 -1
  208. package/dist/fullstack-secrets-C-GGohke.cjs +0 -111
  209. package/dist/fullstack-secrets-C-GGohke.cjs.map +0 -1
  210. package/dist/fullstack-secrets-D1o9-G5l.mjs +0 -87
  211. package/dist/fullstack-secrets-D1o9-G5l.mjs.map +0 -1
  212. package/dist/generator-CNzBw7g5.cjs +0 -289
  213. package/dist/generator-CNzBw7g5.cjs.map +0 -1
  214. package/dist/generator-VE2JrFlY.mjs +0 -253
  215. package/dist/generator-VE2JrFlY.mjs.map +0 -1
  216. package/dist/index-BThUzEIp.d.mts.map +0 -1
  217. package/dist/index-DCtipn2h.d.cts.map +0 -1
  218. package/dist/openapi-CA0yJUTN.cjs.map +0 -1
  219. package/dist/openapi-kkQbsRVj.mjs.map +0 -1
  220. package/dist/openapi-react-query-Byltvm_7.mjs +0 -167
  221. package/dist/openapi-react-query-Byltvm_7.mjs.map +0 -1
  222. package/dist/openapi-react-query-CmJ1xDbn.cjs +0 -173
  223. package/dist/openapi-react-query-CmJ1xDbn.cjs.map +0 -1
  224. package/dist/openapi-react-query.cjs +0 -4
  225. package/dist/openapi-react-query.d.cts +0 -11
  226. package/dist/openapi-react-query.d.cts.map +0 -1
  227. package/dist/openapi-react-query.d.mts +0 -11
  228. package/dist/openapi-react-query.d.mts.map +0 -1
  229. package/dist/openapi-react-query.mjs +0 -4
  230. package/dist/reconcile-CFs8C_1a.mjs.map +0 -1
  231. package/dist/reconcile-D0pimNiy.cjs.map +0 -1
  232. package/dist/setup-B5_oHHUj.cjs +0 -11
  233. package/dist/setup-Cm2UnAdh.cjs +0 -473
  234. package/dist/setup-Cm2UnAdh.cjs.map +0 -1
  235. package/dist/setup-DXvRLTZN.mjs +0 -443
  236. package/dist/setup-DXvRLTZN.mjs.map +0 -1
  237. package/dist/setup-ZijS4qeC.mjs +0 -11
  238. package/dist/storage-BJmzYxt8.cjs +0 -363
  239. package/dist/storage-BJmzYxt8.cjs.map +0 -1
  240. package/dist/storage-BM9hGpgv.cjs +0 -7
  241. package/dist/storage-Bi24WfoW.mjs +0 -297
  242. package/dist/storage-Bi24WfoW.mjs.map +0 -1
  243. package/dist/storage-CYlGwWTj.mjs +0 -3
  244. package/dist/sync-CmEuNZsB.mjs +0 -76
  245. package/dist/sync-CmEuNZsB.mjs.map +0 -1
  246. package/dist/sync-D306yOWu.cjs +0 -4
  247. package/dist/sync-SizaChmC.cjs +0 -93
  248. package/dist/sync-SizaChmC.cjs.map +0 -1
  249. package/dist/sync-hOqAWHR6.mjs +0 -3
  250. package/dist/types-BhIl-COG.d.cts +0 -2184
  251. package/dist/types-BhIl-COG.d.cts.map +0 -1
  252. package/dist/types-C-arnQ1r.d.mts +0 -2184
  253. package/dist/types-C-arnQ1r.d.mts.map +0 -1
  254. package/dist/workspace-BFMrAKqI.mjs.map +0 -1
  255. package/dist/workspace-BcucjwvA.cjs.map +0 -1
  256. package/dist/workspace-DdJss8I6.cjs +0 -9
  257. package/dist/workspace-k4l3rsFh.mjs +0 -8
@@ -1,9 +1,9 @@
1
- const require_discover = require('../discover-DTmFeloL.cjs');
2
- const require_emit = require('../emit-CbcRolsa.cjs');
3
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_discover = require("../discover-B0f_kuNN.cjs");
3
+ const require_emit = require("../emit-BdoPFjZf.cjs");
4
4
  exports.MANIFEST_PATH = require_emit.MANIFEST_PATH;
5
5
  exports.discover = require_discover.discover;
6
6
  exports.isDeclarable = require_discover.isDeclarable;
7
7
  exports.manifestModule = require_emit.manifestModule;
8
8
  exports.withRoutes = require_emit.withRoutes;
9
- exports.writeManifestModule = require_emit.writeManifestModule;
9
+ exports.writeManifestModule = require_emit.writeManifestModule;
@@ -1,8 +1,6 @@
1
- import { CacheBackend, EmailBackend } from "../types-BhIl-COG.cjs";
1
+ import { n as EmailBackend, t as CacheBackend } from "../types-DfdYe31u.cjs";
2
2
  import { ConstructManifest, Declaration, RouteInfo } from "@geekmidas/manifest";
3
-
4
3
  //#region src/reconcile/discover.d.ts
5
-
6
4
  /** The construct face discovery needs: an id, and the ability to declare. */
7
5
  interface Declarable {
8
6
  id: string;
@@ -15,7 +13,7 @@ interface Declarable {
15
13
  * `service` is still a construct, and requiring one would exclude the kinds that
16
14
  * own no address.
17
15
  */
18
- declare function isDeclarable(value: unknown): value is Declarable;
16
+ export declare function isDeclarable(value: unknown): value is Declarable;
19
17
  interface DiscoverOptions {
20
18
  /** The glob(s) to search. One pattern, not one per kind. */
21
19
  patterns: string | readonly string[];
@@ -39,6 +37,18 @@ interface DiscoverOptions {
39
37
  * caller, which wants the manifest and nothing else, is unchanged.
40
38
  */
41
39
  sources?: Record<string, ConstructSource>;
40
+ /**
41
+ * Filled in, when provided, with the ids each owner's runnables declared an
42
+ * edge to — keyed by the surface an endpoint was built from, or the worker
43
+ * a cron or subscriber was.
44
+ *
45
+ * A runnable is not a declaration: a surface's endpoints are found by the
46
+ * glob, not listed by the surface, so its node says `endpoints: []` until a
47
+ * build folds the routes in. Anything deciding what an app's process reaches
48
+ * — which keys its container is given — needs those edges before any build,
49
+ * and discovery is already importing the files they are in.
50
+ */
51
+ runnables?: Record<string, string[]>;
42
52
  }
43
53
  /** Where a construct was declared, and under what name. */
44
54
  interface ConstructSource {
@@ -46,6 +56,13 @@ interface ConstructSource {
46
56
  file: string;
47
57
  /** The name it was exported as — what an import statement has to say. */
48
58
  exportName: string;
59
+ /**
60
+ * The exported construct itself.
61
+ *
62
+ * What a declaration cannot say — whether it serves itself — the object can
63
+ * be asked, and discovery already imported it.
64
+ */
65
+ construct: unknown;
49
66
  }
50
67
  /**
51
68
  * Build the construct manifest for a project.
@@ -55,12 +72,11 @@ interface ConstructSource {
55
72
  *
56
73
  * @throws {DuplicateConstruct} when two exports claim one id.
57
74
  */
58
- declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
59
- /** Two constructs claiming one id. */
75
+ export declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
60
76
  //#endregion
61
77
  //#region src/reconcile/emit.d.ts
62
78
  /** Where the build writes it, relative to the app root. */
63
- declare const MANIFEST_PATH = ".gkm/manifest.ts";
79
+ export declare const MANIFEST_PATH = ".gkm/manifest.ts";
64
80
  /**
65
81
  * Fold the build's generated routes into the surface that serves them.
66
82
  *
@@ -89,37 +105,22 @@ declare const MANIFEST_PATH = ".gkm/manifest.ts";
89
105
  * document's contents depend on which `--provider` ran last. A manifest must not
90
106
  * do that.
91
107
  */
92
- declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
108
+ export declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
93
109
  perRoute: boolean;
94
110
  }): ConstructManifest;
95
- /**
96
- * Fold in the compute the build generated: functions, crons, queue workers and
97
- * topic subscribers.
98
- *
99
- * All four are named by their *export*, the same way an endpoint's handler is —
100
- * `CronGenerator` uses the export key as the name — so none of them can declare
101
- * themselves and all of them are the build's to add. That is why a `Function`
102
- * has no `declare()` and never will.
103
- *
104
- * A worker and a subscriber **nest** inside the queue or topic that triggers
105
- * them, because position carries the trigger. A function and a cron are
106
- * top-level, because nothing triggers them but a caller or a clock.
107
- */
108
-
109
111
  /**
110
112
  * The manifest as TypeScript source.
111
113
  *
112
114
  * Pure, so what gets written can be asserted without touching a filesystem.
113
115
  */
114
- declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
116
+ export declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
115
117
  /** Write it where the deploy config expects to import it from. */
116
- declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
118
+ export declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
117
119
  /** The choices that are deployment config rather than declaration. */
118
120
  interface Backends {
119
121
  cache?: CacheBackend;
120
122
  email?: EmailBackend;
121
123
  }
122
- //# sourceMappingURL=emit.d.ts.map
123
124
  //#endregion
124
- export { DiscoverOptions, MANIFEST_PATH, discover, isDeclarable, manifestModule, withRoutes, writeManifestModule };
125
+ export type { DiscoverOptions };
125
126
  //# sourceMappingURL=public.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.cts","names":[],"sources":["../../src/reconcile/discover.ts","../../src/reconcile/emit.ts"],"sourcesContent":[],"mappings":";;;;;;AAiGU,UAnEA,UAAA,CAmEA;;aAjEE;;ACKZ;AA8BA;;;;;AAIoB;AA2JJ,iBDxLA,YAAA,CCwLc,KAAA,EAAA,OAAA,CAAA,EAAA,KAAA,IDxLyB,UCwLzB;AAAA,UD5Kb,eAAA,CC4Ka;EAAA;EACF,QACjB,EAAA,MAAA,GAAA,SAAA,MAAA,EAAA;EAAa,GAAA,CAAA,EAAA,MAAA;EA8BF;;;;;AAIZ;EAUO,SAAA,CAAA,EAAQ,OAAA;EAAA;;;AAEJ;;;;;;;;YDtMV,eAAe;;;UAIT,eAAA;;;;;;;;;;;;;;iBAeK,QAAA,UACZ,kBACP,QAAQ;;;;AC5DX;AA8BgB,cA9BH,aAAA,GA8Ba,kBAAA;;;;;AAIN;AA2JpB;;;;AAEwB;AA8BxB;;;;;AAIU;AAUV;;;;AAEqB;;;;;;;;iBA/ML,UAAA,WACL,oCACO;;IAEf;;;;;;;;;;;;;;;;;;;;iBA2Ja,cAAA,WACL,8BACA;;iBA8BW,mBAAA,WACX,+CAEA,WACR;;UAUc,QAAA;UACR;UACA"}
1
+ {"version":3,"file":"public.d.cts","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;;;;;;;;;;;;EAYzB,YAAY;;;UAII;;EAEhB;;EAEA;;;;;;;EAOA;;;;;;;;;;wBAWqB,SACrB,SAAS,kBACP,QAAQ;;;;qBC/EE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,8 +1,6 @@
1
- import { CacheBackend, EmailBackend } from "../types-C-arnQ1r.mjs";
1
+ import { n as EmailBackend, t as CacheBackend } from "../types-0R124hrY.mjs";
2
2
  import { ConstructManifest, Declaration, RouteInfo } from "@geekmidas/manifest";
3
-
4
3
  //#region src/reconcile/discover.d.ts
5
-
6
4
  /** The construct face discovery needs: an id, and the ability to declare. */
7
5
  interface Declarable {
8
6
  id: string;
@@ -15,7 +13,7 @@ interface Declarable {
15
13
  * `service` is still a construct, and requiring one would exclude the kinds that
16
14
  * own no address.
17
15
  */
18
- declare function isDeclarable(value: unknown): value is Declarable;
16
+ export declare function isDeclarable(value: unknown): value is Declarable;
19
17
  interface DiscoverOptions {
20
18
  /** The glob(s) to search. One pattern, not one per kind. */
21
19
  patterns: string | readonly string[];
@@ -39,6 +37,18 @@ interface DiscoverOptions {
39
37
  * caller, which wants the manifest and nothing else, is unchanged.
40
38
  */
41
39
  sources?: Record<string, ConstructSource>;
40
+ /**
41
+ * Filled in, when provided, with the ids each owner's runnables declared an
42
+ * edge to — keyed by the surface an endpoint was built from, or the worker
43
+ * a cron or subscriber was.
44
+ *
45
+ * A runnable is not a declaration: a surface's endpoints are found by the
46
+ * glob, not listed by the surface, so its node says `endpoints: []` until a
47
+ * build folds the routes in. Anything deciding what an app's process reaches
48
+ * — which keys its container is given — needs those edges before any build,
49
+ * and discovery is already importing the files they are in.
50
+ */
51
+ runnables?: Record<string, string[]>;
42
52
  }
43
53
  /** Where a construct was declared, and under what name. */
44
54
  interface ConstructSource {
@@ -46,6 +56,13 @@ interface ConstructSource {
46
56
  file: string;
47
57
  /** The name it was exported as — what an import statement has to say. */
48
58
  exportName: string;
59
+ /**
60
+ * The exported construct itself.
61
+ *
62
+ * What a declaration cannot say — whether it serves itself — the object can
63
+ * be asked, and discovery already imported it.
64
+ */
65
+ construct: unknown;
49
66
  }
50
67
  /**
51
68
  * Build the construct manifest for a project.
@@ -55,12 +72,11 @@ interface ConstructSource {
55
72
  *
56
73
  * @throws {DuplicateConstruct} when two exports claim one id.
57
74
  */
58
- declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
59
- /** Two constructs claiming one id. */
75
+ export declare function discover(options: DiscoverOptions): Promise<ConstructManifest>;
60
76
  //#endregion
61
77
  //#region src/reconcile/emit.d.ts
62
78
  /** Where the build writes it, relative to the app root. */
63
- declare const MANIFEST_PATH = ".gkm/manifest.ts";
79
+ export declare const MANIFEST_PATH = ".gkm/manifest.ts";
64
80
  /**
65
81
  * Fold the build's generated routes into the surface that serves them.
66
82
  *
@@ -89,37 +105,22 @@ declare const MANIFEST_PATH = ".gkm/manifest.ts";
89
105
  * document's contents depend on which `--provider` ran last. A manifest must not
90
106
  * do that.
91
107
  */
92
- declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
108
+ export declare function withRoutes(manifest: ConstructManifest, routes: readonly RouteInfo[], options: {
93
109
  perRoute: boolean;
94
110
  }): ConstructManifest;
95
- /**
96
- * Fold in the compute the build generated: functions, crons, queue workers and
97
- * topic subscribers.
98
- *
99
- * All four are named by their *export*, the same way an endpoint's handler is —
100
- * `CronGenerator` uses the export key as the name — so none of them can declare
101
- * themselves and all of them are the build's to add. That is why a `Function`
102
- * has no `declare()` and never will.
103
- *
104
- * A worker and a subscriber **nest** inside the queue or topic that triggers
105
- * them, because position carries the trigger. A function and a cron are
106
- * top-level, because nothing triggers them but a caller or a clock.
107
- */
108
-
109
111
  /**
110
112
  * The manifest as TypeScript source.
111
113
  *
112
114
  * Pure, so what gets written can be asserted without touching a filesystem.
113
115
  */
114
- declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
116
+ export declare function manifestModule(manifest: ConstructManifest, backends?: Backends): string;
115
117
  /** Write it where the deploy config expects to import it from. */
116
- declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
118
+ export declare function writeManifestModule(manifest: ConstructManifest, appRoot: string, backends?: Backends): Promise<string>;
117
119
  /** The choices that are deployment config rather than declaration. */
118
120
  interface Backends {
119
121
  cache?: CacheBackend;
120
122
  email?: EmailBackend;
121
123
  }
122
- //# sourceMappingURL=emit.d.ts.map
123
124
  //#endregion
124
- export { DiscoverOptions, MANIFEST_PATH, discover, isDeclarable, manifestModule, withRoutes, writeManifestModule };
125
+ export type { DiscoverOptions };
125
126
  //# sourceMappingURL=public.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public.d.mts","names":[],"sources":["../../src/reconcile/discover.ts","../../src/reconcile/emit.ts"],"sourcesContent":[],"mappings":";;;;;;AAiGU,UAnEA,UAAA,CAmEA;;aAjEE;;ACKZ;AA8BA;;;;;AAIoB;AA2JJ,iBDxLA,YAAA,CCwLc,KAAA,EAAA,OAAA,CAAA,EAAA,KAAA,IDxLyB,UCwLzB;AAAA,UD5Kb,eAAA,CC4Ka;EAAA;EACF,QACjB,EAAA,MAAA,GAAA,SAAA,MAAA,EAAA;EAAa,GAAA,CAAA,EAAA,MAAA;EA8BF;;;;;AAIZ;EAUO,SAAA,CAAA,EAAQ,OAAA;EAAA;;;AAEJ;;;;;;;;YDtMV,eAAe;;;UAIT,eAAA;;;;;;;;;;;;;;iBAeK,QAAA,UACZ,kBACP,QAAQ;;;;AC5DX;AA8BgB,cA9BH,aAAA,GA8Ba,kBAAA;;;;;AAIN;AA2JpB;;;;AAEwB;AA8BxB;;;;;AAIU;AAUV;;;;AAEqB;;;;;;;;iBA/ML,UAAA,WACL,oCACO;;IAEf;;;;;;;;;;;;;;;;;;;;iBA2Ja,cAAA,WACL,8BACA;;iBA8BW,mBAAA,WACX,+CAEA,WACR;;UAUc,QAAA;UACR;UACA"}
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;;;;;;;;;;;;EAYzB,YAAY;;;UAII;;EAEhB;;EAEA;;;;;;;EAOA;;;;;;;;;;wBAWqB,SACrB,SAAS,kBACP,QAAQ;;;;qBC/EE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,4 +1,3 @@
1
- import { discover, isDeclarable } from "../discover-CAlFgYec.mjs";
2
- import { MANIFEST_PATH, manifestModule, withRoutes, writeManifestModule } from "../emit-CiZS_5Ub.mjs";
3
-
4
- export { MANIFEST_PATH, discover, isDeclarable, manifestModule, withRoutes, writeManifestModule };
1
+ import { r as isDeclarable, t as discover } from "../discover-BLhf7V_J.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,6 +1,4 @@
1
- import "./generator-VE2JrFlY.mjs";
2
- import { generateFullstackCustomSecrets } from "./fullstack-secrets-D1o9-G5l.mjs";
3
-
1
+ import { t as generateFullstackCustomSecrets } from "./index.mjs";
4
2
  //#region src/secrets/reconcile.ts
5
3
  /**
6
4
  * Reconcile missing custom secrets for a workspace.
@@ -12,8 +10,7 @@ import { generateFullstackCustomSecrets } from "./fullstack-secrets-D1o9-G5l.mjs
12
10
  * @returns ReconcileResult if keys were added, null if secrets are up-to-date
13
11
  */
14
12
  function reconcileMissingSecrets(secrets, workspace, containers = []) {
15
- const isMultiApp = Object.keys(workspace.apps).length > 1;
16
- if (!isMultiApp) return null;
13
+ if (!(Object.keys(workspace.apps).length > 1)) return null;
17
14
  const expectedCustom = generateFullstackCustomSecrets(workspace, containers);
18
15
  const addedKeys = [];
19
16
  const mergedCustom = { ...secrets.custom };
@@ -31,7 +28,7 @@ function reconcileMissingSecrets(secrets, workspace, containers = []) {
31
28
  addedKeys
32
29
  };
33
30
  }
34
-
35
31
  //#endregion
36
32
  export { reconcileMissingSecrets };
37
- //# sourceMappingURL=reconcile-CFs8C_1a.mjs.map
33
+
34
+ //# sourceMappingURL=reconcile--I7V4Klj.mjs.map
@@ -0,0 +1 @@
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,6 +1,4 @@
1
- require('./generator-CNzBw7g5.cjs');
2
- const require_fullstack_secrets = require('./fullstack-secrets-C-GGohke.cjs');
3
-
1
+ const require_index = require("./index.cjs");
4
2
  //#region src/secrets/reconcile.ts
5
3
  /**
6
4
  * Reconcile missing custom secrets for a workspace.
@@ -12,9 +10,8 @@ const require_fullstack_secrets = require('./fullstack-secrets-C-GGohke.cjs');
12
10
  * @returns ReconcileResult if keys were added, null if secrets are up-to-date
13
11
  */
14
12
  function reconcileMissingSecrets(secrets, workspace, containers = []) {
15
- const isMultiApp = Object.keys(workspace.apps).length > 1;
16
- if (!isMultiApp) return null;
17
- const expectedCustom = require_fullstack_secrets.generateFullstackCustomSecrets(workspace, containers);
13
+ if (!(Object.keys(workspace.apps).length > 1)) return null;
14
+ const expectedCustom = require_index.generateFullstackCustomSecrets(workspace, containers);
18
15
  const addedKeys = [];
19
16
  const mergedCustom = { ...secrets.custom };
20
17
  for (const [key, value] of Object.entries(expectedCustom)) if (!(key in mergedCustom)) {
@@ -31,7 +28,7 @@ function reconcileMissingSecrets(secrets, workspace, containers = []) {
31
28
  addedKeys
32
29
  };
33
30
  }
34
-
35
31
  //#endregion
36
32
  exports.reconcileMissingSecrets = reconcileMissingSecrets;
37
- //# sourceMappingURL=reconcile-D0pimNiy.cjs.map
33
+
34
+ //# sourceMappingURL=reconcile-CuCQBa5-.cjs.map
@@ -0,0 +1 @@
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,15 @@
1
+ import { createRequire } from "node:module";
2
+ //#region \0rolldown/runtime.js
3
+ var __defProp = Object.defineProperty;
4
+ var __exportAll = (all, no_symbols) => {
5
+ let target = {};
6
+ for (var name in all) __defProp(target, name, {
7
+ get: all[name],
8
+ enumerable: true
9
+ });
10
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
11
+ return target;
12
+ };
13
+ var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
14
+ //#endregion
15
+ export { __require as n, __exportAll as t };
@@ -1,10 +1,19 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __exportAll = (all, no_symbols) => {
9
+ let target = {};
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
15
+ return target;
16
+ };
8
17
  var __copyProps = (to, from, except, desc) => {
9
18
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
19
  key = keys[i];
@@ -15,16 +24,20 @@ var __copyProps = (to, from, except, desc) => {
15
24
  }
16
25
  return to;
17
26
  };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
27
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
28
  value: mod,
20
29
  enumerable: true
21
30
  }) : target, mod));
22
-
23
31
  //#endregion
24
-
25
- Object.defineProperty(exports, '__toESM', {
26
- enumerable: true,
27
- get: function () {
28
- return __toESM;
29
- }
30
- });
32
+ Object.defineProperty(exports, "__exportAll", {
33
+ enumerable: true,
34
+ get: function() {
35
+ return __exportAll;
36
+ }
37
+ });
38
+ Object.defineProperty(exports, "__toESM", {
39
+ enumerable: true,
40
+ get: function() {
41
+ return __toESM;
42
+ }
43
+ });
@@ -0,0 +1,124 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
2
+ //#region src/secrets/storage.ts
3
+ var storage_exports = /* @__PURE__ */ __exportAll({
4
+ initStageSecrets: () => initStageSecrets,
5
+ maskPassword: () => maskPassword,
6
+ toEmbeddableSecrets: () => toEmbeddableSecrets,
7
+ validateEnvironmentVariables: () => validateEnvironmentVariables,
8
+ withCustomSecret: () => withCustomSecret
9
+ });
10
+ /**
11
+ * Initialize an empty StageSecrets object for a stage.
12
+ */
13
+ function initStageSecrets(stage) {
14
+ const now = (/* @__PURE__ */ new Date()).toISOString();
15
+ return {
16
+ stage,
17
+ createdAt: now,
18
+ updatedAt: now,
19
+ services: {},
20
+ urls: {},
21
+ custom: {}
22
+ };
23
+ }
24
+ /**
25
+ * Convert StageSecrets to embeddable format (flat key-value pairs).
26
+ * This is what gets encrypted and embedded in the bundle.
27
+ */
28
+ function toEmbeddableSecrets(secrets) {
29
+ return {
30
+ ...secrets.urls,
31
+ ...secrets.custom,
32
+ ...secrets.services.postgres && {
33
+ POSTGRES_USER: secrets.services.postgres.username,
34
+ POSTGRES_PASSWORD: secrets.services.postgres.password,
35
+ POSTGRES_DB: secrets.services.postgres.database ?? "app",
36
+ POSTGRES_HOST: secrets.services.postgres.host,
37
+ POSTGRES_PORT: String(secrets.services.postgres.port)
38
+ },
39
+ ...secrets.services.redis && {
40
+ REDIS_PASSWORD: secrets.services.redis.password,
41
+ REDIS_HOST: secrets.services.redis.host,
42
+ REDIS_PORT: String(secrets.services.redis.port)
43
+ },
44
+ ...secrets.services.minio && {
45
+ STORAGE_ACCESS_KEY_ID: secrets.services.minio.username,
46
+ STORAGE_SECRET_ACCESS_KEY: secrets.services.minio.password,
47
+ STORAGE_BUCKET: secrets.services.minio.bucket ?? "app",
48
+ STORAGE_REGION: "eu-west-1",
49
+ STORAGE_FORCE_PATH_STYLE: "true"
50
+ },
51
+ ...secrets.services.mailpit && {
52
+ SMTP_HOST: secrets.services.mailpit.host,
53
+ SMTP_PORT: String(secrets.services.mailpit.port),
54
+ SMTP_USER: secrets.services.mailpit.username,
55
+ SMTP_PASS: secrets.services.mailpit.password,
56
+ SMTP_SECURE: "false",
57
+ MAIL_FROM: "noreply@localhost"
58
+ },
59
+ ...secrets.services.localstack && {
60
+ AWS_ACCESS_KEY_ID: secrets.services.localstack.accessKeyId ?? secrets.services.localstack.username,
61
+ AWS_SECRET_ACCESS_KEY: secrets.services.localstack.password,
62
+ AWS_REGION: secrets.services.localstack.region ?? "us-east-1",
63
+ AWS_ENDPOINT_URL: `http://${secrets.services.localstack.host}:${secrets.services.localstack.port}`
64
+ },
65
+ ...secrets.services.pgboss && {
66
+ PGBOSS_DB_USER: secrets.services.pgboss.username,
67
+ PGBOSS_DB_PASSWORD: secrets.services.pgboss.password
68
+ }
69
+ };
70
+ }
71
+ /** The same secrets with one custom value set, and `updatedAt` moved on. */
72
+ function withCustomSecret(secrets, key, value) {
73
+ return {
74
+ ...secrets,
75
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
76
+ custom: {
77
+ ...secrets.custom,
78
+ [key]: value
79
+ }
80
+ };
81
+ }
82
+ /**
83
+ * Mask a password for display (show first 4 and last 2 chars).
84
+ */
85
+ function maskPassword(password) {
86
+ if (password.length <= 8) return "********";
87
+ return `${password.slice(0, 4)}${"*".repeat(password.length - 6)}${password.slice(-2)}`;
88
+ }
89
+ /**
90
+ * Validate that all required environment variables are present in secrets.
91
+ *
92
+ * @param requiredVars - Array of environment variable names required by the application
93
+ * @param secrets - Stage secrets to validate against
94
+ * @returns Validation result with missing and provided variables
95
+ *
96
+ * @example
97
+ * ```typescript
98
+ * const required = ['DATABASE_URL', 'API_KEY', 'JWT_SECRET'];
99
+ * const secrets = await secretsStoreFor(workspace, 'production').then((s) => s.read('production'));
100
+ * const result = validateEnvironmentVariables(required, secrets);
101
+ *
102
+ * if (!result.valid) {
103
+ * console.error(`Missing environment variables: ${result.missing.join(', ')}`);
104
+ * }
105
+ * ```
106
+ */
107
+ function validateEnvironmentVariables(requiredVars, secrets) {
108
+ const embeddable = toEmbeddableSecrets(secrets);
109
+ const availableVars = new Set(Object.keys(embeddable));
110
+ const missing = [];
111
+ const provided = [];
112
+ for (const varName of requiredVars) if (availableVars.has(varName)) provided.push(varName);
113
+ else missing.push(varName);
114
+ return {
115
+ valid: missing.length === 0,
116
+ missing: missing.sort(),
117
+ provided: provided.sort(),
118
+ required: [...requiredVars].sort()
119
+ };
120
+ }
121
+ //#endregion
122
+ export { withCustomSecret as a, toEmbeddableSecrets as i, maskPassword as n, storage_exports as r, initStageSecrets as t };
123
+
124
+ //# sourceMappingURL=storage-BzaUxmqe.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-BzaUxmqe.mjs","names":[],"sources":["../src/secrets/storage.ts"],"sourcesContent":["/**\n * What a stage's secrets are, independent of where they are kept: building\n * them, changing them, and handing them to a process. Where they are kept is a\n * {@link SecretsStore}'s business — see `secretsStoreFor`.\n */\n\nimport type { SecretsStore } from './store.js';\nimport type { EmbeddableSecrets, StageSecrets } from './types';\n\n/**\n * Initialize an empty StageSecrets object for a stage.\n */\nexport function initStageSecrets(stage: string): StageSecrets {\n\tconst now = new Date().toISOString();\n\treturn {\n\t\tstage,\n\t\tcreatedAt: now,\n\t\tupdatedAt: now,\n\t\tservices: {},\n\t\turls: {},\n\t\tcustom: {},\n\t};\n}\n\n/**\n * Convert StageSecrets to embeddable format (flat key-value pairs).\n * This is what gets encrypted and embedded in the bundle.\n */\nexport function toEmbeddableSecrets(secrets: StageSecrets): EmbeddableSecrets {\n\treturn {\n\t\t...secrets.urls,\n\t\t...secrets.custom,\n\t\t// Also include individual service credentials if needed\n\t\t...(secrets.services.postgres && {\n\t\t\tPOSTGRES_USER: secrets.services.postgres.username,\n\t\t\tPOSTGRES_PASSWORD: secrets.services.postgres.password,\n\t\t\tPOSTGRES_DB: secrets.services.postgres.database ?? 'app',\n\t\t\tPOSTGRES_HOST: secrets.services.postgres.host,\n\t\t\tPOSTGRES_PORT: String(secrets.services.postgres.port),\n\t\t}),\n\t\t...(secrets.services.redis && {\n\t\t\tREDIS_PASSWORD: secrets.services.redis.password,\n\t\t\tREDIS_HOST: secrets.services.redis.host,\n\t\t\tREDIS_PORT: String(secrets.services.redis.port),\n\t\t}),\n\t\t...(secrets.services.minio && {\n\t\t\tSTORAGE_ACCESS_KEY_ID: secrets.services.minio.username,\n\t\t\tSTORAGE_SECRET_ACCESS_KEY: secrets.services.minio.password,\n\t\t\tSTORAGE_BUCKET: secrets.services.minio.bucket ?? 'app',\n\t\t\tSTORAGE_REGION: 'eu-west-1',\n\t\t\tSTORAGE_FORCE_PATH_STYLE: 'true',\n\t\t}),\n\t\t...(secrets.services.mailpit && {\n\t\t\tSMTP_HOST: secrets.services.mailpit.host,\n\t\t\tSMTP_PORT: String(secrets.services.mailpit.port),\n\t\t\tSMTP_USER: secrets.services.mailpit.username,\n\t\t\tSMTP_PASS: secrets.services.mailpit.password,\n\t\t\tSMTP_SECURE: 'false',\n\t\t\tMAIL_FROM: 'noreply@localhost',\n\t\t}),\n\t\t...(secrets.services.localstack && {\n\t\t\tAWS_ACCESS_KEY_ID:\n\t\t\t\tsecrets.services.localstack.accessKeyId ??\n\t\t\t\tsecrets.services.localstack.username,\n\t\t\tAWS_SECRET_ACCESS_KEY: secrets.services.localstack.password,\n\t\t\tAWS_REGION: secrets.services.localstack.region ?? 'us-east-1',\n\t\t\tAWS_ENDPOINT_URL: `http://${secrets.services.localstack.host}:${secrets.services.localstack.port}`,\n\t\t}),\n\t\t...(secrets.services.pgboss && {\n\t\t\tPGBOSS_DB_USER: secrets.services.pgboss.username,\n\t\t\tPGBOSS_DB_PASSWORD: secrets.services.pgboss.password,\n\t\t}),\n\t};\n}\n\n/** The same secrets with one custom value set, and `updatedAt` moved on. */\nexport function withCustomSecret(\n\tsecrets: StageSecrets,\n\tkey: string,\n\tvalue: string,\n): StageSecrets {\n\treturn {\n\t\t...secrets,\n\t\tupdatedAt: new Date().toISOString(),\n\t\tcustom: { ...secrets.custom, [key]: value },\n\t};\n}\n\n/**\n * Mask a password for display (show first 4 and last 2 chars).\n */\nexport function maskPassword(password: string): string {\n\tif (password.length <= 8) {\n\t\treturn '********';\n\t}\n\treturn `${password.slice(0, 4)}${'*'.repeat(password.length - 6)}${password.slice(-2)}`;\n}\n\n/**\n * Result of environment variable validation.\n */\nexport interface EnvValidationResult {\n\t/** Whether all required environment variables are present */\n\tvalid: boolean;\n\t/** List of missing environment variable names */\n\tmissing: string[];\n\t/** List of environment variables that are provided */\n\tprovided: string[];\n\t/** List of environment variables that were required */\n\trequired: string[];\n}\n\n/**\n * Validate that all required environment variables are present in secrets.\n *\n * @param requiredVars - Array of environment variable names required by the application\n * @param secrets - Stage secrets to validate against\n * @returns Validation result with missing and provided variables\n *\n * @example\n * ```typescript\n * const required = ['DATABASE_URL', 'API_KEY', 'JWT_SECRET'];\n * const secrets = await secretsStoreFor(workspace, 'production').then((s) => s.read('production'));\n * const result = validateEnvironmentVariables(required, secrets);\n *\n * if (!result.valid) {\n * console.error(`Missing environment variables: ${result.missing.join(', ')}`);\n * }\n * ```\n */\nexport function validateEnvironmentVariables(\n\trequiredVars: string[],\n\tsecrets: StageSecrets,\n): EnvValidationResult {\n\tconst embeddable = toEmbeddableSecrets(secrets);\n\tconst availableVars = new Set(Object.keys(embeddable));\n\n\tconst missing: string[] = [];\n\tconst provided: string[] = [];\n\n\tfor (const varName of requiredVars) {\n\t\tif (availableVars.has(varName)) {\n\t\t\tprovided.push(varName);\n\t\t} else {\n\t\t\tmissing.push(varName);\n\t\t}\n\t}\n\n\treturn {\n\t\tvalid: missing.length === 0,\n\t\tmissing: missing.sort(),\n\t\tprovided: provided.sort(),\n\t\trequired: [...requiredVars].sort(),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,iBAAiB,OAA6B;CAC7D,MAAM,uBAAM,IAAI,KAAK,EAAA,CAAE,YAAY;CACnC,OAAO;EACN;EACA,WAAW;EACX,WAAW;EACX,UAAU,CAAC;EACX,MAAM,CAAC;EACP,QAAQ,CAAC;CACV;AACD;;;;;AAMA,SAAgB,oBAAoB,SAA0C;CAC7E,OAAO;EACN,GAAG,QAAQ;EACX,GAAG,QAAQ;EAEX,GAAI,QAAQ,SAAS,YAAY;GAChC,eAAe,QAAQ,SAAS,SAAS;GACzC,mBAAmB,QAAQ,SAAS,SAAS;GAC7C,aAAa,QAAQ,SAAS,SAAS,YAAY;GACnD,eAAe,QAAQ,SAAS,SAAS;GACzC,eAAe,OAAO,QAAQ,SAAS,SAAS,IAAI;EACrD;EACA,GAAI,QAAQ,SAAS,SAAS;GAC7B,gBAAgB,QAAQ,SAAS,MAAM;GACvC,YAAY,QAAQ,SAAS,MAAM;GACnC,YAAY,OAAO,QAAQ,SAAS,MAAM,IAAI;EAC/C;EACA,GAAI,QAAQ,SAAS,SAAS;GAC7B,uBAAuB,QAAQ,SAAS,MAAM;GAC9C,2BAA2B,QAAQ,SAAS,MAAM;GAClD,gBAAgB,QAAQ,SAAS,MAAM,UAAU;GACjD,gBAAgB;GAChB,0BAA0B;EAC3B;EACA,GAAI,QAAQ,SAAS,WAAW;GAC/B,WAAW,QAAQ,SAAS,QAAQ;GACpC,WAAW,OAAO,QAAQ,SAAS,QAAQ,IAAI;GAC/C,WAAW,QAAQ,SAAS,QAAQ;GACpC,WAAW,QAAQ,SAAS,QAAQ;GACpC,aAAa;GACb,WAAW;EACZ;EACA,GAAI,QAAQ,SAAS,cAAc;GAClC,mBACC,QAAQ,SAAS,WAAW,eAC5B,QAAQ,SAAS,WAAW;GAC7B,uBAAuB,QAAQ,SAAS,WAAW;GACnD,YAAY,QAAQ,SAAS,WAAW,UAAU;GAClD,kBAAkB,UAAU,QAAQ,SAAS,WAAW,KAAK,GAAG,QAAQ,SAAS,WAAW;EAC7F;EACA,GAAI,QAAQ,SAAS,UAAU;GAC9B,gBAAgB,QAAQ,SAAS,OAAO;GACxC,oBAAoB,QAAQ,SAAS,OAAO;EAC7C;CACD;AACD;;AAGA,SAAgB,iBACf,SACA,KACA,OACe;CACf,OAAO;EACN,GAAG;EACH,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;EAClC,QAAQ;GAAE,GAAG,QAAQ;IAAS,MAAM;EAAM;CAC3C;AACD;;;;AAKA,SAAgB,aAAa,UAA0B;CACtD,IAAI,SAAS,UAAU,GACtB,OAAO;CAER,OAAO,GAAG,SAAS,MAAM,GAAG,CAAC,IAAI,IAAI,OAAO,SAAS,SAAS,CAAC,IAAI,SAAS,MAAM,EAAE;AACrF;;;;;;;;;;;;;;;;;;;AAkCA,SAAgB,6BACf,cACA,SACsB;CACtB,MAAM,aAAa,oBAAoB,OAAO;CAC9C,MAAM,gBAAgB,IAAI,IAAI,OAAO,KAAK,UAAU,CAAC;CAErD,MAAM,UAAoB,CAAC;CAC3B,MAAM,WAAqB,CAAC;CAE5B,KAAK,MAAM,WAAW,cACrB,IAAI,cAAc,IAAI,OAAO,GAC5B,SAAS,KAAK,OAAO;MAErB,QAAQ,KAAK,OAAO;CAItB,OAAO;EACN,OAAO,QAAQ,WAAW;EAC1B,SAAS,QAAQ,KAAK;EACtB,UAAU,SAAS,KAAK;EACxB,UAAU,CAAC,GAAG,YAAY,CAAC,CAAC,KAAK;CAClC;AACD"}