void 0.21.2 → 0.21.4
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/dist/{account-cmd-D8OC-U7y.mjs → account-cmd-DGt9cpRe.mjs} +4 -4
- package/dist/{agents-gni4eqBu.mjs → agents-B_pX_HmQ.mjs} +1 -1
- package/dist/ast-CPGPjb0V.mjs +18 -0
- package/dist/{auth-CAw7zHqj.mjs → auth-CZuiVsFh.mjs} +1 -1
- package/dist/{auth-B9_D6ygs.mjs → auth-DLNN0D3Z.mjs} +4 -4
- package/dist/{auth-link-BYFeMJAp.mjs → auth-link-Cl9vOuf7.mjs} +4 -4
- package/dist/{auth-router-OHZNmrb_.mjs → auth-router-D4ZcMUSf.mjs} +6 -6
- package/dist/{better-auth-shared-BoVwA5Vm.d.mts → better-auth-shared-BVkjZ3vM.d.mts} +1 -0
- package/dist/{better-auth-shared-syGYYmnY.mjs → better-auth-shared-rsBGBvWJ.mjs} +3 -6
- package/dist/{build-cmd-Bft7EY51.mjs → build-cmd-Dpt0jd-x.mjs} +4 -4
- package/dist/{cache-CKV1Gz2w.mjs → cache-7_UeZdTk.mjs} +4 -4
- package/dist/{cancel-deploy-BAKmkX4f.mjs → cancel-deploy-D23R1RXT.mjs} +3 -3
- package/dist/{cf-access-rAZxzMkL.mjs → cf-access-P0iZnu0q.mjs} +1 -1
- package/dist/{cf-build-output-CTdlo6Rt.mjs → cf-build-output-CGT03qCD.mjs} +2 -2
- package/dist/cli/cf-compat.mjs +2 -2
- package/dist/cli/cli.mjs +47 -43
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/client-4cDVv7BO.mjs +2 -0
- package/dist/{client-PdAJ-F0t.mjs → client-QTl6ko_D.mjs} +28 -5
- package/dist/{cloudflare-auth-BCmTc1X_.mjs → cloudflare-auth-B9jPCkV2.mjs} +1 -1
- package/dist/{cloudflare-cmd-D6PrKn7o.mjs → cloudflare-cmd-BjNxR1XF.mjs} +3 -3
- package/dist/{cloudflare-connect-DloREDlc.mjs → cloudflare-connect-CCUozPOe.mjs} +3 -3
- package/dist/{cloudflare-operations-BHNJVDbN.mjs → cloudflare-operations-BipGMJ5O.mjs} +1 -1
- package/dist/{cloudflare-operations-CPEdHYhM.mjs → cloudflare-operations-sMZXpk_S.mjs} +4 -4
- package/dist/collect-DLyFDiKW.mjs +2 -0
- package/dist/{collect-DXHNWHcT.mjs → collect-DiTn9yr6.mjs} +1 -1
- package/dist/config-0acf1oys.mjs +2 -0
- package/dist/{config-DywxBLQC.d.mts → config-CF69HgXc.d.mts} +7 -0
- package/dist/{config-Dxr6cTXn.mjs → config-CafTW6Cz.mjs} +12 -1
- package/dist/{config-BSe70f4T.mjs → config-D8MOgiQV.mjs} +3 -3
- package/dist/config-DPByhVck.mjs +32 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config--T87TD8T.mjs → config-s7Xj7tPb.mjs} +1 -1
- package/dist/{config-write-y3CBI_ux.mjs → config-write-BSduPMY8.mjs} +3 -3
- package/dist/{connect-DLx1pRYk.mjs → connect-4Ph5Y0QE.mjs} +7 -7
- package/dist/{create-project-JV9-6ICF.mjs → create-project-BniEV0OW.mjs} +1 -1
- package/dist/{create-project-BZBl_gQ0.mjs → create-project-DBfFSZKY.mjs} +4 -4
- package/dist/{db-B98_UV4H.mjs → db-CTXIWD42.mjs} +123 -55
- package/dist/{delete-BEEyqlwd.mjs → delete-D6dZ9B6B.mjs} +4 -4
- package/dist/deploy-BVwow28d.mjs +2 -0
- package/dist/{deploy-Bsymb0_c.mjs → deploy-F1exK5F4.mjs} +567 -263
- package/dist/discover-AMCBXivQ.mjs +2 -0
- package/dist/{discover-C4O6YxVS.mjs → discover-BcPPiF1o.mjs} +2 -2
- package/dist/{dist-4WkAWhWx.mjs → dist-BVqXeR_h.mjs} +9 -1
- package/dist/dist-_UUlL6bg.mjs +2 -0
- package/dist/{domain-Av2AkLQP.mjs → domain-Dmhvb2oU.mjs} +4 -4
- package/dist/{email-C5kaZXzJ.mjs → email--tEtMoj_.mjs} +1 -1
- package/dist/{email-CUqa6TtH.mjs → email-BxHabktK.mjs} +9 -9
- package/dist/{entry-DdRFGK0y.mjs → entry-CF5wvH4w.mjs} +4 -21
- package/dist/{env-D4RIGEzz.mjs → env-Csi-tMbT.mjs} +7 -7
- package/dist/{env-Yz4HcvHs.mjs → env-D5liuQYR.mjs} +5 -2
- package/dist/{env-DX_v-Q-v.mjs → env-_v349JBd.mjs} +1 -1
- package/dist/{env-types-CWDtqHgw.mjs → env-types-C2_bIk_b.mjs} +2 -2
- package/dist/{env-validation-BsFEXps5.mjs → env-validation-BB4GkLxn.mjs} +4 -4
- package/dist/{env-validation-DIDGM7h4.mjs → env-validation-BXge7uyK.mjs} +1 -1
- package/dist/{gen-pg-Ojg8Y.mjs → gen-Dz3X1Qab.mjs} +8 -8
- package/dist/gen-Vnv2f65C.mjs +2 -0
- package/dist/{generate-C0VY6RVf.mjs → generate-GDbL7sUr.mjs} +2 -2
- package/dist/{github-cmd-BEK4VprE.mjs → github-cmd-BED3_9JD.mjs} +4 -4
- package/dist/{headers-B_HBMgi0.mjs → headers-BOg_velo.mjs} +2 -2
- package/dist/{help-iQOt7WHk.mjs → help-DC7gdz7L.mjs} +7 -3
- package/dist/help-DQMfeKMz.mjs +2 -0
- package/dist/index.mjs +132 -158
- package/dist/{init-D5niUPAz.mjs → init-CRGDXzVC.mjs} +105 -289
- package/dist/{link-3lGrfXzd.mjs → link-CsHOinF7.mjs} +5 -5
- package/dist/{list-CVjGr_C6.mjs → list-CDb-4bZ1.mjs} +5 -5
- package/dist/{local-d1-DzykTWY8.mjs → local-d1-CC8sKFGu.mjs} +3 -3
- package/dist/{login-BgQJzxAl.mjs → login-BQyISZuW.mjs} +3 -3
- package/dist/login-r2gL8l7B.mjs +2 -0
- package/dist/{logs-DbzD-QDf.mjs → logs-BdfiOezj.mjs} +4 -4
- package/dist/{migrate-BV8qHiCb.mjs → migrate-B8KuoYsO.mjs} +69 -44
- package/dist/migrate-TsHGBnDA.mjs +2 -0
- package/dist/{node-Cupyf7-s.mjs → node-BM43oz4G.mjs} +5 -5
- package/dist/{operator-auth-BkVgJqv-.mjs → operator-auth-8KnOVXVd.mjs} +2 -2
- package/dist/{operator-client-A0iex2yi.mjs → operator-client-DUwumHpQ.mjs} +2 -2
- package/dist/{operator-cmd-CR6Lxzt0.mjs → operator-cmd-Co-PeaeD.mjs} +6 -6
- package/dist/{package-json-iCbMg5XF.mjs → package-json-DXfiT1jV.mjs} +1 -1
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +11 -6
- package/dist/pages/islands-plugin.d.mts +271 -1
- package/dist/pages/islands-plugin.mjs +95 -18
- package/dist/parse-filename-DioPHiR9.mjs +77 -0
- package/dist/{platform-auth-config-De7BqRJm.mjs → platform-auth-config-TSw8edHw.mjs} +5 -5
- package/dist/{platform-auth-protection-Dcat-6zu.mjs → platform-auth-protection-Ba1XqGhn.mjs} +6 -6
- package/dist/{platform-auth-recovery-C9gsM640.mjs → platform-auth-recovery-BkT3EsF2.mjs} +5 -5
- package/dist/{platform-cmd-Cl9Uhzru.mjs → platform-cmd-C8OqhqPt.mjs} +1 -1
- package/dist/{platform-cmd-CudokNIg.mjs → platform-cmd-CRSKfu8k.mjs} +5 -5
- package/dist/{platform-domain-Ckpd2kXw.mjs → platform-domain-j9YCXRm6.mjs} +3 -3
- package/dist/{platform-lifecycle-DVzM2T4j.mjs → platform-lifecycle-78H0XQUA.mjs} +277 -229
- package/dist/{platform-lifecycle-DlpiGcjr.mjs → platform-lifecycle-DDc9zCeJ.mjs} +1 -1
- package/dist/{platform-management-ibuS1as0.mjs → platform-management-6w8-DUjC.mjs} +2 -2
- package/dist/{platform-management-44Bxd3YC.mjs → platform-management-DzKNsMlt.mjs} +1 -1
- package/dist/{platform-recovery-D_KmvdSk.mjs → platform-recovery-Do8VOyDE.mjs} +3 -3
- package/dist/{platform-registry-BJbgZLS1.mjs → platform-registry-QBa4DK32.mjs} +1 -1
- package/dist/{plugin-inference-DsvtJLll.mjs → plugin-inference-BMfKRSqE.mjs} +188 -85
- package/dist/prepare-BZXkjdNe.mjs +2 -0
- package/dist/{prepare-pcWcxSCh.mjs → prepare-C3kt3Rst.mjs} +11 -11
- package/dist/{prepare-_T-Haxrr.mjs → prepare-DyZ-Yok5.mjs} +1 -1
- package/dist/{prerender-render-Cf_WDE9W.mjs → prerender-render-D9qbLs2f.mjs} +1 -1
- package/dist/prerender-render.mjs +1 -1
- package/dist/{preset-Dowh9tTt.mjs → preset-UHj9ARyP.mjs} +4 -4
- package/dist/{project-BEBFDFLz.mjs → project-BuUwfj6f.mjs} +1 -1
- package/dist/{project-CWNIPoXc.mjs → project-C0Fqu05O.mjs} +2 -2
- package/dist/{project-cmd-BuF9doku.mjs → project-cmd-B44I8J_W.mjs} +15 -15
- package/dist/{project-paths-CKQ-Q5JS.mjs → project-paths-GgcMozYz.mjs} +1 -1
- package/dist/{project-team-B1Tia8vd.mjs → project-team-BkbYIsXN.mjs} +4 -4
- package/dist/{project-token-Bwxjf4y6.mjs → project-token-C8xEEQnB.mjs} +4 -4
- package/dist/{project-tsconfig-CwfqUnVp.mjs → project-tsconfig-B8GeM0RM.mjs} +2 -2
- package/dist/{provision-Cck2m3jJ.mjs → provision-BhreDAOS.mjs} +141 -78
- package/dist/provision-DNtrtaVD.mjs +3 -0
- package/dist/{requests-CphRF98D.mjs → requests-DFyhBMaf.mjs} +3 -3
- package/dist/{resolve-project-Xvis70DG.mjs → resolve-project-BG5ORGID.mjs} +1 -1
- package/dist/resolve-project-DtbidV4y.mjs +2 -0
- package/dist/{rollback-BYHJV2yD.mjs → rollback-DHHxXZiS.mjs} +4 -4
- package/dist/{route-types-Id82-veQ.mjs → route-types-Clm4WD0B.mjs} +39 -16
- package/dist/{runner-CQs_cDSG.mjs → runner-B8wXwWlo.mjs} +1 -1
- package/dist/{runner-mysql-1o47achK.mjs → runner-mysql-CEG5JozK.mjs} +1 -1
- package/dist/{runner-mysql-BhwMk2Bm.mjs → runner-mysql-DmWchSWJ.mjs} +1 -1
- package/dist/{runner-BGVsGgkb.mjs → runner-p-dMs2UN.mjs} +3 -3
- package/dist/{runner-pg-D7z01mQS.mjs → runner-pg-Bh4AgZdj.mjs} +1 -1
- package/dist/{runner-pg-CJ_JeGF6.mjs → runner-pg-D4OPlil-.mjs} +1 -1
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/db.mjs +8 -5
- package/dist/runtime/durable.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/env-public.mjs +1 -1
- package/dist/runtime/env.d.mts +1 -1
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/live-server.mjs +38 -23
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws-server.mjs +1 -1
- package/dist/{scan-DJbooZm2.mjs → scan-4tfN-PSn.mjs} +113 -99
- package/dist/{scan-DdDvRCU1.mjs → scan-ClYmX3sa.mjs} +35 -137
- package/dist/{secret-Rt9c4Ttw.mjs → secret-DN9sSNiV.mjs} +6 -6
- package/dist/{skills-B-690E7h.mjs → skills-O6FUaizK.mjs} +2 -2
- package/dist/sveltekit.mjs +1 -1
- package/dist/{validate-qNhV00PD.mjs → validate-CIUwFpjB.mjs} +2 -2
- package/dist/validate-EKmJWxmy.mjs +2 -0
- package/dist/{wrangler-D01qs6VB.mjs → wrangler-BymcxrRa.mjs} +3 -3
- package/dist/{yarn-pnp-CVEc3gE7.mjs → yarn-pnp-BV4AzNul.mjs} +1 -1
- package/package.json +7 -7
- package/schema.json +18 -0
- package/skills/void/docs/guide/app-types.md +1 -1
- package/skills/void/docs/guide/auth.md +2 -2
- package/skills/void/docs/guide/database/d1.md +6 -0
- package/skills/void/docs/guide/durable-state.md +1 -1
- package/skills/void/docs/guide/edge/rewrites.md +2 -3
- package/skills/void/docs/guide/env-migration.md +1 -1
- package/skills/void/docs/guide/pages-routing/markdown.md +1 -1
- package/skills/void/docs/guide/platform/development/local.md +1 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +2 -2
- package/skills/void/docs/guide/platform/installation/setup.md +1 -1
- package/skills/void/docs/guide/server-routing.md +2 -3
- package/skills/void/docs/guide/ssr.md +4 -10
- package/skills/void/docs/guide/websockets.md +1 -1
- package/skills/void/docs/integrations/cloudflare.md +3 -0
- package/skills/void/docs/reference/api.md +1 -1
- package/skills/void/docs/reference/cli.md +10 -3
- package/skills/void/docs/reference/config.md +11 -0
- package/skills/void/docs/reference/resource-inference.md +1 -1
- package/dist/client-DAAivdid.mjs +0 -2
- package/dist/collect-DAUItMDS.mjs +0 -2
- package/dist/config-DDIFxQYx.mjs +0 -2
- package/dist/config-uP7ZDtVZ.mjs +0 -21
- package/dist/deploy-CsjbRNyv.mjs +0 -2
- package/dist/discover-BBzDZe_o.mjs +0 -2
- package/dist/dist-D7-nEOXi.mjs +0 -2
- package/dist/gen-B87rlalt.mjs +0 -2
- package/dist/help-r_vrpH_d.mjs +0 -2
- package/dist/login-Bz0zEPoy.mjs +0 -2
- package/dist/migrate-BXY3B3m7.mjs +0 -2
- package/dist/prepare-D4CkM3_v.mjs +0 -2
- package/dist/provision-CNgEBkVA.mjs +0 -3
- package/dist/resolve-project-BTotl8Nn.mjs +0 -2
- package/dist/validate-DqJ33oHj.mjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
|
|
2
|
-
import { a as join, l as relative, n as dirname, u as resolve } from "./dist-
|
|
2
|
+
import { a as join, l as relative, n as dirname, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
3
3
|
import { d as require_picocolors } from "./output-CCH48AMM.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-
|
|
6
|
-
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-
|
|
4
|
+
import { G as resolveWorkerDirName, St as hasDocumentRoutes, V as resolveDistDir, ct as prerenderPagesNode, dt as collectRevalidate, ft as hasRevalidate, mt as SEND_EMAIL_BINDING, ot as generateQueueResolverSource, pt as scanDurableObjectModules, st as prerenderPages, ut as collectPages, wt as resolveAssetRoutingPolicy, xt as hasApiRoutes } from "./deploy-F1exK5F4.mjs";
|
|
5
|
+
import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-GgcMozYz.mjs";
|
|
6
|
+
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-DPByhVck.mjs";
|
|
7
7
|
import { r as scopedAccessCredentials } from "./cf-access-DRsQRe6k.mjs";
|
|
8
|
-
import { a as getApiUrl, c as getToken, o as getProxyUrl, u as isStagingMode } from "./auth-
|
|
9
|
-
import { r as ensurePlatformProxyAccess } from "./cf-access-
|
|
10
|
-
import { i as readDeploymentPlatform, o as readProjectConfig } from "./project-
|
|
11
|
-
import { d as isNodeTarget, h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-
|
|
12
|
-
import { C as readWranglerWebSocketTombstones, D as syncWranglerWebSockets, E as syncWranglerDurableObjects, L as materializeCloudflareConfig, M as isSandboxEnabled, P as resolveSandboxConfig, T as syncWranglerBindings, V as stashCloudflareDeployPointer, a as LIVE_MIGRATION_TAG, d as ensureWranglerNodejsAlsFlag, g as readExistingLiveBindingConfig, h as normalizeWranglerCompatibilityFlags, j as SANDBOX_MIGRATION_TAG, l as ensureWranglerCompat, m as nextDurableObjectMigrationTag, p as hasDurableObjectSqliteMigration, u as ensureWranglerCompatibilityDate, w as resolveLiveBindingConfig, y as readWranglerCompat, z as restoreCloudflarePreviewPointer } from "./wrangler-
|
|
8
|
+
import { a as getApiUrl, c as getToken, o as getProxyUrl, u as isStagingMode } from "./auth-DLNN0D3Z.mjs";
|
|
9
|
+
import { r as ensurePlatformProxyAccess } from "./cf-access-P0iZnu0q.mjs";
|
|
10
|
+
import { i as readDeploymentPlatform, o as readProjectConfig } from "./project-C0Fqu05O.mjs";
|
|
11
|
+
import { d as isNodeTarget, h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-CafTW6Cz.mjs";
|
|
12
|
+
import { C as readWranglerWebSocketTombstones, D as syncWranglerWebSockets, E as syncWranglerDurableObjects, L as materializeCloudflareConfig, M as isSandboxEnabled, P as resolveSandboxConfig, T as syncWranglerBindings, V as stashCloudflareDeployPointer, a as LIVE_MIGRATION_TAG, d as ensureWranglerNodejsAlsFlag, g as readExistingLiveBindingConfig, h as normalizeWranglerCompatibilityFlags, j as SANDBOX_MIGRATION_TAG, l as ensureWranglerCompat, m as nextDurableObjectMigrationTag, p as hasDurableObjectSqliteMigration, u as ensureWranglerCompatibilityDate, w as resolveLiveBindingConfig, y as readWranglerCompat, z as restoreCloudflarePreviewPointer } from "./wrangler-BymcxrRa.mjs";
|
|
13
13
|
import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-ChfPKsVd.mjs";
|
|
14
|
-
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-
|
|
15
|
-
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { a as
|
|
19
|
-
import { n as
|
|
14
|
+
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-BOg_velo.mjs";
|
|
15
|
+
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-B8GeM0RM.mjs";
|
|
16
|
+
import { i as isMemberExpression, n as isIdentifier, r as isLiteral } from "./ast-CPGPjb0V.mjs";
|
|
17
|
+
import { i as resolveLayoutIds } from "./scan-4tfN-PSn.mjs";
|
|
18
|
+
import { a as scanJobsSync, i as scanQueuesSync, n as scanRoutePatternsSync, r as scanRoutes, t as scanMiddlewareSync } from "./scan-ClYmX3sa.mjs";
|
|
19
|
+
import { c as inferBindingsFromSource, i as inferProjectBindings, l as walk, n as FRAMEWORK_SCAN_DIRS, r as detectFramework, s as scanWebSocketRoutesSync, t as DEFAULT_SCAN_DIRS } from "./plugin-inference-BMfKRSqE.mjs";
|
|
20
|
+
import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-CC8sKFGu.mjs";
|
|
20
21
|
import { n as parseDotenvFile } from "./dotenv-VQxupEUv.mjs";
|
|
21
|
-
import { i as generateDbDts, n as generateQueueTypes, r as DRIZZLE_OPERATORS, t as generateRouteTypes } from "./route-types-
|
|
22
|
-
import { t as discoverSchema } from "./discover-
|
|
22
|
+
import { i as generateDbDts, n as generateQueueTypes, r as DRIZZLE_OPERATORS, t as generateRouteTypes } from "./route-types-Clm4WD0B.mjs";
|
|
23
|
+
import { t as discoverSchema } from "./discover-BcPPiF1o.mjs";
|
|
23
24
|
import { _ as parseCapturedMessage, a as DEV_INBOX_ENV_VAR, c as DEV_INBOX_TOKEN_ENV_VAR, f as clearDevBuffer, g as listDevMessages, l as DEV_INBOX_TOKEN_HEADER, m as findDevMessage, n as DEV_INBOX_ACK_VALUE, o as DEV_INBOX_MAX_CAPTURE_BYTES, s as DEV_INBOX_PREFIX, t as DEV_INBOX_ACK_HEADER, u as DEV_INBOX_TOKEN_QUERY, v as pushToDevBuffer, y as registerEmailSink } from "./dev-inbox-P0u4tM8Y.mjs";
|
|
24
25
|
import { t as MagicString } from "./dist-BR1quN_w.mjs";
|
|
25
|
-
import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-
|
|
26
|
-
import { y as loadUserEnvFile } from "./env-validation-
|
|
27
|
-
import { a as loadLocalEnv, o as resolveRemoteMode, r as findLegacyEnvFiles, s as stripInternalEnvKeys, t as CLIENT_ENV_PREFIX$2 } from "./env-
|
|
28
|
-
import {
|
|
29
|
-
import { a as
|
|
26
|
+
import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-C2_bIk_b.mjs";
|
|
27
|
+
import { y as loadUserEnvFile } from "./env-validation-BB4GkLxn.mjs";
|
|
28
|
+
import { a as loadLocalEnv, o as resolveRemoteMode, r as findLegacyEnvFiles, s as stripInternalEnvKeys, t as CLIENT_ENV_PREFIX$2 } from "./env-_v349JBd.mjs";
|
|
29
|
+
import { t as isRouteEnabledForEnvironment } from "./parse-filename-DioPHiR9.mjs";
|
|
30
|
+
import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-CF5wvH4w.mjs";
|
|
31
|
+
import { a as scanEmailHandlersSync, r as hasEmailHandlers } from "./email--tEtMoj_.mjs";
|
|
30
32
|
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-Beb2Am5S.mjs";
|
|
31
33
|
import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./env-raw-Cx8ElDdj.mjs";
|
|
32
34
|
import { n as defer } from "./defer-YsYDUoii.mjs";
|
|
@@ -35,9 +37,9 @@ import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, re
|
|
|
35
37
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
36
38
|
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
37
39
|
import { appendSqliteClassMigration } from "@void/deploy-core";
|
|
40
|
+
import { normalizePath, parseSync } from "vite";
|
|
38
41
|
import { timingSafeEqual } from "node:crypto";
|
|
39
42
|
import { homedir } from "node:os";
|
|
40
|
-
import { normalizePath, parseSync } from "vite";
|
|
41
43
|
import { init, parse } from "es-module-lexer";
|
|
42
44
|
//#region src/pages/dev-css-assets.ts
|
|
43
45
|
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
@@ -48,8 +50,6 @@ const DEV_CSS_ASSET_GUARD_VALUE = "pages-css";
|
|
|
48
50
|
const CSS_REQUEST_RE = /\.(?:css|scss|sass|less|styl|stylus|pcss|postcss)(?:$|[?#])/;
|
|
49
51
|
const STYLE_QUERY_RE = /[?&](?:vue|svelte|island-style)\b.*[?&]type=style\b|[?&]type=style\b/;
|
|
50
52
|
const CSS_BYPASS_RE = /[?&](?:raw|url|worker|sharedworker)\b/;
|
|
51
|
-
const INLINE_CSS_EXPORT_RE = /(?:export\s+default|__vite__css\s*=)\s*("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`)/;
|
|
52
|
-
const VITE_DEV_ID_RE = /const\s+__vite__id\s*=\s*("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/;
|
|
53
53
|
const SKIPPABLE_VIRTUAL_URL_RE = /^(?:\/@id\/__x00__)?virtual:void-client-(?:browser|worker)(?:$|[?#])/;
|
|
54
54
|
function splitQueryHash(value) {
|
|
55
55
|
const index = value.search(/[?#]/);
|
|
@@ -99,17 +99,25 @@ function appendInlineQuery(url) {
|
|
|
99
99
|
if (!parsed.searchParams.has("inline")) parsed.searchParams.append("inline", "");
|
|
100
100
|
return parsed.pathname + parsed.search + parsed.hash;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
function parseCssOutput(code) {
|
|
103
|
+
const program = parseSync("void-dev-css.js", code).program;
|
|
104
|
+
const result = {};
|
|
105
|
+
const readCss = (node) => {
|
|
106
|
+
if (node?.type === "Literal" && typeof node.value === "string") result.css = node.value;
|
|
107
|
+
else if (node?.type === "TemplateLiteral") result.templateCss = true;
|
|
108
|
+
};
|
|
109
|
+
for (const statement of program.body ?? []) if (statement.type === "ExportDefaultDeclaration") readCss(statement.declaration);
|
|
110
|
+
else if (statement.type === "VariableDeclaration") {
|
|
111
|
+
for (const declaration of statement.declarations ?? []) if (declaration.id?.name === "__vite__css") readCss(declaration.init);
|
|
112
|
+
else if (statement.kind === "const" && declaration.id?.name === "__vite__id" && declaration.init?.type === "Literal" && typeof declaration.init.value === "string") result.id = declaration.init.value;
|
|
113
|
+
} else if (statement.type === "ExpressionStatement" && statement.expression?.type === "AssignmentExpression" && statement.expression.left?.name === "__vite__css") readCss(statement.expression.right);
|
|
114
|
+
return result;
|
|
108
115
|
}
|
|
109
|
-
function
|
|
110
|
-
const
|
|
111
|
-
if (
|
|
112
|
-
|
|
116
|
+
function extractInlineCss(code) {
|
|
117
|
+
const result = parseCssOutput(code);
|
|
118
|
+
if (result.templateCss) throw new Error("Unexpected template literal inline CSS output.");
|
|
119
|
+
if (result.css === void 0) throw new Error("Unable to extract inline CSS from Vite transform output.");
|
|
120
|
+
return result.css;
|
|
113
121
|
}
|
|
114
122
|
function createOrderedEdgeStore(root) {
|
|
115
123
|
let version = 0;
|
|
@@ -201,11 +209,12 @@ var DevCssProvider = class {
|
|
|
201
209
|
cssUrls.push(node.url);
|
|
202
210
|
}
|
|
203
211
|
if (transformedCode) {
|
|
204
|
-
|
|
205
|
-
cssViteDevIds.set(node.url, viteDevId ?? node.id ?? node.url);
|
|
212
|
+
let output;
|
|
206
213
|
try {
|
|
207
|
-
|
|
214
|
+
output = parseCssOutput(transformedCode);
|
|
208
215
|
} catch {}
|
|
216
|
+
cssViteDevIds.set(node.url, output?.id ?? node.id ?? node.url);
|
|
217
|
+
if (output?.css !== void 0 && !output.templateCss) transformedCss.set(node.url, output.css);
|
|
209
218
|
} else cssViteDevIds.set(node.url, node.id ?? node.url);
|
|
210
219
|
return;
|
|
211
220
|
}
|
|
@@ -682,21 +691,29 @@ export function createDb(connectionString) {
|
|
|
682
691
|
`;
|
|
683
692
|
return `
|
|
684
693
|
import { drizzle } from ${JSON.stringify(drizzleD1Resolved)};
|
|
685
|
-
import { requireRuntimeBinding } from ${JSON.stringify(envModuleResolved)};
|
|
694
|
+
import { getRuntimeRequestResource, requireRuntimeBinding } from ${JSON.stringify(envModuleResolved)};
|
|
686
695
|
${schemaImport}
|
|
687
696
|
export { ${DRIZZLE_OPERATORS} } from ${JSON.stringify(drizzleOrmResolved)};
|
|
688
697
|
|
|
689
|
-
|
|
698
|
+
const _requestResourceKey = {};
|
|
690
699
|
|
|
691
700
|
export const db = new Proxy({}, {
|
|
692
701
|
get(_, prop) {
|
|
693
|
-
|
|
694
|
-
|
|
702
|
+
const instance = getRuntimeRequestResource(
|
|
703
|
+
_requestResourceKey,
|
|
704
|
+
() => createDb(requireRuntimeBinding(${JSON.stringify(d1BindingName)})),
|
|
705
|
+
() => createPrimaryDb(requireRuntimeBinding(${JSON.stringify(d1BindingName)}))
|
|
706
|
+
);
|
|
707
|
+
return Reflect.get(instance, prop);
|
|
695
708
|
},
|
|
696
709
|
});
|
|
697
710
|
|
|
698
711
|
export function createDb(d1) {
|
|
699
|
-
return drizzle(d1${drizzleConfig});
|
|
712
|
+
return drizzle(d1.withSession("first-unconstrained")${drizzleConfig});
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
function createPrimaryDb(d1) {
|
|
716
|
+
return drizzle(d1.withSession("first-primary")${drizzleConfig});
|
|
700
717
|
}
|
|
701
718
|
`;
|
|
702
719
|
}
|
|
@@ -706,7 +723,7 @@ export function createDb(d1) {
|
|
|
706
723
|
const migrationsDir = paths.migrationsDir;
|
|
707
724
|
if (!(existsSync(migrationsDir) && readdirSync(migrationsDir).some((f) => f.endsWith(".sql")))) {
|
|
708
725
|
if (dialect === "sqlite") {
|
|
709
|
-
const { getApplicationTables, getMiniflareDatabasePath } = await import("./runner-
|
|
726
|
+
const { getApplicationTables, getMiniflareDatabasePath } = await import("./runner-B8wXwWlo.mjs");
|
|
710
727
|
if ((await getApplicationTables(getMiniflareDatabasePath(options.localD1PersistRoot ?? join(root, ".void"), options.localD1DatabaseId ?? "local")).catch(() => [])).length > 0) return;
|
|
711
728
|
}
|
|
712
729
|
voidWarn(`Schema found but no migrations in ${paths.sourceRelative("db/migrations")}/.\n \`void db push\` syncs the schema to your local DB without creating migration files.
|
|
@@ -1987,10 +2004,10 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
1987
2004
|
else warn();
|
|
1988
2005
|
return;
|
|
1989
2006
|
}
|
|
1990
|
-
const { collectMigrations } = await import("./collect-
|
|
1991
|
-
const { validateMigrations } = await import("./validate-
|
|
2007
|
+
const { collectMigrations } = await import("./collect-DLyFDiKW.mjs");
|
|
2008
|
+
const { validateMigrations } = await import("./validate-EKmJWxmy.mjs");
|
|
1992
2009
|
const allMigrations = collectMigrations(migrationsDir);
|
|
1993
|
-
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-
|
|
2010
|
+
const appliedNames = dialect === "mysql" ? await import("./runner-mysql-CEG5JozK.mjs").then((runner) => runner.getMySqlAppliedMigrations(url)) : await import("./runner-pg-Bh4AgZdj.mjs").then((runner) => runner.getPgAppliedMigrations(url));
|
|
1994
2011
|
const appliedSet = new Set(appliedNames);
|
|
1995
2012
|
const pending = allMigrations.filter((migration) => !appliedSet.has(migration.name));
|
|
1996
2013
|
if (pending.length > 0) try {
|
|
@@ -1998,12 +2015,12 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
1998
2015
|
} catch (err) {
|
|
1999
2016
|
voidWarn(err instanceof Error ? err.message : String(err));
|
|
2000
2017
|
}
|
|
2001
|
-
const applied = dialect === "mysql" ? await import("./runner-mysql-
|
|
2018
|
+
const applied = dialect === "mysql" ? await import("./runner-mysql-CEG5JozK.mjs").then((runner) => runner.runMySqlMigrations(migrationsDir, url)) : await import("./runner-pg-Bh4AgZdj.mjs").then((runner) => runner.runPgMigrations(migrationsDir, url));
|
|
2002
2019
|
if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
|
|
2003
2020
|
} else if (hasSqlMigrations) {
|
|
2004
|
-
const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-
|
|
2005
|
-
const { collectMigrations } = await import("./collect-
|
|
2006
|
-
const { validateMigrations } = await import("./validate-
|
|
2021
|
+
const { runMigrations, getMiniflareDatabasePath, getAppliedMigrations } = await import("./runner-B8wXwWlo.mjs");
|
|
2022
|
+
const { collectMigrations } = await import("./collect-DLyFDiKW.mjs");
|
|
2023
|
+
const { validateMigrations } = await import("./validate-EKmJWxmy.mjs");
|
|
2007
2024
|
const dbPath = getMiniflareDatabasePath(persistRoot, databaseId);
|
|
2008
2025
|
const allMigrations = collectMigrations(migrationsDir);
|
|
2009
2026
|
const appliedRows = await getAppliedMigrations(dbPath);
|
|
@@ -2018,7 +2035,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
2018
2035
|
if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
|
|
2019
2036
|
}
|
|
2020
2037
|
if (auth?.enabled) {
|
|
2021
|
-
const { runLocalVoidAuthMigrations } = await import("./node-
|
|
2038
|
+
const { runLocalVoidAuthMigrations } = await import("./node-BM43oz4G.mjs");
|
|
2022
2039
|
await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth.configPath);
|
|
2023
2040
|
voidLog("Applied Better Auth migrations");
|
|
2024
2041
|
}
|
|
@@ -2317,6 +2334,7 @@ function restartPlugin() {
|
|
|
2317
2334
|
*/
|
|
2318
2335
|
const BINDING_HINT_SCRIPT = `<script type="module" src="/@id/virtual:void/binding-hint"><\/script>`;
|
|
2319
2336
|
const DEFAULT_ERROR_PAGE_FONT_STACK = "system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif";
|
|
2337
|
+
const EDGE_MODULE_PATH = fileURLToPath(import.meta.resolve("@void/edge"));
|
|
2320
2338
|
function pushDefaultErrorPageHelpers(lines, options) {
|
|
2321
2339
|
const dev = options.dev === true;
|
|
2322
2340
|
lines.push(`const __VOID_ERROR_PAGE_FONT_STACK = ${JSON.stringify(DEFAULT_ERROR_PAGE_FONT_STACK)};`);
|
|
@@ -2914,7 +2932,7 @@ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, s
|
|
|
2914
2932
|
}
|
|
2915
2933
|
lines.push("");
|
|
2916
2934
|
if (auth) {
|
|
2917
|
-
lines.push(`const __voidAuthOptions = { dialect: ${JSON.stringify(auth.dialect)}, providers: ${JSON.stringify(auth.providers)}, userConfig: ${auth.authConfigPath ? "__voidAuthConfig" : "undefined"} };`);
|
|
2935
|
+
lines.push(`const __voidAuthOptions = { dialect: ${JSON.stringify(auth.dialect)}, providers: ${JSON.stringify(auth.providers)}, userConfig: ${auth.authConfigPath ? "__voidAuthConfig" : "undefined"}, dev: ${JSON.stringify(options.dev === true)} };`);
|
|
2918
2936
|
if (webSockets.length > 0) lines.push(`const __resolveVoidAuthState = (request, env, runtime) => __resolveVoidAuthStateRuntime(request, env, runtime${auth.authDatabasePath ? ", __voidAuthDatabase" : ""});`);
|
|
2919
2937
|
lines.push("");
|
|
2920
2938
|
}
|
|
@@ -4389,62 +4407,10 @@ export async function fetch(path, options) {
|
|
|
4389
4407
|
return data;
|
|
4390
4408
|
}`;
|
|
4391
4409
|
}
|
|
4392
|
-
/**
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
*
|
|
4397
|
-
* Syntax:
|
|
4398
|
-
* :name — single path segment (captured as `name`)
|
|
4399
|
-
* :name* — zero or more segments (captured as `name`)
|
|
4400
|
-
* * — zero or more segments (captured as `splat`, legacy)
|
|
4401
|
-
*
|
|
4402
|
-
* When a pattern contains multiple bare `*`, only the first captures as
|
|
4403
|
-
* `splat`; later occurrences emit a non-capturing `.*` so the constructed
|
|
4404
|
-
* `RegExp` doesn't reject "duplicate group name" at request time. `:name*`
|
|
4405
|
-
* uses a distinct group name and never clashes with `*`. `__matchPattern`
|
|
4406
|
-
* additionally swallows any compile-time `RegExp` error and returns `false`
|
|
4407
|
-
* so a single malformed rule cannot 500 unrelated requests on CF dev.
|
|
4408
|
-
*/
|
|
4409
|
-
function emitCompilePattern(lines) {
|
|
4410
|
-
lines.push("function __compilePattern(source) {");
|
|
4411
|
-
lines.push(" const names = [];");
|
|
4412
|
-
lines.push(" let legacySplatCaptured = false;");
|
|
4413
|
-
lines.push(" let pattern = \"\";");
|
|
4414
|
-
lines.push(" let i = 0;");
|
|
4415
|
-
lines.push(" while (i < source.length) {");
|
|
4416
|
-
lines.push(" const ch = source[i];");
|
|
4417
|
-
lines.push(" if (ch === \":\") {");
|
|
4418
|
-
lines.push(" let j = i + 1;");
|
|
4419
|
-
lines.push(" while (j < source.length && /[A-Za-z0-9_]/.test(source[j])) j++;");
|
|
4420
|
-
lines.push(" const name = source.slice(i + 1, j);");
|
|
4421
|
-
lines.push(" if (!name) { pattern += \"\\\\:\"; i++; continue; }");
|
|
4422
|
-
lines.push(" if (source[j] === \"*\") {");
|
|
4423
|
-
lines.push(" names.push(name);");
|
|
4424
|
-
lines.push(" pattern += `(?<${name}>.*)`;");
|
|
4425
|
-
lines.push(" i = j + 1;");
|
|
4426
|
-
lines.push(" } else {");
|
|
4427
|
-
lines.push(" names.push(name);");
|
|
4428
|
-
lines.push(" pattern += `(?<${name}>[^/]+)`;");
|
|
4429
|
-
lines.push(" i = j;");
|
|
4430
|
-
lines.push(" }");
|
|
4431
|
-
lines.push(" } else if (ch === \"*\") {");
|
|
4432
|
-
lines.push(" if (legacySplatCaptured) {");
|
|
4433
|
-
lines.push(" pattern += \".*\";");
|
|
4434
|
-
lines.push(" } else {");
|
|
4435
|
-
lines.push(" names.push(\"splat\");");
|
|
4436
|
-
lines.push(" pattern += \"(?<splat>.*)\";");
|
|
4437
|
-
lines.push(" legacySplatCaptured = true;");
|
|
4438
|
-
lines.push(" }");
|
|
4439
|
-
lines.push(" i++;");
|
|
4440
|
-
lines.push(" } else {");
|
|
4441
|
-
lines.push(" if (/[.+?^${}()|[\\]\\\\]/.test(ch)) pattern += \"\\\\\";");
|
|
4442
|
-
lines.push(" pattern += ch;");
|
|
4443
|
-
lines.push(" i++;");
|
|
4444
|
-
lines.push(" }");
|
|
4445
|
-
lines.push(" }");
|
|
4446
|
-
lines.push(" return { regex: new RegExp(`^${pattern}$`), names };");
|
|
4447
|
-
lines.push("}");
|
|
4410
|
+
/** Import the shared cached routing helpers only for modules that use rules. */
|
|
4411
|
+
function ensureCompilePatternEmitted(lines) {
|
|
4412
|
+
if (lines.some((line) => line.includes("compilePattern as __compilePattern"))) return;
|
|
4413
|
+
lines.push(`import { compilePattern as __compilePattern, substituteParams as __substituteParams } from ${JSON.stringify(EDGE_MODULE_PATH)};`);
|
|
4448
4414
|
lines.push("const __matchPatternWarned = new Set();");
|
|
4449
4415
|
lines.push("function __matchPattern(pattern, pathname) {");
|
|
4450
4416
|
lines.push(" try {");
|
|
@@ -4457,40 +4423,11 @@ function emitCompilePattern(lines) {
|
|
|
4457
4423
|
lines.push(" return false;");
|
|
4458
4424
|
lines.push(" }");
|
|
4459
4425
|
lines.push("}");
|
|
4460
|
-
lines.push("function __substituteParams(destination, params) {");
|
|
4461
|
-
lines.push(" return destination.replace(/:([A-Za-z0-9_]+)\\*?/g, (whole, name) => {");
|
|
4462
|
-
lines.push(" return params[name] != null ? params[name] : whole;");
|
|
4463
|
-
lines.push(" });");
|
|
4464
|
-
lines.push("}");
|
|
4465
4426
|
lines.push("");
|
|
4466
4427
|
}
|
|
4467
|
-
function ensureCompilePatternEmitted(lines) {
|
|
4468
|
-
if (!lines.some((l) => l.includes("function __compilePattern"))) emitCompilePattern(lines);
|
|
4469
|
-
}
|
|
4470
|
-
/**
|
|
4471
|
-
* Emit the `__mergeQueryIntoLocation` helper. Shared between the static
|
|
4472
|
-
* routing-rules middleware (for `_redirects` entries) and the dynamic
|
|
4473
|
-
* `c.redirect` wrapper, so it's emitted unconditionally above the rewrite
|
|
4474
|
-
* middleware. If the destination already carries a param, the destination
|
|
4475
|
-
* wins — matching the static-redirect semantics.
|
|
4476
|
-
*/
|
|
4477
4428
|
function ensureMergeQueryHelperEmitted(lines) {
|
|
4478
|
-
if (lines.some((
|
|
4479
|
-
lines.push(
|
|
4480
|
-
lines.push(" if (!search || search === \"?\") return destination;");
|
|
4481
|
-
lines.push(" const fragIdx = destination.indexOf(\"#\");");
|
|
4482
|
-
lines.push(" const base = fragIdx === -1 ? destination : destination.slice(0, fragIdx);");
|
|
4483
|
-
lines.push(" const fragment = fragIdx === -1 ? \"\" : destination.slice(fragIdx);");
|
|
4484
|
-
lines.push(" const q = base.indexOf(\"?\");");
|
|
4485
|
-
lines.push(" if (q === -1) return base + search + fragment;");
|
|
4486
|
-
lines.push(" if (q === base.length - 1) return base.slice(0, q) + fragment;");
|
|
4487
|
-
lines.push(" const dp = new URLSearchParams(base.slice(q + 1));");
|
|
4488
|
-
lines.push(" for (const [k, v] of new URLSearchParams(search)) {");
|
|
4489
|
-
lines.push(" if (!dp.has(k)) dp.append(k, v);");
|
|
4490
|
-
lines.push(" }");
|
|
4491
|
-
lines.push(" return base.slice(0, q) + \"?\" + dp.toString() + fragment;");
|
|
4492
|
-
lines.push("}");
|
|
4493
|
-
lines.push("");
|
|
4429
|
+
if (lines.some((line) => line.includes("mergeQueryIntoLocation as __mergeQueryIntoLocation"))) return;
|
|
4430
|
+
lines.push(`import { mergeQueryIntoLocation as __mergeQueryIntoLocation } from ${JSON.stringify(EDGE_MODULE_PATH)};`);
|
|
4494
4431
|
}
|
|
4495
4432
|
/**
|
|
4496
4433
|
* Shared body for routing-rule evaluation: match rules in order (last wins),
|
|
@@ -4999,6 +4936,7 @@ function routingPlugin(root, options) {
|
|
|
4999
4936
|
},
|
|
5000
4937
|
config(_, env) {
|
|
5001
4938
|
routeEnvironment = env.command === "serve" && !env.isPreview ? "dev" : "prod";
|
|
4939
|
+
compileOptions.hasLive = options.live !== void 0;
|
|
5002
4940
|
compileOptions.managedDispatch = !options.target && env.command === "build" && Boolean(process.env.VOID_DEPLOY_PROJECT_ID);
|
|
5003
4941
|
if (env.command === "serve" && options.isAuthEnabled()) return { resolve: { alias: [
|
|
5004
4942
|
"client",
|
|
@@ -5033,7 +4971,7 @@ function routingPlugin(root, options) {
|
|
|
5033
4971
|
if (!options.target) {
|
|
5034
4972
|
const migrationsDir = paths.migrationsDir;
|
|
5035
4973
|
if (existsSync(migrationsDir) || compileOptions.auth) {
|
|
5036
|
-
const { collectMigrations } = await import("./collect-
|
|
4974
|
+
const { collectMigrations } = await import("./collect-DLyFDiKW.mjs");
|
|
5037
4975
|
const { buildMigrationPlanBundle } = await import("./plan-DpuOr14e.mjs");
|
|
5038
4976
|
const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
|
|
5039
4977
|
const dialect = getDatabaseDialect(readConfig(root));
|
|
@@ -5184,6 +5122,27 @@ function routingPlugin(root, options) {
|
|
|
5184
5122
|
};
|
|
5185
5123
|
}
|
|
5186
5124
|
//#endregion
|
|
5125
|
+
//#region src/sveltekit-hooks-transform.ts
|
|
5126
|
+
/** Add Void's dev bindings to SvelteKit's generated get_hooks function. */
|
|
5127
|
+
function injectSvelteKitHooks(code, id, dispatchPath) {
|
|
5128
|
+
if (!code.includes("get_hooks")) return;
|
|
5129
|
+
const hooks = (parseSync(id, code).program.body ?? []).filter((node) => node.type === "ExportNamedDeclaration").map((node) => node.declaration).filter((node) => {
|
|
5130
|
+
const name = node?.id;
|
|
5131
|
+
return node?.type === "FunctionDeclaration" && isIdentifier(name) && name.name === "get_hooks";
|
|
5132
|
+
});
|
|
5133
|
+
if (hooks.length !== 1) throw new Error("sveltekit: Expected one generated get_hooks function.");
|
|
5134
|
+
const body = hooks[0].body;
|
|
5135
|
+
const returns = (body?.body)?.filter((node) => node.type === "ReturnStatement" && node.argument?.type === "ObjectExpression") ?? [];
|
|
5136
|
+
if (body?.type !== "BlockStatement" || body.start === void 0 || returns.length !== 1 || returns[0]?.start === void 0) throw new Error("sveltekit: Expected one object return in generated get_hooks.");
|
|
5137
|
+
const ms = new MagicString(code);
|
|
5138
|
+
ms.appendLeft(body.start + 1, `\n const { withRuntimeEnv } = await import("void/_env");\n const { handleDevTrigger } = await import(${JSON.stringify(dispatchPath)});`);
|
|
5139
|
+
ms.appendLeft(returns[0].start, "const __origHandle = handle ?? (({ event, resolve }) => resolve(event));\n handle = ({ event, resolve }) => withRuntimeEnv(event.platform?.env, async () => {\n const __triggerResp = await handleDevTrigger(event.request, event.platform?.env, undefined);\n if (__triggerResp) return __triggerResp;\n return __origHandle({ event, resolve });\n });\n ");
|
|
5140
|
+
return {
|
|
5141
|
+
code: ms.toString(),
|
|
5142
|
+
map: ms.generateMap({ hires: true })
|
|
5143
|
+
};
|
|
5144
|
+
}
|
|
5145
|
+
//#endregion
|
|
5187
5146
|
//#region src/index.ts
|
|
5188
5147
|
/**
|
|
5189
5148
|
* Persist the dev-trigger token at `<root>/.void/dev-trigger-token` so
|
|
@@ -5582,9 +5541,9 @@ function readVoidDevCredentials(root) {
|
|
|
5582
5541
|
*/
|
|
5583
5542
|
async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
5584
5543
|
const { select, text, isCancel, log } = await import("./dist-C5fND3R0.mjs");
|
|
5585
|
-
const { PlatformClient } = await import("./client-
|
|
5586
|
-
const { attachSelectedPlatform, writeProjectConfig } = await import("./project-
|
|
5587
|
-
const { inferDefaultSlug } = await import("./resolve-project-
|
|
5544
|
+
const { PlatformClient } = await import("./client-4cDVv7BO.mjs");
|
|
5545
|
+
const { attachSelectedPlatform, writeProjectConfig } = await import("./project-BuUwfj6f.mjs");
|
|
5546
|
+
const { inferDefaultSlug } = await import("./resolve-project-DtbidV4y.mjs");
|
|
5588
5547
|
const client = new PlatformClient(token, apiUrl);
|
|
5589
5548
|
let projects;
|
|
5590
5549
|
try {
|
|
@@ -5611,7 +5570,7 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
|
5611
5570
|
let slug;
|
|
5612
5571
|
if (result === "__create__") {
|
|
5613
5572
|
const { validateProjectSlug } = await import("./project-slug-DofjTFd-.mjs");
|
|
5614
|
-
const { createProjectWithSlugRetry } = await import("./create-project-
|
|
5573
|
+
const { createProjectWithSlugRetry } = await import("./create-project-BniEV0OW.mjs");
|
|
5615
5574
|
let created;
|
|
5616
5575
|
try {
|
|
5617
5576
|
created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
|
|
@@ -5717,13 +5676,14 @@ function voidPlugin(options) {
|
|
|
5717
5676
|
...inferenceOptions,
|
|
5718
5677
|
paths
|
|
5719
5678
|
}, scanDirs);
|
|
5720
|
-
const
|
|
5679
|
+
const sandboxEnabled = isSandboxEnabled(config);
|
|
5680
|
+
let bindings = sandboxEnabled ? {
|
|
5721
5681
|
...inferredBindings,
|
|
5722
5682
|
needsSandbox: true
|
|
5723
5683
|
} : inferredBindings;
|
|
5724
5684
|
const sandboxConfig = bindings.needsSandbox ? resolveSandboxConfig(config, root) : void 0;
|
|
5725
5685
|
const authConfigPath = findVoidAuthConfig(root, paths);
|
|
5726
|
-
|
|
5686
|
+
let authEnabled = bindings.needsAuth || authConfigPath !== null || config.auth !== void 0;
|
|
5727
5687
|
if (detected && authEnabled) throw new Error("auth: Void-managed Better Auth is only supported in Void apps. Use Better Auth's official integration for this framework instead.");
|
|
5728
5688
|
if (detected && bindings.needsSandbox) throw new Error("sandbox: Cloudflare Sandboxes are currently supported in Void apps only.");
|
|
5729
5689
|
if (detected && bindings.needsLive) throw new Error("live: void/live is currently supported in Void apps only.");
|
|
@@ -5820,6 +5780,7 @@ function voidPlugin(options) {
|
|
|
5820
5780
|
syncWranglerWebSockets(root, productionWebSocketRoutes);
|
|
5821
5781
|
websocketTombstones = readWranglerWebSocketTombstones(root, productionWebSocketRoutes);
|
|
5822
5782
|
}
|
|
5783
|
+
const existingLiveConfig = !isNodeTarget(config.target) ? readExistingLiveBindingConfig(root) : void 0;
|
|
5823
5784
|
const liveConfig = !isNodeTarget(config.target) ? bindings.needsLive ? resolveLiveBindingConfig(root, {
|
|
5824
5785
|
reservedBindings: [...websocketRoutes.map((route) => route.bindingName), ...durableObjects.map((module) => module.bindingName)],
|
|
5825
5786
|
reservedClasses: [
|
|
@@ -5827,7 +5788,8 @@ function voidPlugin(options) {
|
|
|
5827
5788
|
...durableObjects.map((module) => module.className),
|
|
5828
5789
|
sandboxConfig?.className
|
|
5829
5790
|
]
|
|
5830
|
-
}) :
|
|
5791
|
+
}) : existingLiveConfig : void 0;
|
|
5792
|
+
const shouldEmitLive = () => bindings.needsLive || existingLiveConfig !== void 0;
|
|
5831
5793
|
if (detected && (detected.class === "b" || detected.class === "c")) {
|
|
5832
5794
|
const frameworkPersistRoot = localD1.persistRoot;
|
|
5833
5795
|
const syncFrameworkCompat = (compat) => {
|
|
@@ -5894,11 +5856,7 @@ function voidPlugin(options) {
|
|
|
5894
5856
|
transform(code, id) {
|
|
5895
5857
|
if (detected.class !== "b") return;
|
|
5896
5858
|
if (!id.includes(".svelte-kit/generated/server/internal")) return;
|
|
5897
|
-
|
|
5898
|
-
const dispatchPath = JSON.stringify(frameworkTriggersDispatchPath(root));
|
|
5899
|
-
return code.replace("export async function get_hooks() {", `export async function get_hooks() {
|
|
5900
|
-
const { withRuntimeEnv } = await import("void/_env");
|
|
5901
|
-
const { handleDevTrigger } = await import(${dispatchPath});`).replace(/return\s*\{/, "const __origHandle = handle ?? (({ event, resolve }) => resolve(event));\n handle = ({ event, resolve }) => withRuntimeEnv(event.platform?.env, async () => {\n const __triggerResp = await handleDevTrigger(event.request, event.platform?.env, undefined);\n if (__triggerResp) return __triggerResp;\n return __origHandle({ event, resolve });\n });\n return {");
|
|
5859
|
+
return injectSvelteKitHooks(code, id, frameworkTriggersDispatchPath(root));
|
|
5902
5860
|
}
|
|
5903
5861
|
};
|
|
5904
5862
|
return [
|
|
@@ -6101,7 +6059,7 @@ function voidPlugin(options) {
|
|
|
6101
6059
|
new_sqlite_classes: [sandboxConfig.className]
|
|
6102
6060
|
}];
|
|
6103
6061
|
}
|
|
6104
|
-
if (liveConfig) {
|
|
6062
|
+
if (shouldEmitLive() && liveConfig) {
|
|
6105
6063
|
const existingDurableObjectBindings = (result.durable_objects ?? resolved.durable_objects)?.bindings ?? [];
|
|
6106
6064
|
if (!existingDurableObjectBindings.some((binding) => binding.name === liveConfig.bindingName)) result.durable_objects = { bindings: [...existingDurableObjectBindings, {
|
|
6107
6065
|
name: liveConfig.bindingName,
|
|
@@ -6148,6 +6106,16 @@ function voidPlugin(options) {
|
|
|
6148
6106
|
config(userConfig, { command, isPreview }) {
|
|
6149
6107
|
viteCommand = command;
|
|
6150
6108
|
routeEnvironment = command === "serve" && !isPreview ? "dev" : "prod";
|
|
6109
|
+
const environmentBindings = inferProjectBindings(root, {
|
|
6110
|
+
...inferenceOptions,
|
|
6111
|
+
paths,
|
|
6112
|
+
environment: routeEnvironment
|
|
6113
|
+
}, scanDirs);
|
|
6114
|
+
bindings = sandboxEnabled ? {
|
|
6115
|
+
...environmentBindings,
|
|
6116
|
+
needsSandbox: true
|
|
6117
|
+
} : environmentBindings;
|
|
6118
|
+
authEnabled = bindings.needsAuth || authConfigPath !== null || config.auth !== void 0;
|
|
6151
6119
|
if (command === "serve" && directCloudflareDestination && bindings.needsAI) process.env.CLOUDFLARE_AUTH_USE_KEYRING = "true";
|
|
6152
6120
|
if (!framework && !isNodeTarget(config.target)) {
|
|
6153
6121
|
managedCloudflareBuild = command === "build" && Boolean(process.env.VOID_DEPLOY_PROJECT_ID);
|
|
@@ -6158,7 +6126,9 @@ function voidPlugin(options) {
|
|
|
6158
6126
|
const ignored = ["**/.void/**"];
|
|
6159
6127
|
if (command === "serve") {
|
|
6160
6128
|
const local = loadLocalEnv(root, { onWarn: (message) => voidWarn(message) });
|
|
6161
|
-
const
|
|
6129
|
+
const devEnv = { ...local };
|
|
6130
|
+
for (const key of /* @__PURE__ */ new Set([...Object.keys(local), ...envSchemaFacts?.keys ?? []])) if (process.env[key] !== void 0) devEnv[key] = process.env[key];
|
|
6131
|
+
const { sanitized: env, stripped } = stripInternalEnvKeys(devEnv);
|
|
6162
6132
|
if (stripped.length > 0) voidWarn(`Ignoring internal env keys from .env: ${stripped.join(", ")}. These are reserved for Void runtime use.`);
|
|
6163
6133
|
workerConfig.vars = {
|
|
6164
6134
|
...workerConfig.vars,
|
|
@@ -6393,7 +6363,7 @@ function voidPlugin(options) {
|
|
|
6393
6363
|
hasMiddleware,
|
|
6394
6364
|
hasWebSockets: hasDocumentRoutes(environmentWebsocketRoutes),
|
|
6395
6365
|
authEnabled,
|
|
6396
|
-
liveEnabled: liveConfig !== void 0,
|
|
6366
|
+
liveEnabled: shouldEmitLive() && liveConfig !== void 0,
|
|
6397
6367
|
notFound: config.routing?.notFound
|
|
6398
6368
|
});
|
|
6399
6369
|
const rules = mergeRoutingRules({
|
|
@@ -6451,10 +6421,14 @@ function voidPlugin(options) {
|
|
|
6451
6421
|
remoteMode,
|
|
6452
6422
|
routing: config.routing,
|
|
6453
6423
|
bindingNames,
|
|
6454
|
-
hasSandbox
|
|
6424
|
+
get hasSandbox() {
|
|
6425
|
+
return bindings.needsSandbox;
|
|
6426
|
+
},
|
|
6455
6427
|
sandboxBindingName: sandboxConfig?.binding,
|
|
6456
6428
|
sandboxClassName: sandboxConfig?.className,
|
|
6457
|
-
live
|
|
6429
|
+
get live() {
|
|
6430
|
+
return shouldEmitLive() ? liveConfig : void 0;
|
|
6431
|
+
},
|
|
6458
6432
|
durableObjects,
|
|
6459
6433
|
websocketTombstones,
|
|
6460
6434
|
onDevAssetRoutingPolicyChange: updateDevAssetRoutingPolicy
|