void 0.20.3 → 0.21.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 +2 -2
- package/dist/agents-gni4eqBu.mjs +111 -0
- package/dist/auth-3sGB0zJ1.mjs +22 -0
- package/dist/{auth-DPl6kck4.mjs → auth-B9_D6ygs.mjs} +6 -241
- package/dist/auth-CAw7zHqj.mjs +2 -0
- package/dist/auth-client-BWBT8HLp.mjs +6 -0
- package/dist/auth-client-Bawdj38n.d.mts +7 -0
- package/dist/auth-client-react-7GFffu8R.d.mts +7 -0
- package/dist/auth-client-react-CMLwT2xI.mjs +6 -0
- package/dist/auth-client-solid-DyTFL4cq.d.mts +7 -0
- package/dist/auth-client-solid-UoreJWZG.mjs +6 -0
- package/dist/auth-client-svelte-Cv_WvrRk.mjs +6 -0
- package/dist/auth-client-svelte-zetW0KIH.d.mts +7 -0
- package/dist/auth-client-vue-CFk7Xbv3.mjs +6 -0
- package/dist/auth-client-vue-bChShbQP.d.mts +7 -0
- package/dist/{auth-cmd-CzwquNiP.mjs → auth-cmd-MkBG2u1f.mjs} +5 -5
- package/dist/{auth-link-ElDTgF7j.mjs → auth-link-Devmv96E.mjs} +5 -5
- package/dist/{better-auth-shared-DSCeohOK.d.mts → better-auth-shared-BoVwA5Vm.d.mts} +1 -6
- package/dist/{better-auth-shared-CYw1T3k4.mjs → better-auth-shared-syGYYmnY.mjs} +1 -1
- package/dist/{build-cmd-BpJe6boP.mjs → build-cmd-DsBGwtfs.mjs} +6 -4
- package/dist/{cache-D98YTqeE.mjs → cache-BMw8eMyF.mjs} +6 -4
- package/dist/{cancel-deploy-CPbEQLMG.mjs → cancel-deploy-B3_s9NIN.mjs} +5 -3
- package/dist/cf-access-rAZxzMkL.mjs +181 -0
- package/dist/cf-build-output-CTdlo6Rt.mjs +520 -0
- package/dist/cli/cf-compat.d.mts +1 -0
- package/dist/cli/cf-compat.mjs +934 -0
- package/dist/cli/cli.mjs +60 -38
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-DAAivdid.mjs +2 -0
- package/dist/{client-BQBrZoCX.mjs → client-PdAJ-F0t.mjs} +6 -12
- package/dist/{cloudflare-auth-6M5llVPC.mjs → cloudflare-auth-BCmTc1X_.mjs} +13 -44
- package/dist/{cloudflare-cmd-4RPGN3KB.mjs → cloudflare-cmd-D6PrKn7o.mjs} +4 -7
- package/dist/{cloudflare-connect-t1UU5svD.mjs → cloudflare-connect-DloREDlc.mjs} +6 -6
- package/dist/cloudflare-operations-BHNJVDbN.mjs +2 -0
- package/dist/{cloudflare-operations-BzWnlC1_.mjs → cloudflare-operations-CPEdHYhM.mjs} +37 -39
- package/dist/cloudflare-user-output-Q-k0QoNQ.mjs +20 -0
- package/dist/collect-DAUItMDS.mjs +2 -0
- package/dist/collect-DXHNWHcT.mjs +48 -0
- package/dist/config--T87TD8T.mjs +2 -0
- package/dist/{config-NOG_U1aK.mjs → config-BSe70f4T.mjs} +4 -6
- package/dist/config-DDIFxQYx.mjs +2 -0
- package/dist/{config-uNGuFsI2.mjs → config-Dxr6cTXn.mjs} +22 -37
- package/dist/config-DywxBLQC.d.mts +185 -0
- package/dist/config-entry.d.mts +6 -0
- package/dist/config-entry.mjs +7 -0
- package/dist/config-uP7ZDtVZ.mjs +21 -0
- package/dist/config-write-y3CBI_ux.mjs +60 -0
- package/dist/{connect-WCQZ_u3m.mjs → connect-BvC9kolB.mjs} +8 -6
- package/dist/{create-project-D0oXA090.mjs → create-project-C9lQhRzj.mjs} +8 -23
- package/dist/create-project-CI-17RVJ.mjs +2 -0
- package/dist/database-provider-Cx525bwX.mjs +6 -0
- package/dist/database-provider.mjs +1 -5
- package/dist/{db-DJ-9qs3S.mjs → db-R7IQgOv5.mjs} +48 -44
- package/dist/{delete-BZ4-WaGm.mjs → delete-CghI_NXn.mjs} +6 -4
- package/dist/deploy-CYPymbtG.mjs +2 -0
- package/dist/{deploy-BAhhcg5q.mjs → deploy-H968Lo4T.mjs} +751 -190
- package/dist/discover-BBzDZe_o.mjs +2 -0
- package/dist/{discover-xvfrgJeo.mjs → discover-C4O6YxVS.mjs} +3 -8
- package/dist/{dist-BrsS7cai.mjs → dist-4WkAWhWx.mjs} +1 -15
- package/dist/{dist-m40_XgNh.mjs → dist-Bn8Kodjp.mjs} +1 -1
- package/dist/dist-C5fND3R0.mjs +2 -0
- package/dist/dist-D7-nEOXi.mjs +2 -0
- package/dist/{output-B0cfNSx5.mjs → dist-Dn6nn2IU.mjs} +3 -926
- package/dist/{domain-BxAyhxXN.mjs → domain-CITt8lC-.mjs} +7 -5
- package/dist/{route-types-Da-DpyUp.mjs → drizzle-Beb2Am5S.mjs} +1 -280
- package/dist/{email-Ce6SQq-i.mjs → email-C5kaZXzJ.mjs} +2 -2
- package/dist/{email-Bj7Cvdwp.mjs → email-_8VmyX7V.mjs} +14 -12
- package/dist/{entry-DU3oDoQ3.mjs → entry-DdRFGK0y.mjs} +2 -2
- package/dist/{env-DP_EErve.mjs → env-DV4r3nHz.mjs} +9 -7
- package/dist/{env-DBKmK4vc.mjs → env-DX_v-Q-v.mjs} +1 -1
- package/dist/env-Yz4HcvHs.mjs +78 -0
- package/dist/env-helpers--wFmQ_5Q.mjs +136 -0
- package/dist/{env-types-BNPhro-M.mjs → env-types-CWDtqHgw.mjs} +6 -2
- package/dist/{env-validation-CF6KvTRf.mjs → env-validation-BsFEXps5.mjs} +19 -28
- package/dist/env-validation-DIDGM7h4.mjs +2 -0
- package/dist/fetch-CXDChK7B.mjs +18 -0
- package/dist/fetch-_SeGZao9.d.mts +57 -0
- package/dist/fetch-stream-AOByI7Ki.mjs +81 -0
- package/dist/fetch-stream-Bjf0hoZb.d.mts +49 -0
- package/dist/gen-BBiIZw6g.mjs +2 -0
- package/dist/{gen-B_wPnVTK.mjs → gen-CFOEEc-t.mjs} +13 -11
- package/dist/{generate-RTK8_kK1.mjs → generate-C0VY6RVf.mjs} +2 -2
- package/dist/{github-cmd-C-z_xRrQ.mjs → github-cmd-jYjha2LO.mjs} +6 -4
- package/dist/{handler-D1hLsObx.d.mts → handler-BXJTXd02.d.mts} +6 -1
- package/dist/handler-DghKr6dU.mjs +150 -0
- package/dist/head-D_QRR5Yd.mjs +112 -0
- package/dist/head-client-DzmJGN4C.mjs +90 -0
- package/dist/{headers-BAHwgHdW.mjs → headers-B_HBMgi0.mjs} +2 -2
- package/dist/{help-CwOX-zmI.mjs → help-C46mnlUS.mjs} +17 -12
- package/dist/help-CS_nAsWu.mjs +2 -0
- package/dist/index.d.mts +2 -20
- package/dist/index.mjs +116 -60
- package/dist/{init-BGktCXgA.mjs → init-CSXmvxKu.mjs} +49 -50
- package/dist/{link-D2kbqhWb.mjs → link-DxMOALXk.mjs} +7 -5
- package/dist/{list-CvkK_G7k.mjs → list-0wQs0oYg.mjs} +7 -5
- package/dist/live-CB1y5IuC.mjs +411 -0
- package/dist/live-CKiJilLr.d.mts +105 -0
- package/dist/local-d1-DzykTWY8.mjs +104 -0
- package/dist/{login-WIjNc77c.mjs → login-CKk5NX4d.mjs} +6 -11
- package/dist/login-Ch9cgWRF.mjs +2 -0
- package/dist/{logs-dLUFCapG.mjs → logs-hxWBSoej.mjs} +6 -4
- package/dist/migrate-CLty4mZR.mjs +2 -0
- package/dist/migrate-DcW8F2W8.mjs +285 -0
- package/dist/migration-handler-DM4clYj5.d.mts +51 -0
- package/dist/{neon-DHwd2zvC.mjs → neon-n74ta1Pr.mjs} +1 -1
- package/dist/{node-Ez5KW5rn.mjs → node-Cupyf7-s.mjs} +6 -6
- package/dist/{operator-auth-B3e08unv.mjs → operator-auth-BkVgJqv-.mjs} +2 -2
- package/dist/{operator-client-LUZnlnYk.mjs → operator-client-A0iex2yi.mjs} +2 -1
- package/dist/{operator-cmd-CKJ7xIRs.mjs → operator-cmd-BEUYhaHB.mjs} +6 -6
- package/dist/output-urU86XeT.mjs +146 -0
- package/dist/{package-json-CPoWX79C.mjs → package-json-iCbMg5XF.mjs} +1 -1
- package/dist/pages/client.d.mts +5 -2
- package/dist/pages/client.mjs +5 -3
- package/dist/pages/head-client.mjs +1 -89
- package/dist/pages/head.mjs +1 -111
- package/dist/pages/index.d.mts +2 -3
- package/dist/pages/index.mjs +7 -7
- package/dist/pages/islands-plugin.mjs +2 -2
- package/dist/pages/prefetch.d.mts +2 -30
- package/dist/pages/prefetch.mjs +1 -89
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +3 -3
- package/dist/pages/serialize.d.mts +2 -9
- package/dist/pages/serialize.mjs +1 -13
- package/dist/plan-BEZ8VJW0.mjs +256 -0
- package/dist/plan-DpuOr14e.mjs +2 -0
- package/dist/{platform-auth-config-CdVWRRJr.mjs → platform-auth-config-Df6yVw-e.mjs} +6 -6
- package/dist/{platform-auth-protection-Drl0qhrn.mjs → platform-auth-protection-Jb0yftay.mjs} +7 -5
- package/dist/{platform-auth-recovery-CmKEWpDo.mjs → platform-auth-recovery-DmRyIfW0.mjs} +6 -5
- package/dist/platform-cmd-C9Vt7m-d.mjs +2 -0
- package/dist/{platform-cmd-5q_k56xS.mjs → platform-cmd-DRxCOTwy.mjs} +8 -5
- package/dist/{platform-domain-4GiDlcqx.mjs → platform-domain-IjiXgrXJ.mjs} +4 -3
- package/dist/{platform-lifecycle-R9xAxvtG.mjs → platform-lifecycle-BquAaU-5.mjs} +208 -37
- package/dist/platform-lifecycle-CuJIZNvA.mjs +2 -0
- package/dist/{platform-management-BfWsXHEW.mjs → platform-management-CCQKGsq4.mjs} +8 -5
- package/dist/platform-management-Cgyed0WY.mjs +2 -0
- package/dist/{platform-recovery-CbK-I1FB.mjs → platform-recovery-DS8ih1SW.mjs} +3 -3
- package/dist/platform-registry-BJbgZLS1.mjs +431 -0
- package/dist/{plugin-inference-BDRfZngg.mjs → plugin-inference-DsvtJLll.mjs} +4 -4
- package/dist/prefetch-Bsc_Pb6c.mjs +90 -0
- package/dist/prefetch-Ce6la4EI.d.mts +31 -0
- package/dist/{prepare-blNRQvQl.mjs → prepare-CaUxODOU.mjs} +3 -2
- package/dist/prepare-D4CkM3_v.mjs +2 -0
- package/dist/{prepare-CtDJjoOj.mjs → prepare-pcWcxSCh.mjs} +13 -11
- package/dist/prerender-render-Cf_WDE9W.mjs +111 -0
- package/dist/prerender-render.mjs +1 -110
- package/dist/{preset-lAy0B0BQ.mjs → preset-Dowh9tTt.mjs} +16 -118
- package/dist/project-BEBFDFLz.mjs +2 -0
- package/dist/project-CWNIPoXc.mjs +209 -0
- package/dist/{project-cmd-CTdmnzvc.mjs → project-cmd-2lN--YAX.mjs} +18 -16
- package/dist/{project-paths-SK8nMHPp.mjs → project-paths-CKQ-Q5JS.mjs} +47 -14
- package/dist/project-slug-23TpquG4.mjs +8 -0
- package/dist/project-slug-DofjTFd-.mjs +2 -0
- package/dist/{project-team-CGxsQe3_.mjs → project-team-Dapn9HZn.mjs} +6 -4
- package/dist/{project-token-Cirx7uwZ.mjs → project-token-C90v9SJK.mjs} +6 -4
- package/dist/{project-tsconfig-Ql2XsSQp.mjs → project-tsconfig-CwfqUnVp.mjs} +2 -2
- package/dist/{protocol-C-pqYJjE.d.mts → protocol-ZH3jP4a7.d.mts} +1 -1
- package/dist/providers-BNKRacMr.d.mts +7 -0
- package/dist/provision-CNgEBkVA.mjs +3 -0
- package/dist/{provision-CSJOjjQk.mjs → provision-Cck2m3jJ.mjs} +11 -25
- package/dist/queues-BWKt1Xo4.d.mts +7 -0
- package/dist/{requests-4Nq59hOr.mjs → requests-CzX46I0i.mjs} +5 -3
- package/dist/resolve-project-BTotl8Nn.mjs +2 -0
- package/dist/{resolve-project--Vxawf7z.mjs → resolve-project-Xvis70DG.mjs} +2 -8
- package/dist/response-Tn7rU0MV.mjs +30 -0
- package/dist/{rollback-Dr7u0Ljx.mjs → rollback-BEeyc73H.mjs} +6 -4
- package/dist/{rolldown-runtime-rQ84J-ij.mjs → rolldown-runtime-DXIUcv95.mjs} +1 -10
- package/dist/route-types-Id82-veQ.mjs +280 -0
- package/dist/{local-d1-D2I6Ox5F.mjs → runner-BGVsGgkb.mjs} +6 -114
- package/dist/runner-CQs_cDSG.mjs +2 -0
- package/dist/runner-mysql-1o47achK.mjs +2 -0
- package/dist/{runner-mysql-7BPUNGmL.mjs → runner-mysql-BhwMk2Bm.mjs} +2 -9
- package/dist/{runner-pg-BkEza-dX.mjs → runner-pg-CJ_JeGF6.mjs} +2 -9
- package/dist/runner-pg-D7z01mQS.mjs +2 -0
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth-client-react.d.mts +2 -6
- package/dist/runtime/auth-client-react.mjs +1 -5
- package/dist/runtime/auth-client-solid.d.mts +2 -6
- package/dist/runtime/auth-client-solid.mjs +1 -5
- package/dist/runtime/auth-client-svelte.d.mts +2 -6
- package/dist/runtime/auth-client-svelte.mjs +1 -5
- package/dist/runtime/auth-client-vue.d.mts +2 -6
- package/dist/runtime/auth-client-vue.mjs +1 -5
- package/dist/runtime/auth-client.d.mts +2 -6
- package/dist/runtime/auth-client.mjs +1 -5
- package/dist/runtime/auth.mjs +1 -21
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +3 -3
- package/dist/runtime/client-react.mjs +3 -3
- package/dist/runtime/client-solid.d.mts +3 -3
- package/dist/runtime/client-solid.mjs +3 -3
- package/dist/runtime/client-svelte.d.mts +3 -3
- package/dist/runtime/client-svelte.mjs +3 -3
- package/dist/runtime/client-vue.d.mts +3 -3
- package/dist/runtime/client-vue.mjs +3 -3
- package/dist/runtime/client.d.mts +3 -3
- package/dist/runtime/client.mjs +3 -3
- package/dist/runtime/db.mjs +1 -1
- package/dist/runtime/durable.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-helpers.mjs +1 -135
- package/dist/runtime/env-public-client.mjs +1 -1
- package/dist/runtime/env-public.mjs +2 -2
- package/dist/runtime/env.mjs +1 -77
- package/dist/runtime/fetch-stream.d.mts +2 -49
- package/dist/runtime/fetch-stream.mjs +2 -80
- package/dist/runtime/fetch.d.mts +2 -57
- package/dist/runtime/fetch.mjs +2 -17
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -149
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +2 -2
- package/dist/runtime/live.d.mts +2 -104
- package/dist/runtime/live.mjs +1 -410
- package/dist/runtime/migration-handler-mysql.d.mts +1 -1
- package/dist/runtime/migration-handler-pg.d.mts +1 -1
- package/dist/runtime/migration-handler.d.mts +2 -50
- package/dist/runtime/queues.d.mts +2 -6
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/response.mjs +1 -29
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/sse.mjs +1 -171
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/validator.mjs +1 -71
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws-server.mjs +2 -2
- package/dist/runtime/ws.d.mts +2 -121
- package/dist/{scan-CpK-57ug.mjs → scan-DJbooZm2.mjs} +3 -3
- package/dist/{scan-BMH4rzlv.mjs → scan-DdDvRCU1.mjs} +8 -26
- package/dist/{secret-AcPi-FoA.mjs → secret-wnTel5Yw.mjs} +8 -6
- package/dist/serialize-BPvnNQuA.mjs +14 -0
- package/dist/serialize-CfSwWfF2.d.mts +10 -0
- package/dist/{skills-C0RvGjeE.mjs → skills-B-690E7h.mjs} +3 -2
- package/dist/sse-BaC1jXko.mjs +172 -0
- package/dist/{subcommand-prompt-Bmyn5Rlc.mjs → subcommand-prompt-Gj3VzLIh.mjs} +2 -1
- package/dist/sveltekit.d.mts +2 -1
- package/dist/sveltekit.mjs +3 -2
- package/dist/validate-DqJ33oHj.mjs +2 -0
- package/dist/validate-qNhV00PD.mjs +180 -0
- package/dist/validator-BTOu0fB0.mjs +72 -0
- package/dist/{wrangler--imS8n0d.mjs → wrangler-D01qs6VB.mjs} +259 -71
- package/dist/ws-BwcqizuH.d.mts +122 -0
- package/dist/{yarn-pnp-DxSInkzL.mjs → yarn-pnp-CVEc3gE7.mjs} +1 -1
- package/package.json +19 -8
- package/skills/void/SKILL.md +6 -4
- package/skills/void/docs/guide/ai.md +3 -3
- package/skills/void/docs/guide/app-types.md +12 -11
- package/skills/void/docs/guide/auth.md +2 -2
- package/skills/void/docs/guide/database/d1.md +1 -1
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +3 -3
- package/skills/void/docs/guide/deployment.md +2 -2
- package/skills/void/docs/guide/durable-state.md +2 -2
- package/skills/void/docs/guide/edge/headers.md +3 -3
- package/skills/void/docs/guide/edge/prerendering.md +1 -1
- package/skills/void/docs/guide/edge/redirects.md +4 -4
- package/skills/void/docs/guide/edge/revalidation.md +6 -6
- package/skills/void/docs/guide/edge/rewrites.md +28 -27
- package/skills/void/docs/guide/edge/static-assets.md +1 -1
- package/skills/void/docs/guide/email.md +15 -15
- package/skills/void/docs/guide/env-migration.md +1 -1
- package/skills/void/docs/guide/index.md +1 -1
- package/skills/void/docs/guide/pages-routing/head.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +13 -5
- package/skills/void/docs/guide/platform/administration/projects.md +3 -1
- package/skills/void/docs/guide/platform/installation/ci.md +3 -0
- package/skills/void/docs/guide/platform/installation/credentials.md +15 -5
- package/skills/void/docs/guide/platform/installation/prerequisites.md +2 -0
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/remote-dev.md +2 -2
- package/skills/void/docs/guide/sandboxes.md +1 -1
- package/skills/void/docs/guide/ssg.md +1 -1
- package/skills/void/docs/guide/websockets.md +1 -1
- package/skills/void/docs/integrations/cloudflare.md +86 -84
- package/skills/void/docs/integrations/frameworks/analog.md +14 -9
- package/skills/void/docs/integrations/frameworks/astro.md +14 -10
- package/skills/void/docs/integrations/frameworks/nuxt.md +14 -9
- package/skills/void/docs/integrations/frameworks/overview.md +35 -29
- package/skills/void/docs/integrations/frameworks/react-router.md +1 -1
- package/skills/void/docs/integrations/frameworks/sveltekit.md +33 -30
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +1 -1
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -5
- package/skills/void/docs/reference/api.md +21 -4
- package/skills/void/docs/reference/cli.md +32 -23
- package/skills/void/docs/reference/config.md +56 -33
- package/skills/void/docs/reference/structure.md +2 -2
- package/dist/validate-tBBN_dXH.mjs +0 -505
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//#region src/pages/head-client.ts
|
|
2
|
+
const ATTR = "data-void-head";
|
|
3
|
+
function elementDescriptorSignature(descriptor) {
|
|
4
|
+
const attrs = Object.entries(descriptor.attrs).sort(([a], [b]) => a.localeCompare(b));
|
|
5
|
+
return `${encodeURIComponent(descriptor.tag)}:${attrs.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`).join("&")}`;
|
|
6
|
+
}
|
|
7
|
+
function elementSignature(el) {
|
|
8
|
+
const attrs = {};
|
|
9
|
+
for (const attr of Array.from(el.attributes)) if (attr.name !== ATTR) attrs[attr.name] = attr.value;
|
|
10
|
+
return elementDescriptorSignature({
|
|
11
|
+
tag: el.tagName.toLowerCase(),
|
|
12
|
+
attrs
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function createHeadElement(descriptor) {
|
|
16
|
+
const el = document.createElement(descriptor.tag);
|
|
17
|
+
for (const [key, value] of Object.entries(descriptor.attrs)) el.setAttribute(key, value);
|
|
18
|
+
el.setAttribute(ATTR, "");
|
|
19
|
+
return el;
|
|
20
|
+
}
|
|
21
|
+
function collectDesiredHeadElements(head) {
|
|
22
|
+
const desired = [];
|
|
23
|
+
if (head.meta) for (const entry of head.meta) {
|
|
24
|
+
const attrs = {};
|
|
25
|
+
if (entry.charset) attrs.charset = entry.charset;
|
|
26
|
+
if (entry.name) attrs.name = entry.name;
|
|
27
|
+
if (entry.property) attrs.property = entry.property;
|
|
28
|
+
if (entry.content !== void 0) attrs.content = entry.content;
|
|
29
|
+
desired.push({
|
|
30
|
+
tag: "meta",
|
|
31
|
+
attrs
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (head.link) for (const entry of head.link) {
|
|
35
|
+
const attrs = {};
|
|
36
|
+
for (const [key, value] of Object.entries(entry)) if (value != null) attrs[key] = value;
|
|
37
|
+
desired.push({
|
|
38
|
+
tag: "link",
|
|
39
|
+
attrs
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return desired;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Mark SSR-rendered head tags so they are cleaned up on the first SPA navigation.
|
|
46
|
+
* Call once after hydration with the initial page's head descriptor.
|
|
47
|
+
*/
|
|
48
|
+
function initClientHead(head) {
|
|
49
|
+
if (!head) return;
|
|
50
|
+
if (head.meta) for (const entry of head.meta) {
|
|
51
|
+
const selector = entry.charset ? "meta[charset]" : entry.property ? `meta[property="${entry.property}"]` : entry.name ? `meta[name="${entry.name}"]` : null;
|
|
52
|
+
if (!selector) continue;
|
|
53
|
+
const el = document.head.querySelector(selector);
|
|
54
|
+
if (el) el.setAttribute(ATTR, "");
|
|
55
|
+
}
|
|
56
|
+
if (head.link) for (const entry of head.link) {
|
|
57
|
+
const el = document.head.querySelector(`link[rel="${entry.rel}"][href="${entry.href}"]`);
|
|
58
|
+
if (el) el.setAttribute(ATTR, "");
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Apply head changes on SPA navigation.
|
|
63
|
+
* Preserves existing managed tags when their final attributes are unchanged.
|
|
64
|
+
*/
|
|
65
|
+
function applyClientHead(head) {
|
|
66
|
+
const existing = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const el of document.head.querySelectorAll(`[${ATTR}]`)) {
|
|
68
|
+
const signature = elementSignature(el);
|
|
69
|
+
const elements = existing.get(signature);
|
|
70
|
+
if (elements) elements.push(el);
|
|
71
|
+
else existing.set(signature, [el]);
|
|
72
|
+
}
|
|
73
|
+
const desiredElements = [];
|
|
74
|
+
for (const descriptor of head ? collectDesiredHeadElements(head) : []) {
|
|
75
|
+
const signature = elementDescriptorSignature(descriptor);
|
|
76
|
+
const elements = existing.get(signature);
|
|
77
|
+
const preserved = elements?.shift();
|
|
78
|
+
if (elements && elements.length === 0) existing.delete(signature);
|
|
79
|
+
desiredElements.push(preserved ?? createHeadElement(descriptor));
|
|
80
|
+
}
|
|
81
|
+
for (const elements of existing.values()) for (const el of elements) el.remove();
|
|
82
|
+
let cursor = document.head.querySelector(`[${ATTR}]`);
|
|
83
|
+
for (const el of desiredElements) {
|
|
84
|
+
if (el !== cursor) document.head.insertBefore(el, cursor);
|
|
85
|
+
cursor = el.nextSibling;
|
|
86
|
+
}
|
|
87
|
+
if (head?.title !== void 0) document.title = head.title;
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
export { initClientHead as n, applyClientHead as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
1
|
+
import { a as join } from "./dist-4WkAWhWx.mjs";
|
|
2
|
+
import { a as convertFallbacksConfig, c as convertRewritesConfig, f as isProtocolRelative, l as countSplats, n as VALID_REDIRECT_STATUSES, o as convertHeadersConfig, p as parseHostPrefixedSource, s as convertRedirectsConfig } from "./config-Dxr6cTXn.mjs";
|
|
3
3
|
import { i as voidWarn } from "./log-ChfPKsVd.mjs";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/cli/headers.ts
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { a as join } from "./dist-4WkAWhWx.mjs";
|
|
2
|
+
import { c as import_picocolors, l as sectionTitle, s as helpLine, t as categoryTitle } from "./output-urU86XeT.mjs";
|
|
3
|
+
import { N as note, P as outro } from "./dist-Dn6nn2IU.mjs";
|
|
4
|
+
import { n as getPackageDir } from "./agents-gni4eqBu.mjs";
|
|
5
|
+
import { t as OPERATOR_MAX_TIMEOUT_MS } from "./operator-client-A0iex2yi.mjs";
|
|
5
6
|
import { readFileSync } from "node:fs";
|
|
6
7
|
//#region src/cli/ascii.ts
|
|
7
8
|
const asciiArts = [
|
|
@@ -583,12 +584,6 @@ function parseOperatorArgs(args) {
|
|
|
583
584
|
}
|
|
584
585
|
//#endregion
|
|
585
586
|
//#region src/cli/help.ts
|
|
586
|
-
var help_exports = /* @__PURE__ */ __exportAll({
|
|
587
|
-
getHelpPath: () => getHelpPath,
|
|
588
|
-
printGlobalHelp: () => printGlobalHelp,
|
|
589
|
-
printHelpPage: () => printHelpPage,
|
|
590
|
-
printVoidHeader: () => printVoidHeader
|
|
591
|
-
});
|
|
592
587
|
function operatorHelpTree() {
|
|
593
588
|
return Object.fromEntries(operatorGroups.map((group) => {
|
|
594
589
|
const commands = operatorCommands.filter((entry) => entry.group === group);
|
|
@@ -716,6 +711,14 @@ const HELP_TREE = {
|
|
|
716
711
|
}
|
|
717
712
|
]
|
|
718
713
|
},
|
|
714
|
+
migrate: {
|
|
715
|
+
summary: "Move legacy Void project settings into void.config.ts.",
|
|
716
|
+
usage: ["void migrate"],
|
|
717
|
+
examples: [{
|
|
718
|
+
command: "void migrate",
|
|
719
|
+
description: "Convert void.json to void.config.ts"
|
|
720
|
+
}]
|
|
721
|
+
},
|
|
719
722
|
deploy: {
|
|
720
723
|
summary: "Build and deploy. Offers to link an existing Cloudflare Worker when no destination is configured.",
|
|
721
724
|
usage: ["void deploy [options]"],
|
|
@@ -1546,7 +1549,7 @@ const HELP_TREE = {
|
|
|
1546
1549
|
}]
|
|
1547
1550
|
},
|
|
1548
1551
|
setup: {
|
|
1549
|
-
summary: "Set email up on your own Cloudflare account: enable Email Routing, onboard Email Sending,
|
|
1552
|
+
summary: "Set email up on your own Cloudflare account: enable Email Routing, onboard Email Sending, and record send_email + addresses in the Cloudflare config managed by Void. Asks once before changing the account.",
|
|
1550
1553
|
usage: ["void email setup --platform cloudflare"],
|
|
1551
1554
|
options: [{
|
|
1552
1555
|
command: "--platform cloudflare",
|
|
@@ -2073,6 +2076,8 @@ function printGlobalHelp() {
|
|
|
2073
2076
|
globalCommandLine(["init"], "void init"),
|
|
2074
2077
|
...globalOptionLines(["init"]),
|
|
2075
2078
|
"",
|
|
2079
|
+
globalCommandLine(["migrate"], "void migrate"),
|
|
2080
|
+
"",
|
|
2076
2081
|
globalCommandLine(["connect"], "void connect [url]"),
|
|
2077
2082
|
...globalOptionLines(["connect"]),
|
|
2078
2083
|
"",
|
|
@@ -2213,4 +2218,4 @@ function formatHelpPath(path) {
|
|
|
2213
2218
|
return path.length === 0 ? "help" : path.join(" ");
|
|
2214
2219
|
}
|
|
2215
2220
|
//#endregion
|
|
2216
|
-
export {
|
|
2221
|
+
export { operatorGroups as a, printVoidHeader as i, printGlobalHelp as n, parseOperatorArgs as o, printHelpPage as r, getHelpPath as t };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as HeadDescriptor } from "./head-Do8P4puT.mjs";
|
|
2
2
|
import { r as AuthUser } from "./auth-DkcFflXV.mjs";
|
|
3
|
-
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, x as DeferredState, y as defineScheduled } from "./handler-
|
|
4
|
-
import { QueueMap } from "./
|
|
3
|
+
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, x as DeferredState, y as defineScheduled } from "./handler-BXJTXd02.mjs";
|
|
4
|
+
import { t as QueueMap } from "./queues-BWKt1Xo4.mjs";
|
|
5
5
|
import { PluginConfig } from "@cloudflare/vite-plugin";
|
|
6
6
|
import { Plugin } from "vite";
|
|
7
7
|
//#region src/router/parse-filename.d.ts
|
|
@@ -45,24 +45,6 @@ export declare function shouldBindWorkersAi(command: string, needsAI: boolean, r
|
|
|
45
45
|
export declare function shouldInjectEmailDevInboxVar(routeEnvironment: RouteEnvironment, needsEmail: boolean | undefined, assetsBinding: string | undefined): boolean;
|
|
46
46
|
/** Resolve the runtime Workers AI binding, preserving a root Wrangler declaration. */
|
|
47
47
|
export declare function resolveWorkersAiBindingName(resolvedAi: unknown, configuredName?: string): string;
|
|
48
|
-
/**
|
|
49
|
-
* Void plugin — the main entry point.
|
|
50
|
-
*
|
|
51
|
-
* Composes:
|
|
52
|
-
* 1. Routing plugin (file-based routing from routes/ and middleware/)
|
|
53
|
-
* 2. Migration plugin (auto-apply .sql migrations on dev startup)
|
|
54
|
-
* 3. @cloudflare/vite-plugin (workerd runtime, HMR, builds)
|
|
55
|
-
*
|
|
56
|
-
* Binding inference runs synchronously here so results are available
|
|
57
|
-
* before the Cloudflare plugin initializes.
|
|
58
|
-
*
|
|
59
|
-
* If the user has a `wrangler.jsonc` / `wrangler.json` in their project root,
|
|
60
|
-
* the Cloudflare plugin reads it and provides the resolved config to our
|
|
61
|
-
* config function. Bindings already defined there (with real IDs for
|
|
62
|
-
* production deployment) are preserved — we only add inferred bindings
|
|
63
|
-
* that are missing. This allows `vite build && wrangler deploy` to work
|
|
64
|
-
* for deploying directly to Cloudflare without the Void platform.
|
|
65
|
-
*/
|
|
66
48
|
export declare function voidPlugin(options?: {
|
|
67
49
|
persistTo?: string;
|
|
68
50
|
auxiliaryWorkers?: PluginConfig["auxiliaryWorkers"];
|
package/dist/index.mjs
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-
|
|
6
|
-
import {
|
|
1
|
+
import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
|
|
2
|
+
import { a as join, l as relative, n as dirname, u as resolve } from "./dist-4WkAWhWx.mjs";
|
|
3
|
+
import { d as require_picocolors } from "./output-urU86XeT.mjs";
|
|
4
|
+
import { B as resolveDistDir, Ct as resolveAssetRoutingPolicy, W as resolveWorkerDirName, at as generateQueueResolverSource, bt as hasApiRoutes, dt as hasRevalidate, ft as scanDurableObjectModules, lt as collectPages, ot as prerenderPages, pt as SEND_EMAIL_BINDING, st as prerenderPagesNode, ut as collectRevalidate, xt as hasDocumentRoutes } from "./deploy-H968Lo4T.mjs";
|
|
5
|
+
import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-CKQ-Q5JS.mjs";
|
|
6
|
+
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-uP7ZDtVZ.mjs";
|
|
7
7
|
import { r as scopedAccessCredentials } from "./cf-access-DRsQRe6k.mjs";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { a as getApiUrl, c as getToken, o as getProxyUrl, u as isStagingMode } from "./auth-B9_D6ygs.mjs";
|
|
9
|
+
import { r as ensurePlatformProxyAccess } from "./cf-access-rAZxzMkL.mjs";
|
|
10
|
+
import { i as readDeploymentPlatform, o as readProjectConfig } from "./project-CWNIPoXc.mjs";
|
|
11
|
+
import { d as isNodeTarget, h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-Dxr6cTXn.mjs";
|
|
12
|
+
import { C as readWranglerWebSocketTombstones, D as syncWranglerWebSockets, E as syncWranglerDurableObjects, L as materializeCloudflareConfig, M as isSandboxEnabled, P as resolveSandboxConfig, T as syncWranglerBindings, V as stashCloudflareDeployPointer, a as LIVE_MIGRATION_TAG, d as ensureWranglerNodejsAlsFlag, g as readExistingLiveBindingConfig, h as normalizeWranglerCompatibilityFlags, j as SANDBOX_MIGRATION_TAG, l as ensureWranglerCompat, m as nextDurableObjectMigrationTag, p as hasDurableObjectSqliteMigration, u as ensureWranglerCompatibilityDate, w as resolveLiveBindingConfig, y as readWranglerCompat, z as restoreCloudflarePreviewPointer } from "./wrangler-D01qs6VB.mjs";
|
|
11
13
|
import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-ChfPKsVd.mjs";
|
|
12
|
-
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-
|
|
13
|
-
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-
|
|
14
|
-
import { a as
|
|
15
|
-
import { a as
|
|
16
|
-
import { n as
|
|
14
|
+
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-B_HBMgi0.mjs";
|
|
15
|
+
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-CwfqUnVp.mjs";
|
|
16
|
+
import { a as scanQueuesSync, i as scanWebSocketRoutesSync, n as scanRoutePatternsSync, o as scanJobsSync, r as scanRoutes, t as scanMiddlewareSync } from "./scan-DdDvRCU1.mjs";
|
|
17
|
+
import { a as inferBindingsFromSource, i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, o as walk, r as detectFramework, t as DEFAULT_SCAN_DIRS } from "./plugin-inference-DsvtJLll.mjs";
|
|
18
|
+
import { a as validateSsrEntries, c as isIdentifier, l as isLiteral, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS, u as isMemberExpression } from "./entry-DdRFGK0y.mjs";
|
|
19
|
+
import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-DzykTWY8.mjs";
|
|
17
20
|
import { n as parseDotenvFile } from "./dotenv-VQxupEUv.mjs";
|
|
18
|
-
import { i as
|
|
19
|
-
import { t as discoverSchema } from "./discover-
|
|
21
|
+
import { i as generateDbDts, n as generateQueueTypes, r as DRIZZLE_OPERATORS, t as generateRouteTypes } from "./route-types-Id82-veQ.mjs";
|
|
22
|
+
import { t as discoverSchema } from "./discover-C4O6YxVS.mjs";
|
|
20
23
|
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, y as registerEmailSink } from "./dev-inbox-P0u4tM8Y.mjs";
|
|
21
24
|
import { t as MagicString } from "./dist-BR1quN_w.mjs";
|
|
22
|
-
import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-
|
|
23
|
-
import {
|
|
24
|
-
import { a as loadLocalEnv, o as resolveRemoteMode, r as findLegacyEnvFiles, s as stripInternalEnvKeys, t as CLIENT_ENV_PREFIX$2 } from "./env-
|
|
25
|
-
import { i as resolveLayoutIds, o as isRouteEnabledForEnvironment } from "./scan-
|
|
26
|
-
import { a as scanEmailHandlersSync, r as hasEmailHandlers } from "./email-
|
|
25
|
+
import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-CWDtqHgw.mjs";
|
|
26
|
+
import { y as loadUserEnvFile } from "./env-validation-BsFEXps5.mjs";
|
|
27
|
+
import { a as loadLocalEnv, o as resolveRemoteMode, r as findLegacyEnvFiles, s as stripInternalEnvKeys, t as CLIENT_ENV_PREFIX$2 } from "./env-DX_v-Q-v.mjs";
|
|
28
|
+
import { i as resolveLayoutIds, o as isRouteEnabledForEnvironment } from "./scan-DJbooZm2.mjs";
|
|
29
|
+
import { a as scanEmailHandlersSync, r as hasEmailHandlers } from "./email-C5kaZXzJ.mjs";
|
|
30
|
+
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-Beb2Am5S.mjs";
|
|
27
31
|
import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./env-raw-Cx8ElDdj.mjs";
|
|
28
32
|
import { n as defer } from "./defer-YsYDUoii.mjs";
|
|
29
|
-
import {
|
|
33
|
+
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-DghKr6dU.mjs";
|
|
30
34
|
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
31
35
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
32
36
|
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
@@ -702,7 +706,7 @@ export function createDb(d1) {
|
|
|
702
706
|
const migrationsDir = paths.migrationsDir;
|
|
703
707
|
if (!(existsSync(migrationsDir) && readdirSync(migrationsDir).some((f) => f.endsWith(".sql")))) {
|
|
704
708
|
if (dialect === "sqlite") {
|
|
705
|
-
const { getApplicationTables, getMiniflareDatabasePath } = await import("./
|
|
709
|
+
const { getApplicationTables, getMiniflareDatabasePath } = await import("./runner-CQs_cDSG.mjs");
|
|
706
710
|
if ((await getApplicationTables(getMiniflareDatabasePath(options.localD1PersistRoot ?? join(root, ".void"), options.localD1DatabaseId ?? "local")).catch(() => [])).length > 0) return;
|
|
707
711
|
}
|
|
708
712
|
voidWarn(`Schema found but no migrations in ${paths.sourceRelative("db/migrations")}/.\n \`void db push\` syncs the schema to your local DB without creating migration files.
|
|
@@ -1983,10 +1987,10 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
1983
1987
|
else warn();
|
|
1984
1988
|
return;
|
|
1985
1989
|
}
|
|
1986
|
-
const { collectMigrations } = await import("./
|
|
1987
|
-
const { validateMigrations } = await import("./validate-
|
|
1990
|
+
const { collectMigrations } = await import("./collect-DAUItMDS.mjs");
|
|
1991
|
+
const { validateMigrations } = await import("./validate-DqJ33oHj.mjs");
|
|
1988
1992
|
const allMigrations = collectMigrations(migrationsDir);
|
|
1989
|
-
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-
|
|
1993
|
+
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-1o47achK.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-D7z01mQS.mjs").then((runner) => runner.getPgAppliedMigrations(url));
|
|
1990
1994
|
const appliedSet = new Set(appliedNames);
|
|
1991
1995
|
const pending = allMigrations.filter((migration) => !appliedSet.has(migration.name));
|
|
1992
1996
|
if (pending.length > 0) try {
|
|
@@ -1994,12 +1998,12 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
1994
1998
|
} catch (err) {
|
|
1995
1999
|
voidWarn(err instanceof Error ? err.message : String(err));
|
|
1996
2000
|
}
|
|
1997
|
-
const applied = dialect === "mysql" ? await import("./runner-mysql-
|
|
2001
|
+
const applied = dialect === "mysql" ? await import("./runner-mysql-1o47achK.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url)) : await import("./runner-pg-D7z01mQS.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
|
|
1998
2002
|
if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
|
|
1999
2003
|
} else if (hasSqlMigrations) {
|
|
2000
|
-
const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./
|
|
2001
|
-
const { collectMigrations } = await import("./
|
|
2002
|
-
const { validateMigrations } = await import("./validate-
|
|
2004
|
+
const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-CQs_cDSG.mjs");
|
|
2005
|
+
const { collectMigrations } = await import("./collect-DAUItMDS.mjs");
|
|
2006
|
+
const { validateMigrations } = await import("./validate-DqJ33oHj.mjs");
|
|
2003
2007
|
const dbPath = getMiniflareDatabasePath(persistRoot, databaseId);
|
|
2004
2008
|
const allMigrations = collectMigrations(migrationsDir);
|
|
2005
2009
|
const appliedRows = await getAppliedMigrations(dbPath);
|
|
@@ -2014,7 +2018,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
2014
2018
|
if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
|
|
2015
2019
|
}
|
|
2016
2020
|
if (auth?.enabled) {
|
|
2017
|
-
const { runLocalVoidAuthMigrations } = await import("./node-
|
|
2021
|
+
const { runLocalVoidAuthMigrations } = await import("./node-Cupyf7-s.mjs");
|
|
2018
2022
|
await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth.configPath);
|
|
2019
2023
|
voidLog("Applied Better Auth migrations");
|
|
2020
2024
|
}
|
|
@@ -5029,8 +5033,8 @@ function routingPlugin(root, options) {
|
|
|
5029
5033
|
if (!options.target) {
|
|
5030
5034
|
const migrationsDir = paths.migrationsDir;
|
|
5031
5035
|
if (existsSync(migrationsDir) || compileOptions.auth) {
|
|
5032
|
-
const { collectMigrations } = await import("./
|
|
5033
|
-
const { buildMigrationPlanBundle } = await import("./
|
|
5036
|
+
const { collectMigrations } = await import("./collect-DAUItMDS.mjs");
|
|
5037
|
+
const { buildMigrationPlanBundle } = await import("./plan-DpuOr14e.mjs");
|
|
5034
5038
|
const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
|
|
5035
5039
|
const dialect = getDatabaseDialect(readConfig(root));
|
|
5036
5040
|
compileOptions.migrationHandlerPath = resolveFile(dialect === "postgresql" ? "#self/runtime/migration-handler-pg" : dialect === "mysql" ? "#self/runtime/migration-handler-mysql" : "#self/runtime/migration-handler");
|
|
@@ -5343,9 +5347,14 @@ import original from ${JSON.stringify(original)};
|
|
|
5343
5347
|
export default {
|
|
5344
5348
|
...original,
|
|
5345
5349
|
async fetch(request, env, ctx) {
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5350
|
+
if (request.method === "POST") {
|
|
5351
|
+
const pathname = new URL(request.url).pathname;
|
|
5352
|
+
if (pathname === "/__void/scheduled" || pathname === "/__void/queue") {
|
|
5353
|
+
const { handleDevTrigger } = await import(${JSON.stringify(frameworkTriggersDispatchPath(root))});
|
|
5354
|
+
const response = await handleDevTrigger(request, env, ctx);
|
|
5355
|
+
if (response) return response;
|
|
5356
|
+
}
|
|
5357
|
+
}
|
|
5349
5358
|
return original.fetch(request, env, ctx);
|
|
5350
5359
|
},
|
|
5351
5360
|
};
|
|
@@ -5572,10 +5581,10 @@ function readVoidDevCredentials(root) {
|
|
|
5572
5581
|
* block the server. On completion, writes project.json and restarts the server.
|
|
5573
5582
|
*/
|
|
5574
5583
|
async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
5575
|
-
const { select, text, isCancel, log } = await import("./
|
|
5576
|
-
const { PlatformClient } = await import("./client-
|
|
5577
|
-
const { attachSelectedPlatform, writeProjectConfig } = await import("./
|
|
5578
|
-
const { inferDefaultSlug } = await import("./resolve-project
|
|
5584
|
+
const { select, text, isCancel, log } = await import("./dist-C5fND3R0.mjs");
|
|
5585
|
+
const { PlatformClient } = await import("./client-DAAivdid.mjs");
|
|
5586
|
+
const { attachSelectedPlatform, writeProjectConfig } = await import("./project-BEBFDFLz.mjs");
|
|
5587
|
+
const { inferDefaultSlug } = await import("./resolve-project-BTotl8Nn.mjs");
|
|
5579
5588
|
const client = new PlatformClient(token, apiUrl);
|
|
5580
5589
|
let projects;
|
|
5581
5590
|
try {
|
|
@@ -5601,8 +5610,8 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
|
5601
5610
|
let projectId;
|
|
5602
5611
|
let slug;
|
|
5603
5612
|
if (result === "__create__") {
|
|
5604
|
-
const { validateProjectSlug } = await import("./
|
|
5605
|
-
const { createProjectWithSlugRetry } = await import("./create-project-
|
|
5613
|
+
const { validateProjectSlug } = await import("./project-slug-DofjTFd-.mjs");
|
|
5614
|
+
const { createProjectWithSlugRetry } = await import("./create-project-CI-17RVJ.mjs");
|
|
5606
5615
|
let created;
|
|
5607
5616
|
try {
|
|
5608
5617
|
created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
|
|
@@ -5645,19 +5654,49 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
|
5645
5654
|
* Binding inference runs synchronously here so results are available
|
|
5646
5655
|
* before the Cloudflare plugin initializes.
|
|
5647
5656
|
*
|
|
5648
|
-
*
|
|
5649
|
-
* the Cloudflare plugin reads it and provides the resolved config to our
|
|
5657
|
+
* The Cloudflare plugin reads Void's generated config and provides it to our
|
|
5650
5658
|
* config function. Bindings already defined there (with real IDs for
|
|
5651
5659
|
* production deployment) are preserved — we only add inferred bindings
|
|
5652
5660
|
* that are missing. This allows `vite build && wrangler deploy` to work
|
|
5653
5661
|
* for deploying directly to Cloudflare without the Void platform.
|
|
5654
5662
|
*/
|
|
5663
|
+
const scheduledPointerCleanups = /* @__PURE__ */ new Set();
|
|
5664
|
+
const scheduledPreviewPointerCleanups = /* @__PURE__ */ new Set();
|
|
5655
5665
|
function voidPlugin(options) {
|
|
5656
5666
|
const root = process.cwd();
|
|
5657
5667
|
const directCloudflareDestination = readDeploymentPlatform(root) === "cloudflare";
|
|
5658
5668
|
warnIfPackageJsonIsNotEsm(root);
|
|
5659
5669
|
const devTriggerToken = isViteBuildOrPreview() ? crypto.randomUUID() : getOrCreateDevTriggerToken(root);
|
|
5660
5670
|
const config = readConfig(root);
|
|
5671
|
+
const projectCloudflareConfigPath = !isNodeTarget(config.target) ? materializeCloudflareConfig(root) : void 0;
|
|
5672
|
+
const cloudflareConfigPath = projectCloudflareConfigPath && existsSync(projectCloudflareConfigPath) ? projectCloudflareConfigPath : void 0;
|
|
5673
|
+
let previewing = false;
|
|
5674
|
+
const implicitDeployGuard = {
|
|
5675
|
+
name: "void:remove-implicit-cloudflare-deploy-pointer",
|
|
5676
|
+
enforce: "pre",
|
|
5677
|
+
config(_config, environment) {
|
|
5678
|
+
previewing = environment.isPreview === true;
|
|
5679
|
+
if (previewing && existsSync(join(root, "void.config.ts"))) {
|
|
5680
|
+
if (restoreCloudflarePreviewPointer(root) && !scheduledPreviewPointerCleanups.has(root)) {
|
|
5681
|
+
scheduledPreviewPointerCleanups.add(root);
|
|
5682
|
+
process.once("exit", () => {
|
|
5683
|
+
rmSync(join(root, ".wrangler", "deploy", "config.json"), { force: true });
|
|
5684
|
+
});
|
|
5685
|
+
}
|
|
5686
|
+
}
|
|
5687
|
+
},
|
|
5688
|
+
closeBundle() {
|
|
5689
|
+
if (!previewing && existsSync(join(root, "void.config.ts")) && process.env["VOID_CLOUDFLARE_DEPLOY_BUILD"] !== "1") {
|
|
5690
|
+
const removePointer = () => stashCloudflareDeployPointer(root);
|
|
5691
|
+
if (detected?.name === "astro") {
|
|
5692
|
+
if (!scheduledPointerCleanups.has(root)) {
|
|
5693
|
+
scheduledPointerCleanups.add(root);
|
|
5694
|
+
process.once("exit", removePointer);
|
|
5695
|
+
}
|
|
5696
|
+
} else removePointer();
|
|
5697
|
+
}
|
|
5698
|
+
}
|
|
5699
|
+
};
|
|
5661
5700
|
const paths = resolveProjectPaths(root, config);
|
|
5662
5701
|
let routeEnvironment = "prod";
|
|
5663
5702
|
assertNoRootSourceConventionConflicts(paths);
|
|
@@ -5798,6 +5837,7 @@ function voidPlugin(options) {
|
|
|
5798
5837
|
name: "void:wrangler-compat",
|
|
5799
5838
|
enforce: "pre",
|
|
5800
5839
|
config(_, env) {
|
|
5840
|
+
if (env.command === "serve" && directCloudflareDestination && bindings.needsAI) process.env.CLOUDFLARE_AUTH_USE_KEYRING = "true";
|
|
5801
5841
|
syncFrameworkCompat(ensureWranglerCompat(root, config));
|
|
5802
5842
|
if (env.command !== "serve") return;
|
|
5803
5843
|
if (ensureWranglerNodejsAlsFlag(root)) voidLog("Synced nodejs_als to Cloudflare config");
|
|
@@ -5809,17 +5849,28 @@ function voidPlugin(options) {
|
|
|
5809
5849
|
syncFrameworkCompat(ensureWranglerCompat(root, config));
|
|
5810
5850
|
}
|
|
5811
5851
|
};
|
|
5852
|
+
const syncFrameworkBindings = (command) => {
|
|
5853
|
+
if (command !== "serve") return;
|
|
5854
|
+
if (syncWranglerBindings(root, {
|
|
5855
|
+
...bindings,
|
|
5856
|
+
needsD1: dialect === "sqlite" && bindings.needsD1
|
|
5857
|
+
}, {
|
|
5858
|
+
bindingNames,
|
|
5859
|
+
...directCloudflareDestination && bindings.needsAI ? { directCloudflareAi: { gateway: config.ai?.gateway } } : {},
|
|
5860
|
+
websockets: websocketRoutes,
|
|
5861
|
+
sandbox: sandboxConfig,
|
|
5862
|
+
live: liveConfig
|
|
5863
|
+
})) voidLog("Synced bindings to Cloudflare config");
|
|
5864
|
+
};
|
|
5812
5865
|
const wranglerSyncPlugin = {
|
|
5813
5866
|
name: "void:wrangler-sync",
|
|
5867
|
+
enforce: "pre",
|
|
5868
|
+
config(_, env) {
|
|
5869
|
+
syncFrameworkBindings(env.command);
|
|
5870
|
+
},
|
|
5814
5871
|
configResolved(resolvedConfig) {
|
|
5815
5872
|
syncFrameworkCompat(readWranglerCompat(root, config));
|
|
5816
|
-
|
|
5817
|
-
if (syncWranglerBindings(root, bindings, {
|
|
5818
|
-
bindingNames,
|
|
5819
|
-
websockets: websocketRoutes,
|
|
5820
|
-
sandbox: sandboxConfig,
|
|
5821
|
-
live: liveConfig
|
|
5822
|
-
})) voidLog("Synced bindings to wrangler.jsonc");
|
|
5873
|
+
syncFrameworkBindings(resolvedConfig.command);
|
|
5823
5874
|
}
|
|
5824
5875
|
};
|
|
5825
5876
|
const nuxtVite8WebSocketCompatPlugin = detected.name === "nuxt" ? {
|
|
@@ -5876,7 +5927,8 @@ function voidPlugin(options) {
|
|
|
5876
5927
|
frameworkTriggersPlugin(root, { devTriggerToken }),
|
|
5877
5928
|
...detected.name === "nuxt" ? [nitroDevTriggerInjectPlugin(root, { serverDir: "server" })] : [],
|
|
5878
5929
|
...detected.name === "analog" ? [analogDevTriggerInjectPlugin(root)] : [],
|
|
5879
|
-
...detected.name === "astro" ? [astroDevTriggerInjectPlugin(root)] : []
|
|
5930
|
+
...detected.name === "astro" ? [astroDevTriggerInjectPlugin(root)] : [],
|
|
5931
|
+
implicitDeployGuard
|
|
5880
5932
|
];
|
|
5881
5933
|
}
|
|
5882
5934
|
const remoteMode = resolveRemoteMode(config.remote);
|
|
@@ -5924,7 +5976,7 @@ function voidPlugin(options) {
|
|
|
5924
5976
|
}
|
|
5925
5977
|
const d1Name = bindingNames?.d1 ?? "DB";
|
|
5926
5978
|
const d1 = [];
|
|
5927
|
-
if ((bindings.needsD1 || authEnabled
|
|
5979
|
+
if (dialect === "sqlite" && (bindings.needsD1 || authEnabled) && !hasBinding(resolved.d1_databases, d1Name)) d1.push({
|
|
5928
5980
|
binding: d1Name,
|
|
5929
5981
|
database_name: "default",
|
|
5930
5982
|
database_id: "local"
|
|
@@ -6228,7 +6280,7 @@ function voidPlugin(options) {
|
|
|
6228
6280
|
if (resolved.command !== "build") return;
|
|
6229
6281
|
if (config.routing?.notFound !== void 0 && !process.env.VOID_DEPLOY_BUILD && !notFoundIgnoredWarned) {
|
|
6230
6282
|
notFoundIgnoredWarned = true;
|
|
6231
|
-
voidWarn(`Void generates no asset routing policy for a ${framework} build, so "routing.notFound" in void.
|
|
6283
|
+
voidWarn(`Void generates no asset routing policy for a ${framework} build, so "routing.notFound" in void.config.ts is not written to the built worker config. During a self-hosted build and direct Cloudflare deployment, it takes effect only if your own Cloudflare config declares a complete \`assets\` policy (\`binding\`, \`directory\`, \`not_found_handling\`, \`run_worker_first\`); otherwise Cloudflare's default applies. Managed \`void deploy\` supplies the policy for you.`);
|
|
6232
6284
|
}
|
|
6233
6285
|
generateClassATriggerWrapper(root, framework, getOriginalFrameworkEntry(framework, root), true, resolved.build.assetsDir, config.routing?.notFound);
|
|
6234
6286
|
}
|
|
@@ -6281,24 +6333,26 @@ function voidPlugin(options) {
|
|
|
6281
6333
|
devTriggerToken
|
|
6282
6334
|
}),
|
|
6283
6335
|
...cloudflare({
|
|
6336
|
+
configPath: cloudflareConfigPath,
|
|
6284
6337
|
...inspectorPortOption,
|
|
6285
6338
|
persistState: { path: localD1.persistRoot },
|
|
6286
6339
|
auxiliaryWorkers: options?.auxiliaryWorkers,
|
|
6287
6340
|
viteEnvironment,
|
|
6288
6341
|
config: mergeBindings
|
|
6289
|
-
})
|
|
6342
|
+
}),
|
|
6343
|
+
implicitDeployGuard
|
|
6290
6344
|
];
|
|
6291
6345
|
}
|
|
6292
6346
|
if (isNodeTarget(config.target)) {
|
|
6293
6347
|
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.");
|
|
6294
|
-
if (config.inference?.bindings) voidWarn("\"inference.bindings\" in void.
|
|
6295
|
-
if (config.worker) voidWarn("\"worker\" in void.
|
|
6296
|
-
if (config.remote) voidWarn("\"remote\" in void.
|
|
6348
|
+
if (config.inference?.bindings) voidWarn("\"inference.bindings\" in void.config.ts is ignored with target: \"" + config.target + "\"");
|
|
6349
|
+
if (config.worker) voidWarn("\"worker\" in void.config.ts is ignored with target: \"" + config.target + "\"");
|
|
6350
|
+
if (config.remote) voidWarn("\"remote\" in void.config.ts is ignored with target: \"" + config.target + "\"");
|
|
6297
6351
|
if (bindings.needsSandbox) throw new Error(`sandbox: Cloudflare Sandboxes require target: "cloudflare". They are not available with target: '${config.target}'.`);
|
|
6298
6352
|
if (bindings.needsLive) throw new Error(`live: void/live requires target: "cloudflare". It is not available with target: '${config.target}'.`);
|
|
6299
6353
|
if (durableObjects.length > 0) throw new Error(`durable: durable-objects/ requires target: "cloudflare". It is not available with target: '${config.target}'.`);
|
|
6300
6354
|
if (hasInboundEmail) throw new Error(`email: inbound email handlers (email/) require target: "cloudflare". They are not available with target: '${config.target}'.`);
|
|
6301
|
-
if (config.routing?.revalidate) voidWarn("\"routing.revalidate\" in void.
|
|
6355
|
+
if (config.routing?.revalidate) voidWarn("\"routing.revalidate\" in void.config.ts is ignored with target: \"" + config.target + "\" (edge caching is CF-only)");
|
|
6302
6356
|
return [
|
|
6303
6357
|
restartPlugin(),
|
|
6304
6358
|
envPlugin,
|
|
@@ -6421,12 +6475,14 @@ function voidPlugin(options) {
|
|
|
6421
6475
|
devTriggerToken
|
|
6422
6476
|
}),
|
|
6423
6477
|
...cloudflare({
|
|
6478
|
+
configPath: cloudflareConfigPath,
|
|
6424
6479
|
...inspectorPortOption,
|
|
6425
6480
|
persistState: { path: localD1.persistRoot },
|
|
6426
6481
|
auxiliaryWorkers: options?.auxiliaryWorkers,
|
|
6427
6482
|
viteEnvironment: { name: DEFAULT_WORKER_ENVIRONMENT_NAME },
|
|
6428
6483
|
config: mergeBindings
|
|
6429
|
-
})
|
|
6484
|
+
}),
|
|
6485
|
+
implicitDeployGuard
|
|
6430
6486
|
];
|
|
6431
6487
|
}
|
|
6432
6488
|
//#endregion
|