@geekmidas/cli 10.0.0-alpha.153 → 10.0.0-alpha.155

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 (163) hide show
  1. package/dist/{GoDaddyProvider-DHDuEgOS.mjs → GoDaddyProvider-CQ4YrB5P.mjs} +2 -2
  2. package/dist/{GoDaddyProvider-DHDuEgOS.mjs.map → GoDaddyProvider-CQ4YrB5P.mjs.map} +1 -1
  3. package/dist/{GoDaddyProvider-F9XB8Od5.cjs → GoDaddyProvider-H59_cXa0.cjs} +2 -2
  4. package/dist/{GoDaddyProvider-F9XB8Od5.cjs.map → GoDaddyProvider-H59_cXa0.cjs.map} +1 -1
  5. package/dist/{HostingerProvider-C0ZbaQBj.mjs → HostingerProvider-DBfHH0qT.mjs} +2 -2
  6. package/dist/{HostingerProvider-C0ZbaQBj.mjs.map → HostingerProvider-DBfHH0qT.mjs.map} +1 -1
  7. package/dist/{HostingerProvider-Cf8JZHII.cjs → HostingerProvider-DecF9ELH.cjs} +2 -2
  8. package/dist/{HostingerProvider-Cf8JZHII.cjs.map → HostingerProvider-DecF9ELH.cjs.map} +1 -1
  9. package/dist/{LegacyStateStore-CL8pSB1w.mjs → LegacyStateStore-Cz1ORtCx.mjs} +2 -2
  10. package/dist/{LegacyStateStore-CL8pSB1w.mjs.map → LegacyStateStore-Cz1ORtCx.mjs.map} +1 -1
  11. package/dist/{LegacyStateStore-CgNi3XJ_.cjs → LegacyStateStore-DwsnVS-2.cjs} +2 -2
  12. package/dist/{LegacyStateStore-CgNi3XJ_.cjs.map → LegacyStateStore-DwsnVS-2.cjs.map} +1 -1
  13. package/dist/{LocalStateStore-rtHfw0BF.cjs → LocalStateStore-BZ5b3sw4.cjs} +2 -2
  14. package/dist/{LocalStateStore-rtHfw0BF.cjs.map → LocalStateStore-BZ5b3sw4.cjs.map} +1 -1
  15. package/dist/{LocalStateStore-CY_Bry1E.mjs → LocalStateStore-dz7OkMGm.mjs} +2 -2
  16. package/dist/{LocalStateStore-CY_Bry1E.mjs.map → LocalStateStore-dz7OkMGm.mjs.map} +1 -1
  17. package/dist/{S3StateStore-CQcXWoxu.mjs → S3StateStore-Bda3aGqz.mjs} +4 -4
  18. package/dist/{S3StateStore-CQcXWoxu.mjs.map → S3StateStore-Bda3aGqz.mjs.map} +1 -1
  19. package/dist/{S3StateStore-DSL1gtik.cjs → S3StateStore-Dw9Dx_vy.cjs} +4 -4
  20. package/dist/{S3StateStore-DSL1gtik.cjs.map → S3StateStore-Dw9Dx_vy.cjs.map} +1 -1
  21. package/dist/{SSMStateStore-BqbVN9Xg.mjs → SSMStateStore-CcT6YJFd.mjs} +2 -2
  22. package/dist/{SSMStateStore-BqbVN9Xg.mjs.map → SSMStateStore-CcT6YJFd.mjs.map} +1 -1
  23. package/dist/{SSMStateStore-bzGNUN8_.cjs → SSMStateStore-DPZpYnda.cjs} +2 -2
  24. package/dist/{SSMStateStore-bzGNUN8_.cjs.map → SSMStateStore-DPZpYnda.cjs.map} +1 -1
  25. package/dist/{add-UREEeMOa.cjs → add-Bwek61Bv.cjs} +4 -4
  26. package/dist/{add-UREEeMOa.cjs.map → add-Bwek61Bv.cjs.map} +1 -1
  27. package/dist/{add-CCtY1DrL.mjs → add-Feiof1dz.mjs} +4 -4
  28. package/dist/{add-CCtY1DrL.mjs.map → add-Feiof1dz.mjs.map} +1 -1
  29. package/dist/{apps-BBo5-LK0.mjs → apps-C0kZVQpf.mjs} +98 -11
  30. package/dist/apps-C0kZVQpf.mjs.map +1 -0
  31. package/dist/{apps-CbIWhlye.cjs → apps-CrQhJueV.cjs} +109 -10
  32. package/dist/apps-CrQhJueV.cjs.map +1 -0
  33. package/dist/{bundler-Bn2HX4nE.cjs → bundler-CV-UpPpb.cjs} +6 -6
  34. package/dist/{bundler-Bn2HX4nE.cjs.map → bundler-CV-UpPpb.cjs.map} +1 -1
  35. package/dist/{bundler-CffmpkV3.mjs → bundler-o10_P4d9.mjs} +6 -6
  36. package/dist/{bundler-CffmpkV3.mjs.map → bundler-o10_P4d9.mjs.map} +1 -1
  37. package/dist/{cli-DvtRusay.cjs → cli-BO4qIuTd.cjs} +4 -4
  38. package/dist/{cli-DvtRusay.cjs.map → cli-BO4qIuTd.cjs.map} +1 -1
  39. package/dist/{cli-BLfIYaB3.mjs → cli-KFbKAyaH.mjs} +4 -4
  40. package/dist/{cli-BLfIYaB3.mjs.map → cli-KFbKAyaH.mjs.map} +1 -1
  41. package/dist/{compose-DSBTDhk5.mjs → compose-C-k9AoH0.mjs} +128 -17
  42. package/dist/compose-C-k9AoH0.mjs.map +1 -0
  43. package/dist/{compose-CGP0Nw2v.cjs → compose-CyGZOLcK.cjs} +128 -17
  44. package/dist/compose-CyGZOLcK.cjs.map +1 -0
  45. package/dist/{compose-DDJhIyfw.mjs → compose-D8fn0ebx.mjs} +4 -4
  46. package/dist/{compose-DDJhIyfw.mjs.map → compose-D8fn0ebx.mjs.map} +1 -1
  47. package/dist/{compose-Cdx-M3-g.cjs → compose-djwQcfQD.cjs} +4 -4
  48. package/dist/{compose-Cdx-M3-g.cjs.map → compose-djwQcfQD.cjs.map} +1 -1
  49. package/dist/{credentials-wid61zD2.mjs → credentials-DY_Cu5Ht.mjs} +5 -5
  50. package/dist/{credentials-wid61zD2.mjs.map → credentials-DY_Cu5Ht.mjs.map} +1 -1
  51. package/dist/{credentials-BryyjZPs.cjs → credentials-DixsjQcu.cjs} +5 -5
  52. package/dist/{credentials-BryyjZPs.cjs.map → credentials-DixsjQcu.cjs.map} +1 -1
  53. package/dist/deploy/public.cjs +10 -10
  54. package/dist/deploy/public.mjs +10 -10
  55. package/dist/{deploy-CDNFAKqC.mjs → deploy-DsWQ8kTC.mjs} +11 -11
  56. package/dist/{deploy-CDNFAKqC.mjs.map → deploy-DsWQ8kTC.mjs.map} +1 -1
  57. package/dist/{deploy-DCFfSmMK.cjs → deploy-DzYn1rNl.cjs} +11 -11
  58. package/dist/{deploy-DCFfSmMK.cjs.map → deploy-DzYn1rNl.cjs.map} +1 -1
  59. package/dist/{docker-MENEje7d.mjs → docker-CobK4rVH.mjs} +6 -5
  60. package/dist/{docker-MENEje7d.mjs.map → docker-CobK4rVH.mjs.map} +1 -1
  61. package/dist/{docker-D_cDbA9A.cjs → docker-DDHfNbM8.cjs} +6 -5
  62. package/dist/{docker-D_cDbA9A.cjs.map → docker-DDHfNbM8.cjs.map} +1 -1
  63. package/dist/{dokploy-iUWcPZvQ.mjs → dokploy-2bH8IDTX.mjs} +2 -2
  64. package/dist/{dokploy-iUWcPZvQ.mjs.map → dokploy-2bH8IDTX.mjs.map} +1 -1
  65. package/dist/{dokploy-Ds9KMB6j.cjs → dokploy-CCgBM22f.cjs} +2 -2
  66. package/dist/{dokploy-Ds9KMB6j.cjs.map → dokploy-CCgBM22f.cjs.map} +1 -1
  67. package/dist/{eas-C5jrsZeF.cjs → eas-8X90Y3ks.cjs} +2 -2
  68. package/dist/{eas-C5jrsZeF.cjs.map → eas-8X90Y3ks.cjs.map} +1 -1
  69. package/dist/{eas-Bv7SZlrg.mjs → eas-CYs_Grue.mjs} +2 -2
  70. package/dist/{eas-Bv7SZlrg.mjs.map → eas-CYs_Grue.mjs.map} +1 -1
  71. package/dist/{encryption-Bug_342m.cjs → encryption-BlvEsxDL.cjs} +2 -2
  72. package/dist/{encryption-Bug_342m.cjs.map → encryption-BlvEsxDL.cjs.map} +1 -1
  73. package/dist/{encryption-Bagl9knS.mjs → encryption-Bm9pJAlv.mjs} +2 -2
  74. package/dist/{encryption-Bagl9knS.mjs.map → encryption-Bm9pJAlv.mjs.map} +1 -1
  75. package/dist/{engine-B7Hm6yHL.cjs → engine-BL_34-M8.cjs} +8 -8
  76. package/dist/{engine-B7Hm6yHL.cjs.map → engine-BL_34-M8.cjs.map} +1 -1
  77. package/dist/{engine-CkJFeGuu.mjs → engine-CVgtgVgf.mjs} +8 -8
  78. package/dist/{engine-CkJFeGuu.mjs.map → engine-CVgtgVgf.mjs.map} +1 -1
  79. package/dist/{github--cBRadD-.cjs → github-Ci0PUjjW.cjs} +6 -6
  80. package/dist/{github--cBRadD-.cjs.map → github-Ci0PUjjW.cjs.map} +1 -1
  81. package/dist/{github-COo0o_dI.mjs → github-j9ytVxlm.mjs} +6 -6
  82. package/dist/{github-COo0o_dI.mjs.map → github-j9ytVxlm.mjs.map} +1 -1
  83. package/dist/{googlePlay-CkE6OZml.mjs → googlePlay-CvYKw65D.mjs} +4 -4
  84. package/dist/{googlePlay-CkE6OZml.mjs.map → googlePlay-CvYKw65D.mjs.map} +1 -1
  85. package/dist/{googlePlay-CmSg_6bz.cjs → googlePlay-jR8oRAzy.cjs} +4 -4
  86. package/dist/{googlePlay-CmSg_6bz.cjs.map → googlePlay-jR8oRAzy.cjs.map} +1 -1
  87. package/dist/index.cjs +59 -59
  88. package/dist/index.cjs.map +1 -1
  89. package/dist/index.mjs +59 -59
  90. package/dist/index.mjs.map +1 -1
  91. package/dist/{local-BjSgGOpF.cjs → local-5DkpRnl2.cjs} +2 -2
  92. package/dist/{local-BjSgGOpF.cjs.map → local-5DkpRnl2.cjs.map} +1 -1
  93. package/dist/{local-D4YcMzMd.mjs → local-pFyO21et.mjs} +2 -2
  94. package/dist/{local-D4YcMzMd.mjs.map → local-pFyO21et.mjs.map} +1 -1
  95. package/dist/{migrate-Bgw27ucL.mjs → migrate-C1SSvzNZ.mjs} +2 -2
  96. package/dist/{migrate-Bgw27ucL.mjs.map → migrate-C1SSvzNZ.mjs.map} +1 -1
  97. package/dist/{migrate-C8FXW2vU.cjs → migrate-CPoStsvd.cjs} +4 -4
  98. package/dist/{migrate-C8FXW2vU.cjs.map → migrate-CPoStsvd.cjs.map} +1 -1
  99. package/dist/{migrate-C6PbVtPI.cjs → migrate-DKep6Tol.cjs} +2 -2
  100. package/dist/{migrate-C6PbVtPI.cjs.map → migrate-DKep6Tol.cjs.map} +1 -1
  101. package/dist/{migrate-DaxK8mbZ.mjs → migrate-Dv8Qk0jw.mjs} +4 -4
  102. package/dist/{migrate-DaxK8mbZ.mjs.map → migrate-Dv8Qk0jw.mjs.map} +1 -1
  103. package/dist/{notes-D2fjIErC.cjs → notes-CFCdqMQ4.cjs} +2 -2
  104. package/dist/{notes-D2fjIErC.cjs.map → notes-CFCdqMQ4.cjs.map} +1 -1
  105. package/dist/{notes-B05dtIdF.mjs → notes-Dwz8jmoh.mjs} +2 -2
  106. package/dist/{notes-B05dtIdF.mjs.map → notes-Dwz8jmoh.mjs.map} +1 -1
  107. package/dist/{projectBucket-DW1QMOLF.mjs → projectBucket-Daak2eUn.mjs} +2 -2
  108. package/dist/{projectBucket-DW1QMOLF.mjs.map → projectBucket-Daak2eUn.mjs.map} +1 -1
  109. package/dist/{projectBucket-BkdKxCQ9.cjs → projectBucket-UCuebUhW.cjs} +2 -2
  110. package/dist/{projectBucket-BkdKxCQ9.cjs.map → projectBucket-UCuebUhW.cjs.map} +1 -1
  111. package/dist/{publish-De0WIoeb.cjs → publish-CBuMAY04.cjs} +2 -2
  112. package/dist/{publish-De0WIoeb.cjs.map → publish-CBuMAY04.cjs.map} +1 -1
  113. package/dist/{publish-p23AqJV9.mjs → publish-DibqEZ2a.mjs} +2 -2
  114. package/dist/{publish-p23AqJV9.mjs.map → publish-DibqEZ2a.mjs.map} +1 -1
  115. package/dist/{resolve-CLAv6ugd.mjs → resolve-BF4-f30m.mjs} +4 -4
  116. package/dist/{resolve-CLAv6ugd.mjs.map → resolve-BF4-f30m.mjs.map} +1 -1
  117. package/dist/{resolve-cgPmnYYs.cjs → resolve-BjgqLxcZ.cjs} +4 -4
  118. package/dist/{resolve-cgPmnYYs.cjs.map → resolve-BjgqLxcZ.cjs.map} +1 -1
  119. package/dist/{rollback-BSwqHG7-.cjs → rollback-BXkzAkAh.cjs} +5 -5
  120. package/dist/{rollback-BSwqHG7-.cjs.map → rollback-BXkzAkAh.cjs.map} +1 -1
  121. package/dist/{rollback-Kfu-u1Ja.mjs → rollback-DBewZGz9.mjs} +5 -5
  122. package/dist/{rollback-Kfu-u1Ja.mjs.map → rollback-DBewZGz9.mjs.map} +1 -1
  123. package/dist/{s3-B_Y8YIBy.mjs → s3-CR8gEP-7.mjs} +2 -2
  124. package/dist/{s3-B_Y8YIBy.mjs.map → s3-CR8gEP-7.mjs.map} +1 -1
  125. package/dist/{s3-SZo3_eJV.cjs → s3-Cp2eA2v_.cjs} +2 -2
  126. package/dist/{s3-SZo3_eJV.cjs.map → s3-Cp2eA2v_.cjs.map} +1 -1
  127. package/dist/{serverSetup-Cqg1RFGl.cjs → serverSetup-0eV8bl75.cjs} +5 -5
  128. package/dist/{serverSetup-Cqg1RFGl.cjs.map → serverSetup-0eV8bl75.cjs.map} +1 -1
  129. package/dist/{serverSetup-B1Vh7ZtI.mjs → serverSetup-B9BPzpUQ.mjs} +5 -5
  130. package/dist/{serverSetup-B1Vh7ZtI.mjs.map → serverSetup-B9BPzpUQ.mjs.map} +1 -1
  131. package/dist/{sniffer-DK40zMnG.cjs → sniffer-0wN20Fuy.cjs} +6 -6
  132. package/dist/{sniffer-DK40zMnG.cjs.map → sniffer-0wN20Fuy.cjs.map} +1 -1
  133. package/dist/{sniffer-CZAwpkah.mjs → sniffer-C2yPOlOW.mjs} +6 -6
  134. package/dist/{sniffer-CZAwpkah.mjs.map → sniffer-C2yPOlOW.mjs.map} +1 -1
  135. package/dist/{snsSubscriptions-Cp7doA_C.mjs → snsSubscriptions-CtOrP15M.mjs} +2 -2
  136. package/dist/{snsSubscriptions-Cp7doA_C.mjs.map → snsSubscriptions-CtOrP15M.mjs.map} +1 -1
  137. package/dist/{snsSubscriptions-D8YYmNcf.cjs → snsSubscriptions-DR3drFJK.cjs} +2 -2
  138. package/dist/{snsSubscriptions-D8YYmNcf.cjs.map → snsSubscriptions-DR3drFJK.cjs.map} +1 -1
  139. package/dist/{sst-Bf5FZC12.mjs → sst-BF85FnBg.mjs} +4 -4
  140. package/dist/{sst-Bf5FZC12.mjs.map → sst-BF85FnBg.mjs.map} +1 -1
  141. package/dist/{sst-Bj5x4qtW.cjs → sst-fbVtyw_h.cjs} +4 -4
  142. package/dist/{sst-Bj5x4qtW.cjs.map → sst-fbVtyw_h.cjs.map} +1 -1
  143. package/dist/{stack-C0V1Jm57.cjs → stack-CB0U6NiV.cjs} +38 -9
  144. package/dist/stack-CB0U6NiV.cjs.map +1 -0
  145. package/dist/{stack-DyKwnVrO.mjs → stack-ZV2le8OB.mjs} +38 -9
  146. package/dist/stack-ZV2le8OB.mjs.map +1 -0
  147. package/dist/{stage-jweO7ZpZ.cjs → stage-B6bQKczF.cjs} +5 -5
  148. package/dist/{stage-jweO7ZpZ.cjs.map → stage-B6bQKczF.cjs.map} +1 -1
  149. package/dist/{stage-4jY7016s.mjs → stage-CPtCIwru.mjs} +5 -5
  150. package/dist/{stage-4jY7016s.mjs.map → stage-CPtCIwru.mjs.map} +1 -1
  151. package/dist/target/public.cjs +1 -1
  152. package/dist/target/public.mjs +1 -1
  153. package/dist/{terminal-CKfjtEyy.cjs → terminal-CyB5bRPt.cjs} +2 -2
  154. package/dist/{terminal-CKfjtEyy.cjs.map → terminal-CyB5bRPt.cjs.map} +1 -1
  155. package/dist/{terminal-CKuv6CB4.mjs → terminal-b_4H0MHd.mjs} +2 -2
  156. package/dist/{terminal-CKuv6CB4.mjs.map → terminal-b_4H0MHd.mjs.map} +1 -1
  157. package/package.json +15 -15
  158. package/dist/apps-BBo5-LK0.mjs.map +0 -1
  159. package/dist/apps-CbIWhlye.cjs.map +0 -1
  160. package/dist/compose-CGP0Nw2v.cjs.map +0 -1
  161. package/dist/compose-DSBTDhk5.mjs.map +0 -1
  162. package/dist/stack-C0V1Jm57.cjs.map +0 -1
  163. package/dist/stack-DyKwnVrO.mjs.map +0 -1
@@ -1,8 +1,8 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-C0BPl7ul.cjs");
2
2
  const require_errors = require("./errors-DMC4Umsb.cjs");
3
- const require_credentials = require("./credentials-BryyjZPs.cjs");
3
+ const require_credentials = require("./credentials-DixsjQcu.cjs");
4
4
  const require_workspace = require("./workspace-1szcahj9.cjs");
5
- const require_compose = require("./compose-Cdx-M3-g.cjs");
5
+ const require_compose = require("./compose-djwQcfQD.cjs");
6
6
  const require_SubscriberGenerator = require("./SubscriberGenerator-BNJyPmXJ.cjs");
7
7
  const require_config = require("./config-juUyBlb1.cjs");
8
8
  const require_types = require("./types-Bl_CwZC9.cjs");
@@ -2338,8 +2338,12 @@ const OFFLINE_BUILD_ADDRESS = "127.0.0.1";
2338
2338
  * ones, and the running container resolves them as anything else does. A
2339
2339
  * stage secret named for the bundle is someone else's host (an analytics
2340
2340
  * service, a store) and is left alone, as are `localhost` and an address.
2341
+ *
2342
+ * None for a site that pre-renders against its stage (`prerender: 'stage'`):
2343
+ * it is built once those hosts answer, and has to reach them.
2341
2344
  */
2342
2345
  function offlineBuildHosts(site, manifest, resolve) {
2346
+ if (site.prerender === "stage") return [];
2343
2347
  const sources = [(0, _geekmidas_manifest.provideKey)(site.id, "url"), ...Object.values((0, _geekmidas_manifest.publicEnvFor)(site, manifest))];
2344
2348
  const hosts = /* @__PURE__ */ new Set();
2345
2349
  for (const source of sources) {
@@ -2450,6 +2454,20 @@ const STATIC_SITE_IMAGE = "caddy:2.10-alpine";
2450
2454
  * Dockerfile says which version it runs.
2451
2455
  */
2452
2456
  const DEFAULT_BASE_IMAGE = "node:22.23.4-alpine";
2457
+ /**
2458
+ * The build secret a site that pre-renders against its stage reads the root
2459
+ * certificate of the stage's edge from — gkm's local CA, on the local stage,
2460
+ * whose hosts no public root vouches for. A certificate, not a key; a secret
2461
+ * only because a build has no other way to be handed a file it should not
2462
+ * keep. Absent on a deployed stage, whose certificates are public ones.
2463
+ */
2464
+ const LOCAL_CA_BUILD_SECRET = "gkm_local_ca";
2465
+ /**
2466
+ * The build argument naming the deploy a site that pre-renders against its
2467
+ * stage is built for — new on every deploy, so the layer that fetches the
2468
+ * stage's data is never served from Docker's cache.
2469
+ */
2470
+ const PRERENDER_RUN_ARG = "GKM_PRERENDER_RUN";
2453
2471
  const LOCKFILES = [
2454
2472
  ["pnpm-lock.yaml", "pnpm"],
2455
2473
  ["bun.lockb", "bun"],
@@ -2793,8 +2811,8 @@ RUN cd ${root} && GKM_BIN="$(node -e '${FIND_GKM_BIN}')" && \\
2793
2811
 
2794
2812
  # \`gkm exec\` in this build injects the build args, never a stage's secrets
2795
2813
  ENV ${IMAGE_BUILD_ENV}=1
2796
- # No stage is reachable from this build: the site's APIs are not up yet
2797
- ENV ${BUILD_OFFLINE_ENV}=1${generate}`;
2814
+ ${options.prerender ? `# Built once the site's APIs are up on its stage: it pre-renders from them` : `# No stage is reachable from this build: the site's APIs are not up yet
2815
+ ENV ${BUILD_OFFLINE_ENV}=1`}${generate}`;
2798
2816
  }
2799
2817
  /**
2800
2818
  * Build the site with turbo. Loose env mode, so the task sees what the
@@ -2804,7 +2822,14 @@ ENV ${BUILD_OFFLINE_ENV}=1${generate}`;
2804
2822
  */
2805
2823
  function siteBuild(options) {
2806
2824
  const { turbo } = layout(options);
2807
- return `RUN ${turbo} run build --filter='${options.turboPackage}' --env-mode=loose`;
2825
+ const build = `${turbo} run build --filter='${options.turboPackage}' --env-mode=loose`;
2826
+ if (!options.prerender) return `RUN ${build}`;
2827
+ const ca = `/run/secrets/${LOCAL_CA_BUILD_SECRET}`;
2828
+ return `ARG ${PRERENDER_RUN_ARG}=""
2829
+ RUN --mount=type=secret,id=${LOCAL_CA_BUILD_SECRET},required=false \\
2830
+ echo "prerendered for: \${${PRERENDER_RUN_ARG}:-any run}" && \\
2831
+ if [ -s ${ca} ]; then export NODE_EXTRA_CA_CERTS=${ca}; fi && \\
2832
+ ${build}`;
2808
2833
  }
2809
2834
  /**
2810
2835
  * The encrypted credentials, from a build secret — never an ARG, which is
@@ -5184,6 +5209,7 @@ var apps_exports = /* @__PURE__ */ require_rolldown_runtime.__exportAll({
5184
5209
  appEnvKeys: () => appEnvKeys,
5185
5210
  appProcess: () => appProcess,
5186
5211
  appServices: () => appServices,
5212
+ callerKeys: () => callerKeys,
5187
5213
  constructKeys: () => constructKeys,
5188
5214
  dockerfileOf: () => dockerfileOf,
5189
5215
  healthcheck: () => healthcheck,
@@ -5268,7 +5294,40 @@ function networkEnv(plan, options, hostOf = (container) => container) {
5268
5294
  }
5269
5295
  /**
5270
5296
  * The keys one app's environment may hold: what its own declaration provides
5271
- * and requires, and what each construct it has an edge to provides.
5297
+ * and requires, what each construct it has an edge to provides, and — for a
5298
+ * surface — the identity of each client with an edge to it.
5299
+ *
5300
+ * The one rule for every command and stage: `gkm dev`, `gkm exec` and `gkm
5301
+ * test` hand an app these keys (through `processEnvKeys`), `gkm compose`
5302
+ * writes them to its env file, and `gkm docker`'s apps profile to its
5303
+ * service. A key missing here is missing everywhere, so an app that reads it
5304
+ * fails on its first local request rather than in production.
5305
+ *
5306
+ * What an edge `caller.dependsOn([target])` hands each side, `<C>` and `<T>`
5307
+ * being the caller's and the target's ids (`provideKey`) — keep this list and
5308
+ * `apps/docs/guide/edges.md` in step with the code below:
5309
+ *
5310
+ * - `rest-api`: the caller gets `<T>_URL`. The target gets `<C>_URL` from a
5311
+ * site caller and `<C>_SCHEME` from a mobile app caller (`callerKeys`).
5312
+ * - `websocket-api`: the caller gets `<T>_URL`, and a server process also
5313
+ * `<T>_PUBLISHER_CONNECTION_STRING`. The target gets what a `rest-api`
5314
+ * does.
5315
+ * - `queue`, `topic`: the caller gets the target's `provides` and
5316
+ * `EVENT_PUBLISHER_CONNECTION_STRING`. The target gets nothing.
5317
+ * - `objects`: the target's `provides`, its file server's, and the S3 key
5318
+ * pair (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`).
5319
+ * - `inbox`: the target's `provides`, and the local relay token.
5320
+ * - anything else (a database, cache, secret, credential, external API…):
5321
+ * the target's `provides`. The target gets nothing.
5322
+ *
5323
+ * Beside the keys, a surface's `<T>_TRUSTED_ORIGINS` lists every caller's
5324
+ * origin (a mobile app's as its scheme) and `<T>_COOKIE_DOMAIN` the parent
5325
+ * they share — values of the surface's own keys, derived from the same
5326
+ * inbound edges (`surfaceEnv`).
5327
+ *
5328
+ * A site or mobile app is a bundle: it also gets the public-prefixed name of
5329
+ * each of those its bundler inlines (`publicEnvFor`: `VITE_API_URL`,
5330
+ * `EXPO_PUBLIC_API_URL`), and never a `Telemetry` node's keys.
5272
5331
  *
5273
5332
  * The edges, not the manifest. Every app used to be handed every key the
5274
5333
  * workspace resolved — a web app got the database's owner URL and the auth
@@ -5277,8 +5336,7 @@ function networkEnv(plan, options, hostOf = (container) => container) {
5277
5336
  * app's environment from its edges; so does this.
5278
5337
  *
5279
5338
  * One hop: a surface an app calls is reached over HTTP, so its URL is the
5280
- * app's business and its database is not. A site also gets the public
5281
- * variant of each key its bundle inlines (`NEXT_PUBLIC_API_URL`).
5339
+ * app's business and its database is not.
5282
5340
  *
5283
5341
  * A surface's process runs its own endpoints and nothing else. A Worker's
5284
5342
  * crons, queue consumers and subscribers run in the worker's own process
@@ -5291,13 +5349,14 @@ function networkEnv(plan, options, hostOf = (container) => container) {
5291
5349
  function appEnvKeys(manifest, appName) {
5292
5350
  const entry = Object.entries(manifest).find(([id, d]) => (d.kind === "rest-api" || d.kind === "websocket-api" || d.kind === "site" || d.kind === "mobile-app") && require_config.appKey(id) === appName);
5293
5351
  if (!entry) return void 0;
5294
- const [, declaration] = entry;
5352
+ const [id, declaration] = entry;
5295
5353
  const keys = /* @__PURE__ */ new Set([
5296
5354
  ...declaration.provides ?? [],
5297
5355
  ...declaration.requires ?? [],
5298
5356
  ...declaration.kind === "rest-api" ? declaration.endpoints.flatMap((endpoint) => endpoint.requires ?? []) : []
5299
5357
  ]);
5300
5358
  addEdgeKeys(manifest, (0, _geekmidas_manifest.dependenciesOf)(declaration).map((edge) => edge.target), keys, declaration.kind === "site" || declaration.kind === "mobile-app");
5359
+ if (declaration.kind === "rest-api" || declaration.kind === "websocket-api") for (const key of callerKeys(manifest, id)) keys.add(key);
5301
5360
  if (declaration.kind === "site" || declaration.kind === "mobile-app") {
5302
5361
  for (const key of _geekmidas_manifest.TELEMETRY_KEYS) keys.delete(key);
5303
5362
  for (const key of Object.keys((0, _geekmidas_manifest.publicEnvFor)(declaration, manifest))) keys.add(key);
@@ -5419,6 +5478,34 @@ function appProcess(workspace, manifest, background, appName) {
5419
5478
  processors: hosted(() => processorUnits(workspace, manifest))
5420
5479
  };
5421
5480
  }
5481
+ /**
5482
+ * What a surface is told about the clients that call it: the identity it
5483
+ * links and redirects back to.
5484
+ *
5485
+ * An API that finishes an OAuth callback by sending a phone back into the app
5486
+ * builds `<scheme>://…`; one that mails a link to the site builds it on the
5487
+ * site's address. Both are the caller's own key, named by the caller's id —
5488
+ * `APP_SCHEME` for `MobileApp('App')`, `WEB_URL` for `StaticSite('Web')` — so
5489
+ * two apps calling one API arrive as `APP_SCHEME` and `ADMIN_APP_SCHEME`.
5490
+ *
5491
+ * Clients only. A surface or a worker that calls this one is something it
5492
+ * answers, never somewhere it sends a user, so nothing of theirs comes back
5493
+ * along the edge. Their origins still reach the surface, folded into its
5494
+ * `<ID>_TRUSTED_ORIGINS`.
5495
+ */
5496
+ function callerKeys(manifest, surfaceId) {
5497
+ const keys = [];
5498
+ for (const caller of (0, _geekmidas_manifest.dependentsOf)(manifest, surfaceId)) {
5499
+ const declaration = manifest[caller];
5500
+ if (declaration?.kind === "mobile-app") keys.push((0, _geekmidas_manifest.provideKey)(caller, "scheme"));
5501
+ else if (declaration?.kind === "site") keys.push((0, _geekmidas_manifest.provideKey)(caller, "url"));
5502
+ }
5503
+ return keys;
5504
+ }
5505
+ /**
5506
+ * What a caller gets for each construct it has an edge to — the left half of
5507
+ * the table on {@link appEnvKeys}.
5508
+ */
5422
5509
  function addEdgeKeys(manifest, edges, keys, client = false) {
5423
5510
  for (const id of edges) {
5424
5511
  const bucket = require_discover.eventsEdgeBucket(id);
@@ -5562,6 +5649,12 @@ Object.defineProperty(exports, "LEGACY_LOCAL_LOGIN", {
5562
5649
  return LEGACY_LOCAL_LOGIN;
5563
5650
  }
5564
5651
  });
5652
+ Object.defineProperty(exports, "LOCAL_CA_BUILD_SECRET", {
5653
+ enumerable: true,
5654
+ get: function() {
5655
+ return LOCAL_CA_BUILD_SECRET;
5656
+ }
5657
+ });
5565
5658
  Object.defineProperty(exports, "LOCAL_TLD", {
5566
5659
  enumerable: true,
5567
5660
  get: function() {
@@ -5580,6 +5673,12 @@ Object.defineProperty(exports, "ORIGIN_VERIFY_HEADER", {
5580
5673
  return ORIGIN_VERIFY_HEADER;
5581
5674
  }
5582
5675
  });
5676
+ Object.defineProperty(exports, "PRERENDER_RUN_ARG", {
5677
+ enumerable: true,
5678
+ get: function() {
5679
+ return PRERENDER_RUN_ARG;
5680
+ }
5681
+ });
5583
5682
  Object.defineProperty(exports, "PROCESSORS_DEV_PREFIX", {
5584
5683
  enumerable: true,
5585
5684
  get: function() {
@@ -6145,4 +6244,4 @@ Object.defineProperty(exports, "workspace_exports", {
6145
6244
  }
6146
6245
  });
6147
6246
 
6148
- //# sourceMappingURL=apps-CbIWhlye.cjs.map
6247
+ //# sourceMappingURL=apps-CrQhJueV.cjs.map