void 1.2.0 → 1.3.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/dist/{account-cmd-CdUll_35.mjs → account-cmd-B4i71m7k.mjs} +3 -3
- package/dist/{application-analysis-fEqoSeMp.mjs → application-analysis-DYdVoMAY.mjs} +8 -6
- package/dist/{application-routing-DAhNP4u3.mjs → application-routing-C8EqRDfv.mjs} +3 -1
- package/dist/{auth-link-C87vGXM-.mjs → auth-link-BKwHPbdv.mjs} +3 -3
- package/dist/{auth-router-6I81r-ix.mjs → auth-router-DqLx8E0F.mjs} +2 -2
- package/dist/{better-auth-shared-D-6z0q0f.mjs → better-auth-shared-7FM3Uk2N.mjs} +48 -2
- package/dist/{build-cmd-ex1g-j_e.mjs → build-cmd-Dy4psnt1.mjs} +1 -1
- package/dist/{cache-oHzrnY3z.mjs → cache-DV37S6dl.mjs} +1 -1
- package/dist/{cancel-deploy-viAMD0Q_.mjs → cancel-deploy-DMPyu1Vt.mjs} +1 -1
- package/dist/{cf-build-output-BhVxldCw.mjs → cf-build-output-Bapzc_8Z.mjs} +102 -1
- package/dist/cf-build-output-DlBkWdNU.mjs +1 -0
- package/dist/cli/cli.mjs +41 -32
- package/dist/cli/cloudflare-operation-process.mjs +27 -6
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/{client-BEkdj1kx.mjs → client-BEMtySaV.mjs} +8 -1
- package/dist/client-DyxPQnF_.mjs +1 -0
- package/dist/{cloudflare-cmd-DMzCv12s.mjs → cloudflare-cmd-BaqIigwI.mjs} +1 -1
- package/dist/{cloudflare-connect-CCRTVg-I.mjs → cloudflare-connect-pNLQmr_e.mjs} +1 -1
- package/dist/{cloudflare-operations-DsSaw2BT.mjs → cloudflare-operations-PCM4wucv.mjs} +1 -1
- package/dist/{cloudflare-operations-Dh9dEHJj.mjs → cloudflare-operations-vP3b5CQf.mjs} +3 -3
- package/dist/config-BTu1o3Dc.mjs +49 -0
- package/dist/{config-DQfHOKh9.d.mts → config-Du88-7Y8.d.mts} +2 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-k7R2rPVA.mjs → connect-DwVsBvVh.mjs} +4 -4
- package/dist/{create-project-DTuy-l0z.mjs → create-project-CgrnvzyA.mjs} +1 -1
- package/dist/{create-project-DV71ol5d.mjs → create-project-CjzbBlTv.mjs} +1 -1
- package/dist/{db-DVOkLH5X.mjs → db-rvo64snS.mjs} +13 -13
- package/dist/{delete-BbP5eopu.mjs → delete-DWX6dP4M.mjs} +1 -1
- package/dist/deploy-CtHE2A3R.mjs +2 -0
- package/dist/{deploy-7H32EnUs.mjs → deploy-hRPvw8ci.mjs} +229 -69
- package/dist/{deploy-managed-static-DlvcvnQT.mjs → deploy-managed-static-CDYA2p3L.mjs} +30 -14
- package/dist/{deploy-transport-BzGEj0Ge.mjs → deploy-transport-JCxw7QDi.mjs} +3 -3
- package/dist/deploy.mjs +4 -3
- package/dist/{dispatch-DoUnxTNo.mjs → dispatch-OVLeWW8K.mjs} +71 -2
- package/dist/{domain-CA2wBgra.mjs → domain-CH5iBD9Y.mjs} +2 -2
- package/dist/{email-DXpCc77w.mjs → email-CbTO1l78.mjs} +58 -9
- package/dist/{email-cloudflare-D03g2TkS.mjs → email-cloudflare-B8-pq_-W.mjs} +106 -5
- package/dist/{env-DgOQ9_8S.mjs → env-BBdw236G.mjs} +3 -3
- package/dist/{env-BJjULvL0.mjs → env-BaMz0j7H.mjs} +6 -1
- package/dist/{env-validation-BmsdCZEk.mjs → env-validation-BfBVvBNe.mjs} +1 -1
- package/dist/{env-validation-Dwq3PJzK.mjs → env-validation-XcukUlFM.mjs} +1 -1
- package/dist/{gen-BfmcIi2g.mjs → gen-CCx3t2Ju.mjs} +1 -1
- package/dist/gen-TgXy93Rr.mjs +1 -0
- package/dist/{github-cmd-CY9LUqLh.mjs → github-cmd-BzkRLkbg.mjs} +1 -1
- package/dist/{handler-BbkSPzGF.d.mts → handler-CQv5YDS0.d.mts} +1 -1
- package/dist/{help-CxSlPpzJ.mjs → help-CKbrhZha.mjs} +16 -1
- package/dist/help-qOZr3wng.mjs +1 -0
- package/dist/index.d.mts +2 -4
- package/dist/index.mjs +317 -122
- package/dist/{info-7VDlhtyy.mjs → info-oBm8yK8J.mjs} +2 -2
- package/dist/{init-DxYyOs4-.mjs → init-CBp_uMve.mjs} +217 -197
- package/dist/{link-Ddmod1dZ.mjs → link-Dt_QXmM4.mjs} +2 -2
- package/dist/{list-MogaugiO.mjs → list-DF6asTdt.mjs} +2 -2
- package/dist/{live-Bt8Y_0bg.d.mts → live-CXJ9yC98.d.mts} +1 -1
- package/dist/{local-d1-BHBnKWRb.mjs → local-d1-CUhH3qtj.mjs} +1 -1
- package/dist/{login-Cttnagmm.mjs → login-BjSyhXlT.mjs} +2 -2
- package/dist/login-Cdo8Aco1.mjs +1 -0
- package/dist/{logs-CAszUWZI.mjs → logs-DmvBl6xA.mjs} +2 -2
- package/dist/{migrate-DyT2jJ8y.mjs → migrate-BXRHpYwR.mjs} +1 -1
- package/dist/migrate-COPncCGx.mjs +1 -0
- package/dist/nitro.mjs +2 -2
- package/dist/{node-WB7c2N4L.mjs → node-DtD7ZiPf.mjs} +4 -4
- package/dist/{operator-args-UnE8Y2eK.mjs → operator-args-BsJIYXaT.mjs} +8 -1
- package/dist/operator-cmd-DDiX7Y3f.mjs +1 -0
- package/dist/{operator-cmd-skshjMGl.mjs → operator-cmd-DjZKGGgN.mjs} +4 -3
- package/dist/pages/client.d.mts +21 -4
- package/dist/pages/client.mjs +174 -35
- package/dist/pages/index.d.mts +18 -2
- package/dist/pages/index.mjs +2 -52
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +9 -3
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/platform-args-BC8_hsDj.mjs +1 -0
- package/dist/{platform-args-DVbVClZl.mjs → platform-args-BMD2gjc_.mjs} +1 -1
- package/dist/{platform-auth-config-C-pm5Qzx.mjs → platform-auth-config-BgnuMbml.mjs} +3 -3
- package/dist/{platform-auth-protection-SHhvim1L.mjs → platform-auth-protection-NjRejttU.mjs} +2 -2
- package/dist/{platform-auth-recovery-DXVWs-wA.mjs → platform-auth-recovery-Ug12d9W5.mjs} +2 -2
- package/dist/{platform-cmd-PiNRkopU.mjs → platform-cmd-BYKLMPCn.mjs} +1 -1
- package/dist/{platform-cmd-D5I1beUX.mjs → platform-cmd-HByuZAO7.mjs} +4 -4
- package/dist/{platform-domain-jpmBfZeb.mjs → platform-domain-DLSQ8GF8.mjs} +2 -2
- package/dist/{platform-lifecycle-DyKmuNY6.mjs → platform-lifecycle-3dwFJmnq.mjs} +102 -40
- package/dist/{platform-lifecycle-DH3Yr1qQ.mjs → platform-lifecycle-BRqcxerG.mjs} +1 -1
- package/dist/{platform-management-7m-PLaPJ.mjs → platform-management-ZK6XcbCo.mjs} +1 -1
- package/dist/{platform-management--vDwSn35.mjs → platform-management-ZZ6bQM5j.mjs} +1 -1
- package/dist/{platform-recovery-BiNpZZab.mjs → platform-recovery-8vNE5dNN.mjs} +2 -2
- package/dist/{plugin-inference-DUjCd55H.mjs → plugin-inference-CeiB6BG5.mjs} +53 -18
- package/dist/{prepare-BcAE5Sdj.mjs → prepare-5BR7Splm.mjs} +1 -1
- package/dist/prepare-B3VrSF1Z.mjs +1 -0
- package/dist/{prepare-DA-17DhO.mjs → prepare-Dseww74N.mjs} +4 -4
- package/dist/{prerender-render-Cijv7UFo.mjs → prerender-render-CaShbHJ3.mjs} +13 -1
- package/dist/prerender-render.d.mts +1 -0
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-DA4K5faU.mjs → project-cmd-CjLNNxwe.mjs} +15 -15
- package/dist/{project-team-CQBNveX3.mjs → project-team-DE5drjcl.mjs} +1 -1
- package/dist/{project-token-CCalFyQf.mjs → project-token-XEYEXfiJ.mjs} +1 -1
- package/dist/{project-zero-trust-DPnkiEuT.mjs → project-zero-trust-6VPU8zmV.mjs} +1 -1
- package/dist/{protocol-BBDpJz3G.d.mts → protocol-BekmFxCI.d.mts} +2 -2
- package/dist/{provision-DtROpNNI.mjs → provision-B7UFrBH7.mjs} +1 -1
- package/dist/{provision-BFLCrnUp.mjs → provision-Chq0NRAV.mjs} +1 -1
- package/dist/{requests-BpH0kImL.mjs → requests-CG-Pj8ze.mjs} +1 -1
- package/dist/{rollback-CXS1tAa-.mjs → rollback-CIrm2txZ.mjs} +2 -2
- package/dist/{route-types-BZi26DVS.mjs → route-types--PAOzHlH.mjs} +49 -28
- package/dist/routes-stub.d.mts +22 -13
- 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/handler.d.mts +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/log.mjs +19 -1
- package/dist/runtime/routing.d.mts +2 -2
- package/dist/runtime/routing.mjs +4 -3
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{scan-8IzYXiU_.mjs → scan-N9WzdcAl.mjs} +302 -23
- package/dist/{secret-BbXHfLAt.mjs → secret-BL6g7mF5.mjs} +3 -3
- package/dist/static-asset-marker-Btf-6oCD.mjs +32 -0
- package/dist/{types-7AIz0OZu.d.mts → types-w72dljaA.d.mts} +6 -1
- package/dist/{version-metadata-tS39iW09.mjs → version-metadata-DmaZNTYW.mjs} +1 -1
- package/dist/worker-conditions-AWFRcFxR.mjs +11 -0
- package/dist/{wrangler-F96NnLyb.mjs → wrangler-CDiEBCdS.mjs} +2 -1
- package/dist/wrangler-DOPr4jyI.mjs +1 -0
- package/dist/{wrapper-D3sZyh2C.mjs → wrapper-CEiDeCqD.mjs} +6 -10
- package/dist/{ws-BH-im_tX.d.mts → ws-D1zWiB_P.d.mts} +1 -1
- package/docs/guide/auth.md +3 -1
- package/docs/guide/edge/static-assets.md +10 -0
- package/docs/guide/email/domains.md +1 -1
- package/docs/guide/email/receiving.md +2 -0
- package/docs/guide/email/sending.md +1 -1
- package/docs/guide/pages-routing/actions-and-forms.md +19 -13
- package/docs/guide/pages-routing/markdown.md +2 -0
- package/docs/guide/pages-routing/overview.md +34 -3
- package/docs/guide/platform/administration/email.md +18 -0
- package/docs/guide/platform/installation/prerequisites.md +9 -4
- package/docs/guide/platform/installation/uninstall.md +2 -0
- package/docs/guide/queues.md +13 -1
- package/docs/guide/quickstart.md +26 -1
- package/docs/guide/sandboxes.md +2 -2
- package/docs/guide/server-routing.md +38 -2
- package/docs/guide/type-safety.md +7 -7
- package/docs/guide/websockets.md +4 -2
- package/docs/reference/api/pages.md +4 -4
- package/docs/reference/cli/email.md +13 -0
- package/docs/reference/cli/platform-email.md +2 -2
- package/docs/reference/cli.md +2 -1
- package/docs/reference/structure.md +3 -1
- package/package.json +8 -7
- package/sandbox.Dockerfile +1 -1
- package/templates/assets/icons.svg +49 -0
- package/templates/assets/react.svg +1 -0
- package/templates/assets/solid.svg +1 -0
- package/templates/assets/stack.svg +35 -0
- package/templates/assets/svelte.svg +1 -0
- package/templates/assets/void.svg +5 -0
- package/templates/assets/vue.svg +1 -0
- package/dist/cf-build-output-BJHuSsVN.mjs +0 -1
- package/dist/client-BiRDZTSd.mjs +0 -1
- package/dist/config-CyUJzi3q.mjs +0 -32
- package/dist/deploy-CE0Ev0Ob.mjs +0 -2
- package/dist/gen-NrOlWZaG.mjs +0 -1
- package/dist/help-BeAFFE5C.mjs +0 -1
- package/dist/login-DgDwlKc_.mjs +0 -1
- package/dist/migrate-n49ZeS1X.mjs +0 -1
- package/dist/operator-cmd-d2MvJOrl.mjs +0 -1
- package/dist/parse-filename-DioPHiR9.mjs +0 -77
- package/dist/platform-args-kQrgxScY.mjs +0 -1
- package/dist/prepare-C4I0f--h.mjs +0 -1
- package/dist/wrangler-BLb3_luP.mjs +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-3h0WiCiA.mjs";
|
|
2
2
|
import { a as join, c as resolve, i as isAbsolute, n as dirname, o as normalize, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
3
3
|
import { t as require_picocolors } from "./picocolors-BsDfhxIw.mjs";
|
|
4
|
-
import { l as inferBindingsFromSource,
|
|
4
|
+
import { l as inferBindingsFromSource, m as applyBindingOverrides, n as FRAMEWORK_SCAN_DIRS, t as DEFAULT_SCAN_DIRS, u as staticModuleReferences } from "./plugin-inference-CeiB6BG5.mjs";
|
|
5
5
|
import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-DGu_QZ_Q.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { i as loadVoidAuthConfig, n as devAuthConfigImporter, t as AUTH_CONFIG_ENVIRONMENT } from "./config-BTu1o3Dc.mjs";
|
|
7
7
|
import { c as getDatabaseCasing, l as getDatabaseDialect, p as readConfig, u as isNodeTarget } from "./config-DHgSEWT7.mjs";
|
|
8
|
+
import { f as invalidateSourceAnalysis, o as resolveLayoutIds, p as isRouteEnabledForEnvironment } from "./scan-N9WzdcAl.mjs";
|
|
8
9
|
import { i as isMemberExpression, n as isIdentifier, r as isLiteral } from "./ast-CsZ_q_gc.mjs";
|
|
9
10
|
import { n as bindingResolver } from "./ast-bindings-C3yaPs1y.mjs";
|
|
10
|
-
import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, n as DEFAULT_SANDBOX_CLASS_NAME, p as scanJobsSync, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync, u as scanQueuesSync } from "./application-analysis-
|
|
11
|
-
import { t as isRouteEnabledForEnvironment } from "./parse-filename-DioPHiR9.mjs";
|
|
12
|
-
import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-BEM8ZuGP.mjs";
|
|
13
|
-
import { r as hasEmailHandlers } from "./email-B9ayYQEG.mjs";
|
|
11
|
+
import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, n as DEFAULT_SANDBOX_CLASS_NAME, p as scanJobsSync, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync, u as scanQueuesSync } from "./application-analysis-DYdVoMAY.mjs";
|
|
14
12
|
import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-BMwmN5Ae.mjs";
|
|
15
13
|
import { t as MagicString } from "./dist-Cegxq8gs.mjs";
|
|
16
|
-
import {
|
|
14
|
+
import { a as validateSsrEntries, n as SSR_SERVER_ENTRY_RELATIVE_PATHS, o as validateSsrEntry, t as SSR_CLIENT_ENTRY_RELATIVE_PATHS } from "./entry-BEM8ZuGP.mjs";
|
|
15
|
+
import { r as hasEmailHandlers } from "./email-B9ayYQEG.mjs";
|
|
17
16
|
import { a as resolveDistDir, c as hasDocumentRoutes, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate, s as hasApiRoutes, t as collectPages, u as resolveAssetRoutingPolicy } from "./isr-config-fZaJJ8t7.mjs";
|
|
18
17
|
import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-D522zd0A.mjs";
|
|
19
18
|
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
20
19
|
import { a as restoreCloudflarePreviewPointer, r as materializeCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-DchHxPTo.mjs";
|
|
21
|
-
import { A as syncWranglerWebSockets, E as resolveLiveBindingConfig, O as syncWranglerBindings, T as readWranglerWebSocketTombstones, a as LIVE_MIGRATION_TAG, b as readRootWranglerConfig, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as normalizeWranglerCompatibilityFlags, h as nextDurableObjectMigrationTag, k as syncWranglerDurableObjects, m as hasDurableObjectSqliteMigration, p as findBindingNameOwner, u as ensureWranglerCompat, v as readExistingLiveBindingConfig, x as readWranglerCompat } from "./wrangler-
|
|
22
|
-
import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-
|
|
20
|
+
import { A as syncWranglerWebSockets, E as resolveLiveBindingConfig, O as syncWranglerBindings, T as readWranglerWebSocketTombstones, a as LIVE_MIGRATION_TAG, b as readRootWranglerConfig, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as normalizeWranglerCompatibilityFlags, h as nextDurableObjectMigrationTag, k as syncWranglerDurableObjects, m as hasDurableObjectSqliteMigration, p as findBindingNameOwner, u as ensureWranglerCompat, v as readExistingLiveBindingConfig, x as readWranglerCompat } from "./wrangler-CDiEBCdS.mjs";
|
|
21
|
+
import { n as writeLocalD1PersistState, t as resolveLocalD1Target } from "./local-d1-CUhH3qtj.mjs";
|
|
23
22
|
import { n as scopedAccessCredentials } from "./cf-access-BM9G0lhO.mjs";
|
|
24
23
|
import { n as ensurePlatformProxyAccess } from "./cf-access-CWP4avfP.mjs";
|
|
25
24
|
import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-B6iOCjKI.mjs";
|
|
26
25
|
import { r as writeFileIfChanged } from "./project-tsconfig-Itv1f4WC.mjs";
|
|
27
|
-
import {
|
|
26
|
+
import { a as readDeployBuildQueueNames, r as cloudflareQueueName, s as drizzlePlugin, t as generateQueueResolverSource } from "./dispatch-OVLeWW8K.mjs";
|
|
28
27
|
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 } from "./dev-inbox-D0jxye_D.mjs";
|
|
29
28
|
import { n as scanWranglerDotenvKeys } from "./dotenv-CNazY3-w.mjs";
|
|
30
|
-
import { a as
|
|
29
|
+
import { a as findReservedEnvKeys, c as reservedEnvKeysMessage, i as findLegacyEnvFiles, l as resolveRemoteMode, o as isClientEnvKey, r as LOCAL_ENV_FILE, s as loadLocalEnv } from "./env-BaMz0j7H.mjs";
|
|
31
30
|
import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-BicfKBhV.mjs";
|
|
32
31
|
import { t as loadUserEnvFile } from "./load-user-env-DD5qveNU.mjs";
|
|
33
32
|
import { n as INTERNAL_BINDING_PREFIXES, t as INTERNAL_BINDING_EXACT_NAMES } from "./env-raw-D74P4ebM.mjs";
|
|
34
33
|
import { t as ASSET_EXTENSIONS } from "./routing-assets-DdSFxoLp.mjs";
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
34
|
+
import { t as assertNoPrerenderFailures } from "./prerender-render-CaShbHJ3.mjs";
|
|
35
|
+
import { r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-DmaZNTYW.mjs";
|
|
36
|
+
import { d as isGeneratedAssetHeaders, f as resolveAssetWorkerBypass, g as prerenderPagesNode, h as prerenderPages, n as SEND_EMAIL_BINDING, u as isAssetBypassRule } from "./email-cloudflare-B8-pq_-W.mjs";
|
|
37
37
|
import { r as defer } from "./validation-error-Dg9Recn1.mjs";
|
|
38
38
|
import { i as safeJsonStringify } from "./protocol-DimNxVRr.mjs";
|
|
39
|
-
import { n as completeApplicationAnalysis } from "./application-routing-
|
|
40
|
-
import { n as generateQueueTypes, t as generateRouteTypes } from "./route-types
|
|
39
|
+
import { n as completeApplicationAnalysis } from "./application-routing-C8EqRDfv.mjs";
|
|
40
|
+
import { n as generateQueueTypes, t as generateRouteTypes } from "./route-types--PAOzHlH.mjs";
|
|
41
41
|
import { a as defineMiddleware, c as defineScheduled, i as defineHead, n as basicAuth, o as defineQueue, r as defineHandler, s as defineRender, t as VoidAssetRewriteError } from "./handler-BZ1t7-Rv.mjs";
|
|
42
42
|
import module, { builtinModules, createRequire } from "node:module";
|
|
43
43
|
import { chmodSync, closeSync, existsSync, mkdirSync, openSync, readFileSync, realpathSync, rmSync, statSync, writeFileSync, writeSync } from "node:fs";
|
|
44
44
|
import { cloudflare } from "@cloudflare/vite-plugin";
|
|
45
45
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
46
|
-
import { defaultServerConditions, loadEnv, normalizePath, parseSync, resolveEnvPrefix } from "vite";
|
|
46
|
+
import { createRunnableDevEnvironment, defaultServerConditions, isRunnableDevEnvironment, loadEnv, normalizePath, parseSync, resolveEnvPrefix } from "vite";
|
|
47
47
|
import { appendSqliteClassMigration } from "@void/deploy-core";
|
|
48
48
|
import { randomBytes, timingSafeEqual } from "node:crypto";
|
|
49
49
|
import { homedir } from "node:os";
|
|
@@ -489,7 +489,7 @@ function readVoidDevCredentials(root) {
|
|
|
489
489
|
*/
|
|
490
490
|
async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
491
491
|
const { select, text, isCancel, log } = await import("./dist-B1PLt4_8.mjs");
|
|
492
|
-
const { PlatformClient } = await import("./client-
|
|
492
|
+
const { PlatformClient } = await import("./client-DyxPQnF_.mjs");
|
|
493
493
|
const { attachSelectedPlatform, writeProjectConfig } = await import("./project-zdB3fs9G.mjs");
|
|
494
494
|
const { inferDefaultSlug } = await import("./resolve-project-DD1vu8s9.mjs");
|
|
495
495
|
const { printSuccess } = await import("./output-BW9uK099.mjs");
|
|
@@ -519,7 +519,7 @@ async function runAiSetupPrompt(root, token, apiUrl, server) {
|
|
|
519
519
|
let slug;
|
|
520
520
|
if (result === "__create__") {
|
|
521
521
|
const { validateProjectSlug } = await import("./project-slug-6cyz8E7k.mjs");
|
|
522
|
-
const { createProjectWithSlugRetry } = await import("./create-project-
|
|
522
|
+
const { createProjectWithSlugRetry } = await import("./create-project-CgrnvzyA.mjs");
|
|
523
523
|
let created;
|
|
524
524
|
try {
|
|
525
525
|
created = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => {
|
|
@@ -2364,7 +2364,9 @@ function compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, s
|
|
|
2364
2364
|
lines.push("");
|
|
2365
2365
|
}
|
|
2366
2366
|
if (scan.queues.length > 0) {
|
|
2367
|
-
|
|
2367
|
+
const queueNames = scan.queues.map((queue) => queue.name);
|
|
2368
|
+
const cloudflareNames = options.cloudflareQueueNames;
|
|
2369
|
+
lines.push(generateQueueResolverSource(queueNames, cloudflareNames && queueNames.map((name) => cloudflareQueueName(name, cloudflareNames))));
|
|
2368
2370
|
lines.push("");
|
|
2369
2371
|
lines.push("export async function __processQueue(payload, env) {");
|
|
2370
2372
|
lines.push(" const queueSuffix = payload.queue;");
|
|
@@ -2768,7 +2770,7 @@ ${envValidateCall}${remoteEnvSwap}${isrDeploymentStamp} const userEnv = __filte
|
|
|
2768
2770
|
const emailHandler = hasEmail ? `async function handleEmail(envelope, env, ctx) {
|
|
2769
2771
|
${envValidateCall}${remoteEnvSwap} const userEnv = __filterInternalBindings(env);
|
|
2770
2772
|
const __relayed = typeof envelope.viaDomain === "string" && envelope.viaDomain.length > 0;
|
|
2771
|
-
const __slug = __relayed
|
|
2773
|
+
const __slug = __relayed || typeof env.__VOID_PROJECT_SLUG !== "string" || env.__VOID_PROJECT_SLUG.length === 0 ? undefined : (String(envelope.to || "").split("@")[0].split("+")[0] || env.__VOID_PROJECT_SLUG);
|
|
2772
2774
|
const { message, getActions } = __createMessageProxy(envelope, { slug: __slug });
|
|
2773
2775
|
await __withRawEnv(env, () => withRuntimeEnv(env, () => __emailHandler(message, userEnv, ctx, { slug: __slug })));
|
|
2774
2776
|
const __actions = getActions();
|
|
@@ -3294,8 +3296,8 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
|
|
|
3294
3296
|
const hasSqlMigrations = existsSync(migrationsDir);
|
|
3295
3297
|
if (!hasSqlMigrations && !auth?.enabled) return;
|
|
3296
3298
|
const migrateAuth = async (databaseUrl) => {
|
|
3297
|
-
const { runLocalVoidAuthMigrations } = await import("./node-
|
|
3298
|
-
await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth?.configPath, databaseUrl);
|
|
3299
|
+
const { runLocalVoidAuthMigrations } = await import("./node-DtD7ZiPf.mjs");
|
|
3300
|
+
await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth?.configPath, databaseUrl, devAuthConfigImporter(server));
|
|
3299
3301
|
};
|
|
3300
3302
|
const mysqlAuth = dialect === "mysql" && auth?.enabled === true;
|
|
3301
3303
|
const logApplied = (applied) => {
|
|
@@ -3967,7 +3969,7 @@ function prerenderPlugin(root, config) {
|
|
|
3967
3969
|
voidLog("No pages to prerender");
|
|
3968
3970
|
return;
|
|
3969
3971
|
}
|
|
3970
|
-
|
|
3972
|
+
assertNoPrerenderFailures(result.failed);
|
|
3971
3973
|
}
|
|
3972
3974
|
};
|
|
3973
3975
|
}
|
|
@@ -4159,10 +4161,13 @@ function restartPlugin() {
|
|
|
4159
4161
|
}
|
|
4160
4162
|
//#endregion
|
|
4161
4163
|
//#region src/client-asset-manifest.ts
|
|
4162
|
-
/**
|
|
4164
|
+
/**
|
|
4165
|
+
* Attach cache provenance to the existing manifest without changing its entry inventory.
|
|
4166
|
+
* Returns the stamped immutable files, sorted, relative to the client root.
|
|
4167
|
+
*/
|
|
4163
4168
|
function stampClientAssetCachePolicy(bundle, manifestPath, headerRules = []) {
|
|
4164
4169
|
const asset = bundle[manifestPath];
|
|
4165
|
-
if (asset?.type !== "asset") return;
|
|
4170
|
+
if (asset?.type !== "asset") return [];
|
|
4166
4171
|
const fingerprinted = /* @__PURE__ */ new Set();
|
|
4167
4172
|
const authoredCachePatterns = headerRules.filter((rule) => rule.headers.some(([name]) => name.toLowerCase() === "cache-control")).map((rule) => rule.pattern);
|
|
4168
4173
|
for (const pattern of authoredCachePatterns) compilePattern(pattern);
|
|
@@ -4170,9 +4175,13 @@ function stampClientAssetCachePolicy(bundle, manifestPath, headerRules = []) {
|
|
|
4170
4175
|
if (!authoredCachePatterns.some((pattern) => matchPattern(pattern, "/" + item.fileName))) fingerprinted.add(item.fileName);
|
|
4171
4176
|
}
|
|
4172
4177
|
const manifest = JSON.parse(String(asset.source));
|
|
4173
|
-
|
|
4174
|
-
|
|
4178
|
+
const stamped = /* @__PURE__ */ new Set();
|
|
4179
|
+
for (const entry of Object.values(manifest)) if (entry.file && fingerprinted.has(entry.file)) {
|
|
4180
|
+
entry.immutableFiles = [entry.file];
|
|
4181
|
+
stamped.add(entry.file);
|
|
4182
|
+
} else delete entry.immutableFiles;
|
|
4175
4183
|
asset.source = JSON.stringify(manifest, null, 2);
|
|
4184
|
+
return [...stamped].sort();
|
|
4176
4185
|
}
|
|
4177
4186
|
//#endregion
|
|
4178
4187
|
//#region src/plugin-routing.ts
|
|
@@ -4201,6 +4210,20 @@ function routingPlugin(root, options) {
|
|
|
4201
4210
|
let previewing = false;
|
|
4202
4211
|
let ssr = null;
|
|
4203
4212
|
let authConfigPath = null;
|
|
4213
|
+
const routeInputsKey = () => JSON.stringify([
|
|
4214
|
+
scan,
|
|
4215
|
+
authConfigPath,
|
|
4216
|
+
ssr,
|
|
4217
|
+
compileOptions.auth
|
|
4218
|
+
]);
|
|
4219
|
+
let generatedRouteInputs;
|
|
4220
|
+
let generatedFiles;
|
|
4221
|
+
let pendingRegeneration = Promise.resolve();
|
|
4222
|
+
function regenerateInOrder(regenerate) {
|
|
4223
|
+
const result = pendingRegeneration.then(regenerate);
|
|
4224
|
+
pendingRegeneration = result.then(() => {}, () => {});
|
|
4225
|
+
return result;
|
|
4226
|
+
}
|
|
4204
4227
|
const paths = readProjectPaths(root);
|
|
4205
4228
|
const routesDir = paths.routesDir;
|
|
4206
4229
|
const middlewareDir = paths.middlewareDir;
|
|
@@ -4210,6 +4233,8 @@ function routingPlugin(root, options) {
|
|
|
4210
4233
|
const pagesDir = paths.pagesDir;
|
|
4211
4234
|
const ssrDir = paths.ssrDir;
|
|
4212
4235
|
const authConfigPaths = new Set(paths.authConfigCandidates.map((path) => normalizePath(path)));
|
|
4236
|
+
let authConfigEnvironment;
|
|
4237
|
+
let authConfigStale = false;
|
|
4213
4238
|
const envFilePaths = new Set(paths.envFileCandidates.map((path) => normalizePath(path)));
|
|
4214
4239
|
const normalizedRoutesDir = normalizePath(routesDir);
|
|
4215
4240
|
const normalizedMiddlewareDir = normalizePath(middlewareDir);
|
|
@@ -4237,9 +4262,10 @@ function routingPlugin(root, options) {
|
|
|
4237
4262
|
}
|
|
4238
4263
|
async function rescan(refresh = false) {
|
|
4239
4264
|
const analysis = options.getApplicationAnalysis(routeEnvironment, refresh);
|
|
4240
|
-
|
|
4241
|
-
authConfigPath = analysis.authConfigPath;
|
|
4265
|
+
const nextScan = (await completeApplicationAnalysis(analysis)).scan;
|
|
4242
4266
|
const entries = validateSsrEntries(root, paths);
|
|
4267
|
+
scan = nextScan;
|
|
4268
|
+
authConfigPath = analysis.authConfigPath;
|
|
4243
4269
|
ssr = entries ? {
|
|
4244
4270
|
serverEntryPath: entries.server.absolutePath,
|
|
4245
4271
|
clientEntryRelativePath: entries.client.relativePath
|
|
@@ -4321,13 +4347,44 @@ function routingPlugin(root, options) {
|
|
|
4321
4347
|
providers: config.auth?.providers ?? null
|
|
4322
4348
|
};
|
|
4323
4349
|
}
|
|
4350
|
+
/**
|
|
4351
|
+
* Size and mtime of every generated file, or undefined when one is missing.
|
|
4352
|
+
* Another void process in the same root (a build, `void db generate`) can
|
|
4353
|
+
* rewrite them, and the dev watcher ignores `.void/`.
|
|
4354
|
+
*/
|
|
4355
|
+
function generatedFilesSignature() {
|
|
4356
|
+
const files = [
|
|
4357
|
+
"routes.d.ts",
|
|
4358
|
+
"queues.d.ts",
|
|
4359
|
+
...options.target ? ["app.ts", "index.ts"] : ["entry.ts"],
|
|
4360
|
+
...compileOptions.auth ? ["better-auth-db.ts", "better-auth-schema.ts"] : []
|
|
4361
|
+
];
|
|
4362
|
+
const parts = [];
|
|
4363
|
+
for (const file of files) {
|
|
4364
|
+
const stat = statSync(join(outDir, file), { throwIfNoEntry: false });
|
|
4365
|
+
if (!stat?.isFile()) return;
|
|
4366
|
+
parts.push(`${file}:${stat.size}:${stat.mtimeMs}`);
|
|
4367
|
+
}
|
|
4368
|
+
return parts.join("|");
|
|
4369
|
+
}
|
|
4370
|
+
async function loadAuthConfig(configPath) {
|
|
4371
|
+
const environment = authConfigEnvironment;
|
|
4372
|
+
if (authConfigStale && environment) environment.moduleGraph.invalidateAll();
|
|
4373
|
+
authConfigStale = false;
|
|
4374
|
+
try {
|
|
4375
|
+
return await loadVoidAuthConfig(configPath, environment && ((path) => environment.runner.import(path)));
|
|
4376
|
+
} catch (error) {
|
|
4377
|
+
authConfigStale = true;
|
|
4378
|
+
throw error;
|
|
4379
|
+
}
|
|
4380
|
+
}
|
|
4324
4381
|
async function writeAuthDatabaseFiles() {
|
|
4325
4382
|
if (!compileOptions.auth) return;
|
|
4326
4383
|
const { generateVoidAuthDatabaseModule, generateVoidAuthDrizzleSchema } = await import("./drizzle-9TubSZvI.mjs");
|
|
4327
4384
|
const authRuntime = {
|
|
4328
4385
|
dialect: compileOptions.auth.dialect,
|
|
4329
4386
|
providers: compileOptions.auth.providers,
|
|
4330
|
-
userConfig: await
|
|
4387
|
+
userConfig: await loadAuthConfig(compileOptions.auth.authConfigPath)
|
|
4331
4388
|
};
|
|
4332
4389
|
const env = {
|
|
4333
4390
|
...resolvedConfig?.command === "serve" ? loadLocalEnv(root) : {},
|
|
@@ -4362,7 +4419,8 @@ function routingPlugin(root, options) {
|
|
|
4362
4419
|
return framework ? `${base}:${framework}` : base;
|
|
4363
4420
|
}
|
|
4364
4421
|
function isPotentialAuthConfigPath(path) {
|
|
4365
|
-
|
|
4422
|
+
const normalized = normalizePath(path);
|
|
4423
|
+
return authConfigPaths.has(normalized) || (authConfigEnvironment?.moduleGraph.getModulesByFile(normalized)?.size ?? 0) > 0;
|
|
4366
4424
|
}
|
|
4367
4425
|
function isPotentialEnvFilePath(path) {
|
|
4368
4426
|
return envFilePaths.has(normalizePath(path));
|
|
@@ -4395,6 +4453,61 @@ function routingPlugin(root, options) {
|
|
|
4395
4453
|
notFound: options.routing?.notFound
|
|
4396
4454
|
});
|
|
4397
4455
|
}
|
|
4456
|
+
let clientImmutableFiles = [];
|
|
4457
|
+
/**
|
|
4458
|
+
* The generated `_headers` text when this build can skip the Worker for its
|
|
4459
|
+
* hashed files, and the new `wrangler.json` text when it changes; null when
|
|
4460
|
+
* there is no built Worker config. Reads only, so a read failure leaves the
|
|
4461
|
+
* output unchanged.
|
|
4462
|
+
*/
|
|
4463
|
+
function planAssetWorkerBypass(clientDir, assetsDir, userHeaders) {
|
|
4464
|
+
if (!scan || !resolvedConfig || compileOptions.managedDispatch) return null;
|
|
4465
|
+
let wranglerPath;
|
|
4466
|
+
let wrangler;
|
|
4467
|
+
try {
|
|
4468
|
+
const distDir = resolveDistDir(root);
|
|
4469
|
+
wranglerPath = join(distDir, resolveWorkerDirName(distDir), "wrangler.json");
|
|
4470
|
+
wrangler = JSON.parse(readFileSync(wranglerPath, "utf8"));
|
|
4471
|
+
} catch {
|
|
4472
|
+
return null;
|
|
4473
|
+
}
|
|
4474
|
+
const assets = wrangler?.assets;
|
|
4475
|
+
if (!assets || typeof assets !== "object" || typeof assets.directory !== "string" || resolve(dirname(wranglerPath), assets.directory) !== clientDir) return null;
|
|
4476
|
+
const revalidate = options.routing?.revalidate;
|
|
4477
|
+
const facts = {
|
|
4478
|
+
runWorkerFirst: assets.run_worker_first,
|
|
4479
|
+
notFoundHandling: assets.not_found_handling,
|
|
4480
|
+
base: resolvedConfig.base,
|
|
4481
|
+
hasMiddleware: scan.middleware.length > 0,
|
|
4482
|
+
authEnabled: compileOptions.auth !== null,
|
|
4483
|
+
headerRuleCount: compileOptions.headerRules?.length ?? 0,
|
|
4484
|
+
redirectRuleCount: compileOptions.redirectRules?.length ?? 0,
|
|
4485
|
+
fallbackRuleCount: compileOptions.fallbackRules?.length ?? 0,
|
|
4486
|
+
publicEdgeFiles: publicDir !== null && (existsSync(join(publicDir, "_headers")) || existsSync(join(publicDir, "_redirects"))),
|
|
4487
|
+
patterns: [
|
|
4488
|
+
...scan.routes.map((route) => route.pattern),
|
|
4489
|
+
...scan.pages.pages.map((page) => page.pattern),
|
|
4490
|
+
...(scan.websockets ?? []).map((route) => route.pattern),
|
|
4491
|
+
...(options.prerenderPaths ?? []).filter((path) => typeof path === "string"),
|
|
4492
|
+
...revalidate && typeof revalidate === "object" ? Object.keys(revalidate) : []
|
|
4493
|
+
],
|
|
4494
|
+
assetsDir,
|
|
4495
|
+
immutableFiles: clientImmutableFiles
|
|
4496
|
+
};
|
|
4497
|
+
const bypass = userHeaders ? null : resolveAssetWorkerBypass(facts);
|
|
4498
|
+
const runWorkerFirst = bypass?.runWorkerFirst ?? (isAssetBypassRule(assets.run_worker_first, assetsDir) ? ["/**"] : null);
|
|
4499
|
+
return {
|
|
4500
|
+
headers: bypass?.headers ?? null,
|
|
4501
|
+
wranglerPath,
|
|
4502
|
+
wranglerText: runWorkerFirst && JSON.stringify({
|
|
4503
|
+
...wrangler,
|
|
4504
|
+
assets: {
|
|
4505
|
+
...assets,
|
|
4506
|
+
run_worker_first: runWorkerFirst
|
|
4507
|
+
}
|
|
4508
|
+
})
|
|
4509
|
+
};
|
|
4510
|
+
}
|
|
4398
4511
|
const sandboxEntry = options.hasSandbox ? {
|
|
4399
4512
|
bindingName: options.sandboxBindingName,
|
|
4400
4513
|
className: options.sandboxClassName,
|
|
@@ -4449,6 +4562,7 @@ function routingPlugin(root, options) {
|
|
|
4449
4562
|
authClientPath = resolveAuthClientPath(config);
|
|
4450
4563
|
compileOptions.dev = config.command === "serve" && !previewing;
|
|
4451
4564
|
compileOptions.assetsDir = config.build.assetsDir;
|
|
4565
|
+
compileOptions.cloudflareQueueNames = config.command === "build" ? readDeployBuildQueueNames() : void 0;
|
|
4452
4566
|
compileOptions.reactRefresh = config.plugins.some((plugin) => plugin.name === "vite:react-babel" || plugin.name === "vite:react-refresh" || plugin.name === "vite:react-swc");
|
|
4453
4567
|
const resolvedPublicDir = config.publicDir && config.publicDir.length > 0 ? config.publicDir : null;
|
|
4454
4568
|
if (resolvedPublicDir !== publicDir) {
|
|
@@ -4459,26 +4573,39 @@ function routingPlugin(root, options) {
|
|
|
4459
4573
|
config(_, env) {
|
|
4460
4574
|
previewing = env.isPreview === true;
|
|
4461
4575
|
routeEnvironment = env.command === "serve" && !env.isPreview ? "dev" : "prod";
|
|
4576
|
+
const authConfigEnvironmentConfig = routeEnvironment === "dev" ? { environments: { [AUTH_CONFIG_ENVIRONMENT]: {
|
|
4577
|
+
consumer: "server",
|
|
4578
|
+
dev: { createEnvironment: (name, config) => createRunnableDevEnvironment(name, config, {
|
|
4579
|
+
hot: false,
|
|
4580
|
+
runnerOptions: { hmr: false }
|
|
4581
|
+
}) }
|
|
4582
|
+
} } } : {};
|
|
4462
4583
|
compileOptions.hasLive = options.live !== void 0;
|
|
4463
4584
|
compileOptions.managedDispatch = !options.target && env.command === "build" && Boolean(process.env.VOID_DEPLOY_PROJECT_ID);
|
|
4464
|
-
if (env.command === "serve" && options.isAuthEnabled())
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4585
|
+
if (env.command === "serve" && options.isAuthEnabled()) {
|
|
4586
|
+
const resolvedAliases = [
|
|
4587
|
+
"client",
|
|
4588
|
+
"react",
|
|
4589
|
+
"vue",
|
|
4590
|
+
"svelte",
|
|
4591
|
+
"solid"
|
|
4592
|
+
].flatMap((sub) => {
|
|
4593
|
+
try {
|
|
4594
|
+
return [{
|
|
4595
|
+
find: new RegExp(`^better-auth/${sub}$`),
|
|
4596
|
+
replacement: resolveFile(`better-auth/${sub}`)
|
|
4597
|
+
}];
|
|
4598
|
+
} catch {
|
|
4599
|
+
return [];
|
|
4600
|
+
}
|
|
4601
|
+
});
|
|
4602
|
+
return {
|
|
4603
|
+
...authConfigEnvironmentConfig,
|
|
4604
|
+
resolve: { alias: resolvedAliases }
|
|
4605
|
+
};
|
|
4606
|
+
}
|
|
4480
4607
|
const entries = validateSsrEntries(root, paths);
|
|
4481
|
-
if (env.command !== "build") return;
|
|
4608
|
+
if (env.command !== "build") return authConfigEnvironmentConfig;
|
|
4482
4609
|
return { build: {
|
|
4483
4610
|
manifest: entries ? true : _.build?.manifest ?? true,
|
|
4484
4611
|
...entries ? { rollupOptions: { input: entries.client.absolutePath } } : {}
|
|
@@ -4488,42 +4615,71 @@ function routingPlugin(root, options) {
|
|
|
4488
4615
|
order: "post",
|
|
4489
4616
|
handler(_output, bundle) {
|
|
4490
4617
|
const manifest = this.environment.config.build.manifest;
|
|
4491
|
-
if (this.environment.name === "client"
|
|
4618
|
+
if (this.environment.name === "client") clientImmutableFiles = manifest ? stampClientAssetCachePolicy(bundle, typeof manifest === "string" ? manifest : ".vite/manifest.json", compileOptions.headerRules) : [];
|
|
4492
4619
|
}
|
|
4493
4620
|
},
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
if (
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
|
|
4507
|
-
const dialect = getDatabaseDialect(readConfig(root));
|
|
4508
|
-
compileOptions.migrationHandlerPath = resolveFile(dialect === "postgresql" ? "#self/runtime/migration-handler-pg" : dialect === "mysql" ? "#self/runtime/migration-handler-mysql" : "#self/runtime/migration-handler");
|
|
4509
|
-
compileOptions.migrations = migrations;
|
|
4510
|
-
compileOptions.migrationPlanBundle = dialect === "sqlite" ? buildMigrationPlanBundle(migrations) : void 0;
|
|
4621
|
+
writeBundle() {
|
|
4622
|
+
if (!options.assetWorkerBypass || options.target || resolvedConfig?.command !== "build" || this.environment.name !== "client") return;
|
|
4623
|
+
const { outDir, assetsDir } = this.environment.config.build;
|
|
4624
|
+
const clientDir = resolve(resolvedConfig.root, outDir);
|
|
4625
|
+
const headersPath = join(clientDir, "_headers");
|
|
4626
|
+
let generatedHeaders = false;
|
|
4627
|
+
let userHeaders = false;
|
|
4628
|
+
if (existsSync(headersPath)) {
|
|
4629
|
+
try {
|
|
4630
|
+
generatedHeaders = isGeneratedAssetHeaders(readFileSync(headersPath, "utf8"));
|
|
4631
|
+
} catch {
|
|
4632
|
+
return;
|
|
4511
4633
|
}
|
|
4634
|
+
userHeaders = !generatedHeaders;
|
|
4512
4635
|
}
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4636
|
+
const plan = planAssetWorkerBypass(clientDir, assetsDir, userHeaders);
|
|
4637
|
+
if (plan?.headers) writeFileSync(headersPath, plan.headers);
|
|
4638
|
+
else if (generatedHeaders) rmSync(headersPath);
|
|
4639
|
+
if (plan?.wranglerText) writeFileSync(plan.wranglerPath, plan.wranglerText);
|
|
4640
|
+
},
|
|
4641
|
+
buildStart() {
|
|
4642
|
+
return regenerateInOrder(async () => {
|
|
4643
|
+
generatedRouteInputs = void 0;
|
|
4644
|
+
await rescan();
|
|
4645
|
+
if (options.target && (scan?.websockets?.length ?? 0) > 0) throw new Error("routing: WebSocket routes require the default Cloudflare target.");
|
|
4646
|
+
resolveAuthCompileOptions();
|
|
4647
|
+
const nextRouteInputs = routeInputsKey();
|
|
4648
|
+
await writeAuthDatabaseFiles();
|
|
4649
|
+
writeRouteTypes();
|
|
4650
|
+
writeQueueTypes();
|
|
4651
|
+
if (!options.target) {
|
|
4652
|
+
const migrationsDir = paths.migrationsDir;
|
|
4653
|
+
if (existsSync(migrationsDir) || compileOptions.auth) {
|
|
4654
|
+
const { collectMigrations } = await import("./collect-BWhkgtAn.mjs");
|
|
4655
|
+
const { buildMigrationPlanBundle } = await import("./plan-CKX_jWnD.mjs");
|
|
4656
|
+
const migrations = existsSync(migrationsDir) ? collectMigrations(migrationsDir) : [];
|
|
4657
|
+
const dialect = getDatabaseDialect(readConfig(root));
|
|
4658
|
+
compileOptions.migrationHandlerPath = resolveFile(dialect === "postgresql" ? "#self/runtime/migration-handler-pg" : dialect === "mysql" ? "#self/runtime/migration-handler-mysql" : "#self/runtime/migration-handler");
|
|
4659
|
+
compileOptions.migrations = migrations;
|
|
4660
|
+
compileOptions.migrationPlanBundle = dialect === "sqlite" ? buildMigrationPlanBundle(migrations) : void 0;
|
|
4661
|
+
}
|
|
4662
|
+
}
|
|
4663
|
+
if (options.target) writeNodeEntries(options.target);
|
|
4664
|
+
else {
|
|
4665
|
+
const buildConfig = readConfig(root);
|
|
4666
|
+
const merged = collectRevalidate(buildConfig, scan.pages);
|
|
4667
|
+
const configuredRevalidate = buildConfig.routing?.revalidate;
|
|
4668
|
+
const emitIsr = resolvedConfig?.command === "build" && !process.env.VOID_DEPLOY_PROJECT_ID && hasRevalidate(merged);
|
|
4669
|
+
isrRevalidate = emitIsr ? merged : void 0;
|
|
4670
|
+
isrPages = emitIsr ? collectPages(scan.pages, configuredRevalidate) : void 0;
|
|
4671
|
+
isrPathRevalidate = emitIsr && configuredRevalidate && typeof configuredRevalidate === "object" ? configuredRevalidate : void 0;
|
|
4672
|
+
writeWorkerEntry(emitIsr ? {
|
|
4673
|
+
runtimePath: resolveFile("@void/isr/runtime"),
|
|
4674
|
+
queryAllowlist: buildConfig.routing?.revalidateQueryAllowlist
|
|
4675
|
+
} : void 0);
|
|
4676
|
+
}
|
|
4677
|
+
generatedRouteInputs = nextRouteInputs;
|
|
4678
|
+
generatedFiles = generatedFilesSignature();
|
|
4679
|
+
});
|
|
4680
|
+
},
|
|
4681
|
+
watchChange(id) {
|
|
4682
|
+
invalidateSourceAnalysis(id);
|
|
4527
4683
|
},
|
|
4528
4684
|
resolveId: {
|
|
4529
4685
|
filter: { id: RESOLVE_ID_FILTER },
|
|
@@ -4544,44 +4700,79 @@ function routingPlugin(root, options) {
|
|
|
4544
4700
|
if (virtualClient?.[1] === "worker") return compileWorkerClient(getClientAuthPath(id), Boolean(options.target));
|
|
4545
4701
|
if (id !== VIRTUAL_ROUTES_ID) return;
|
|
4546
4702
|
if (this?.environment?.name === "client") throw new Error(`${VIRTUAL_ROUTES_ID} is server-only and cannot be loaded by client code.`);
|
|
4547
|
-
if (!scan) await rescan();
|
|
4703
|
+
if (!scan) await regenerateInOrder(() => rescan());
|
|
4548
4704
|
return compileRouteTable(scan, routesDir, middlewareDir, jobsDir, queuesDir, ssr, compileOptions, getPagesCompileOptions(), isrRevalidate, isrPages, isrPathRevalidate);
|
|
4549
4705
|
}
|
|
4550
4706
|
},
|
|
4707
|
+
hotUpdate() {
|
|
4708
|
+
if (this.environment.name === "void_auth_config") return [];
|
|
4709
|
+
},
|
|
4551
4710
|
configureServer(devServer) {
|
|
4711
|
+
const authEnvironment = devServer.environments[AUTH_CONFIG_ENVIRONMENT];
|
|
4712
|
+
authConfigEnvironment = authEnvironment && isRunnableDevEnvironment(authEnvironment) ? authEnvironment : void 0;
|
|
4552
4713
|
const watcher = devServer.watcher;
|
|
4553
4714
|
const handleFileChange = async (path, event) => {
|
|
4554
4715
|
const normalizedPath = normalizePath(path);
|
|
4555
|
-
|
|
4556
|
-
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4563
|
-
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
if (pageMod) env.moduleGraph.invalidateModule(pageMod);
|
|
4716
|
+
invalidateSourceAnalysis(normalizedPath);
|
|
4717
|
+
const authConfigChanged = isPotentialAuthConfigPath(normalizedPath);
|
|
4718
|
+
if (authConfigChanged) authConfigStale = true;
|
|
4719
|
+
const authImportCreated = event === "add" && authConfigStale && compileOptions.auth !== null;
|
|
4720
|
+
if (!(isInDirectory(normalizedPath, normalizedRoutesDir) || isInDirectory(normalizedPath, normalizedMiddlewareDir) || isInDirectory(normalizedPath, normalizedJobsDir) || isInDirectory(normalizedPath, normalizedQueuesDir) || isInDirectory(normalizedPath, normalizedEmailDir) || isInDirectory(normalizedPath, normalizedPagesDir) || authConfigChanged || authImportCreated || isPotentialEnvFilePath(normalizedPath)) && !ssrEntryAbsPaths.has(normalizedPath)) return;
|
|
4721
|
+
if (await regenerateInOrder(async () => {
|
|
4722
|
+
invalidateSourceAnalysis(normalizedPath);
|
|
4723
|
+
if (event !== "change" || authConfigChanged || isPotentialEnvFilePath(normalizedPath) || ssrEntryAbsPaths.has(normalizedPath)) generatedRouteInputs = void 0;
|
|
4724
|
+
try {
|
|
4725
|
+
await rescan(true);
|
|
4726
|
+
} catch (error) {
|
|
4727
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
4728
|
+
if (!(message.startsWith("pages:") && isInDirectory(normalizedPath, normalizedPagesDir) && (event !== "change" || normalizedPath.endsWith(".md")) && resolvedConfig?.plugins?.some((plugin) => plugin.name.endsWith(":pages")) === true)) devServer.config.logger.error(message, {
|
|
4729
|
+
error: error instanceof Error ? error : void 0,
|
|
4730
|
+
timestamp: true
|
|
4731
|
+
});
|
|
4732
|
+
return;
|
|
4573
4733
|
}
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4734
|
+
resolveAuthCompileOptions();
|
|
4735
|
+
const nextRouteInputs = routeInputsKey();
|
|
4736
|
+
const currentFiles = generatedFilesSignature();
|
|
4737
|
+
const routeInputsChanged = nextRouteInputs !== generatedRouteInputs || currentFiles === void 0 || currentFiles !== generatedFiles;
|
|
4738
|
+
if (routeInputsChanged) generatedRouteInputs = void 0;
|
|
4739
|
+
if (event !== "change" && options.onDevAssetRoutingPolicyChange?.(resolveCurrentAssetRoutingPolicy()) === true) return true;
|
|
4740
|
+
if (routeInputsChanged) {
|
|
4741
|
+
await writeAuthDatabaseFiles();
|
|
4742
|
+
writeRouteTypes();
|
|
4743
|
+
writeQueueTypes();
|
|
4744
|
+
if (options.target) writeNodeEntries(options.target);
|
|
4745
|
+
else writeWorkerEntry(void 0);
|
|
4578
4746
|
}
|
|
4579
|
-
|
|
4580
|
-
|
|
4747
|
+
const structural = event !== "change";
|
|
4748
|
+
const pageManifestChanged = isInDirectory(normalizedPath, normalizedPagesDir) && (structural || normalizedPath.endsWith(".md"));
|
|
4749
|
+
for (const env of Object.values(devServer.environments)) {
|
|
4750
|
+
if (pageManifestChanged) for (const id of PAGE_VIRTUAL_MODULE_IDS) {
|
|
4751
|
+
const pageMod = env.moduleGraph.getModuleById(id);
|
|
4752
|
+
if (pageMod) env.moduleGraph.invalidateModule(pageMod);
|
|
4753
|
+
}
|
|
4754
|
+
const mod = env.moduleGraph.getModuleById(VIRTUAL_ROUTES_ID);
|
|
4755
|
+
if (mod && routeInputsChanged) {
|
|
4756
|
+
env.moduleGraph.invalidateModule(mod);
|
|
4757
|
+
if (structural) env.hot.send({ type: "full-reload" });
|
|
4758
|
+
}
|
|
4759
|
+
}
|
|
4760
|
+
if (/\.island\./.test(normalizedPath) || normalizedPath.endsWith(".md")) devServer.environments.client?.hot.send({ type: "full-reload" });
|
|
4761
|
+
if (routeInputsChanged) {
|
|
4762
|
+
generatedRouteInputs = nextRouteInputs;
|
|
4763
|
+
generatedFiles = generatedFilesSignature();
|
|
4764
|
+
}
|
|
4765
|
+
})) await devServer.restart();
|
|
4581
4766
|
};
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4767
|
+
const onFileChange = (path, event) => handleFileChange(path, event).catch((error) => {
|
|
4768
|
+
devServer.config.logger.error(error instanceof Error ? error.message : String(error), {
|
|
4769
|
+
error: error instanceof Error ? error : void 0,
|
|
4770
|
+
timestamp: true
|
|
4771
|
+
});
|
|
4772
|
+
});
|
|
4773
|
+
watcher.on("add", (path) => onFileChange(path, "add"));
|
|
4774
|
+
watcher.on("change", (path) => onFileChange(path, "change"));
|
|
4775
|
+
watcher.on("unlink", (path) => onFileChange(path, "unlink"));
|
|
4585
4776
|
if (publicDir) {
|
|
4586
4777
|
const redirectsPath = join(publicDir, "_redirects");
|
|
4587
4778
|
const headersPath = join(publicDir, "_headers");
|
|
@@ -4780,19 +4971,22 @@ function mergeWorkerBindings(resolved, input) {
|
|
|
4780
4971
|
vars.__VOID_EMAIL_FROM = config.email.from;
|
|
4781
4972
|
result.vars = vars;
|
|
4782
4973
|
}
|
|
4783
|
-
if (queues.length > 0)
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4974
|
+
if (queues.length > 0) {
|
|
4975
|
+
const cloudflareNames = viteCommand === "build" ? readDeployBuildQueueNames() : void 0;
|
|
4976
|
+
result.queues = {
|
|
4977
|
+
producers: queues.map((q) => ({
|
|
4978
|
+
queue: cloudflareQueueName(q.name, cloudflareNames),
|
|
4979
|
+
binding: q.bindingName
|
|
4980
|
+
})),
|
|
4981
|
+
consumers: queues.map((q) => ({
|
|
4982
|
+
queue: cloudflareQueueName(q.name, cloudflareNames),
|
|
4983
|
+
...q.maxBatchSize != null && { max_batch_size: q.maxBatchSize },
|
|
4984
|
+
...q.maxBatchTimeout != null && { max_batch_timeout: q.maxBatchTimeout },
|
|
4985
|
+
...q.maxRetries != null && { max_retries: q.maxRetries },
|
|
4986
|
+
...q.retryDelay != null && { retry_delay: q.retryDelay }
|
|
4987
|
+
}))
|
|
4988
|
+
};
|
|
4989
|
+
}
|
|
4796
4990
|
if (environmentWebsocketRoutes.length > 0) {
|
|
4797
4991
|
const existingDurableObjectBindings = resolved.durable_objects?.bindings ?? [];
|
|
4798
4992
|
for (const route of environmentWebsocketRoutes) {
|
|
@@ -5413,7 +5607,8 @@ function voidPlugin(options) {
|
|
|
5413
5607
|
},
|
|
5414
5608
|
durableObjects,
|
|
5415
5609
|
websocketTombstones,
|
|
5416
|
-
onDevAssetRoutingPolicyChange: updateDevAssetRoutingPolicy
|
|
5610
|
+
onDevAssetRoutingPolicyChange: updateDevAssetRoutingPolicy,
|
|
5611
|
+
assetWorkerBypass: true
|
|
5417
5612
|
}),
|
|
5418
5613
|
drizzlePlugin(root, true, dialect, {
|
|
5419
5614
|
d1BindingName: bindingNames?.d1,
|