void 0.22.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-C84Ee8cO.mjs} +4 -4
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-CZuiVsFh.mjs → auth-CCjt0hcq.mjs} +1 -1
- package/dist/{auth-DLNN0D3Z.mjs → auth-CSkdO2Bb.mjs} +4 -47
- package/dist/{auth-link-BLO4ptzo.mjs → auth-link-CioEg6uY.mjs} +4 -4
- package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-BsR981d4.mjs} +4 -4
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-LzvNJORH.mjs} +17 -5
- package/dist/{cache-D0sWhgKI.mjs → cache-C4MvnrMH.mjs} +2 -2
- package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-abUxpP2n.mjs} +2 -2
- package/dist/{cf-build-output-BJ6yGEIS.mjs → cf-build-output-BPqOT964.mjs} +2 -1
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +80 -455
- package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +442 -421
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-Cu7jWiF1.mjs +2 -0
- package/dist/{client-BTZ3XkrB.mjs → client-RV8NVeB8.mjs} +140 -21
- package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
- package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-BcrVyTmJ.mjs} +5 -5
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-B8uPZ4nx.mjs} +3 -3
- package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-AiWashgg.mjs} +1 -1
- package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-fxHb-byx.mjs} +116 -172
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-VavjpDnp.d.mts → config-BMHb8RCj.d.mts} +1 -0
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-Dg-WkW-C.mjs → connect-Bd4kJd9U.mjs} +5 -5
- package/dist/{create-project-DdoqwFLF.mjs → create-project-Boczwj5r.mjs} +1 -1
- package/dist/{create-project-l9J7pbtm.mjs → create-project-bMf6ffLZ.mjs} +2 -2
- package/dist/{db-gp2sCXyN.mjs → db-8uG64XLl.mjs} +21 -21
- package/dist/{delete-TTedbH6B.mjs → delete-NvbiyeJf.mjs} +2 -2
- package/dist/{deploy-CH-o2CaZ.mjs → deploy-DzAIwqNU.mjs} +908 -582
- package/dist/{deploy-B19L2Bra.mjs → deploy-bjXdFCtn.mjs} +1 -1
- package/dist/{domain-JRF59P_r.mjs → domain-y5Tvydvo.mjs} +3 -3
- package/dist/{email-Bo6G9LOZ.mjs → email-B3umsW75.mjs} +13 -28
- package/dist/{env-BYOrWQnv.mjs → env-BS6qYHDb.mjs} +4 -4
- package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-BPn7vk-V.mjs} +18 -71
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-DbTg7-ar.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-sCtlCOdA.mjs → gen-B580--vC.mjs} +2 -2
- package/dist/gen-BVaUUumi.mjs +2 -0
- package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-v45BdfKX.mjs} +2 -2
- package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
- package/dist/help-DofyZuY7.mjs +2 -0
- package/dist/{help-GKtwl07I.mjs → help-daGKjXGk.mjs} +229 -747
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +288 -1502
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-FZx3Elvz.mjs → init-Bvy7zrBo.mjs} +46 -15
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-BrQfb_CU.mjs → link-CDqqCjFl.mjs} +3 -3
- package/dist/{list-D44jmIAM.mjs → list-CZj0dzKY.mjs} +3 -3
- package/dist/{live-CKJlvlNp.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-Bg9OzEEO.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/login-DYt_An22.mjs +2 -0
- package/dist/{login-CAsAsQ-_.mjs → login-UZKFM_u7.mjs} +3 -3
- package/dist/{logs-BjKvFnVM.mjs → logs-CUZ6t9t3.mjs} +3 -3
- package/dist/migrate-8_2u55MD.mjs +2 -0
- package/dist/{migrate-BPITvDJN.mjs → migrate-DHul7PRV.mjs} +2 -1
- package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
- package/dist/operator-args-CLgKGlwU.mjs +690 -0
- package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DBA6dl0m.mjs} +68 -22
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +1 -1
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-BJdRtlLq.mjs +506 -0
- package/dist/platform-args-D3RXyR6h.mjs +2 -0
- package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-B56E9YP1.mjs} +3 -3
- package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BDWO_aER.mjs} +2 -2
- package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-1gg4CSRe.mjs} +3 -3
- package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-Bt-1w6pY.mjs} +1 -1
- package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMcQStSc.mjs} +24 -3
- package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-BNkcz0OB.mjs} +2 -2
- package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-9OyBALhH.mjs} +327 -215
- package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BE6C_jxh.mjs} +1 -1
- package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CjwLVQwN.mjs} +6 -3
- package/dist/{platform-management-DOtss0BN.mjs → platform-management-CnyTdcWX.mjs} +1 -1
- package/dist/platform-plans-config-BNGKGr4P.mjs +359 -0
- package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-D6KSpuFm.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-C-6YZyyg.mjs → prepare-B5Mkic5u.mjs} +1 -1
- package/dist/{prepare-CRhJbVrG.mjs → prepare-DOsL0CC9.mjs} +4 -20
- package/dist/prepare-cgvDMtSb.mjs +2 -0
- package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-CNzrqvBv.mjs} +16 -16
- package/dist/{project-team-BvgM0WoX.mjs → project-team-DQOWPfQT.mjs} +2 -2
- package/dist/{project-token-l5DqK6Az.mjs → project-token-CTDYU0Cc.mjs} +2 -2
- package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-BNAkW-_0.mjs} +2 -2
- package/dist/{protocol-BBa6cstI.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-Fr9pRqce.mjs → provision-C4ORE7G7.mjs} +1 -1
- package/dist/{provision-C4IGqkBf.mjs → provision-CJFgTZY8.mjs} +89 -198
- package/dist/{requests-DN-BbNiM.mjs → requests-MhxYnau8.mjs} +2 -2
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-D7rzSaZM.mjs → rollback-CJ6iSDoU.mjs} +3 -3
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +84 -17
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +1 -1
- package/dist/runtime/sandbox-container.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +3 -3
- package/dist/runtime/sandbox.mjs +75 -45
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/{sandbox-qpNBT8a3.d.mts → sandbox-XZAqzFlG.d.mts} +11 -8
- package/dist/{sandbox-container-DdNEBfCc.d.mts → sandbox-container-Bo0eiFKz.d.mts} +2 -1
- package/dist/{sandbox-container-4fdqLnyb.mjs → sandbox-container-C6ItmVuN.mjs} +4 -2
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-BOtOl_cb.mjs → secret-Dli5fP0B.mjs} +4 -4
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-DQF1vKyf.mjs → wrangler-7K-bW_DL.mjs} +8 -239
- package/dist/{ws-BoY7vQML.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +15 -8
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +50 -135
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +27 -113
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +3 -47
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +5 -18
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +22 -72
- package/skills/void/docs/guide/email/domains.md +112 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +23 -152
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/credentials.md +6 -4
- package/skills/void/docs/guide/platform/installation/domains.md +30 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +2 -0
- package/skills/void/docs/guide/platform/installation/maintenance.md +3 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +20 -15
- package/skills/void/docs/guide/platform/installation/setup.md +9 -5
- package/skills/void/docs/guide/platform-administration.md +1 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +4 -9
- package/skills/void/docs/guide/sandboxes.md +29 -21
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +88 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +85 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +127 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +45 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +32 -1682
- package/skills/void/docs/reference/config.md +12 -18
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/client-Czz8o5jP.mjs +0 -2
- package/dist/gen-CNJ62MM7.mjs +0 -2
- package/dist/help-CmZzxUba.mjs +0 -2
- package/dist/login-CGcRKEoi.mjs +0 -2
- package/dist/migrate-CYfbKkXh.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-Bm3iq-u4.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
package/dist/pages/protocol.mjs
CHANGED
|
@@ -1,309 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import { i as resolveHead, n as renderHeadToString, r as renderHtmlAttrs, t as renderBodyAttrs } from "../head-D_QRR5Yd.mjs";
|
|
4
|
-
import { t as serializePageData } from "../serialize-BPvnNQuA.mjs";
|
|
5
|
-
//#region src/pages/protocol.ts
|
|
6
|
-
const POWERED_BY = { "X-Powered-By": "Void" };
|
|
7
|
-
const RENDER_ERROR_ASSET_TAGS_KEY = "__voidPageAssetTags";
|
|
8
|
-
/** Escape characters that are unsafe inside inline <script> tags to prevent XSS. */
|
|
9
|
-
function safeJsonStringify(value) {
|
|
10
|
-
return (JSON.stringify(value) ?? "null").replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
|
|
11
|
-
}
|
|
12
|
-
function isPagesRequest(c) {
|
|
13
|
-
return c.req.header("x-voidpages") === "true";
|
|
14
|
-
}
|
|
15
|
-
function pageResponseHeaders(c, headers) {
|
|
16
|
-
const out = new Headers(c.res.headers);
|
|
17
|
-
for (const [key, value] of Object.entries(headers)) out.set(key, value);
|
|
18
|
-
return out;
|
|
19
|
-
}
|
|
20
|
-
function escapeHtmlAttr(value) {
|
|
21
|
-
return value.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<");
|
|
22
|
-
}
|
|
23
|
-
function serializeStyleCss(css) {
|
|
24
|
-
return css.replace(/<\/style/gi, "<\\/style");
|
|
25
|
-
}
|
|
26
|
-
function serializeDevCssAssets(assets, nonce) {
|
|
27
|
-
return assets.map((asset) => `<style data-vite-dev-id="${escapeHtmlAttr(asset.id ?? asset.url)}" nonce="${escapeHtmlAttr(nonce)}">${serializeStyleCss(asset.css)}</style>`).join("\n");
|
|
28
|
-
}
|
|
29
|
-
function hasCompatibleStyleSource(value, nonceSource) {
|
|
30
|
-
return value === "'unsafe-inline'" || value === nonceSource;
|
|
31
|
-
}
|
|
32
|
-
function adjustCspValue(value, nonce) {
|
|
33
|
-
const nonceSource = `'nonce-${nonce}'`;
|
|
34
|
-
const parsed = value.split(";").map((part) => part.trim()).filter(Boolean).map((directive) => {
|
|
35
|
-
const [name = "", ...sources] = directive.split(/\s+/);
|
|
36
|
-
return {
|
|
37
|
-
name: name.toLowerCase(),
|
|
38
|
-
originalName: name,
|
|
39
|
-
sources
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
const styleElem = parsed.find((directive) => directive.name === "style-src-elem");
|
|
43
|
-
if (styleElem) {
|
|
44
|
-
if (!styleElem.sources.some((source) => hasCompatibleStyleSource(source, nonceSource))) styleElem.sources.push(nonceSource);
|
|
45
|
-
return parsed.map((directive) => [directive.originalName, ...directive.sources].join(" ")).join("; ");
|
|
46
|
-
}
|
|
47
|
-
const style = parsed.find((directive) => directive.name === "style-src");
|
|
48
|
-
if (style) {
|
|
49
|
-
if (!style.sources.some((source) => hasCompatibleStyleSource(source, nonceSource))) style.sources.push(nonceSource);
|
|
50
|
-
return parsed.map((directive) => [directive.originalName, ...directive.sources].join(" ")).join("; ");
|
|
51
|
-
}
|
|
52
|
-
const defaultSrc = parsed.find((directive) => directive.name === "default-src");
|
|
53
|
-
if (defaultSrc) {
|
|
54
|
-
parsed.push({
|
|
55
|
-
name: "style-src",
|
|
56
|
-
originalName: "style-src",
|
|
57
|
-
sources: [...defaultSrc.sources, nonceSource]
|
|
58
|
-
});
|
|
59
|
-
return parsed.map((directive) => [directive.originalName, ...directive.sources].join(" ")).join("; ");
|
|
60
|
-
}
|
|
61
|
-
parsed.push({
|
|
62
|
-
name: "style-src",
|
|
63
|
-
originalName: "style-src",
|
|
64
|
-
sources: [nonceSource]
|
|
65
|
-
});
|
|
66
|
-
return parsed.map((directive) => [directive.originalName, ...directive.sources].join(" ")).join("; ");
|
|
67
|
-
}
|
|
68
|
-
function adjustDevCssCsp(headers, nonce) {
|
|
69
|
-
if (!nonce) return headers;
|
|
70
|
-
const csp = headers.get("content-security-policy");
|
|
71
|
-
if (csp) headers.set("content-security-policy", adjustCspValue(csp, nonce));
|
|
72
|
-
const cspReportOnly = headers.get("content-security-policy-report-only");
|
|
73
|
-
if (cspReportOnly) headers.set("content-security-policy-report-only", adjustCspValue(cspReportOnly, nonce));
|
|
74
|
-
return headers;
|
|
75
|
-
}
|
|
76
|
-
function prepareAssetTags(assetTags) {
|
|
77
|
-
if (!assetTags.devCss || assetTags.devCss.length === 0) return assetTags;
|
|
78
|
-
const nonce = crypto.randomUUID().replaceAll("-", "");
|
|
79
|
-
return {
|
|
80
|
-
...assetTags,
|
|
81
|
-
css: [assetTags.css, serializeDevCssAssets(assetTags.devCss, nonce)].filter(Boolean).join("\n"),
|
|
82
|
-
devCssNonce: nonce
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function attachRenderErrorAssetTags(error, assetTags) {
|
|
86
|
-
if ((typeof error === "object" || typeof error === "function") && error !== null) Object.defineProperty(error, RENDER_ERROR_ASSET_TAGS_KEY, {
|
|
87
|
-
configurable: true,
|
|
88
|
-
value: assetTags
|
|
89
|
-
});
|
|
90
|
-
throw error;
|
|
91
|
-
}
|
|
92
|
-
async function renderWithAssetTags(renderFn, pageObj, assetTags) {
|
|
93
|
-
try {
|
|
94
|
-
return await renderFn(pageObj, assetTags);
|
|
95
|
-
} catch (error) {
|
|
96
|
-
attachRenderErrorAssetTags(error, assetTags);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
function renderClientOnlyPage(pageObj, assetTags, renderFn) {
|
|
100
|
-
const pageData = serializePageData(pageObj);
|
|
101
|
-
const headHtml = pageObj.head ? renderHeadToString(pageObj.head) : "";
|
|
102
|
-
const htmlAttrs = pageObj.head ? renderHtmlAttrs(pageObj.head) : "";
|
|
103
|
-
const bodyAttrs = pageObj.head ? renderBodyAttrs(pageObj.head) : "";
|
|
104
|
-
return `<!doctype html>
|
|
105
|
-
<html${htmlAttrs}>
|
|
106
|
-
<head>${headHtml}${typeof renderFn.preambleScript === "string" ? renderFn.preambleScript : ""}${assetTags.css}${assetTags.preloads}</head>
|
|
107
|
-
<body${bodyAttrs}>
|
|
108
|
-
<script id="__VOID_PAGE_DATA__" type="application/json">${pageData}<\/script>
|
|
109
|
-
<div id="app" data-void-ssr="false"></div>
|
|
110
|
-
${assetTags.body}
|
|
111
|
-
</body>
|
|
112
|
-
</html>`;
|
|
113
|
-
}
|
|
114
|
-
function pageJsonResponse(c, pageObj) {
|
|
115
|
-
return Response.json(pageObj, { headers: pageResponseHeaders(c, {
|
|
116
|
-
"X-VoidPages": "true",
|
|
117
|
-
Vary: "X-VoidPages",
|
|
118
|
-
...POWERED_BY
|
|
119
|
-
}) });
|
|
120
|
-
}
|
|
121
|
-
function requestPathWithSearch(c) {
|
|
122
|
-
return c.req.path + new URL(c.req.url).search;
|
|
123
|
-
}
|
|
124
|
-
function requestParams(c) {
|
|
125
|
-
return c.req.param();
|
|
126
|
-
}
|
|
127
|
-
/** Extract props from a handler result, handling Response wrapping from withValidator */
|
|
128
|
-
async function extractProps(result) {
|
|
129
|
-
if (result instanceof Response) {
|
|
130
|
-
if ((result.headers.get("content-type") || "").includes("application/json")) return await result.json();
|
|
131
|
-
return {};
|
|
132
|
-
}
|
|
133
|
-
return result ?? {};
|
|
134
|
-
}
|
|
135
|
-
/** Flatten withValidator's { issues: [{ slot, issues: [{ message, path }] }] } into { field: message } */
|
|
136
|
-
function flattenValidationErrors(body) {
|
|
137
|
-
const errors = {};
|
|
138
|
-
const issues = body?.issues;
|
|
139
|
-
if (issues) for (const slotIssue of issues) for (const issue of slotIssue.issues ?? []) {
|
|
140
|
-
const key = typeof issue.path === "string" ? issue.path : slotIssue.slot;
|
|
141
|
-
if (typeof key === "string") errors[key] = issue.message ?? "Invalid value";
|
|
142
|
-
}
|
|
143
|
-
return errors;
|
|
144
|
-
}
|
|
145
|
-
/** Strip deferred sentinels from props, setting their keys to null. Used by mutations. */
|
|
146
|
-
function stripDeferred(props) {
|
|
147
|
-
const result = {};
|
|
148
|
-
for (const [key, value] of Object.entries(props)) if (value && typeof value === "object" && DEFERRED in value) result[key] = null;
|
|
149
|
-
else result[key] = value;
|
|
150
|
-
return result;
|
|
151
|
-
}
|
|
152
|
-
async function writeRenderResult(writer, encoder, result) {
|
|
153
|
-
if (typeof result === "string") {
|
|
154
|
-
await writer.write(encoder.encode(result));
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
const reader = result.getReader();
|
|
158
|
-
while (true) {
|
|
159
|
-
const { done, value } = await reader.read();
|
|
160
|
-
if (done) return;
|
|
161
|
-
await writer.write(value);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
function renderedResponse(c, result, contentType, assetTags) {
|
|
165
|
-
return new Response(result, { headers: adjustDevCssCsp(pageResponseHeaders(c, {
|
|
166
|
-
"content-type": contentType,
|
|
167
|
-
...POWERED_BY
|
|
168
|
-
}), assetTags?.devCssNonce) });
|
|
169
|
-
}
|
|
170
|
-
/** Build a streaming response that sends an initial chunk then streams deferred results. */
|
|
171
|
-
function streamDeferredResponse(initialChunk, deferredMap, c, contentType, formatResolved, formatRejected, assetTags) {
|
|
172
|
-
const encoder = new TextEncoder();
|
|
173
|
-
const { readable, writable } = new TransformStream();
|
|
174
|
-
const writer = writable.getWriter();
|
|
175
|
-
const pendingChunks = Object.entries(deferredMap).map(([group, { resolver }]) => resolver(c).then((data) => formatResolved(group, data)).catch((err) => formatRejected(group, err instanceof Error ? err.message : String(err))));
|
|
176
|
-
(async () => {
|
|
177
|
-
await writeRenderResult(writer, encoder, initialChunk);
|
|
178
|
-
await Promise.all(pendingChunks.map(async (chunk) => writer.write(encoder.encode(await chunk))));
|
|
179
|
-
await writer.close();
|
|
180
|
-
})().catch((error) => {
|
|
181
|
-
writer.abort(error).catch(() => {});
|
|
182
|
-
});
|
|
183
|
-
return new Response(readable, { headers: adjustDevCssCsp(pageResponseHeaders(c, {
|
|
184
|
-
"content-type": contentType,
|
|
185
|
-
...POWERED_BY
|
|
186
|
-
}), assetTags?.devCssNonce) });
|
|
187
|
-
}
|
|
188
|
-
/** Handle GET page request — run handler, return page object or SSR HTML */
|
|
189
|
-
async function handlePageGet(handler, headFn, c, componentId, renderFn, getAssetTags, configHead, options) {
|
|
190
|
-
const renderMode = options?.renderMode ?? "server";
|
|
191
|
-
const shared = c.get("shared") ?? {};
|
|
192
|
-
let props = {};
|
|
193
|
-
if (handler) {
|
|
194
|
-
const result = await handler(c);
|
|
195
|
-
if (result instanceof Response && !isConvertedResponse(result)) {
|
|
196
|
-
const contentType = result.headers.get("content-type") || "";
|
|
197
|
-
if (result.status >= 300 || !contentType.includes("application/json")) return result;
|
|
198
|
-
}
|
|
199
|
-
props = await extractProps(result);
|
|
200
|
-
}
|
|
201
|
-
const pageHead = headFn ? headFn(c, props) : void 0;
|
|
202
|
-
const middlewareHead = c.get("headDefaults");
|
|
203
|
-
const head = resolveHead(configHead, middlewareHead, pageHead);
|
|
204
|
-
const { immediateProps, deferredMap } = separateDeferred(props);
|
|
205
|
-
const hasDeferred = Object.keys(deferredMap).length > 0;
|
|
206
|
-
const deferredKeys = {};
|
|
207
|
-
if (hasDeferred) for (const [group, { keys }] of Object.entries(deferredMap)) for (const key of keys) deferredKeys[key] = group;
|
|
208
|
-
const pageObj = {
|
|
209
|
-
component: componentId,
|
|
210
|
-
props: immediateProps,
|
|
211
|
-
params: requestParams(c),
|
|
212
|
-
shared,
|
|
213
|
-
url: requestPathWithSearch(c),
|
|
214
|
-
errors: null,
|
|
215
|
-
...head && { head },
|
|
216
|
-
...hasDeferred && {
|
|
217
|
-
deferred: Object.keys(deferredMap),
|
|
218
|
-
deferredKeys
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
if (renderMode !== "island" && isPagesRequest(c)) {
|
|
222
|
-
if (c.req.header("purpose") === "prefetch" && hasDeferred) {
|
|
223
|
-
const resolvedProps = { ...immediateProps };
|
|
224
|
-
await Promise.all(Object.entries(deferredMap).map(async ([, { resolver, keys }]) => {
|
|
225
|
-
try {
|
|
226
|
-
const data = await resolver(c);
|
|
227
|
-
if (keys.length === 1) resolvedProps[keys[0]] = data;
|
|
228
|
-
else {
|
|
229
|
-
const obj = data;
|
|
230
|
-
for (const key of keys) resolvedProps[key] = obj[key];
|
|
231
|
-
}
|
|
232
|
-
} catch {
|
|
233
|
-
for (const key of keys) resolvedProps[key] = null;
|
|
234
|
-
}
|
|
235
|
-
}));
|
|
236
|
-
return pageJsonResponse(c, {
|
|
237
|
-
...pageObj,
|
|
238
|
-
props: resolvedProps,
|
|
239
|
-
deferred: void 0
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
if (!hasDeferred) return pageJsonResponse(c, pageObj);
|
|
243
|
-
c.header("X-VoidPages", "true");
|
|
244
|
-
c.header("Vary", "X-VoidPages");
|
|
245
|
-
return streamDeferredResponse(JSON.stringify(pageObj) + "\n", deferredMap, c, "application/x-ndjson", (group, data) => JSON.stringify({
|
|
246
|
-
__deferred: group,
|
|
247
|
-
data
|
|
248
|
-
}) + "\n", (group, error) => JSON.stringify({
|
|
249
|
-
__deferred: group,
|
|
250
|
-
error
|
|
251
|
-
}) + "\n");
|
|
252
|
-
}
|
|
253
|
-
const assetTags = prepareAssetTags(await getAssetTags(c.req.raw, c.env, componentId));
|
|
254
|
-
const html = renderMode === "client" ? renderClientOnlyPage(pageObj, assetTags, renderFn) : await renderWithAssetTags(renderFn, pageObj, assetTags);
|
|
255
|
-
if (!hasDeferred) return renderedResponse(c, html, "text/html; charset=utf-8", assetTags);
|
|
256
|
-
return streamDeferredResponse(html, deferredMap, c, "text/html; charset=utf-8", (group, data) => `\n<script>window.__resolveDeferred?window.__resolveDeferred(${safeJsonStringify(group)},${safeJsonStringify(data)}):(window.__deferredQueue??=[]).push([${safeJsonStringify(group)},${safeJsonStringify(data)}])<\/script>`, (group, error) => `\n<script>window.__rejectDeferred?window.__rejectDeferred(${safeJsonStringify(group)},${safeJsonStringify(error)}):(window.__deferredQueue??=[]).push([${safeJsonStringify(group)},0,${safeJsonStringify(error)}])<\/script>`, assetTags);
|
|
257
|
-
}
|
|
258
|
-
/** Handle POST/PUT/DELETE page request — run mutation, then re-run GET or redirect */
|
|
259
|
-
async function handlePageMutation(mutationHandler, getHandler, headFn, c, componentId, renderFn, getAssetTags, configHead, options) {
|
|
260
|
-
const renderMode = options?.renderMode ?? "server";
|
|
261
|
-
const shared = c.get("shared") ?? {};
|
|
262
|
-
const middlewareHead = c.get("headDefaults");
|
|
263
|
-
function buildMutationPageObj(props, errors) {
|
|
264
|
-
const pageHead = headFn ? headFn(c, props) : void 0;
|
|
265
|
-
const head = resolveHead(configHead, middlewareHead, pageHead);
|
|
266
|
-
return {
|
|
267
|
-
component: componentId,
|
|
268
|
-
props,
|
|
269
|
-
params: requestParams(c),
|
|
270
|
-
shared,
|
|
271
|
-
url: requestPathWithSearch(c),
|
|
272
|
-
errors,
|
|
273
|
-
...head && { head }
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
let result;
|
|
277
|
-
try {
|
|
278
|
-
result = mutationHandler ? await mutationHandler(c) : void 0;
|
|
279
|
-
} catch (e) {
|
|
280
|
-
if (e instanceof ValidationError) {
|
|
281
|
-
if (renderMode === "island") return Response.json({ errors: e.errors }, { status: 422 });
|
|
282
|
-
const pageObj = buildMutationPageObj(stripDeferred(getHandler ? await extractProps(await getHandler(c)) : {}), e.errors);
|
|
283
|
-
if (isPagesRequest(c)) return pageJsonResponse(c, pageObj);
|
|
284
|
-
const assetTags = prepareAssetTags(await getAssetTags(c.req.raw, c.env, componentId));
|
|
285
|
-
return renderedResponse(c, renderMode === "client" ? renderClientOnlyPage(pageObj, assetTags, renderFn) : await renderWithAssetTags(renderFn, pageObj, assetTags), "text/html; charset=utf-8", assetTags);
|
|
286
|
-
}
|
|
287
|
-
throw e;
|
|
288
|
-
}
|
|
289
|
-
if (result instanceof Response) {
|
|
290
|
-
const status = result.status;
|
|
291
|
-
if (status >= 300 && status < 400) return result;
|
|
292
|
-
if (status === 400) {
|
|
293
|
-
const errors = flattenValidationErrors(await result.json());
|
|
294
|
-
if (renderMode === "island") return Response.json({ errors }, { status: 422 });
|
|
295
|
-
const pageObj = buildMutationPageObj(stripDeferred(getHandler ? await extractProps(await getHandler(c)) : {}), errors);
|
|
296
|
-
if (isPagesRequest(c)) return pageJsonResponse(c, pageObj);
|
|
297
|
-
const assetTags = prepareAssetTags(await getAssetTags(c.req.raw, c.env, componentId));
|
|
298
|
-
return renderedResponse(c, renderMode === "client" ? renderClientOnlyPage(pageObj, assetTags, renderFn) : await renderWithAssetTags(renderFn, pageObj, assetTags), "text/html; charset=utf-8", assetTags);
|
|
299
|
-
}
|
|
300
|
-
if (status !== 204) return result;
|
|
301
|
-
}
|
|
302
|
-
if (renderMode === "island") return Response.json({ success: true });
|
|
303
|
-
const pageObj = buildMutationPageObj(stripDeferred(getHandler ? await extractProps(await getHandler(c)) : {}), null);
|
|
304
|
-
if (isPagesRequest(c)) return pageJsonResponse(c, pageObj);
|
|
305
|
-
const assetTags = prepareAssetTags(await getAssetTags(c.req.raw, c.env, componentId));
|
|
306
|
-
return renderedResponse(c, renderMode === "client" ? renderClientOnlyPage(pageObj, assetTags, renderFn) : await renderWithAssetTags(renderFn, pageObj, assetTags), "text/html; charset=utf-8", assetTags);
|
|
307
|
-
}
|
|
308
|
-
//#endregion
|
|
1
|
+
import { i as ValidationError } from "../defer-YsYDUoii.mjs";
|
|
2
|
+
import { i as safeJsonStringify, n as handlePageGet, r as handlePageMutation, t as flattenValidationErrors } from "../protocol-U7bfjHmA.mjs";
|
|
309
3
|
export { ValidationError, flattenValidationErrors, handlePageGet, handlePageMutation, safeJsonStringify };
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
import { n as isIdentifier } from "./ast-CPGPjb0V.mjs";
|
|
2
|
+
import { parseSync } from "vite";
|
|
3
|
+
//#region src/shared/static-exports.ts
|
|
4
|
+
/** Read the initializer of directly exported constants without evaluating user code. */
|
|
5
|
+
function staticExportInitializers(filename, source, names) {
|
|
6
|
+
const result = /* @__PURE__ */ new Map();
|
|
7
|
+
const program = parseSync(filename, source).program;
|
|
8
|
+
for (const statement of program.body ?? []) {
|
|
9
|
+
if (statement.type !== "ExportNamedDeclaration") continue;
|
|
10
|
+
const declaration = statement.declaration;
|
|
11
|
+
if (declaration?.type !== "VariableDeclaration" || declaration.kind !== "const") continue;
|
|
12
|
+
for (const variable of declaration.declarations ?? []) if (isIdentifier(variable.id) && names.has(variable.id.name) && variable.init) result.set(variable.id.name, variable.init);
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
function unwrapStaticExpression(node) {
|
|
17
|
+
while (node && [
|
|
18
|
+
"ParenthesizedExpression",
|
|
19
|
+
"TSAsExpression",
|
|
20
|
+
"TSSatisfiesExpression",
|
|
21
|
+
"TSTypeAssertion"
|
|
22
|
+
].includes(node.type)) node = node.expression;
|
|
23
|
+
return node;
|
|
24
|
+
}
|
|
25
|
+
function staticLiteral(node) {
|
|
26
|
+
node = unwrapStaticExpression(node);
|
|
27
|
+
if (node?.type === "Literal") return node.value;
|
|
28
|
+
if (node?.type === "TemplateLiteral") {
|
|
29
|
+
const expressions = node.expressions;
|
|
30
|
+
const quasis = node.quasis;
|
|
31
|
+
if (expressions?.length === 0 && quasis?.length === 1) return quasis[0]?.value?.cooked;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
1
35
|
//#region src/router/parse-filename.ts
|
|
2
36
|
const EXTENSIONS = [
|
|
3
37
|
".ts",
|
|
@@ -74,4 +108,4 @@ function isRouteEnabledForEnvironment(route, environment) {
|
|
|
74
108
|
return environment === void 0 || route.env === null || route.env === environment;
|
|
75
109
|
}
|
|
76
110
|
//#endregion
|
|
77
|
-
export { parseRouteFilename as n, parseWebSocketFilename as r, isRouteEnabledForEnvironment as t };
|
|
111
|
+
export { staticLiteral as a, staticExportInitializers as i, parseRouteFilename as n, unwrapStaticExpression as o, parseWebSocketFilename as r, isRouteEnabledForEnvironment as t };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MIGRATION_CLASSIFIER_VERSION, canonicalJson, canonicalSql, classifySqlMigration, getMigrationPlanHashInput, tokenizeSql } from "@void/deploy-core";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
//#region src/migrations/plan.ts
|
|
4
|
+
const DESTRUCTIVE_PRAGMA = "-- void:allow-destructive";
|
|
5
|
+
function sha256Hex(value) {
|
|
6
|
+
return `sha256:${createHash("sha256").update(value).digest("hex")}`;
|
|
7
|
+
}
|
|
8
|
+
function hashPlan(plan) {
|
|
9
|
+
return sha256Hex(canonicalJson(getMigrationPlanHashInput(plan)));
|
|
10
|
+
}
|
|
11
|
+
function computeMigrationListHash(plans) {
|
|
12
|
+
return sha256Hex(canonicalJson(plans.map((plan) => [
|
|
13
|
+
plan.name,
|
|
14
|
+
plan.sqlHash,
|
|
15
|
+
plan.planHash
|
|
16
|
+
])));
|
|
17
|
+
}
|
|
18
|
+
function getExecutableSql(sql) {
|
|
19
|
+
let out = "";
|
|
20
|
+
for (const segment of tokenizeSql(sql)) if (segment.kind === "sql") out += sql.slice(segment.start, segment.end);
|
|
21
|
+
else out += " ".repeat(segment.end - segment.start);
|
|
22
|
+
return out;
|
|
23
|
+
}
|
|
24
|
+
function includesTransactionControl(sql) {
|
|
25
|
+
return getExecutableSql(sql).match(/(?:^|;)\s*(BEGIN(?:\s+(?:DEFERRED|IMMEDIATE|EXCLUSIVE|TRANSACTION))?|COMMIT|ROLLBACK|SAVEPOINT|RELEASE)\b/i)?.[1]?.toUpperCase() ?? null;
|
|
26
|
+
}
|
|
27
|
+
function classifyMigration(migration) {
|
|
28
|
+
const sql = canonicalSql(migration.sql);
|
|
29
|
+
const sqlHash = sha256Hex(sql);
|
|
30
|
+
const transactionControl = includesTransactionControl(sql);
|
|
31
|
+
if (transactionControl) throw new Error(`Migration ${migration.name} contains ${transactionControl}; Void owns the stable D1 transaction boundary.`);
|
|
32
|
+
const classification = classifySqlMigration(sql);
|
|
33
|
+
if (classification.kind === "breakpoint-framed" && classification.statements.length === 0) throw new Error(`Migration ${migration.name} has statement breakpoints but no SQL statements.`);
|
|
34
|
+
const base = {
|
|
35
|
+
...classification,
|
|
36
|
+
classifierVersion: MIGRATION_CLASSIFIER_VERSION,
|
|
37
|
+
dialect: "sqlite",
|
|
38
|
+
name: migration.name,
|
|
39
|
+
sqlHash
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
...base,
|
|
43
|
+
planHash: hashPlan(base),
|
|
44
|
+
...classification.kind === "legacy-unsplit-multi-statement" ? { warnings: [`Migration ${migration.name} contains multiple statements without Drizzle statement breakpoints; it will run through the legacy D1 path.`] } : {}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function buildMigrationPlanBundle(migrations) {
|
|
48
|
+
const plans = migrations.map((migration) => classifyMigration(migration));
|
|
49
|
+
return {
|
|
50
|
+
classifierVersion: MIGRATION_CLASSIFIER_VERSION,
|
|
51
|
+
destructiveValidation: "passed",
|
|
52
|
+
migrationListHash: computeMigrationListHash(plans),
|
|
53
|
+
plans,
|
|
54
|
+
protocolVersion: 2
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { sha256Hex as a, computeMigrationListHash as i, buildMigrationPlanBundle as n, classifyMigration as r, DESTRUCTIVE_PRAGMA as t };
|