void 1.12.2 → 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-CdJQba_Q.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-D9MWA_dj.mjs → auth-link-I4omV0pL.mjs} +6 -6
- package/dist/{auth-router-FskgTU3B.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-DaLrQfPS.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-WG4TcR_d.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-BSuWV1PI.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-DtJeunLF.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-DoDqRH6i.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-B2VZ2Hut.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-jUBgfvzk.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-wML5HNfS.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-Bv3oQ2gE.mjs → platform-auth-config-BbfNhjBc.mjs} +9 -9
- package/dist/{platform-auth-protection-OqzfhXwx.mjs → platform-auth-protection-BHPV4MUf.mjs} +9 -8
- package/dist/{platform-auth-recovery-rmIYjXST.mjs → platform-auth-recovery-DE0nArYy.mjs} +8 -7
- package/dist/{platform-cmd-D_4z2Ijv.mjs → platform-cmd-CLRU3BRb.mjs} +11 -10
- package/dist/{platform-cmd-B3rO4RhU.mjs → platform-cmd-Cs2LkT5L.mjs} +1 -1
- package/dist/{platform-discovery-CLxtixHJ.mjs → platform-discovery-CKeeeD82.mjs} +1 -1
- package/dist/{platform-domain-CUq9odbd.mjs → platform-domain-kn3WuKPG.mjs} +6 -5
- package/dist/{platform-lifecycle-DOSYo0UI.mjs → platform-lifecycle-BoCEYy2w.mjs} +1 -1
- package/dist/{platform-lifecycle-DuoVruij.mjs → platform-lifecycle-CKwOg8wz.mjs} +164 -72
- package/dist/{platform-management-D_gt3qLb.mjs → platform-management-CaSdFthX.mjs} +1 -1
- package/dist/{platform-management-MmO9IubR.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-P_FVslfd.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 +10 -10
- 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-GT4CW5fs.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-BbSQTZ6d.mjs +0 -1
- package/dist/migrate-C9aoWLvY.mjs +0 -1
- package/dist/operator-cmd-jnjzuJKX.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
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Generate PNGs from HTML or JSX in a route handler.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Image Generation
|
|
7
|
+
|
|
8
|
+
Return an `ImageResponse` from a route to draw a PNG with HTML and CSS.
|
|
9
|
+
|
|
10
|
+
## Draw a badge {#usage}
|
|
11
|
+
|
|
12
|
+
Read the badge label from the URL and put it in an `html` template:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// routes/badge.png.ts
|
|
16
|
+
import { defineHandler } from 'void';
|
|
17
|
+
import { html } from 'void/html';
|
|
18
|
+
import { ImageResponse } from 'void/image';
|
|
19
|
+
|
|
20
|
+
export const GET = defineHandler((c) => {
|
|
21
|
+
const label = c.req.query('label') ?? 'Built with Void';
|
|
22
|
+
return new ImageResponse(
|
|
23
|
+
html`<div style="padding: 12px; background: #0f172a; color: white; font-size: 28px">
|
|
24
|
+
${label}
|
|
25
|
+
</div>`,
|
|
26
|
+
{ width: 320, height: 64 },
|
|
27
|
+
);
|
|
28
|
+
});
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Open `/badge.png?label=Preview` to see a 320 × 64 badge that reads “Preview”. The [`html` tag](../reference/api/html.md) escapes the label, so text like `<Preview>` appears as written. For a social preview, use [`OgImageResponse`](./og-images.md) to get the standard 1200 × 630 size.
|
|
32
|
+
|
|
33
|
+
## Rendering with JSX {#jsx-types}
|
|
34
|
+
|
|
35
|
+
To draw a favicon with Hono JSX, add `/** @jsxImportSource void/jsx */` at the top of the `.tsx` route. This works alongside a React, Vue, Svelte, or Solid app without changing how your pages render.
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
/** @jsxImportSource void/jsx */
|
|
39
|
+
// routes/favicon.png.tsx
|
|
40
|
+
import { ImageResponse } from 'void/image';
|
|
41
|
+
|
|
42
|
+
export const GET = () =>
|
|
43
|
+
new ImageResponse(
|
|
44
|
+
<div style={{ background: '#0f172a', color: 'white', fontSize: 48, textAlign: 'center' }}>
|
|
45
|
+
V
|
|
46
|
+
</div>,
|
|
47
|
+
{ width: 64, height: 64 },
|
|
48
|
+
);
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
To use Hono JSX for every `.tsx` file, set `jsxImportSource` in your [TypeScript and Vite config](./server-routing.md#jsx-handlers). Image routes accept Hono elements and `html` templates, including async templates. Use `ImageInput` to type shared card content.
|
|
52
|
+
|
|
53
|
+
## Where images render {#setup}
|
|
54
|
+
|
|
55
|
+
Void uses local Chromium in development, preview, and [prerendering](./edge/prerendering.md). Importing `void/image` adds a Browser Run binding named `BROWSER` for deployment.
|
|
56
|
+
|
|
57
|
+
- **Your Cloudflare account:** `void deploy --platform cloudflare` uses your account’s [Browser Run allowance](https://developers.cloudflare.com/browser-run/limits/). [Quick Actions](https://developers.cloudflare.com/browser-run/quick-actions/) require a Worker compatibility date of `2026-03-24` or later. If your app pins an older date, update `worker.compatibility_date` in `void.config.ts`.
|
|
58
|
+
- **A Void platform:** each render counts toward your account’s [monthly browser time](./platform/administration/plans.md) and your app’s request rate. The binding supports Quick Actions on the default browser, except `json`. For Browser Sessions, deploy to your own Cloudflare account. If the platform predates Browser Run support, ask its administrator to upgrade before deploying.
|
|
59
|
+
|
|
60
|
+
To test against your Cloudflare account during development, run `void connect --platform cloudflare` and set `remote: true`:
|
|
61
|
+
|
|
62
|
+
```ts
|
|
63
|
+
// void.config.ts
|
|
64
|
+
import { defineConfig } from 'void/config';
|
|
65
|
+
|
|
66
|
+
export default defineConfig({
|
|
67
|
+
cloudflare: { browser: { binding: 'BROWSER', remote: true } },
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Await rendering
|
|
72
|
+
|
|
73
|
+
Use `renderImage()` when you need the PNG bytes, for example to save the badge to storage or return a fallback if rendering fails:
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
import { html } from 'void/html';
|
|
77
|
+
import { renderImage } from 'void/image';
|
|
78
|
+
|
|
79
|
+
export function renderBadge(label: string) {
|
|
80
|
+
return renderImage(html`<strong>${label}</strong>`, { width: 320, height: 64 });
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Call `await renderBadge(label)` in your handler to catch a rendering error before sending headers. An `ImageResponse` starts rendering when its body is read, after the handler has returned. In a Void handler or Pages action, an uncaught `UsageLimit` from `void/limits` returns HTTP 429. A platform rate limit includes `retryAt`. A monthly quota resets at the next billing period.
|
|
85
|
+
|
|
86
|
+
## Options
|
|
87
|
+
|
|
88
|
+
For shared options, import `RenderImageOptions` or `ImageResponseOptions` from `void/image`.
|
|
89
|
+
|
|
90
|
+
| Option | Behavior |
|
|
91
|
+
| --------------------------------- | ------------------------------------------------------------------------------------ |
|
|
92
|
+
| `width`, `height` | Required image dimensions in pixels. Use positive integers. |
|
|
93
|
+
| `font`, `fonts` | Select a font family or fallback stack and supply custom faces. See [Fonts](#fonts). |
|
|
94
|
+
| `lang` | Set the document language, for example `'ja'`. |
|
|
95
|
+
| `debug` | Set to `true` to outline each element. |
|
|
96
|
+
| `status`, `statusText`, `headers` | HTTP options for `ImageResponse`. The content type defaults to `image/png`. |
|
|
97
|
+
|
|
98
|
+
### CSS and images
|
|
99
|
+
|
|
100
|
+
Use inline CSS or a `<style>` block. The browser does not run JavaScript. Use public HTTPS URLs or data URLs for images. If a request supplies an image URL, check that it points to a source you trust.
|
|
101
|
+
|
|
102
|
+
## Fonts
|
|
103
|
+
|
|
104
|
+
Text uses Roboto by default. Choose a [preinstalled family](https://developers.cloudflare.com/browser-run/reference/supported-fonts/) or supply a font file as bytes (`ArrayBuffer` or `Uint8Array`) or an HTTPS URL. Set `font` to the name you gave the face:
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { html } from 'void/html';
|
|
108
|
+
import { ImageResponse } from 'void/image';
|
|
109
|
+
|
|
110
|
+
export function brandBadge(label: string) {
|
|
111
|
+
return new ImageResponse(html`<strong>${label}</strong>`, {
|
|
112
|
+
width: 320,
|
|
113
|
+
height: 64,
|
|
114
|
+
fonts: [{ name: 'Brand', data: { url: 'https://example.com/fonts/brand.woff2' } }],
|
|
115
|
+
font: ['Brand', 'Roboto', 'sans-serif'],
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
If you use Google Fonts, use the font file URL. Set `weight` (1–1000) for a single weight or omit it for a variable face. Use `style: 'italic'` for an italic face. Emoji use the browser’s system fonts.
|
|
121
|
+
|
|
122
|
+
## Cache generated images
|
|
123
|
+
|
|
124
|
+
`ImageResponse` leaves caching to your route. To reuse the badge at the edge for a day and keep a separate image for each label, add the route and its query parameter to your [revalidation settings](./edge/revalidation.md):
|
|
125
|
+
|
|
126
|
+
```ts
|
|
127
|
+
// void.config.ts
|
|
128
|
+
import { defineConfig } from 'void/config';
|
|
129
|
+
|
|
130
|
+
export default defineConfig({
|
|
131
|
+
routing: {
|
|
132
|
+
revalidate: { '/badge.png': 86400 },
|
|
133
|
+
revalidateQueryAllowlist: { '/badge.png': ['label'] },
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Void skips paths under `/api`. For an image that changes with a query parameter, list that parameter as above or put the value in the path.
|
|
139
|
+
|
|
140
|
+
## Third-party renderers {#third-party-renderer}
|
|
141
|
+
|
|
142
|
+
Pass a `renderer` to use another backend, such as [void-image-takumi](https://github.com/yangshun/void-image-takumi) for browser-free rendering. If every image in your app uses a third-party renderer, set [`inference.bindings.browser`](../reference/config.md#inference-bindings) to `false` to leave out the Browser Run binding.
|
package/docs/guide/index.md
CHANGED
|
@@ -5,23 +5,32 @@ outline: deep
|
|
|
5
5
|
|
|
6
6
|
# What is Void?
|
|
7
7
|
|
|
8
|
-
Void is a full-stack framework for Cloudflare Workers, powered by Vite.
|
|
8
|
+
Void is a full-stack framework for Cloudflare Workers, powered by Vite. You can build pages with React, Vue, Svelte, or Solid and write the server code they call in the same project.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
To create your first app, follow the [Quickstart](./quickstart.md). If you already use a framework like Nuxt or TanStack Start, start with its [integration guide](../integrations/frameworks/overview.md).
|
|
11
11
|
|
|
12
12
|
## Server routes and pages
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Imagine you’re building a directory of people. Once you’ve defined a `users` table in your [database schema](./database.md#schema-definition), you can serve their names at `/api/users` by creating this file:
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
```ts
|
|
17
|
+
// routes/api/users.ts
|
|
18
|
+
import { users } from '@schema';
|
|
19
|
+
import { defineHandler } from 'void';
|
|
20
|
+
import { db } from 'void/db';
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
export const GET = defineHandler(async () => {
|
|
23
|
+
return await db.select({ name: users.name }).from(users);
|
|
24
|
+
});
|
|
25
|
+
```
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
The file gives the route its URL. The query gives it a response type. When you call the route with [typed fetch](./typed-fetch.md), TypeScript knows that each item has a `name`. If you rename that field, your editor shows you which callers need updating.
|
|
28
|
+
|
|
29
|
+
To render a page at `/users`, put an `index` component in `pages/users/`. Its companion `index.server.ts` can export a **loader** that reads the users and returns typed props to the component. Add an **action** there when you want a form to save a new user. See [Pages routing](./pages-routing/overview.md) for a complete example. You can also use [server routes](./server-routing.md) with your own client-side router or build an API on its own.
|
|
21
30
|
|
|
22
|
-
|
|
31
|
+
## Resources from your code
|
|
23
32
|
|
|
24
|
-
|
|
33
|
+
In the example above, importing `db` tells Void that the app needs a database. With the default D1 database, you can work on the directory locally, then let Void provision its database when you deploy. Use [KV](./kv.md) to store a value by key, [object storage](./storage.md) for files, or a [queue](./queues.md) to process work in the background.
|
|
25
34
|
|
|
26
35
|
## From local development to production
|
|
27
36
|
|
|
@@ -30,10 +39,3 @@ Vite runs your app locally with Cloudflare's runtime. `void deploy` builds it, p
|
|
|
30
39
|
Deploy to [your own Cloudflare account](./deployment.md#deploy-to-cloudflare), or connect to a [Void platform](./self-hosted-platform.md) run by your team. Both use the same application APIs. A platform adds shared access, deployment history, and administration.
|
|
31
40
|
|
|
32
41
|
Void also deploys [existing frameworks and static sites](./app-types.md). Your framework keeps its routing and rendering; Void handles resources and deployment.
|
|
33
|
-
|
|
34
|
-
## Next steps
|
|
35
|
-
|
|
36
|
-
- [Quickstart](./quickstart.md): create your first app
|
|
37
|
-
- [Pages Routing](./pages-routing/overview.md): loaders, layouts, and forms
|
|
38
|
-
- [Database](./database.md): schemas, queries, and migrations
|
|
39
|
-
- [Deployment](./deployment.md): Cloudflare, team platforms, and CI
|
package/docs/guide/jobs.md
CHANGED
|
@@ -62,7 +62,7 @@ Content-Type: application/json
|
|
|
62
62
|
|
|
63
63
|
Set `cron` to an expression exported by your job. A successful call returns `{ "ok": true }`.
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Start the dev server and copy the `curl` command it prints. It includes the port and trigger token. You can run the job from a native Void app or a supported framework this way. The trigger is available only on the dev server.
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
68
|
curl -X POST http://localhost:5173/__void/scheduled \
|
|
@@ -71,10 +71,8 @@ curl -X POST http://localhost:5173/__void/scheduled \
|
|
|
71
71
|
-d '{"cron":"0 * * * *","scheduledTime":'"$(date +%s000)"'}'
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
The endpoint works in native Void apps and supported frameworks. Framework jobs run in the adapter's development runtime and use the bindings it provides.
|
|
75
|
-
|
|
76
74
|
## Deployment behavior
|
|
77
75
|
|
|
78
|
-
|
|
76
|
+
To trigger a framework job manually on a direct Cloudflare deployment, set `CRON_SECRET` and send its value in the `x-void-internal` header of a POST to `/__void/scheduled`.
|
|
79
77
|
|
|
80
78
|
On a Void platform, each project can use up to 100 different cron expressions and 1,000 schedules (each expression a job exports counts as one schedule). Jobs that share an expression count once toward the expression limit. When you deploy to your own Cloudflare account, Cloudflare's [Cron Trigger limits](https://developers.cloudflare.com/workers/platform/limits/) apply instead.
|
package/docs/guide/kv.md
CHANGED
|
@@ -26,7 +26,7 @@ Values are automatically parsed as JSON. If the stored value isn't valid JSON, t
|
|
|
26
26
|
await kv.put('user:123', { name: 'Alice', role: 'admin' });
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
`get()` preserves the type you stored with `put()`, including strings such as `"123"` and `"null"`.
|
|
30
30
|
|
|
31
31
|
Add a TTL (in seconds) or absolute expiration (Unix timestamp):
|
|
32
32
|
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: 'Give each post its own social preview image.'
|
|
3
|
+
outline: deep
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Open Graph Images
|
|
7
|
+
|
|
8
|
+
When someone shares a post, the social app reads the page’s `og:image` tag and fetches that URL. Give each post an image route so its preview shows the right title and author.
|
|
9
|
+
|
|
10
|
+
## Create the image route {#usage}
|
|
11
|
+
|
|
12
|
+
Return an `OgImageResponse` from `routes/og/[slug].ts`. It renders the same [HTML templates](../reference/api/html.md) and [Hono JSX](./image-generation.md#jsx-types) as `ImageResponse`, with a default size of 1200 × 630.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
// routes/og/[slug].ts
|
|
16
|
+
import { defineHandler } from 'void';
|
|
17
|
+
import { html } from 'void/html';
|
|
18
|
+
import { OgImageResponse } from 'void/image';
|
|
19
|
+
import { getPost } from '../../src/posts.ts';
|
|
20
|
+
|
|
21
|
+
export const GET = defineHandler(async (c) => {
|
|
22
|
+
const slug = c.req.param('slug');
|
|
23
|
+
const post = slug && (await getPost(slug));
|
|
24
|
+
if (!post) {
|
|
25
|
+
return c.notFound();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return new OgImageResponse(
|
|
29
|
+
html`<article style="height: 100%; padding: 80px; background: #0f172a; color: white">
|
|
30
|
+
<h1 style="font-size: 72px">${post.title}</h1>
|
|
31
|
+
<p style="font-size: 36px">${post.author}</p>
|
|
32
|
+
</article>`,
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Open `/og/hello-world` to see the PNG for the post with slug `hello-world`. The image URL must be accessible without signing in so social apps can fetch it. See [where images render](./image-generation.md#setup) for local development and deployment.
|
|
38
|
+
|
|
39
|
+
## Add the image to a page
|
|
40
|
+
|
|
41
|
+
If your loader returns a `post`, use it in [`head()`](./pages-routing/head.md) to give the page and its preview the same title. Set `og:image` to the route you just created:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
// pages/posts/[slug].server.ts
|
|
45
|
+
import { defineHead } from 'void';
|
|
46
|
+
|
|
47
|
+
interface Props {
|
|
48
|
+
post: { title: string; slug: string; description: string; author: string };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const head = defineHead<Props>((c, { post }) => ({
|
|
52
|
+
title: post.title,
|
|
53
|
+
meta: [
|
|
54
|
+
{ property: 'og:type', content: 'article' },
|
|
55
|
+
{ property: 'og:title', content: post.title },
|
|
56
|
+
{ property: 'og:description', content: post.description },
|
|
57
|
+
{ property: 'og:url', content: c.req.url },
|
|
58
|
+
{ property: 'og:image', content: `/og/${encodeURIComponent(post.slug)}` },
|
|
59
|
+
{ property: 'og:image:width', content: '1200' },
|
|
60
|
+
{ property: 'og:image:height', content: '630' },
|
|
61
|
+
{ property: 'og:image:alt', content: `${post.title} by ${post.author}` },
|
|
62
|
+
{ name: 'twitter:card', content: 'summary_large_image' },
|
|
63
|
+
],
|
|
64
|
+
}));
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Void expands the image path to an absolute URL using the incoming request. For a [prerendered page](./pages-routing/head.md#absolute-crawler-urls), supply the full public URL because there’s no request at build time.
|
|
68
|
+
|
|
69
|
+
## Image sizes
|
|
70
|
+
|
|
71
|
+
The default size works for most landscape previews. To make a square thumbnail, pass `{ width: 600, height: 600 }` as the second argument. Update the dimensions in the page metadata too. For a square X card, use `twitter:card="summary"`.
|
|
72
|
+
|
|
73
|
+
If one service needs a different crop, give it its own route and point its image tag there. For example, `twitter:image` can point to a 1200 × 600 card while `og:image` points to the 1200 × 630 version for other services.
|
|
74
|
+
|
|
75
|
+
## Caching
|
|
76
|
+
|
|
77
|
+
In production, `OgImageResponse` sets `Cache-Control: public, max-age=86400`. A browser can reuse the same URL for 24 hours. Social apps may keep a preview longer. When a cover changes and you need readers to see it right away, give it a new URL and update `og:image`. Purging Void’s cache won’t remove a social app’s copy.
|
|
78
|
+
|
|
79
|
+
Override `headers` to choose a different lifetime. Development has no default cache header. To avoid rendering again when another visitor requests the same cover, [cache the route at the edge](./image-generation.md#cache-generated-images).
|
|
80
|
+
|
|
81
|
+
## Await rendering
|
|
82
|
+
|
|
83
|
+
Use `renderOgImage(content, options?)` when you need bytes instead of an HTTP response. It takes the same [rendering options](./image-generation.md#options) and defaults to 1200 × 630. Await it to [handle a rendering error](./image-generation.md#await-rendering) before sending headers. If you return the bytes in a `Response`, set its content type and cache policy.
|
|
@@ -34,9 +34,9 @@ Middleware does not run again after the action. To change [shared data](./layout
|
|
|
34
34
|
|
|
35
35
|
## Form
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
A `Form` submits the values you manage with `useForm`. For example, the form below sends a name and email address to the `/users` action. If the action rejects the email, the user can correct it and submit again without retyping their name.
|
|
38
38
|
|
|
39
|
-
Import `Form` from your adapter
|
|
39
|
+
Import `Form` from your adapter and pass it the `form` object. The default method is `"post"`. Set `method` to `"put"`, `"patch"`, or `"delete"` for other actions.
|
|
40
40
|
|
|
41
41
|
## `useForm`
|
|
42
42
|
|
|
@@ -133,7 +133,9 @@ export default function CreateUser() {
|
|
|
133
133
|
|
|
134
134
|
:::
|
|
135
135
|
|
|
136
|
-
The
|
|
136
|
+
The validator in `index.server.ts` supplies the types for `name` and `email`. Without a validator you still get URL completion, and the body type is `Record<string, unknown>`.
|
|
137
|
+
|
|
138
|
+
`Form` displays `form.error` in an alert above the inputs. If there’s no action error, it joins the field messages from `form.errors` in the same alert. Use `renderError` to customize the action-error text (a snippet in Svelte). Field messages still appear in the alert.
|
|
137
139
|
|
|
138
140
|
### `useForm` API
|
|
139
141
|
|
|
@@ -156,7 +158,7 @@ The types are inferred from your action's `withValidator()` schema in the compan
|
|
|
156
158
|
| `clearErrors(...fields)` | Clear validation errors. Field names autocomplete. Clearing a parent field also clears the errors of its nested fields. |
|
|
157
159
|
| `clearError()` | Clear `error`. |
|
|
158
160
|
|
|
159
|
-
|
|
161
|
+
For a nested field, call `form.setError('profile.name', 'Please enter a name')`. Editing that name clears its error and keeps errors on other fields. Call `form.clearErrors('profile')` to clear errors on the whole profile.
|
|
160
162
|
|
|
161
163
|
For a native React form, use `form.post`, `form.put`, `form.patch`, or `form.delete` as a native form action. For an awaitable mutation, use `action()`. In Vue, Svelte, and Solid, form submissions return `Promise<void>`; catch thrown errors or use your framework's error handling.
|
|
162
164
|
|
|
@@ -92,9 +92,7 @@ Action errors that reach a client boundary keep their HTTP status and public mes
|
|
|
92
92
|
|
|
93
93
|
## HTTP exceptions
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
A suspended account can return `403` with an explanation.
|
|
95
|
+
If a suspended user visits the account page, you can explain why they can’t open it. Throw an `HTTPException` from the loader with the status and message you want them to see.
|
|
98
96
|
|
|
99
97
|
```ts
|
|
100
98
|
// pages/account.server.ts
|
|
@@ -114,11 +112,29 @@ Error components handle these exceptions on page GET and HEAD requests. API rout
|
|
|
114
112
|
|
|
115
113
|
Use [`c.status()`](./loaders.md#response-status) instead when you want an error status while rendering the requested page with its normal props.
|
|
116
114
|
|
|
115
|
+
Void renders the error inside the layouts at or above the `_error` file, including named layouts. With `layout = false`, the error renders on its own. To keep a section’s navigation visible, put an `_error` in that section.
|
|
116
|
+
|
|
117
117
|
## Nested errors
|
|
118
118
|
|
|
119
119
|
Put an error component in a subdirectory to customize that section. Void uses the closest one and keeps its surrounding layouts. If a layout fails, an error component outside that layout handles it. If an error component fails, Void tries an outer one, then its built-in error page.
|
|
120
120
|
|
|
121
|
-
Boundary components don't
|
|
121
|
+
Boundary components don't define routes, so you can still use `/error` and `/not-found` for ordinary pages. They support `.dev` and `.prod` variants but have no loader, actions, or `layout` export.
|
|
122
|
+
|
|
123
|
+
## Page titles
|
|
124
|
+
|
|
125
|
+
Export [`head()`](./head.md) from `_error.server.ts` or `_not-found.server.ts` to give the error page its own title. It receives the same `error` as the component:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
// pages/_error.server.ts (or pages/_not-found.server.ts)
|
|
129
|
+
import { defineHead } from 'void/handler';
|
|
130
|
+
import type { ErrorPageProps } from 'void/pages';
|
|
131
|
+
|
|
132
|
+
export const head = defineHead<ErrorPageProps>((c, { error }) => ({
|
|
133
|
+
title: error.status === 404 ? 'Page not found' : 'Something went wrong',
|
|
134
|
+
}));
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
The companion file can export only `head()`. If it throws or omits `title`, Void uses `Not Found` or `Internal Server Error`. Your [page title template](./head.md#page-title-templates) applies in either case.
|
|
122
138
|
|
|
123
139
|
## Recovery
|
|
124
140
|
|
|
@@ -38,7 +38,7 @@ export const head = defineHead<Props>((c, props) => {
|
|
|
38
38
|
});
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
`head()` runs server-side only, after the loader resolves.
|
|
41
|
+
`head()` runs server-side only, after the loader resolves. To give each post a preview with its own title and author, see [Open Graph Images](../og-images.md).
|
|
42
42
|
|
|
43
43
|
## Site defaults
|
|
44
44
|
|
|
@@ -100,7 +100,7 @@ To drop the suffix entirely for a section, including the config's, set the templ
|
|
|
100
100
|
|
|
101
101
|
## Page title templates
|
|
102
102
|
|
|
103
|
-
|
|
103
|
+
Our title template adds the site name to every page. The home page already includes it, so we can skip the suffix on that page by returning an empty `titleTemplate` from `head()`.
|
|
104
104
|
|
|
105
105
|
```ts
|
|
106
106
|
// pages/index.server.ts
|
|
@@ -112,7 +112,7 @@ export const head = defineHead(() => ({
|
|
|
112
112
|
}));
|
|
113
113
|
```
|
|
114
114
|
|
|
115
|
-
|
|
115
|
+
The browser tab now reads `My Site | Guides and Tutorials`. Other pages still use `%s | My Site`. You can also give a page its own template, such as `%s - Docs`, to override both the middleware and site defaults.
|
|
116
116
|
|
|
117
117
|
## Precedence
|
|
118
118
|
|
|
@@ -179,7 +179,7 @@ interface HeadDescriptor {
|
|
|
179
179
|
|
|
180
180
|
## Markdown pages
|
|
181
181
|
|
|
182
|
-
Markdown pages (`.md` files)
|
|
182
|
+
Markdown pages (`.md` files) generate head tags from frontmatter:
|
|
183
183
|
|
|
184
184
|
```md
|
|
185
185
|
---
|
|
@@ -196,4 +196,4 @@ This produces `<title>Getting Started</title>` and `<meta name="description" con
|
|
|
196
196
|
|
|
197
197
|
Titles, meta tags, and links update automatically on client-side navigation.
|
|
198
198
|
|
|
199
|
-
`script`, `htmlAttrs`, and `bodyAttrs` are SSR-only.
|
|
199
|
+
`script`, `htmlAttrs`, and `bodyAttrs` are SSR-only.
|
|
@@ -172,6 +172,8 @@ Import attributes require `"module": "ESNext"` in your `tsconfig.json`:
|
|
|
172
172
|
|
|
173
173
|
## Hydration Strategies
|
|
174
174
|
|
|
175
|
+
In Svelte, put `<svelte:head>` in a page or layout. If multiple copies of an island each set head tags, Svelte can remount an island during hydration and reset its inputs.
|
|
176
|
+
|
|
175
177
|
The `island` attribute value controls _when_ the component hydrates:
|
|
176
178
|
|
|
177
179
|
| Strategy | Hydrates when... | Use case |
|
|
@@ -353,26 +355,14 @@ Successful submissions reload the page; redirects navigate to their destination.
|
|
|
353
355
|
|
|
354
356
|
## Navigation
|
|
355
357
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
```tsx
|
|
359
|
-
// ✅ Use regular links in island pages
|
|
360
|
-
<a href="/blog/my-post">Read more</a>
|
|
361
|
-
|
|
362
|
-
// ❌ Don't use <Link>; there is no Void Router to handle it
|
|
363
|
-
<Link href="/blog/my-post">Read more</Link>
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
When navigating _from_ a regular page to an island page (e.g., via `<Link>`), the router detects that the target is an island page and falls back to a full-page navigation automatically.
|
|
358
|
+
Use HTML links such as `<a href="/blog/my-post">Read more</a>` on island pages. Navigating to or from an island page loads a new document.
|
|
367
359
|
|
|
368
360
|
## Layouts
|
|
369
361
|
|
|
370
|
-
Island pages
|
|
362
|
+
Island pages use the same [layouts](./layouts) as regular pages. Their layouts render as static HTML.
|
|
371
363
|
|
|
372
364
|
## Mixing Island and Regular Pages
|
|
373
365
|
|
|
374
366
|
Island pages and regular pages can coexist in the same app:
|
|
375
367
|
|
|
376
368
|
<FileTree :items="mixedItems" adapter-tabs default-expanded />
|
|
377
|
-
|
|
378
|
-
The Void Router handles navigation between regular pages. Navigating to or from an island page triggers a full-page load.
|
|
@@ -289,7 +289,7 @@ Wrap your markdown content in a `.void-md` element to scope the styles:
|
|
|
289
289
|
The theme covers:
|
|
290
290
|
|
|
291
291
|
- **Prose:** headings, paragraphs, lists, blockquotes, tables, inline code, links, horizontal rules, task lists, `<kbd>`, `<mark>`, definition lists, and footnotes. Dark mode works through `prefers-color-scheme` and the `data-theme` attribute.
|
|
292
|
-
- **Code blocks:**
|
|
292
|
+
- **Code blocks:** highlighted code follows the page’s light or dark theme.
|
|
293
293
|
- **Containers:** styles for `:::tip`, `:::warning`, `:::danger`, `:::info`, and `:::details`.
|
|
294
294
|
- **GitHub alerts:** support for `> [!NOTE]`, `> [!TIP]`, `> [!WARNING]`, and similar syntax.
|
|
295
295
|
|
|
@@ -371,7 +371,7 @@ Custom titles work too: `::: tip Pro Tip`.
|
|
|
371
371
|
|
|
372
372
|
### Syntax Highlighting
|
|
373
373
|
|
|
374
|
-
|
|
374
|
+
A fenced code block uses `github-light` in light mode and `github-dark` in dark mode. If the highlighter doesn’t recognize the language, readers see plain text.
|
|
375
375
|
|
|
376
376
|
### Line Highlighting
|
|
377
377
|
|