void 1.1.11 → 1.2.0

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 (233) hide show
  1. package/dist/{account-cmd-R35a4Oa8.mjs → account-cmd-CdUll_35.mjs} +5 -5
  2. package/dist/action-key-XZ9HkWAO.mjs +26 -0
  3. package/dist/{application-analysis-D7nNmNJb.mjs → application-analysis-fEqoSeMp.mjs} +11 -11
  4. package/dist/{application-routing-CZH66gXn.mjs → application-routing-DAhNP4u3.mjs} +1 -1
  5. package/dist/{ast-CPGPjb0V.mjs → ast-CsZ_q_gc.mjs} +6 -1
  6. package/dist/ast-bindings-C3yaPs1y.mjs +296 -0
  7. package/dist/{auth-link-VHmiKZmP.mjs → auth-link-C87vGXM-.mjs} +5 -5
  8. package/dist/{auth-router-O_Wrs5kg.mjs → auth-router-6I81r-ix.mjs} +3 -3
  9. package/dist/{better-auth-shared-Bv18bB-l.d.mts → better-auth-shared-DVk2DkTW.d.mts} +1 -1
  10. package/dist/{build-cmd-CMZiMn46.mjs → build-cmd-ex1g-j_e.mjs} +4 -4
  11. package/dist/{cache-TZ5Ab3d7.mjs → cache-oHzrnY3z.mjs} +4 -4
  12. package/dist/{cancel-deploy-DXoR6oC3.mjs → cancel-deploy-viAMD0Q_.mjs} +3 -3
  13. package/dist/cf-build-output-BJHuSsVN.mjs +1 -0
  14. package/dist/{cf-build-output-Bc8i3dzE.mjs → cf-build-output-BhVxldCw.mjs} +75 -10
  15. package/dist/{cf-user-agent-ChjQp2MU.mjs → cf-command-values-ByHk0xg4.mjs} +6 -16
  16. package/dist/cf-worker-settings-BECvvTVd.mjs +37 -0
  17. package/dist/cli/cli.mjs +139 -35
  18. package/dist/cli/cloudflare-operation-process.mjs +65 -18
  19. package/dist/cli/env-schema-probe.d.mts +1 -1
  20. package/dist/cli/env-schema-probe.mjs +3 -3
  21. package/dist/{client-GuSO3v_x.mjs → client-BEkdj1kx.mjs} +58 -13
  22. package/dist/client-BiRDZTSd.mjs +1 -0
  23. package/dist/{cloudflare-auth-DSvBc1Gu.mjs → cloudflare-auth-Byo_0_N9.mjs} +1 -1
  24. package/dist/{cloudflare-cmd-ZSErUl6Y.mjs → cloudflare-cmd-DMzCv12s.mjs} +5 -5
  25. package/dist/{cloudflare-config-rdFOys4X.mjs → cloudflare-config-DchHxPTo.mjs} +1 -1
  26. package/dist/{cloudflare-connect-BN-k2kD-.mjs → cloudflare-connect-CCRTVg-I.mjs} +3 -3
  27. package/dist/{cloudflare-operations-DH3GedbV.mjs → cloudflare-operations-Dh9dEHJj.mjs} +17 -7
  28. package/dist/{cloudflare-operations-Cm8lVx7W.mjs → cloudflare-operations-DsSaw2BT.mjs} +1 -1
  29. package/dist/{cloudflare-process-CZJ4viYl.mjs → cloudflare-process-8jEYIeim.mjs} +3 -2
  30. package/dist/{config-DC5llZaI.mjs → config-BIaXIkkv.mjs} +8 -3
  31. package/dist/{config-DYJV8aEH.mjs → config-BU6hMu1W.mjs} +1 -1
  32. package/dist/{config-D26zcdKy.mjs → config-DHgSEWT7.mjs} +39 -6
  33. package/dist/{config-7qoq2p9v.d.mts → config-DQfHOKh9.d.mts} +10 -1
  34. package/dist/config-entry.d.mts +1 -1
  35. package/dist/{connect-yQuLbuiJ.mjs → connect-k7R2rPVA.mjs} +6 -6
  36. package/dist/{create-project-CGOo_OL_.mjs → create-project-DTuy-l0z.mjs} +1 -1
  37. package/dist/{create-project-DEEWJX_M.mjs → create-project-DV71ol5d.mjs} +4 -4
  38. package/dist/{db-COI-yTJE.mjs → db-DVOkLH5X.mjs} +79 -23
  39. package/dist/{delete-PgN6L_9N.mjs → delete-BbP5eopu.mjs} +4 -4
  40. package/dist/{deploy-DsW-PrRQ.mjs → deploy-7H32EnUs.mjs} +220 -95
  41. package/dist/deploy-CE0Ev0Ob.mjs +2 -0
  42. package/dist/{deploy-managed-static-Dqz06S2u.mjs → deploy-managed-static-DlvcvnQT.mjs} +74 -28
  43. package/dist/{deploy-transport-nY3vLXPL.mjs → deploy-transport-BzGEj0Ge.mjs} +2 -2
  44. package/dist/deploy.d.mts +22 -1
  45. package/dist/deploy.mjs +49 -8
  46. package/dist/{dev-inbox-Rd6j_8vM.mjs → dev-inbox-D0jxye_D.mjs} +1 -1
  47. package/dist/{dispatch-BAbbn3jg.mjs → dispatch-DoUnxTNo.mjs} +15 -11
  48. package/dist/{dist-CfgIkieS.mjs → dist-B1PLt4_8.mjs} +1 -1
  49. package/dist/{dist-BVdsO7Py.mjs → dist-Cor9XGoz.mjs} +94 -200
  50. package/dist/{dist-Bn8Kodjp.mjs → dist-D15hFhP0.mjs} +1 -1
  51. package/dist/{domain-DKlNI0SR.mjs → domain-CA2wBgra.mjs} +5 -5
  52. package/dist/drizzle-9TubSZvI.mjs +1 -0
  53. package/dist/{email-BcjSyAL0.mjs → email-B9ayYQEG.mjs} +1 -1
  54. package/dist/{email-C0s3OvJk.mjs → email-DXpCc77w.mjs} +10 -10
  55. package/dist/{email-cloudflare-etpKiITL.mjs → email-cloudflare-D03g2TkS.mjs} +7 -7
  56. package/dist/{entry-B_0IhV64.mjs → entry-BEM8ZuGP.mjs} +40 -12
  57. package/dist/{env-BX2JFsgF.mjs → env-DgOQ9_8S.mjs} +6 -6
  58. package/dist/{env-public-CCdykygU.d.mts → env-public-6lqiSD2b.d.mts} +1 -0
  59. package/dist/{env-types-GRchm5dw.mjs → env-types-BicfKBhV.mjs} +1 -1
  60. package/dist/{env-validation-CuGfWRJd.mjs → env-validation-BmsdCZEk.mjs} +1 -1
  61. package/dist/{env-validation-D_KyMdab.mjs → env-validation-Dwq3PJzK.mjs} +3 -3
  62. package/dist/{fetch-DHLOuPyk.d.mts → fetch-CUX0tB78.d.mts} +14 -1
  63. package/dist/fetch-CtESUYWd.mjs +26 -0
  64. package/dist/{fetch-error-Dj3crt0e.mjs → fetch-error-Bw0n-IY-.mjs} +1 -1
  65. package/dist/{fetch-stream-PGgz4uGz.mjs → fetch-stream-BspOeTAI.mjs} +1 -1
  66. package/dist/{fetch-stream-CNxOrBdP.d.mts → fetch-stream-DfkAzZf-.d.mts} +1 -1
  67. package/dist/{gen-Bj6ZkOcI.mjs → gen-BfmcIi2g.mjs} +5 -5
  68. package/dist/gen-NrOlWZaG.mjs +1 -0
  69. package/dist/{github-cmd-DQDryS-5.mjs → github-cmd-CY9LUqLh.mjs} +4 -4
  70. package/dist/{handler-_PqY82xe.d.mts → handler-BbkSPzGF.d.mts} +91 -9
  71. package/dist/{headers-Bi4bOAwp.mjs → headers-D522zd0A.mjs} +2 -2
  72. package/dist/help-BeAFFE5C.mjs +1 -0
  73. package/dist/{help-D49SL_lN.mjs → help-CxSlPpzJ.mjs} +83 -12
  74. package/dist/{inbound-BuTfm11U.mjs → inbound-VrOLqwZY.mjs} +1 -1
  75. package/dist/index.d.mts +1 -1
  76. package/dist/index.mjs +125 -124
  77. package/dist/{info-Bxunp14X.mjs → info-7VDlhtyy.mjs} +4 -4
  78. package/dist/{init-DyTEY04s.mjs → init-DxYyOs4-.mjs} +103 -43
  79. package/dist/{link-CgOVn9EC.mjs → link-Ddmod1dZ.mjs} +5 -5
  80. package/dist/{list-CUfD9RSb.mjs → list-MogaugiO.mjs} +5 -5
  81. package/dist/{live-DJONVlQK.d.mts → live-Bt8Y_0bg.d.mts} +1 -1
  82. package/dist/{local-d1-CpaPbd_L.mjs → local-d1-BHBnKWRb.mjs} +1 -1
  83. package/dist/{log-vqY3pqwI.mjs → log-BMwmN5Ae.mjs} +2 -2
  84. package/dist/{login-BJvGW5Eu.mjs → login-Cttnagmm.mjs} +4 -4
  85. package/dist/login-DgDwlKc_.mjs +1 -0
  86. package/dist/{logs-DeizBI4j.mjs → logs-CAszUWZI.mjs} +4 -4
  87. package/dist/{migrate-8rk56vV8.mjs → migrate-DyT2jJ8y.mjs} +5 -5
  88. package/dist/migrate-n49ZeS1X.mjs +1 -0
  89. package/dist/{mime-srOklVVv.mjs → mime-BAyHPskU.mjs} +1 -1
  90. package/dist/nitro.mjs +3 -3
  91. package/dist/{node-uN8_zxJr.mjs → node-WB7c2N4L.mjs} +2 -2
  92. package/dist/operator-cmd-d2MvJOrl.mjs +1 -0
  93. package/dist/{operator-cmd-CA5QQyvE.mjs → operator-cmd-skshjMGl.mjs} +4 -4
  94. package/dist/output-BW9uK099.mjs +1 -0
  95. package/dist/{output-Ba6ZbrzY.mjs → output-BpgYODYx.mjs} +16 -4
  96. package/dist/pages/client.d.mts +2 -2
  97. package/dist/pages/client.mjs +48 -25
  98. package/dist/pages/index.d.mts +2 -2
  99. package/dist/pages/index.mjs +4 -4
  100. package/dist/pages/islands-plugin.d.mts +43 -5
  101. package/dist/pages/islands-plugin.mjs +100 -28
  102. package/dist/pages/protocol.d.mts +2 -2
  103. package/dist/pages/protocol.mjs +1 -1
  104. package/dist/pages/serialize.d.mts +2 -2
  105. package/dist/pages/serialize.mjs +1 -1
  106. package/dist/{parse-filename-CUbj-1MP.mjs → parse-filename-DioPHiR9.mjs} +1 -35
  107. package/dist/{picocolors-BTps1_gs.mjs → picocolors-BsDfhxIw.mjs} +1 -1
  108. package/dist/{platform-args-B7ke06up.mjs → platform-args-DVbVClZl.mjs} +12 -4
  109. package/dist/platform-args-kQrgxScY.mjs +1 -0
  110. package/dist/{platform-auth-config-CZaY812e.mjs → platform-auth-config-C-pm5Qzx.mjs} +6 -6
  111. package/dist/{platform-auth-protection-U9HCqoXv.mjs → platform-auth-protection-SHhvim1L.mjs} +4 -4
  112. package/dist/{platform-auth-recovery-B0BV2hfV.mjs → platform-auth-recovery-DXVWs-wA.mjs} +4 -4
  113. package/dist/{platform-cmd-CXrjk4fb.mjs → platform-cmd-D5I1beUX.mjs} +7 -7
  114. package/dist/{platform-cmd-D9lwFpcl.mjs → platform-cmd-PiNRkopU.mjs} +1 -1
  115. package/dist/{platform-domain-CXyq-68_.mjs → platform-domain-jpmBfZeb.mjs} +4 -4
  116. package/dist/{platform-lifecycle-Dz2cJsLX.mjs → platform-lifecycle-DH3Yr1qQ.mjs} +1 -1
  117. package/dist/{platform-lifecycle-D0TdyXbN.mjs → platform-lifecycle-DyKmuNY6.mjs} +405 -44
  118. package/dist/{platform-management-CnXhgxTM.mjs → platform-management--vDwSn35.mjs} +49 -5
  119. package/dist/{platform-management-BvgbusqL.mjs → platform-management-7m-PLaPJ.mjs} +1 -1
  120. package/dist/{platform-plans-config-BWn1S2Rv.mjs → platform-plans-config-CeydDSj0.mjs} +2 -2
  121. package/dist/{platform-recovery-CH_fThW6.mjs → platform-recovery-BiNpZZab.mjs} +2 -2
  122. package/dist/{platform-setup-YvN9VQXV.mjs → platform-setup-Ca53gtt0.mjs} +3 -2
  123. package/dist/{plugin-inference-Bekzjuqw.mjs → plugin-inference-DUjCd55H.mjs} +145 -218
  124. package/dist/{prepare-2XD6kh77.mjs → prepare-BcAE5Sdj.mjs} +3 -3
  125. package/dist/prepare-C4I0f--h.mjs +1 -0
  126. package/dist/{prepare-DepAGBcV.mjs → prepare-DA-17DhO.mjs} +5 -5
  127. package/dist/{prerender-render-Bfsumdkv.mjs → prerender-render-Cijv7UFo.mjs} +11 -6
  128. package/dist/prerender-render.mjs +1 -1
  129. package/dist/{project-cmd-CpLYflCH.mjs → project-cmd-DA4K5faU.mjs} +18 -18
  130. package/dist/{project-team-CTSY7W7Q.mjs → project-team-CQBNveX3.mjs} +4 -4
  131. package/dist/{project-token-Cybtlfbl.mjs → project-token-CCalFyQf.mjs} +4 -4
  132. package/dist/{project-zero-trust-DKOtqyvu.mjs → project-zero-trust-DPnkiEuT.mjs} +4 -4
  133. package/dist/{protocol-B8sI8dRD.d.mts → protocol-BBDpJz3G.d.mts} +3 -1
  134. package/dist/{protocol-RNP0u7UY.mjs → protocol-DimNxVRr.mjs} +42 -17
  135. package/dist/{provision-UcYjpTRh.mjs → provision-BFLCrnUp.mjs} +1 -1
  136. package/dist/{provision-BuifYvLc.mjs → provision-DtROpNNI.mjs} +6 -5
  137. package/dist/{requests-Ryiazz9i.mjs → requests-BpH0kImL.mjs} +3 -3
  138. package/dist/resolve-project-DD1vu8s9.mjs +1 -0
  139. package/dist/{resolve-project-WpwkCB_c.mjs → resolve-project-Xoi6eTWY.mjs} +1 -1
  140. package/dist/{rollback-Or0EV3rP.mjs → rollback-CXS1tAa-.mjs} +10 -9
  141. package/dist/{rolldown-runtime-DXIUcv95.mjs → rolldown-runtime-3h0WiCiA.mjs} +1 -1
  142. package/dist/{routing-assets-VkrKIbxE.mjs → routing-assets-DdSFxoLp.mjs} +10 -4
  143. package/dist/runtime/better-auth-mysql.d.mts +1 -1
  144. package/dist/runtime/better-auth-pg.d.mts +1 -1
  145. package/dist/runtime/better-auth.d.mts +1 -1
  146. package/dist/runtime/client-react.d.mts +2 -2
  147. package/dist/runtime/client-react.mjs +3 -3
  148. package/dist/runtime/client-solid.d.mts +2 -2
  149. package/dist/runtime/client-solid.mjs +3 -3
  150. package/dist/runtime/client-svelte.d.mts +2 -2
  151. package/dist/runtime/client-svelte.mjs +3 -3
  152. package/dist/runtime/client-vue.d.mts +2 -2
  153. package/dist/runtime/client-vue.mjs +3 -3
  154. package/dist/runtime/client.d.mts +2 -2
  155. package/dist/runtime/client.mjs +3 -3
  156. package/dist/runtime/email/testing.mjs +4 -4
  157. package/dist/runtime/email.mjs +3 -3
  158. package/dist/runtime/env-public.d.mts +1 -1
  159. package/dist/runtime/fetch-server.d.mts +8 -0
  160. package/dist/runtime/fetch-server.mjs +30 -0
  161. package/dist/runtime/fetch-stream.d.mts +2 -2
  162. package/dist/runtime/fetch-stream.mjs +2 -2
  163. package/dist/runtime/fetch.d.mts +2 -2
  164. package/dist/runtime/fetch.mjs +3 -3
  165. package/dist/runtime/handler.d.mts +1 -1
  166. package/dist/runtime/live-client.d.mts +1 -1
  167. package/dist/runtime/live.d.mts +1 -1
  168. package/dist/runtime/routing.d.mts +17 -76
  169. package/dist/runtime/routing.mjs +277 -216
  170. package/dist/runtime/validator.d.mts +1 -1
  171. package/dist/runtime/ws-server.d.mts +2 -2
  172. package/dist/runtime/ws.d.mts +1 -1
  173. package/dist/{scan-D2-FcLHs.mjs → scan-8IzYXiU_.mjs} +12 -11
  174. package/dist/{secret-CClHaFxm.mjs → secret-BbXHfLAt.mjs} +6 -6
  175. package/dist/serialize-DtR8Vwa_.d.mts +18 -0
  176. package/dist/serialize-YHvlcG3Q.mjs +31 -0
  177. package/dist/{skills-C_yRTg0g.mjs → skills-CrUO3PJ0.mjs} +1 -1
  178. package/dist/{subcommand-prompt-Bm3ZlYgA.mjs → subcommand-prompt-D9OhhbGG.mjs} +2 -2
  179. package/dist/{version-metadata-B1Bm2wSq.mjs → version-metadata-tS39iW09.mjs} +1 -1
  180. package/dist/wrangler-BLb3_luP.mjs +1 -0
  181. package/dist/{wrangler-C9XSzrju.mjs → wrangler-F96NnLyb.mjs} +13 -5
  182. package/dist/{wrapper-BOigE1xJ.mjs → wrapper-D3sZyh2C.mjs} +5 -3
  183. package/dist/{ws-CsBNxv86.d.mts → ws-BH-im_tX.d.mts} +1 -1
  184. package/docs/guide/ai.md +1 -1
  185. package/docs/guide/database/postgresql.md +1 -1
  186. package/docs/guide/database.md +26 -0
  187. package/docs/guide/deployment.md +2 -0
  188. package/docs/guide/edge/headers.md +1 -1
  189. package/docs/guide/email/domains.md +1 -1
  190. package/docs/guide/email/receiving.md +1 -1
  191. package/docs/guide/email/sending.md +3 -3
  192. package/docs/guide/pages-routing/actions-and-forms.md +1 -1
  193. package/docs/guide/pages-routing/markdown.md +3 -1
  194. package/docs/guide/platform/administration/email.md +7 -1
  195. package/docs/guide/platform/installation/ci.md +2 -0
  196. package/docs/guide/platform/installation/credentials.md +24 -6
  197. package/docs/guide/platform/installation/domains.md +16 -0
  198. package/docs/guide/platform/installation/maintenance.md +32 -2
  199. package/docs/guide/platform/installation/setup.md +1 -1
  200. package/docs/guide/self-hosted-platform.md +1 -1
  201. package/docs/guide/server-routing.md +1 -1
  202. package/docs/guide/typed-fetch.md +1 -1
  203. package/docs/integrations/cloudflare.md +2 -1
  204. package/docs/integrations/frameworks/tanstack-start.md +25 -0
  205. package/docs/reference/api/deploy.md +35 -3
  206. package/docs/reference/api/env.md +1 -1
  207. package/docs/reference/api/rewrites.md +1 -1
  208. package/docs/reference/api/types.md +1 -0
  209. package/docs/reference/cli/database.md +15 -0
  210. package/docs/reference/cli/platform-installation.md +5 -2
  211. package/docs/reference/cli/project.md +4 -2
  212. package/docs/reference/cli/setup.md +17 -0
  213. package/docs/reference/cli.md +1 -0
  214. package/docs/reference/config.md +14 -1
  215. package/docs/reference/resource-inference.md +4 -0
  216. package/package.json +23 -22
  217. package/sandbox.Dockerfile +1 -1
  218. package/schema.json +23 -3
  219. package/dist/cf-build-output-BU3hqdHu.mjs +0 -1
  220. package/dist/client-DrdeJgHR.mjs +0 -1
  221. package/dist/deploy-CxNgEYr4.mjs +0 -2
  222. package/dist/fetch-sAcwjzLO.mjs +0 -18
  223. package/dist/gen-DsCukhuw.mjs +0 -1
  224. package/dist/help-DOFygYi4.mjs +0 -1
  225. package/dist/login-alAlxw4S.mjs +0 -1
  226. package/dist/migrate-D2odrAmh.mjs +0 -1
  227. package/dist/operator-cmd-D7toMPJ9.mjs +0 -1
  228. package/dist/platform-args-B_LrqEZB.mjs +0 -1
  229. package/dist/prepare-EVEbQ9n2.mjs +0 -1
  230. package/dist/resolve-project-PnhzMtY6.mjs +0 -1
  231. package/dist/serialize-BtQyaYoC.mjs +0 -20
  232. package/dist/serialize-CfSwWfF2.d.mts +0 -10
  233. package/dist/wrangler-DAdxHEzh.mjs +0 -1
@@ -1,14 +1,14 @@
1
1
  import { c as getToken, f as removeToken } from "./auth-B6iOCjKI.mjs";
2
- import { L as log } from "./dist-BVdsO7Py.mjs";
3
- import { m as printSuccess } from "./output-Ba6ZbrzY.mjs";
4
- import { r as PlatformClient } from "./client-GuSO3v_x.mjs";
5
- import { n as runLoginCommand } from "./login-BJvGW5Eu.mjs";
2
+ import { L as log } from "./dist-Cor9XGoz.mjs";
3
+ import { r as PlatformClient } from "./client-BEkdj1kx.mjs";
4
+ import { m as printSuccess } from "./output-BpgYODYx.mjs";
5
+ import { n as runLoginCommand } from "./login-Cttnagmm.mjs";
6
6
  import { execSync } from "node:child_process";
7
7
  //#region src/cli/account-cmd.ts
8
8
  async function runAccountCommand(root, args) {
9
9
  switch (args.subcommand) {
10
10
  case "login": return runLoginCommand(root);
11
- case "link": return import("./auth-link-VHmiKZmP.mjs").then(({ runAuthLink }) => runAuthLink(root, args.connectionId));
11
+ case "link": return import("./auth-link-C87vGXM-.mjs").then(({ runAuthLink }) => runAuthLink(root, args.connectionId));
12
12
  case "logout":
13
13
  if (removeToken(root)) printSuccess("Logged out.");
14
14
  else log.info("Not logged in.");
@@ -0,0 +1,26 @@
1
+ //#region src/pages/action-key.ts
2
+ const actionKeyRequests = /* @__PURE__ */ new WeakSet();
3
+ function markActionKey(request) {
4
+ actionKeyRequests.add(request);
5
+ }
6
+ function hasActionKey(request) {
7
+ return actionKeyRequests.has(request);
8
+ }
9
+ /** The first non-empty segment of `search` as sent: `delete` in `?delete&page=2`. */
10
+ function actionKeySegment(search) {
11
+ let start = 1;
12
+ while (search[start] === "&") start++;
13
+ const end = search.indexOf("&", start);
14
+ return search.slice(start, end === -1 ? search.length : end);
15
+ }
16
+ /** `search` without its first non-empty segment; the rest is kept as sent. */
17
+ function searchWithoutActionKey(search) {
18
+ let start = 1;
19
+ while (search[start] === "&") start++;
20
+ let rest = search.indexOf("&", start);
21
+ if (rest === -1) return "";
22
+ while (search[rest] === "&") rest++;
23
+ return rest < search.length ? "?" + search.slice(rest) : "";
24
+ }
25
+ //#endregion
26
+ export { searchWithoutActionKey as i, hasActionKey as n, markActionKey as r, actionKeySegment as t };
@@ -1,15 +1,16 @@
1
1
  import { a as join, i as isAbsolute, t as basename } from "./dist-ipQi0Q8y.mjs";
2
- import { c as scanWebSocketRoutesSync, f as readResourceDefinition, h as needsApplicationDatabase, i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, p as listConventionFiles, r as detectFramework, s as isWebSocketPatternFile } from "./plugin-inference-Bekzjuqw.mjs";
2
+ import { c as scanWebSocketRoutesSync, d as readResourceDefinition, f as listConventionFiles, i as inferProjectBindings, m as needsApplicationDatabase, n as FRAMEWORK_SCAN_DIRS, r as detectFramework, s as isWebSocketPatternFile } from "./plugin-inference-DUjCd55H.mjs";
3
3
  import { i as resolveProjectPaths, n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
4
4
  import { t as findVoidAuthConfig } from "./config-CyUJzi3q.mjs";
5
- import { f as resolveBindingNames, s as getDatabaseDialect } from "./config-D26zcdKy.mjs";
6
- import { n as globSync } from "./dist-Bn8Kodjp.mjs";
7
- import { n as isIdentifier } from "./ast-CPGPjb0V.mjs";
8
- import { a as staticLiteral, i as staticExportInitializers, n as parseRouteFilename, o as unwrapStaticExpression, t as isRouteEnabledForEnvironment } from "./parse-filename-CUbj-1MP.mjs";
5
+ import { l as getDatabaseDialect, m as resolveBindingNames } from "./config-DHgSEWT7.mjs";
6
+ import { n as globSync } from "./dist-D15hFhP0.mjs";
7
+ import { n as isIdentifier, o as moduleExportName } from "./ast-CsZ_q_gc.mjs";
8
+ import { a as staticLiteral, i as staticExportInitializers, o as unwrapStaticExpression, t as bindingNames } from "./ast-bindings-C3yaPs1y.mjs";
9
9
  import { n as resourceNameWords } from "./resource-name-C7LVpcRm.mjs";
10
10
  import { t as collectMigrations } from "./collect-Dew86qce.mjs";
11
- import { i as scanEmailHandlersSync } from "./email-BcjSyAL0.mjs";
12
- import { t as scanPages } from "./scan-D2-FcLHs.mjs";
11
+ import { n as parseRouteFilename, t as isRouteEnabledForEnvironment } from "./parse-filename-DioPHiR9.mjs";
12
+ import { i as scanEmailHandlersSync } from "./email-B9ayYQEG.mjs";
13
+ import { t as scanPages } from "./scan-8IzYXiU_.mjs";
13
14
  import { existsSync, readFileSync, readdirSync } from "node:fs";
14
15
  import { fileURLToPath } from "node:url";
15
16
  import { parseSync } from "vite";
@@ -160,16 +161,15 @@ function detectHttpExports(absPath) {
160
161
  if (declarationNode.exportKind === "type") continue;
161
162
  const decl = declarationNode.declaration;
162
163
  if (decl) {
163
- if (decl.type === "VariableDeclaration") {
164
- for (const declarator of decl.declarations ?? []) if (isIdentifier(declarator.id) && HTTP_METHODS.has(declarator.id.name)) methods.push(declarator.id.name);
165
- } else if (decl.type === "FunctionDeclaration") {
164
+ if (decl.type === "VariableDeclaration") for (const declarator of decl.declarations ?? []) methods.push(...bindingNames(declarator.id).filter((name) => HTTP_METHODS.has(name)));
165
+ else if (decl.type === "FunctionDeclaration") {
166
166
  const fn = decl;
167
167
  if (isIdentifier(fn.id) && HTTP_METHODS.has(fn.id.name)) methods.push(fn.id.name);
168
168
  }
169
169
  }
170
170
  if (declarationNode.specifiers) for (const spec of declarationNode.specifiers) {
171
171
  if (spec.exportKind === "type") continue;
172
- const exported = isIdentifier(spec.exported) ? spec.exported.name : isIdentifier(spec.local) ? spec.local.name : void 0;
172
+ const exported = moduleExportName(spec.exported);
173
173
  if (exported && HTTP_METHODS.has(exported)) methods.push(exported);
174
174
  }
175
175
  }
@@ -1,4 +1,4 @@
1
- import { l as scanRoutes, t as analyzeApplicationSync } from "./application-analysis-D7nNmNJb.mjs";
1
+ import { l as scanRoutes, t as analyzeApplicationSync } from "./application-analysis-fEqoSeMp.mjs";
2
2
  //#region src/application-routing.ts
3
3
  /** Complete route/page analysis using the same resource and handler inventories. */
4
4
  async function completeApplicationAnalysis(analysis) {
@@ -5,6 +5,11 @@ function isIdentifier(node) {
5
5
  function isLiteral(node) {
6
6
  return node?.type === "Literal";
7
7
  }
8
+ /** Module export names may be identifiers or string literals, independently of the local name. */
9
+ function moduleExportName(node) {
10
+ if (isIdentifier(node)) return node.name;
11
+ return isLiteral(node) && typeof node.value === "string" ? node.value : void 0;
12
+ }
8
13
  function isMemberExpression(node) {
9
14
  return node?.type === "MemberExpression";
10
15
  }
@@ -15,4 +20,4 @@ function isObjectExpression(node) {
15
20
  return node?.type === "ObjectExpression";
16
21
  }
17
22
  //#endregion
18
- export { isObjectExpression as a, isMemberExpression as i, isIdentifier as n, isLiteral as r, isCallExpression as t };
23
+ export { isObjectExpression as a, isMemberExpression as i, isIdentifier as n, moduleExportName as o, isLiteral as r, isCallExpression as t };
@@ -0,0 +1,296 @@
1
+ import { n as isIdentifier } from "./ast-CsZ_q_gc.mjs";
2
+ import { parseSync } from "vite";
3
+ //#region src/shared/static-exports.ts
4
+ /** Read the initializer of directly exported constants without evaluating user code. */
5
+ function staticExportInitializers(filename, source, names) {
6
+ const result = /* @__PURE__ */ new Map();
7
+ const program = parseSync(filename, source).program;
8
+ for (const statement of program.body ?? []) {
9
+ if (statement.type !== "ExportNamedDeclaration") continue;
10
+ const declaration = statement.declaration;
11
+ if (declaration?.type !== "VariableDeclaration" || declaration.kind !== "const") continue;
12
+ for (const variable of declaration.declarations ?? []) if (isIdentifier(variable.id) && names.has(variable.id.name) && variable.init) result.set(variable.id.name, variable.init);
13
+ }
14
+ return result;
15
+ }
16
+ function unwrapStaticExpression(node) {
17
+ while (node && [
18
+ "ParenthesizedExpression",
19
+ "TSAsExpression",
20
+ "TSSatisfiesExpression",
21
+ "TSTypeAssertion"
22
+ ].includes(node.type)) node = node.expression;
23
+ return node;
24
+ }
25
+ function staticLiteral(node) {
26
+ node = unwrapStaticExpression(node);
27
+ if (node?.type === "Literal") return node.value;
28
+ if (node?.type === "TemplateLiteral") {
29
+ const expressions = node.expressions;
30
+ const quasis = node.quasis;
31
+ if (expressions?.length === 0 && quasis?.length === 1) return quasis[0]?.value?.cooked;
32
+ }
33
+ }
34
+ //#endregion
35
+ //#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/walker.js
36
+ /**
37
+ * @typedef { import('estree').Node} Node
38
+ * @typedef {{
39
+ * skip: () => void;
40
+ * remove: () => void;
41
+ * replace: (node: Node) => void;
42
+ * }} WalkerContext
43
+ */
44
+ var WalkerBase = class {
45
+ constructor() {
46
+ /** @type {boolean} */
47
+ this.should_skip = false;
48
+ /** @type {boolean} */
49
+ this.should_remove = false;
50
+ /** @type {Node | null} */
51
+ this.replacement = null;
52
+ /** @type {WalkerContext} */
53
+ this.context = {
54
+ skip: () => this.should_skip = true,
55
+ remove: () => this.should_remove = true,
56
+ replace: (node) => this.replacement = node
57
+ };
58
+ }
59
+ /**
60
+ * @template {Node} Parent
61
+ * @param {Parent | null | undefined} parent
62
+ * @param {keyof Parent | null | undefined} prop
63
+ * @param {number | null | undefined} index
64
+ * @param {Node} node
65
+ */
66
+ replace(parent, prop, index, node) {
67
+ if (parent && prop) {
68
+ if (index != null)
69
+ /** @type {Array<Node>} */ parent[prop][index] = node;
70
+ else
71
+ /** @type {Node} */ parent[prop] = node;
72
+ }
73
+ }
74
+ /**
75
+ * @template {Node} Parent
76
+ * @param {Parent | null | undefined} parent
77
+ * @param {keyof Parent | null | undefined} prop
78
+ * @param {number | null | undefined} index
79
+ */
80
+ remove(parent, prop, index) {
81
+ if (parent && prop) {
82
+ if (index !== null && index !== void 0)
83
+ /** @type {Array<Node>} */ parent[prop].splice(index, 1);
84
+ else delete parent[prop];
85
+ }
86
+ }
87
+ };
88
+ //#endregion
89
+ //#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/sync.js
90
+ /**
91
+ * @typedef { import('estree').Node} Node
92
+ * @typedef { import('./walker.js').WalkerContext} WalkerContext
93
+ * @typedef {(
94
+ * this: WalkerContext,
95
+ * node: Node,
96
+ * parent: Node | null,
97
+ * key: string | number | symbol | null | undefined,
98
+ * index: number | null | undefined
99
+ * ) => void} SyncHandler
100
+ */
101
+ var SyncWalker = class extends WalkerBase {
102
+ /**
103
+ *
104
+ * @param {SyncHandler} [enter]
105
+ * @param {SyncHandler} [leave]
106
+ */
107
+ constructor(enter, leave) {
108
+ super();
109
+ /** @type {boolean} */
110
+ this.should_skip = false;
111
+ /** @type {boolean} */
112
+ this.should_remove = false;
113
+ /** @type {Node | null} */
114
+ this.replacement = null;
115
+ /** @type {WalkerContext} */
116
+ this.context = {
117
+ skip: () => this.should_skip = true,
118
+ remove: () => this.should_remove = true,
119
+ replace: (node) => this.replacement = node
120
+ };
121
+ /** @type {SyncHandler | undefined} */
122
+ this.enter = enter;
123
+ /** @type {SyncHandler | undefined} */
124
+ this.leave = leave;
125
+ }
126
+ /**
127
+ * @template {Node} Parent
128
+ * @param {Node} node
129
+ * @param {Parent | null} parent
130
+ * @param {keyof Parent} [prop]
131
+ * @param {number | null} [index]
132
+ * @returns {Node | null}
133
+ */
134
+ visit(node, parent, prop, index) {
135
+ if (node) {
136
+ if (this.enter) {
137
+ const _should_skip = this.should_skip;
138
+ const _should_remove = this.should_remove;
139
+ const _replacement = this.replacement;
140
+ this.should_skip = false;
141
+ this.should_remove = false;
142
+ this.replacement = null;
143
+ this.enter.call(this.context, node, parent, prop, index);
144
+ if (this.replacement) {
145
+ node = this.replacement;
146
+ this.replace(parent, prop, index, node);
147
+ }
148
+ if (this.should_remove) this.remove(parent, prop, index);
149
+ const skipped = this.should_skip;
150
+ const removed = this.should_remove;
151
+ this.should_skip = _should_skip;
152
+ this.should_remove = _should_remove;
153
+ this.replacement = _replacement;
154
+ if (skipped) return node;
155
+ if (removed) return null;
156
+ }
157
+ /** @type {keyof Node} */
158
+ let key;
159
+ for (key in node) {
160
+ /** @type {unknown} */
161
+ const value = node[key];
162
+ if (value && typeof value === "object") {
163
+ if (Array.isArray(value)) {
164
+ const nodes = value;
165
+ for (let i = 0; i < nodes.length; i += 1) {
166
+ const item = nodes[i];
167
+ if (isNode(item)) {
168
+ if (!this.visit(item, node, key, i)) i--;
169
+ }
170
+ }
171
+ } else if (isNode(value)) this.visit(value, node, key, null);
172
+ }
173
+ }
174
+ if (this.leave) {
175
+ const _replacement = this.replacement;
176
+ const _should_remove = this.should_remove;
177
+ this.replacement = null;
178
+ this.should_remove = false;
179
+ this.leave.call(this.context, node, parent, prop, index);
180
+ if (this.replacement) {
181
+ node = this.replacement;
182
+ this.replace(parent, prop, index, node);
183
+ }
184
+ if (this.should_remove) this.remove(parent, prop, index);
185
+ const removed = this.should_remove;
186
+ this.replacement = _replacement;
187
+ this.should_remove = _should_remove;
188
+ if (removed) return null;
189
+ }
190
+ }
191
+ return node;
192
+ }
193
+ };
194
+ /**
195
+ * Ducktype a node.
196
+ *
197
+ * @param {unknown} value
198
+ * @returns {value is Node}
199
+ */
200
+ function isNode(value) {
201
+ return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
202
+ }
203
+ //#endregion
204
+ //#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/index.js
205
+ /**
206
+ * @typedef {import('estree').Node} Node
207
+ * @typedef {import('./sync.js').SyncHandler} SyncHandler
208
+ * @typedef {import('./async.js').AsyncHandler} AsyncHandler
209
+ */
210
+ /**
211
+ * @param {Node} ast
212
+ * @param {{
213
+ * enter?: SyncHandler
214
+ * leave?: SyncHandler
215
+ * }} walker
216
+ * @returns {Node | null}
217
+ */
218
+ function walk(ast, { enter, leave }) {
219
+ return new SyncWalker(enter, leave).visit(ast, null);
220
+ }
221
+ //#endregion
222
+ //#region src/shared/ast-bindings.ts
223
+ /** Names introduced by a binding pattern, excluding keys and default expressions. */
224
+ function bindingNames(node) {
225
+ if (isIdentifier(node)) return [node.name];
226
+ if (node?.type === "ObjectPattern") return (node.properties ?? []).flatMap((property) => bindingNames(property.type === "RestElement" ? property.argument : property.value));
227
+ if (node?.type === "ArrayPattern") return (node.elements ?? []).flatMap(bindingNames);
228
+ if (node?.type === "AssignmentPattern" || node?.type === "RestElement") return bindingNames(node.left ?? node.argument);
229
+ if (node?.type === "TSParameterProperty") return bindingNames(node.parameter);
230
+ return [];
231
+ }
232
+ const FUNCTIONS = /* @__PURE__ */ new Set([
233
+ "FunctionDeclaration",
234
+ "FunctionExpression",
235
+ "ArrowFunctionExpression"
236
+ ]);
237
+ /**
238
+ * Resolve lexical bindings after collecting declarations, including hoisted and later bindings.
239
+ * A visitor can collect references in the same pass; return true to retain a node's scope.
240
+ * Names can limit binding collection when only specific imports need resolution.
241
+ */
242
+ function bindingResolver(program, options) {
243
+ const scopes = /* @__PURE__ */ new WeakMap();
244
+ const outerScopes = /* @__PURE__ */ new WeakMap();
245
+ let scope = { varScope: true };
246
+ const declare = (pattern, declaration, target = scope) => {
247
+ for (const name of bindingNames(pattern)) if (!options?.names || options.names.has(name)) (target.bindings ??= /* @__PURE__ */ new Map()).set(name, declaration);
248
+ };
249
+ walk(program, {
250
+ enter(raw, rawParent, key) {
251
+ const node = raw;
252
+ const parent = rawParent;
253
+ const outerScope = scope;
254
+ if (parent?.type === "SwitchStatement" && key === "discriminant") scope = scope.parent;
255
+ if ([
256
+ "FunctionDeclaration",
257
+ "ClassDeclaration",
258
+ "TSEnumDeclaration",
259
+ "TSModuleDeclaration"
260
+ ].includes(node.type)) declare(node.id, node);
261
+ const isFunction = FUNCTIONS.has(node.type);
262
+ if (isFunction || node.type === "BlockStatement" || node.type === "StaticBlock" || node.type === "CatchClause" || node.type === "ForStatement" || node.type === "ForInStatement" || node.type === "ForOfStatement" || node.type === "SwitchStatement" || node.type === "ClassDeclaration" || node.type === "ClassExpression" || node.type === "TSModuleDeclaration") scope = {
263
+ parent: scope,
264
+ varScope: isFunction || node.type === "StaticBlock" || node.type === "TSModuleDeclaration" || node.type === "BlockStatement" && !!parent && FUNCTIONS.has(parent.type)
265
+ };
266
+ if (scope !== outerScope) outerScopes.set(node, outerScope);
267
+ if (!options?.visit || options.visit(node)) scopes.set(node, scope);
268
+ if (isFunction) {
269
+ if (node.type === "FunctionExpression") declare(node.id, node);
270
+ for (const parameter of node.params ?? []) declare(parameter, parameter);
271
+ } else if (node.type === "ClassDeclaration" || node.type === "ClassExpression") declare(node.id, node);
272
+ else if (node.type === "CatchClause") declare(node.param, node);
273
+ else if (node.type === "ImportDeclaration" && node.importKind !== "type") {
274
+ for (const specifier of node.specifiers ?? []) if (specifier.importKind !== "type") declare(specifier.local, specifier);
275
+ } else if (node.type === "VariableDeclaration") {
276
+ let target = scope;
277
+ if (node.kind === "var") while (!target.varScope && target.parent) target = target.parent;
278
+ for (const declaration of node.declarations ?? []) declare(declaration.id, declaration, target);
279
+ }
280
+ },
281
+ leave(raw) {
282
+ const outer = outerScopes.get(raw);
283
+ if (outer) scope = outer;
284
+ }
285
+ });
286
+ return (node, name) => {
287
+ let current = scopes.get(node);
288
+ while (current) {
289
+ const binding = current.bindings?.get(name);
290
+ if (binding) return binding;
291
+ current = current.parent;
292
+ }
293
+ };
294
+ }
295
+ //#endregion
296
+ export { staticLiteral as a, staticExportInitializers as i, bindingResolver as n, unwrapStaticExpression as o, walk as r, bindingNames as t };
@@ -1,9 +1,9 @@
1
1
  import { a as getApiUrl, c as getToken, m as savePlatformToken, p as runPlatformLogin, u as openBrowser } from "./auth-B6iOCjKI.mjs";
2
- import { L as log } from "./dist-BVdsO7Py.mjs";
3
- import { l as formatUrl } from "./output-Ba6ZbrzY.mjs";
4
- import { r as PlatformClient } from "./client-GuSO3v_x.mjs";
5
- import { r as selectPlatformLoginMethod } from "./login-BJvGW5Eu.mjs";
6
- import { t as discoverPlatform } from "./platform-cmd-CXrjk4fb.mjs";
2
+ import { L as log } from "./dist-Cor9XGoz.mjs";
3
+ import { r as PlatformClient } from "./client-BEkdj1kx.mjs";
4
+ import { l as formatUrl } from "./output-BpgYODYx.mjs";
5
+ import { r as selectPlatformLoginMethod } from "./login-Cttnagmm.mjs";
6
+ import { t as discoverPlatform } from "./platform-cmd-D5I1beUX.mjs";
7
7
  //#region src/cli/auth-link.ts
8
8
  async function runAuthLink(root, connectionId) {
9
9
  const token = getToken(root);
@@ -1,6 +1,6 @@
1
1
  import { s as listPlatformConnections } from "./platform-registry-B9mWX9LO.mjs";
2
2
  import { n as readDeploymentPlatform } from "./project-rqDnVsJN.mjs";
3
- import { K as select, tt as isCancel } from "./dist-BVdsO7Py.mjs";
3
+ import { K as select, tt as isCancel } from "./dist-Cor9XGoz.mjs";
4
4
  //#region src/cli/auth-router.ts
5
5
  async function chooseDestination(root, args, interactive) {
6
6
  const saved = readDeploymentPlatform(root);
@@ -39,11 +39,11 @@ async function chooseDestination(root, args, interactive) {
39
39
  async function runAuthRouter(root, args, interactive = Boolean(process.stdin.isTTY)) {
40
40
  const destination = await chooseDestination(root, args, interactive);
41
41
  if (destination.platform === "cloudflare") {
42
- const { runCloudflareCommand } = await import("./cloudflare-cmd-ZSErUl6Y.mjs");
42
+ const { runCloudflareCommand } = await import("./cloudflare-cmd-DMzCv12s.mjs");
43
43
  await runCloudflareCommand(root, { subcommand: args.subcommand });
44
44
  return;
45
45
  }
46
- const { runAccountCommand } = await import("./account-cmd-R35a4Oa8.mjs");
46
+ const { runAccountCommand } = await import("./account-cmd-CdUll_35.mjs");
47
47
  const subcommand = args.subcommand === "status" ? "whoami" : args.subcommand;
48
48
  if (!destination.apiUrl) {
49
49
  await runAccountCommand(root, { subcommand });
@@ -1,8 +1,8 @@
1
1
  import { t as VoidAuthProvider } from "./providers-BNKRacMr.mjs";
2
2
  import { i as VoidAuthConfig, n as AuthState } from "./auth-DkcFflXV.mjs";
3
- import { DBFieldAttribute } from "better-auth/db";
4
3
  import { BetterAuthOptions, betterAuth } from "better-auth";
5
4
  import { Context } from "hono";
5
+ import { DBFieldAttribute } from "better-auth/db";
6
6
  //#region src/auth/drizzle.d.ts
7
7
  type AuthIdStrategy = "serial" | "text" | "uuid";
8
8
  type VoidAuthMigrationField = {
@@ -1,9 +1,9 @@
1
1
  import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
- import { H as outro, L as log } from "./dist-BVdsO7Py.mjs";
4
- import { f as import_picocolors, i as dim, m as printSuccess } from "./output-Ba6ZbrzY.mjs";
5
- import { n as PlatformApiError, r as PlatformClient } from "./client-GuSO3v_x.mjs";
6
- import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-WpwkCB_c.mjs";
3
+ import { H as outro, L as log } from "./dist-Cor9XGoz.mjs";
4
+ import { n as PlatformApiError, r as PlatformClient } from "./client-BEkdj1kx.mjs";
5
+ import { f as import_picocolors, i as dim, m as printSuccess } from "./output-BpgYODYx.mjs";
6
+ import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
7
7
  import { appendFileSync, writeFileSync } from "node:fs";
8
8
  //#region src/cli/build-cmd.ts
9
9
  const POLL_MS = 1e3;
@@ -1,9 +1,9 @@
1
1
  import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
- import { L as log } from "./dist-BVdsO7Py.mjs";
4
- import { m as printSuccess, o as formatCount, r as createSpinner } from "./output-Ba6ZbrzY.mjs";
5
- import { r as PlatformClient } from "./client-GuSO3v_x.mjs";
6
- import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-WpwkCB_c.mjs";
3
+ import { L as log } from "./dist-Cor9XGoz.mjs";
4
+ import { r as PlatformClient } from "./client-BEkdj1kx.mjs";
5
+ import { m as printSuccess, o as formatCount, r as createSpinner } from "./output-BpgYODYx.mjs";
6
+ import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
7
7
  //#region src/cli/cache.ts
8
8
  async function runPurgeCacheCommand(root, projectSlug) {
9
9
  console.log();
@@ -1,8 +1,8 @@
1
1
  import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
2
2
  import { c as getToken } from "./auth-B6iOCjKI.mjs";
3
- import { A as confirm, H as outro, L as log, tt as isCancel } from "./dist-BVdsO7Py.mjs";
4
- import { m as printSuccess } from "./output-Ba6ZbrzY.mjs";
5
- import { r as PlatformClient } from "./client-GuSO3v_x.mjs";
3
+ import { A as confirm, H as outro, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
4
+ import { r as PlatformClient } from "./client-BEkdj1kx.mjs";
5
+ import { m as printSuccess } from "./output-BpgYODYx.mjs";
6
6
  //#region src/cli/cancel-deploy.ts
7
7
  const ACTIVE_STATUSES = /* @__PURE__ */ new Set([
8
8
  "pending",
@@ -0,0 +1 @@
1
+ export { t as prepareCfBuildOutput } from "./cf-build-output-BhVxldCw.mjs";
@@ -1,4 +1,5 @@
1
1
  import { a as join, c as resolve, i as isAbsolute, n as dirname, r as extname, s as relative, t as basename } from "./dist-ipQi0Q8y.mjs";
2
+ import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-DeWj5F9Y.mjs";
2
3
  import { copyFileSync, cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
3
4
  import { fileURLToPath } from "node:url";
4
5
  import { isRecord } from "@void/deploy-core";
@@ -6,9 +7,9 @@ import { randomUUID } from "node:crypto";
6
7
  import { tmpdir } from "node:os";
7
8
  import { isDeepStrictEqual } from "node:util";
8
9
  import { spawn, spawnSync } from "node:child_process";
9
- import ignore from "ignore";
10
- import { getWorkerBundleDir, normalizeDirectoryName, readBuildOutput, writeAssets, writeContainerConfig, writeRootConfig, writeWorkerConfig } from "@cloudflare/build-output-utils";
10
+ import { getRootConfigPath, getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, normalizeDirectoryName, readBuildOutput, writeAssets, writeContainerConfig, writeRootConfig, writeWorkerConfig } from "@cloudflare/build-output-utils";
11
11
  import { InputConfigSchema, OutputContainerSchema } from "@cloudflare/config";
12
+ import ignore from "ignore";
12
13
  //#region src/cli/cf-config-migrate.ts
13
14
  function record(value) {
14
15
  return isRecord(value) ? value : null;
@@ -363,6 +364,14 @@ function isInside(directory, path) {
363
364
  const child = relative(directory, path);
364
365
  return child !== "" && child !== ".." && !child.startsWith("../") && !isAbsolute(child);
365
366
  }
367
+ /** Asset copies follow symlinks, so a link may not reach outside the asset directory. */
368
+ function assertAssetSymlinksInside(directory) {
369
+ const realDirectory = realpathSync(directory);
370
+ for (const entry of readdirSync(directory, {
371
+ recursive: true,
372
+ withFileTypes: true
373
+ })) if (entry.isSymbolicLink() && !isInside(realDirectory, realpathSync(join(entry.parentPath, entry.name)))) throw new Error("The Worker assets contain a symlink outside the asset directory.");
374
+ }
366
375
  function copyBundle(source, destination) {
367
376
  const modules = {};
368
377
  for (const entry of readdirSync(source, {
@@ -384,12 +393,14 @@ function copyBundle(source, destination) {
384
393
  }
385
394
  return modules;
386
395
  }
387
- /** Create a private cf Build Output tree from Void's verified Vite artifact. */
388
- async function prepareCfBuildOutput(workerDirectory, accountId) {
396
+ /** Create a disposable cf Build Output tree from an existing Cloudflare Worker build. */
397
+ async function prepareCfBuildOutput(workerDirectory, accountId, mode) {
389
398
  const source = resolve(workerDirectory);
399
+ if (existsSync(getRootConfigPath(source))) return prepareNativeBuildOutput(source, accountId, mode);
400
+ if (!existsSync(join(source, "wrangler.json"))) throw new Error(`No Cloudflare Worker build found in ${source}. Pass the project root that contains .cloudflare/output/v0, or the Worker output directory that contains wrangler.json.`);
390
401
  const raw = record(JSON.parse(readFileSync(join(source, "wrangler.json"), "utf8")));
391
402
  if (!raw) return null;
392
- if (typeof raw.account_id === "string" && raw.account_id !== accountId) return null;
403
+ if (typeof raw.account_id === "string" && accountId !== void 0 && raw.account_id !== accountId) return null;
393
404
  const config = migrateBuiltWranglerConfig(raw);
394
405
  if (!config.worker) throw new Error("cf did not produce a Worker configuration.");
395
406
  if (typeof raw.main !== "string" || !raw.main) throw new Error("The built Worker configuration is missing its main entry. Rebuild the app.");
@@ -412,9 +423,10 @@ async function prepareCfBuildOutput(workerDirectory, accountId) {
412
423
  const bundle = getWorkerBundleDir(directory);
413
424
  mkdirSync(bundle, { recursive: true });
414
425
  const modules = copyBundle(source, bundle);
415
- await writeRootConfig(directory, { accountId }, {
426
+ const configuredAccountId = accountId ?? raw.account_id;
427
+ await writeRootConfig(directory, typeof configuredAccountId === "string" ? { accountId: configuredAccountId } : {}, {
416
428
  isPreview: false,
417
- mode: "production"
429
+ mode: mode ?? "production"
418
430
  });
419
431
  await writeWorkerConfig({
420
432
  root: directory,
@@ -448,6 +460,7 @@ async function prepareCfBuildOutput(workerDirectory, accountId) {
448
460
  await dispose();
449
461
  return null;
450
462
  }
463
+ assertAssetSymlinksInside(assetPath);
451
464
  await writeAssets({
452
465
  root: directory,
453
466
  sourceDirectory: assetPath
@@ -464,6 +477,58 @@ async function prepareCfBuildOutput(workerDirectory, accountId) {
464
477
  throw error;
465
478
  }
466
479
  }
480
+ /** Copy and complete the native artifact without changing the Vite build's inputs or metadata. */
481
+ async function prepareNativeBuildOutput(source, accountId, mode) {
482
+ const built = await readBuildOutput(source);
483
+ if (accountId !== void 0 && built.rootConfig.accountId !== void 0 && accountId !== built.rootConfig.accountId || mode !== void 0 && mode !== built.rootConfig.buildContext.mode) return null;
484
+ const directory = mkdtempSync(join(tmpdir(), "void-cf-native-"));
485
+ const dispose = async () => {
486
+ rmSync(directory, {
487
+ recursive: true,
488
+ force: true
489
+ });
490
+ };
491
+ try {
492
+ await writeRootConfig(directory, {
493
+ accountId: accountId ?? built.rootConfig.accountId,
494
+ complianceRegion: built.rootConfig.complianceRegion
495
+ }, {
496
+ ...built.rootConfig.buildContext,
497
+ mode: built.rootConfig.buildContext.mode
498
+ });
499
+ for (const [name, worker] of Object.entries(built.workers)) {
500
+ if (worker.bundleDir && (!worker.config.manifest || worker.config.manifest.modules[worker.config.manifest.mainModule]?.type !== "esm")) throw new Error("The native Worker build must declare its main ES module.");
501
+ const configPath = getWorkerConfigPath(directory, name);
502
+ mkdirSync(dirname(configPath), { recursive: true });
503
+ writeFileSync(configPath, JSON.stringify(worker.config));
504
+ if (worker.bundleDir && worker.config.manifest) {
505
+ const bundle = getWorkerBundleDir(directory, name);
506
+ for (const module of Object.keys(worker.config.manifest.modules)) {
507
+ const destination = join(bundle, module);
508
+ if (module.includes("\\") || module.includes(":") || !isInside(bundle, resolve(bundle, module)) || !isInside(worker.bundleDir, resolve(worker.bundleDir, module))) throw new Error("Native Worker modules must stay inside the build bundle.");
509
+ if (!existsSync(join(worker.bundleDir, module))) throw new Error(`Native Worker module ${module} is missing from the build bundle.`);
510
+ mkdirSync(dirname(destination), { recursive: true });
511
+ copyFileSync(join(worker.bundleDir, module), destination);
512
+ }
513
+ }
514
+ if (worker.assetsDir) cpSync(worker.assetsDir, getWorkerAssetsDir(directory, name), { recursive: true });
515
+ }
516
+ for (const container of built.containers) await writeContainerConfig({
517
+ root: directory,
518
+ config: container.config,
519
+ directoryName: basename(dirname(container.configPath))
520
+ });
521
+ await readBuildOutput(directory);
522
+ return {
523
+ directory,
524
+ ...built.workers.default.assetsDir ? { assetsDirectory: built.workers.default.assetsDir } : {},
525
+ dispose
526
+ };
527
+ } catch (error) {
528
+ await dispose();
529
+ throw error;
530
+ }
531
+ }
467
532
  /** Bundle a generated Worker entry with Vite, then hand the result to `prepareCfBuildOutput`. */
468
533
  async function prepareBundledBuildOutput(options) {
469
534
  const scratch = mkdtempSync(join(tmpdir(), options.scratchPrefix));
@@ -519,9 +584,9 @@ async function prepareCfStaticBuildOutput(options) {
519
584
  }
520
585
  /** Bundle an adapter-produced Worker and copy only its public framework assets. */
521
586
  async function prepareCfFrameworkBuildOutput(options) {
522
- const raw = record(JSON.parse(readFileSync(options.configPath, "utf8")));
523
- const assets = record(raw?.assets);
524
- if (!raw || typeof raw.main !== "string" || typeof assets?.directory !== "string") return null;
587
+ const raw = readGeneratedWranglerConfigFile(options.configPath);
588
+ const assets = record(raw.assets);
589
+ if (typeof raw.main !== "string" || typeof assets?.directory !== "string") return null;
525
590
  const configDirectory = dirname(options.configPath);
526
591
  const entry = resolve(configDirectory, raw.main);
527
592
  const sourceAssets = resolve(configDirectory, assets.directory);