void 0.21.9 → 0.23.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 (293) hide show
  1. package/README.md +5 -1
  2. package/dist/{account-cmd-DZZGK80W.mjs → account-cmd-C84Ee8cO.mjs} +5 -5
  3. package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
  4. package/dist/application-routing-B7QEjqSR.mjs +27 -0
  5. package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
  6. package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
  7. package/dist/{auth-link-B_CeugBw.mjs → auth-link-CioEg6uY.mjs} +5 -5
  8. package/dist/{auth-router-BgEFRuvZ.mjs → auth-router-BsR981d4.mjs} +5 -5
  9. package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
  10. package/dist/{build-cmd-Dpt0jd-x.mjs → build-cmd-LzvNJORH.mjs} +19 -7
  11. package/dist/{cache-7_UeZdTk.mjs → cache-C4MvnrMH.mjs} +4 -4
  12. package/dist/{cancel-deploy-D23R1RXT.mjs → cancel-deploy-abUxpP2n.mjs} +4 -4
  13. package/dist/{cf-build-output-CGT03qCD.mjs → cf-build-output-BPqOT964.mjs} +141 -63
  14. package/dist/cf-build-output-_0HNWysu.mjs +2 -0
  15. package/dist/cli/cli.mjs +114 -460
  16. package/dist/cli/cloudflare-operation-process.mjs +1103 -0
  17. package/dist/cli/env-schema-probe.d.mts +2 -1
  18. package/dist/cli/env-schema-probe.mjs +3 -3
  19. package/dist/client-Cu7jWiF1.mjs +2 -0
  20. package/dist/{client-QTl6ko_D.mjs → client-RV8NVeB8.mjs} +165 -21
  21. package/dist/{cloudflare-auth-C4_GPZr0.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -43
  22. package/dist/{cloudflare-cmd-bSmZ1d5L.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +9 -10
  23. package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
  24. package/dist/{cloudflare-connect-jAwacxxP.mjs → cloudflare-connect-B8uPZ4nx.mjs} +4 -4
  25. package/dist/{cloudflare-operations-BipGMJ5O.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
  26. package/dist/{cloudflare-operations-sMZXpk_S.mjs → cloudflare-operations-fxHb-byx.mjs} +118 -203
  27. package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
  28. package/dist/{config-CF69HgXc.d.mts → config-BMHb8RCj.d.mts} +2 -2
  29. package/dist/{config-CafTW6Cz.mjs → config-Br_JZD6u.mjs} +2 -7
  30. package/dist/config-C_XRIPx2.mjs +89 -0
  31. package/dist/{config-s7Xj7tPb.mjs → config-CyQ-wVd7.mjs} +1 -1
  32. package/dist/config-entry.d.mts +1 -1
  33. package/dist/{config-write-BSduPMY8.mjs → config-write-B1f88wJA.mjs} +1 -1
  34. package/dist/{connect-BsUSRzln.mjs → connect-Bd4kJd9U.mjs} +6 -6
  35. package/dist/{create-project-BniEV0OW.mjs → create-project-Boczwj5r.mjs} +1 -1
  36. package/dist/{create-project-DBfFSZKY.mjs → create-project-bMf6ffLZ.mjs} +9 -5
  37. package/dist/{db-hRrvZaq_.mjs → db-8uG64XLl.mjs} +26 -26
  38. package/dist/{delete-D6dZ9B6B.mjs → delete-NvbiyeJf.mjs} +4 -4
  39. package/dist/{deploy-WaAQez1O.mjs → deploy-DzAIwqNU.mjs} +944 -607
  40. package/dist/{deploy-DDz7c8LK.mjs → deploy-bjXdFCtn.mjs} +1 -1
  41. package/dist/{dist-BR1quN_w.mjs → dist-AoCzRTJE.mjs} +226 -60
  42. package/dist/{dist-C5fND3R0.mjs → dist-BuDuKZJv.mjs} +1 -1
  43. package/dist/{dist-Dn6nn2IU.mjs → dist-CTBk70IR.mjs} +42 -42
  44. package/dist/{domain-Dmhvb2oU.mjs → domain-y5Tvydvo.mjs} +5 -5
  45. package/dist/{email-DFi-s2t4.mjs → email-B3umsW75.mjs} +15 -30
  46. package/dist/{env-Csi-tMbT.mjs → env-BS6qYHDb.mjs} +6 -6
  47. package/dist/{env-public-D_6u46fX.d.mts → env-public-BX_r8HR6.d.mts} +2 -1
  48. package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
  49. package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
  50. package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
  51. package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
  52. package/dist/{gen-Dz3X1Qab.mjs → gen-B580--vC.mjs} +5 -5
  53. package/dist/gen-BVaUUumi.mjs +2 -0
  54. package/dist/{github-cmd-BED3_9JD.mjs → github-cmd-v45BdfKX.mjs} +6 -8
  55. package/dist/{handler-BXJTXd02.d.mts → handler-CZ4nAylQ.d.mts} +2 -1
  56. package/dist/{headers-BOg_velo.mjs → headers-DWi2IXWx.mjs} +1 -1
  57. package/dist/help-DofyZuY7.mjs +2 -0
  58. package/dist/{help-DC7gdz7L.mjs → help-daGKjXGk.mjs} +268 -666
  59. package/dist/index.d.mts +1 -1
  60. package/dist/index.mjs +305 -1490
  61. package/dist/info-B97bTX9N.mjs +113 -0
  62. package/dist/{init-WO0JlPx8.mjs → init-Bvy7zrBo.mjs} +51 -20
  63. package/dist/limits-Bq5LG8Id.d.mts +27 -0
  64. package/dist/limits-Cjuk2VPm.mjs +68 -0
  65. package/dist/{link-CsHOinF7.mjs → link-CDqqCjFl.mjs} +5 -5
  66. package/dist/{list-CDb-4bZ1.mjs → list-CZj0dzKY.mjs} +5 -5
  67. package/dist/{live-CKiJilLr.d.mts → live-Chw1eIMv.d.mts} +1 -1
  68. package/dist/{local-d1-CC8sKFGu.mjs → local-d1-2CMnpuW_.mjs} +2 -2
  69. package/dist/login-DYt_An22.mjs +2 -0
  70. package/dist/{login-DvqXsfGs.mjs → login-UZKFM_u7.mjs} +5 -5
  71. package/dist/{logs-BdfiOezj.mjs → logs-CUZ6t9t3.mjs} +5 -5
  72. package/dist/migrate-8_2u55MD.mjs +2 -0
  73. package/dist/{migrate-B8KuoYsO.mjs → migrate-DHul7PRV.mjs} +5 -4
  74. package/dist/{node-BM43oz4G.mjs → node-BkyRWRx8.mjs} +2 -2
  75. package/dist/operator-args-CLgKGlwU.mjs +690 -0
  76. package/dist/{operator-cmd-03819ATr.mjs → operator-cmd-DBA6dl0m.mjs} +69 -23
  77. package/dist/output-Dm_A4Tbv.mjs +81 -0
  78. package/dist/pages/client.d.mts +34 -2
  79. package/dist/pages/client.mjs +59 -3
  80. package/dist/pages/index.d.mts +1 -1
  81. package/dist/pages/index.mjs +3 -3
  82. package/dist/pages/islands-plugin.d.mts +16 -6
  83. package/dist/pages/islands-plugin.mjs +2 -2
  84. package/dist/pages/protocol.d.mts +2 -2
  85. package/dist/pages/protocol.mjs +2 -308
  86. package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
  87. package/dist/{output-CCH48AMM.mjs → picocolors-BTps1_gs.mjs} +2 -76
  88. package/dist/plan-D1Q5rf-r.mjs +2 -0
  89. package/dist/plan-NPpwZ_kc.mjs +58 -0
  90. package/dist/platform-args-BJdRtlLq.mjs +506 -0
  91. package/dist/platform-args-D3RXyR6h.mjs +2 -0
  92. package/dist/{platform-auth-config-z92h63q5.mjs → platform-auth-config-B56E9YP1.mjs} +4 -4
  93. package/dist/{platform-auth-protection-DeE3yr2R.mjs → platform-auth-protection-BDWO_aER.mjs} +3 -3
  94. package/dist/{platform-auth-recovery-o_340Ixx.mjs → platform-auth-recovery-1gg4CSRe.mjs} +4 -4
  95. package/dist/{platform-cmd-C4ZV3Vpy.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
  96. package/dist/{platform-cmd-DNl8WosH.mjs → platform-cmd-DMcQStSc.mjs} +26 -5
  97. package/dist/{platform-domain-CU1JtJkW.mjs → platform-domain-BNkcz0OB.mjs} +36 -9
  98. package/dist/{platform-lifecycle-Bc047IeT.mjs → platform-lifecycle-9OyBALhH.mjs} +850 -276
  99. package/dist/{platform-lifecycle-Bs2qx1E3.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
  100. package/dist/{platform-management-CVpGI9Y5.mjs → platform-management-CjwLVQwN.mjs} +59 -11
  101. package/dist/{platform-management-C8tt6D8h.mjs → platform-management-CnyTdcWX.mjs} +1 -1
  102. package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
  103. package/dist/{platform-recovery-dvUaptLr.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
  104. package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
  105. package/dist/{prepare-DyZ-Yok5.mjs → prepare-B5Mkic5u.mjs} +3 -3
  106. package/dist/{prepare-C3kt3Rst.mjs → prepare-DOsL0CC9.mjs} +4 -20
  107. package/dist/prepare-cgvDMtSb.mjs +2 -0
  108. package/dist/{project-cmd-B44I8J_W.mjs → project-cmd-CNzrqvBv.mjs} +30 -16
  109. package/dist/{project-team-BkbYIsXN.mjs → project-team-DQOWPfQT.mjs} +4 -4
  110. package/dist/{project-token-C8xEEQnB.mjs → project-token-CTDYU0Cc.mjs} +4 -4
  111. package/dist/project-zero-trust-BNAkW-_0.mjs +63 -0
  112. package/dist/{protocol-ZH3jP4a7.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
  113. package/dist/protocol-U7bfjHmA.mjs +331 -0
  114. package/dist/{provision-DNtrtaVD.mjs → provision-C4ORE7G7.mjs} +1 -1
  115. package/dist/{provision-BhreDAOS.mjs → provision-CJFgTZY8.mjs} +111 -215
  116. package/dist/{requests-DFyhBMaf.mjs → requests-MhxYnau8.mjs} +4 -4
  117. package/dist/resource-name-C7LVpcRm.mjs +11 -0
  118. package/dist/{rollback-DHHxXZiS.mjs → rollback-CJ6iSDoU.mjs} +5 -5
  119. package/dist/route-url-CG7U-cRN.mjs +15 -0
  120. package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
  121. package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
  122. package/dist/runtime/ai.d.mts +12 -8
  123. package/dist/runtime/ai.mjs +84 -17
  124. package/dist/runtime/better-auth-mysql.mjs +1 -1
  125. package/dist/runtime/better-auth-pg.mjs +1 -1
  126. package/dist/runtime/better-auth.mjs +1 -1
  127. package/dist/runtime/client-react.mjs +2 -2
  128. package/dist/runtime/client-solid.mjs +2 -2
  129. package/dist/runtime/client-svelte.mjs +2 -2
  130. package/dist/runtime/client-vue.mjs +2 -2
  131. package/dist/runtime/client.mjs +2 -2
  132. package/dist/runtime/durable.d.mts +3 -1
  133. package/dist/runtime/durable.mjs +4 -1
  134. package/dist/runtime/email/testing.mjs +1 -1
  135. package/dist/runtime/env-public.d.mts +1 -1
  136. package/dist/runtime/fetch-stream.mjs +1 -1
  137. package/dist/runtime/fetch.mjs +1 -1
  138. package/dist/runtime/handler.d.mts +1 -1
  139. package/dist/runtime/kv.mjs +0 -1
  140. package/dist/runtime/limits.d.mts +2 -0
  141. package/dist/runtime/limits.mjs +2 -0
  142. package/dist/runtime/live-client.d.mts +1 -1
  143. package/dist/runtime/live-server.mjs +25 -16
  144. package/dist/runtime/live.d.mts +1 -1
  145. package/dist/runtime/migration-handler.mjs +62 -42
  146. package/dist/runtime/route-url.d.mts +4 -0
  147. package/dist/runtime/route-url.mjs +2 -0
  148. package/dist/runtime/routing.d.mts +180 -0
  149. package/dist/runtime/routing.mjs +1082 -0
  150. package/dist/runtime/sandbox-container.d.mts +3 -0
  151. package/dist/runtime/sandbox-container.mjs +2 -0
  152. package/dist/runtime/sandbox.d.mts +4 -32
  153. package/dist/runtime/sandbox.mjs +151 -75
  154. package/dist/runtime/sse.mjs +1 -1
  155. package/dist/runtime/validator.d.mts +1 -1
  156. package/dist/runtime/ws-server.d.mts +4 -2
  157. package/dist/runtime/ws-server.mjs +27 -2
  158. package/dist/runtime/ws.d.mts +2 -2
  159. package/dist/runtime/ws.mjs +8 -6
  160. package/dist/sandbox-XZAqzFlG.d.mts +52 -0
  161. package/dist/sandbox-container-Bo0eiFKz.d.mts +73 -0
  162. package/dist/sandbox-container-C6ItmVuN.mjs +281 -0
  163. package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
  164. package/dist/{secret-DN9sSNiV.mjs → secret-Dli5fP0B.mjs} +6 -6
  165. package/dist/{skills-O6FUaizK.mjs → skills-D1II1Juz.mjs} +1 -1
  166. package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
  167. package/dist/{subcommand-prompt-BuGYkAkC.mjs → subcommand-prompt-CY1C4fvl.mjs} +2 -2
  168. package/dist/validate-Dq_L3s0S.mjs +2 -0
  169. package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
  170. package/dist/{wrangler-BymcxrRa.mjs → wrangler-7K-bW_DL.mjs} +14 -235
  171. package/dist/{ws-BwcqizuH.d.mts → ws-CL1w7GXU.d.mts} +13 -2
  172. package/package.json +48 -33
  173. package/sandbox.Dockerfile +4 -0
  174. package/schema.json +10 -22
  175. package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
  176. package/skills/void/SKILL.md +50 -133
  177. package/skills/void/docs/guide/ai.md +94 -84
  178. package/skills/void/docs/guide/app-types.md +3 -32
  179. package/skills/void/docs/guide/auth.md +12 -116
  180. package/skills/void/docs/guide/database/d1.md +9 -54
  181. package/skills/void/docs/guide/database/mysql.md +1 -1
  182. package/skills/void/docs/guide/database/postgresql.md +5 -26
  183. package/skills/void/docs/guide/database.md +23 -75
  184. package/skills/void/docs/guide/deployment.md +27 -113
  185. package/skills/void/docs/guide/durable-state.md +43 -18
  186. package/skills/void/docs/guide/edge/headers.md +3 -47
  187. package/skills/void/docs/guide/edge/prerendering.md +5 -20
  188. package/skills/void/docs/guide/edge/redirects.md +11 -64
  189. package/skills/void/docs/guide/edge/revalidation.md +6 -19
  190. package/skills/void/docs/guide/edge/rewrites.md +56 -284
  191. package/skills/void/docs/guide/edge/static-assets.md +23 -72
  192. package/skills/void/docs/guide/email/domains.md +112 -0
  193. package/skills/void/docs/guide/email/receiving.md +139 -0
  194. package/skills/void/docs/guide/email/sending.md +231 -0
  195. package/skills/void/docs/guide/email.md +13 -619
  196. package/skills/void/docs/guide/env-migration.md +11 -11
  197. package/skills/void/docs/guide/env-vars.md +9 -29
  198. package/skills/void/docs/guide/index.md +0 -15
  199. package/skills/void/docs/guide/jobs.md +3 -18
  200. package/skills/void/docs/guide/kv.md +5 -11
  201. package/skills/void/docs/guide/live.md +5 -56
  202. package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
  203. package/skills/void/docs/guide/pages-routing/head.md +10 -10
  204. package/skills/void/docs/guide/pages-routing/islands.md +6 -36
  205. package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
  206. package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
  207. package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
  208. package/skills/void/docs/guide/pages-routing/overview.md +7 -17
  209. package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
  210. package/skills/void/docs/guide/platform/administration/access.md +1 -4
  211. package/skills/void/docs/guide/platform/administration/email.md +35 -8
  212. package/skills/void/docs/guide/platform/administration/operations.md +26 -4
  213. package/skills/void/docs/guide/platform/administration/plans.md +126 -0
  214. package/skills/void/docs/guide/platform/administration/projects.md +5 -2
  215. package/skills/void/docs/guide/platform/administration/zero-trust.md +189 -0
  216. package/skills/void/docs/guide/platform/development/local.md +2 -2
  217. package/skills/void/docs/guide/platform/development/runtime.md +3 -13
  218. package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
  219. package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
  220. package/skills/void/docs/guide/platform/installation/domains.md +31 -3
  221. package/skills/void/docs/guide/platform/installation/first-deployment.md +6 -0
  222. package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
  223. package/skills/void/docs/guide/platform/installation/prerequisites.md +21 -16
  224. package/skills/void/docs/guide/platform/installation/setup.md +9 -5
  225. package/skills/void/docs/guide/platform/installation/uninstall.md +17 -2
  226. package/skills/void/docs/guide/platform-administration.md +2 -0
  227. package/skills/void/docs/guide/queues.md +7 -9
  228. package/skills/void/docs/guide/quickstart.md +38 -37
  229. package/skills/void/docs/guide/remote-dev.md +4 -9
  230. package/skills/void/docs/guide/sandboxes.md +78 -41
  231. package/skills/void/docs/guide/server-routing.md +9 -72
  232. package/skills/void/docs/guide/sse.md +4 -18
  233. package/skills/void/docs/guide/ssg.md +3 -15
  234. package/skills/void/docs/guide/ssr.md +14 -62
  235. package/skills/void/docs/guide/storage.md +9 -4
  236. package/skills/void/docs/guide/type-safety.md +3 -14
  237. package/skills/void/docs/guide/typed-fetch.md +3 -7
  238. package/skills/void/docs/guide/websockets.md +68 -40
  239. package/skills/void/docs/integrations/agents.md +3 -3
  240. package/skills/void/docs/integrations/cloudflare.md +85 -316
  241. package/skills/void/docs/integrations/frameworks/analog.md +5 -64
  242. package/skills/void/docs/integrations/frameworks/astro.md +4 -73
  243. package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
  244. package/skills/void/docs/integrations/frameworks/overview.md +11 -54
  245. package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
  246. package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
  247. package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
  248. package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
  249. package/skills/void/docs/reference/api/auth.md +156 -0
  250. package/skills/void/docs/reference/api/client.md +87 -0
  251. package/skills/void/docs/reference/api/database.md +95 -0
  252. package/skills/void/docs/reference/api/durable.md +46 -0
  253. package/skills/void/docs/reference/api/env.md +50 -0
  254. package/skills/void/docs/reference/api/handlers.md +254 -0
  255. package/skills/void/docs/reference/api/pages.md +241 -0
  256. package/skills/void/docs/reference/api/plugin.md +39 -0
  257. package/skills/void/docs/reference/api/resources.md +109 -0
  258. package/skills/void/docs/reference/api/rewrites.md +76 -0
  259. package/skills/void/docs/reference/api/types.md +92 -0
  260. package/skills/void/docs/reference/api.md +56 -1218
  261. package/skills/void/docs/reference/cli/auth.md +88 -0
  262. package/skills/void/docs/reference/cli/database.md +128 -0
  263. package/skills/void/docs/reference/cli/deploy.md +85 -0
  264. package/skills/void/docs/reference/cli/domains.md +41 -0
  265. package/skills/void/docs/reference/cli/email.md +129 -0
  266. package/skills/void/docs/reference/cli/generate.md +116 -0
  267. package/skills/void/docs/reference/cli/github.md +189 -0
  268. package/skills/void/docs/reference/cli/platform-config.md +92 -0
  269. package/skills/void/docs/reference/cli/platform-email.md +81 -0
  270. package/skills/void/docs/reference/cli/platform-installation.md +127 -0
  271. package/skills/void/docs/reference/cli/platform-operations.md +90 -0
  272. package/skills/void/docs/reference/cli/platform-users.md +89 -0
  273. package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
  274. package/skills/void/docs/reference/cli/platform.md +70 -0
  275. package/skills/void/docs/reference/cli/project.md +214 -0
  276. package/skills/void/docs/reference/cli/secrets.md +76 -0
  277. package/skills/void/docs/reference/cli/setup.md +70 -0
  278. package/skills/void/docs/reference/cli.md +33 -1621
  279. package/skills/void/docs/reference/config.md +26 -32
  280. package/skills/void/docs/reference/resource-inference.md +3 -58
  281. package/skills/void/docs/reference/structure.md +14 -41
  282. package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
  283. package/dist/cli/cf-compat.mjs +0 -968
  284. package/dist/client-4cDVv7BO.mjs +0 -2
  285. package/dist/gen-Vnv2f65C.mjs +0 -2
  286. package/dist/help-DQMfeKMz.mjs +0 -2
  287. package/dist/login-DFQk7rbW.mjs +0 -2
  288. package/dist/migrate-TsHGBnDA.mjs +0 -2
  289. package/dist/plan-BEZ8VJW0.mjs +0 -256
  290. package/dist/plan-DpuOr14e.mjs +0 -2
  291. package/dist/prepare-BZXkjdNe.mjs +0 -2
  292. package/dist/validate-EKmJWxmy.mjs +0 -2
  293. /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
@@ -1,9 +1,9 @@
1
1
  import { a as join, i as isAbsolute, l as relative, n as dirname, r as extname, t as basename, u as resolve } from "./dist-BVqXeR_h.mjs";
2
2
  import { copyFileSync, cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
3
- import { fileURLToPath, pathToFileURL } from "node:url";
4
- import { build } from "vite";
3
+ import { fileURLToPath } from "node:url";
4
+ import { randomUUID } from "node:crypto";
5
5
  import { tmpdir } from "node:os";
6
- import { spawnSync } from "node:child_process";
6
+ import { spawn, spawnSync } from "node:child_process";
7
7
  import { isDeepStrictEqual } from "node:util";
8
8
  import { getWorkerBundleDir, normalizeDirectoryName, readBuildOutput, writeAssets, writeContainerConfig, writeRootConfig, writeWorkerConfig } from "@cloudflare/build-output-utils";
9
9
  import { InputConfigSchema, OutputContainerSchema } from "@cloudflare/config";
@@ -111,14 +111,12 @@ function uncredentialedEnvironment() {
111
111
  env.CF_DELEGATION = "1";
112
112
  return env;
113
113
  }
114
- function migrationFollowUps(output) {
115
- return [...output.matchAll(/\[required\] ([^:\n]+): ([^\n]+)/g)].map((match) => ({
116
- path: match[1],
117
- message: match[2]
118
- }));
119
- }
120
- function assertHandledFollowUps(output) {
121
- for (const item of migrationFollowUps(output)) if (!(item.path === "assets.directory" && item.message.includes("assets directory") || /^d1_databases\.\d+$/.test(item.path) && /`migrations_(?:dir|table)`/.test(item.message) || /^durable_objects\.bindings\.\d+$/.test(item.path) || item.path === "migrations" || item.path === "containers")) throw new Error(`cf cannot migrate Cloudflare setting ${item.path}: ${item.message}`);
114
+ function assertHandledFollowUps(followUps) {
115
+ for (const item of followUps) {
116
+ if (!item.blocking) continue;
117
+ const path = item.sourcePath ?? item.code;
118
+ if (!(path === "assets.directory" && item.message.includes("assets directory") || /^d1_databases\.\d+$/.test(path) && /`migrations_(?:dir|table)`/.test(item.message) || /^durable_objects\.bindings\.\d+$/.test(path) || path === "migrations" || path === "containers")) throw new Error(`cf cannot migrate Cloudflare setting ${path}: ${item.message}`);
119
+ }
122
120
  }
123
121
  function durableObjectExports(raw) {
124
122
  const migrations = raw.migrations;
@@ -172,8 +170,14 @@ function containersFromWrangler(raw, exports) {
172
170
  if (values === void 0) return [];
173
171
  if (!Array.isArray(values) || !values.every((value) => record(value))) throw new Error("Invalid Containers in the built Cloudflare config.");
174
172
  return values.map((value) => {
175
- if (typeof value.name !== "string" || typeof value.class_name !== "string" || typeof value.image !== "string") throw new Error("cf requires a name, class_name and image for each Container.");
176
- const fields = /* @__PURE__ */ new Set([
173
+ if (typeof value.name !== "string" || typeof value.class_name !== "string") throw new Error("cf requires a name and class_name for each Container.");
174
+ const managed = value.scheduling_policy === "durable_object";
175
+ const fields = new Set(managed ? [
176
+ "name",
177
+ "class_name",
178
+ "scheduling_policy",
179
+ "images"
180
+ ] : [
177
181
  "name",
178
182
  "class_name",
179
183
  "image",
@@ -184,23 +188,59 @@ function containersFromWrangler(raw, exports) {
184
188
  const declaration = record(exports[value.class_name]);
185
189
  if (!declaration || declaration.storage !== "sqlite") throw new Error(`Container ${value.name} needs a SQLite Durable Object export.`);
186
190
  declaration.container = value.name;
191
+ if (managed) {
192
+ const images = record(value.images);
193
+ if (!images) throw new Error("A Sandbox requires a named image.");
194
+ return {
195
+ name: value.name,
196
+ schedulingPolicy: "durable-object",
197
+ images: Object.fromEntries(Object.entries(images).map(([name, image]) => {
198
+ const source = record(image);
199
+ if (!source || Object.keys(source).some((key) => ![
200
+ "dockerfile",
201
+ "build_context",
202
+ "image"
203
+ ].includes(key)) || source.dockerfile !== void 0 && source.image !== void 0 || source.build_context !== void 0 && typeof source.build_context !== "string") throw new Error("Invalid Sandbox image.");
204
+ if (typeof source.dockerfile === "string") return [name, {
205
+ dockerfile: source.dockerfile,
206
+ ...typeof source.build_context === "string" ? { buildContext: source.build_context } : {}
207
+ }];
208
+ if (typeof source.image === "string") return [name, { reference: source.image }];
209
+ throw new Error("Invalid Sandbox image source.");
210
+ }))
211
+ };
212
+ }
213
+ if (typeof value.image !== "string") throw new Error("A Container requires an image.");
187
214
  return {
188
215
  name: value.name,
189
- schedulingPolicy: "durable-object",
190
- images: { default: { reference: value.image } },
216
+ image: { reference: value.image },
191
217
  ...typeof value.max_instances === "number" ? { maxInstances: value.max_instances } : {},
192
218
  ...typeof value.instance_type === "string" ? { instanceType: value.instance_type } : {}
193
219
  };
194
220
  });
195
221
  }
196
- /**
197
- * Ask the pinned cf CLI to translate the Vite plugin's generated JSON config.
198
- * Migration runs on a disposable copy without Cloudflare credentials; its
199
- * generated module is evaluated in a second uncredentialed Node process.
200
- */
222
+ const migrationScript = String.raw`
223
+ import { readFileSync, writeFileSync } from 'node:fs';
224
+ import { dirname, join } from 'node:path';
225
+ import { pathToFileURL } from 'node:url';
226
+ const { migrateWranglerToCf } = await import(process.argv[1]);
227
+ const configPath = process.argv[2];
228
+ const migration = await migrateWranglerToCf(configPath, {
229
+ bundler: 'vite', force: true, installDependencies: false,
230
+ });
231
+ const directory = dirname(configPath);
232
+ const generated = readFileSync(join(directory, 'cloudflare.config.ts'), 'utf8');
233
+ const executable = generated.replace(/^throw new Error\("Migration incomplete\.[^\n]*\);\s*$/m, '');
234
+ if (executable === generated && migration.status !== 'complete') {
235
+ throw new Error('cf did not provide a usable Cloudflare configuration.');
236
+ }
237
+ const executablePath = join(directory, 'cloudflare.config.mjs');
238
+ writeFileSync(executablePath, executable, { mode: 0o600 });
239
+ const config = (await import(pathToFileURL(executablePath).href)).default;
240
+ process.stdout.write(JSON.stringify({ config, followUps: migration.followUps }));
241
+ `;
201
242
  function migrateBuiltWranglerConfig(raw) {
202
243
  const cfPackage = fileURLToPath(import.meta.resolve("cf/package.json"));
203
- const cfBinary = join(dirname(cfPackage), "bin", "cf");
204
244
  const directory = mkdtempSync(join(tmpdir(), "void-cf-config-"));
205
245
  try {
206
246
  mkdirSync(join(directory, "node_modules"));
@@ -216,44 +256,23 @@ function migrateBuiltWranglerConfig(raw) {
216
256
  }), { mode: 384 });
217
257
  const configPath = join(directory, "wrangler.json");
218
258
  writeFileSync(configPath, JSON.stringify(migrationInput(raw)), { mode: 384 });
219
- const env = uncredentialedEnvironment();
220
259
  const migrated = spawnSync(process.execPath, [
221
- cfBinary,
222
- "migrate",
223
- configPath,
224
- "--bundler",
225
- "vite",
226
- "--no-install",
227
- "--force"
228
- ], {
229
- cwd: directory,
230
- env,
231
- encoding: "utf8",
232
- timeout: 3e4,
233
- maxBuffer: 4194304
234
- });
235
- const generatedPath = join(directory, "cloudflare.config.ts");
236
- if (!existsSync(generatedPath) || migrated.error) throw new Error("cf could not translate the built Cloudflare configuration.");
237
- assertHandledFollowUps(migrated.stdout);
238
- const generated = readFileSync(generatedPath, "utf8");
239
- const executable = generated.replace(/^throw new Error\("Migration incomplete\.[^\n]*\);\s*$/m, "");
240
- if (executable === generated && migrated.status !== 0) throw new Error("cf did not provide a usable Cloudflare configuration.");
241
- const executablePath = join(directory, "cloudflare.config.mjs");
242
- writeFileSync(executablePath, executable, { mode: 384 });
243
- const evaluated = spawnSync(process.execPath, [
244
260
  "--input-type=module",
245
261
  "-e",
246
- "const mod = await import(process.argv[1]); process.stdout.write(JSON.stringify(mod.default));",
247
- pathToFileURL(executablePath).href
262
+ migrationScript,
263
+ import.meta.resolve("@cloudflare/codemods"),
264
+ configPath
248
265
  ], {
249
266
  cwd: directory,
250
- env,
267
+ env: uncredentialedEnvironment(),
251
268
  encoding: "utf8",
252
- timeout: 1e4,
269
+ timeout: 3e4,
253
270
  maxBuffer: 4194304
254
271
  });
255
- if (evaluated.status !== 0 || evaluated.error) throw new Error("cf generated a configuration that Void could not validate.");
256
- const result = record(JSON.parse(evaluated.stdout));
272
+ if (migrated.status !== 0 || migrated.error) throw new Error("cf could not translate the built Cloudflare configuration.");
273
+ const migration = JSON.parse(migrated.stdout);
274
+ assertHandledFollowUps(migration.followUps);
275
+ const result = record(migration.config);
257
276
  const worker = record(result?.worker);
258
277
  if (!result || !worker) throw new Error("cf did not generate a Worker configuration.");
259
278
  applyPreservationFlags(raw, worker);
@@ -288,6 +307,37 @@ function migrateBuiltWranglerConfig(raw) {
288
307
  }
289
308
  }
290
309
  //#endregion
310
+ //#region src/cli/container-image.ts
311
+ function docker(args, quiet = false) {
312
+ return new Promise((resolve, reject) => {
313
+ const child = spawn(process.env.WRANGLER_DOCKER_BIN ?? "docker", args, { stdio: quiet ? "ignore" : "inherit" });
314
+ child.once("error", reject);
315
+ child.once("exit", (code) => code === 0 ? resolve() : reject(/* @__PURE__ */ new Error("Sandbox image preparation failed. Start Docker and retry the deployment.")));
316
+ });
317
+ }
318
+ /** Build locally; the pinned cf uploader pushes this tag to the managed registry. */
319
+ async function buildContainerImage(dockerfile, buildContext = dirname(dockerfile)) {
320
+ const localReference = `void-sandbox-build:${randomUUID()}`;
321
+ await docker([
322
+ "build",
323
+ "--platform",
324
+ "linux/amd64",
325
+ "--file",
326
+ dockerfile,
327
+ "--tag",
328
+ localReference,
329
+ buildContext
330
+ ]);
331
+ return {
332
+ localReference,
333
+ dispose: () => docker([
334
+ "image",
335
+ "rm",
336
+ localReference
337
+ ], true).catch(() => {})
338
+ };
339
+ }
340
+ //#endregion
291
341
  //#region src/cli/cf-build-output.ts
292
342
  function object(value) {
293
343
  return value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
@@ -298,6 +348,11 @@ const moduleTypes = {
298
348
  ".cjs": "cjs",
299
349
  ".wasm": "wasm",
300
350
  ".bin": "data",
351
+ ".woff": "data",
352
+ ".woff2": "data",
353
+ ".ttf": "data",
354
+ ".otf": "data",
355
+ ".eot": "data",
301
356
  ".txt": "text",
302
357
  ".html": "text",
303
358
  ".sql": "text",
@@ -320,7 +375,7 @@ function copyBundle(source, destination) {
320
375
  const name = relative(source, absolute);
321
376
  if (name === "wrangler.json" || name === ".dev.vars" || name === join(".vite", "manifest.json") || name.endsWith(".css") || name.endsWith(".css.map")) continue;
322
377
  const type = moduleTypes[extname(entry.name).toLowerCase()];
323
- if (!type) return null;
378
+ if (!type) throw new Error(`The built Worker contains an unsupported module ${JSON.stringify(name)}. Emit public assets into the client output or configure the plugin that produced this file to run only in the client environment.`);
324
379
  const destinationPath = join(destination, name);
325
380
  mkdirSync(dirname(destinationPath), { recursive: true });
326
381
  if (entry.isSymbolicLink()) copyFileSync(realpathSync(absolute), destinationPath);
@@ -337,10 +392,14 @@ async function prepareCfBuildOutput(workerDirectory, accountId) {
337
392
  if (typeof raw.account_id === "string" && raw.account_id !== accountId) return null;
338
393
  const config = migrateBuiltWranglerConfig(raw);
339
394
  if (!config.worker) throw new Error("cf did not produce a Worker configuration.");
340
- const main = raw.main;
341
- if (typeof main !== "string" || basename(main) !== main || !existsSync(join(source, main))) return null;
395
+ if (typeof raw.main !== "string" || !raw.main) throw new Error("The built Worker configuration is missing its main entry. Rebuild the app.");
396
+ const entry = raw.main.replaceAll("\\", "/");
397
+ const main = relative(source, resolve(source, entry));
398
+ if (isAbsolute(entry) || /^[a-z]:/i.test(entry) || !main || main === ".." || main.startsWith("../")) throw new Error("The built Worker main entry must be inside its output directory.");
399
+ if (!existsSync(join(source, main))) throw new Error(`The built Worker main entry ${JSON.stringify(main)} is missing. Rebuild the app.`);
342
400
  const assetsDirectory = object(raw.assets)?.directory;
343
401
  if (assetsDirectory !== void 0 && typeof assetsDirectory !== "string") return null;
402
+ const images = [];
344
403
  const directory = mkdtempSync(join(tmpdir(), "void-cf-deploy-"));
345
404
  try {
346
405
  const bundle = getWorkerBundleDir(directory);
@@ -366,11 +425,23 @@ async function prepareCfBuildOutput(workerDirectory, accountId) {
366
425
  modules
367
426
  }
368
427
  });
369
- for (const container of config.containers ?? []) await writeContainerConfig({
370
- root: directory,
371
- config: OutputContainerSchema.parse(container),
372
- directoryName: normalizeDirectoryName(container.name)
373
- });
428
+ for (const container of config.containers ?? []) {
429
+ const builtContainer = { ...container };
430
+ if ("images" in container && container.images) {
431
+ const prepared = {};
432
+ for (const [name, image] of Object.entries(container.images)) if ("dockerfile" in image) {
433
+ const built = await buildContainerImage(resolve(source, image.dockerfile), image.buildContext ? resolve(source, image.buildContext) : void 0);
434
+ images.push(built);
435
+ prepared[name] = { localReference: built.localReference };
436
+ } else prepared[name] = image;
437
+ builtContainer.images = prepared;
438
+ }
439
+ await writeContainerConfig({
440
+ root: directory,
441
+ config: OutputContainerSchema.parse(builtContainer),
442
+ directoryName: normalizeDirectoryName(container.name)
443
+ });
444
+ }
374
445
  if (typeof assetsDirectory === "string") {
375
446
  const assetPath = resolve(source, assetsDirectory);
376
447
  if (!existsSync(assetPath)) {
@@ -378,6 +449,7 @@ async function prepareCfBuildOutput(workerDirectory, accountId) {
378
449
  recursive: true,
379
450
  force: true
380
451
  });
452
+ await Promise.all(images.map((image) => image.dispose()));
381
453
  return null;
382
454
  }
383
455
  await writeAssets({
@@ -389,16 +461,20 @@ async function prepareCfBuildOutput(workerDirectory, accountId) {
389
461
  return {
390
462
  directory,
391
463
  ...typeof assetsDirectory === "string" ? { assetsDirectory: resolve(source, assetsDirectory) } : {},
392
- dispose: () => rmSync(directory, {
393
- recursive: true,
394
- force: true
395
- })
464
+ dispose: async () => {
465
+ rmSync(directory, {
466
+ recursive: true,
467
+ force: true
468
+ });
469
+ await Promise.all(images.map((image) => image.dispose()));
470
+ }
396
471
  };
397
472
  } catch (error) {
398
473
  rmSync(directory, {
399
474
  recursive: true,
400
475
  force: true
401
476
  });
477
+ await Promise.all(images.map((image) => image.dispose()));
402
478
  throw error;
403
479
  }
404
480
  }
@@ -410,6 +486,7 @@ async function prepareCfStaticBuildOutput(options) {
410
486
  if (!existsSync(entry)) return null;
411
487
  const scratch = mkdtempSync(join(tmpdir(), "void-cf-static-"));
412
488
  try {
489
+ const { build } = await import("vite");
413
490
  await build({
414
491
  configFile: false,
415
492
  root: options.projectRoot,
@@ -475,6 +552,7 @@ async function prepareCfFrameworkBuildOutput(options) {
475
552
  copyFileSync(target, destination);
476
553
  } else if (file.isFile()) copyFileSync(absolute, destination);
477
554
  }
555
+ const { build } = await import("vite");
478
556
  await build({
479
557
  configFile: false,
480
558
  root: options.projectRoot,
@@ -0,0 +1,2 @@
1
+ import { t as prepareCfBuildOutput } from "./cf-build-output-BPqOT964.mjs";
2
+ export { prepareCfBuildOutput };