void 0.20.3 → 0.21.1
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-g_ymMkUe.mjs} +5 -5
- package/dist/{auth-link-ElDTgF7j.mjs → auth-link-DFvxIyZi.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-wJAv808h.mjs} +6 -4
- package/dist/{cache-D98YTqeE.mjs → cache-Be0Fu5Ka.mjs} +6 -4
- package/dist/{cancel-deploy-CPbEQLMG.mjs → cancel-deploy-BgmyOwhe.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 +944 -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-LnvW4HKx.mjs} +8 -6
- package/dist/{create-project-D0oXA090.mjs → create-project-BZBl_gQ0.mjs} +8 -23
- package/dist/create-project-JV9-6ICF.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-Mzv88E1C.mjs} +48 -44
- package/dist/{delete-BZ4-WaGm.mjs → delete-Ri6JemSU.mjs} +6 -4
- package/dist/deploy-DAH2-m_-.mjs +2 -0
- package/dist/{deploy-BAhhcg5q.mjs → deploy-DEsMVrCY.mjs} +796 -198
- 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-BA37Ye7T.mjs} +7 -5
- package/dist/{route-types-Da-DpyUp.mjs → drizzle-Beb2Am5S.mjs} +1 -280
- package/dist/{email-Bj7Cvdwp.mjs → email-C5NsxrQG.mjs} +14 -12
- package/dist/{email-Ce6SQq-i.mjs → email-C5kaZXzJ.mjs} +2 -2
- package/dist/{entry-DU3oDoQ3.mjs → entry-DdRFGK0y.mjs} +2 -2
- package/dist/{env-DBKmK4vc.mjs → env-DX_v-Q-v.mjs} +1 -1
- package/dist/{env-DP_EErve.mjs → env-U_ohASB0.mjs} +9 -7
- 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-B87rlalt.mjs +2 -0
- package/dist/{gen-B_wPnVTK.mjs → gen-pg-Ojg8Y.mjs} +13 -11
- package/dist/{generate-RTK8_kK1.mjs → generate-C0VY6RVf.mjs} +2 -2
- package/dist/{github-cmd-C-z_xRrQ.mjs → github-cmd-DsrkweIl.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-B403BLBB.mjs +2 -0
- package/dist/{help-CwOX-zmI.mjs → help-sBhFH6pi.mjs} +17 -12
- package/dist/index.d.mts +2 -20
- package/dist/index.mjs +116 -60
- package/dist/{init-BGktCXgA.mjs → init-C--Yyj1b.mjs} +49 -50
- package/dist/{link-D2kbqhWb.mjs → link-BC-mNG9-.mjs} +7 -5
- package/dist/{list-CvkK_G7k.mjs → list-DHU1Wj6c.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-BwiopVdg.mjs +2 -0
- package/dist/{login-WIjNc77c.mjs → login-jKe_0QZL.mjs} +6 -11
- package/dist/{logs-dLUFCapG.mjs → logs-BG11f5PR.mjs} +6 -4
- package/dist/migrate-BV8qHiCb.mjs +285 -0
- package/dist/migrate-BXY3B3m7.mjs +2 -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-BwAS2XZt.mjs} +6 -6
- package/dist/output-CCH48AMM.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-C-hv-_Ok.mjs} +6 -6
- package/dist/{platform-auth-protection-Drl0qhrn.mjs → platform-auth-protection-DjTE5Hj-.mjs} +7 -5
- package/dist/{platform-auth-recovery-CmKEWpDo.mjs → platform-auth-recovery-Cr0r8TEb.mjs} +6 -5
- package/dist/{platform-cmd-5q_k56xS.mjs → platform-cmd-0tEh2ZtA.mjs} +8 -5
- package/dist/platform-cmd-DE6dw45v.mjs +2 -0
- package/dist/{platform-domain-4GiDlcqx.mjs → platform-domain-B_7x6Iqx.mjs} +4 -3
- package/dist/platform-lifecycle-Dhx9Pnub.mjs +2 -0
- package/dist/{platform-lifecycle-R9xAxvtG.mjs → platform-lifecycle-Di0LbhPM.mjs} +208 -37
- package/dist/platform-management-B9LUtMt9.mjs +2 -0
- package/dist/{platform-management-BfWsXHEW.mjs → platform-management-eaiaU3uM.mjs} +8 -5
- package/dist/{platform-recovery-CbK-I1FB.mjs → platform-recovery-BxfA8E5C.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-D4CkM3_v.mjs +2 -0
- package/dist/{prepare-blNRQvQl.mjs → prepare-_T-Haxrr.mjs} +3 -2
- 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-DrnRJdep.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-CzRbO_kA.mjs} +6 -4
- package/dist/{project-token-Cirx7uwZ.mjs → project-token-Bwxjf4y6.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-DwrqUQZ8.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-B4tFWmkN.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-UtrRjhEO.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-BuGYkAkC.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 +8 -15
- 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 +60 -66
- package/skills/void/docs/guide/env-migration.md +1 -1
- package/skills/void/docs/guide/index.md +15 -41
- 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/quickstart.md +11 -78
- 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/index.md +17 -17
- package/skills/void/docs/integrations/cloudflare.md +91 -96
- 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 +40 -25
- package/skills/void/docs/reference/config.md +58 -35
- package/skills/void/docs/reference/structure.md +2 -2
- package/dist/validate-tBBN_dXH.mjs +0 -505
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { a as join, n as dirname } from "./dist-4WkAWhWx.mjs";
|
|
2
|
+
import { r as cliTitle } from "./output-CCH48AMM.mjs";
|
|
3
|
+
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-CKQ-Q5JS.mjs";
|
|
4
|
+
import { g as validateConfig } from "./config-Dxr6cTXn.mjs";
|
|
5
|
+
import { B as seedCloudflareConfig, I as VOID_LOCK_FILE, V as stashCloudflareDeployPointer } from "./wrangler-D01qs6VB.mjs";
|
|
6
|
+
import { O as intro, P as outro, j as log } from "./dist-Dn6nn2IU.mjs";
|
|
7
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { randomUUID } from "node:crypto";
|
|
9
|
+
import { parse, parseTree } from "jsonc-parser";
|
|
10
|
+
import { isDeepStrictEqual } from "node:util";
|
|
11
|
+
import { parseExpressionAt } from "acorn";
|
|
12
|
+
//#region src/cli/framework-config-migrate.ts
|
|
13
|
+
const GENERATED_PATH = "./.void-wrangler.jsonc";
|
|
14
|
+
const CONFIG_FILES = [
|
|
15
|
+
"vite.config.ts",
|
|
16
|
+
"vite.config.js",
|
|
17
|
+
"vite.config.mts",
|
|
18
|
+
"vite.config.mjs",
|
|
19
|
+
"vite.config.cts",
|
|
20
|
+
"vite.config.cjs",
|
|
21
|
+
"svelte.config.ts",
|
|
22
|
+
"svelte.config.js",
|
|
23
|
+
"astro.config.ts",
|
|
24
|
+
"astro.config.mjs",
|
|
25
|
+
"astro.config.js",
|
|
26
|
+
"astro.config.mts",
|
|
27
|
+
"nuxt.config.ts",
|
|
28
|
+
"nuxt.config.mjs",
|
|
29
|
+
"nuxt.config.js",
|
|
30
|
+
"nuxt.config.mts"
|
|
31
|
+
];
|
|
32
|
+
/** Find an adapter's explicit root Wrangler JSON file, including custom build filenames. */
|
|
33
|
+
function discoverFrameworkWranglerFiles(root) {
|
|
34
|
+
const names = /* @__PURE__ */ new Set();
|
|
35
|
+
for (const file of CONFIG_FILES) {
|
|
36
|
+
const path = join(root, file);
|
|
37
|
+
if (!existsSync(path)) continue;
|
|
38
|
+
const source = readFileSync(path, "utf8");
|
|
39
|
+
if (!source.includes("@sveltejs/adapter-cloudflare") && !source.includes("@astrojs/cloudflare") && !source.includes("nitro-cloudflare-dev")) continue;
|
|
40
|
+
for (const match of source.matchAll(/\b(?:configPath|config)\s*:\s*(['"])(?:\.\/)?(wrangler[A-Za-z0-9._-]*\.jsonc?)\1/g)) {
|
|
41
|
+
const name = match[2];
|
|
42
|
+
if (existsSync(join(root, name))) names.add(name);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return [...names];
|
|
46
|
+
}
|
|
47
|
+
function property(object, key) {
|
|
48
|
+
return object.properties?.find((item) => item.type === "Property" && !item.computed && item.kind === "init" && (item.key?.name === key || item.key?.value === key))?.value;
|
|
49
|
+
}
|
|
50
|
+
function setPath(object, key, file, edits, legacyName) {
|
|
51
|
+
const value = property(object, key);
|
|
52
|
+
if (!value) edits.push({
|
|
53
|
+
start: object.start + 1,
|
|
54
|
+
end: object.start + 1,
|
|
55
|
+
text: `${key}: '${GENERATED_PATH}', `
|
|
56
|
+
});
|
|
57
|
+
else if (value.type === "Literal" && typeof value.value === "string" && ([
|
|
58
|
+
"wrangler.jsonc",
|
|
59
|
+
"wrangler.json",
|
|
60
|
+
legacyName
|
|
61
|
+
].includes(value.value.replace(/^\.\//, "")) || value.value === GENERATED_PATH)) edits.push({
|
|
62
|
+
start: value.start,
|
|
63
|
+
end: value.end,
|
|
64
|
+
text: `'${GENERATED_PATH}'`
|
|
65
|
+
});
|
|
66
|
+
else throw new Error(`migrate: Update ${file} to pass ${GENERATED_PATH} to its Cloudflare adapter before removing the root Wrangler config.`);
|
|
67
|
+
}
|
|
68
|
+
function patchAdapterCall(source, identifier, file, kind, legacyName) {
|
|
69
|
+
const candidates = [...source.matchAll(new RegExp(`\\b${identifier}\\s*\\(`, "g"))];
|
|
70
|
+
const calls = [];
|
|
71
|
+
for (const candidate of candidates) try {
|
|
72
|
+
const parsed = parseExpressionAt(source, candidate.index, {
|
|
73
|
+
ecmaVersion: "latest",
|
|
74
|
+
sourceType: "module"
|
|
75
|
+
});
|
|
76
|
+
const first = parsed.expressions?.[0];
|
|
77
|
+
const node = parsed.type === "SequenceExpression" && source.slice(0, candidate.index).trimEnd().endsWith(":") && first?.type === "CallExpression" && /^\s*,/.test(source.slice(first.end)) ? first : parsed;
|
|
78
|
+
if (node.type === "CallExpression" && node.callee?.name === identifier) calls.push(node);
|
|
79
|
+
} catch {}
|
|
80
|
+
if (calls.length !== 1) throw new Error(`migrate: Update ${file} to pass ${GENERATED_PATH} to its Cloudflare adapter before removing the root Wrangler config.`);
|
|
81
|
+
const call = calls[0];
|
|
82
|
+
const args = call.arguments ?? [];
|
|
83
|
+
if (args.length > 1 || args.length === 1 && args[0]?.type !== "ObjectExpression") throw new Error(`migrate: Update ${file} to pass ${GENERATED_PATH} to its Cloudflare adapter before removing the root Wrangler config.`);
|
|
84
|
+
if (args.length === 0) {
|
|
85
|
+
const options = kind === "svelte" ? `{ config: '${GENERATED_PATH}', platformProxy: { configPath: '${GENERATED_PATH}' } }` : `{ configPath: '${GENERATED_PATH}' }`;
|
|
86
|
+
return `${source.slice(0, call.end - 1)}${options}${source.slice(call.end - 1)}`;
|
|
87
|
+
}
|
|
88
|
+
const options = args[0];
|
|
89
|
+
const edits = [];
|
|
90
|
+
if (kind === "astro") setPath(options, "configPath", file, edits, legacyName);
|
|
91
|
+
else {
|
|
92
|
+
setPath(options, "config", file, edits, legacyName);
|
|
93
|
+
const proxy = property(options, "platformProxy");
|
|
94
|
+
if (!proxy) edits.push({
|
|
95
|
+
start: options.start + 1,
|
|
96
|
+
end: options.start + 1,
|
|
97
|
+
text: `platformProxy: { configPath: '${GENERATED_PATH}' }, `
|
|
98
|
+
});
|
|
99
|
+
else if (proxy.type === "ObjectExpression") setPath(proxy, "configPath", file, edits, legacyName);
|
|
100
|
+
else throw new Error(`migrate: Update ${file} to pass ${GENERATED_PATH} to its Cloudflare adapter before removing the root Wrangler config.`);
|
|
101
|
+
}
|
|
102
|
+
return edits.sort((a, b) => b.start - a.start).reduce((result, edit) => `${result.slice(0, edit.start)}${edit.text}${result.slice(edit.end)}`, source);
|
|
103
|
+
}
|
|
104
|
+
/** Plan only edits whose adapter call can be identified without changing authored options. */
|
|
105
|
+
function planFrameworkConfigMigration(root, legacyName) {
|
|
106
|
+
const patches = [];
|
|
107
|
+
for (const file of CONFIG_FILES) {
|
|
108
|
+
const path = join(root, file);
|
|
109
|
+
if (!existsSync(path)) continue;
|
|
110
|
+
const original = readFileSync(path, "utf8");
|
|
111
|
+
let updated = original;
|
|
112
|
+
const svelteImport = /import\s+(\w+)\s+from\s+['"]@sveltejs\/adapter-cloudflare['"]/.exec(original);
|
|
113
|
+
if (svelteImport) {
|
|
114
|
+
const identifier = svelteImport[1];
|
|
115
|
+
updated = patchAdapterCall(updated, identifier, file, "svelte", legacyName);
|
|
116
|
+
} else if (/(?:from\s*['"]|require\(\s*['"]|import\(\s*['"])@sveltejs\/adapter-cloudflare['"]/.test(original)) throw new Error(`migrate: Update ${file} to pass ${GENERATED_PATH} to its Cloudflare adapter before removing the root Wrangler config.`);
|
|
117
|
+
const astroImport = /import\s+(\w+)\s+from\s+['"]@astrojs\/cloudflare['"]/.exec(original);
|
|
118
|
+
if (astroImport) {
|
|
119
|
+
const identifier = astroImport[1];
|
|
120
|
+
updated = patchAdapterCall(updated, identifier, file, "astro", legacyName);
|
|
121
|
+
} else if (/(?:from\s*['"]|require\(\s*['"]|import\(\s*['"])@astrojs\/cloudflare['"]/.test(original)) throw new Error(`migrate: Update ${file} to pass ${GENERATED_PATH} to its Cloudflare adapter before removing the root Wrangler config.`);
|
|
122
|
+
if (original.includes("nitro-cloudflare-dev") && !original.includes("cloudflareDev:")) {
|
|
123
|
+
const preset = /preset:\s*['"]cloudflare-module['"]\s*,/g;
|
|
124
|
+
if ([...updated.matchAll(preset)].length !== 1) throw new Error(`migrate: Set nitro.cloudflareDev.configPath to ${GENERATED_PATH} in ${file} before removing the root Wrangler config.`);
|
|
125
|
+
updated = updated.replace(preset, (match) => `${match}\n cloudflareDev: { configPath: '${GENERATED_PATH}' },`);
|
|
126
|
+
} else if (original.includes("nitro-cloudflare-dev") && original.includes("cloudflareDev:") && !original.includes(`configPath: '${GENERATED_PATH}'`) && !original.includes(`configPath: "${GENERATED_PATH}"`)) {
|
|
127
|
+
const rootPath = /configPath:\s*(['"])(?:\.\/)?([^'"]+)\1/g;
|
|
128
|
+
const names = /* @__PURE__ */ new Set([
|
|
129
|
+
"wrangler.jsonc",
|
|
130
|
+
"wrangler.json",
|
|
131
|
+
legacyName
|
|
132
|
+
]);
|
|
133
|
+
const matches = [...updated.matchAll(rootPath)].filter((match) => names.has(match[2]));
|
|
134
|
+
if (matches.length !== 1) throw new Error(`migrate: Set nitro.cloudflareDev.configPath to ${GENERATED_PATH} in ${file} before removing the root Wrangler config.`);
|
|
135
|
+
const match = matches[0];
|
|
136
|
+
updated = updated.slice(0, match.index) + `configPath: '${GENERATED_PATH}'` + updated.slice(match.index + match[0].length);
|
|
137
|
+
}
|
|
138
|
+
if (updated !== original) patches.push({
|
|
139
|
+
file,
|
|
140
|
+
original,
|
|
141
|
+
updated
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return patches;
|
|
145
|
+
}
|
|
146
|
+
function applyFrameworkConfigMigration(root, patches) {
|
|
147
|
+
for (const patch of patches) {
|
|
148
|
+
const path = join(root, patch.file);
|
|
149
|
+
if (readFileSync(path, "utf8") !== patch.original) throw new Error(`migrate: ${patch.file} changed during migration. Retry.`);
|
|
150
|
+
const backup = join(root, ".void", "config-migration", patch.file);
|
|
151
|
+
mkdirSync(dirname(backup), { recursive: true });
|
|
152
|
+
if (!existsSync(backup)) writeFileSync(backup, patch.original, { flag: "wx" });
|
|
153
|
+
writeFileSync(path, patch.updated);
|
|
154
|
+
}
|
|
155
|
+
return patches.length > 0;
|
|
156
|
+
}
|
|
157
|
+
function migrateFrameworkAdapterPaths(root) {
|
|
158
|
+
if (!existsSync(join(root, "void.config.ts"))) return false;
|
|
159
|
+
return applyFrameworkConfigMigration(root, planFrameworkConfigMigration(root));
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region src/cli/migrate.ts
|
|
163
|
+
const LEGACY_FILE = "void.json";
|
|
164
|
+
const GENERATED_MARKER = "// Generated by void migrate.";
|
|
165
|
+
const OLD_GENERATED_MARKER = "// Generated from void.json by void migrate.";
|
|
166
|
+
const INIT_GENERATED_MARKER = "// Generated by void init.";
|
|
167
|
+
function parseWranglerJsonc(path, raw) {
|
|
168
|
+
const source = raw.replace(/^\uFEFF/, "");
|
|
169
|
+
const errors = [];
|
|
170
|
+
const parsed = parse(source, errors, { allowTrailingComma: true });
|
|
171
|
+
if (errors.length > 0 || typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) throw new Error(`migrate: Invalid JSON/JSONC in ${path}. Fix it before migrating.`);
|
|
172
|
+
function assertUnique(node) {
|
|
173
|
+
if (!node) return;
|
|
174
|
+
if (node.type === "object") {
|
|
175
|
+
const seen = /* @__PURE__ */ new Set();
|
|
176
|
+
for (const property of node.children ?? []) {
|
|
177
|
+
const key = property.children?.[0]?.value;
|
|
178
|
+
if (seen.has(key)) throw new Error(`migrate: Duplicate key ${JSON.stringify(key)} in ${path}. Resolve it before migrating.`);
|
|
179
|
+
seen.add(key);
|
|
180
|
+
assertUnique(property.children?.[1]);
|
|
181
|
+
}
|
|
182
|
+
} else for (const child of node.children ?? []) assertUnique(child);
|
|
183
|
+
}
|
|
184
|
+
assertUnique(parseTree(source));
|
|
185
|
+
return parsed;
|
|
186
|
+
}
|
|
187
|
+
function backup(root, name, content) {
|
|
188
|
+
const dir = join(root, ".void", "config-migration");
|
|
189
|
+
mkdirSync(dir, { recursive: true });
|
|
190
|
+
const path = join(dir, name);
|
|
191
|
+
if (!existsSync(path)) writeFileSync(path, content, { flag: "wx" });
|
|
192
|
+
}
|
|
193
|
+
function generatedSource(config) {
|
|
194
|
+
return `${GENERATED_MARKER}\nimport { defineConfig } from 'void/config';\n\nexport default defineConfig(${JSON.stringify(config, null, 2)});\n`;
|
|
195
|
+
}
|
|
196
|
+
function isOrphanedCompatibilityConfig(root, legacy, typed) {
|
|
197
|
+
if (!isDeepStrictEqual(legacy, { worker: { compatibility_date: "2026-02-24" } })) return false;
|
|
198
|
+
const backupPath = join(root, ".void", "config-migration", LEGACY_FILE);
|
|
199
|
+
if (!existsSync(backupPath)) return false;
|
|
200
|
+
try {
|
|
201
|
+
const original = JSON.parse(readFileSync(backupPath, "utf8"));
|
|
202
|
+
delete original.$schema;
|
|
203
|
+
return isDeepStrictEqual(original, typed);
|
|
204
|
+
} catch {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function ignoreGeneratedCloudflareConfig(root) {
|
|
209
|
+
const path = join(root, ".gitignore");
|
|
210
|
+
const source = existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
211
|
+
if (source.split(/\r?\n/).some((line) => /^\/?\.void-wrangler\.jsonc$/.test(line.trim()))) return;
|
|
212
|
+
writeFileSync(path, `${source}${source && !source.endsWith("\n") ? "\n" : ""}.void-wrangler.jsonc\n`);
|
|
213
|
+
}
|
|
214
|
+
/** Move Void and Cloudflare JSON/JSONC settings into a typed, checked-in project config. */
|
|
215
|
+
function migrateLegacyVoidConfig(root) {
|
|
216
|
+
const legacyPath = join(root, LEGACY_FILE);
|
|
217
|
+
const wranglerFiles = [.../* @__PURE__ */ new Set([...["wrangler.jsonc", "wrangler.json"].filter((name) => existsSync(join(root, name))), ...discoverFrameworkWranglerFiles(root)])];
|
|
218
|
+
if (wranglerFiles.length > 1) throw new Error(`migrate: Multiple root Wrangler JSON files exist (${wranglerFiles.join(", ")}). Keep one before migrating.`);
|
|
219
|
+
if (existsSync(join(root, "wrangler.toml"))) throw new Error("migrate: Wrangler TOML is not supported. Convert it to JSON/JSONC first.");
|
|
220
|
+
const wranglerName = wranglerFiles[0];
|
|
221
|
+
const typedPath = join(root, TYPED_CONFIG_FILE);
|
|
222
|
+
if (!existsSync(legacyPath) && !wranglerName) {
|
|
223
|
+
if (existsSync(typedPath)) stashCloudflareDeployPointer(root);
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
const frameworkPatches = planFrameworkConfigMigration(root, wranglerName);
|
|
227
|
+
const raw = existsSync(legacyPath) ? readFileSync(legacyPath, "utf8") : void 0;
|
|
228
|
+
let legacy = {};
|
|
229
|
+
if (raw !== void 0) {
|
|
230
|
+
try {
|
|
231
|
+
legacy = JSON.parse(raw);
|
|
232
|
+
} catch {
|
|
233
|
+
throw new Error(`migrate: Invalid JSON in ${LEGACY_FILE}. Fix it before migrating.`);
|
|
234
|
+
}
|
|
235
|
+
validateConfig(legacy);
|
|
236
|
+
}
|
|
237
|
+
const withoutSchema = { ...legacy };
|
|
238
|
+
delete withoutSchema.$schema;
|
|
239
|
+
const wranglerRaw = wranglerName ? readFileSync(join(root, wranglerName), "utf8") : void 0;
|
|
240
|
+
const cloudflare = wranglerName && wranglerRaw !== void 0 ? parseWranglerJsonc(wranglerName, wranglerRaw) : void 0;
|
|
241
|
+
const hadTyped = existsSync(typedPath);
|
|
242
|
+
let current;
|
|
243
|
+
if (hadTyped) {
|
|
244
|
+
const existing = readFileSync(typedPath, "utf8");
|
|
245
|
+
if (!existing.startsWith(GENERATED_MARKER) && !existing.startsWith(OLD_GENERATED_MARKER) && !existing.startsWith(INIT_GENERATED_MARKER)) throw new Error(`migrate: ${TYPED_CONFIG_FILE} already exists. Move the legacy settings into it before deleting the old files.`);
|
|
246
|
+
current = validateConfig(loadTypedVoidConfigFile(typedPath), TYPED_CONFIG_FILE);
|
|
247
|
+
const currentVoid = { ...current };
|
|
248
|
+
delete currentVoid.cloudflare;
|
|
249
|
+
if (raw !== void 0 && !isDeepStrictEqual(currentVoid, withoutSchema) && !isOrphanedCompatibilityConfig(root, withoutSchema, currentVoid)) throw new Error(`migrate: ${LEGACY_FILE} and ${TYPED_CONFIG_FILE} differ. Resolve their settings before retrying.`);
|
|
250
|
+
if (cloudflare && current.cloudflare !== void 0 && !isDeepStrictEqual(current.cloudflare, cloudflare)) throw new Error(`migrate: Cloudflare settings in ${TYPED_CONFIG_FILE} differ from ${wranglerName}. Resolve them before retrying.`);
|
|
251
|
+
}
|
|
252
|
+
const next = { ...current ?? withoutSchema };
|
|
253
|
+
if (cloudflare) next.cloudflare = cloudflare;
|
|
254
|
+
const needsTypedWrite = !hadTyped || !isDeepStrictEqual(current, next);
|
|
255
|
+
const temporaryPath = join(root, `.void.config.${randomUUID()}.ts`);
|
|
256
|
+
if (needsTypedWrite) writeFileSync(temporaryPath, generatedSource(next), { flag: "wx" });
|
|
257
|
+
try {
|
|
258
|
+
if (needsTypedWrite) {
|
|
259
|
+
const loaded = loadTypedVoidConfigFile(temporaryPath);
|
|
260
|
+
validateConfig(loaded, TYPED_CONFIG_FILE);
|
|
261
|
+
if (!isDeepStrictEqual(loaded, next)) throw new Error("migrate: The typed config did not reproduce the original settings.");
|
|
262
|
+
}
|
|
263
|
+
if (raw !== void 0) backup(root, LEGACY_FILE, raw);
|
|
264
|
+
if (wranglerName && wranglerRaw !== void 0) backup(root, wranglerName, wranglerRaw);
|
|
265
|
+
if (cloudflare && wranglerRaw !== void 0) seedCloudflareConfig(root, cloudflare, wranglerRaw);
|
|
266
|
+
if (needsTypedWrite) renameSync(temporaryPath, typedPath);
|
|
267
|
+
applyFrameworkConfigMigration(root, frameworkPatches);
|
|
268
|
+
if (raw !== void 0) unlinkSync(legacyPath);
|
|
269
|
+
if (wranglerName) unlinkSync(join(root, wranglerName));
|
|
270
|
+
ignoreGeneratedCloudflareConfig(root);
|
|
271
|
+
stashCloudflareDeployPointer(root);
|
|
272
|
+
return true;
|
|
273
|
+
} finally {
|
|
274
|
+
rmSync(temporaryPath, { force: true });
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
async function runMigrateCommand(root) {
|
|
278
|
+
console.log();
|
|
279
|
+
intro(cliTitle("migrate"));
|
|
280
|
+
if (migrateLegacyVoidConfig(root)) log.success(`Migrated project settings to ${TYPED_CONFIG_FILE}. Commit it and ${VOID_LOCK_FILE} when present.`);
|
|
281
|
+
else log.info("No legacy project configuration found.");
|
|
282
|
+
outro("Configuration migration complete.");
|
|
283
|
+
}
|
|
284
|
+
//#endregion
|
|
285
|
+
export { migrateFrameworkAdapterPaths as i, runMigrateCommand as n, discoverFrameworkWranglerFiles as r, migrateLegacyVoidConfig as t };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/runtime/migration-handler.d.ts
|
|
2
|
+
type MigrationEntry = {
|
|
3
|
+
name: string;
|
|
4
|
+
sql: string;
|
|
5
|
+
};
|
|
6
|
+
type MigrationResult = {
|
|
7
|
+
name: string;
|
|
8
|
+
applied: boolean;
|
|
9
|
+
durationMs: number;
|
|
10
|
+
error?: string;
|
|
11
|
+
status?: "applied" | "skipped" | "failed";
|
|
12
|
+
stability?: "stable" | "legacy";
|
|
13
|
+
};
|
|
14
|
+
type MigrationResponse = {
|
|
15
|
+
ok: boolean;
|
|
16
|
+
migrations: Array<MigrationResult>;
|
|
17
|
+
error?: string;
|
|
18
|
+
protocolVersion?: 2;
|
|
19
|
+
attemptId?: string;
|
|
20
|
+
confirmedApplied?: Array<string>;
|
|
21
|
+
confirmedSkipped?: Array<string>;
|
|
22
|
+
stability?: "stable" | "legacy";
|
|
23
|
+
warnings?: Array<string>;
|
|
24
|
+
};
|
|
25
|
+
type MigrationExecutionPlan = {
|
|
26
|
+
name: string;
|
|
27
|
+
dialect: "sqlite";
|
|
28
|
+
classifierVersion: number;
|
|
29
|
+
sqlHash: string;
|
|
30
|
+
planHash: string;
|
|
31
|
+
stability: "stable" | "legacy";
|
|
32
|
+
warnings?: Array<string>;
|
|
33
|
+
} & ({
|
|
34
|
+
kind: "single-statement";
|
|
35
|
+
} | {
|
|
36
|
+
kind: "breakpoint-framed";
|
|
37
|
+
statements: Array<string>;
|
|
38
|
+
} | {
|
|
39
|
+
kind: "legacy-unsplit-multi-statement";
|
|
40
|
+
allowLegacy: boolean;
|
|
41
|
+
});
|
|
42
|
+
type MigrationPlanBundle = {
|
|
43
|
+
protocolVersion: 2;
|
|
44
|
+
classifierVersion: number;
|
|
45
|
+
migrationListHash: string;
|
|
46
|
+
destructiveValidation: "passed";
|
|
47
|
+
plans: Array<MigrationExecutionPlan>;
|
|
48
|
+
};
|
|
49
|
+
declare function createMigrationHandler(env: Record<string, unknown>, migrations: Array<MigrationEntry> | undefined, _dialect: "sqlite" | "postgresql" | "mysql", runAuthMigrations?: () => Promise<void>, planBundle?: MigrationPlanBundle): (request: Request) => Promise<Response>;
|
|
50
|
+
//#endregion
|
|
51
|
+
export { createMigrationHandler as i, MigrationResponse as n, MigrationResult as r, MigrationEntry as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineDatabaseProvider } from "./database-provider.mjs";
|
|
1
|
+
import { t as defineDatabaseProvider } from "./database-provider-Cx525bwX.mjs";
|
|
2
2
|
//#region src/database-providers/neon.ts
|
|
3
3
|
function getConnectionString(payload) {
|
|
4
4
|
if (!payload || typeof payload !== "object") return;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { r as getMiniflareDatabasePath } from "./
|
|
5
|
-
import { a as
|
|
6
|
-
import {
|
|
1
|
+
import { a as join } from "./dist-4WkAWhWx.mjs";
|
|
2
|
+
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-uP7ZDtVZ.mjs";
|
|
3
|
+
import { m as readConfig } from "./config-Dxr6cTXn.mjs";
|
|
4
|
+
import { r as getMiniflareDatabasePath } from "./runner-BGVsGgkb.mjs";
|
|
5
|
+
import { a as loadLocalEnv } from "./env-DX_v-Q-v.mjs";
|
|
6
|
+
import { r as resolveVoidAuthMigrationSchema } from "./drizzle-Beb2Am5S.mjs";
|
|
7
7
|
import { n as applyPgAuthMigrations, r as applySqliteAuthMigrations, t as applyMySqlAuthMigrations } from "./auth-migrations-9vif1uj8.mjs";
|
|
8
8
|
//#region src/auth/node.ts
|
|
9
9
|
async function runLocalVoidAuthMigrations(root, dialect, persistRoot = join(root, ".void"), databaseId = "local", configPath = findVoidAuthConfig(root)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-
|
|
1
|
+
import { S as writeKeyringPassword, b as deleteKeyringPassword, c as platformCredentialAccount, o as listPlatformConnections, r as getActivePlatformConnection, s as normalizePlatformApiUrl, x as readKeyringPassword } from "./platform-registry-BJbgZLS1.mjs";
|
|
2
|
+
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-A0iex2yi.mjs";
|
|
3
3
|
/** Operator authority never comes from repository-controlled metadata. */
|
|
4
4
|
function resolveOperatorOrigin(connection = "") {
|
|
5
5
|
if (connection) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { B as ensureCloudflaredToken, X as normalizePlatformApiUrl } from "./output-B0cfNSx5.mjs";
|
|
2
1
|
import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
|
|
2
|
+
import { s as normalizePlatformApiUrl } from "./platform-registry-BJbgZLS1.mjs";
|
|
3
|
+
import { t as ensureCloudflaredToken } from "./cf-access-rAZxzMkL.mjs";
|
|
3
4
|
const OPERATOR_MAX_TIMEOUT_MS = 36e5;
|
|
4
5
|
var OperatorClientError = class extends Error {
|
|
5
6
|
code;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-
|
|
2
|
-
import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-
|
|
1
|
+
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-A0iex2yi.mjs";
|
|
2
|
+
import { a as resolveOperatorOrigin, i as removeOperatorToken, n as readOperatorApiTokenStdin, o as saveOperatorToken, r as readOperatorToken, t as exchangeOperatorSession } from "./operator-auth-BkVgJqv-.mjs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { createInterface } from "node:readline/promises";
|
|
5
5
|
import { setTimeout } from "node:timers/promises";
|
|
@@ -137,9 +137,9 @@ async function runAuth(origin, args) {
|
|
|
137
137
|
if (args.action === "login" || args.action === "token" && args.tokenStdin) {
|
|
138
138
|
if (!args.tokenStdin && !process.stdin.isTTY) throw new OperatorClientError("Browser login requires an interactive terminal. Use --token-stdin to exchange an API session.", "interactive_login_required");
|
|
139
139
|
const apiToken = args.tokenStdin ? await readOperatorApiTokenStdin() : await (async () => {
|
|
140
|
-
const { discoverPlatform } = await import("./platform-cmd-
|
|
141
|
-
const { selectPlatformLoginMethod } = await import("./login-
|
|
142
|
-
const { runPlatformLogin } = await import("./auth-
|
|
140
|
+
const { discoverPlatform } = await import("./platform-cmd-DE6dw45v.mjs");
|
|
141
|
+
const { selectPlatformLoginMethod } = await import("./login-BwiopVdg.mjs");
|
|
142
|
+
const { runPlatformLogin } = await import("./auth-CAw7zHqj.mjs");
|
|
143
143
|
return runPlatformLogin(origin, (await selectPlatformLoginMethod(await discoverPlatform(origin), args.providerExplicit ? args.provider : void 0)).id, (url) => process.stderr.write(`Sign in at ${url}\n`));
|
|
144
144
|
})();
|
|
145
145
|
const session = await exchangeOperatorSession(origin, apiToken);
|
|
@@ -279,7 +279,7 @@ async function followOperatorLogs(client, args, signal, pollIntervalMs = 2e3) {
|
|
|
279
279
|
}
|
|
280
280
|
async function runOperatorCommand(args) {
|
|
281
281
|
if (!args.action) {
|
|
282
|
-
const { printHelpPage } = await import("./help-
|
|
282
|
+
const { printHelpPage } = await import("./help-B403BLBB.mjs");
|
|
283
283
|
printHelpPage(["platform", args.group]);
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { n as __toESM, t as __commonJSMin } from "./rolldown-runtime-DXIUcv95.mjs";
|
|
2
|
+
import { L as spinner, j as log, k as isCI } from "./dist-Dn6nn2IU.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js
|
|
4
|
+
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
5
|
+
let p = process || {};
|
|
6
|
+
let argv = p.argv || [];
|
|
7
|
+
let env = p.env || {};
|
|
8
|
+
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
9
|
+
let formatter = (open, close, replace = open) => (input) => {
|
|
10
|
+
let string = "" + input, index = string.indexOf(close, open.length);
|
|
11
|
+
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
|
|
12
|
+
};
|
|
13
|
+
let replaceClose = (string, close, replace, index) => {
|
|
14
|
+
let result = "", cursor = 0;
|
|
15
|
+
do {
|
|
16
|
+
result += string.substring(cursor, index) + replace;
|
|
17
|
+
cursor = index + close.length;
|
|
18
|
+
index = string.indexOf(close, cursor);
|
|
19
|
+
} while (~index);
|
|
20
|
+
return result + string.substring(cursor);
|
|
21
|
+
};
|
|
22
|
+
let createColors = (enabled = isColorSupported) => {
|
|
23
|
+
let f = enabled ? formatter : () => String;
|
|
24
|
+
return {
|
|
25
|
+
isColorSupported: enabled,
|
|
26
|
+
reset: f("\x1B[0m", "\x1B[0m"),
|
|
27
|
+
bold: f("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
28
|
+
dim: f("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
29
|
+
italic: f("\x1B[3m", "\x1B[23m"),
|
|
30
|
+
underline: f("\x1B[4m", "\x1B[24m"),
|
|
31
|
+
inverse: f("\x1B[7m", "\x1B[27m"),
|
|
32
|
+
hidden: f("\x1B[8m", "\x1B[28m"),
|
|
33
|
+
strikethrough: f("\x1B[9m", "\x1B[29m"),
|
|
34
|
+
black: f("\x1B[30m", "\x1B[39m"),
|
|
35
|
+
red: f("\x1B[31m", "\x1B[39m"),
|
|
36
|
+
green: f("\x1B[32m", "\x1B[39m"),
|
|
37
|
+
yellow: f("\x1B[33m", "\x1B[39m"),
|
|
38
|
+
blue: f("\x1B[34m", "\x1B[39m"),
|
|
39
|
+
magenta: f("\x1B[35m", "\x1B[39m"),
|
|
40
|
+
cyan: f("\x1B[36m", "\x1B[39m"),
|
|
41
|
+
white: f("\x1B[37m", "\x1B[39m"),
|
|
42
|
+
gray: f("\x1B[90m", "\x1B[39m"),
|
|
43
|
+
bgBlack: f("\x1B[40m", "\x1B[49m"),
|
|
44
|
+
bgRed: f("\x1B[41m", "\x1B[49m"),
|
|
45
|
+
bgGreen: f("\x1B[42m", "\x1B[49m"),
|
|
46
|
+
bgYellow: f("\x1B[43m", "\x1B[49m"),
|
|
47
|
+
bgBlue: f("\x1B[44m", "\x1B[49m"),
|
|
48
|
+
bgMagenta: f("\x1B[45m", "\x1B[49m"),
|
|
49
|
+
bgCyan: f("\x1B[46m", "\x1B[49m"),
|
|
50
|
+
bgWhite: f("\x1B[47m", "\x1B[49m"),
|
|
51
|
+
blackBright: f("\x1B[90m", "\x1B[39m"),
|
|
52
|
+
redBright: f("\x1B[91m", "\x1B[39m"),
|
|
53
|
+
greenBright: f("\x1B[92m", "\x1B[39m"),
|
|
54
|
+
yellowBright: f("\x1B[93m", "\x1B[39m"),
|
|
55
|
+
blueBright: f("\x1B[94m", "\x1B[39m"),
|
|
56
|
+
magentaBright: f("\x1B[95m", "\x1B[39m"),
|
|
57
|
+
cyanBright: f("\x1B[96m", "\x1B[39m"),
|
|
58
|
+
whiteBright: f("\x1B[97m", "\x1B[39m"),
|
|
59
|
+
bgBlackBright: f("\x1B[100m", "\x1B[49m"),
|
|
60
|
+
bgRedBright: f("\x1B[101m", "\x1B[49m"),
|
|
61
|
+
bgGreenBright: f("\x1B[102m", "\x1B[49m"),
|
|
62
|
+
bgYellowBright: f("\x1B[103m", "\x1B[49m"),
|
|
63
|
+
bgBlueBright: f("\x1B[104m", "\x1B[49m"),
|
|
64
|
+
bgMagentaBright: f("\x1B[105m", "\x1B[49m"),
|
|
65
|
+
bgCyanBright: f("\x1B[106m", "\x1B[49m"),
|
|
66
|
+
bgWhiteBright: f("\x1B[107m", "\x1B[49m")
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
module.exports = createColors();
|
|
70
|
+
module.exports.createColors = createColors;
|
|
71
|
+
}));
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/cli/output.ts
|
|
74
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
75
|
+
/** Keep recovery commands on the same CLI when using the local checkout launcher. */
|
|
76
|
+
function cliCommandName() {
|
|
77
|
+
const entryName = process.argv[1]?.split(/[\\/]/).at(-1);
|
|
78
|
+
return entryName === "void-dev" || entryName === "void-dev.cmd" ? "void-dev" : "void";
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Terminal-safe spinner wrapper. In CI and redirected output,
|
|
82
|
+
* `@clack/prompts` spinner emits DEC Private Mode cursor hide/show codes
|
|
83
|
+
* (`\x1b[?25l` / `\x1b[?25h`) that render as text artifacts. This wrapper
|
|
84
|
+
* replaces the spinner with plain log output.
|
|
85
|
+
*/
|
|
86
|
+
function createSpinner(options, isTerminal = process.stdout.isTTY === true) {
|
|
87
|
+
if (!isCI() && isTerminal) return spinner(options);
|
|
88
|
+
let currentMessage = "";
|
|
89
|
+
return {
|
|
90
|
+
start(msg = "") {
|
|
91
|
+
currentMessage = msg;
|
|
92
|
+
if (msg) log.step(msg);
|
|
93
|
+
},
|
|
94
|
+
stop(msg = "") {
|
|
95
|
+
if (msg) log.info(msg);
|
|
96
|
+
},
|
|
97
|
+
message(msg = "") {
|
|
98
|
+
if (msg && msg !== currentMessage) {
|
|
99
|
+
currentMessage = msg;
|
|
100
|
+
log.step(msg);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
cancel(msg = "") {
|
|
104
|
+
if (msg) log.warn(msg);
|
|
105
|
+
},
|
|
106
|
+
error(msg = "") {
|
|
107
|
+
if (msg) log.error(msg);
|
|
108
|
+
},
|
|
109
|
+
clear() {},
|
|
110
|
+
get isCancelled() {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
function cliTitle(command) {
|
|
116
|
+
return import_picocolors.default.blue(`void ${command}`);
|
|
117
|
+
}
|
|
118
|
+
function sectionTitle(title) {
|
|
119
|
+
return import_picocolors.default.reset(import_picocolors.default.blue(title));
|
|
120
|
+
}
|
|
121
|
+
function categoryTitle(title) {
|
|
122
|
+
return import_picocolors.default.reset(import_picocolors.default.bold(import_picocolors.default.cyan(title)));
|
|
123
|
+
}
|
|
124
|
+
function dim(text) {
|
|
125
|
+
return import_picocolors.default.dim(text);
|
|
126
|
+
}
|
|
127
|
+
function tablePrefix() {
|
|
128
|
+
return `${import_picocolors.default.gray("│")} `;
|
|
129
|
+
}
|
|
130
|
+
function helpLine(command, description) {
|
|
131
|
+
return `${import_picocolors.default.reset(command.padEnd(34))} ${import_picocolors.default.dim(description)}`;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Ensure a timestamp string will be parsed as UTC by `new Date()`.
|
|
135
|
+
* DB timestamps lack timezone info — appends 'Z' only when no
|
|
136
|
+
* existing indicator (Z, z, or numeric offset) is present.
|
|
137
|
+
*/
|
|
138
|
+
function ensureUtc(s) {
|
|
139
|
+
const last = s.at(-1);
|
|
140
|
+
if (last === "Z" || last === "z") return s;
|
|
141
|
+
if (s.includes("+", 10)) return s;
|
|
142
|
+
if (s.lastIndexOf("-") > 9) return s;
|
|
143
|
+
return s + "Z";
|
|
144
|
+
}
|
|
145
|
+
//#endregion
|
|
146
|
+
export { dim as a, import_picocolors as c, require_picocolors as d, createSpinner as i, sectionTitle as l, cliCommandName as n, ensureUtc as o, cliTitle as r, helpLine as s, categoryTitle as t, tablePrefix as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as join, n as dirname } from "./dist-4WkAWhWx.mjs";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
//#region src/shared/package-json.ts
|
|
4
4
|
const DEFAULT_DEPENDENCY_FIELDS = ["dependencies", "devDependencies"];
|
package/dist/pages/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as PageObject } from "../protocol-
|
|
2
|
-
import { CacheForInput, CacheForResult } from "
|
|
1
|
+
import { t as PageObject } from "../protocol-ZH3jP4a7.mjs";
|
|
2
|
+
import { n as CacheForInput, r as CacheForResult } from "../prefetch-Ce6la4EI.mjs";
|
|
3
3
|
//#region src/pages/action-result.d.ts
|
|
4
4
|
type ActionErrorHandlingScope = "callSite" | "boundary";
|
|
5
5
|
type ActionResult<T = PageObject | undefined> = {
|
|
@@ -71,6 +71,8 @@ type PageNavigationEngineConfig = {
|
|
|
71
71
|
viewTransitions: boolean;
|
|
72
72
|
prefetchHoverDelay: number;
|
|
73
73
|
prefetchDefaultCacheFor: CacheForResult;
|
|
74
|
+
/** Reuse successful GET page shells on later visits, refreshing stale shells in the background. */
|
|
75
|
+
cacheVisitedPageData?: boolean;
|
|
74
76
|
};
|
|
75
77
|
type PageNavigationResult = {
|
|
76
78
|
pageData: PageData;
|
|
@@ -171,6 +173,7 @@ export type VoidRouterConfig = {
|
|
|
171
173
|
viewTransitions: boolean;
|
|
172
174
|
prefetchHoverDelay: number;
|
|
173
175
|
prefetchDefaultCacheFor: CacheForResult;
|
|
176
|
+
cacheVisitedPageData?: boolean;
|
|
174
177
|
onRouteChange?(url: string): void;
|
|
175
178
|
onNavigationChange?(navigation: NavigationState): void;
|
|
176
179
|
};
|
package/dist/pages/client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as initClientHead, t as applyClientHead } from "../head-client-DzmJGN4C.mjs";
|
|
2
|
+
import { n as parseCacheFor, t as PrefetchCache } from "../prefetch-Bsc_Pb6c.mjs";
|
|
3
3
|
//#region src/pages/action-result.ts
|
|
4
4
|
var VoidActionError = class extends Error {
|
|
5
5
|
body;
|
|
@@ -123,7 +123,7 @@ async function fetchPageResponse(fetchUrl, init) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
async function createPageNavigationEngine(config) {
|
|
126
|
-
const { adapter, components, layoutTree, routeMeta, matchRoute, staticPageData: STATIC_PAGE_DATA_ENABLED = false, staticPageDataFastPath: STATIC_PAGE_DATA_FAST_PATH = STATIC_PAGE_DATA_ENABLED, prefetchHoverDelay: PREFETCH_HOVER_DELAY, prefetchDefaultCacheFor: PREFETCH_DEFAULT_CACHE_FOR } = config;
|
|
126
|
+
const { adapter, components, layoutTree, routeMeta, matchRoute, staticPageData: STATIC_PAGE_DATA_ENABLED = false, staticPageDataFastPath: STATIC_PAGE_DATA_FAST_PATH = STATIC_PAGE_DATA_ENABLED, prefetchHoverDelay: PREFETCH_HOVER_DELAY, prefetchDefaultCacheFor: PREFETCH_DEFAULT_CACHE_FOR, cacheVisitedPageData: CACHE_VISITED_PAGE_DATA = false } = config;
|
|
127
127
|
const _prefetchCache = new PrefetchCache();
|
|
128
128
|
const _staticPageDataCacheKeys = /* @__PURE__ */ new Set();
|
|
129
129
|
let _nextNavigationId = 0;
|
|
@@ -492,6 +492,7 @@ async function createPageNavigationEngine(config) {
|
|
|
492
492
|
pageData = await response.json();
|
|
493
493
|
deferredRegistry.setupPending(pageData);
|
|
494
494
|
}
|
|
495
|
+
if (CACHE_VISITED_PAGE_DATA && method === "GET" && response?.ok && response.headers.get("X-VoidPages") && pageData?.component === matchRoute(fetchUrl) && !pageData.deferredKeys) _prefetchCache.set(fetchUrl, method, Promise.resolve(clonePageData(pageData)), PREFETCH_DEFAULT_CACHE_FOR);
|
|
495
496
|
}
|
|
496
497
|
if (!pageData) throw new Error("pages: Missing page payload.");
|
|
497
498
|
if (method !== "GET") deferredRegistry.preserveValuesFrom(_committedDeferredRegistry, pageData);
|
|
@@ -553,6 +554,7 @@ async function createPageNavigationEngine(config) {
|
|
|
553
554
|
}
|
|
554
555
|
const initialPageData = readInitialPageData(document.getElementById("app"));
|
|
555
556
|
const [initialComponent, initialLayouts] = await Promise.all([resolveComponent(initialPageData.component), resolveLayouts(initialPageData.component)]);
|
|
557
|
+
if (CACHE_VISITED_PAGE_DATA && initialPageData.url === _currentFetchUrl && initialPageData.component === matchRoute(_currentFetchUrl) && initialPageData.errors === null && !initialPageData.deferredKeys) _prefetchCache.set(_currentFetchUrl, "GET", Promise.resolve(clonePageData(initialPageData)), PREFETCH_DEFAULT_CACHE_FOR);
|
|
556
558
|
const initialDeferredRegistry = new DeferredRegistry();
|
|
557
559
|
initialDeferredRegistry.setupPending(initialPageData);
|
|
558
560
|
_committedDeferredRegistry = initialDeferredRegistry;
|