void 1.12.1 → 1.13.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.
- package/README.md +1 -0
- package/dist/{account-cmd-BU1Fy_Bf.mjs → account-cmd-4fQiXYX7.mjs} +6 -6
- package/dist/{application-analysis-DVeN8yoi.mjs → application-analysis-BjEwHTV2.mjs} +19 -13
- package/dist/{application-routing-KKw4Y84h.mjs → application-routing-COCfD2yc.mjs} +1 -1
- package/dist/args-DrnTI35r.mjs +88 -0
- package/dist/args-MnQnqypt.mjs +1 -0
- package/dist/{auth-CqwJwItO.mjs → auth-CeBmolb-.mjs} +3 -3
- package/dist/{auth-A7cZ8aXA.mjs → auth-CvaDxOMi.mjs} +1 -1
- package/dist/{auth-link-Duu2NvN5.mjs → auth-link-I4omV0pL.mjs} +6 -6
- package/dist/{auth-router-vgtOdb9j.mjs → auth-router-CXq4q7bb.mjs} +6 -5
- package/dist/{better-auth-shared-BS3pDQbT.d.mts → better-auth-shared-CrIkcN8I.d.mts} +2 -1
- package/dist/bindings-C7zOgxT3.d.mts +28 -0
- package/dist/browser-run-BKgZVwLk.mjs +124 -0
- package/dist/{build-cmd-B7OJ0U5R.mjs → build-cmd-Biz6u4rn.mjs} +6 -6
- package/dist/{cache-wSpi3aeM.mjs → cache-WkLMUrjQ.mjs} +6 -6
- package/dist/{cancel-deploy-DMWzkAlb.mjs → cancel-deploy-BRsrmyTk.mjs} +6 -5
- package/dist/{cf-access-DHklo7Rg.mjs → cf-access-B21j-nd6.mjs} +1 -1
- package/dist/{cf-build-output-Cso7Vh-t.mjs → cf-build-output-G-7Tdd8b.mjs} +6 -5
- package/dist/cf-build-output-Qc43LWzE.mjs +1 -0
- package/dist/{cf-command-values-5BPBRc9Z.mjs → cf-command-values-cUnJwCyG.mjs} +24 -1
- package/dist/{cf-config-migrate-D271BTiw.mjs → cf-config-migrate-CsbQGzMf.mjs} +200 -94
- package/dist/cf-user-agent-HHTRzfud.mjs +15 -0
- package/dist/cf-version-api-BWHMVtzw.mjs +1 -0
- package/dist/cf-version-api-XEEK2B9A.mjs +856 -0
- package/dist/cf-worker-settings-DJKdy97k.mjs +127 -0
- package/dist/cli/cli.mjs +1 -1
- package/dist/cli/cloudflare-operation-process.mjs +111 -47
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/cli/json-command-process.d.mts +6 -0
- package/dist/cli/json-command-process.mjs +91 -0
- package/dist/{cli-main-BrChcpE3.mjs → cli-main-CJTGhcYN.mjs} +84 -113
- package/dist/{client-eLZwqkPH.mjs → client-0um7Lzze.mjs} +1 -1
- package/dist/{client-DE2m2ldh.mjs → client-BEHI4UWn.mjs} +14 -8
- package/dist/{cloudflare-auth-eWfhdZCk.mjs → cloudflare-auth-iOgRurWm.mjs} +1 -1
- package/dist/{cloudflare-cmd-SsFlJe2B.mjs → cloudflare-cmd-DsSlXbNy.mjs} +5 -5
- package/dist/{cloudflare-config-D9UFH_A5.mjs → cloudflare-config-KPHKf57C.mjs} +2 -2
- package/dist/{cloudflare-connect-BgpHcSg3.mjs → cloudflare-connect-bEtneBjT.mjs} +5 -4
- package/dist/{cloudflare-operations-ByjFGats.mjs → cloudflare-operations-BmICrRnm.mjs} +1 -1
- package/dist/{cloudflare-operations-BIRQkYwL.mjs → cloudflare-operations-D-9psgPQ.mjs} +19 -11
- package/dist/cloudflare-preview-8eLSQPdO.mjs +1 -0
- package/dist/cloudflare-preview-BaeU-m74.mjs +112 -0
- package/dist/{cloudflare-process-60r4Z2Zf.mjs → cloudflare-process-DFNpqV_m.mjs} +57 -29
- package/dist/cloudflare-user-output-DFbD0l4l.mjs +36 -0
- package/dist/collect-Aam0GwAU.mjs +1 -0
- package/dist/{collect-rNLybAnF.mjs → collect-KC4cizWM.mjs} +6 -1
- package/dist/{config-DA6ZbLXO.d.mts → config-BdmM5ZzP.d.mts} +12 -2
- package/dist/{config-BFX5ZB1J.mjs → config-CUYGZqdN.mjs} +2 -2
- package/dist/{config-BSoW3QCB.mjs → config-C_UjzkVS.mjs} +3 -3
- package/dist/{config-DtjrUtPo.mjs → config-Ge-MytMU.mjs} +1 -1
- package/dist/{config-Dv5jri1-.mjs → config-KZAiI3gG.mjs} +32 -6
- package/dist/config-entry.d.mts +1 -1
- package/dist/config-write-dKLINlm2.mjs +80 -0
- package/dist/{connect-D0V0o40j.mjs → connect-Bqq3b9sX.mjs} +10 -9
- package/dist/{create-project-CbuDH5Hv.mjs → create-project-MXoP_rte.mjs} +1 -1
- package/dist/{create-project-8FdN6D2i.mjs → create-project-T-9AIQDe.mjs} +7 -6
- package/dist/{db-BNPIjLkK.mjs → db-B3eoVDNA.mjs} +50 -47
- package/dist/{db-args-CiQVg8SJ.mjs → db-args-BcvTZ8KE.mjs} +1 -1
- package/dist/db-args-Cx1y4vZn.mjs +1 -0
- package/dist/{db-types-B4Cf9dzR.mjs → db-types-BpgXVtQZ.mjs} +1 -1
- package/dist/{delete-WtLEfap2.mjs → delete-Cf6SroAw.mjs} +7 -6
- package/dist/deploy-DZ9j7MC4.mjs +2 -0
- package/dist/{deploy-BgSbagIP.mjs → deploy-UojYUEWr.mjs} +803 -1415
- package/dist/{deploy-managed-static-BWBsxOww.mjs → deploy-managed-static-DV_OmTWf.mjs} +54 -393
- package/dist/{deploy-security-notice-IRGy6Edf.mjs → deploy-security-notice-3jX71IeP.mjs} +6 -4
- package/dist/deploy-summary-Dkl0zvQy.mjs +377 -0
- package/dist/{deploy-transport-BKP_oV9q.mjs → deploy-transport-4ISWxx8n.mjs} +4 -3
- package/dist/deploy.mjs +14 -10
- package/dist/discover-BZWVWeQs.mjs +1 -0
- package/dist/{discover-IcspacCg.mjs → discover-BeFs7OPS.mjs} +1 -1
- package/dist/{dispatch-DIhDA3NI.mjs → dispatch-BUKbPdqb.mjs} +7 -7
- package/dist/{dist-Cr_xGE_K.mjs → dist-BngS28id.mjs} +6 -6
- package/dist/{dist-C47zy_kJ.mjs → dist-x99fIj4n.mjs} +1 -1
- package/dist/{domain-mweyYXSw.mjs → domain-BK6NWkWK.mjs} +7 -7
- package/dist/{drizzle-BJDMPrj7.mjs → drizzle-CnSbVeiZ.mjs} +12 -13
- package/dist/{drizzle-CQ5jWuDL.mjs → drizzle-CrkwVwK8.mjs} +1 -1
- package/dist/{email-DcQNP40O.mjs → email-BBSDV0J5.mjs} +13 -12
- package/dist/{email-cloudflare-DeYH3Ke7.mjs → email-cloudflare-C-guKEbz.mjs} +10 -8
- package/dist/{env-DaAoYR2-.mjs → env-BVnKiGYJ.mjs} +8 -8
- package/dist/{env-EjHqc7m9.mjs → env-CU2tMDdO.mjs} +6 -1
- package/dist/{env-types-D2hBodXP.mjs → env-types-B33fEHRH.mjs} +1 -1
- package/dist/{env-validation-j9pjCDfA.mjs → env-validation-BnAsx6gz.mjs} +1 -1
- package/dist/{env-validation-D-v5_CWL.mjs → env-validation-SXsjd6-Z.mjs} +4 -4
- package/dist/{fetch-CiEsvjpP.mjs → fetch-DL7OCgwB.mjs} +1 -1
- package/dist/{fetch-stream-BIG5lHW6.mjs → fetch-stream-DEilLTCc.mjs} +2 -2
- package/dist/{gen-aOtHhZLD.mjs → gen-BxuIN1bz.mjs} +10 -9
- package/dist/gen-DaayFP9v.mjs +1 -0
- package/dist/{generate-Dq2Bgw75.mjs → generate-Ck-L3e0e.mjs} +1 -1
- package/dist/{generate-C3ZAqCy-.mjs → generate-t1dDUYZZ.mjs} +1 -1
- package/dist/{github-cmd-BR19Ffdz.mjs → github-cmd-B7U9Hjmi.mjs} +7 -6
- package/dist/{handler-DCrDLzw2.mjs → handler-2wAywJgj.mjs} +11 -9
- package/dist/{headers-DqBsjDxg.mjs → headers-DPI4MDGC.mjs} +1 -1
- package/dist/{help-DvClCzqL.mjs → help-Bgiu5PMX.mjs} +36 -4
- package/dist/help-DWGHmt_n.mjs +1 -0
- package/dist/html-5sfGLjiI.d.mts +3 -0
- package/dist/html-DPSOBDCh.mjs +1 -0
- package/dist/{index-Dn2mkPr2.d.mts → index-CqF8_p9C.d.mts} +5 -105
- package/dist/index-Cvqotnhc.d.mts +91 -0
- package/dist/{index-BQ5qYiAw.d.mts → index-DAinHkj8.d.mts} +1 -1
- package/dist/{index-8cAgNdb6.d.mts → index-lnEWwVAS.d.mts} +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.mjs +536 -170
- package/dist/{info-P6MBiVJi.mjs → info-7COlpAfY.mjs} +32 -20
- package/dist/{init-C8YpkGIP.mjs → init-DftAx3L4.mjs} +237 -88
- package/dist/input-jcps6lAn.mjs +64 -0
- package/dist/interactive-prompts-EK0dilFu.mjs +43 -0
- package/dist/{limits-BCoQLpn3.mjs → limits-3I3VdX2E.mjs} +4 -1
- package/dist/{link-Dyz9IGcM.mjs → link-C3WMNFTG.mjs} +7 -7
- package/dist/{list-VGYBMjmx.mjs → list-K4EGVUZN.mjs} +9 -9
- package/dist/{load-user-env-B8qC0Q2Y.mjs → load-user-env-uMmQJ-Th.mjs} +1 -1
- package/dist/{local-d1-CYOYkVwO.mjs → local-d1-BtLCVC1p.mjs} +2 -2
- package/dist/login-BJwPhV_S.mjs +1 -0
- package/dist/{login-CWFr-G2I.mjs → login-DaugBfBG.mjs} +6 -5
- package/dist/{logs-kS1wuR4b.mjs → logs-BR2szdN5.mjs} +6 -6
- package/dist/migrate-BHD46A31.mjs +1 -0
- package/dist/{migrate-BNZL1hee.mjs → migrate-Dtlg8fC6.mjs} +7 -7
- package/dist/nitro.mjs +3 -3
- package/dist/{node-DVJWfV6s.mjs → node-BbKlLpHa.mjs} +5 -5
- package/dist/{operator-ai-logging-DD0n6zc2.mjs → operator-ai-logging-4Nvs6Ut3.mjs} +5 -5
- package/dist/{operator-args-nvetCWuz.mjs → operator-args-DWvqq3Ws.mjs} +31 -15
- package/dist/{operator-auth-DMvn-y9X.mjs → operator-auth-DtRMGXYY.mjs} +2 -2
- package/dist/{operator-client-dFNnXfyB.mjs → operator-client-BG0VIMMM.mjs} +2 -2
- package/dist/operator-cmd-CR3Q9k4c.mjs +1 -0
- package/dist/{operator-cmd-a7yOf2tH.mjs → operator-cmd-D4YcMKO-.mjs} +9 -9
- package/dist/{operator-security-D5MToU0p.mjs → operator-security-nVLo8vDt.mjs} +11 -5
- package/dist/{output-BZLnu0z8.mjs → output-DhJgS6Ve.mjs} +1 -1
- package/dist/output-OYwcEwok.mjs +1 -0
- package/dist/pages/client.d.mts +34 -20
- package/dist/pages/client.mjs +172 -74
- package/dist/pages/index.d.mts +11 -4
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +2 -2
- package/dist/pages/islands-plugin.mjs +5 -3
- package/dist/pages/protocol.d.mts +3 -3
- package/dist/pages/protocol.mjs +3 -3
- package/dist/pages/serialize.d.mts +2 -2
- package/dist/pages/serialize.mjs +1 -1
- package/dist/parse-filename-DIPUjoCh.d.mts +2 -0
- package/dist/platform-C3Q44RJ8.mjs +250 -0
- package/dist/platform-args-BSyVZESg.mjs +1 -0
- package/dist/{platform-args-CvZSuhYS.mjs → platform-args-BnocJDC_.mjs} +1 -1
- package/dist/{platform-auth-config-CpszX-Ne.mjs → platform-auth-config-BbfNhjBc.mjs} +9 -9
- package/dist/{platform-auth-protection-DA6Tw8Og.mjs → platform-auth-protection-BHPV4MUf.mjs} +9 -8
- package/dist/{platform-auth-recovery-Cztrb1JC.mjs → platform-auth-recovery-DE0nArYy.mjs} +8 -7
- package/dist/{platform-cmd-m6Asj6nO.mjs → platform-cmd-CLRU3BRb.mjs} +11 -10
- package/dist/{platform-cmd-u1j88ggF.mjs → platform-cmd-Cs2LkT5L.mjs} +1 -1
- package/dist/{platform-discovery-CLxtixHJ.mjs → platform-discovery-CKeeeD82.mjs} +1 -1
- package/dist/{platform-domain-DJSznNTA.mjs → platform-domain-kn3WuKPG.mjs} +6 -5
- package/dist/{platform-lifecycle-BC-9p58d.mjs → platform-lifecycle-BoCEYy2w.mjs} +1 -1
- package/dist/{platform-lifecycle-GFeXv3NC.mjs → platform-lifecycle-CKwOg8wz.mjs} +244 -104
- package/dist/{platform-management-BwHkz46V.mjs → platform-management-CaSdFthX.mjs} +1 -1
- package/dist/{platform-management-DX1zINou.mjs → platform-management-fyrsq2Ra.mjs} +27 -14
- package/dist/{platform-plans-config-DiydtNKY.mjs → platform-plans-config-BSI-6Inu.mjs} +11 -5
- package/dist/{platform-recovery-CnzBbudV.mjs → platform-recovery-PwJ54AIZ.mjs} +3 -3
- package/dist/{platform-registry-DHH6fivm.mjs → platform-registry-zHH3RiIm.mjs} +2 -1
- package/dist/{platform-setup-Lph9i-rh.mjs → platform-setup-DwYITHfY.mjs} +3 -3
- package/dist/{plugin-inference-COlq96WJ.mjs → plugin-inference-D5MjBVMB.mjs} +60 -142
- package/dist/prepare-CLl_TA_r.mjs +1 -0
- package/dist/{prepare-WvijE289.mjs → prepare-DZEs5AGr.mjs} +3 -3
- package/dist/{prepare-co1o1FFd.mjs → prepare-DhVzN7CB.mjs} +14 -12
- package/dist/{project-uXKua1it.mjs → project-BXpm-vgG.mjs} +1 -1
- package/dist/{project-dh9431bN.mjs → project-DC-BqHef.mjs} +1 -1
- package/dist/{project-cmd-BWJTplpc.mjs → project-cmd-BKN3qT4R.mjs} +31 -21
- package/dist/{project-paths-2ENfCCih.mjs → project-paths-BeAxxqGh.mjs} +1 -1
- package/dist/{project-security-BV1xfj1K.mjs → project-security-B-SHxprt.mjs} +1 -1
- package/dist/{project-security-CY_aahvW.mjs → project-security-BWTd6cTU.mjs} +87 -46
- package/dist/{project-team-BlIFXlmT.mjs → project-team-jcn9reIB.mjs} +6 -6
- package/dist/{project-token-CMsB7I1-.mjs → project-token-BHkBKtzt.mjs} +6 -6
- package/dist/{project-tsconfig-BOA4ym99.mjs → project-tsconfig-LjgxDdj_.mjs} +1 -1
- package/dist/{project-zero-trust-BI6pdpx4.mjs → project-zero-trust-2t_qI6xa.mjs} +4 -4
- package/dist/{protocol-4rEnumif.mjs → protocol-DhMbnxzy.mjs} +120 -35
- package/dist/{protocol-ERy-n3jf.d.mts → protocol-wG7JP5Mm.d.mts} +27 -4
- package/dist/{provision-DFv7SJDn.mjs → provision-C04aXE3a.mjs} +1 -1
- package/dist/{provision-Bh44omGA.mjs → provision-CQykn8gu.mjs} +8 -4
- package/dist/{redirect-Dyvuil0Q.mjs → redirect-DjyA_hx_.mjs} +1 -1
- package/dist/{requests-CfmJxNYg.mjs → requests-BznxnxTT.mjs} +5 -5
- package/dist/resolve-project-Bob_rEi2.mjs +1 -0
- package/dist/{resolve-project-8WZ3iVmr.mjs → resolve-project-s_FGWyr-.mjs} +2 -2
- package/dist/resource-binding-5nI30acw.mjs +20 -0
- package/dist/{resource-name-DlJ9QXzg.mjs → resource-name-D_gw36kh.mjs} +5 -1
- package/dist/{rollback-DL5HuAsM.mjs → rollback-CLiINtpt.mjs} +25 -14
- package/dist/{route-types-CSed9-Dp.mjs → route-types-DxvqN5bL.mjs} +59 -9
- package/dist/{route-url-B41eQ8QI.mjs → route-url-CRC8yR_2.mjs} +2 -3
- package/dist/{route-url-Bd6IX-JZ.d.mts → route-url-zDfC-7DD.d.mts} +33 -5
- package/dist/routes-stub.d.mts +18 -2
- package/dist/routes-stub.mjs +1 -1
- package/dist/{runner-CeguHWJx.mjs → runner-CnUrhc8H.mjs} +1 -1
- package/dist/{runner-mysql-DOjbj-N1.mjs → runner-mysql-CW6bFa67.mjs} +1 -1
- package/dist/{runner-mysql-D549vGGm.mjs → runner-mysql-DSLGFOlC.mjs} +1 -1
- package/dist/{runner-pg-Buzw17hl.mjs → runner-pg-BcGF7iBR.mjs} +1 -1
- package/dist/{runner-pg-DMJquR3d.mjs → runner-pg-OeP0JpEo.mjs} +1 -1
- package/dist/{runner-Bf94YVJK.mjs → runner-rnXCGa20.mjs} +1 -1
- package/dist/runtime/ai/index.mjs +1 -1
- package/dist/runtime/auth/better-auth-d1.d.mts +1 -1
- package/dist/runtime/auth/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/auth/better-auth-postgres.d.mts +1 -1
- package/dist/runtime/client/fetch-server.mjs +1 -1
- package/dist/runtime/client/fetch-stream.mjs +1 -1
- package/dist/runtime/client/fetch.mjs +1 -1
- package/dist/runtime/client/index.mjs +2 -2
- package/dist/runtime/client/react.mjs +2 -2
- package/dist/runtime/client/solid.mjs +2 -2
- package/dist/runtime/client/svelte.mjs +2 -2
- package/dist/runtime/client/vue.mjs +2 -2
- package/dist/runtime/durable/index.mjs +11 -26
- package/dist/runtime/env/runtime.d.mts +2 -10
- package/dist/runtime/handler/index.d.mts +3 -2
- package/dist/runtime/handler/index.mjs +2 -2
- package/dist/runtime/handler/validator.d.mts +1 -1
- package/dist/runtime/handler/validator.mjs +1 -1
- package/dist/runtime/html.d.mts +2 -0
- package/dist/runtime/html.mjs +1 -0
- package/dist/runtime/image/index.d.mts +103 -0
- package/dist/runtime/image/index.mjs +89 -0
- package/dist/runtime/jsx/index.d.mts +3 -0
- package/dist/runtime/jsx/index.mjs +2 -0
- package/dist/runtime/jsx/jsx-dev-runtime.d.mts +1 -0
- package/dist/runtime/jsx/jsx-dev-runtime.mjs +2 -0
- package/dist/runtime/jsx/jsx-runtime.d.mts +1 -0
- package/dist/runtime/jsx/jsx-runtime.mjs +2 -0
- package/dist/runtime/limits/index.mjs +1 -1
- package/dist/runtime/live/client.d.mts +2 -2
- package/dist/runtime/live/index.d.mts +1 -1
- package/dist/runtime/routing/index.d.mts +87 -4
- package/dist/runtime/routing/index.mjs +59 -20
- package/dist/runtime/routing/route-url.d.mts +2 -2
- package/dist/runtime/routing/route-url.mjs +1 -1
- package/dist/runtime/sandbox/index.mjs +1 -1
- package/dist/runtime/sse/client.d.mts +1 -1
- package/dist/runtime/workflows/entry.d.mts +8 -0
- package/dist/runtime/workflows/entry.mjs +49 -0
- package/dist/runtime/workflows/index.d.mts +3 -0
- package/dist/runtime/workflows/index.mjs +77 -0
- package/dist/runtime/ws/index.d.mts +1 -1
- package/dist/runtime/ws/index.mjs +2 -2
- package/dist/runtime/ws/room.d.mts +1 -1
- package/dist/runtime/ws/server.d.mts +2 -2
- package/dist/runtime-Db72hLY-.d.mts +11 -0
- package/dist/scan-BxhB4BA-.mjs +946 -0
- package/dist/scan-D2ISAobj.mjs +308 -0
- package/dist/{secret-C-WBaUSS.mjs → secret-Ck9N5xbU.mjs} +9 -8
- package/dist/{security-sarif-ClyYwtAW.mjs → security-sarif-DzTIqNwZ.mjs} +1 -1
- package/dist/{serialize-DN-envGQ.d.mts → serialize-Dr9B-0yV.d.mts} +10 -1
- package/dist/{serialize-BmB4BfKu.mjs → serialize-nW4IeEBI.mjs} +23 -2
- package/dist/{skills-C-csz78e.mjs → skills-BR7YHAF7.mjs} +1 -1
- package/dist/{scan-Ct_SEzH4.mjs → source-analysis-cache-Ccm_JSOl.mjs} +340 -902
- package/dist/standard-schema-DvMcZGMK.mjs +8 -0
- package/dist/{subcommand-prompt-B4LOLosl.mjs → subcommand-prompt-AFf2LcrC.mjs} +2 -2
- package/dist/{types-FDH6NuY1.d.mts → types-RYVujNS6.d.mts} +4 -2
- package/dist/{version-metadata-DqgLa6gc.mjs → untrusted-env-4oW0TdBP.mjs} +1 -23
- package/dist/{url-DBQluotE.mjs → url-DAQ1c3lh.mjs} +45 -1
- package/dist/{validate-CtBWCzez.mjs → validate-B1PsQ_mt.mjs} +1 -1
- package/dist/validate-p9b3r1k4.mjs +1 -0
- package/dist/{validation-error-CtcAvyI7.mjs → validation-error-EKI0wMWX.mjs} +2 -2
- package/dist/{validator-Dfh9kCDm.mjs → validator-JJcf9E48.mjs} +5 -8
- package/dist/version-metadata-CEla0kgi.mjs +23 -0
- package/dist/{wrangler-DVe5KV5G.mjs → wrangler-AyMfdVJK.mjs} +34 -69
- package/dist/wrangler-BT7qrzWc.mjs +1 -0
- package/dist/{wrapper-CcMYpOS8.mjs → wrapper-DPlTBVOx.mjs} +5 -5
- package/docs/guide/ai.md +1 -1
- package/docs/guide/app-types.md +6 -23
- package/docs/guide/auth.md +2 -4
- package/docs/guide/database/d1.md +21 -67
- package/docs/guide/database/mysql.md +8 -0
- package/docs/guide/database/postgresql.md +2 -2
- package/docs/guide/database.md +1 -1
- package/docs/guide/deployment.md +18 -0
- package/docs/guide/edge/prerendering.md +3 -7
- package/docs/guide/edge/redirects.md +1 -1
- package/docs/guide/edge/revalidation.md +8 -17
- package/docs/guide/edge/rewrites.md +1 -1
- package/docs/guide/edge/static-assets.md +10 -22
- package/docs/guide/email/domains.md +3 -1
- package/docs/guide/email/receiving.md +2 -2
- package/docs/guide/email/sending.md +3 -1
- package/docs/guide/env-vars.md +2 -0
- package/docs/guide/image-generation.md +142 -0
- package/docs/guide/index.md +17 -15
- package/docs/guide/jobs.md +2 -4
- package/docs/guide/kv.md +1 -1
- package/docs/guide/og-images.md +83 -0
- package/docs/guide/pages-routing/actions-and-forms.md +6 -4
- package/docs/guide/pages-routing/errors.md +20 -4
- package/docs/guide/pages-routing/head.md +5 -5
- package/docs/guide/pages-routing/islands.md +4 -14
- package/docs/guide/pages-routing/markdown.md +2 -2
- package/docs/guide/pages-routing/overview.md +129 -15
- package/docs/guide/platform/administration/plans.md +47 -16
- package/docs/guide/platform/administration/projects.md +10 -0
- package/docs/guide/platform/administration/security-audits.md +76 -30
- package/docs/guide/platform/administration/zero-trust.md +1 -1
- package/docs/guide/platform/installation/ci.md +0 -4
- package/docs/guide/platform/installation/credentials.md +1 -1
- package/docs/guide/platform/installation/maintenance.md +11 -9
- package/docs/guide/platform/installation/prerequisites.md +3 -1
- package/docs/guide/platform/installation/setup.md +7 -15
- package/docs/guide/platform/installation/uninstall.md +6 -12
- package/docs/guide/project-collaboration.md +1 -4
- package/docs/guide/queues.md +6 -8
- package/docs/guide/quickstart.md +6 -8
- package/docs/guide/sandboxes.md +1 -1
- package/docs/guide/self-hosted-platform.md +4 -7
- package/docs/guide/server-routing.md +5 -3
- package/docs/guide/ssg.md +1 -1
- package/docs/guide/type-safety.md +74 -10
- package/docs/guide/websockets.md +5 -7
- package/docs/guide/workflows.md +122 -0
- package/docs/index.md +2 -3
- package/docs/integrations/agents.md +3 -16
- package/docs/integrations/cloudflare.md +98 -2
- package/docs/integrations/frameworks/analog.md +9 -11
- package/docs/integrations/frameworks/astro.md +16 -17
- package/docs/integrations/frameworks/nuxt.md +11 -13
- package/docs/integrations/frameworks/overview.md +18 -20
- package/docs/integrations/frameworks/react-router.md +55 -6
- package/docs/integrations/frameworks/sveltekit.md +8 -6
- package/docs/integrations/frameworks/tanstack-start.md +10 -6
- package/docs/integrations/hono.md +27 -12
- package/docs/integrations/nodejs-bun-deno.md +10 -2
- package/docs/reference/api/database.md +8 -10
- package/docs/reference/api/env.md +2 -2
- package/docs/reference/api/handlers.md +1 -1
- package/docs/reference/api/html.md +45 -0
- package/docs/reference/api/pages.md +118 -167
- package/docs/reference/api/rewrites.md +5 -5
- package/docs/reference/api/types.md +13 -6
- package/docs/reference/api/workflows.md +48 -0
- package/docs/reference/api.md +7 -1
- package/docs/reference/cli/database.md +22 -10
- package/docs/reference/cli/deploy.md +49 -4
- package/docs/reference/cli/domains.md +7 -3
- package/docs/reference/cli/email.md +3 -1
- package/docs/reference/cli/platform-installation.md +9 -53
- package/docs/reference/cli/platform-security.md +36 -8
- package/docs/reference/cli/platform-users.md +11 -1
- package/docs/reference/cli/platform-zero-trust.md +1 -1
- package/docs/reference/cli/project.md +52 -11
- package/docs/reference/cli/setup.md +8 -10
- package/docs/reference/cli.md +49 -47
- package/docs/reference/config.md +22 -8
- package/docs/reference/resource-inference.md +8 -1
- package/docs/reference/structure.md +5 -0
- package/package.json +52 -25
- package/schema.json +20 -1
- package/skills/void/SKILL.md +60 -54
- package/dist/cf-build-output-Wpk_e5CI.mjs +0 -1
- package/dist/cf-worker-settings-BBdlhm9U.mjs +0 -41
- package/dist/cli/db-execute-process.d.mts +0 -2
- package/dist/cli/db-execute-process.mjs +0 -57
- package/dist/cloudflare-user-output-CCR99eQY.mjs +0 -19
- package/dist/collect-B6nlSnsb.mjs +0 -1
- package/dist/db-args-BvMwAber.mjs +0 -1
- package/dist/deploy-Do6FWqon.mjs +0 -2
- package/dist/discover-D2KGP3cR.mjs +0 -1
- package/dist/entry-Bwb9ev8K.mjs +0 -113
- package/dist/gen-vhBDHs3q.mjs +0 -1
- package/dist/help-fKPzcTJv.mjs +0 -1
- package/dist/isr-config-DiTnL9Tb.mjs +0 -115
- package/dist/login-DECm3e9b.mjs +0 -1
- package/dist/migrate-C9aoWLvY.mjs +0 -1
- package/dist/operator-cmd-CVfK5U0B.mjs +0 -1
- package/dist/output-D7K9TWIA.mjs +0 -1
- package/dist/platform-args-CMwMoiLp.mjs +0 -1
- package/dist/prepare-DcwigRUS.mjs +0 -1
- package/dist/providers-D5P8j_8D.d.mts +0 -5
- package/dist/resolve-project-YsTH-U9I.mjs +0 -1
- package/dist/static-exports-s7P86Ngp.mjs +0 -354
- package/dist/validate-CZYUIfR-.mjs +0 -1
- package/dist/wrangler-Dq269bjx.mjs +0 -1
- package/docs/guide/platform/development/local.md +0 -120
- package/docs/guide/platform/development/runtime.md +0 -115
- package/docs/guide/platform/development/schema-ci.md +0 -44
- package/docs/guide/platform-development.md +0 -16
package/dist/index.mjs
CHANGED
|
@@ -1,49 +1,50 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-uD8oG6U2.mjs";
|
|
2
2
|
import { a as join, c as resolve, i as isAbsolute, l as toSlash, n as dirname, s as relative, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
3
3
|
import { t as require_picocolors } from "./picocolors-D1NxSLw-.mjs";
|
|
4
|
-
import { a as assertSandboxNamespaceConfig, c as resolveSandboxConfig, d as hasEmailHandlers, g as scanJobsSync, i as SANDBOX_MIGRATION_TAG, l as sandboxContainerConfig, n as getNativeWorkerSourceFiles, o as hasSandboxSqliteMigration, p as scanQueuesSync, r as DEFAULT_SANDBOX_CLASS_NAME, t as analyzeApplicationSync } from "./application-analysis-
|
|
5
|
-
import {
|
|
6
|
-
import { a as isAssetBypassRule, d as hasDocumentRoutes, l as edgeRulesNeedWorker, n as mergeRoutingRules, o as isGeneratedAssetHeaders, p as resolveAssetRoutingPolicy, s as resolveAssetWorkerBypass, t as lintRoutingPhases, u as hasApiRoutes } from "./headers-
|
|
7
|
-
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-
|
|
8
|
-
import {
|
|
9
|
-
import { c as stashCloudflareDeployPointer, i as materializeCloudflareConfig, l as ensureGitignoreLines, o as restoreCloudflarePreviewPointer } from "./cloudflare-config-
|
|
10
|
-
import { a as syncAuthTypesFile, i as removeAuthTypesIfPresent, n as generateQueueTypes, s as syncBindingTypes, t as generateRouteTypes } from "./route-types-
|
|
11
|
-
import { c as
|
|
12
|
-
import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-
|
|
4
|
+
import { a as assertSandboxNamespaceConfig, c as resolveSandboxConfig, d as hasEmailHandlers, g as scanJobsSync, i as SANDBOX_MIGRATION_TAG, l as sandboxContainerConfig, n as getNativeWorkerSourceFiles, o as hasSandboxSqliteMigration, p as scanQueuesSync, r as DEFAULT_SANDBOX_CLASS_NAME, t as analyzeApplicationSync } from "./application-analysis-BjEwHTV2.mjs";
|
|
5
|
+
import { f as applyBindingOverrides, l as inferBindingsFromSource, n as FRAMEWORK_SCAN_DIRS, t as DEFAULT_SCAN_DIRS } from "./plugin-inference-D5MjBVMB.mjs";
|
|
6
|
+
import { a as isAssetBypassRule, d as hasDocumentRoutes, l as edgeRulesNeedWorker, n as mergeRoutingRules, o as isGeneratedAssetHeaders, p as resolveAssetRoutingPolicy, s as resolveAssetWorkerBypass, t as lintRoutingPhases, u as hasApiRoutes } from "./headers-DPI4MDGC.mjs";
|
|
7
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DC-BqHef.mjs";
|
|
8
|
+
import { D as syncWranglerBindings, N as DEFAULT_WORKER_COMPAT_DATE, O as syncWranglerDurableObjects, P as assertBrowserCompatibility, T as resolveLiveBindingConfig, _ as readExistingLiveBindingConfig, b as readWranglerCompat, d as ensureWranglerNodejsAlsFlag, f as findBindingNameOwner, h as normalizeWranglerCompatibilityFlags, i as LIVE_MIGRATION_TAG, k as syncWranglerWebSockets, l as ensureWranglerCompat, m as nextDurableObjectMigrationTag, p as hasDurableObjectSqliteMigration, u as ensureWranglerCompatibilityDate, w as readWranglerWebSocketTombstones, y as readRootWranglerConfig } from "./wrangler-AyMfdVJK.mjs";
|
|
9
|
+
import { c as stashCloudflareDeployPointer, i as materializeCloudflareConfig, l as ensureGitignoreLines, o as restoreCloudflarePreviewPointer } from "./cloudflare-config-KPHKf57C.mjs";
|
|
10
|
+
import { a as syncAuthTypesFile, i as removeAuthTypesIfPresent, n as generateQueueTypes, s as syncBindingTypes, t as generateRouteTypes } from "./route-types-DxvqN5bL.mjs";
|
|
11
|
+
import { c as getDatabaseAuthDateType, d as isNodeTarget, h as readConfig, l as getDatabaseCasing, m as precompressesAssets, u as getDatabaseDialect } from "./config-KZAiI3gG.mjs";
|
|
12
|
+
import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-BtLCVC1p.mjs";
|
|
13
13
|
import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-D9hwSySP.mjs";
|
|
14
14
|
import { t as Buffer } from "./node-buffer-D7kgjaDs.mjs";
|
|
15
15
|
import { t as staticModuleReferences } from "./module-references-DWQmO6TW.mjs";
|
|
16
|
-
import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-
|
|
17
|
-
import { n as ensurePlatformProxyAccess } from "./cf-access-
|
|
16
|
+
import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-CeBmolb-.mjs";
|
|
17
|
+
import { n as ensurePlatformProxyAccess } from "./cf-access-B21j-nd6.mjs";
|
|
18
18
|
import { n as scopedAccessCredentials } from "./cf-access-DmkKPcAI.mjs";
|
|
19
19
|
import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-CoDaaFsA.mjs";
|
|
20
|
-
import { t as migrateBuiltWranglerConfig } from "./cf-config-migrate-
|
|
20
|
+
import { t as migrateBuiltWranglerConfig } from "./cf-config-migrate-CsbQGzMf.mjs";
|
|
21
21
|
import { t as writeFileAtomic } from "./atomic-write-DA6eD1Kp.mjs";
|
|
22
|
-
import { a as
|
|
23
|
-
import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-
|
|
24
|
-
import { a as readDeployBuildQueueNames, r as cloudflareQueueName, s as drizzlePlugin, t as generateQueueResolverSource } from "./dispatch-
|
|
22
|
+
import { a as findLegacyEnvFiles, c as legacyEnvExampleHint, d as resolveRemoteMode, i as LOCAL_ENV_FILE, l as loadLocalEnv, o as findReservedEnvKeys, s as isClientEnvKey, u as reservedEnvKeysMessage } from "./env-CU2tMDdO.mjs";
|
|
23
|
+
import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-BeAxxqGh.mjs";
|
|
24
|
+
import { a as readDeployBuildQueueNames, r as cloudflareQueueName, s as drizzlePlugin, t as generateQueueResolverSource } from "./dispatch-BUKbPdqb.mjs";
|
|
25
25
|
import { _ as parseCapturedMessage, a as DEV_INBOX_ENV_VAR, c as DEV_INBOX_TOKEN_ENV_VAR, f as clearDevBuffer, g as listDevMessages, l as DEV_INBOX_TOKEN_HEADER, m as findDevMessage, n as DEV_INBOX_ACK_VALUE, o as DEV_INBOX_MAX_CAPTURE_BYTES, s as DEV_INBOX_PREFIX, t as DEV_INBOX_ACK_HEADER, u as DEV_INBOX_TOKEN_QUERY, v as pushToDevBuffer } from "./dev-inbox-ClVjKEHy.mjs";
|
|
26
26
|
import { t as MagicString } from "./dist-B6eN80gc.mjs";
|
|
27
|
-
import {
|
|
27
|
+
import { d as convertPathToPattern, l as bindingResolver, n as invalidateSourceAnalysis } from "./source-analysis-cache-Ccm_JSOl.mjs";
|
|
28
28
|
import { a as isMemberExpression, i as isLiteral, r as isIdentifier, t as asAstProgram } from "./ast-BkPQu7A0.mjs";
|
|
29
|
-
import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-
|
|
30
|
-
import { a as syncAuthTypesInProjectTsconfig, o as writeFileIfChanged } from "./project-tsconfig-
|
|
31
|
-
import { t as loadUserEnvFile } from "./load-user-env-
|
|
29
|
+
import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-B33fEHRH.mjs";
|
|
30
|
+
import { a as syncAuthTypesInProjectTsconfig, o as writeFileIfChanged } from "./project-tsconfig-LjgxDdj_.mjs";
|
|
31
|
+
import { t as loadUserEnvFile } from "./load-user-env-uMmQJ-Th.mjs";
|
|
32
32
|
import { n as scanWranglerDotenvKeys } from "./dotenv-BG6RQavH.mjs";
|
|
33
|
-
import {
|
|
33
|
+
import { a as createBoundaryManifest, c as resolveLayoutIds, h as isRouteEnabledForEnvironment, i as patternToRegex } from "./scan-BxhB4BA-.mjs";
|
|
34
34
|
import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./raw-5rak34QN.mjs";
|
|
35
35
|
import { i as isClientManifest, t as ASSET_EXTENSIONS } from "./assets-Br6_BeFJ.mjs";
|
|
36
|
+
import { i as readPackageJson } from "./package-json-4xUI3xLz.mjs";
|
|
36
37
|
import { r as findVoidDependentPackages, t as findDependencyClosure } from "./installed-packages-tfmYd-cC.mjs";
|
|
37
|
-
import { i as loadVoidAuthConfig, n as devAuthConfigImporter, o as viteAuthConfigImporter, t as AUTH_CONFIG_ENVIRONMENT } from "./config-
|
|
38
|
-
import { a as resolveDistDir,
|
|
38
|
+
import { i as loadVoidAuthConfig, n as devAuthConfigImporter, o as viteAuthConfigImporter, t as AUTH_CONFIG_ENVIRONMENT } from "./config-CUYGZqdN.mjs";
|
|
39
|
+
import { a as collectRevalidate, c as resolveDistDir, d as precompressAssets, i as collectPages, l as resolveWorkerDirName, o as hasRevalidate, r as planWorkflows, t as FRAMEWORK_WORKFLOWS_ERROR, u as PRECOMPRESSED_ASSET_DIR } from "./platform-C3Q44RJ8.mjs";
|
|
39
40
|
import { t as assertNoPrerenderFailures } from "./prerender-render-BAdYhivW.mjs";
|
|
40
|
-
import { h as prerenderPagesNode, m as prerenderPages, n as SEND_EMAIL_BINDING } from "./email-cloudflare-
|
|
41
|
-
import {
|
|
42
|
-
import { n as completeApplicationAnalysis } from "./application-routing-
|
|
43
|
-
import { a as
|
|
44
|
-
import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-
|
|
45
|
-
import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "./handler-
|
|
46
|
-
import { r as defer } from "./validation-error-
|
|
41
|
+
import { h as prerenderPagesNode, m as prerenderPages, n as SEND_EMAIL_BINDING } from "./email-cloudflare-C-guKEbz.mjs";
|
|
42
|
+
import { o as safeJsonStringify } from "./protocol-DhMbnxzy.mjs";
|
|
43
|
+
import { n as completeApplicationAnalysis } from "./application-routing-COCfD2yc.mjs";
|
|
44
|
+
import { a as SSR_SERVER_ENTRY_RELATIVE_PATHS, c as validateSsrEntry, i as SSR_CLIENT_ENTRY_RELATIVE_PATHS, o as getSsrServerEntryPath, r as scanWorkflowModules, s as validateSsrEntries } from "./scan-D2ISAobj.mjs";
|
|
45
|
+
import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-CEla0kgi.mjs";
|
|
46
|
+
import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "./handler-2wAywJgj.mjs";
|
|
47
|
+
import { r as defer } from "./validation-error-EKI0wMWX.mjs";
|
|
47
48
|
import { builtinModules, createRequire } from "node:module";
|
|
48
49
|
import { chmodSync, closeSync, cpSync, existsSync, mkdirSync, mkdtempSync, openSync, readFileSync, readdirSync, realpathSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
49
50
|
import { createRunnableDevEnvironment, defaultServerConditions, isFileServingAllowed, isRunnableDevEnvironment, loadEnv, normalizePath, parseSync, resolveEnvPrefix } from "vite";
|
|
@@ -53,7 +54,7 @@ import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
|
53
54
|
import { homedir } from "node:os";
|
|
54
55
|
import { isDeepStrictEqual, parseEnv } from "node:util";
|
|
55
56
|
import { getRootConfigPath, getWorkerAssetsDir, getWorkerConfigPath, readBuildOutput } from "@cloudflare/build-output-utils";
|
|
56
|
-
import { convertToWranglerConfig } from "@cloudflare/config";
|
|
57
|
+
import { bindings, convertToWranglerConfig } from "@cloudflare/config";
|
|
57
58
|
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
58
59
|
import { parse } from "smol-toml";
|
|
59
60
|
import { readFile, stat } from "node:fs/promises";
|
|
@@ -509,11 +510,11 @@ function readVoidDevCredentials(root) {
|
|
|
509
510
|
* block the server. On completion, writes project.json and restarts the server.
|
|
510
511
|
*/
|
|
511
512
|
async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
512
|
-
const { select, text, isCancel, log } = await import("./dist-
|
|
513
|
-
const { PlatformClient } = await import("./client-
|
|
514
|
-
const { attachSelectedPlatform, writeProjectConfig } = await import("./project-
|
|
515
|
-
const { inferDefaultSlug } = await import("./resolve-project-
|
|
516
|
-
const { printSuccess } = await import("./output-
|
|
513
|
+
const { select, text, isCancel, log } = await import("./dist-x99fIj4n.mjs");
|
|
514
|
+
const { PlatformClient } = await import("./client-0um7Lzze.mjs");
|
|
515
|
+
const { attachSelectedPlatform, writeProjectConfig } = await import("./project-BXpm-vgG.mjs");
|
|
516
|
+
const { inferDefaultSlug } = await import("./resolve-project-Bob_rEi2.mjs");
|
|
517
|
+
const { printSuccess } = await import("./output-OYwcEwok.mjs");
|
|
517
518
|
const client = new PlatformClient(token, { apiUrl });
|
|
518
519
|
let projects;
|
|
519
520
|
try {
|
|
@@ -540,7 +541,7 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
|
540
541
|
let slug;
|
|
541
542
|
if (result === "__create__") {
|
|
542
543
|
const { validateProjectSlug } = await import("./project-slug-BUy0lmyR.mjs");
|
|
543
|
-
const { createProjectWithSlugRetry } = await import("./create-project-
|
|
544
|
+
const { createProjectWithSlugRetry } = await import("./create-project-MXoP_rte.mjs");
|
|
544
545
|
let created;
|
|
545
546
|
try {
|
|
546
547
|
created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
|
|
@@ -676,7 +677,8 @@ function createClientStubsPlugin() {
|
|
|
676
677
|
export const createInboundTestHarness = serverOnly('createInboundTestHarness');
|
|
677
678
|
`,
|
|
678
679
|
"void/live": "",
|
|
679
|
-
"void/durable": ""
|
|
680
|
+
"void/durable": "",
|
|
681
|
+
"void/workflows": ""
|
|
680
682
|
}));
|
|
681
683
|
const STUB_RESOLVE_FILTER = new RegExp(`^(${Array.from(stubSources.keys()).join("|").replaceAll("/", String.raw`\/`)})$`);
|
|
682
684
|
const STUB_LOAD_FILTER = new RegExp(`^\\0void-client-stub:`);
|
|
@@ -687,7 +689,7 @@ function createClientStubsPlugin() {
|
|
|
687
689
|
filter: { id: STUB_RESOLVE_FILTER },
|
|
688
690
|
handler(id) {
|
|
689
691
|
if (this.environment?.name === "client") {
|
|
690
|
-
if (id === "void/live" || id === "void/durable") this.error(id === "void/live" ? "void/live is server-only and cannot be imported by browser code. Import void/live/client instead." :
|
|
692
|
+
if (id === "void/live" || id === "void/durable" || id === "void/workflows") this.error(id === "void/live" ? "void/live is server-only and cannot be imported by browser code. Import void/live/client instead." : `${id} is server-only and cannot be imported by browser code.`);
|
|
691
693
|
return STUB_PREFIX + id;
|
|
692
694
|
}
|
|
693
695
|
}
|
|
@@ -701,6 +703,30 @@ function createClientStubsPlugin() {
|
|
|
701
703
|
};
|
|
702
704
|
}
|
|
703
705
|
// src/plugin-cloudflare-config.ts
|
|
706
|
+
function addLocalQueueProducers(worker, read, warn = voidWarn) {
|
|
707
|
+
if (!read || process.env.CLOUDFLARE_VITE_BUILD === "true") return;
|
|
708
|
+
const { queues, reserved } = read();
|
|
709
|
+
if (queues.length === 0) return;
|
|
710
|
+
const taken = new Set(reserved);
|
|
711
|
+
const byBinding = /* @__PURE__ */ new Map();
|
|
712
|
+
for (const queue of queues) {
|
|
713
|
+
const group = byBinding.get(queue.bindingName) ?? [];
|
|
714
|
+
group.push(queue);
|
|
715
|
+
byBinding.set(queue.bindingName, group);
|
|
716
|
+
}
|
|
717
|
+
let added;
|
|
718
|
+
for (const [binding, group] of byBinding) {
|
|
719
|
+
if (group.length > 1) {
|
|
720
|
+
warn(`Queue files ${group.map(({ filePath }) => filePath).join(", ")} share binding ${binding}. Void skips inference for this binding. Rename the conflicting files so each queue has a distinct binding.`);
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if (!taken.has(binding) && !Object.hasOwn(worker.env ?? {}, binding)) {
|
|
724
|
+
(worker.env ??= {})[binding] = bindings.queue({ name: group[0].name });
|
|
725
|
+
(added ??= []).push(binding);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return added;
|
|
729
|
+
}
|
|
704
730
|
/** Match the old plugin's patch semantics, including its array concatenation. */
|
|
705
731
|
function mergeCloudflareConfig(patch, fallback) {
|
|
706
732
|
const result = { ...fallback };
|
|
@@ -711,18 +737,22 @@ function mergeCloudflareConfig(patch, fallback) {
|
|
|
711
737
|
}
|
|
712
738
|
return result;
|
|
713
739
|
}
|
|
714
|
-
/**
|
|
715
|
-
function
|
|
740
|
+
/** The Worker name a Void app gets when its config does not set one: its package or directory name. */
|
|
741
|
+
function defaultCloudflareWorkerName(root) {
|
|
716
742
|
const packagePath = join(root, "package.json");
|
|
717
743
|
const packageName = existsSync(packagePath) ? JSON.parse(readFileSync(packagePath, "utf8")).name : void 0;
|
|
718
|
-
|
|
744
|
+
return String(packageName ?? basename(root)).replaceAll("_", "-").replaceAll(/[^a-z0-9- ]/g, "-").replaceAll(/^(-+)|(-+)$/g, "").slice(0, 63) || "my-worker";
|
|
745
|
+
}
|
|
746
|
+
/** Translate Void's Wrangler-shaped settings to the configuration that the Cloudflare plugin takes. */
|
|
747
|
+
function toNativeCloudflareConfig(raw, root) {
|
|
748
|
+
const name = defaultCloudflareWorkerName(root);
|
|
719
749
|
const { env, vars, ...base } = raw;
|
|
720
750
|
const selected = process.env.CLOUDFLARE_ENV ? env?.[process.env.CLOUDFLARE_ENV] : void 0;
|
|
721
751
|
const values = selected ? selected.vars : vars;
|
|
722
752
|
const environments = env && Object.fromEntries(Object.entries(env).map(([name, { vars: _vars, ...config }]) => [`void-environment-${name}`, config]));
|
|
723
753
|
const config = migrateBuiltWranglerConfig({
|
|
724
754
|
name,
|
|
725
|
-
compatibility_date:
|
|
755
|
+
compatibility_date: DEFAULT_WORKER_COMPAT_DATE,
|
|
726
756
|
...base,
|
|
727
757
|
...environments && process.env.CLOUDFLARE_ENV ? { env: environments } : {}
|
|
728
758
|
}, process.env.CLOUDFLARE_ENV ? `void-environment-${process.env.CLOUDFLARE_ENV}` : "void-top-level");
|
|
@@ -765,14 +795,24 @@ function restoreLocalContainerBindings(worker) {
|
|
|
765
795
|
};
|
|
766
796
|
}
|
|
767
797
|
}
|
|
768
|
-
function nativeAuxiliaryWorkers(workers, root) {
|
|
798
|
+
function nativeAuxiliaryWorkers(workers, root, readLocalQueueBindings) {
|
|
769
799
|
return workers?.map(({ configPath, config, ...options }) => ({
|
|
770
800
|
...options,
|
|
771
801
|
config({ entryWorkerConfig }) {
|
|
772
802
|
const path = configPath ? resolve(root, configPath) : void 0;
|
|
773
803
|
const base = path ? path.endsWith(".toml") ? parse(readFileSync(path, "utf8")) : readGeneratedWranglerConfigFile(path) : {};
|
|
804
|
+
let worker = entryWorkerConfig;
|
|
805
|
+
const localBindings = readLocalQueueBindings?.();
|
|
806
|
+
if (localBindings && typeof config === "function") {
|
|
807
|
+
const env = { ...entryWorkerConfig.env };
|
|
808
|
+
for (const name of localBindings) delete env[name];
|
|
809
|
+
worker = {
|
|
810
|
+
...entryWorkerConfig,
|
|
811
|
+
env
|
|
812
|
+
};
|
|
813
|
+
}
|
|
774
814
|
return toNativeCloudflareConfig(mergeCloudflareConfig((typeof config === "function" ? config(base, { entryWorkerConfig: convertToWranglerConfig({
|
|
775
|
-
worker
|
|
815
|
+
worker,
|
|
776
816
|
containers: []
|
|
777
817
|
}) }) : config) ?? {}, base), path ? dirname(path) : root).worker;
|
|
778
818
|
}
|
|
@@ -780,7 +820,7 @@ function nativeAuxiliaryWorkers(workers, root) {
|
|
|
780
820
|
}
|
|
781
821
|
// src/plugin-cloudflare-preview.ts
|
|
782
822
|
/** Give preview local bindings without changing the deployable build or storing their values. */
|
|
783
|
-
function withLocalPreviewBindings(plugins, root) {
|
|
823
|
+
function withLocalPreviewBindings(plugins, root, localQueueProducers) {
|
|
784
824
|
let directory;
|
|
785
825
|
const cleanup = () => {
|
|
786
826
|
if (directory) {
|
|
@@ -817,6 +857,7 @@ function withLocalPreviewBindings(plugins, root) {
|
|
|
817
857
|
const binding = worker.env[name];
|
|
818
858
|
if (!binding || inlineBindingTypes.has(binding.type)) worker.env[name] = { type: "secret" };
|
|
819
859
|
}
|
|
860
|
+
addLocalQueueProducers(worker, localQueueProducers);
|
|
820
861
|
writeFileAtomic(path, JSON.stringify(worker));
|
|
821
862
|
return await hook.call(this, {
|
|
822
863
|
...config,
|
|
@@ -984,30 +1025,6 @@ function devTriggerSecretGuardPlugin() {
|
|
|
984
1025
|
}
|
|
985
1026
|
};
|
|
986
1027
|
}
|
|
987
|
-
/**
|
|
988
|
-
* Warn when the project's `package.json` does not declare `"type": "module"`.
|
|
989
|
-
*
|
|
990
|
-
* Vite's default `configLoader: "bundle"` bundles `vite.config.ts`,
|
|
991
|
-
* externalizes deps, and then loads the bundle. When `package.json` is non-ESM
|
|
992
|
-
* the bundle is written as `.js` and loaded via CJS `require()`, which throws
|
|
993
|
-
* `ERR_REQUIRE_ASYNC_MODULE` if any externalized dep's ESM graph contains
|
|
994
|
-
* top-level await. `@cloudflare/vite-plugin` (which voidPlugin pulls in) has
|
|
995
|
-
* exactly such a TLA, so non-ESM consumers hit this on every Vite invocation.
|
|
996
|
-
*
|
|
997
|
-
* Runs once per Vite process (factory time), single sync read.
|
|
998
|
-
*/
|
|
999
|
-
function warnIfPackageJsonIsNotEsm(root) {
|
|
1000
|
-
const pkgPath = join(root, "package.json");
|
|
1001
|
-
if (!existsSync(pkgPath)) return;
|
|
1002
|
-
let pkg;
|
|
1003
|
-
try {
|
|
1004
|
-
pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
|
|
1005
|
-
} catch {
|
|
1006
|
-
return;
|
|
1007
|
-
}
|
|
1008
|
-
if (pkg.type === "module") return;
|
|
1009
|
-
voidWarn("package.json is missing `\"type\": \"module\"`. Vite's default config loader will fail with ERR_REQUIRE_ASYNC_MODULE on transitive top-level await (e.g. @cloudflare/vite-plugin). Add `\"type\": \"module\"` to package.json, or run vite build with `--configLoader runner`.");
|
|
1010
|
-
}
|
|
1011
1028
|
// src/plugin-cloudflare.ts
|
|
1012
1029
|
function isInside(directory, path) {
|
|
1013
1030
|
const child = relative(directory, path);
|
|
@@ -1032,10 +1049,14 @@ function cloudflare$1(options) {
|
|
|
1032
1049
|
let workerConfig;
|
|
1033
1050
|
let native;
|
|
1034
1051
|
let pluginNative;
|
|
1052
|
+
let localQueueBindings;
|
|
1053
|
+
let localQueueWarnings;
|
|
1035
1054
|
const outputDirectories = /* @__PURE__ */ new Map();
|
|
1036
1055
|
const bridge = {
|
|
1037
1056
|
name: "void:cloudflare-config",
|
|
1038
1057
|
config(_userConfig, environment) {
|
|
1058
|
+
localQueueBindings = void 0;
|
|
1059
|
+
localQueueWarnings = void 0;
|
|
1039
1060
|
if (environment.isPreview) return;
|
|
1040
1061
|
let base = options.configPath ? readGeneratedWranglerConfigFile(options.configPath) : {};
|
|
1041
1062
|
if (process.env.CLOUDFLARE_ENV && base.env) {
|
|
@@ -1056,7 +1077,13 @@ function cloudflare$1(options) {
|
|
|
1056
1077
|
if (environment.command === "build" && (native.containers?.length ?? 0) > 0) {
|
|
1057
1078
|
pluginNative.containers = [];
|
|
1058
1079
|
for (const declaration of Object.values(pluginNative.worker?.exports ?? {})) if ("container" in declaration) delete declaration.container;
|
|
1059
|
-
} else if (environment.command === "serve")
|
|
1080
|
+
} else if (environment.command === "serve") {
|
|
1081
|
+
restoreLocalContainerBindings(pluginNative.worker);
|
|
1082
|
+
localQueueBindings = addLocalQueueProducers(pluginNative.worker, options.localQueueProducers, (message) => (localQueueWarnings ??= []).push(message));
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
configureServer() {
|
|
1086
|
+
localQueueWarnings?.forEach(voidWarn);
|
|
1060
1087
|
}
|
|
1061
1088
|
};
|
|
1062
1089
|
const directories = {
|
|
@@ -1121,6 +1148,26 @@ function cloudflare$1(options) {
|
|
|
1121
1148
|
} } : {}
|
|
1122
1149
|
};
|
|
1123
1150
|
delete config.env;
|
|
1151
|
+
if (config.containers) {
|
|
1152
|
+
const rebase = (path) => isAbsolute(path) ? path : relative(destination, resolve(root, path)) || ".";
|
|
1153
|
+
config.containers = config.containers.map((container) => {
|
|
1154
|
+
if (!container.images) return container;
|
|
1155
|
+
const images = { ...container.images };
|
|
1156
|
+
for (const [name, image] of Object.entries(images)) {
|
|
1157
|
+
if (image.dockerfile === void 0) continue;
|
|
1158
|
+
const local = {
|
|
1159
|
+
...image,
|
|
1160
|
+
dockerfile: rebase(image.dockerfile)
|
|
1161
|
+
};
|
|
1162
|
+
if (image.build_context !== void 0) local.build_context = rebase(image.build_context);
|
|
1163
|
+
images[name] = local;
|
|
1164
|
+
}
|
|
1165
|
+
return {
|
|
1166
|
+
...container,
|
|
1167
|
+
images
|
|
1168
|
+
};
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1124
1171
|
writeFileAtomic(join(destination, "wrangler.json"), `${JSON.stringify(config, null, 2)}\n`);
|
|
1125
1172
|
if (options.finalizeAssets) {
|
|
1126
1173
|
options.finalizeAssets(client, builder.environments.client);
|
|
@@ -1151,12 +1198,12 @@ function cloudflare$1(options) {
|
|
|
1151
1198
|
inspectorPort: options.inspectorPort,
|
|
1152
1199
|
persistState: options.persistState,
|
|
1153
1200
|
viteEnvironment: options.viteEnvironment,
|
|
1154
|
-
auxiliaryWorkers: nativeAuxiliaryWorkers(options.auxiliaryWorkers, root),
|
|
1201
|
+
auxiliaryWorkers: nativeAuxiliaryWorkers(options.auxiliaryWorkers, root, () => localQueueBindings),
|
|
1155
1202
|
types: { generate: false },
|
|
1156
1203
|
config() {
|
|
1157
1204
|
return pluginNative;
|
|
1158
1205
|
}
|
|
1159
|
-
}), root),
|
|
1206
|
+
}), root, options.localQueueProducers),
|
|
1160
1207
|
output
|
|
1161
1208
|
]);
|
|
1162
1209
|
}
|
|
@@ -2388,22 +2435,39 @@ function astroMiddlewareClaims() {
|
|
|
2388
2435
|
}
|
|
2389
2436
|
/**
|
|
2390
2437
|
* Whether the Astro app has middleware that Void did not write. Void cannot add its dev trigger
|
|
2391
|
-
* middleware then, so the wrapper around
|
|
2438
|
+
* middleware then, so the wrapper around the adapter's request handler answers the triggers.
|
|
2392
2439
|
*/
|
|
2393
2440
|
function hasOwnAstroMiddleware(root) {
|
|
2394
2441
|
const middlewarePath = join(root, ASTRO_MIDDLEWARE_RELATIVE);
|
|
2395
2442
|
if (existsSync(middlewarePath)) return !astroMiddlewareClaims().has(middlewarePath);
|
|
2396
2443
|
return existsSync(join(root, "src", "middleware", "index.ts"));
|
|
2397
2444
|
}
|
|
2398
|
-
/**
|
|
2399
|
-
|
|
2400
|
-
|
|
2445
|
+
/**
|
|
2446
|
+
* The adapter modules that Void's wrapper covers (`void:astro-server-entry`): the server entry,
|
|
2447
|
+
* and the one whose `handle()` an app's own Worker entry calls.
|
|
2448
|
+
*/
|
|
2449
|
+
const ASTRO_WRAPPED_MODULES = ["@astrojs/cloudflare/entrypoints/server", "@astrojs/cloudflare/handler"];
|
|
2450
|
+
/**
|
|
2451
|
+
* The app's own Worker entry from its Cloudflare config, when its source names neither module
|
|
2452
|
+
* that Void wraps, so its requests reach Astro another way. An entry that cannot be read counts
|
|
2453
|
+
* too, and so does one that leaves the call to another module of the app.
|
|
2454
|
+
*/
|
|
2455
|
+
function unwrappedAstroWorkerEntry(root) {
|
|
2456
|
+
let rootConfig;
|
|
2401
2457
|
try {
|
|
2402
|
-
|
|
2458
|
+
rootConfig = readRootWranglerConfig(root);
|
|
2403
2459
|
} catch {
|
|
2404
2460
|
return;
|
|
2405
2461
|
}
|
|
2406
|
-
|
|
2462
|
+
const main = rootConfig?.config.main;
|
|
2463
|
+
if (!rootConfig || typeof main !== "string" || /^@astrojs\/cloudflare\/entrypoints\/server(?:\.js)?$/.test(main)) return;
|
|
2464
|
+
let source;
|
|
2465
|
+
try {
|
|
2466
|
+
source = readFileSync(resolve(dirname(rootConfig.configPath), main), "utf8");
|
|
2467
|
+
} catch {
|
|
2468
|
+
return main;
|
|
2469
|
+
}
|
|
2470
|
+
return ASTRO_WRAPPED_MODULES.some((name) => source.includes(name)) ? void 0 : main;
|
|
2407
2471
|
}
|
|
2408
2472
|
/**
|
|
2409
2473
|
* Writes a tiny Astro middleware to the user's project so
|
|
@@ -2413,8 +2477,9 @@ function customAstroWorkerEntry(root) {
|
|
|
2413
2477
|
*
|
|
2414
2478
|
* Astro middleware lives at a single discoverable entry, so if the user
|
|
2415
2479
|
* already has `src/middleware.ts` we don't overwrite it. The wrapper around
|
|
2416
|
-
*
|
|
2417
|
-
* entry
|
|
2480
|
+
* the adapter's request handler answers the triggers then, also for a custom
|
|
2481
|
+
* Worker entry that calls `handle()`. An entry that reaches Astro another way
|
|
2482
|
+
* skips the wrapper, so we warn about one.
|
|
2418
2483
|
*
|
|
2419
2484
|
* If we wrote the file we remove it when the last dev server using it closes,
|
|
2420
2485
|
* so the user's source tree stays clean. `src/middleware.ts` belongs to the
|
|
@@ -2427,10 +2492,10 @@ function astroDevTriggerInjectPlugin(root) {
|
|
|
2427
2492
|
/** Whether the dev server being set up now holds the middleware Void wrote. */
|
|
2428
2493
|
const ensureFile = () => {
|
|
2429
2494
|
if (hasOwnAstroMiddleware(root)) {
|
|
2430
|
-
const entry =
|
|
2431
|
-
if (entry) voidWarn(`Your Astro app has its own middleware and its own Worker entry (${entry}).\n In dev, /__void/scheduled and /__void/queue
|
|
2432
|
-
handle() from @astrojs/cloudflare/handler
|
|
2433
|
-
default export of @astrojs/cloudflare/entrypoints/server
|
|
2495
|
+
const entry = unwrappedAstroWorkerEntry(root);
|
|
2496
|
+
if (entry) voidWarn(`Your Astro app has its own middleware and its own Worker entry (${entry}).\n In dev, /__void/scheduled and /__void/queue work only when this entry serves
|
|
2497
|
+
requests with handle() from @astrojs/cloudflare/handler, or with fetch() on
|
|
2498
|
+
the default export of @astrojs/cloudflare/entrypoints/server.`);
|
|
2434
2499
|
return false;
|
|
2435
2500
|
}
|
|
2436
2501
|
const claim = claims.get(middlewarePath);
|
|
@@ -2664,8 +2729,13 @@ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, s
|
|
|
2664
2729
|
}
|
|
2665
2730
|
lines.push(" const failures = (await Promise.all(tasks)).filter(Boolean);", " if (failures.length) {", " throw new AggregateError(failures.map((failure) => failure.error), `Scheduled jobs failed: ${failures.map((failure) => failure.job).join(\", \")}`);", " }", "}", "");
|
|
2666
2731
|
} else lines.push("export async function scheduled() {}", "");
|
|
2732
|
+
const triggerPaths = [];
|
|
2733
|
+
function registerTrigger(path, handler) {
|
|
2734
|
+
triggerPaths.push(path);
|
|
2735
|
+
return `app.post(${JSON.stringify(path)}, __markRouteHandler(${handler}));`;
|
|
2736
|
+
}
|
|
2667
2737
|
if (scan.jobs.length > 0 || scan.queues.length > 0) lines.push("function __voidTriggerUnauthorized(c) {", " const __token = c.req.header(\"x-void-internal\");", " const __expected = __getRawEnv()?.__VOID_PROXY_TOKEN;", " const __devToken = c.req.header(\"x-void-dev-trigger\");", " return __VOID_SERVE ? __devToken !== __VOID_DEV_TRIGGER_TOKEN : __expected ? __token !== __expected : __token !== __VOID_BUILD_KEY;", "}", "");
|
|
2668
|
-
if (scan.jobs.length > 0) lines.push("const __scheduledHandler = async (c) => {", " if (__voidTriggerUnauthorized(c)) return c.json({ error: \"unauthorized\" }, 401);", " const { cron, scheduledTime } = await c.req.json();", " const controller = { cron, scheduledTime, noRetry() {} };", " await scheduled(controller, c.env, c.executionCtx);", " return c.json({ ok: true });", "};",
|
|
2738
|
+
if (scan.jobs.length > 0) lines.push("const __scheduledHandler = async (c) => {", " if (__voidTriggerUnauthorized(c)) return c.json({ error: \"unauthorized\" }, 401);", " const { cron, scheduledTime } = await c.req.json();", " const controller = { cron, scheduledTime, noRetry() {} };", " await scheduled(controller, c.env, c.executionCtx);", " return c.json({ ok: true });", "};", registerTrigger("/__void/scheduled", "__scheduledHandler"), "");
|
|
2669
2739
|
if (scan.queues.length > 0) {
|
|
2670
2740
|
const queueNames = scan.queues.map((queue) => queue.name);
|
|
2671
2741
|
const cloudflareNames = options.cloudflareQueueNames;
|
|
@@ -2676,7 +2746,7 @@ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, s
|
|
|
2676
2746
|
const q = scan.queues[i];
|
|
2677
2747
|
lines.push(` case ${i}: {`, ` const mod = await import(${JSON.stringify(`${queuesDir}/${q.filePath}`)});`, " if (typeof mod.default === 'function') await mod.default(batch, env);", " break;", " }");
|
|
2678
2748
|
}
|
|
2679
|
-
lines.push(" }", " } catch (error) {", " console.error(`[void] Queue handler ${__queueLabels[__queueIndex]} failed for queue \"${String(queueSuffix)}\":`, error);", " __ok = false;", " }", " return { ok: __ok, ...(__decisions.size > 0 ? { decisions: Object.fromEntries(__decisions) } : {}) };", "}", "", "const __queueHandler = async (c) => {", " if (__voidTriggerUnauthorized(c)) return c.json({ error: \"unauthorized\" }, 401);", " const payload = await c.req.json();", " const result = await __processQueue(payload, c.env);", " return c.json(result);", "};",
|
|
2749
|
+
lines.push(" }", " } catch (error) {", " console.error(`[void] Queue handler ${__queueLabels[__queueIndex]} failed for queue \"${String(queueSuffix)}\":`, error);", " __ok = false;", " }", " return { ok: __ok, ...(__decisions.size > 0 ? { decisions: Object.fromEntries(__decisions) } : {}) };", "}", "", "const __queueHandler = async (c) => {", " if (__voidTriggerUnauthorized(c)) return c.json({ error: \"unauthorized\" }, 401);", " const payload = await c.req.json();", " const result = await __processQueue(payload, c.env);", " return c.json(result);", "};", registerTrigger("/__void/queue", "__queueHandler"), "");
|
|
2680
2750
|
}
|
|
2681
2751
|
const email = scan.email;
|
|
2682
2752
|
const emailDir = options.emailDir;
|
|
@@ -2703,6 +2773,7 @@ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, s
|
|
|
2703
2773
|
} else lines.push(" if (typeof message.setReject === \"function\") {", String.raw` message.setReject("no handler matched recipient \"" + __to + "\" — add email/_default.ts to handle unmatched mail");`, " }");
|
|
2704
2774
|
lines.push("}", "");
|
|
2705
2775
|
}
|
|
2776
|
+
const internalFallback = options.bindingHandlerPath ? [" return null;"] : [...triggerPaths.map((path) => ` if (request.method === "POST" && pathname === ${JSON.stringify(path)}) return null;`), " return new Response(null, { status: 404 });"];
|
|
2706
2777
|
if (options.migrationHandlerPath && (options.migrations?.length || auth)) {
|
|
2707
2778
|
const d1BindingName = options.bindingNames?.d1;
|
|
2708
2779
|
lines.push(`import { createMigrationHandler as __createMigrationHandler } from ${JSON.stringify(options.migrationHandlerPath)};`, `const __migrations = ${JSON.stringify(options.migrations)};`, `const __migrationPlanBundle = ${JSON.stringify(options.migrationPlanBundle)};`);
|
|
@@ -2715,12 +2786,12 @@ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, s
|
|
|
2715
2786
|
lines.push("function __voidCreateMigrationRequestHandler(includeAuthMigrations, includePlanBundle) {", " return __createMigrationHandler(", " __voidGetMigrationEnv(),", " __migrations,");
|
|
2716
2787
|
if (auth) lines.push(" includeAuthMigrations ? () => runVoidAuthMigrations(__voidGetMigrationEnv(), __voidAuthOptions, __voidAuthMigrationSchema) : undefined,");
|
|
2717
2788
|
else lines.push(" undefined,");
|
|
2718
|
-
lines.push(" includePlanBundle ? __migrationPlanBundle : undefined,", " );", "}", "export async function __voidHandleInternalRoute(request) {", "
|
|
2719
|
-
if (auth) lines.push(" if (request.method === \"POST\" &&
|
|
2720
|
-
lines.push(
|
|
2789
|
+
lines.push(" includePlanBundle ? __migrationPlanBundle : undefined,", " );", "}", "export async function __voidHandleInternalRoute(request, pathname) {", " if (request.method === \"POST\" && pathname === \"/__void/migrate\") {", ` return __voidCreateMigrationRequestHandler(${auth ? "true" : "false"}, false)(request);`, " }", " if (request.method === \"GET\" && pathname === \"/__void/migrate/capabilities\") {", ` return __voidCreateMigrationRequestHandler(${auth ? "true" : "false"}, true)(request);`, " }", " if (request.method === \"POST\" && pathname === \"/__void/migrate/app\") {", " return __voidCreateMigrationRequestHandler(false, true)(request);", " }", " if (request.method === \"GET\" && pathname.startsWith(\"/__void/migrate/app/attempt/\")) {", " return __voidCreateMigrationRequestHandler(false, true)(request);", " }");
|
|
2790
|
+
if (auth) lines.push(" if (request.method === \"POST\" && pathname === \"/__void/migrate/auth\") {", " return __voidCreateMigrationRequestHandler(true, true)(request);", " }");
|
|
2791
|
+
lines.push(...internalFallback, "}", `app.post("/__void/migrate", __markRouteHandler((c) => __voidCreateMigrationRequestHandler(${auth ? "true" : "false"}, false)(c.req.raw)));`, `app.get("/__void/migrate/capabilities", __markRouteHandler((c) => __voidCreateMigrationRequestHandler(${auth ? "true" : "false"}, true)(c.req.raw)));`, "app.post(\"/__void/migrate/app\", __markRouteHandler((c) => __voidCreateMigrationRequestHandler(false, true)(c.req.raw)));", "app.get(\"/__void/migrate/app/attempt/:attemptId\", __markRouteHandler((c) => __voidCreateMigrationRequestHandler(false, true)(c.req.raw)));");
|
|
2721
2792
|
if (auth) lines.push("app.post(\"/__void/migrate/auth\", __markRouteHandler((c) => __voidCreateMigrationRequestHandler(true, true)(c.req.raw)));");
|
|
2722
2793
|
lines.push("");
|
|
2723
|
-
} else lines.push("export async function __voidHandleInternalRoute() {
|
|
2794
|
+
} else lines.push("export async function __voidHandleInternalRoute(request, pathname) {", ...internalFallback, "}", "");
|
|
2724
2795
|
if (options.bindingHandlerPath) lines.push(`import { createBindingHandler as __createBindingHandler } from ${JSON.stringify(options.bindingHandlerPath)};`, "let __voidBindingApp;", "app.all(\"/__void/*\", __markRouteHandler(async (c) => {", " if (!__voidBindingApp) __voidBindingApp = __createBindingHandler(__getRawEnv());", " const url = new URL(c.req.url);", " url.pathname = url.pathname.slice(7);", " return __voidBindingApp.fetch(new Request(url.toString(), c.req.raw));", "}));", "");
|
|
2725
2796
|
lines.push("const __rawEnvStore = new AsyncLocalStorage();", "export function __withRawEnv(env, fn) { return __rawEnvStore.run(env, fn); }", "function __getRawEnv() { return __rawEnvStore.getStore(); }", `export const __VOID_BUILD_KEY = ${JSON.stringify(crypto.randomUUID())};`, `export const __VOID_DEV_TRIGGER_TOKEN = ${JSON.stringify(options.devTriggerToken ?? crypto.randomUUID())};`, `const __VOID_SERVE = ${JSON.stringify(options.dev === true)};`, `export const __VOID_ISR_REVALIDATE = ${JSON.stringify(mergedRevalidate)};`, `export const __VOID_ISR_PAGES = ${JSON.stringify(isrPages)};`, `export const __VOID_ISR_PATH_REVALIDATE = ${JSON.stringify(isrPathRevalidate)};`, `export const __VOID_ISR_DEPLOYMENT_ID = ${JSON.stringify(crypto.randomUUID())};`, "", `export default app;`);
|
|
2726
2797
|
return lines.join("\n");
|
|
@@ -2795,6 +2866,21 @@ function compilePageRoutes(lines, scan, pages, options, pageNames) {
|
|
|
2795
2866
|
pageDevRootPhases[plan.id] = [[virtualDevUrl(pages.clientEntryId)], files.map((file) => toDevRootUrl(`${pages.pagesDir}/${file}`))];
|
|
2796
2867
|
}
|
|
2797
2868
|
lines.push("const __loadPagesManifest = __createManifestLoader();");
|
|
2869
|
+
const boundaryHeadLoaders = {};
|
|
2870
|
+
const boundaryHeadModules = /* @__PURE__ */ new Map();
|
|
2871
|
+
for (const plan of Object.values(boundaryManifest.plans)) {
|
|
2872
|
+
const serverPath = scan.pages.boundaries?.find((boundary) => boundary.filePath === plan.filePath)?.serverPath;
|
|
2873
|
+
if (!serverPath) continue;
|
|
2874
|
+
let loader = boundaryHeadModules.get(serverPath);
|
|
2875
|
+
if (!loader) {
|
|
2876
|
+
loader = `__boundaryHead${boundaryHeadModules.size}`;
|
|
2877
|
+
boundaryHeadModules.set(serverPath, loader);
|
|
2878
|
+
lines.push(`const ${loader} = __createModuleLoader(() => import(${JSON.stringify(`${pages.pagesDir}/${serverPath}`)}));`);
|
|
2879
|
+
}
|
|
2880
|
+
boundaryHeadLoaders[plan.id] = loader;
|
|
2881
|
+
}
|
|
2882
|
+
if (boundaryHeadModules.size) lines.push(`const __voidBoundaryHeads = { ${Object.entries(boundaryHeadLoaders).map(([id, loader]) => `${JSON.stringify(id)}: ${loader}`).join(", ")} };`);
|
|
2883
|
+
const boundaryHeadsOption = boundaryHeadModules.size ? "boundaryHeads: __voidBoundaryHeads, " : "";
|
|
2798
2884
|
const assetMetadata = {
|
|
2799
2885
|
pageCssKeys,
|
|
2800
2886
|
devRootPhases: options.dev ? pageDevRootPhases : void 0,
|
|
@@ -2817,7 +2903,7 @@ function compilePageRoutes(lines, scan, pages, options, pageNames) {
|
|
|
2817
2903
|
})}${devCssOption} }, __loadPagesManifest);`);
|
|
2818
2904
|
if (boundaryManifest.root) {
|
|
2819
2905
|
const island = scan.pages.pages.length > 0 && scan.pages.pages.every((page) => page.island);
|
|
2820
|
-
lines.push(`const __voidRootNotFoundOptions = { componentId: ${JSON.stringify(boundaryManifest.root)}, load: async () => ({ loader: () => new Response(null, { status: 404 }) }), render: ${island ? "renderIslandPage" : "renderPage"}, assets: ${island && pages.islandClientEntryId ? "getIslandsAssetTags" : "getPagesAssetTags"}, headConfig: __voidHeadConfig, renderOptions: ${JSON.stringify({
|
|
2906
|
+
lines.push(`const __voidRootNotFoundOptions = { ${boundaryHeadsOption}componentId: ${JSON.stringify(boundaryManifest.root)}, load: async () => ({ loader: () => new Response(null, { status: 404 }) }), render: ${island ? "renderIslandPage" : "renderPage"}, assets: ${island && pages.islandClientEntryId ? "getIslandsAssetTags" : "getPagesAssetTags"}, headConfig: __voidHeadConfig, renderOptions: ${JSON.stringify({
|
|
2821
2907
|
renderMode: island ? "island" : "server",
|
|
2822
2908
|
dev: options.dev === true,
|
|
2823
2909
|
boundaries: {
|
|
@@ -2857,7 +2943,7 @@ function compilePageRoutes(lines, scan, pages, options, pageNames) {
|
|
|
2857
2943
|
notFound: boundaryManifest.root,
|
|
2858
2944
|
errors: (boundaryManifest.pages[page.componentId]?.errors ?? []).filter((id) => !boundaryManifest.plans[id].directory)
|
|
2859
2945
|
})}, `;
|
|
2860
|
-
const routeOptions = `{ ${serverImportPath ? "load: _pload_" + safeId + ", " : ""}${mdHeadRef ? "head: " + mdHeadRef + ", " : ""}${trailingCatchAll ? `trailingSlash: true, catchAllParam: ${JSON.stringify(catchAllParam)}, ` : ""}${middlewareBoundaries}componentId: ${JSON.stringify(page.componentId)}, render: ${renderer}, assets: ${assetTags}, headConfig: __voidHeadConfig, renderOptions: ${JSON.stringify({
|
|
2946
|
+
const routeOptions = `{ ${boundaryHeadsOption}${serverImportPath ? "load: _pload_" + safeId + ", " : ""}${mdHeadRef ? "head: " + mdHeadRef + ", " : ""}${trailingCatchAll ? `trailingSlash: true, catchAllParam: ${JSON.stringify(catchAllParam)}, ` : ""}${middlewareBoundaries}componentId: ${JSON.stringify(page.componentId)}, render: ${renderer}, assets: ${assetTags}, headConfig: __voidHeadConfig, renderOptions: ${JSON.stringify({
|
|
2861
2947
|
renderMode: page.renderMode,
|
|
2862
2948
|
...options.dev === true ? { dev: true } : {},
|
|
2863
2949
|
...boundaryManifest.pages[page.componentId] && { boundaries: boundaryManifest.pages[page.componentId] }
|
|
@@ -2892,7 +2978,7 @@ const serveWithAssets = __createAssetFallback(${JSON.stringify({
|
|
|
2892
2978
|
* proxy-backed versions.
|
|
2893
2979
|
*/
|
|
2894
2980
|
function compileWorkerEntry(options = {}) {
|
|
2895
|
-
const { hasQueues = false, versionMetadataBinding, alwaysUseHttps = false, remote, assetsDir = "assets", webSocketClasses = [], runtimeEnvPath = "void/_env", runtimeEmailPath = "void/email", envSchemaModule, sandbox, serveSpaFallback = false, hasEmail = false, live, dev = false, isr, notFound = "none", durableObjects = [] } = options;
|
|
2981
|
+
const { hasQueues = false, versionMetadataBinding, alwaysUseHttps = false, remote, assetsDir = "assets", webSocketClasses = [], runtimeEnvPath = "void/_env", runtimeEmailPath = "void/email", envSchemaModule, sandbox, serveSpaFallback = false, hasEmail = false, live, dev = false, isr, notFound = "none", durableObjects = [], workflows = [] } = options;
|
|
2896
2982
|
const remotePath = remote?.remotePath;
|
|
2897
2983
|
const remoteBindingNames = JSON.stringify(remote?.bindingNames);
|
|
2898
2984
|
const createRemoteEnvCall = `createRemoteEnv(env${remote?.bindingNames ? `, ${remoteBindingNames}` : ""})`;
|
|
@@ -2911,8 +2997,28 @@ function compileWorkerEntry(options = {}) {
|
|
|
2911
2997
|
const liveRuntimeImport = hasLive ? `import { __setLiveBindingName${liveDev ? ", __setLiveDev" : ""} } from "void/live";\n` : "";
|
|
2912
2998
|
const liveDevCall = liveDev ? "__setLiveDev(true);\n" : "";
|
|
2913
2999
|
const liveExport = hasLive ? liveClassName === "VoidLiveStreamDurableObject" ? `export { VoidLiveStreamDurableObject };\n__setLiveBindingName(${JSON.stringify(liveBindingName)});\n${liveDevCall}` : `export { VoidLiveStreamDurableObject as ${liveClassName} };\n__setLiveBindingName(${JSON.stringify(liveBindingName)});\n${liveDevCall}` : "";
|
|
2914
|
-
const
|
|
2915
|
-
|
|
3000
|
+
const workflowOptions = [
|
|
3001
|
+
isr && "isrDeploymentId: __VOID_ISR_DEPLOYMENT_ID",
|
|
3002
|
+
envSchemaModule && "validateEnv: _validateEnvOnce",
|
|
3003
|
+
remotePath && `remoteEnv: (env) => ${createRemoteEnvCall}`
|
|
3004
|
+
].filter(Boolean).join(", ");
|
|
3005
|
+
const workflowEntryImport = workflows.length ? `import { createWorkflowEntrypoint as __createWorkflowEntrypoint } from ${JSON.stringify(fileURLToPath(import.meta.resolve("#self/runtime/workflow-entry")))};\n` : "";
|
|
3006
|
+
function resourceExports(entries, directory) {
|
|
3007
|
+
const workflow = directory === "workflows";
|
|
3008
|
+
const prefix = workflow ? "workflows" : "durable";
|
|
3009
|
+
const helpers = workflow ? "defineWorkflow() or defineWorkflowEntrypoint()" : "defineDurableState() or defineDurableObject()";
|
|
3010
|
+
return entries.map(({ bindingName, className, filePath, relativePath, name }, index) => {
|
|
3011
|
+
const local = (workflow ? "__voidWorkflow" : "__voidDurableObject") + index;
|
|
3012
|
+
const file = relativePath ?? basename(filePath.replaceAll("\\", "/"));
|
|
3013
|
+
const message = `${prefix}: ${directory}/${file} must default-export ${helpers}.`;
|
|
3014
|
+
const resourceClass = `${local}.class`;
|
|
3015
|
+
return `import * as ${local}Module from ${JSON.stringify(filePath)};
|
|
3016
|
+
const ${local} = ${local}Module.default;
|
|
3017
|
+
if (typeof ${local}?.__bind !== "function") throw new Error(${JSON.stringify(message)});
|
|
3018
|
+
${local}.__bind(${JSON.stringify(bindingName)}${name === void 0 ? "" : ", " + JSON.stringify(name)});
|
|
3019
|
+
export const ${className} = ${workflow ? `__createWorkflowEntrypoint(${resourceClass}, { ${workflowOptions} })` : resourceClass};`;
|
|
3020
|
+
}).join("\n");
|
|
3021
|
+
}
|
|
2916
3022
|
const runtimeEnvImport = `import { withRuntimeEnv } from ${JSON.stringify(runtimeEnvPath)};\n`;
|
|
2917
3023
|
const remoteImport = remote ? `import { createRemoteEnv } from ${JSON.stringify(remote.remotePath)};\n` : "";
|
|
2918
3024
|
const envSchemaImport = envSchemaModule ? `import ${JSON.stringify(envSchemaModule.importPath)};\nimport { _validateEnvOnce } from ${JSON.stringify(envSchemaModule.helperPath)};\n` : "";
|
|
@@ -2981,6 +3087,11 @@ ${hasQueues ? ` async queue(batch) { return __voidQueue(batch, this.env, this.c
|
|
|
2981
3087
|
throw new TypeError("Native email event required");
|
|
2982
3088
|
}
|
|
2983
3089
|
await handleEmail(message, this.env, this.ctx);
|
|
3090
|
+
}\n` : ""}${workflows.length ? ` runVoidWorkflow(className, event, step) {
|
|
3091
|
+
switch (className) {
|
|
3092
|
+
${workflows.map(({ className }) => `case ${JSON.stringify(className)}: return new ${className}(this.ctx, this.env).run(event, step);`).join("\n ")}
|
|
3093
|
+
default: throw new Error('Unknown Workflow class.');
|
|
3094
|
+
}
|
|
2984
3095
|
}\n` : ""}}`;
|
|
2985
3096
|
const queueImport = hasQueues ? ", __processQueue" : "";
|
|
2986
3097
|
const queueFunction = hasQueues ? `async function __voidQueue(batch, env, ctx) {
|
|
@@ -3006,7 +3117,7 @@ ${envValidateCall}${remoteEnvSwap}${isrDeploymentStamp} const userEnv = __filte
|
|
|
3006
3117
|
|
|
3007
3118
|
` : "";
|
|
3008
3119
|
return `${sandboxImport}${entryImport}${liveRuntimeImport}import app, { scheduled, __voidCollectPrerenderPaths, __voidRenderStaticNotFound, __voidHandleInternalRoute, __withRawEnv${queueImport}${emailImport}${webSocketClasses.length > 0 ? `, ${webSocketClasses.join(", ")}` : ""}${liveRouteImport} } from 'virtual:void-routes';
|
|
3009
|
-
${
|
|
3120
|
+
${workflowEntryImport}${runtimeEnvImport}${emailProxyImport}${envSchemaImport}${remoteImport}${isrImport}${filterBindingsHelper}${assetHelper}
|
|
3010
3121
|
${fetchDeclaration}
|
|
3011
3122
|
${scheduledHandler}
|
|
3012
3123
|
${emailHandler}
|
|
@@ -3014,19 +3125,50 @@ ${emailReceiptHandler}
|
|
|
3014
3125
|
${queueFunction}${webSocketClasses.map((name) => `export { ${name} };`).join("\n")}
|
|
3015
3126
|
${liveExport}
|
|
3016
3127
|
${sandboxExport}
|
|
3017
|
-
${
|
|
3128
|
+
${resourceExports(durableObjects, "durable-objects")}
|
|
3129
|
+
${resourceExports(workflows, "workflows")}
|
|
3018
3130
|
${entryClass}`;
|
|
3019
3131
|
}
|
|
3020
3132
|
/**
|
|
3021
3133
|
* Generate the app module — exports the Hono app with static asset serving.
|
|
3022
3134
|
* This is the entry imported by `vite preview` and can be used programmatically.
|
|
3023
3135
|
*/
|
|
3024
|
-
function compileNodeApp(target,
|
|
3136
|
+
function compileNodeApp(target, options) {
|
|
3137
|
+
const { envSchemaModule } = options;
|
|
3025
3138
|
const staticImport = target === "bun" ? `import { serveStatic } from "hono/bun";` : target === "deno" ? `import { serveStatic } from "hono/deno";` : `import { serveStatic } from "@hono/node-server/serve-static";`;
|
|
3026
3139
|
const envSchemaImport = envSchemaModule ? `import ${JSON.stringify(envSchemaModule.importPath)};\nimport { _validateEnvOnce } from ${JSON.stringify(envSchemaModule.helperPath)};\n` : "";
|
|
3027
3140
|
const envMiddleware = envSchemaModule ? `app.use("*", async (c, next) => { if (!(((c.req.method === "POST" && c.req.path === "/__void/prerender-paths") || (c.req.method === "GET" && c.req.path === "/__void/static-not-found")) && c.env?.__VOID_PRERENDER === "1")) await _validateEnvOnce(${target === "deno" ? "Deno.env.toObject()" : "process.env"}); return next(); });\n` : "";
|
|
3141
|
+
const precompressedImport = options.precompress ? `import { existsSync } from "node:fs";
|
|
3142
|
+
import { parseAccept } from ${JSON.stringify(fileURLToPath(import.meta.resolve("hono/utils/accept")))};
|
|
3143
|
+
` : "";
|
|
3144
|
+
const precompressedMiddleware = options.precompress ? ` const variants = new Map();
|
|
3145
|
+
for (const encoding of ["br", "gzip"]) {
|
|
3146
|
+
const root = fileURLToPath(new URL(encoding + "/", import.meta.voidPrecompressedDirectory));
|
|
3147
|
+
if (existsSync(root)) variants.set(encoding, serveStatic({ ...options, root }));
|
|
3148
|
+
}
|
|
3149
|
+
if (variants.size) {
|
|
3150
|
+
assetApp.get("/assets/*", async (c, next) => {
|
|
3151
|
+
c.header("Vary", "Accept-Encoding", { append: true });
|
|
3152
|
+
if (c.req.header("Range")) return next();
|
|
3153
|
+
const accepted = new Map(parseAccept(c.req.header("Accept-Encoding") ?? "")
|
|
3154
|
+
.map(({ type, q }) => [type.toLowerCase(), q]));
|
|
3155
|
+
const preferred = [...variants].map(([encoding, serve]) => ({
|
|
3156
|
+
encoding, serve, q: accepted.get(encoding) ?? accepted.get("*") ?? 0,
|
|
3157
|
+
})).sort((a, b) => b.q - a.q);
|
|
3158
|
+
for (const { encoding, serve, q } of preferred) {
|
|
3159
|
+
if (q <= 0 || q < (accepted.get("identity") ?? 0)) break;
|
|
3160
|
+
const response = await serve(c, async () => {});
|
|
3161
|
+
if (response) {
|
|
3162
|
+
response.headers.set("Content-Encoding", encoding);
|
|
3163
|
+
return response;
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
return next();
|
|
3167
|
+
});
|
|
3168
|
+
}
|
|
3169
|
+
` : "";
|
|
3028
3170
|
return `${staticImport}
|
|
3029
|
-
import { fileURLToPath } from "node:url";
|
|
3171
|
+
${precompressedImport}import { fileURLToPath } from "node:url";
|
|
3030
3172
|
import innerApp, { __voidCollectPrerenderPaths, __voidRenderStaticNotFound } from "virtual:void-routes";
|
|
3031
3173
|
import { Hono, prerenderPathsResponse as __prerenderPathsResponse } from ${JSON.stringify(ROUTING_RUNTIME_PATH)};
|
|
3032
3174
|
${envSchemaImport}
|
|
@@ -3037,14 +3179,15 @@ const clientAssets = () => {
|
|
|
3037
3179
|
if (!fileAssets) {
|
|
3038
3180
|
// Resolved by nodeTargetPlugin for this emitted chunk, including shared chunks.
|
|
3039
3181
|
const clientRoot = fileURLToPath(import.meta.voidClientDirectory);
|
|
3040
|
-
const
|
|
3041
|
-
assetApp.get("*", serveStatic({
|
|
3182
|
+
const options = {
|
|
3042
3183
|
root: clientRoot,
|
|
3043
3184
|
allowPercentInPath: true,
|
|
3044
3185
|
// Windows permits a trailing separator when opening a regular file.
|
|
3045
3186
|
// Directory URLs must look up an index so they cannot alias those files.
|
|
3046
3187
|
rewriteRequestPath: (path) => path.endsWith("/") ? path + "index.html" : path,
|
|
3047
|
-
}
|
|
3188
|
+
};
|
|
3189
|
+
const assetApp = new Hono();
|
|
3190
|
+
${precompressedMiddleware} assetApp.get("*", serveStatic(options));
|
|
3048
3191
|
fileAssets = { fetch: (request) => assetApp.fetch(request) };
|
|
3049
3192
|
}
|
|
3050
3193
|
return fileAssets;
|
|
@@ -3138,18 +3281,20 @@ function isFileEntry(root, main) {
|
|
|
3138
3281
|
if (main.startsWith(".") || isAbsolute(main)) return true;
|
|
3139
3282
|
return statSync(resolve(root, main), { throwIfNoEntry: false })?.isFile() === true;
|
|
3140
3283
|
}
|
|
3284
|
+
function resolveCustomWorkerEntry(framework, root, main) {
|
|
3285
|
+
if (typeof main !== "string" || main.trim() === "") throw new Error("config: cloudflare.main must be a non-empty Worker entry path.");
|
|
3286
|
+
if (!isFileEntry(root, main)) return main;
|
|
3287
|
+
const original = resolve(root, main);
|
|
3288
|
+
if (original === resolve(root, ".void", `${framework}-trigger-wrapper.ts`)) throw new Error("config: cloudflare.main cannot point to Void's generated framework wrapper.");
|
|
3289
|
+
return original;
|
|
3290
|
+
}
|
|
3141
3291
|
/** The framework's own server entry, before our trigger wrapper. */
|
|
3142
3292
|
function getOriginalFrameworkEntry(framework, root, configuredMain) {
|
|
3143
3293
|
switch (framework) {
|
|
3144
|
-
case "tanstack-start":
|
|
3294
|
+
case "tanstack-start":
|
|
3145
3295
|
if (configuredMain === void 0 || configuredMain === TANSTACK_SERVER_ENTRY || configuredMain === `${TANSTACK_SERVER_ENTRY}.js`) return TANSTACK_SERVER_ENTRY;
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
const original = resolve(root, configuredMain);
|
|
3149
|
-
if (original === resolve(root, ".void", "tanstack-start-trigger-wrapper.ts")) throw new Error("config: cloudflare.main cannot point to Void's generated framework wrapper.");
|
|
3150
|
-
return original;
|
|
3151
|
-
}
|
|
3152
|
-
case "react-router": return generateReactRouterEntry(root);
|
|
3296
|
+
return resolveCustomWorkerEntry(framework, root, configuredMain);
|
|
3297
|
+
case "react-router": return configuredMain === void 0 ? generateReactRouterEntry(root) : resolveCustomWorkerEntry(framework, root, configuredMain);
|
|
3153
3298
|
case "vinext-app": return "vinext/server/app-router-entry";
|
|
3154
3299
|
case "vinext-pages": return "vinext/server/pages-router-entry";
|
|
3155
3300
|
}
|
|
@@ -3217,6 +3362,53 @@ ${isBuild && assetFallback ? `${compileAssetFallbackHelper(assetsDir, false, not
|
|
|
3217
3362
|
writeFileIfChanged(wrapperPath, body);
|
|
3218
3363
|
return wrapperPath;
|
|
3219
3364
|
}
|
|
3365
|
+
const REACT_ROUTER_NODE_DEFAULT = /\/dist\/config\/defaults\/entry\.server\.node\.tsx$/;
|
|
3366
|
+
const reactRouterEdgeEntry = `import { createElement } from "react";
|
|
3367
|
+
import { renderToReadableStream } from "react-dom/server";
|
|
3368
|
+
import { ServerRouter } from "react-router";
|
|
3369
|
+
import { isbot } from "isbot";
|
|
3370
|
+
|
|
3371
|
+
export const streamTimeout = 5_000;
|
|
3372
|
+
|
|
3373
|
+
export default async function handleRequest(request, status, headers, context) {
|
|
3374
|
+
if (request.method === "HEAD") {
|
|
3375
|
+
return new Response(null, { status, headers });
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
let shellRendered = false;
|
|
3379
|
+
const body = await renderToReadableStream(
|
|
3380
|
+
createElement(ServerRouter, { context, url: request.url }),
|
|
3381
|
+
{
|
|
3382
|
+
signal: AbortSignal.timeout(streamTimeout + 1000),
|
|
3383
|
+
onError(error) {
|
|
3384
|
+
status = 500;
|
|
3385
|
+
if (shellRendered) console.error(error);
|
|
3386
|
+
},
|
|
3387
|
+
},
|
|
3388
|
+
);
|
|
3389
|
+
shellRendered = true;
|
|
3390
|
+
|
|
3391
|
+
if (context.isSpaMode || isbot(request.headers.get("user-agent"))) {
|
|
3392
|
+
await body.allReady;
|
|
3393
|
+
}
|
|
3394
|
+
headers.set("Content-Type", "text/html");
|
|
3395
|
+
return new Response(body, { status, headers });
|
|
3396
|
+
}
|
|
3397
|
+
`;
|
|
3398
|
+
function reactRouterEdgeEntryPlugin() {
|
|
3399
|
+
return {
|
|
3400
|
+
name: "void:react-router-edge-entry",
|
|
3401
|
+
enforce: "pre",
|
|
3402
|
+
load: {
|
|
3403
|
+
filter: { id: REACT_ROUTER_NODE_DEFAULT },
|
|
3404
|
+
handler(id) {
|
|
3405
|
+
if (!this.environment.config.resolve.conditions.includes("workerd")) return;
|
|
3406
|
+
const packageRoot = id.replace(REACT_ROUTER_NODE_DEFAULT, "");
|
|
3407
|
+
if (readPackageJson(packageRoot)?.name === "@react-router/dev") return reactRouterEdgeEntry;
|
|
3408
|
+
}
|
|
3409
|
+
}
|
|
3410
|
+
};
|
|
3411
|
+
}
|
|
3220
3412
|
/** Generate a worker entry for React Router v7 projects. */
|
|
3221
3413
|
function generateReactRouterEntry(root) {
|
|
3222
3414
|
const outDir = join(root, ".void");
|
|
@@ -3268,7 +3460,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
3268
3460
|
const hasSqlMigrations = existsSync(migrationsDir);
|
|
3269
3461
|
if (!hasSqlMigrations && !auth?.enabled) return;
|
|
3270
3462
|
const migrateAuth = async (databaseUrl) => {
|
|
3271
|
-
const { runLocalVoidAuthMigrations } = await import("./node-
|
|
3463
|
+
const { runLocalVoidAuthMigrations } = await import("./node-BbKlLpHa.mjs");
|
|
3272
3464
|
await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth?.configPath, databaseUrl, devAuthConfigImporter(server));
|
|
3273
3465
|
};
|
|
3274
3466
|
const mysqlAuth = dialect === "mysql" && auth?.enabled === true;
|
|
@@ -3280,7 +3472,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
3280
3472
|
};
|
|
3281
3473
|
try {
|
|
3282
3474
|
if (dialect !== "sqlite") {
|
|
3283
|
-
const { collectMigrations } = await import("./collect-
|
|
3475
|
+
const { collectMigrations } = await import("./collect-Aam0GwAU.mjs");
|
|
3284
3476
|
const allMigrations = collectMigrations(migrationsDir);
|
|
3285
3477
|
const runFiles = dialect === "mysql" ? allMigrations.length > 0 : hasSqlMigrations;
|
|
3286
3478
|
const url = runFiles ? readDatabaseUrl(root) : void 0;
|
|
@@ -3294,8 +3486,8 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
3294
3486
|
}
|
|
3295
3487
|
const authWithFiles = authUrl !== void 0 && authUrl === url;
|
|
3296
3488
|
if (url) {
|
|
3297
|
-
const { validateMigrations } = await import("./validate-
|
|
3298
|
-
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-
|
|
3489
|
+
const { validateMigrations } = await import("./validate-p9b3r1k4.mjs");
|
|
3490
|
+
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-CW6bFa67.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-OeP0JpEo.mjs").then((runner) => runner.getPgAppliedMigrations(url));
|
|
3299
3491
|
const appliedSet = new Set(appliedNames);
|
|
3300
3492
|
const pending = allMigrations.filter((migration) => !appliedSet.has(migration.name));
|
|
3301
3493
|
if (pending.length > 0) try {
|
|
@@ -3304,20 +3496,20 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
3304
3496
|
refuse(err);
|
|
3305
3497
|
return;
|
|
3306
3498
|
}
|
|
3307
|
-
const applied = dialect === "mysql" ? await import("./runner-mysql-
|
|
3499
|
+
const applied = dialect === "mysql" ? await import("./runner-mysql-CW6bFa67.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url, authWithFiles ? async (names) => {
|
|
3308
3500
|
logApplied(names);
|
|
3309
3501
|
await migrateAuth(url);
|
|
3310
|
-
} : void 0)) : await import("./runner-pg-
|
|
3502
|
+
} : void 0)) : await import("./runner-pg-OeP0JpEo.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
|
|
3311
3503
|
if (!authWithFiles) logApplied(applied);
|
|
3312
3504
|
}
|
|
3313
3505
|
if (authUrl && !authWithFiles) {
|
|
3314
|
-
const { withMySqlMigrationLockAt } = await import("./runner-mysql-
|
|
3506
|
+
const { withMySqlMigrationLockAt } = await import("./runner-mysql-CW6bFa67.mjs");
|
|
3315
3507
|
await withMySqlMigrationLockAt(authUrl, () => migrateAuth(authUrl));
|
|
3316
3508
|
}
|
|
3317
3509
|
} else if (hasSqlMigrations) {
|
|
3318
|
-
const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-
|
|
3319
|
-
const { collectMigrations } = await import("./collect-
|
|
3320
|
-
const { validateMigrations } = await import("./validate-
|
|
3510
|
+
const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-rnXCGa20.mjs");
|
|
3511
|
+
const { collectMigrations } = await import("./collect-Aam0GwAU.mjs");
|
|
3512
|
+
const { validateMigrations } = await import("./validate-p9b3r1k4.mjs");
|
|
3321
3513
|
const dbPath = getMiniflareDatabasePath(persistRoot, databaseId);
|
|
3322
3514
|
const allMigrations = collectMigrations(migrationsDir);
|
|
3323
3515
|
const appliedRows = await getAppliedMigrations(dbPath);
|
|
@@ -3389,9 +3581,45 @@ function createBareVoidRedirectPlugin() {
|
|
|
3389
3581
|
}
|
|
3390
3582
|
};
|
|
3391
3583
|
}
|
|
3584
|
+
/** Preserve route-miss identity across Hono's bodyless compression copy. */
|
|
3585
|
+
function createHonoCompressionPlugin(routingRuntime = fileURLToPath(import.meta.resolve("#self/runtime/routing"))) {
|
|
3586
|
+
const prefix = "\0void:hono-compress:";
|
|
3587
|
+
return {
|
|
3588
|
+
name: "void:hono-compression",
|
|
3589
|
+
resolveId: {
|
|
3590
|
+
order: "pre",
|
|
3591
|
+
filter: { id: /^hono\/compress$/ },
|
|
3592
|
+
async handler(id, importer, options) {
|
|
3593
|
+
if (this.environment.config.consumer === "client") return;
|
|
3594
|
+
const original = await this.resolve(id, importer, {
|
|
3595
|
+
...options,
|
|
3596
|
+
skipSelf: true
|
|
3597
|
+
});
|
|
3598
|
+
if (original && !original.external) return prefix + original.id;
|
|
3599
|
+
}
|
|
3600
|
+
},
|
|
3601
|
+
load(id) {
|
|
3602
|
+
if (id.startsWith(prefix)) {
|
|
3603
|
+
const original = JSON.stringify(id.slice(20));
|
|
3604
|
+
return `
|
|
3605
|
+
export * from ${original};
|
|
3606
|
+
import { compress as honoCompress } from ${original};
|
|
3607
|
+
import { trackCompression } from ${JSON.stringify(routingRuntime)};
|
|
3608
|
+
export const compress = (...args) => trackCompression(honoCompress(...args));
|
|
3609
|
+
`;
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
};
|
|
3613
|
+
}
|
|
3392
3614
|
function createDefaultWorkerEnvironmentPlugin() {
|
|
3393
3615
|
return {
|
|
3394
3616
|
name: "void:default-worker-environment",
|
|
3617
|
+
configureServer: {
|
|
3618
|
+
order: "pre",
|
|
3619
|
+
async handler(server) {
|
|
3620
|
+
await server.environments[DEFAULT_WORKER_ENVIRONMENT_NAME]?.depsOptimizer?.init();
|
|
3621
|
+
}
|
|
3622
|
+
},
|
|
3395
3623
|
config(config) {
|
|
3396
3624
|
const currentEnvironment = config.environments?.[DEFAULT_WORKER_ENVIRONMENT_NAME];
|
|
3397
3625
|
return { environments: { [DEFAULT_WORKER_ENVIRONMENT_NAME]: {
|
|
@@ -3569,6 +3797,8 @@ const envPublicFile = fileURLToPath(import.meta.resolve("#self/env"));
|
|
|
3569
3797
|
const voidDir = toSlash(import.meta.dirname);
|
|
3570
3798
|
const ASTRO_SERVER_ENTRY = "@astrojs/cloudflare/entrypoints/server";
|
|
3571
3799
|
const ASTRO_SCOPED_SERVER_ENTRY = "\0void:astro-server-entry";
|
|
3800
|
+
const ASTRO_HANDLER = "@astrojs/cloudflare/handler";
|
|
3801
|
+
const ASTRO_SCOPED_HANDLER = "\0void:astro-handler";
|
|
3572
3802
|
/**
|
|
3573
3803
|
* A define value as Vite writes it into code (its handleDefineValue): a string is code, anything
|
|
3574
3804
|
* else is JSON.
|
|
@@ -3720,35 +3950,41 @@ function createFrameworkPlugins(input) {
|
|
|
3720
3950
|
const astroServerEntryPlugin = detected.name === "astro" ? {
|
|
3721
3951
|
name: "void:astro-server-entry",
|
|
3722
3952
|
enforce: "pre",
|
|
3953
|
+
configEnvironment: {
|
|
3954
|
+
order: "post",
|
|
3955
|
+
handler(_name, environment, { command }) {
|
|
3956
|
+
if (command === "serve" && environment.resolve?.conditions?.includes("workerd") && !environment.optimizeDeps?.noDiscovery) return { optimizeDeps: { include: [ASTRO_HANDLER] } };
|
|
3957
|
+
}
|
|
3958
|
+
},
|
|
3723
3959
|
configResolved(resolvedConfig) {
|
|
3724
3960
|
astroDevTriggers = resolvedConfig.command === "serve" && hasOwnAstroMiddleware(root);
|
|
3725
3961
|
},
|
|
3726
3962
|
resolveId: {
|
|
3727
|
-
filter: { id: /^@astrojs\/cloudflare\/entrypoints\/server(?:\.js)
|
|
3728
|
-
handler(
|
|
3729
|
-
|
|
3730
|
-
return
|
|
3963
|
+
filter: { id: /^@astrojs\/cloudflare\/(?:entrypoints\/server(?:\.js)?|handler)$/ },
|
|
3964
|
+
handler(id, importer) {
|
|
3965
|
+
const scoped = id === ASTRO_HANDLER ? ASTRO_SCOPED_HANDLER : ASTRO_SCOPED_SERVER_ENTRY;
|
|
3966
|
+
if (!scopeAstroRequests && !astroDevTriggers || importer === scoped || this.environment?.name === "client") return;
|
|
3967
|
+
return scoped;
|
|
3731
3968
|
}
|
|
3732
3969
|
},
|
|
3733
3970
|
load: {
|
|
3734
|
-
filter: { id: /^\0void:astro-server-entry$/ },
|
|
3735
|
-
handler() {
|
|
3971
|
+
filter: { id: /^\0void:astro-(?:server-entry|handler)$/ },
|
|
3972
|
+
handler(id) {
|
|
3973
|
+
const wrapsHandle = id === ASTRO_SCOPED_HANDLER;
|
|
3974
|
+
const source = JSON.stringify(wrapsHandle ? ASTRO_HANDLER : ASTRO_SERVER_ENTRY);
|
|
3736
3975
|
const imports = [
|
|
3737
|
-
`import original from ${
|
|
3976
|
+
wrapsHandle ? `import { handle as original } from ${source};` : `import original from ${source};`,
|
|
3738
3977
|
...scopeAstroRequests ? [`import { withRuntimeEnv } from ${JSON.stringify(envModuleFile)};`] : [],
|
|
3739
3978
|
...astroDevTriggers ? [`import { handleDevTrigger } from ${JSON.stringify(frameworkTriggersDispatchPath(root))};`] : []
|
|
3740
3979
|
];
|
|
3741
|
-
const
|
|
3980
|
+
const callOriginal = wrapsHandle ? "original(request, env, ctx)" : "original.fetch(request, env, ctx)";
|
|
3981
|
+
const respond = astroDevTriggers ? `async () => (await handleDevTrigger(request, env, ctx)) ?? ${callOriginal}` : `() => ${callOriginal}`;
|
|
3982
|
+
const body = (indent) => `${indent}const respond = ${respond};\n${indent}return ${scopeAstroRequests ? "withRuntimeEnv(env, respond)" : "respond()"};`;
|
|
3983
|
+
const wrapped = wrapsHandle ? `export function handle(request, env, ctx) {\n${body(" ")}\n}` : `export default {\n ...original,\n fetch(request, env, ctx) {\n${body(" ")}\n },\n};`;
|
|
3742
3984
|
return `${imports.join("\n")}
|
|
3743
|
-
export * from ${
|
|
3985
|
+
export * from ${source};
|
|
3744
3986
|
|
|
3745
|
-
|
|
3746
|
-
...original,
|
|
3747
|
-
fetch(request, env, ctx) {
|
|
3748
|
-
const handle = ${handle};
|
|
3749
|
-
return ${scopeAstroRequests ? "withRuntimeEnv(env, handle)" : "handle()"};
|
|
3750
|
-
},
|
|
3751
|
-
};
|
|
3987
|
+
${wrapped}
|
|
3752
3988
|
`;
|
|
3753
3989
|
}
|
|
3754
3990
|
}
|
|
@@ -3896,7 +4132,7 @@ function honoMiddleware(getApp, isViteFile) {
|
|
|
3896
4132
|
* 4. Build — dual-environment build (client + SSR) for pages apps,
|
|
3897
4133
|
* single SSR build for API-only apps
|
|
3898
4134
|
*/
|
|
3899
|
-
function nodeTargetPlugin(target, options
|
|
4135
|
+
function nodeTargetPlugin(target, options) {
|
|
3900
4136
|
const unavailable = (id, root, importer) => {
|
|
3901
4137
|
const source = importer ? ` Imported by ${relative(root, importer)}.` : "";
|
|
3902
4138
|
return /* @__PURE__ */ new Error(`target: '${id}' is not available with target '${target}'. CF bindings require target: "cloudflare".${source}`);
|
|
@@ -3913,8 +4149,9 @@ function nodeTargetPlugin(target, options = {}) {
|
|
|
3913
4149
|
renderChunk(code, chunk) {
|
|
3914
4150
|
if (!code.includes("import.meta.voidClientDirectory")) return null;
|
|
3915
4151
|
const clientPath = relative(dirname(chunk.fileName), "../client");
|
|
4152
|
+
const precompressedPath = relative(dirname(chunk.fileName), PRECOMPRESSED_ASSET_DIR);
|
|
3916
4153
|
return {
|
|
3917
|
-
code: code.replaceAll("import.meta.voidClientDirectory", `new URL(${JSON.stringify(`${clientPath}/`)}, import.meta.url)`),
|
|
4154
|
+
code: code.replaceAll("import.meta.voidClientDirectory", `new URL(${JSON.stringify(`${clientPath}/`)}, import.meta.url)`).replaceAll("import.meta.voidPrecompressedDirectory", `new URL(${JSON.stringify(`${precompressedPath}/`)}, import.meta.url)`),
|
|
3918
4155
|
map: null
|
|
3919
4156
|
};
|
|
3920
4157
|
},
|
|
@@ -3956,8 +4193,13 @@ function nodeTargetPlugin(target, options = {}) {
|
|
|
3956
4193
|
};
|
|
3957
4194
|
},
|
|
3958
4195
|
async buildApp(builder) {
|
|
3959
|
-
|
|
3960
|
-
|
|
4196
|
+
const ssr = builder.environments.ssr;
|
|
4197
|
+
await builder.build(ssr);
|
|
4198
|
+
const client = builder.environments.client;
|
|
4199
|
+
if (client) {
|
|
4200
|
+
await builder.build(client);
|
|
4201
|
+
if (options.precompress && process.env.VOID_DEPLOY_BUILD !== "1") await precompressAssets(resolve(client.config.root, client.config.build.outDir, "assets"), resolve(ssr.config.root, ssr.config.build.outDir, PRECOMPRESSED_ASSET_DIR));
|
|
4202
|
+
}
|
|
3961
4203
|
},
|
|
3962
4204
|
configureServer(server) {
|
|
3963
4205
|
const assets = { async fetch(request) {
|
|
@@ -4168,9 +4410,9 @@ function isSameOriginNavigation(req) {
|
|
|
4168
4410
|
}
|
|
4169
4411
|
/**
|
|
4170
4412
|
* The toast is the only in-app way to reach `/__void/restarting`, so it is
|
|
4171
|
-
* the only place that knows the restart token. Vite's default
|
|
4172
|
-
* lets only localhost origins read this module, the same exposure as the
|
|
4173
|
-
*
|
|
4413
|
+
* the only place that knows the restart token. Vite's default CORS middleware
|
|
4414
|
+
* lets only localhost origins read this module, the same exposure as the HMR
|
|
4415
|
+
* token in `/@vite/client`. Void apps turn that middleware off by default.
|
|
4174
4416
|
*/
|
|
4175
4417
|
const clientModule = (token) => `if (import.meta.hot) {
|
|
4176
4418
|
const token = ${JSON.stringify(token)};
|
|
@@ -4322,9 +4564,14 @@ function isInDirectory(path, directory) {
|
|
|
4322
4564
|
* - Generates virtual modules for the route table and worker entry
|
|
4323
4565
|
* - Watches for file changes and triggers HMR
|
|
4324
4566
|
*/
|
|
4567
|
+
/** Mirrors the D1, KV and R2 bindings the managed deploy manifest declares. */
|
|
4568
|
+
function usesPlatformDataBindings(analysis) {
|
|
4569
|
+
return analysis.needsDatabase && analysis.dialect === "sqlite" || analysis.bindings.needsKV || analysis.bindings.needsR2;
|
|
4570
|
+
}
|
|
4325
4571
|
function routingPlugin(root, options) {
|
|
4326
4572
|
let scan = null;
|
|
4327
4573
|
let routeEnvironment = "prod";
|
|
4574
|
+
let platformBuild = false;
|
|
4328
4575
|
let previewing = false;
|
|
4329
4576
|
let ssr = null;
|
|
4330
4577
|
let authConfigPath = null;
|
|
@@ -4359,6 +4606,7 @@ function routingPlugin(root, options) {
|
|
|
4359
4606
|
const normalizedMiddlewareDir = normalizePath(middlewareDir);
|
|
4360
4607
|
const normalizedJobsDir = normalizePath(jobsDir);
|
|
4361
4608
|
const normalizedQueuesDir = normalizePath(queuesDir);
|
|
4609
|
+
const normalizedWorkflowsDir = normalizePath(join(root, "workflows"));
|
|
4362
4610
|
const normalizedEmailDir = normalizePath(emailDir);
|
|
4363
4611
|
const normalizedPagesDir = normalizePath(pagesDir);
|
|
4364
4612
|
const ssrEntryAbsPaths = new Set([...SSR_SERVER_ENTRY_RELATIVE_PATHS, ...SSR_CLIENT_ENTRY_RELATIVE_PATHS].map((path) => normalizePath(join(ssrDir, path.slice(path.lastIndexOf("/") + 1)))));
|
|
@@ -4383,6 +4631,7 @@ function routingPlugin(root, options) {
|
|
|
4383
4631
|
scan = nextScan;
|
|
4384
4632
|
authConfigPath = analysis.authConfigPath;
|
|
4385
4633
|
output = analysis.config.output;
|
|
4634
|
+
compileOptions.bindingHandlerPath = platformBuild && usesPlatformDataBindings(analysis) ? resolveFile("#self/remote/binding-handler") : void 0;
|
|
4386
4635
|
ssr = entries ? {
|
|
4387
4636
|
serverEntryPath: entries.server.absolutePath,
|
|
4388
4637
|
clientEntryRelativePath: entries.client.relativePath
|
|
@@ -4431,7 +4680,6 @@ function routingPlugin(root, options) {
|
|
|
4431
4680
|
nodeTarget: !!options.target,
|
|
4432
4681
|
managedDispatch: false,
|
|
4433
4682
|
explicitPrerenderPaths: options.prerenderPaths,
|
|
4434
|
-
bindingHandlerPath: options.target ? void 0 : resolveFile("#self/remote/binding-handler"),
|
|
4435
4683
|
bindingNames: options.bindingNames
|
|
4436
4684
|
};
|
|
4437
4685
|
let publicDir = join(root, "public");
|
|
@@ -4459,6 +4707,7 @@ function routingPlugin(root, options) {
|
|
|
4459
4707
|
authDatabasePath: join(outDir, "better-auth-db.ts"),
|
|
4460
4708
|
authSchemaPath: join(outDir, "better-auth-schema.ts"),
|
|
4461
4709
|
dialect,
|
|
4710
|
+
authDateType: getDatabaseAuthDateType(config),
|
|
4462
4711
|
providers: config.auth?.providers ?? null
|
|
4463
4712
|
};
|
|
4464
4713
|
}
|
|
@@ -4502,9 +4751,10 @@ function routingPlugin(root, options) {
|
|
|
4502
4751
|
if (removeAuthTypesIfPresent(outDir)) syncAuthTypesInProjectTsconfig(root);
|
|
4503
4752
|
return;
|
|
4504
4753
|
}
|
|
4505
|
-
const { generateVoidAuthDatabaseModule, generateVoidAuthDrizzleSchema } = await import("./drizzle-
|
|
4754
|
+
const { generateVoidAuthDatabaseModule, generateVoidAuthDrizzleSchema } = await import("./drizzle-CrkwVwK8.mjs");
|
|
4506
4755
|
const authRuntime = {
|
|
4507
4756
|
dialect: compileOptions.auth.dialect,
|
|
4757
|
+
authDateType: compileOptions.auth.authDateType,
|
|
4508
4758
|
providers: compileOptions.auth.providers,
|
|
4509
4759
|
userConfig: await loadAuthConfig(compileOptions.auth.authConfigPath)
|
|
4510
4760
|
};
|
|
@@ -4661,7 +4911,10 @@ function routingPlugin(root, options) {
|
|
|
4661
4911
|
runtimePath: sandboxRuntimePath
|
|
4662
4912
|
} : false;
|
|
4663
4913
|
function writeNodeEntries(target) {
|
|
4664
|
-
writeFileIfChanged(join(outDir, "app.ts"), compileNodeApp(target,
|
|
4914
|
+
writeFileIfChanged(join(outDir, "app.ts"), compileNodeApp(target, {
|
|
4915
|
+
precompress: options.precompress === true,
|
|
4916
|
+
envSchemaModule: getEnvSchemaModule()
|
|
4917
|
+
}));
|
|
4665
4918
|
writeFileIfChanged(join(outDir, "index.ts"), compileNodeServer(target));
|
|
4666
4919
|
}
|
|
4667
4920
|
/** Write the Cloudflare worker entry from the completed scan. */
|
|
@@ -4685,7 +4938,8 @@ function routingPlugin(root, options) {
|
|
|
4685
4938
|
dev: compileOptions.dev,
|
|
4686
4939
|
isr,
|
|
4687
4940
|
notFound: policy.assetConfig.not_found_handling ?? "none",
|
|
4688
|
-
durableObjects: options.durableObjects
|
|
4941
|
+
durableObjects: options.durableObjects,
|
|
4942
|
+
workflows: options.workflows
|
|
4689
4943
|
}));
|
|
4690
4944
|
}
|
|
4691
4945
|
const outDir = join(root, ".void");
|
|
@@ -4700,7 +4954,8 @@ function routingPlugin(root, options) {
|
|
|
4700
4954
|
envSchemaModule: getEnvSchemaModule(),
|
|
4701
4955
|
sandbox: sandboxEntry,
|
|
4702
4956
|
live: options.live,
|
|
4703
|
-
durableObjects: options.durableObjects
|
|
4957
|
+
durableObjects: options.durableObjects,
|
|
4958
|
+
workflows: options.workflows
|
|
4704
4959
|
}));
|
|
4705
4960
|
return {
|
|
4706
4961
|
name: "void:routing",
|
|
@@ -4740,6 +4995,7 @@ function routingPlugin(root, options) {
|
|
|
4740
4995
|
} } } : {};
|
|
4741
4996
|
compileOptions.hasLive = options.live !== void 0;
|
|
4742
4997
|
compileOptions.managedDispatch = !options.target && env.command === "build" && Boolean(process.env.VOID_DEPLOY_PROJECT_ID);
|
|
4998
|
+
platformBuild = !options.target && env.command === "build" && process.env["VOID_CLOUDFLARE_DEPLOY_BUILD"] !== "1";
|
|
4743
4999
|
if (env.command === "serve" && options.isAuthEnabled()) {
|
|
4744
5000
|
const resolvedAliases = [
|
|
4745
5001
|
"client",
|
|
@@ -4789,7 +5045,7 @@ function routingPlugin(root, options) {
|
|
|
4789
5045
|
if (!options.target) {
|
|
4790
5046
|
const migrationsDir = paths.migrationsDir;
|
|
4791
5047
|
if (existsSync(migrationsDir) || compileOptions.auth) {
|
|
4792
|
-
const { collectMigrations } = await import("./collect-
|
|
5048
|
+
const { collectMigrations } = await import("./collect-Aam0GwAU.mjs");
|
|
4793
5049
|
const { buildMigrationPlanBundle } = await import("./plan-CQ-N4gws.mjs");
|
|
4794
5050
|
const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
|
|
4795
5051
|
const dialect = getDatabaseDialect(readConfig(root));
|
|
@@ -4820,6 +5076,15 @@ function routingPlugin(root, options) {
|
|
|
4820
5076
|
watchChange(id) {
|
|
4821
5077
|
invalidateSourceAnalysis(id);
|
|
4822
5078
|
},
|
|
5079
|
+
transform: {
|
|
5080
|
+
filter: {
|
|
5081
|
+
id: /\.c[jt]s$/,
|
|
5082
|
+
code: /\b(?:exports|require)\b/
|
|
5083
|
+
},
|
|
5084
|
+
handler(code, id) {
|
|
5085
|
+
if (options.workflows?.length && this.environment.mode === "dev" && this.environment.config.resolve.conditions.includes("workerd") && isInDirectory(id, normalizedWorkflowsDir) && !relative(normalizedWorkflowsDir, id).split("/").includes("node_modules") && !parseSync(id, code).module.hasModuleSyntax) this.error(`workflows: ${relative(root, id)} is a CommonJS helper. Use an ES module (.mjs or .mts) with import and export for local Workflow development.`);
|
|
5086
|
+
}
|
|
5087
|
+
},
|
|
4823
5088
|
resolveId: {
|
|
4824
5089
|
filter: { id: RESOLVE_ID_FILTER },
|
|
4825
5090
|
handler(id) {
|
|
@@ -4856,9 +5121,13 @@ function routingPlugin(root, options) {
|
|
|
4856
5121
|
const authConfigChanged = isPotentialAuthConfigPath(normalizedPath);
|
|
4857
5122
|
if (authConfigChanged) authConfigStale = true;
|
|
4858
5123
|
const authImportCreated = event === "add" && authConfigStale && compileOptions.auth !== null;
|
|
4859
|
-
|
|
5124
|
+
const workflowChanged = options.workflows && isInDirectory(normalizedPath, normalizedWorkflowsDir);
|
|
5125
|
+
const rescanRoutes = isInDirectory(normalizedPath, normalizedRoutesDir) || isInDirectory(normalizedPath, normalizedMiddlewareDir) || isInDirectory(normalizedPath, normalizedJobsDir) || isInDirectory(normalizedPath, normalizedQueuesDir) || isInDirectory(normalizedPath, normalizedEmailDir) || isInDirectory(normalizedPath, normalizedPagesDir) || authConfigChanged || authImportCreated || isPotentialEnvFilePath(normalizedPath) || ssrEntryAbsPaths.has(normalizedPath);
|
|
5126
|
+
if (!workflowChanged && !rescanRoutes) return;
|
|
4860
5127
|
if (await regenerateInOrder(async () => {
|
|
4861
5128
|
invalidateSourceAnalysis(normalizedPath);
|
|
5129
|
+
if (workflowChanged && !isDeepStrictEqual(options.workflows, scanWorkflowModules(root))) return true;
|
|
5130
|
+
if (!rescanRoutes) return;
|
|
4862
5131
|
if (event !== "change" || authConfigChanged || isPotentialEnvFilePath(normalizedPath) || ssrEntryAbsPaths.has(normalizedPath)) generatedRouteInputs = void 0;
|
|
4863
5132
|
try {
|
|
4864
5133
|
await rescan(true);
|
|
@@ -5092,6 +5361,18 @@ function mergeWorkerBindings(resolved, input) {
|
|
|
5092
5361
|
if (config.ai?.gateway) vars.__VOID_AI_GATEWAY = config.ai.gateway;
|
|
5093
5362
|
result.vars = vars;
|
|
5094
5363
|
}
|
|
5364
|
+
if (bindings.needsBrowser && process.env.VOID_DEPLOY_BUILD !== "1" && typeof result.compatibility_date === "string") assertBrowserCompatibility(result.compatibility_date);
|
|
5365
|
+
const resolvedBrowser = resolved.browser;
|
|
5366
|
+
let browserBindingName = typeof resolvedBrowser === "object" && resolvedBrowser !== null && "binding" in resolvedBrowser && typeof resolvedBrowser.binding === "string" ? resolvedBrowser.binding : void 0;
|
|
5367
|
+
if (browserBindingName === void 0 && bindings.needsBrowser) {
|
|
5368
|
+
browserBindingName = bindingNames?.browser ?? "BROWSER";
|
|
5369
|
+
result.browser = { binding: browserBindingName };
|
|
5370
|
+
}
|
|
5371
|
+
if (browserBindingName !== void 0 && browserBindingName !== "BROWSER") {
|
|
5372
|
+
const vars = result.vars ?? {};
|
|
5373
|
+
vars.__VOID_BROWSER_BINDING = browserBindingName;
|
|
5374
|
+
result.vars = vars;
|
|
5375
|
+
}
|
|
5095
5376
|
const emailDevInboxBinding = workerConfig.assets?.binding ?? resolved.assets?.binding;
|
|
5096
5377
|
if (shouldInjectEmailDevInboxVar(routeEnvironment, bindings.needsEmail, emailDevInboxBinding)) {
|
|
5097
5378
|
const vars = result.vars ?? {};
|
|
@@ -5163,6 +5444,11 @@ function mergeWorkerBindings(resolved, input) {
|
|
|
5163
5444
|
}));
|
|
5164
5445
|
if (migrationAdditions.length > 0) result.migrations = [...existingMigrations, ...migrationAdditions];
|
|
5165
5446
|
}
|
|
5447
|
+
if (application.workflows.length) {
|
|
5448
|
+
const deployName = process.env["VOID_CLOUDFLARE_DEPLOY_BUILD"] === "1" && process.env["VOID_CLOUDFLARE_WORKER_NAME"];
|
|
5449
|
+
const { additions } = planWorkflows(resolved, application.workflows, deployName || (resolved.name ?? defaultCloudflareWorkerName(root)));
|
|
5450
|
+
if (additions.length) result.workflows = additions;
|
|
5451
|
+
}
|
|
5166
5452
|
if (bindings.needsSandbox && sandboxConfig) {
|
|
5167
5453
|
assertSandboxNamespaceConfig({
|
|
5168
5454
|
...resolved,
|
|
@@ -5256,10 +5542,9 @@ function voidPlugin(options) {
|
|
|
5256
5542
|
const root = process.cwd();
|
|
5257
5543
|
const directCloudflareDestination = readDeploymentPlatform(root) === "cloudflare";
|
|
5258
5544
|
if (directCloudflareDestination) selectVoidCloudflareLogin();
|
|
5259
|
-
warnIfPackageJsonIsNotEsm(root);
|
|
5260
5545
|
const devTriggerToken = isViteBuildOrPreview() ? crypto.randomUUID() : getOrCreateDevTriggerToken(root);
|
|
5261
5546
|
const config = readConfig(root);
|
|
5262
|
-
|
|
5547
|
+
const minifyWorkers = !isNodeTarget(config.target) && config.output !== "static";
|
|
5263
5548
|
const projectCloudflareConfigPath = !isNodeTarget(config.target) ? materializeCloudflareConfig(root) : void 0;
|
|
5264
5549
|
const cloudflareConfigPath = projectCloudflareConfigPath && existsSync(projectCloudflareConfigPath) ? projectCloudflareConfigPath : void 0;
|
|
5265
5550
|
let previewing = false;
|
|
@@ -5292,6 +5577,7 @@ function voidPlugin(options) {
|
|
|
5292
5577
|
}
|
|
5293
5578
|
};
|
|
5294
5579
|
let application = analyzeApplicationSync(root, { config });
|
|
5580
|
+
syncBindingTypes(root, config, application.workflows);
|
|
5295
5581
|
const { paths, dialect, bindingNames, authConfigPath } = application;
|
|
5296
5582
|
const analyses = /* @__PURE__ */ new Map();
|
|
5297
5583
|
const getApplicationAnalysis = (environment, refresh = false) => {
|
|
@@ -5336,10 +5622,26 @@ function voidPlugin(options) {
|
|
|
5336
5622
|
const websocketRoutes = framework ? [] : application.allWebsockets;
|
|
5337
5623
|
const durableObjects = application.durableObjects;
|
|
5338
5624
|
if (detected && durableObjects.length > 0) throw new Error("durable: durable-objects/ is currently supported in Void apps only, not framework adapter mode.");
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5625
|
+
const workflows = application.workflows;
|
|
5626
|
+
if (detected && workflows.length > 0) throw new Error(FRAMEWORK_WORKFLOWS_ERROR);
|
|
5627
|
+
const reservedResources = websocketRoutes.map(({ bindingName, className, filePath }) => ({
|
|
5628
|
+
bindingName,
|
|
5629
|
+
className,
|
|
5630
|
+
source: `WebSocket route '${filePath}'`
|
|
5631
|
+
}));
|
|
5632
|
+
for (const module of [...durableObjects, ...workflows]) {
|
|
5633
|
+
const { bindingName, className, filePath } = module;
|
|
5634
|
+
const existing = reservedResources.find((resource) => resource.bindingName === bindingName || resource.className === className);
|
|
5635
|
+
const sandboxCollision = sandboxConfig && (bindingName === sandboxConfig.binding || className === sandboxConfig.className);
|
|
5636
|
+
if (existing || sandboxCollision) {
|
|
5637
|
+
const source = "relativePath" in module ? `workflows: workflows/${module.relativePath}` : `durable: durable-objects/${filePath.split("/").pop()}`;
|
|
5638
|
+
throw new Error(`${source} conflicts with ${existing?.source ?? "the configured Sandbox binding or class"}. Rename the conflicting resource.`);
|
|
5639
|
+
}
|
|
5640
|
+
reservedResources.push({
|
|
5641
|
+
bindingName,
|
|
5642
|
+
className,
|
|
5643
|
+
source: `'${filePath}'`
|
|
5644
|
+
});
|
|
5343
5645
|
}
|
|
5344
5646
|
let websocketTombstones = [];
|
|
5345
5647
|
if (!isNodeTarget(config.target)) {
|
|
@@ -5350,12 +5652,8 @@ function voidPlugin(options) {
|
|
|
5350
5652
|
}
|
|
5351
5653
|
const existingLiveConfig = !isNodeTarget(config.target) ? readExistingLiveBindingConfig(root) : void 0;
|
|
5352
5654
|
const liveConfig = !isNodeTarget(config.target) ? bindings.needsLive ? resolveLiveBindingConfig(root, {
|
|
5353
|
-
reservedBindings:
|
|
5354
|
-
reservedClasses: [
|
|
5355
|
-
...websocketRoutes.map((route) => route.className),
|
|
5356
|
-
...durableObjects.map((module) => module.className),
|
|
5357
|
-
sandboxConfig?.className
|
|
5358
|
-
]
|
|
5655
|
+
reservedBindings: reservedResources.map(({ bindingName }) => bindingName),
|
|
5656
|
+
reservedClasses: [...reservedResources.map(({ className }) => className), sandboxConfig?.className]
|
|
5359
5657
|
}) : existingLiveConfig : void 0;
|
|
5360
5658
|
const shouldEmitLive = () => bindings.needsLive || existingLiveConfig !== void 0;
|
|
5361
5659
|
if (detected && (detected.class === "b" || detected.class === "c")) return createFrameworkPlugins({
|
|
@@ -5424,6 +5722,34 @@ function voidPlugin(options) {
|
|
|
5424
5722
|
function applyEnvSchema(facts) {
|
|
5425
5723
|
envSchemaFacts = facts;
|
|
5426
5724
|
}
|
|
5725
|
+
const workerMinifyPlugin = {
|
|
5726
|
+
name: "void:worker-minify",
|
|
5727
|
+
enforce: "post",
|
|
5728
|
+
apply: "build",
|
|
5729
|
+
configEnvironment: {
|
|
5730
|
+
order: "post",
|
|
5731
|
+
handler(name, { build }) {
|
|
5732
|
+
if (minifyWorkers && name === "void_worker" && build?.minify === void 0) return { build: { voidDefaultWorkerMinify: true } };
|
|
5733
|
+
}
|
|
5734
|
+
},
|
|
5735
|
+
outputOptions(output) {
|
|
5736
|
+
if (!minifyWorkers || this.environment.name !== "void_worker") return;
|
|
5737
|
+
const { build } = this.environment.config;
|
|
5738
|
+
if (build.minify !== false || build.lib || !("voidDefaultWorkerMinify" in build) || build.voidDefaultWorkerMinify !== true || output.minify !== "dce-only" && output.minify !== void 0) return;
|
|
5739
|
+
if ([build.rolldownOptions?.output, build.rollupOptions?.output].flat().some((options) => options?.minify !== void 0)) return;
|
|
5740
|
+
const keepNames = {
|
|
5741
|
+
function: true,
|
|
5742
|
+
class: true
|
|
5743
|
+
};
|
|
5744
|
+
return {
|
|
5745
|
+
...output,
|
|
5746
|
+
minify: output.keepNames === void 0 ? {
|
|
5747
|
+
compress: { keepNames },
|
|
5748
|
+
mangle: { keepNames }
|
|
5749
|
+
} : true
|
|
5750
|
+
};
|
|
5751
|
+
}
|
|
5752
|
+
};
|
|
5427
5753
|
const envPlugin = {
|
|
5428
5754
|
name: "void:env",
|
|
5429
5755
|
config(userConfig, { command, isPreview }) {
|
|
@@ -5451,15 +5777,19 @@ function voidPlugin(options) {
|
|
|
5451
5777
|
}
|
|
5452
5778
|
const assets = workerConfig.assets;
|
|
5453
5779
|
if (command === "serve" && !isPreview && assets?.run_worker_first?.includes("/**")) assets.run_worker_first = [...DEV_ASSET_ROUTING_EXCLUSIONS, "/**"];
|
|
5454
|
-
const
|
|
5455
|
-
|
|
5780
|
+
const turnOffViteCors = !framework && userConfig.server?.cors === void 0;
|
|
5781
|
+
const serverConfig = { server: {
|
|
5782
|
+
watch: { ignored },
|
|
5783
|
+
...turnOffViteCors && { cors: false }
|
|
5784
|
+
} };
|
|
5785
|
+
if (minifyWorkers) {
|
|
5456
5786
|
const envNames = framework === "vinext-app" ? ["rsc", "ssr"] : ["ssr"];
|
|
5457
5787
|
return {
|
|
5458
|
-
...
|
|
5788
|
+
...serverConfig,
|
|
5459
5789
|
environments: Object.fromEntries(envNames.map((n) => [n, { build: { minify: true } }]))
|
|
5460
5790
|
};
|
|
5461
5791
|
}
|
|
5462
|
-
return
|
|
5792
|
+
return serverConfig;
|
|
5463
5793
|
},
|
|
5464
5794
|
configureServer(server) {
|
|
5465
5795
|
if (remoteMode && (bindings.needsD1 || bindings.needsKV || bindings.needsR2)) {
|
|
@@ -5508,7 +5838,8 @@ function voidPlugin(options) {
|
|
|
5508
5838
|
name: "void:binding-watch",
|
|
5509
5839
|
apply: "serve",
|
|
5510
5840
|
configureServer(server) {
|
|
5511
|
-
const
|
|
5841
|
+
const effectiveDirs = scanDirs ?? [...DEFAULT_SCAN_DIRS, ...workflows.length > 0 ? ["workflows"] : []];
|
|
5842
|
+
const watchDirs = [.../* @__PURE__ */ new Set([...effectiveDirs, "src"])].map((d) => join(root, d));
|
|
5512
5843
|
let hintShown = false;
|
|
5513
5844
|
const check = (path) => {
|
|
5514
5845
|
if (hintShown) return;
|
|
@@ -5523,6 +5854,7 @@ function voidPlugin(options) {
|
|
|
5523
5854
|
if (fileBindings.needsAI && !bindings.needsAI) newBindings.push("AI (void/ai)");
|
|
5524
5855
|
if (fileBindings.needsSandbox && !bindings.needsSandbox) newBindings.push("Sandbox (void/sandbox)");
|
|
5525
5856
|
if (fileBindings.needsEmail && !bindings.needsEmail) newBindings.push("Email (void/email)");
|
|
5857
|
+
if (fileBindings.needsBrowser && !bindings.needsBrowser) newBindings.push("Browser Run (void/image)");
|
|
5526
5858
|
if (autoDetectAuth && fileBindings.needsAuth) newBindings.push("Auth (void/auth)");
|
|
5527
5859
|
if (newBindings.length > 0) {
|
|
5528
5860
|
hintShown = true;
|
|
@@ -5625,17 +5957,41 @@ function voidPlugin(options) {
|
|
|
5625
5957
|
frameworkBuildWrapperPlugin,
|
|
5626
5958
|
frameworkTriggersPlugin(root, { devTriggerToken }),
|
|
5627
5959
|
devTriggersHintPlugin(root, devTriggerToken),
|
|
5960
|
+
...framework === "react-router" ? [reactRouterEdgeEntryPlugin()] : [],
|
|
5628
5961
|
...cloudflare$1({
|
|
5629
5962
|
configPath: cloudflareConfigPath,
|
|
5630
5963
|
...inspectorPortOption,
|
|
5631
5964
|
persistState: { path: localD1.persistRoot },
|
|
5632
5965
|
auxiliaryWorkers: options?.auxiliaryWorkers,
|
|
5633
5966
|
viteEnvironment,
|
|
5634
|
-
config: mergeBindings
|
|
5967
|
+
config: mergeBindings,
|
|
5968
|
+
localQueueProducers: () => ({
|
|
5969
|
+
queues: application.queues,
|
|
5970
|
+
reserved: envSchemaFacts?.serverKeys ?? []
|
|
5971
|
+
})
|
|
5635
5972
|
}),
|
|
5636
5973
|
implicitDeployGuard
|
|
5637
5974
|
];
|
|
5638
5975
|
}
|
|
5976
|
+
const pagesClientInput = {
|
|
5977
|
+
name: "void:pages-client-input",
|
|
5978
|
+
apply: "build",
|
|
5979
|
+
applyToEnvironment: (environment) => environment.name !== "client",
|
|
5980
|
+
options: {
|
|
5981
|
+
order: "post",
|
|
5982
|
+
handler(options) {
|
|
5983
|
+
const { input } = options;
|
|
5984
|
+
if (input && typeof input === "object" && !Array.isArray(input) && input["pages-client"] === "virtual:void-pages-client") {
|
|
5985
|
+
const entries = { ...input };
|
|
5986
|
+
delete entries["pages-client"];
|
|
5987
|
+
return {
|
|
5988
|
+
...options,
|
|
5989
|
+
input: entries
|
|
5990
|
+
};
|
|
5991
|
+
}
|
|
5992
|
+
}
|
|
5993
|
+
}
|
|
5994
|
+
};
|
|
5639
5995
|
if (isNodeTarget(config.target)) {
|
|
5640
5996
|
if (authEnabled) throw new Error("auth: Void-managed Better Auth is only supported in Cloudflare Void apps. Use Better Auth directly for this target instead.");
|
|
5641
5997
|
if (config.inference?.bindings) voidWarn("\"inference.bindings\" in void.config.ts is ignored with target: \"" + config.target + "\"");
|
|
@@ -5644,6 +6000,7 @@ function voidPlugin(options) {
|
|
|
5644
6000
|
if (bindings.needsSandbox) throw new Error(`sandbox: Cloudflare Sandboxes require target: "cloudflare". They are not available with target: '${config.target}'.`);
|
|
5645
6001
|
if (bindings.needsLive) throw new Error(`live: void/live requires target: "cloudflare". It is not available with target: '${config.target}'.`);
|
|
5646
6002
|
if (durableObjects.length > 0) throw new Error(`durable: durable-objects/ requires target: "cloudflare". It is not available with target: '${config.target}'.`);
|
|
6003
|
+
if (workflows.length > 0) throw new Error(`workflows: workflows/ requires target: "cloudflare". It is not available with target: '${config.target}'.`);
|
|
5647
6004
|
if (hasInboundEmail) throw new Error(`email: inbound email handlers (email/) require target: "cloudflare". They are not available with target: '${config.target}'.`);
|
|
5648
6005
|
if (config.routing?.revalidate) voidWarn("\"routing.revalidate\" in void.config.ts is ignored with target: \"" + config.target + "\" (edge caching is CF-only)");
|
|
5649
6006
|
return [
|
|
@@ -5653,6 +6010,7 @@ function voidPlugin(options) {
|
|
|
5653
6010
|
serverRuntimeOptimizerPlugin,
|
|
5654
6011
|
envSchemaPlugin(root),
|
|
5655
6012
|
...pagesDevCssAssetsPlugin(root, devTriggerToken),
|
|
6013
|
+
pagesClientInput,
|
|
5656
6014
|
routingPlugin(root, {
|
|
5657
6015
|
getApplicationAnalysis,
|
|
5658
6016
|
isAuthEnabled: () => false,
|
|
@@ -5660,11 +6018,15 @@ function voidPlugin(options) {
|
|
|
5660
6018
|
headConfig: config.head,
|
|
5661
6019
|
prerenderPaths: config.routing?.prerender,
|
|
5662
6020
|
target: config.target,
|
|
6021
|
+
precompress: precompressesAssets(config),
|
|
5663
6022
|
routing: config.routing,
|
|
5664
6023
|
hasSandbox: false
|
|
5665
6024
|
}),
|
|
5666
6025
|
prerenderPlugin(root, config),
|
|
5667
|
-
...nodeTargetPlugin(config.target, {
|
|
6026
|
+
...nodeTargetPlugin(config.target, {
|
|
6027
|
+
trailingSlash: config.routing?.trailingSlash,
|
|
6028
|
+
precompress: precompressesAssets(config)
|
|
6029
|
+
})
|
|
5668
6030
|
];
|
|
5669
6031
|
}
|
|
5670
6032
|
const existingFlags = workerConfig.compatibility_flags ?? [];
|
|
@@ -5741,6 +6103,7 @@ function voidPlugin(options) {
|
|
|
5741
6103
|
return shouldEmitLive() ? liveConfig : void 0;
|
|
5742
6104
|
},
|
|
5743
6105
|
durableObjects,
|
|
6106
|
+
workflows,
|
|
5744
6107
|
websocketTombstones,
|
|
5745
6108
|
onDevAssetRoutingPolicyChange: updateDevAssetRoutingPolicy,
|
|
5746
6109
|
assetWorkerBypass: true
|
|
@@ -5748,6 +6111,7 @@ function voidPlugin(options) {
|
|
|
5748
6111
|
return [
|
|
5749
6112
|
createCloudflareBuiltinsExternalPlugin(),
|
|
5750
6113
|
createDefaultWorkerEnvironmentPlugin(),
|
|
6114
|
+
createHonoCompressionPlugin(),
|
|
5751
6115
|
createWorkerEnvironmentSanitizerPlugin([DEFAULT_WORKER_ENVIRONMENT_NAME]),
|
|
5752
6116
|
createWranglerCompatPersistPlugin(root, config),
|
|
5753
6117
|
devTriggerSecretGuardPlugin(),
|
|
@@ -5763,6 +6127,7 @@ function voidPlugin(options) {
|
|
|
5763
6127
|
bindingRuntimePlugin(bindingNames),
|
|
5764
6128
|
...bindings.needsSandbox ? [createSandboxSdkResolvePlugin()] : [],
|
|
5765
6129
|
...pagesDevCssAssetsPlugin(root, devTriggerToken),
|
|
6130
|
+
pagesClientInput,
|
|
5766
6131
|
routes,
|
|
5767
6132
|
drizzlePlugin(root, true, dialect, {
|
|
5768
6133
|
d1BindingName: bindingNames?.d1,
|
|
@@ -5789,7 +6154,8 @@ function voidPlugin(options) {
|
|
|
5789
6154
|
}
|
|
5790
6155
|
}),
|
|
5791
6156
|
prerenderPlugin(root, config),
|
|
5792
|
-
implicitDeployGuard
|
|
6157
|
+
implicitDeployGuard,
|
|
6158
|
+
workerMinifyPlugin
|
|
5793
6159
|
];
|
|
5794
6160
|
}
|
|
5795
6161
|
export { VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, resolveWorkersAiBindingName, shouldBindWorkersAi, shouldInjectEmailDevInboxVar, voidPlugin };
|