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

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
  import { t as __exportAll } from "./rolldown-runtime-BhDjJH2R.mjs";
2
2
  import { t as GkmError } from "./errors-D8Gwp5kU.mjs";
3
- import { E as providerOf, R as externalsManifestName, T as eventsBackendFor, bt as gkmHome, w as cacheBackendFor } from "./credentials-wid61zD2.mjs";
3
+ import { E as providerOf, R as externalsManifestName, T as eventsBackendFor, bt as gkmHome, w as cacheBackendFor } from "./credentials-DY_Cu5Ht.mjs";
4
4
  import { R as stageSampleRate, _ as PUBLIC_ENV_PREFIXES, a as allConstructGlobs, ht as checkStageBackups, j as TEST_STAGE, yt as isReservedStageKey, z as telemetryEnv } from "./workspace-DFGsrjGD.mjs";
5
- import { $ as otlpHeaders, B as fakeKey, D as HOST_GATEWAY$1, F as emulatorEndpoint, G as serviceAddresses, H as portsOf, I as emulatorQueueUrl, J as LOGS_ORG, L as emulatorTopicArn, M as watchedBuckets, O as NOTIFICATION_RULE_PREFIX, P as EMULATOR_REGION, U as postgresImage, V as portKeys, W as primaryPortKey, Y as LOGS_PASSWORD_KEY, b as REDIS_PASSWORD_KEY, f as savePortState, h as postgresRoleSlug, j as objectsWebhookToken, k as minioNotificationRule, l as loadPortState, m as loadLocalCredentials, n as composeFor, ot as rootSite, q as LOGS_EMAIL_KEY, r as toYaml, t as CLUSTER_DATABASE, v as saveLocalCredentials } from "./compose-DDJhIyfw.mjs";
5
+ import { $ as otlpHeaders, B as fakeKey, D as HOST_GATEWAY$1, F as emulatorEndpoint, G as serviceAddresses, H as portsOf, I as emulatorQueueUrl, J as LOGS_ORG, L as emulatorTopicArn, M as watchedBuckets, O as NOTIFICATION_RULE_PREFIX, P as EMULATOR_REGION, U as postgresImage, V as portKeys, W as primaryPortKey, Y as LOGS_PASSWORD_KEY, b as REDIS_PASSWORD_KEY, f as savePortState, h as postgresRoleSlug, j as objectsWebhookToken, k as minioNotificationRule, l as loadPortState, m as loadLocalCredentials, n as composeFor, ot as rootSite, q as LOGS_EMAIL_KEY, r as toYaml, t as CLUSTER_DATABASE, v as saveLocalCredentials } from "./compose-D8fn0ebx.mjs";
6
6
  import { c as INBOX_RELAY_TOKEN_KEY, d as inboxWebhookUrl, i as readFakes, l as inboxRelayToken, o as objectsRoute, r as readCredentialFakes, u as inboxRelayWorker } from "./SubscriberGenerator-CzPrixYu.mjs";
7
7
  import { g as appKey, v as protectedSubdomains } from "./config-BLrAd7Of.mjs";
8
8
  import { i as holdsEveryCache, t as DEFAULT_CACHE } from "./types-Y1NfWlyG.mjs";
@@ -2335,8 +2335,12 @@ const OFFLINE_BUILD_ADDRESS = "127.0.0.1";
2335
2335
  * ones, and the running container resolves them as anything else does. A
2336
2336
  * stage secret named for the bundle is someone else's host (an analytics
2337
2337
  * service, a store) and is left alone, as are `localhost` and an address.
2338
+ *
2339
+ * None for a site that pre-renders against its stage (`prerender: 'stage'`):
2340
+ * it is built once those hosts answer, and has to reach them.
2338
2341
  */
2339
2342
  function offlineBuildHosts(site, manifest, resolve) {
2343
+ if (site.prerender === "stage") return [];
2340
2344
  const sources = [provideKey(site.id, "url"), ...Object.values(publicEnvFor(site, manifest))];
2341
2345
  const hosts = /* @__PURE__ */ new Set();
2342
2346
  for (const source of sources) {
@@ -2447,6 +2451,20 @@ const STATIC_SITE_IMAGE = "caddy:2.10-alpine";
2447
2451
  * Dockerfile says which version it runs.
2448
2452
  */
2449
2453
  const DEFAULT_BASE_IMAGE = "node:22.23.4-alpine";
2454
+ /**
2455
+ * The build secret a site that pre-renders against its stage reads the root
2456
+ * certificate of the stage's edge from — gkm's local CA, on the local stage,
2457
+ * whose hosts no public root vouches for. A certificate, not a key; a secret
2458
+ * only because a build has no other way to be handed a file it should not
2459
+ * keep. Absent on a deployed stage, whose certificates are public ones.
2460
+ */
2461
+ const LOCAL_CA_BUILD_SECRET = "gkm_local_ca";
2462
+ /**
2463
+ * The build argument naming the deploy a site that pre-renders against its
2464
+ * stage is built for — new on every deploy, so the layer that fetches the
2465
+ * stage's data is never served from Docker's cache.
2466
+ */
2467
+ const PRERENDER_RUN_ARG = "GKM_PRERENDER_RUN";
2450
2468
  const LOCKFILES = [
2451
2469
  ["pnpm-lock.yaml", "pnpm"],
2452
2470
  ["bun.lockb", "bun"],
@@ -2790,8 +2808,8 @@ RUN cd ${root} && GKM_BIN="$(node -e '${FIND_GKM_BIN}')" && \\
2790
2808
 
2791
2809
  # \`gkm exec\` in this build injects the build args, never a stage's secrets
2792
2810
  ENV ${IMAGE_BUILD_ENV}=1
2793
- # No stage is reachable from this build: the site's APIs are not up yet
2794
- ENV ${BUILD_OFFLINE_ENV}=1${generate}`;
2811
+ ${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
2812
+ ENV ${BUILD_OFFLINE_ENV}=1`}${generate}`;
2795
2813
  }
2796
2814
  /**
2797
2815
  * Build the site with turbo. Loose env mode, so the task sees what the
@@ -2801,7 +2819,14 @@ ENV ${BUILD_OFFLINE_ENV}=1${generate}`;
2801
2819
  */
2802
2820
  function siteBuild(options) {
2803
2821
  const { turbo } = layout(options);
2804
- return `RUN ${turbo} run build --filter='${options.turboPackage}' --env-mode=loose`;
2822
+ const build = `${turbo} run build --filter='${options.turboPackage}' --env-mode=loose`;
2823
+ if (!options.prerender) return `RUN ${build}`;
2824
+ const ca = `/run/secrets/${LOCAL_CA_BUILD_SECRET}`;
2825
+ return `ARG ${PRERENDER_RUN_ARG}=""
2826
+ RUN --mount=type=secret,id=${LOCAL_CA_BUILD_SECRET},required=false \\
2827
+ echo "prerendered for: \${${PRERENDER_RUN_ARG}:-any run}" && \\
2828
+ if [ -s ${ca} ]; then export NODE_EXTRA_CA_CERTS=${ca}; fi && \\
2829
+ ${build}`;
2805
2830
  }
2806
2831
  /**
2807
2832
  * The encrypted credentials, from a build secret — never an ARG, which is
@@ -5181,6 +5206,7 @@ var apps_exports = /* @__PURE__ */ __exportAll({
5181
5206
  appEnvKeys: () => appEnvKeys,
5182
5207
  appProcess: () => appProcess,
5183
5208
  appServices: () => appServices,
5209
+ callerKeys: () => callerKeys,
5184
5210
  constructKeys: () => constructKeys,
5185
5211
  dockerfileOf: () => dockerfileOf,
5186
5212
  healthcheck: () => healthcheck,
@@ -5265,7 +5291,40 @@ function networkEnv(plan, options, hostOf = (container) => container) {
5265
5291
  }
5266
5292
  /**
5267
5293
  * The keys one app's environment may hold: what its own declaration provides
5268
- * and requires, and what each construct it has an edge to provides.
5294
+ * and requires, what each construct it has an edge to provides, and — for a
5295
+ * surface — the identity of each client with an edge to it.
5296
+ *
5297
+ * The one rule for every command and stage: `gkm dev`, `gkm exec` and `gkm
5298
+ * test` hand an app these keys (through `processEnvKeys`), `gkm compose`
5299
+ * writes them to its env file, and `gkm docker`'s apps profile to its
5300
+ * service. A key missing here is missing everywhere, so an app that reads it
5301
+ * fails on its first local request rather than in production.
5302
+ *
5303
+ * What an edge `caller.dependsOn([target])` hands each side, `<C>` and `<T>`
5304
+ * being the caller's and the target's ids (`provideKey`) — keep this list and
5305
+ * `apps/docs/guide/edges.md` in step with the code below:
5306
+ *
5307
+ * - `rest-api`: the caller gets `<T>_URL`. The target gets `<C>_URL` from a
5308
+ * site caller and `<C>_SCHEME` from a mobile app caller (`callerKeys`).
5309
+ * - `websocket-api`: the caller gets `<T>_URL`, and a server process also
5310
+ * `<T>_PUBLISHER_CONNECTION_STRING`. The target gets what a `rest-api`
5311
+ * does.
5312
+ * - `queue`, `topic`: the caller gets the target's `provides` and
5313
+ * `EVENT_PUBLISHER_CONNECTION_STRING`. The target gets nothing.
5314
+ * - `objects`: the target's `provides`, its file server's, and the S3 key
5315
+ * pair (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`).
5316
+ * - `inbox`: the target's `provides`, and the local relay token.
5317
+ * - anything else (a database, cache, secret, credential, external API…):
5318
+ * the target's `provides`. The target gets nothing.
5319
+ *
5320
+ * Beside the keys, a surface's `<T>_TRUSTED_ORIGINS` lists every caller's
5321
+ * origin (a mobile app's as its scheme) and `<T>_COOKIE_DOMAIN` the parent
5322
+ * they share — values of the surface's own keys, derived from the same
5323
+ * inbound edges (`surfaceEnv`).
5324
+ *
5325
+ * A site or mobile app is a bundle: it also gets the public-prefixed name of
5326
+ * each of those its bundler inlines (`publicEnvFor`: `VITE_API_URL`,
5327
+ * `EXPO_PUBLIC_API_URL`), and never a `Telemetry` node's keys.
5269
5328
  *
5270
5329
  * The edges, not the manifest. Every app used to be handed every key the
5271
5330
  * workspace resolved — a web app got the database's owner URL and the auth
@@ -5274,8 +5333,7 @@ function networkEnv(plan, options, hostOf = (container) => container) {
5274
5333
  * app's environment from its edges; so does this.
5275
5334
  *
5276
5335
  * One hop: a surface an app calls is reached over HTTP, so its URL is the
5277
- * app's business and its database is not. A site also gets the public
5278
- * variant of each key its bundle inlines (`NEXT_PUBLIC_API_URL`).
5336
+ * app's business and its database is not.
5279
5337
  *
5280
5338
  * A surface's process runs its own endpoints and nothing else. A Worker's
5281
5339
  * crons, queue consumers and subscribers run in the worker's own process
@@ -5288,13 +5346,14 @@ function networkEnv(plan, options, hostOf = (container) => container) {
5288
5346
  function appEnvKeys(manifest, appName) {
5289
5347
  const entry = Object.entries(manifest).find(([id, d]) => (d.kind === "rest-api" || d.kind === "websocket-api" || d.kind === "site" || d.kind === "mobile-app") && appKey(id) === appName);
5290
5348
  if (!entry) return void 0;
5291
- const [, declaration] = entry;
5349
+ const [id, declaration] = entry;
5292
5350
  const keys = /* @__PURE__ */ new Set([
5293
5351
  ...declaration.provides ?? [],
5294
5352
  ...declaration.requires ?? [],
5295
5353
  ...declaration.kind === "rest-api" ? declaration.endpoints.flatMap((endpoint) => endpoint.requires ?? []) : []
5296
5354
  ]);
5297
5355
  addEdgeKeys(manifest, dependenciesOf(declaration).map((edge) => edge.target), keys, declaration.kind === "site" || declaration.kind === "mobile-app");
5356
+ if (declaration.kind === "rest-api" || declaration.kind === "websocket-api") for (const key of callerKeys(manifest, id)) keys.add(key);
5298
5357
  if (declaration.kind === "site" || declaration.kind === "mobile-app") {
5299
5358
  for (const key of TELEMETRY_KEYS) keys.delete(key);
5300
5359
  for (const key of Object.keys(publicEnvFor(declaration, manifest))) keys.add(key);
@@ -5416,6 +5475,34 @@ function appProcess(workspace, manifest, background, appName) {
5416
5475
  processors: hosted(() => processorUnits(workspace, manifest))
5417
5476
  };
5418
5477
  }
5478
+ /**
5479
+ * What a surface is told about the clients that call it: the identity it
5480
+ * links and redirects back to.
5481
+ *
5482
+ * An API that finishes an OAuth callback by sending a phone back into the app
5483
+ * builds `<scheme>://…`; one that mails a link to the site builds it on the
5484
+ * site's address. Both are the caller's own key, named by the caller's id —
5485
+ * `APP_SCHEME` for `MobileApp('App')`, `WEB_URL` for `StaticSite('Web')` — so
5486
+ * two apps calling one API arrive as `APP_SCHEME` and `ADMIN_APP_SCHEME`.
5487
+ *
5488
+ * Clients only. A surface or a worker that calls this one is something it
5489
+ * answers, never somewhere it sends a user, so nothing of theirs comes back
5490
+ * along the edge. Their origins still reach the surface, folded into its
5491
+ * `<ID>_TRUSTED_ORIGINS`.
5492
+ */
5493
+ function callerKeys(manifest, surfaceId) {
5494
+ const keys = [];
5495
+ for (const caller of dependentsOf(manifest, surfaceId)) {
5496
+ const declaration = manifest[caller];
5497
+ if (declaration?.kind === "mobile-app") keys.push(provideKey(caller, "scheme"));
5498
+ else if (declaration?.kind === "site") keys.push(provideKey(caller, "url"));
5499
+ }
5500
+ return keys;
5501
+ }
5502
+ /**
5503
+ * What a caller gets for each construct it has an edge to — the left half of
5504
+ * the table on {@link appEnvKeys}.
5505
+ */
5419
5506
  function addEdgeKeys(manifest, edges, keys, client = false) {
5420
5507
  for (const id of edges) {
5421
5508
  const bucket = eventsEdgeBucket(id);
@@ -5529,6 +5616,6 @@ function healthcheck(port, path) {
5529
5616
  };
5530
5617
  }
5531
5618
  //#endregion
5532
- export { OFFLINE_BUILD_ADDRESS as $, originSecretKey as A, resourceName as At, findBuildRoot as B, hostFor$1 as Bt, ensureLocalCertificate as C, quoteIdentifier as Ct, ORIGIN_VERIFY_HEADER as D, stageEnv as Dt, readLocalAuthority as E, localRolePassword as Et, imageLayout as F, surfaceClientTraced as Ft, generateNodeWebDockerfile as G, backupsPrefix as Gt, generateDockerignore as H, backupDatabases as Ht, PROCESSOR_PORT as I, telemetryOf as It, generateWorkerDockerfile as J, deploysWithCompose as Jt, generateProcessorDockerfile as K, runTime as Kt, TURBO_VERSION as L, usesTelemetry as Lt, appImageOptions as M, isTelemetryKey as Mt, composeBuildPaths as N, scopeTelemetryEnv as Nt, PROCESSOR_ORIGIN_SECRET_ENV as O, TELEMETRY_CONTAINER as Ot, fromBuildRoot as P, siteClientTelemetry as Pt, isImageBuild as Q, WORKER_PORT as R, LOCAL_TLD as Rt, ensureLocalAuthority as S, postgresStatements as St, localCertificateNames as T, envFor as Tt, generateEntryDockerfile as U, backupExpiries as Ut, generateBackendDockerfile as V, PROCESSORS_DEV_PREFIX as Vt, generateNextjsDockerfile as W, backupFile as Wt, resolveDockerConfig as X, nextPrerenderManifest as Y, imageBuildCredentials as Z, forgetState as _, applyPolicies as _t, networkEnv as a, processorUnitName as at, bucketClient as b, bucketPolicies as bt, processorEnvKeys as c, BACKUPS_SERVICE as ct, backendsOf as d, backupsRoleStatements as dt, offlineBuildHosts as et, constructGlobs as f, backupsService as ft, COMPOSE_PATH as g, applyNotifications as gt, workspace_exports as h, applyLifecycles as ht, dockerfileOf as i, isUnder as it, processorOriginHost as j, appTelemetry as jt, newOriginSecret as k, planFor as kt, workerEnvKeys as l, BACKUPS_URL_KEY as lt, reconcileWorkspace as m, applyBuckets as mt, appProcess as n, runsServer as nt, processEnv as o, processorUnits as ot, derivedContainers as p, stackBackups as pt, generateViteStaticDockerfile as q, stageBackups as qt, apps_exports as r, siteOfflineHosts as rt, processEnvKeys as s, workerUnits as st, appEnvKeys as t, publicBuildValues as tt, FAKE_ENV as u, RUNNER_PATH as ut, LEGACY_LOCAL_LOGIN as v, applyPostgres as vt, localAuthorityPaths as w, mergeLifecycle as wt, pgClient as x, postgresDatabaseNames as xt, ensurePostgresLogin as y, bucketLifecycles as yt, detectPackageManager as z, clientIpRule as zt };
5619
+ export { imageBuildCredentials as $, originSecretKey as A, TELEMETRY_CONTAINER as At, WORKER_PORT as B, LOCAL_TLD as Bt, ensureLocalCertificate as C, postgresDatabaseNames as Ct, ORIGIN_VERIFY_HEADER as D, envFor as Dt, readLocalAuthority as E, mergeLifecycle as Et, imageLayout as F, scopeTelemetryEnv as Ft, generateEntryDockerfile as G, backupExpiries as Gt, findBuildRoot as H, hostFor$1 as Ht, LOCAL_CA_BUILD_SECRET as I, siteClientTelemetry as It, generateProcessorDockerfile as J, runTime as Jt, generateNextjsDockerfile as K, backupFile as Kt, PRERENDER_RUN_ARG as L, surfaceClientTraced as Lt, appImageOptions as M, resourceName as Mt, composeBuildPaths as N, appTelemetry as Nt, PROCESSOR_ORIGIN_SECRET_ENV as O, localRolePassword as Ot, fromBuildRoot as P, isTelemetryKey as Pt, resolveDockerConfig as Q, PROCESSOR_PORT as R, telemetryOf as Rt, ensureLocalAuthority as S, bucketPolicies as St, localCertificateNames as T, quoteIdentifier as Tt, generateBackendDockerfile as U, PROCESSORS_DEV_PREFIX as Ut, detectPackageManager as V, clientIpRule as Vt, generateDockerignore as W, backupDatabases as Wt, generateWorkerDockerfile as X, deploysWithCompose as Xt, generateViteStaticDockerfile as Y, stageBackups as Yt, nextPrerenderManifest as Z, forgetState as _, applyLifecycles as _t, networkEnv as a, siteOfflineHosts as at, bucketClient as b, applyPostgres as bt, processorEnvKeys as c, processorUnits as ct, backendsOf as d, BACKUPS_URL_KEY as dt, isImageBuild as et, constructGlobs as f, RUNNER_PATH as ft, COMPOSE_PATH as g, applyBuckets as gt, workspace_exports as h, stackBackups as ht, dockerfileOf as i, runsServer as it, processorOriginHost as j, planFor as jt, newOriginSecret as k, stageEnv as kt, workerEnvKeys as l, workerUnits as lt, reconcileWorkspace as m, backupsService as mt, appProcess as n, offlineBuildHosts as nt, processEnv as o, isUnder as ot, derivedContainers as p, backupsRoleStatements as pt, generateNodeWebDockerfile as q, backupsPrefix as qt, apps_exports as r, publicBuildValues as rt, processEnvKeys as s, processorUnitName as st, appEnvKeys as t, OFFLINE_BUILD_ADDRESS as tt, FAKE_ENV as u, BACKUPS_SERVICE as ut, LEGACY_LOCAL_LOGIN as v, applyNotifications as vt, localAuthorityPaths as w, postgresStatements as wt, pgClient as x, bucketLifecycles as xt, ensurePostgresLogin as y, applyPolicies as yt, TURBO_VERSION as z, usesTelemetry as zt };
5533
5620
 
5534
- //# sourceMappingURL=apps-BBo5-LK0.mjs.map
5621
+ //# sourceMappingURL=apps-C0kZVQpf.mjs.map