void 0.10.13 → 0.20.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/AGENTS_TEMPLATE.md +6 -0
- package/{skills/void/docs/node_modules/void/node_modules/pglite-server/LICENSE.md → LICENSE} +1 -1
- package/README.md +34 -8
- package/dist/{auth-qgMlYp7Z.d.mts → auth-DkcFflXV.d.mts} +10 -11
- package/dist/auth-W9WII-mN.mjs +630 -0
- package/dist/{auth-cmd-BqsdZJp5.mjs → auth-cmd-CAH62yDU.mjs} +4 -3
- package/dist/{auth-migrations-BTZ-ATvQ.mjs → auth-migrations-9vif1uj8.mjs} +53 -12
- package/dist/{better-auth-shared-BQooDxbw.mjs → better-auth-shared-CYw1T3k4.mjs} +7 -10
- package/dist/{better-auth-shared-DealXecJ.d.mts → better-auth-shared-DSCeohOK.d.mts} +10 -5
- package/dist/{build-cmd-Bujrv5q-.mjs → build-cmd-CJvZvPQO.mjs} +6 -4
- package/dist/{cache-C11V8Fxq.mjs → cache-BlNeQjuP.mjs} +9 -5
- package/dist/{cancel-deploy-fwFYF04b.mjs → cancel-deploy-CmlAZ9P6.mjs} +3 -2
- package/dist/cf-access-AJ1ehiFR.mjs +42 -0
- package/dist/cf-access-DsSsZUPr.mjs +67 -0
- package/dist/cli/cli.d.mts +1 -1
- package/dist/cli/cli.mjs +1735 -165
- package/dist/cli/env-schema-probe.d.mts +48 -61
- package/dist/cli/env-schema-probe.mjs +10 -58
- package/dist/{client-Gb71-XkG.mjs → client-Clirrol3.mjs} +120 -463
- package/dist/cloudflare-auth-B1QtTO1b.mjs +217 -0
- package/dist/cloudflare-cmd-B6_OZx2V.mjs +62 -0
- package/dist/cloudflare-connect-j5D4hhrG.mjs +56 -0
- package/dist/cloudflare-operations-CPTpRW6d.mjs +566 -0
- package/dist/{config-qHGgPuWT.mjs → config-BQFq7QvD.mjs} +75 -41
- package/dist/{config-CutEMNGJ.mjs → config-NOG_U1aK.mjs} +10 -15
- package/dist/connect-C04Wdy_h.mjs +79 -0
- package/dist/{create-project-DsYvl3TB.mjs → create-project-ChGZ1DFd.mjs} +26 -16
- package/dist/database-provider.d.mts +21 -0
- package/dist/database-provider.mjs +6 -0
- package/dist/{db-C0i0sYMS.mjs → db-D2d_mUsB.mjs} +612 -117
- package/dist/{delete-mh6p-zkQ.mjs → delete-D8GigDk8.mjs} +9 -6
- package/dist/{deploy-jBJT1fUT.mjs → deploy-iXZ3F0N6.mjs} +3252 -1995
- package/dist/dev-inbox-DkgRWLkW.mjs +307 -0
- package/dist/{discover-CJHyvYfR.mjs → discover-xvfrgJeo.mjs} +3 -3
- package/dist/{magic-string.es-ZQjdJFFn.mjs → dist-BR1quN_w.mjs} +570 -216
- package/dist/{dist-DaKKDf8D.mjs → dist-BrsS7cai.mjs} +17 -2
- package/dist/{dist-BuiRJkTd.mjs → dist-m40_XgNh.mjs} +48 -33
- package/dist/{domain-DiaNQbrl.mjs → domain-B1VmoSr0.mjs} +41 -4
- package/dist/dotenv-VQxupEUv.mjs +181 -0
- package/dist/edge.d.mts +2 -0
- package/dist/edge.mjs +2 -0
- package/dist/email-Ce6SQq-i.mjs +182 -0
- package/dist/email-uKyQYUVY.mjs +1016 -0
- package/dist/{entry-D7yy4xVH.mjs → entry-DU3oDoQ3.mjs} +2 -2
- package/dist/env-BcQzYgoG.mjs +73 -0
- package/dist/env-D4Emu-M_.mjs +95 -0
- package/dist/env-helpers-CyKtOBpj.d.mts +22 -0
- package/dist/env-public-D_6u46fX.d.mts +135 -0
- package/dist/{env-types-QBj-ndax.mjs → env-types-BNPhro-M.mjs} +2 -2
- package/dist/{env-validation-Dea3v3ej.mjs → env-validation-ENpMy6Ez.mjs} +68 -122
- package/dist/{gen-BzXf3Jh2.mjs → gen-DI2YwdBM.mjs} +70 -15
- package/dist/generate-RTK8_kK1.mjs +47 -0
- package/dist/{github-cmd-DKcGUNsj.mjs → github-cmd-xItS5Zwf.mjs} +39 -31
- package/dist/{handler-Cjh8uM3Y.d.mts → handler-D1hLsObx.d.mts} +124 -122
- package/dist/{head-nmvOgFjd.d.mts → head-Do8P4puT.d.mts} +9 -8
- package/dist/{headers-ChAADPQu.mjs → headers-D8QfRX9Y.mjs} +12 -10
- package/dist/inbound-2d0zi2yS.mjs +706 -0
- package/dist/inbound-afAcWeQ9.d.mts +363 -0
- package/dist/index.d.mts +61 -34
- package/dist/index.mjs +1012 -293
- package/dist/{init-7JCAcKNQ.mjs → init-BD-9THgn.mjs} +329 -271
- package/dist/link-RMdgjF1v.mjs +52 -0
- package/dist/{list-CPwFDZ_c.mjs → list-3F52R_yO.mjs} +37 -5
- package/dist/{runner-kapo9aPs.mjs → local-d1-D2I6Ox5F.mjs} +116 -6
- package/dist/{login-BT3H8PN3.mjs → login-pV69H-ZO.mjs} +17 -15
- package/dist/{logs-Bt313ax7.mjs → logs-DFHHD6wE.mjs} +16 -2
- package/dist/mime-BJD7d_qL.mjs +1216 -0
- package/dist/neon-DHwd2zvC.mjs +54 -0
- package/dist/{node-pRg81HqV.mjs → node-Dk3H2jmU.mjs} +29 -8
- package/dist/operator-cmd-DYWRbWUA.mjs +348 -0
- package/dist/{agents-CtgBYqld.mjs → output-tFQLLj26.mjs} +676 -211
- package/dist/{package-json-Cx1osYo6.mjs → package-json-CPoWX79C.mjs} +1 -1
- package/dist/pages/client.d.mts +43 -41
- package/dist/pages/client.mjs +40 -33
- package/dist/pages/head-client.d.mts +10 -12
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +37 -14
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.d.mts +25 -27
- package/dist/pages/islands-plugin.mjs +6 -4
- package/dist/pages/prefetch.d.mts +6 -7
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -1
- package/dist/pages/serialize.d.mts +7 -8
- package/dist/platform-cmd-DxJ2FRwR.mjs +123 -0
- package/dist/platform-domain-ChvbJkdy.mjs +228 -0
- package/dist/platform-lifecycle-DN4MzJF_.mjs +4450 -0
- package/dist/platform-management-Db2PXw0B.mjs +698 -0
- package/dist/platform-recovery-C_YO-tIs.mjs +99 -0
- package/dist/{plugin-inference-DMeavIJ6.mjs → plugin-inference-BDRfZngg.mjs} +35 -19
- package/dist/prepare-BfJvFUtJ.mjs +14 -0
- package/dist/{prepare-BvvgAz-3.mjs → prepare-CBetXvsN.mjs} +15 -24
- package/dist/{preset-BjyR3lzz.mjs → preset-lAy0B0BQ.mjs} +25 -212
- package/dist/{project-cmd-D_w-4w5B.mjs → project-cmd-Mo0V9yKS.mjs} +25 -12
- package/dist/{project-paths-BQd7OmIo.mjs → project-paths-SK8nMHPp.mjs} +3 -1
- package/dist/{project-tsconfig-B-QtXjLQ.mjs → project-tsconfig-Ql2XsSQp.mjs} +2 -2
- package/dist/{protocol-Bnb0LFp3.d.mts → protocol-C-pqYJjE.d.mts} +3 -4
- package/dist/{provision-CPx2ZxsH.mjs → provision-Blnstcm2.mjs} +78 -45
- package/dist/r2-conditions-D1Wk8i7b.mjs +30 -0
- package/dist/{requests-B8sZxaFM.mjs → requests-BcKOVpRg.mjs} +5 -3
- package/dist/{resolve-project-BBMtLLV9.mjs → resolve-project--Vxawf7z.mjs} +2 -2
- package/dist/rollback-Bx85-0xh.mjs +166 -0
- package/dist/{rolldown-runtime-DJK8HYOj.mjs → rolldown-runtime-rQ84J-ij.mjs} +1 -1
- package/dist/{route-types-z1jtHEi_.mjs → route-types-Da-DpyUp.mjs} +77 -25
- package/dist/routes-stub.d.mts +22 -23
- package/dist/runner-mysql-7BPUNGmL.mjs +61 -0
- package/dist/{runner-pg-CHM76xuC.mjs → runner-pg-BkEza-dX.mjs} +18 -6
- package/dist/runtime/ai.d.mts +21 -14
- package/dist/runtime/ai.mjs +5 -4
- package/dist/runtime/auth-client-react.d.mts +3 -5
- package/dist/runtime/auth-client-solid.d.mts +3 -5
- package/dist/runtime/auth-client-svelte.d.mts +3 -5
- package/dist/runtime/auth-client-vue.d.mts +3 -5
- package/dist/runtime/auth-client.d.mts +3 -5
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +10 -0
- package/dist/runtime/better-auth-mysql.mjs +49 -0
- package/dist/runtime/better-auth-pg.d.mts +8 -9
- package/dist/runtime/better-auth-pg.mjs +2 -2
- package/dist/runtime/better-auth.d.mts +8 -9
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/db-mysql.d.mts +2 -0
- package/dist/runtime/db-mysql.mjs +1 -0
- package/dist/runtime/db.d.mts +10 -11
- package/dist/runtime/durable.d.mts +47 -0
- package/dist/runtime/durable.mjs +146 -0
- package/dist/runtime/email/testing.d.mts +112 -0
- package/dist/runtime/email/testing.mjs +283 -0
- package/dist/runtime/email.d.mts +30 -0
- package/dist/runtime/email.mjs +573 -0
- package/dist/runtime/env-helpers.d.mts +2 -2
- package/dist/runtime/env-helpers.mjs +5 -42
- package/dist/runtime/env-public-client.d.mts +10 -11
- package/dist/runtime/env-public-client.mjs +1 -1
- package/dist/runtime/env-public.d.mts +2 -2
- package/dist/runtime/env-public.mjs +104 -49
- package/dist/runtime/env.d.mts +19 -18
- package/dist/runtime/env.mjs +15 -2
- package/dist/runtime/fetch-stream.d.mts +20 -21
- package/dist/runtime/fetch.d.mts +15 -16
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/isr.d.mts +21 -22
- package/dist/runtime/isr.mjs +26 -8
- package/dist/runtime/kv.d.mts +9 -10
- package/dist/runtime/live-client.d.mts +5 -7
- package/dist/runtime/live-client.mjs +9 -7
- package/dist/runtime/live-server.d.mts +4 -5
- package/dist/runtime/live.d.mts +22 -24
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/log.d.mts +16 -17
- package/dist/runtime/migration-handler-mysql.d.mts +4 -0
- package/dist/runtime/migration-handler-mysql.mjs +81 -0
- package/dist/runtime/migration-handler-pg.d.mts +2 -4
- package/dist/runtime/migration-handler.d.mts +5 -6
- package/dist/runtime/migration-handler.mjs +4 -3
- package/dist/runtime/queues.d.mts +3 -4
- package/dist/runtime/queues.mjs +2 -1
- package/dist/runtime/remote/binding-handler.d.mts +10 -12
- package/dist/runtime/remote/binding-handler.mjs +24 -3
- package/dist/runtime/remote/index.d.mts +5 -6
- package/dist/runtime/remote/index.mjs +21 -18
- package/dist/runtime/response.d.mts +10 -11
- package/dist/runtime/sandbox.d.mts +56 -55
- package/dist/runtime/sandbox.mjs +57 -49
- package/dist/runtime/schema-mysql.d.mts +1 -0
- package/dist/runtime/schema-mysql.mjs +2 -0
- package/dist/runtime/seed.d.mts +14 -9
- package/dist/runtime/sse-client.d.mts +6 -7
- package/dist/runtime/sse.d.mts +11 -12
- package/dist/runtime/storage.d.mts +3 -4
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +12 -12
- package/dist/runtime/ws-server.mjs +32 -4
- package/dist/runtime/ws.d.mts +19 -21
- package/dist/{scan-ChWt4pX1.mjs → scan-BMH4rzlv.mjs} +42 -19
- package/dist/{scan-NU4xKGci.mjs → scan-CpK-57ug.mjs} +5 -4
- package/dist/{secret-Dt32J6RI.mjs → secret-ByhJ9AMl.mjs} +62 -5
- package/dist/{skills-CLjN0uUO.mjs → skills-Q46GZMO-.mjs} +6 -4
- package/dist/sqlite-validation-BzKMWnO4.mjs +25 -0
- package/dist/{standard-schema-DJ0HW7QP.d.mts → standard-schema-Fo_vCAZh.d.mts} +6 -6
- package/dist/{subcommand-prompt-BzV8iQZo.mjs → subcommand-prompt-WfySCQ7S.mjs} +67 -48
- package/dist/sveltekit.d.mts +12 -11
- package/dist/sveltekit.mjs +1 -1
- package/dist/types-BAp5AEBU.d.mts +79 -0
- package/dist/types-CKWnYgfy.d.mts +1 -0
- package/dist/{validate-Cw_RLeTj.mjs → validate-tBBN_dXH.mjs} +4 -3
- package/dist/wrangler--imS8n0d.mjs +1796 -0
- package/dist/{yarn-pnp-DJn3SAHF.mjs → yarn-pnp-DxSInkzL.mjs} +1 -1
- package/package.json +79 -65
- package/schema.json +22 -3
- package/skills/void/SKILL.md +59 -2
- package/skills/void/docs/guide/ai.md +32 -14
- package/skills/void/docs/guide/app-types.md +6 -6
- package/skills/void/docs/guide/auth.md +14 -16
- package/skills/void/docs/guide/database/d1.md +6 -0
- package/skills/void/docs/guide/database/mysql.md +60 -0
- package/skills/void/docs/guide/database/postgresql.md +14 -9
- package/skills/void/docs/guide/database.md +39 -26
- package/skills/void/docs/guide/deployment.md +99 -25
- package/skills/void/docs/guide/durable-state.md +140 -0
- package/skills/void/docs/guide/edge/headers.md +5 -5
- package/skills/void/docs/guide/edge/prerendering.md +2 -0
- package/skills/void/docs/guide/edge/revalidation.md +21 -6
- package/skills/void/docs/guide/edge/rewrites.md +18 -14
- package/skills/void/docs/guide/edge/static-assets.md +12 -10
- package/skills/void/docs/guide/email.md +640 -0
- package/skills/void/docs/guide/env-migration.md +109 -0
- package/skills/void/docs/guide/env-vars.md +70 -248
- package/skills/void/docs/guide/index.md +15 -17
- package/skills/void/docs/guide/jobs.md +8 -5
- package/skills/void/docs/guide/live.md +7 -15
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +8 -4
- package/skills/void/docs/guide/pages-routing/islands.md +3 -3
- package/skills/void/docs/guide/pages-routing/loaders.md +6 -4
- package/skills/void/docs/guide/pages-routing/overview.md +7 -7
- package/skills/void/docs/guide/platform-administration.md +212 -0
- package/skills/void/docs/guide/platform-development.md +264 -0
- package/skills/void/docs/guide/queues.md +10 -10
- package/skills/void/docs/guide/quickstart.md +46 -67
- package/skills/void/docs/guide/remote-dev.md +8 -6
- package/skills/void/docs/guide/sandboxes.md +33 -16
- package/skills/void/docs/guide/self-hosted-platform.md +553 -0
- package/skills/void/docs/guide/server-routing.md +5 -5
- package/skills/void/docs/guide/sse.md +4 -4
- package/skills/void/docs/guide/ssg.md +5 -3
- package/skills/void/docs/guide/storage.md +2 -2
- package/skills/void/docs/guide/websockets.md +15 -7
- package/skills/void/docs/index.md +3 -3
- package/skills/void/docs/integrations/agents.md +6 -64
- package/skills/void/docs/integrations/cloudflare.md +165 -146
- package/skills/void/docs/integrations/frameworks/analog.md +4 -4
- package/skills/void/docs/integrations/frameworks/astro.md +5 -5
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -5
- package/skills/void/docs/integrations/frameworks/overview.md +3 -3
- package/skills/void/docs/integrations/frameworks/react-router.md +3 -3
- package/skills/void/docs/integrations/frameworks/sveltekit.md +3 -3
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +2 -2
- package/skills/void/docs/integrations/nodejs-bun-deno.md +11 -4
- package/skills/void/docs/reference/api.md +42 -6
- package/skills/void/docs/reference/cli.md +665 -160
- package/skills/void/docs/reference/config.md +67 -27
- package/skills/void/docs/reference/resource-inference.md +13 -9
- package/skills/void/docs/reference/structure.md +9 -11
- package/AGENT_PROMPT.md +0 -19
- package/dist/cf-access-Bqw81xAf.mjs +0 -22
- package/dist/env-CZy5MorI.mjs +0 -299
- package/dist/env-helpers-z4stu8uc.d.mts +0 -52
- package/dist/env-mask-Dd47NbR6.mjs +0 -90
- package/dist/env-public-BfiLcMBk.d.mts +0 -140
- package/dist/link-CdGHSIy-.mjs +0 -45
- package/dist/mcp-DoM3_nhd.mjs +0 -377
- package/dist/project-paths-GpziKeQQ.d.mts +0 -25
- package/dist/providers-BNKRacMr.d.mts +0 -7
- package/dist/proxy-D-3_D-Gl.mjs +0 -5
- package/dist/rollback-CkvTFXx5.mjs +0 -90
- package/dist/runtime/isr-cache.d.mts +0 -207
- package/dist/runtime/isr-cache.mjs +0 -523
- package/dist/types-lLjNE9Qp.d.mts +0 -51
- package/getting-started-prompt.txt +0 -28
- package/skills/void/command/void.md +0 -7
- package/skills/void/docs/integrations/auth-providers.md +0 -0
- package/skills/void/docs/integrations/payment-processors.md +0 -0
- package/skills/void/docs/node_modules/@iconify/vue/README.md +0 -408
- package/skills/void/docs/node_modules/@iconify/vue/offline/readme.md +0 -5
- package/skills/void/docs/node_modules/@voidzero-dev/vitepress-theme/README.md +0 -103
- package/skills/void/docs/node_modules/oxc-minify/README.md +0 -78
- package/skills/void/docs/node_modules/reka-ui/README.md +0 -80
- package/skills/void/docs/node_modules/vitepress/README.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/api-examples.md +0 -49
- package/skills/void/docs/node_modules/vitepress/template/index.md +0 -28
- package/skills/void/docs/node_modules/vitepress/template/markdown-examples.md +0 -85
- package/skills/void/docs/node_modules/vitepress-plugin-group-icons/README.md +0 -101
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +0 -19
- package/skills/void/docs/node_modules/void/CLAUDE.md +0 -221
- package/skills/void/docs/node_modules/void/README.md +0 -90
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/CHANGELOG.md +0 -685
- package/skills/void/docs/node_modules/void/node_modules/@clack/prompts/README.md +0 -396
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/sandbox/README.md +0 -219
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/vite-plugin/README.md +0 -37
- package/skills/void/docs/node_modules/void/node_modules/@cloudflare/workers-types/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@electric-sql/pglite/README.md +0 -189
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/CHANGELOG.md +0 -143
- package/skills/void/docs/node_modules/void/node_modules/@hono/oauth-providers/README.md +0 -1272
- package/skills/void/docs/node_modules/void/node_modules/@napi-rs/keyring/README.md +0 -19
- package/skills/void/docs/node_modules/void/node_modules/@types/better-sqlite3/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/pg/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/README.md +0 -22
- package/skills/void/docs/node_modules/void/node_modules/@typescript/native-preview/vendor/vscode-jsonrpc/README.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/README.md +0 -153
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/engine-javascript/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@shikijs/transformers/README.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/@types/node/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/CHANGELOG.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/gray-matter/README.md +0 -565
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-exit/README.md +0 -127
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-anchor/README.md +0 -600
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-attrs/README.md +0 -386
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-container/README.md +0 -95
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-emoji/README.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/markdown-it-footnote/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/shiki/README.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/vue/README.md +0 -58
- package/skills/void/docs/node_modules/void/node_modules/arktype/README.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/better-auth/LICENSE.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/better-auth/README.md +0 -32
- package/skills/void/docs/node_modules/void/node_modules/better-sqlite3/README.md +0 -99
- package/skills/void/docs/node_modules/void/node_modules/blake3-jit/README.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/drizzle-arktype/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-kit/README.md +0 -79
- package/skills/void/docs/node_modules/void/node_modules/drizzle-orm/README.md +0 -44
- package/skills/void/docs/node_modules/void/node_modules/drizzle-valibot/README.md +0 -51
- package/skills/void/docs/node_modules/void/node_modules/drizzle-zod/README.md +0 -65
- package/skills/void/docs/node_modules/void/node_modules/es-module-lexer/README.md +0 -403
- package/skills/void/docs/node_modules/void/node_modules/estree-walker/README.md +0 -48
- package/skills/void/docs/node_modules/void/node_modules/hono/README.md +0 -85
- package/skills/void/docs/node_modules/void/node_modules/ignore/README.md +0 -452
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/CHANGELOG.md +0 -76
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/LICENSE.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/README.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/jsonc-parser/SECURITY.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/magic-string/README.md +0 -325
- package/skills/void/docs/node_modules/void/node_modules/ofetch/README.md +0 -398
- package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +0 -64
- package/skills/void/docs/node_modules/void/node_modules/pg/README.md +0 -96
- package/skills/void/docs/node_modules/void/node_modules/pglite-server/README.md +0 -135
- package/skills/void/docs/node_modules/void/node_modules/picocolors/README.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +0 -183
- package/skills/void/docs/node_modules/void/node_modules/tinyglobby/README.md +0 -25
- package/skills/void/docs/node_modules/void/node_modules/valibot/LICENSE.md +0 -9
- package/skills/void/docs/node_modules/void/node_modules/valibot/README.md +0 -94
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/AGENTS.md +0 -16
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/README.md +0 -220
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/build.md +0 -21
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/check.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/create.md +0 -70
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/fmt.md +0 -20
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/index.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/lint.md +0 -26
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/pack.md +0 -17
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/run.md +0 -364
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/staged.md +0 -15
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/config/test.md +0 -18
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/automatic-data-tracking.md +0 -145
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/build.md +0 -40
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/cache.md +0 -107
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/check.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ci.md +0 -62
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/commit-hooks.md +0 -60
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/create.md +0 -341
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/dev.md +0 -24
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/docker.md +0 -175
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/env.md +0 -167
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/fmt.md +0 -41
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/github-actions-cache.md +0 -165
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/ide-integration.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/implode.md +0 -23
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/index.md +0 -134
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/install.md +0 -199
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/lint.md +0 -50
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate-rules.md +0 -347
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/migrate.md +0 -197
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/monorepo.md +0 -176
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/pack.md +0 -69
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/run.md +0 -356
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/test.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/troubleshooting.md +0 -108
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/upgrade.md +0 -101
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/vpx.md +0 -66
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/guide/why.md +0 -39
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/index.md +0 -12
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/docs/team.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/generator/README.md +0 -35
- package/skills/void/docs/node_modules/void/node_modules/vite-plus/templates/monorepo/README.md +0 -29
- package/skills/void/docs/node_modules/void/node_modules/wrangler/README.md +0 -63
- package/skills/void/docs/node_modules/void/node_modules/zod/README.md +0 -191
- package/skills/void/docs/node_modules/void/skills/migrate-vite-cloudflare-to-void/SKILL.md +0 -175
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +0 -76
- package/skills/void/docs/node_modules/void/skills/void/command/void.md +0 -7
- package/skills/void/docs/node_modules/void/test/e2e/README.md +0 -85
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { C as cancel, D as log, E as intro, F as isCancel, a as dim, c as import_picocolors, i as createSpinner, j as select, k as outro, o as ensureUtc, r as cliTitle, w as confirm } from "./output-tFQLLj26.mjs";
|
|
2
|
+
import { b as readDeploymentPlatform, c as getToken, x as readProjectConfig } from "./auth-W9WII-mN.mjs";
|
|
3
|
+
import { n as PlatformClient } from "./client-Clirrol3.mjs";
|
|
4
|
+
//#region src/cli/rollback.ts
|
|
5
|
+
async function runRollbackCommand(root, deployId) {
|
|
6
|
+
console.log();
|
|
7
|
+
intro(cliTitle("project rollback"));
|
|
8
|
+
const platform = readDeploymentPlatform(root);
|
|
9
|
+
if (platform === "cloudflare") return runCloudflareRollback(root, deployId);
|
|
10
|
+
if (platform === "none") throw new Error("rollback: Deployment is disabled. Run `void init` to choose a platform.");
|
|
11
|
+
const token = getToken(root);
|
|
12
|
+
if (!token) {
|
|
13
|
+
log.error("Not logged in. Run `void auth login` first.");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
const linked = readProjectConfig(root);
|
|
17
|
+
if (!linked) {
|
|
18
|
+
log.error("No linked project. Run `void project link` first.");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
const client = new PlatformClient(token, { root });
|
|
22
|
+
const { deployments, activeDeploymentId } = await client.listDeployments(linked.projectId);
|
|
23
|
+
const candidates = deployments.filter((d) => d.retained && d.status === "live" && d.id !== activeDeploymentId);
|
|
24
|
+
if (candidates.length === 0) {
|
|
25
|
+
log.warn("No retained deployments available for rollback.");
|
|
26
|
+
outro(dim("Deploy more versions to enable rollback."));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
let targetId;
|
|
30
|
+
if (deployId) {
|
|
31
|
+
if (!candidates.find((d) => d.id === deployId)) {
|
|
32
|
+
log.error(`Deployment ${deployId} is not available for rollback (not retained or not found).`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
targetId = deployId;
|
|
36
|
+
} else {
|
|
37
|
+
const result = await select({
|
|
38
|
+
message: "Select a deployment to roll back to:",
|
|
39
|
+
options: candidates.map((d) => ({
|
|
40
|
+
value: d.id,
|
|
41
|
+
label: `${d.id} ${dim(formatAge(d.deployed_at))}`,
|
|
42
|
+
hint: d.source ? `via ${d.source}` : void 0
|
|
43
|
+
}))
|
|
44
|
+
});
|
|
45
|
+
if (isCancel(result)) {
|
|
46
|
+
cancel("Rollback cancelled.");
|
|
47
|
+
process.exit(0);
|
|
48
|
+
}
|
|
49
|
+
targetId = result;
|
|
50
|
+
}
|
|
51
|
+
const active = deployments.find((d) => d.id === activeDeploymentId);
|
|
52
|
+
const target = candidates.find((d) => d.id === targetId);
|
|
53
|
+
const currentMigrations = active?.applied_migrations ? JSON.parse(active.applied_migrations) : [];
|
|
54
|
+
const targetMigrations = target.applied_migrations ? JSON.parse(target.applied_migrations) : [];
|
|
55
|
+
const migrationDiff = currentMigrations.filter((m) => !targetMigrations.includes(m));
|
|
56
|
+
if (migrationDiff.length > 0) {
|
|
57
|
+
log.warn(`The current database has ${migrationDiff.length} migration(s) applied after this deployment:`);
|
|
58
|
+
for (const m of migrationDiff) log.message(` ${dim("•")} ${m}`);
|
|
59
|
+
log.message(dim("Rolling back will NOT revert these migrations. The older code will run against the current schema."));
|
|
60
|
+
const proceed = await confirm({ message: "Proceed with rollback?" });
|
|
61
|
+
if (isCancel(proceed) || !proceed) {
|
|
62
|
+
cancel("Rollback cancelled.");
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
const s = createSpinner();
|
|
67
|
+
s.start("Rolling back...");
|
|
68
|
+
try {
|
|
69
|
+
const result = await client.rollback(linked.projectId, targetId, { allowDestructive: migrationDiff.length > 0 ? migrationDiff : void 0 });
|
|
70
|
+
s.stop("Rollback complete.");
|
|
71
|
+
if (result.ok) log.success(`Rolled back to ${import_picocolors.default.bold(targetId)}`);
|
|
72
|
+
else {
|
|
73
|
+
log.error(result.error ?? "Rollback failed.");
|
|
74
|
+
process.exit(1);
|
|
75
|
+
}
|
|
76
|
+
} catch (err) {
|
|
77
|
+
s.stop("Rollback failed.");
|
|
78
|
+
log.error(err instanceof Error ? err.message : String(err));
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
outro(dim("Traffic is now serving the rolled-back deployment."));
|
|
82
|
+
}
|
|
83
|
+
async function runCloudflareRollback(root, deployId) {
|
|
84
|
+
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-CPTpRW6d.mjs").then((n) => n.t);
|
|
85
|
+
const context = resolveCloudflareOperationContext(root);
|
|
86
|
+
const status = await readCloudflareWorkerStatus(context);
|
|
87
|
+
const deployedVersionIds = new Set(status.deployedVersionIds);
|
|
88
|
+
const candidates = [...status.versions].reverse().filter((version) => version.id !== status.activeVersionId && deployedVersionIds.has(version.id));
|
|
89
|
+
if (candidates.length === 0) {
|
|
90
|
+
log.warn("No previous Cloudflare Worker Versions are available for rollback.");
|
|
91
|
+
outro(dim("Deploy more versions to enable rollback."));
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const requestedMatches = deployId ? candidates.filter((version) => version.id === deployId || version.id.startsWith(deployId)) : [];
|
|
95
|
+
if (requestedMatches.length > 1) {
|
|
96
|
+
log.error(`Version prefix ${deployId} is ambiguous; pass the complete version id.`);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
let target = requestedMatches[0];
|
|
100
|
+
if (deployId && !target) {
|
|
101
|
+
log.error(`Version ${deployId} is not available for rollback.`);
|
|
102
|
+
process.exit(1);
|
|
103
|
+
}
|
|
104
|
+
if (!target) {
|
|
105
|
+
const result = await select({
|
|
106
|
+
message: "Select a version to roll back to:",
|
|
107
|
+
options: candidates.map((version) => ({
|
|
108
|
+
value: version.id,
|
|
109
|
+
label: `${version.id} ${dim(formatAge(version.createdAt))}`,
|
|
110
|
+
hint: version.metadata ? `${version.metadata.migrations.length} migration(s)` : "migration state unknown"
|
|
111
|
+
}))
|
|
112
|
+
});
|
|
113
|
+
if (isCancel(result)) {
|
|
114
|
+
cancel("Rollback cancelled.");
|
|
115
|
+
process.exit(0);
|
|
116
|
+
}
|
|
117
|
+
target = candidates.find((version) => version.id === result);
|
|
118
|
+
}
|
|
119
|
+
const current = status.versions.find((version) => version.id === status.activeVersionId);
|
|
120
|
+
if (target.metadata?.schema !== 2 || current?.metadata?.schema !== 2 || target.metadata.triggerConfig.preserve || current.metadata.triggerConfig.preserve) log.info("This rollback keeps the current domains, routes, and schedules. The selected version has no complete trigger snapshot.");
|
|
121
|
+
if (!current?.metadata || !target.metadata) {
|
|
122
|
+
log.warn("Void migration metadata is unavailable for one of these versions. Database migrations are forward-only and will not be reverted.");
|
|
123
|
+
const proceed = await confirm({ message: "Proceed with rollback?" });
|
|
124
|
+
if (isCancel(proceed) || !proceed) {
|
|
125
|
+
cancel("Rollback cancelled.");
|
|
126
|
+
process.exit(0);
|
|
127
|
+
}
|
|
128
|
+
} else {
|
|
129
|
+
const targetSet = new Set(target.metadata.migrations);
|
|
130
|
+
const migrationDiff = current.metadata.migrations.filter((migration) => !targetSet.has(migration));
|
|
131
|
+
if (migrationDiff.length > 0) {
|
|
132
|
+
log.warn(`The current database has ${migrationDiff.length} migration(s) applied after this version:`);
|
|
133
|
+
for (const migration of migrationDiff) log.message(` ${dim("•")} ${migration}`);
|
|
134
|
+
log.message(dim("Rolling back will NOT revert these migrations. The older code will run against the current schema."));
|
|
135
|
+
const proceed = await confirm({ message: "Proceed with rollback?" });
|
|
136
|
+
if (isCancel(proceed) || !proceed) {
|
|
137
|
+
cancel("Rollback cancelled.");
|
|
138
|
+
process.exit(0);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const spinner = createSpinner();
|
|
143
|
+
spinner.start("Rolling back...");
|
|
144
|
+
try {
|
|
145
|
+
await activateCloudflareExistingVersion(context, target, current);
|
|
146
|
+
spinner.stop("Rollback complete.");
|
|
147
|
+
} catch (error) {
|
|
148
|
+
spinner.stop("Rollback failed.");
|
|
149
|
+
log.error(error instanceof Error ? error.message : String(error));
|
|
150
|
+
process.exit(1);
|
|
151
|
+
}
|
|
152
|
+
log.success(`Rolled back to ${import_picocolors.default.bold(target.id)}`);
|
|
153
|
+
outro(dim("Traffic is now serving the selected Cloudflare Worker Version."));
|
|
154
|
+
}
|
|
155
|
+
function formatAge(deployedAt) {
|
|
156
|
+
if (!deployedAt) return "";
|
|
157
|
+
const diffMs = Date.now() - new Date(ensureUtc(deployedAt)).getTime();
|
|
158
|
+
if (diffMs < 6e4) return "just now";
|
|
159
|
+
const minutes = Math.floor(diffMs / 6e4);
|
|
160
|
+
if (minutes < 60) return `${minutes}m ago`;
|
|
161
|
+
const hours = Math.floor(minutes / 60);
|
|
162
|
+
if (hours < 24) return `${hours}h ago`;
|
|
163
|
+
return `${Math.floor(hours / 24)}d ago`;
|
|
164
|
+
}
|
|
165
|
+
//#endregion
|
|
166
|
+
export { runRollbackCommand };
|
|
@@ -26,7 +26,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
26
26
|
}
|
|
27
27
|
return to;
|
|
28
28
|
};
|
|
29
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
29
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
30
30
|
value: mod,
|
|
31
31
|
enumerable: true
|
|
32
32
|
}) : target, mod));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as writeFileIfChanged } from "./project-tsconfig-B-QtXjLQ.mjs";
|
|
1
|
+
import { c as relative, o as join } from "./dist-BrsS7cai.mjs";
|
|
3
2
|
import { a as isVoidSocialAuthProvider } from "./providers-CJlNS3kT.mjs";
|
|
3
|
+
import { r as writeFileIfChanged } from "./project-tsconfig-Ql2XsSQp.mjs";
|
|
4
4
|
import { mkdirSync } from "node:fs";
|
|
5
5
|
import { getAuthTables, getSchema } from "better-auth/db";
|
|
6
6
|
//#region src/codegen/db-types.ts
|
|
@@ -17,7 +17,25 @@ const DRIZZLE_OPERATORS = "sql, eq, ne, gt, gte, lt, lte, and, or, not, desc, as
|
|
|
17
17
|
*/
|
|
18
18
|
function generateDbDts(outDir, schema, dialect) {
|
|
19
19
|
mkdirSync(outDir, { recursive: true });
|
|
20
|
-
const lines = dialect === "
|
|
20
|
+
const lines = dialect === "mysql" ? schema ? [
|
|
21
|
+
"// Auto-generated by void — do not edit",
|
|
22
|
+
"import type { MySql2Database } from \"void/_db-mysql\";",
|
|
23
|
+
"import type * as schema from \"@schema\";",
|
|
24
|
+
"type Schema = typeof schema;",
|
|
25
|
+
"export declare const db: MySql2Database<Schema>;",
|
|
26
|
+
"export declare function createDb(connectionString: string): MySql2Database<Schema>;",
|
|
27
|
+
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
28
|
+
"export type { MySql2Database } from \"void/_db-mysql\";",
|
|
29
|
+
""
|
|
30
|
+
] : [
|
|
31
|
+
"// Auto-generated by void — do not edit",
|
|
32
|
+
"import type { MySql2Database } from \"void/_db-mysql\";",
|
|
33
|
+
"export declare const db: MySql2Database<Record<string, never>>;",
|
|
34
|
+
"export declare function createDb(connectionString: string): MySql2Database<Record<string, never>>;",
|
|
35
|
+
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
36
|
+
"export type { MySql2Database } from \"void/_db-mysql\";",
|
|
37
|
+
""
|
|
38
|
+
] : dialect === "postgresql" ? schema ? [
|
|
21
39
|
"// Auto-generated by void — do not edit",
|
|
22
40
|
"import type { NodePgDatabase } from \"void/_db-pg\";",
|
|
23
41
|
"import type * as schema from \"@schema\";",
|
|
@@ -123,13 +141,32 @@ function renderEnumValues(values) {
|
|
|
123
141
|
function resolveFieldName(defaultFieldName, field) {
|
|
124
142
|
return field.fieldName ?? defaultFieldName;
|
|
125
143
|
}
|
|
144
|
+
const UNBOUNDED_MYSQL_AUTH_FIELDS = /* @__PURE__ */ new Set([
|
|
145
|
+
"account.accessToken",
|
|
146
|
+
"account.refreshToken",
|
|
147
|
+
"account.idToken"
|
|
148
|
+
]);
|
|
149
|
+
function usesUnboundedMySqlText(defaultModelName, defaultFieldName, field) {
|
|
150
|
+
return field.type === "string" && !field.unique && !field.index && !field.references && !field.sortable && UNBOUNDED_MYSQL_AUTH_FIELDS.has(`${defaultModelName}.${defaultFieldName}`);
|
|
151
|
+
}
|
|
126
152
|
function resolveReferenceFieldName(schema, model, field) {
|
|
127
153
|
if (field === "id") return "id";
|
|
128
154
|
const referencedField = schema[model]?.fields[field];
|
|
129
155
|
return referencedField ? resolveFieldName(field, referencedField) : field;
|
|
130
156
|
}
|
|
131
|
-
function createColumnBuilder(dialect, idStrategy, fieldName, field) {
|
|
157
|
+
function createColumnBuilder(dialect, idStrategy, defaultModelName, defaultFieldName, fieldName, field) {
|
|
132
158
|
const useIdType = fieldName === "id" || field.references?.field === "id";
|
|
159
|
+
if (dialect === "mysql") {
|
|
160
|
+
if (useIdType) return idStrategy === "serial" ? `int(${JSON.stringify(fieldName)})` : `varchar(${JSON.stringify(fieldName)}, { length: ${idStrategy === "uuid" ? 36 : 255} })`;
|
|
161
|
+
if (Array.isArray(field.type)) return `varchar(${JSON.stringify(fieldName)}, { length: 255, enum: ${renderEnumValues(field.type)} })`;
|
|
162
|
+
if (isJsonField(field)) return `json(${JSON.stringify(fieldName)})`;
|
|
163
|
+
switch (field.type) {
|
|
164
|
+
case "boolean": return `boolean(${JSON.stringify(fieldName)})`;
|
|
165
|
+
case "date": return `timestamp(${JSON.stringify(fieldName)}, { mode: "date", fsp: 3 })`;
|
|
166
|
+
case "number": return field.bigint ? `bigint(${JSON.stringify(fieldName)}, { mode: "number" })` : `int(${JSON.stringify(fieldName)})`;
|
|
167
|
+
default: return usesUnboundedMySqlText(defaultModelName, defaultFieldName, field) ? `text(${JSON.stringify(fieldName)})` : `varchar(${JSON.stringify(fieldName)}, { length: 255 })`;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
133
170
|
if (dialect === "postgresql") {
|
|
134
171
|
if (useIdType) {
|
|
135
172
|
if (idStrategy === "serial") return `integer(${JSON.stringify(fieldName)})`;
|
|
@@ -160,10 +197,13 @@ function createColumnBuilder(dialect, idStrategy, fieldName, field) {
|
|
|
160
197
|
default: return `text(${JSON.stringify(fieldName)})`;
|
|
161
198
|
}
|
|
162
199
|
}
|
|
163
|
-
function createColumnDefinition(dialect, schema, idStrategy, defaultToVariable, defaultFieldName, field) {
|
|
200
|
+
function createColumnDefinition(dialect, schema, idStrategy, defaultToVariable, defaultModelName, defaultFieldName, field) {
|
|
164
201
|
const actualFieldName = resolveFieldName(defaultFieldName, field);
|
|
165
|
-
const parts = [createColumnBuilder(dialect, idStrategy, actualFieldName, field)];
|
|
166
|
-
if (actualFieldName === "id")
|
|
202
|
+
const parts = [createColumnBuilder(dialect, idStrategy, defaultModelName, defaultFieldName, actualFieldName, field)];
|
|
203
|
+
if (actualFieldName === "id") {
|
|
204
|
+
parts.push(".primaryKey()");
|
|
205
|
+
if (dialect === "mysql" && idStrategy === "serial") parts.push(".autoincrement()");
|
|
206
|
+
}
|
|
167
207
|
if (field.required !== false || actualFieldName === "id") parts.push(".notNull()");
|
|
168
208
|
if (field.references) {
|
|
169
209
|
const referenceModel = Object.entries(schema).find(([_, value]) => value.modelName === field.references?.model)?.[0] ?? field.references.model;
|
|
@@ -177,10 +217,10 @@ function createColumnDefinition(dialect, schema, idStrategy, defaultToVariable,
|
|
|
177
217
|
return parts.join("");
|
|
178
218
|
}
|
|
179
219
|
function collectCoreImports(dialect, schema, idStrategy) {
|
|
180
|
-
const imports = /* @__PURE__ */ new Set([dialect === "postgresql" ? "pgTable" : "sqliteTable", "text"]);
|
|
181
|
-
if (idStrategy === "serial") imports.add("integer");
|
|
220
|
+
const imports = /* @__PURE__ */ new Set([dialect === "postgresql" ? "pgTable" : dialect === "mysql" ? "mysqlTable" : "sqliteTable", dialect === "mysql" ? "varchar" : "text"]);
|
|
221
|
+
if (idStrategy === "serial") imports.add(dialect === "mysql" ? "int" : "integer");
|
|
182
222
|
if (idStrategy === "uuid" && dialect === "postgresql") imports.add("uuid");
|
|
183
|
-
for (const [, table] of Object.entries(schema)) for (const [defaultFieldName, field] of Object.entries(table.fields)) {
|
|
223
|
+
for (const [defaultModelName, table] of Object.entries(schema)) for (const [defaultFieldName, field] of Object.entries(table.fields)) {
|
|
184
224
|
if (resolveFieldName(defaultFieldName, field) === "id" || field.references?.field === "id") {
|
|
185
225
|
if (idStrategy === "serial") imports.add("integer");
|
|
186
226
|
if (idStrategy === "uuid" && dialect === "postgresql") imports.add("uuid");
|
|
@@ -188,24 +228,24 @@ function collectCoreImports(dialect, schema, idStrategy) {
|
|
|
188
228
|
}
|
|
189
229
|
if (field.index) imports.add("index");
|
|
190
230
|
if (Array.isArray(field.type) || field.type === "string") {
|
|
191
|
-
imports.add("text");
|
|
231
|
+
imports.add(dialect === "mysql" && !usesUnboundedMySqlText(defaultModelName, defaultFieldName, field) ? "varchar" : "text");
|
|
192
232
|
continue;
|
|
193
233
|
}
|
|
194
234
|
if (isJsonField(field)) {
|
|
195
|
-
imports.add(dialect === "postgresql" ? "jsonb" : "text");
|
|
235
|
+
imports.add(dialect === "postgresql" ? "jsonb" : dialect === "mysql" ? "json" : "text");
|
|
196
236
|
continue;
|
|
197
237
|
}
|
|
198
238
|
if (field.type === "boolean") {
|
|
199
|
-
imports.add(dialect === "postgresql" ? "boolean" : "integer");
|
|
239
|
+
imports.add(dialect === "postgresql" ? "boolean" : dialect === "mysql" ? "boolean" : "integer");
|
|
200
240
|
continue;
|
|
201
241
|
}
|
|
202
242
|
if (field.type === "date") {
|
|
203
|
-
imports.add(dialect === "postgresql" ? "timestamp" : "integer");
|
|
243
|
+
imports.add(dialect === "postgresql" ? "timestamp" : dialect === "mysql" ? "timestamp" : "integer");
|
|
204
244
|
continue;
|
|
205
245
|
}
|
|
206
246
|
if (field.type === "number") {
|
|
207
|
-
imports.add("integer");
|
|
208
|
-
if (field.bigint && dialect
|
|
247
|
+
imports.add(dialect === "mysql" ? "int" : "integer");
|
|
248
|
+
if (field.bigint && dialect !== "sqlite") imports.add("bigint");
|
|
209
249
|
}
|
|
210
250
|
}
|
|
211
251
|
return [...imports].sort();
|
|
@@ -218,8 +258,8 @@ function generateVoidAuthDrizzleSchema(runtime, env = {}) {
|
|
|
218
258
|
const defaultToVariable = /* @__PURE__ */ new Map();
|
|
219
259
|
const entries = Object.entries(schema).sort(([, left], [, right]) => (left.order ?? DEFAULT_TABLE_ORDER) - (right.order ?? DEFAULT_TABLE_ORDER));
|
|
220
260
|
for (const [defaultModelName] of entries) defaultToVariable.set(defaultModelName, `${sanitizeIdentifier(defaultModelName)}Table`);
|
|
221
|
-
const tableFactory = runtime.dialect === "postgresql" ? "pgTable" : "sqliteTable";
|
|
222
|
-
const importPath = runtime.dialect === "postgresql" ? "void/schema-pg" : "void/schema-d1";
|
|
261
|
+
const tableFactory = runtime.dialect === "postgresql" ? "pgTable" : runtime.dialect === "mysql" ? "mysqlTable" : "sqliteTable";
|
|
262
|
+
const importPath = runtime.dialect === "postgresql" ? "void/schema-pg" : runtime.dialect === "mysql" ? "void/schema-mysql" : "void/schema-d1";
|
|
223
263
|
const lines = [
|
|
224
264
|
"// Auto-generated by void — do not edit",
|
|
225
265
|
`import { ${collectCoreImports(runtime.dialect, schema, idStrategy).join(", ")} } from ${JSON.stringify(importPath)};`,
|
|
@@ -228,12 +268,12 @@ function generateVoidAuthDrizzleSchema(runtime, env = {}) {
|
|
|
228
268
|
for (const [defaultModelName, table] of entries) {
|
|
229
269
|
const variableName = defaultToVariable.get(defaultModelName);
|
|
230
270
|
const fieldEntries = Object.entries(table.fields);
|
|
231
|
-
const renderedFields = [` "id": ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, "id", {
|
|
271
|
+
const renderedFields = [` "id": ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, defaultModelName, "id", {
|
|
232
272
|
type: idStrategy === "serial" ? "number" : "string",
|
|
233
273
|
required: true
|
|
234
274
|
})},`, ...fieldEntries.map(([defaultFieldName, field]) => {
|
|
235
275
|
const actualFieldName = resolveFieldName(defaultFieldName, field);
|
|
236
|
-
return ` ${JSON.stringify(actualFieldName)}: ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, defaultFieldName, field)},`;
|
|
276
|
+
return ` ${JSON.stringify(actualFieldName)}: ${createColumnDefinition(runtime.dialect, schema, idStrategy, defaultToVariable, defaultModelName, defaultFieldName, field)},`;
|
|
237
277
|
})];
|
|
238
278
|
const indexedFields = fieldEntries.filter(([, field]) => field.index && !field.unique);
|
|
239
279
|
if (indexedFields.length > 0) lines.push(`export const ${variableName} = ${tableFactory}(${JSON.stringify(table.modelName)}, {`, ...renderedFields, `}, (table) => [`, ...indexedFields.map(([defaultFieldName, field]) => {
|
|
@@ -252,7 +292,12 @@ function generateVoidAuthDrizzleSchema(runtime, env = {}) {
|
|
|
252
292
|
}
|
|
253
293
|
function resolveVoidAuthMigrationSchema(runtime, env = {}) {
|
|
254
294
|
const options = resolveSchemaOptions(runtime, env);
|
|
295
|
+
const logicalSchema = getAuthTables(options);
|
|
255
296
|
const schema = getSchema(options);
|
|
297
|
+
const unboundedMySqlFields = /* @__PURE__ */ new Set();
|
|
298
|
+
if (runtime.dialect === "mysql") {
|
|
299
|
+
for (const [defaultModelName, table] of Object.entries(logicalSchema)) for (const [defaultFieldName, field] of Object.entries(table.fields)) if (usesUnboundedMySqlText(defaultModelName, defaultFieldName, field)) unboundedMySqlFields.add(`${table.modelName}\0${resolveFieldName(defaultFieldName, field)}`);
|
|
300
|
+
}
|
|
256
301
|
return {
|
|
257
302
|
dialect: runtime.dialect,
|
|
258
303
|
idStrategy: resolveIdStrategy(options),
|
|
@@ -265,6 +310,7 @@ function resolveVoidAuthMigrationSchema(runtime, env = {}) {
|
|
|
265
310
|
unique: field.unique === true,
|
|
266
311
|
index: field.index === true,
|
|
267
312
|
bigint: field.bigint === true,
|
|
313
|
+
...unboundedMySqlFields.has(`${name}\0${fieldName}`) ? { unbounded: true } : {},
|
|
268
314
|
...field.references ? { references: {
|
|
269
315
|
table: field.references.model,
|
|
270
316
|
field: field.references.field,
|
|
@@ -276,7 +322,7 @@ function resolveVoidAuthMigrationSchema(runtime, env = {}) {
|
|
|
276
322
|
}
|
|
277
323
|
function generateVoidAuthDatabaseModule(options) {
|
|
278
324
|
const schemaImport = JSON.stringify(options.schemaImportPath);
|
|
279
|
-
const provider = options.dialect === "postgresql" ? "pg" : "sqlite";
|
|
325
|
+
const provider = options.dialect === "postgresql" ? "pg" : options.dialect === "mysql" ? "mysql" : "sqlite";
|
|
280
326
|
return [
|
|
281
327
|
"// Auto-generated by void — do not edit",
|
|
282
328
|
`import { drizzleAdapter } from ${JSON.stringify(options.drizzleAdapterPath)};`,
|
|
@@ -308,7 +354,8 @@ function generateQueueTypes(queues, queuesDir, outDir) {
|
|
|
308
354
|
lines.push("// Auto-generated by void — do not edit");
|
|
309
355
|
lines.push("export interface QueueMap {");
|
|
310
356
|
for (const q of queues) {
|
|
311
|
-
const
|
|
357
|
+
const absPath = `${queuesDir}/${q.filePath}`;
|
|
358
|
+
const importPath = relative(outDir, absPath);
|
|
312
359
|
lines.push(` ${JSON.stringify(q.name)}: Queue<(typeof import(${JSON.stringify(importPath)}))["default"]["__payload"]>;`);
|
|
313
360
|
}
|
|
314
361
|
lines.push("}");
|
|
@@ -435,7 +482,8 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
435
482
|
lines.push(" interface RouteMap {");
|
|
436
483
|
for (const route of scan.routes) {
|
|
437
484
|
if (route.methods.length === 0) continue;
|
|
438
|
-
const
|
|
485
|
+
const absRoutePath = `${routesDir}/${route.filePath}`;
|
|
486
|
+
const importPath = relative(outDir, absRoutePath);
|
|
439
487
|
lines.push(` ${JSON.stringify(route.pattern)}: {`);
|
|
440
488
|
for (const method of route.methods) {
|
|
441
489
|
lines.push(` ${method}: {`);
|
|
@@ -449,7 +497,8 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
449
497
|
lines.push("");
|
|
450
498
|
lines.push(" interface WebSocketRouteMap {");
|
|
451
499
|
for (const route of scan.websockets ?? []) {
|
|
452
|
-
const
|
|
500
|
+
const absRoutePath = `${routesDir}/${route.filePath}`;
|
|
501
|
+
const importPath = relative(outDir, absRoutePath);
|
|
453
502
|
lines.push(` ${JSON.stringify(route.pattern)}: {`);
|
|
454
503
|
lines.push(` params: RouteParams<${JSON.stringify(route.params)}>;`);
|
|
455
504
|
lines.push(` client: ExtractInput<(typeof import(${JSON.stringify(importPath)}))["default"]["messages"]["client"]>;`);
|
|
@@ -466,7 +515,10 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
466
515
|
if (hasAction && hasActions) throw new Error(`pages: Page '${page.pattern}' exports both "action" and "actions". Use one or the other.`);
|
|
467
516
|
lines.push(` ${JSON.stringify(page.pattern)}: {`);
|
|
468
517
|
let importPath = null;
|
|
469
|
-
if (page.serverPath)
|
|
518
|
+
if (page.serverPath) {
|
|
519
|
+
const absPath = `${pagesDir}/${page.serverPath}`;
|
|
520
|
+
importPath = relative(outDir, absPath);
|
|
521
|
+
}
|
|
470
522
|
if (hasActions) {
|
|
471
523
|
if (importPath) {
|
|
472
524
|
const actionsImport = `(typeof import(${JSON.stringify(importPath)}))["actions"]`;
|
package/dist/routes-stub.d.mts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
//#region src/routes-stub.d.ts
|
|
2
2
|
/** Stub interface augmented by the generated .void/routes.d.ts */
|
|
3
|
-
interface RouteMap {}
|
|
3
|
+
export interface RouteMap {}
|
|
4
4
|
/** Stub interface augmented by the generated .void/routes.d.ts */
|
|
5
|
-
interface WebSocketRouteMap {}
|
|
5
|
+
export interface WebSocketRouteMap {}
|
|
6
6
|
/** Union of known route patterns (keys of the generated RouteMap). */
|
|
7
|
-
type RouteName = keyof RouteMap;
|
|
7
|
+
export type RouteName = keyof RouteMap;
|
|
8
8
|
/**
|
|
9
|
-
* Destination type for rewrites / fallbacks / c.rewrite().
|
|
10
|
-
*
|
|
11
|
-
* The `string & {}` branch keeps IDE autocomplete of known routes while
|
|
12
|
-
* still accepting arbitrary strings (needed for dynamic paths like
|
|
13
|
-
* `/users/${id}`). When no routes are generated yet, `RouteName` is
|
|
14
|
-
* `never` and this degenerates to `string & {}`, which is assignable
|
|
15
|
-
* from any string.
|
|
16
|
-
*/
|
|
17
|
-
type RewriteDestination = RouteName | (string & {});
|
|
9
|
+
* Destination type for rewrites / fallbacks / c.rewrite().
|
|
10
|
+
*
|
|
11
|
+
* The `string & {}` branch keeps IDE autocomplete of known routes while
|
|
12
|
+
* still accepting arbitrary strings (needed for dynamic paths like
|
|
13
|
+
* `/users/${id}`). When no routes are generated yet, `RouteName` is
|
|
14
|
+
* `never` and this degenerates to `string & {}`, which is assignable
|
|
15
|
+
* from any string.
|
|
16
|
+
*/
|
|
17
|
+
export type RewriteDestination = RouteName | (string & {});
|
|
18
18
|
/** Stub interface for page action types — augmented by generated routes.d.ts */
|
|
19
|
-
interface PageActionMap {}
|
|
19
|
+
export interface PageActionMap {}
|
|
20
20
|
/** Parse "/path?action" into base path and action name */
|
|
21
|
-
type ParseActionUrl<U extends string> = U extends `${infer Base}?${infer Action}` ? {
|
|
21
|
+
export type ParseActionUrl<U extends string> = U extends `${infer Base}?${infer Action}` ? {
|
|
22
22
|
base: Base;
|
|
23
23
|
action: Action;
|
|
24
24
|
} : {
|
|
@@ -26,7 +26,7 @@ type ParseActionUrl<U extends string> = U extends `${infer Base}?${infer Action}
|
|
|
26
26
|
action: never;
|
|
27
27
|
};
|
|
28
28
|
/** Resolve body type for a useForm URL (single action or named action) */
|
|
29
|
-
type ResolveActionBody<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? ParseActionUrl<U>["action"] extends never ? PageActionMap[ParseActionUrl<U>["base"]] extends {
|
|
29
|
+
export type ResolveActionBody<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? ParseActionUrl<U>["action"] extends never ? PageActionMap[ParseActionUrl<U>["base"]] extends {
|
|
30
30
|
body: infer B;
|
|
31
31
|
} ? B : Record<string, unknown> : PageActionMap[ParseActionUrl<U>["base"]] extends {
|
|
32
32
|
actions: infer A;
|
|
@@ -34,22 +34,21 @@ type ResolveActionBody<U extends string> = ParseActionUrl<U>["base"] extends key
|
|
|
34
34
|
body: infer B;
|
|
35
35
|
} ? B : Record<string, unknown> : never : never : Record<string, unknown>;
|
|
36
36
|
/** Resolve params type */
|
|
37
|
-
type ResolveActionParams<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? PageActionMap[ParseActionUrl<U>["base"]] extends {
|
|
37
|
+
export type ResolveActionParams<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? PageActionMap[ParseActionUrl<U>["base"]] extends {
|
|
38
38
|
params: infer P;
|
|
39
39
|
} ? P : never : never;
|
|
40
40
|
/** Has params check */
|
|
41
|
-
type HasActionParams<U extends string> = ResolveActionParams<U> extends Record<string, string> ? true : false;
|
|
41
|
+
export type HasActionParams<U extends string> = ResolveActionParams<U> extends Record<string, string> ? true : false;
|
|
42
42
|
/** Form options type (requires params for dynamic routes) */
|
|
43
|
-
type ActionFormOptions<U extends string> = HasActionParams<U> extends true ? {
|
|
43
|
+
export type ActionFormOptions<U extends string> = HasActionParams<U> extends true ? {
|
|
44
44
|
params: ResolveActionParams<U>;
|
|
45
45
|
} : {
|
|
46
46
|
params?: never;
|
|
47
47
|
};
|
|
48
48
|
/** Valid useForm URLs — single-action pages + "page?name" combos + default actions */
|
|
49
|
-
type ActionUrl = { [K in keyof PageActionMap]: PageActionMap[K] extends {
|
|
49
|
+
export type ActionUrl = { [K in keyof PageActionMap]: PageActionMap[K] extends {
|
|
50
50
|
body: unknown;
|
|
51
|
-
} ? K : never }[keyof PageActionMap] | { [K in keyof PageActionMap]: PageActionMap[K] extends {
|
|
51
|
+
} ? K : never; }[keyof PageActionMap] | { [K in keyof PageActionMap]: PageActionMap[K] extends {
|
|
52
52
|
actions: infer A;
|
|
53
|
-
} ? `${K & string}?${keyof A & string}` : never }[keyof PageActionMap];
|
|
54
|
-
//#endregion
|
|
55
|
-
export { ActionFormOptions, ActionUrl, HasActionParams, PageActionMap, ParseActionUrl, ResolveActionBody, ResolveActionParams, RewriteDestination, RouteMap, RouteName, WebSocketRouteMap };
|
|
53
|
+
} ? `${K & string}?${keyof A & string}` : never; }[keyof PageActionMap];
|
|
54
|
+
//#endregion
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.mjs";
|
|
2
|
+
import { c as collectMigrations } from "./validate-tBBN_dXH.mjs";
|
|
3
|
+
//#region src/migrations/runner-mysql.ts
|
|
4
|
+
var runner_mysql_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
applyMySqlMigrations: () => applyMySqlMigrations,
|
|
6
|
+
getMySqlAppliedMigrations: () => getMySqlAppliedMigrations,
|
|
7
|
+
readMySqlAppliedMigrations: () => readMySqlAppliedMigrations,
|
|
8
|
+
runMySqlMigrations: () => runMySqlMigrations
|
|
9
|
+
});
|
|
10
|
+
async function readMySqlAppliedMigrations(client) {
|
|
11
|
+
try {
|
|
12
|
+
return (await client.query("SELECT `name` FROM `_void_migrations`")).map((row) => String(row.name));
|
|
13
|
+
} catch (error) {
|
|
14
|
+
const value = typeof error === "object" && error !== null ? error : void 0;
|
|
15
|
+
if (value?.code === "ER_NO_SUCH_TABLE" || value?.errno === 1146) return [];
|
|
16
|
+
throw error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function getMySqlAppliedMigrations(url) {
|
|
20
|
+
const { createConnection } = await import("mysql2/promise");
|
|
21
|
+
const connection = await createConnection(url);
|
|
22
|
+
try {
|
|
23
|
+
return await readMySqlAppliedMigrations({ async query(sql, params) {
|
|
24
|
+
const [rows] = await connection.query(sql, params);
|
|
25
|
+
return Array.isArray(rows) ? rows : [];
|
|
26
|
+
} });
|
|
27
|
+
} finally {
|
|
28
|
+
await connection.end();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async function applyMySqlMigrations(client, migrations) {
|
|
32
|
+
if (migrations.length === 0) return [];
|
|
33
|
+
await client.query("CREATE TABLE IF NOT EXISTS `_void_migrations` (`name` VARCHAR(255) PRIMARY KEY, `applied_at` VARCHAR(64) NOT NULL)");
|
|
34
|
+
const existing = await client.query("SELECT `name` FROM `_void_migrations`");
|
|
35
|
+
const appliedSet = new Set(existing.map((row) => String(row.name)));
|
|
36
|
+
const pending = migrations.filter((migration) => !appliedSet.has(migration.name));
|
|
37
|
+
for (const migration of pending) {
|
|
38
|
+
await client.query(migration.sql);
|
|
39
|
+
await client.query("INSERT INTO `_void_migrations` (`name`, `applied_at`) VALUES (?, ?)", [migration.name, (/* @__PURE__ */ new Date()).toISOString()]);
|
|
40
|
+
}
|
|
41
|
+
return pending.map((migration) => migration.name);
|
|
42
|
+
}
|
|
43
|
+
async function runMySqlMigrations(migrationsDir, url) {
|
|
44
|
+
const migrations = collectMigrations(migrationsDir);
|
|
45
|
+
if (migrations.length === 0) return [];
|
|
46
|
+
const { createConnection } = await import("mysql2/promise");
|
|
47
|
+
const connection = await createConnection({
|
|
48
|
+
uri: url,
|
|
49
|
+
multipleStatements: true
|
|
50
|
+
});
|
|
51
|
+
try {
|
|
52
|
+
return await applyMySqlMigrations({ async query(sql, params) {
|
|
53
|
+
const [rows] = await connection.query(sql, params);
|
|
54
|
+
return Array.isArray(rows) ? rows : [];
|
|
55
|
+
} }, migrations);
|
|
56
|
+
} finally {
|
|
57
|
+
await connection.end();
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//#endregion
|
|
61
|
+
export { runner_mysql_exports as n, runMySqlMigrations as t };
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as __exportAll } from "./rolldown-runtime-rQ84J-ij.mjs";
|
|
2
|
+
import { c as collectMigrations } from "./validate-tBBN_dXH.mjs";
|
|
2
3
|
//#region src/migrations/runner-pg.ts
|
|
4
|
+
var runner_pg_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
applyPgMigrations: () => applyPgMigrations,
|
|
6
|
+
getPgAppliedMigrations: () => getPgAppliedMigrations,
|
|
7
|
+
readPgAppliedMigrations: () => readPgAppliedMigrations,
|
|
8
|
+
runPgMigrations: () => runPgMigrations
|
|
9
|
+
});
|
|
10
|
+
async function readPgAppliedMigrations(client) {
|
|
11
|
+
try {
|
|
12
|
+
return (await client.query("SELECT name FROM _void_migrations")).rows.map((row) => String(row.name));
|
|
13
|
+
} catch (error) {
|
|
14
|
+
if (typeof error === "object" && error !== null && error.code === "42P01") return [];
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
3
18
|
/**
|
|
4
19
|
* Apply unapplied SQL migrations via a connected PostgreSQL client.
|
|
5
20
|
* Each migration runs in its own transaction (BEGIN/COMMIT).
|
|
@@ -9,10 +24,7 @@ async function getPgAppliedMigrations(url) {
|
|
|
9
24
|
const client = new Client({ connectionString: url });
|
|
10
25
|
await client.connect();
|
|
11
26
|
try {
|
|
12
|
-
await client
|
|
13
|
-
return (await client.query("SELECT name FROM _void_migrations")).rows.map((row) => String(row.name));
|
|
14
|
-
} catch {
|
|
15
|
-
return [];
|
|
27
|
+
return await readPgAppliedMigrations(client);
|
|
16
28
|
} finally {
|
|
17
29
|
await client.end();
|
|
18
30
|
}
|
|
@@ -54,4 +66,4 @@ async function runPgMigrations(migrationsDir, url) {
|
|
|
54
66
|
}
|
|
55
67
|
}
|
|
56
68
|
//#endregion
|
|
57
|
-
export {
|
|
69
|
+
export { runner_pg_exports as n, runPgMigrations as t };
|
package/dist/runtime/ai.d.mts
CHANGED
|
@@ -19,22 +19,29 @@ type AiProviderFetchInit = {
|
|
|
19
19
|
//#endregion
|
|
20
20
|
//#region src/runtime/ai.d.ts
|
|
21
21
|
/**
|
|
22
|
-
* Extended AI type with a convenience `stream()` method.
|
|
23
|
-
*
|
|
24
|
-
* `stream()` calls `ai.run()` with `stream: true` and wraps the result
|
|
25
|
-
* in a `Response` with SSE headers — ready to return from a route handler.
|
|
26
|
-
*/
|
|
27
|
-
type VoidAi = Omit<Ai, "run"> & {
|
|
28
|
-
/** Workers AI inference (existing) */
|
|
29
|
-
run(model:
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
* Extended AI type with a convenience `stream()` method.
|
|
23
|
+
*
|
|
24
|
+
* `stream()` calls `ai.run()` with `stream: true` and wraps the result
|
|
25
|
+
* in a `Response` with SSE headers — ready to return from a route handler.
|
|
26
|
+
*/
|
|
27
|
+
export type VoidAi = Omit<Ai, "run"> & {
|
|
28
|
+
/** Workers AI inference (existing) */
|
|
29
|
+
run<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<AiModels[Name]["postProcessedOutputs"]>;
|
|
30
|
+
/** Cloudflare AI Gateway model inference. Accepts Cloudflare model IDs unchanged. */
|
|
31
|
+
run(model: string, inputs: unknown, options?: AiOptions): Promise<unknown>;
|
|
32
|
+
/** Image generation. Returns the proxy response so callers can return or parse it. */
|
|
33
|
+
image<Name extends keyof AiModels>(model: Name, inputs: AiModels[Name]["inputs"], options?: AiOptions): Promise<Response>;
|
|
34
|
+
/** Cloudflare AI Gateway model inference returned as a Response. */
|
|
35
|
+
image(model: string, inputs: unknown, options?: AiOptions): Promise<Response>;
|
|
36
|
+
/** Provider-native AI Gateway requests using a project secret for the provider API key. */
|
|
32
37
|
provider(provider: AiProvider, options?: AiProviderOptions): {
|
|
33
38
|
fetch(path: string, init?: AiProviderFetchInit): Promise<Response>;
|
|
34
|
-
};
|
|
35
|
-
|
|
39
|
+
};
|
|
40
|
+
/** Stream Workers AI response as SSE */
|
|
41
|
+
stream<Name extends keyof AiModels>(model: Name, inputs: Omit<AiModels[Name]["inputs"], "stream">, options?: AiOptions): Promise<Response>;
|
|
42
|
+
/** Stream any Cloudflare AI Gateway model response as SSE */
|
|
36
43
|
stream(model: string, inputs: Record<string, unknown>, options?: AiOptions): Promise<Response>;
|
|
37
44
|
};
|
|
38
|
-
declare const ai: VoidAi;
|
|
45
|
+
export declare const ai: VoidAi;
|
|
39
46
|
//#endregion
|
|
40
|
-
export {
|
|
47
|
+
export type { AiProvider, AiProviderFetchInit, AiProviderName, AiProviderOptions, ImageFileInput };
|