void 1.5.0 → 1.6.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-ChVKPZ-w.mjs → account-cmd-DRhmCWcm.mjs} +3 -3
- package/dist/{application-analysis-2vGZrKzg.mjs → application-analysis-HRFsZOv3.mjs} +3 -3
- package/dist/{application-routing-DnUQoOJD.mjs → application-routing-P4TggvWp.mjs} +1 -1
- package/dist/{auth-link-D4uMdOsw.mjs → auth-link-CVXP1G6G.mjs} +3 -3
- package/dist/{auth-router-62dna450.mjs → auth-router-D1pGdbvB.mjs} +2 -2
- package/dist/{better-auth-shared-CiclgPde.mjs → better-auth-shared-C958aM7W.mjs} +28 -3
- package/dist/{build-cmd-D93K_4Sa.mjs → build-cmd-DmjbuT6d.mjs} +1 -1
- package/dist/{cache-CiIzEED4.mjs → cache-2khBO1MR.mjs} +1 -1
- package/dist/{cancel-deploy-BNoGfn2e.mjs → cancel-deploy-_itbbvY3.mjs} +1 -1
- package/dist/cli/cli.mjs +27 -27
- package/dist/client-CEtr5UOR.mjs +1 -0
- package/dist/{client-Qayy9xEh.mjs → client-CoxPEhJq.mjs} +6 -2
- package/dist/{cloudflare-cmd-DiFGaLow.mjs → cloudflare-cmd-fZ6AMSWk.mjs} +1 -1
- package/dist/{cloudflare-config-Chet188_.mjs → cloudflare-config-eQunqX6A.mjs} +1 -1
- package/dist/{cloudflare-connect-BdgAQBc7.mjs → cloudflare-connect-9OZe4XVQ.mjs} +1 -1
- package/dist/{cloudflare-operations-CWA24vCh.mjs → cloudflare-operations-CrskD4_O.mjs} +4 -4
- package/dist/{cloudflare-operations-D8MoezuN.mjs → cloudflare-operations-oLvAd9Nd.mjs} +1 -1
- package/dist/{config-Bt4rw93x.mjs → config-BBlVXZCU.mjs} +1 -1
- package/dist/{config-DkA9jYF2.mjs → config-BITKQ3O6.mjs} +2 -1
- package/dist/{config-BszFVhpk.mjs → config-BgysUhnm.mjs} +1 -1
- package/dist/{config-CzsNzGVH.d.mts → config-CPxJmt4M.d.mts} +2 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-b9mJbb6X.mjs → connect-CKvmkl2R.mjs} +4 -4
- package/dist/{create-project-rnjum4_V.mjs → create-project-BiMmR5wA.mjs} +1 -1
- package/dist/{create-project-eomwm0wa.mjs → create-project-Bq0M8MtO.mjs} +1 -1
- package/dist/{db-UPWmiSk1.mjs → db-cq5RW4Vy.mjs} +17 -17
- package/dist/{delete-BeeYi1WO.mjs → delete-CY4L8fi2.mjs} +1 -1
- package/dist/deploy-B029oHlE.mjs +2 -0
- package/dist/{deploy-CwmCcTlq.mjs → deploy-D_gEojD2.mjs} +79 -42
- package/dist/{deploy-managed-static-gPDxyp3v.mjs → deploy-managed-static-BHVbB_-A.mjs} +11 -11
- package/dist/{deploy-transport-L6zzPE9T.mjs → deploy-transport-DEyOUfac.mjs} +2 -2
- package/dist/deploy.mjs +5 -4
- package/dist/{dev-inbox-CwH5VuZj.mjs → dev-inbox-CUUS6iUg.mjs} +1 -1
- package/dist/{dispatch-CiJ1Xrba.mjs → dispatch-BNLB5_Gm.mjs} +1 -1
- package/dist/{domain-3xdH9p2L.mjs → domain-BlH90Ods.mjs} +2 -2
- package/dist/{email-Du3YRnM5.mjs → email-Bkq8ZL1p.mjs} +6 -6
- package/dist/{email-cloudflare-CtD8qE13.mjs → email-cloudflare-MvJIxrwx.mjs} +5 -107
- package/dist/{env-Cnvp0pGy.mjs → env-AvuCSeCH.mjs} +2 -2
- package/dist/{gen-BvVmpZ5f.mjs → gen-BD-dfjxY.mjs} +3 -3
- package/dist/gen-CIHXh9I8.mjs +1 -0
- package/dist/{github-cmd-X2GKiLi-.mjs → github-cmd-CA-lBdkn.mjs} +1 -1
- package/dist/{handler-Drm_lyrV.d.mts → handler-BR6Tvjkp.d.mts} +8 -3
- package/dist/{handler-xmzz0U38.mjs → handler-CKeTtYID.mjs} +2 -12
- package/dist/headers-CuTEdP9C.mjs +445 -0
- package/dist/{help-EWDNxST-.mjs → help-1OCFDsRr.mjs} +9 -1
- package/dist/help-Ba8Dq5-r.mjs +1 -0
- package/dist/{inbound-DSKSHDUj.d.mts → inbound-BHt4dIlL.d.mts} +16 -5
- package/dist/{inbound-DQfekMtz.mjs → inbound-CdO-qY0w.mjs} +2 -76
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +65 -37
- package/dist/{info-jW8_d3VI.mjs → info-CJxua_db.mjs} +4 -4
- package/dist/{init-jDQ5G9QC.mjs → init-B-4CluYx.mjs} +12 -11
- package/dist/{isr-config-DhBkzCdY.mjs → isr-config-Czzb4mIq.mjs} +1 -47
- package/dist/{link-DOyxX5Xs.mjs → link-DAXOT-G_.mjs} +2 -2
- package/dist/{list-C9pTYDtl.mjs → list-BYSOo9fm.mjs} +2 -2
- package/dist/{live-CDBHyYiR.d.mts → live-0xrcVpyq.d.mts} +1 -1
- package/dist/{local-d1-CKfek6Z4.mjs → local-d1-BLgsNUj9.mjs} +1 -1
- package/dist/login-BpbYeu-n.mjs +1 -0
- package/dist/{login-koQbjzPd.mjs → login-CJopTWX4.mjs} +2 -2
- package/dist/{logs-cTU5TsRW.mjs → logs-DE0weBsR.mjs} +13 -11
- package/dist/{migrate-C62pGTfr.mjs → migrate-ChHHZBTi.mjs} +3 -3
- package/dist/migrate-HdA6Kh2p.mjs +1 -0
- package/dist/{mime-DKkO7ZtA.mjs → mime-CtP6-qAF.mjs} +143 -15
- package/dist/nitro.mjs +3 -3
- package/dist/{node-BfAt2rz8.mjs → node-CZ6lGNLn.mjs} +1 -1
- package/dist/{operator-cmd-CnAvSqJ5.mjs → operator-cmd-BUqsdk2K.mjs} +28 -10
- package/dist/operator-cmd-wBYyp8iQ.mjs +1 -0
- package/dist/pages/client.d.mts +143 -11
- package/dist/pages/client.mjs +173 -12
- package/dist/pages/index.d.mts +22 -3
- package/dist/pages/index.mjs +18 -4
- package/dist/pages/islands-plugin.d.mts +46 -2
- package/dist/pages/islands-plugin.mjs +91 -5
- package/dist/pages/prefetch.d.mts +2 -2
- package/dist/pages/prefetch.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -2
- package/dist/platform-args-C7XUw9mw.mjs +1 -0
- package/dist/{platform-args-Bv9hoLEL.mjs → platform-args-Cx1M-7bq.mjs} +18 -4
- package/dist/{platform-auth-config-CLj0EvnB.mjs → platform-auth-config-K4m_LE8b.mjs} +4 -4
- package/dist/{platform-auth-protection-DQDSxVhr.mjs → platform-auth-protection-KF5Vo-1I.mjs} +2 -2
- package/dist/{platform-auth-recovery-DD3oLerq.mjs → platform-auth-recovery-BOdFrl7R.mjs} +2 -2
- package/dist/{platform-cmd-WnOmdLzR.mjs → platform-cmd-DpCHawGF.mjs} +1 -1
- package/dist/{platform-cmd-PLNLg-2N.mjs → platform-cmd-Ds3EAV5t.mjs} +5 -4
- package/dist/{platform-domain-Bnq0vg0q.mjs → platform-domain-rWJshybd.mjs} +2 -2
- package/dist/{platform-lifecycle-BQiN9HN5.mjs → platform-lifecycle-BH34I0rh.mjs} +1 -1
- package/dist/{platform-lifecycle-BCsFg1Tl.mjs → platform-lifecycle-D9RdGub1.mjs} +66 -31
- package/dist/{platform-management-nzCDwtiN.mjs → platform-management-BRefdHGD.mjs} +21 -3
- package/dist/{platform-management-CMJR8Zi-.mjs → platform-management-BfLW0Zlo.mjs} +1 -1
- package/dist/{platform-recovery-DBNoME3I.mjs → platform-recovery-DZuZGJtt.mjs} +2 -2
- package/dist/platform-runtime-logs-CdJGnk3f.mjs +68 -0
- package/dist/{platform-setup-VEcHu0Vq.mjs → platform-setup-Vw1AaUN8.mjs} +15 -2
- package/dist/{plugin-inference-DmwjC3y2.mjs → plugin-inference-CdLbxZL_.mjs} +1 -1
- package/dist/{prefetch-L93_1Jk7.mjs → prefetch-Dx2jIbtg.mjs} +19 -1
- package/dist/{prefetch-CG0K6JPd.d.mts → prefetch-NdNeubbH.d.mts} +7 -1
- package/dist/{prepare-pfl2LIMy.mjs → prepare-BJW-f1f1.mjs} +4 -4
- package/dist/{prepare-BPsfLWaW.mjs → prepare-BMGeKL16.mjs} +1 -1
- package/dist/prepare-BdxJJCMv.mjs +1 -0
- package/dist/{project-cmd-5Izu4Pg3.mjs → project-cmd-B_bUyZ3J.mjs} +15 -15
- package/dist/{project-team-DSUyjZFh.mjs → project-team-MjT5K4rQ.mjs} +1 -1
- package/dist/{project-token-wj09YQSB.mjs → project-token-BKHGwY3k.mjs} +1 -1
- package/dist/{project-zero-trust-BMHf2YF0.mjs → project-zero-trust-Bzdd05-h.mjs} +1 -1
- package/dist/{protocol-0-lp9ZYx.mjs → protocol-COyySMki.mjs} +130 -107
- package/dist/{protocol-xdrl-In0.d.mts → protocol-CkwjASep.d.mts} +2 -2
- package/dist/{provision-CRiNnlfE.mjs → provision-BbCzpbXs.mjs} +1 -1
- package/dist/{provision-CxHIGBIZ.mjs → provision-DQF6Kw-6.mjs} +1 -1
- package/dist/{requests-DicgB5jU.mjs → requests-daJmVpjk.mjs} +1 -1
- package/dist/{rollback-DrDZOKNE.mjs → rollback-BgL0wY1J.mjs} +2 -2
- package/dist/{route-types-irZc1txT.mjs → route-types-CZc1YXjF.mjs} +40 -4
- package/dist/route-url-C_YIH_zO.d.mts +37 -0
- package/dist/routes-stub.d.mts +6 -2
- 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/email/testing.d.mts +1 -1
- package/dist/runtime/email/testing.mjs +3 -3
- package/dist/runtime/email.d.mts +1 -1
- package/dist/runtime/email.mjs +3 -3
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +2 -2
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/route-url.d.mts +2 -2
- package/dist/runtime/routing.d.mts +3 -3
- package/dist/runtime/routing.mjs +37 -16
- 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-DSQtH3oS.mjs → scan-X2rDDRNa.mjs} +18 -10
- package/dist/{secret-C_QtTzJG.mjs → secret-CPq-B_vp.mjs} +2 -2
- package/dist/{static-asset-marker-NR1XS2z5.mjs → static-asset-marker-DsQKz6lt.mjs} +8 -1
- package/dist/validation-error-uAAjlsiW.mjs +82 -0
- package/dist/{version-metadata-Blf5H9BQ.mjs → version-metadata-C8hLzQkv.mjs} +1 -1
- package/dist/{wrangler-p-kLCJqF.mjs → wrangler-DESSbN8L.mjs} +2 -2
- package/dist/wrangler-DUB3MGHV.mjs +1 -0
- package/dist/{wrapper-iejSJDwL.mjs → wrapper-C9SUxoj7.mjs} +2 -2
- package/dist/{ws-DzBD-NUj.d.mts → ws-Dmjg5NH2.d.mts} +1 -1
- package/docs/guide/edge/headers.md +2 -0
- package/docs/guide/edge/rewrites.md +1 -1
- package/docs/guide/email/receiving.md +1 -1
- package/docs/guide/email/sending.md +42 -12
- package/docs/guide/pages-routing/actions-and-forms.md +21 -1
- package/docs/guide/pages-routing/islands.md +3 -3
- package/docs/guide/pages-routing/layouts.md +16 -2
- package/docs/guide/pages-routing/loaders.md +2 -2
- package/docs/guide/pages-routing/markdown.md +1 -1
- package/docs/guide/pages-routing/overview.md +103 -0
- package/docs/guide/platform/administration/connected-apps.md +4 -2
- package/docs/guide/platform/installation/credentials.md +6 -4
- package/docs/guide/platform/installation/maintenance.md +13 -0
- package/docs/guide/platform/installation/setup.md +22 -1
- package/docs/guide/ssg.md +3 -3
- package/docs/guide/type-safety.md +42 -1
- package/docs/integrations/frameworks/astro.md +17 -12
- package/docs/integrations/frameworks/overview.md +2 -2
- package/docs/reference/api/pages.md +101 -50
- package/docs/reference/api/rewrites.md +4 -1
- package/docs/reference/api/types.md +14 -10
- package/docs/reference/api.md +1 -1
- package/docs/reference/cli/platform-installation.md +4 -1
- package/docs/reference/cli/setup.md +1 -1
- package/docs/reference/config.md +10 -0
- package/package.json +8 -7
- package/schema.json +4 -0
- package/skills/void/SKILL.md +5 -0
- package/dist/client-DVtAKeUm.mjs +0 -1
- package/dist/deploy-CfU7CR-b.mjs +0 -2
- package/dist/gen-i61rdQgg.mjs +0 -1
- package/dist/headers-DEUBAM6W.mjs +0 -225
- package/dist/help-BcZDUcTw.mjs +0 -1
- package/dist/login-C0MiQrYs.mjs +0 -1
- package/dist/migrate-BG09-KOv.mjs +0 -1
- package/dist/operator-cmd-BhHXIL2G.mjs +0 -1
- package/dist/platform-args-C1kqYUen.mjs +0 -1
- package/dist/prepare-BJMmfq3W.mjs +0 -1
- package/dist/route-url-BGOiyKNz.d.mts +0 -24
- package/dist/validation-error-rDVbUJet.mjs +0 -47
- package/dist/wrangler-CPRX2d9A.mjs +0 -1
|
@@ -1,51 +1,52 @@
|
|
|
1
1
|
import { n as __toESM, t as __commonJSMin } from "./rolldown-runtime-uD8oG6U2.mjs";
|
|
2
2
|
import { a as join, c as resolve, n as dirname, o as normalize, r as extname, s as relative, t as basename } from "./dist-DMYe8CZJ.mjs";
|
|
3
3
|
import { t as require_picocolors } from "./picocolors-D1NxSLw-.mjs";
|
|
4
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
4
|
+
import { r as detectFramework } from "./plugin-inference-CdLbxZL_.mjs";
|
|
5
5
|
import { n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-CdGv9Tmi.mjs";
|
|
6
|
-
import { m as resolveBindingNames, p as readConfig, u as isNodeTarget } from "./config-
|
|
7
|
-
import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, o as requiresSandboxPlatformImage, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync } from "./application-analysis-
|
|
6
|
+
import { m as resolveBindingNames, p as readConfig, r as convertHeadersConfig, u as isNodeTarget } from "./config-BITKQ3O6.mjs";
|
|
7
|
+
import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, o as requiresSandboxPlatformImage, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync } from "./application-analysis-HRFsZOv3.mjs";
|
|
8
8
|
import { t as collectMigrations } from "./collect-C6Blu9yw.mjs";
|
|
9
9
|
import { o as validateSsrEntry } from "./entry-CBZsCy3O.mjs";
|
|
10
10
|
import { r as hasEmailHandlers } from "./email-BHY72ixO.mjs";
|
|
11
|
-
import {
|
|
11
|
+
import { c as VOID_INTERNAL_WORKER_FIRST, d as hasDocumentRoutes, f as resolveAssetConfig, i as readGeneratedAssetHeadersFile, l as edgeRulesNeedWorker, u as hasApiRoutes } from "./headers-CuTEdP9C.mjs";
|
|
12
12
|
import { t as writeFileAtomic } from "./atomic-write-DA6eD1Kp.mjs";
|
|
13
13
|
import { s as listPlatformConnections } from "./platform-registry-DZ_2Xuqd.mjs";
|
|
14
14
|
import { c as writeDeploymentPlatform, n as readDeploymentPlatform, r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
15
15
|
import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-CoDaaFsA.mjs";
|
|
16
|
-
import { a as persistCloudflareConfig, c as stashCloudflareDeployPointer, i as materializeCloudflareConfig } from "./cloudflare-config-
|
|
17
|
-
import { A as syncWranglerWebSockets, C as readWranglerManagedQueueCleanupCandidates, D as sameMigrationsDir, E as resolveLiveBindingConfig, L as writeVoidProjectConfig, M as writeProvisionedWranglerConfig, N as writeWranglerPublishedTrafficSnapshot, a as LIVE_MIGRATION_TAG, c as bindingEntriesForField, h as nextDurableObjectMigrationTag, k as syncWranglerDurableObjects, m as hasDurableObjectSqliteMigration, o as acknowledgeWranglerManagedQueueRemovals, r as FRIENDLY_BINDING_NAMES, v as readExistingLiveBindingConfig, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-
|
|
16
|
+
import { a as persistCloudflareConfig, c as stashCloudflareDeployPointer, i as materializeCloudflareConfig } from "./cloudflare-config-eQunqX6A.mjs";
|
|
17
|
+
import { A as syncWranglerWebSockets, C as readWranglerManagedQueueCleanupCandidates, D as sameMigrationsDir, E as resolveLiveBindingConfig, L as writeVoidProjectConfig, M as writeProvisionedWranglerConfig, N as writeWranglerPublishedTrafficSnapshot, a as LIVE_MIGRATION_TAG, c as bindingEntriesForField, h as nextDurableObjectMigrationTag, k as syncWranglerDurableObjects, m as hasDurableObjectSqliteMigration, o as acknowledgeWranglerManagedQueueRemovals, r as FRIENDLY_BINDING_NAMES, v as readExistingLiveBindingConfig, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-DESSbN8L.mjs";
|
|
18
18
|
import { r as trustedCloudflareWorkerAccessHeaders, t as cfAccessHeaders } from "./cf-access-pejlJmuy.mjs";
|
|
19
19
|
import { t as ensurePlatformAccessToken } from "./cf-access-BmBT2h8_.mjs";
|
|
20
20
|
import { a as getApiUrl, c as getToken, l as getTokenSource } from "./auth-Dy8svcqQ.mjs";
|
|
21
21
|
import { n as record, t as migrateBuiltWranglerConfig } from "./cf-config-migrate-Dy8MrKgF.mjs";
|
|
22
22
|
import { l as resolveRemoteMode, n as CLOUDFLARE_QUEUE_NAMES_BUILD_ENV, t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-CuzZZyjB.mjs";
|
|
23
|
-
import { i as otherQueueConsumers, n as chooseCloudflareQueueName, o as scopedCloudflareQueueName, r as cloudflareQueueName } from "./dispatch-
|
|
23
|
+
import { i as otherQueueConsumers, n as chooseCloudflareQueueName, o as scopedCloudflareQueueName, r as cloudflareQueueName } from "./dispatch-BNLB5_Gm.mjs";
|
|
24
|
+
import { a as resolveDistDir, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate } from "./isr-config-Czzb4mIq.mjs";
|
|
24
25
|
import { t as assertNoPrerenderFailures } from "./prerender-render-RlAj6hh8.mjs";
|
|
25
|
-
import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-
|
|
26
|
-
import { a as emailConfigInputs, c as renderAddressMap, d as
|
|
27
|
-
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-
|
|
26
|
+
import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-C8hLzQkv.mjs";
|
|
27
|
+
import { a as emailConfigInputs, c as renderAddressMap, d as collectPrerenderPathsNode, f as prerenderPages, i as createNodeEmailDns, l as renderEmailChecklist, n as SEND_EMAIL_BINDING, o as preflightEmail, p as prerenderPagesNode, r as applyEmailSetup, t as EMAIL_FROM_VAR, u as collectPrerenderPaths } from "./email-cloudflare-MvJIxrwx.mjs";
|
|
28
|
+
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-P4TggvWp.mjs";
|
|
28
29
|
import { n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-B1C8U83u.mjs";
|
|
29
30
|
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-Ddzl-IwT.mjs";
|
|
30
31
|
import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
31
32
|
import { r as getPackageDir } from "./agents-DRo8gzni.mjs";
|
|
32
|
-
import { a as isExpiredTokenError, r as PlatformClient } from "./client-
|
|
33
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-CoxPEhJq.mjs";
|
|
33
34
|
import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-BCdLioKP.mjs";
|
|
34
35
|
import { t as getRequestedProjectSlug } from "./resolve-project-D0YNnJfm.mjs";
|
|
35
36
|
import { i as safePositional, r as readCfUploadOutput, t as CF_VERSION_SOURCE_MAX_OUTPUT_BYTES } from "./cf-command-values-Ccl-zRhl.mjs";
|
|
36
37
|
import { a as FRAMEWORK_PRESETS, c as hasBackendFiles, i as isCleanCloudflareExit, l as resolveCloudflareOperationArgv, o as detectPreset, s as formatProjectCommand, t as createCloudflareProcessRunner, u as resolveProjectCommand } from "./cloudflare-process-DjJ638A-.mjs";
|
|
37
38
|
import { f as listSelfHostSecretNames, h as selfHostSchemaFailureMessage, i as SelfHostSecretListError, l as dischargeSelfHostEnvContext, n as SelfHostFirstDeployError, p as readEmittedWorkerVars, r as SelfHostSchemaError, s as deriveSelfHostEnvContextFromVars, t as SelfHostEnvValidationError } from "./env-validation-GV1oD4EV.mjs";
|
|
38
|
-
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-
|
|
39
|
-
import { A as promptDeployProjectConfig, C as ensureManagedHyperdrive, D as hasNonPageBackend, E as getGitCommit, F as resolveStaticBuildCommand, I as resolveStaticDeployPreset, L as toManifestSchedulesAndQueues, M as resolveDeployWorkerMain, N as resolveDeployWranglerCompat, O as hasPrerenderSources, P as resolveFullDeployBuildCommand, R as validateDeployMigrations, S as createProjectFromSlug, T as getExitCode, _ as getDeploySchemaDriftMessage, a as collectAndHashAssets, b as assertProjectDeployAccess, c as readWranglerHtmlHandling, d as printDeploySuccess, f as mergeAndLintRoutingRules, g as assertDeploySchemaDriftFree, h as warnUnpublishedRouting, i as buildStaticManifest, j as resolveDeployLiveBindingConfig, k as log$1, l as formatDeploySummary, m as warnIgnoredNotFoundForFramework, n as runStaticDeploy, o as collectWorkerFiles, p as streamDirectR2Deploy, r as buildFrameworkManifest, s as detectNonSpaFallbackWarning, t as assembleVoidManifest, u as printDeployContext, v as hasDeploySchemaDrift, w as generateDeployWrapperIfNeeded, x as assertWorkerMainUploaded, y as assertEnvSchemaValid } from "./deploy-managed-static-
|
|
40
|
-
import { a as checkCloudflareProvisionDrift, b as resolveWorkersDevComplianceRegion, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-
|
|
41
|
-
import { c as scrubWranglerAuthCredentials, n as buildSchemaProbeEnv, o as resolveDeployTransport, r as deployChildEnv, s as scrubManagedDeployBuildMarkers, t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-
|
|
39
|
+
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-C9SUxoj7.mjs";
|
|
40
|
+
import { A as promptDeployProjectConfig, C as ensureManagedHyperdrive, D as hasNonPageBackend, E as getGitCommit, F as resolveStaticBuildCommand, I as resolveStaticDeployPreset, L as toManifestSchedulesAndQueues, M as resolveDeployWorkerMain, N as resolveDeployWranglerCompat, O as hasPrerenderSources, P as resolveFullDeployBuildCommand, R as validateDeployMigrations, S as createProjectFromSlug, T as getExitCode, _ as getDeploySchemaDriftMessage, a as collectAndHashAssets, b as assertProjectDeployAccess, c as readWranglerHtmlHandling, d as printDeploySuccess, f as mergeAndLintRoutingRules, g as assertDeploySchemaDriftFree, h as warnUnpublishedRouting, i as buildStaticManifest, j as resolveDeployLiveBindingConfig, k as log$1, l as formatDeploySummary, m as warnIgnoredNotFoundForFramework, n as runStaticDeploy, o as collectWorkerFiles, p as streamDirectR2Deploy, r as buildFrameworkManifest, s as detectNonSpaFallbackWarning, t as assembleVoidManifest, u as printDeployContext, v as hasDeploySchemaDrift, w as generateDeployWrapperIfNeeded, x as assertWorkerMainUploaded, y as assertEnvSchemaValid } from "./deploy-managed-static-BHVbB_-A.mjs";
|
|
41
|
+
import { a as checkCloudflareProvisionDrift, b as resolveWorkersDevComplianceRegion, d as isQueueConfirmedAbsent, f as isRealD1Id, g as provisionCloudflareResources, i as assertValidResourceName, m as isRealKvId, s as deleteEnvVarCaseAware } from "./provision-BbCzpbXs.mjs";
|
|
42
|
+
import { c as scrubWranglerAuthCredentials, n as buildSchemaProbeEnv, o as resolveDeployTransport, r as deployChildEnv, s as scrubManagedDeployBuildMarkers, t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-DEyOUfac.mjs";
|
|
42
43
|
import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareWorkerSettings } from "./cf-worker-settings-CARs4Wy9.mjs";
|
|
43
44
|
import { t as sanitizeTerminalLogText } from "./terminal-log-text-DNsWJREL.mjs";
|
|
44
|
-
import { t as promptForLoginToken } from "./login-
|
|
45
|
+
import { t as promptForLoginToken } from "./login-CJopTWX4.mjs";
|
|
45
46
|
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-CEu-1Ps_.mjs";
|
|
46
|
-
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-
|
|
47
|
+
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-CrskD4_O.mjs";
|
|
47
48
|
import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from "./sqlite-validation-CLJXXN93.mjs";
|
|
48
|
-
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-
|
|
49
|
+
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-ChHHZBTi.mjs";
|
|
49
50
|
import { a as runMySqlMigrations } from "./runner-mysql-Bdmsp_x4.mjs";
|
|
50
51
|
import { i as runPgMigrations } from "./runner-pg-mYc75KfH.mjs";
|
|
51
52
|
import { t as collectGitDeployMetadata } from "./git-metadata-Cukp5kV5.mjs";
|
|
@@ -2495,15 +2496,7 @@ async function ensureContainerApplications(options) {
|
|
|
2495
2496
|
* uploads. A user-authored `_headers` is not sent on this path.
|
|
2496
2497
|
*/
|
|
2497
2498
|
function readGeneratedAssetHeaders(output) {
|
|
2498
|
-
|
|
2499
|
-
let text;
|
|
2500
|
-
try {
|
|
2501
|
-
text = readFileSync(join(getWorkerAssetsDir(output.directory), "_headers"), "utf8");
|
|
2502
|
-
} catch (cause) {
|
|
2503
|
-
if (cause instanceof Error && "code" in cause && cause.code === "ENOENT") return;
|
|
2504
|
-
throw cause;
|
|
2505
|
-
}
|
|
2506
|
-
return isGeneratedAssetHeaders(text) ? text : void 0;
|
|
2499
|
+
return output.assetsDirectory ? readGeneratedAssetHeadersFile(getWorkerAssetsDir(output.directory)) : void 0;
|
|
2507
2500
|
}
|
|
2508
2501
|
async function uploadAssets(options) {
|
|
2509
2502
|
if (!options.output.assetsDirectory) return;
|
|
@@ -3772,6 +3765,57 @@ async function resolveCloudflareVoidStaticPreset(root, voidConfig) {
|
|
|
3772
3765
|
appType: "static"
|
|
3773
3766
|
};
|
|
3774
3767
|
}
|
|
3768
|
+
/**
|
|
3769
|
+
* Route a static deploy around its thin edge Worker. Without edge rules that
|
|
3770
|
+
* Worker only answers `/__void/ready`, so Cloudflare serves every other request
|
|
3771
|
+
* from assets without starting it. The Void-generated `_headers` is not such a
|
|
3772
|
+
* rule: it only marks fingerprinted files immutable, which Cloudflare applies
|
|
3773
|
+
* itself. Any other rule keeps the Worker in front of every request.
|
|
3774
|
+
*/
|
|
3775
|
+
function planStaticEdgeRouting(options) {
|
|
3776
|
+
const generatedHeaders = readGeneratedAssetHeadersFile(options.outputDir);
|
|
3777
|
+
const merged = mergeAndLintRoutingRules(options.outputDir, options.routing);
|
|
3778
|
+
const manifest = buildStaticManifest({
|
|
3779
|
+
appType: options.appType,
|
|
3780
|
+
alwaysUseHttps: options.routing?.alwaysUseHttps,
|
|
3781
|
+
hashedAssetsPrefix: "assets",
|
|
3782
|
+
headerRules: merged.headerRules,
|
|
3783
|
+
redirectRules: merged.redirectRules,
|
|
3784
|
+
fallbackRules: merged.fallbackRules,
|
|
3785
|
+
notFound: options.routing?.notFound,
|
|
3786
|
+
html_handling: options.htmlHandling
|
|
3787
|
+
});
|
|
3788
|
+
const assetConfig = manifest.assetConfig ?? { not_found_handling: "none" };
|
|
3789
|
+
const entry = {
|
|
3790
|
+
alwaysUseHttps: manifest.alwaysUseHttps,
|
|
3791
|
+
headerRules: manifest.headerRules,
|
|
3792
|
+
redirectRules: manifest.redirectRules,
|
|
3793
|
+
fallbackRules: manifest.fallbackRules
|
|
3794
|
+
};
|
|
3795
|
+
const userHeaderRules = generatedHeaders === void 0 ? entry.headerRules : convertHeadersConfig(options.routing?.headers);
|
|
3796
|
+
if (edgeRulesNeedWorker({
|
|
3797
|
+
...entry,
|
|
3798
|
+
headerRules: userHeaderRules
|
|
3799
|
+
})) return {
|
|
3800
|
+
assetConfig: {
|
|
3801
|
+
...assetConfig,
|
|
3802
|
+
run_worker_first: true
|
|
3803
|
+
},
|
|
3804
|
+
entry,
|
|
3805
|
+
assetHeaders: void 0
|
|
3806
|
+
};
|
|
3807
|
+
return {
|
|
3808
|
+
assetConfig: {
|
|
3809
|
+
...assetConfig,
|
|
3810
|
+
run_worker_first: [...VOID_INTERNAL_WORKER_FIRST]
|
|
3811
|
+
},
|
|
3812
|
+
entry: {
|
|
3813
|
+
...entry,
|
|
3814
|
+
headerRules: void 0
|
|
3815
|
+
},
|
|
3816
|
+
assetHeaders: generatedHeaders
|
|
3817
|
+
};
|
|
3818
|
+
}
|
|
3775
3819
|
async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliLog, deps, initialCloudflareLink, initialCloudflareCandidate) {
|
|
3776
3820
|
const exit = deps.exit ?? ((code) => process.exit(code));
|
|
3777
3821
|
const configPath = discoverRootWranglerConfig(root);
|
|
@@ -3829,16 +3873,11 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3829
3873
|
log$1.error(["deploy: the root Wrangler config changed during the static build.", "Refusing to upload a config rewritten by project build code. Restore the config and retry."].join("\n"));
|
|
3830
3874
|
return exit(1);
|
|
3831
3875
|
}
|
|
3832
|
-
const
|
|
3833
|
-
|
|
3876
|
+
const edgeRouting = planStaticEdgeRouting({
|
|
3877
|
+
outputDir: preset.outputDir,
|
|
3834
3878
|
appType: preset.appType,
|
|
3835
|
-
|
|
3836
|
-
|
|
3837
|
-
headerRules: merged.headerRules,
|
|
3838
|
-
redirectRules: merged.redirectRules,
|
|
3839
|
-
fallbackRules: merged.fallbackRules,
|
|
3840
|
-
notFound: voidConfig.routing?.notFound,
|
|
3841
|
-
html_handling: readWranglerHtmlHandling(rootConfig)
|
|
3879
|
+
routing: voidConfig.routing,
|
|
3880
|
+
htmlHandling: readWranglerHtmlHandling(rootConfig)
|
|
3842
3881
|
});
|
|
3843
3882
|
const entryPath = join(root, ".void", "deploy", "cloudflare", "static-edge.mjs");
|
|
3844
3883
|
mkdirSync(dirname(entryPath), { recursive: true });
|
|
@@ -3851,7 +3890,7 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3851
3890
|
main: relative(dirname(staticConfigPath), entryPath),
|
|
3852
3891
|
assetsDirectory: relative(dirname(staticConfigPath), preset.outputDir),
|
|
3853
3892
|
compatibilityDate: voidConfig.worker?.compatibility_date ?? readWranglerTopLevelString(rootConfig, "compatibility_date") ?? DEFAULT_COMPATIBILITY_DATE,
|
|
3854
|
-
assetConfig:
|
|
3893
|
+
assetConfig: edgeRouting.assetConfig
|
|
3855
3894
|
});
|
|
3856
3895
|
deduplicateGeneratedCompatibilityFlags(staticConfigPath, configPath);
|
|
3857
3896
|
const staticConfig = parseRootWranglerConfig(staticConfigPath);
|
|
@@ -3865,17 +3904,15 @@ async function runCloudflareStaticDeploy(root, options, voidConfig, preset, cliL
|
|
|
3865
3904
|
}, null, 2)}\n`, { mode: 384 });
|
|
3866
3905
|
writeFileSync(entryPath, renderCloudflareStaticEntry({
|
|
3867
3906
|
runtimeImport: "void/edge",
|
|
3868
|
-
|
|
3869
|
-
headerRules: manifest.headerRules,
|
|
3870
|
-
redirectRules: manifest.redirectRules,
|
|
3871
|
-
fallbackRules: manifest.fallbackRules,
|
|
3907
|
+
...edgeRouting.entry,
|
|
3872
3908
|
versionMetadataBinding
|
|
3873
3909
|
}));
|
|
3874
3910
|
if (existingWorker) assertExistingCloudflareConfig(existingWorker, parseRootWranglerConfig(staticConfigPath), true);
|
|
3875
3911
|
const stagedAssetsDirectory = join(root, ".void", "deploy", "cloudflare", "assets");
|
|
3876
3912
|
stageCloudflareStaticAssets({
|
|
3877
3913
|
sourceDirectory: preset.outputDir,
|
|
3878
|
-
destinationDirectory: stagedAssetsDirectory
|
|
3914
|
+
destinationDirectory: stagedAssetsDirectory,
|
|
3915
|
+
headers: edgeRouting.assetHeaders
|
|
3879
3916
|
});
|
|
3880
3917
|
const queueConsumerCleanup = readWranglerManagedQueueCleanupCandidates(configPath);
|
|
3881
3918
|
assertCloudflareDeployTargetUnchanged({
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
import { a as join, c as resolve, n as dirname, r as extname, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
-
import { h as needsApplicationDatabase } from "./plugin-inference-
|
|
2
|
+
import { h as needsApplicationDatabase } from "./plugin-inference-CdLbxZL_.mjs";
|
|
3
3
|
import { n as readProjectPaths } from "./project-paths-CdGv9Tmi.mjs";
|
|
4
4
|
import { t as discoverSchema } from "./discover-Dhkzxgdt.mjs";
|
|
5
|
-
import { u as isNodeTarget } from "./config-
|
|
5
|
+
import { u as isNodeTarget } from "./config-BITKQ3O6.mjs";
|
|
6
6
|
import { t as collectMigrations } from "./collect-C6Blu9yw.mjs";
|
|
7
|
-
import {
|
|
8
|
-
import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-DEUBAM6W.mjs";
|
|
7
|
+
import { n as mergeRoutingRules, t as lintRoutingPhases } from "./headers-CuTEdP9C.mjs";
|
|
9
8
|
import { s as shouldLinkDeployProject, t as attachSelectedPlatform, u as writeProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
10
|
-
import { E as resolveLiveBindingConfig, O as syncWranglerBindings, a as LIVE_MIGRATION_TAG, g as normalizeWranglerCompatibilityFlags, u as ensureWranglerCompat, v as readExistingLiveBindingConfig } from "./wrangler-
|
|
9
|
+
import { E as resolveLiveBindingConfig, O as syncWranglerBindings, a as LIVE_MIGRATION_TAG, g as normalizeWranglerCompatibilityFlags, u as ensureWranglerCompat, v as readExistingLiveBindingConfig } from "./wrangler-DESSbN8L.mjs";
|
|
11
10
|
import { n as buildMigrationPlanBundle } from "./plan-BOD70XGS.mjs";
|
|
12
11
|
import { l as getTokenSource } from "./auth-Dy8svcqQ.mjs";
|
|
13
12
|
import { t as findEnvFile } from "./env-types-DqzVBKnS.mjs";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { i as collectFiles, t as collectPages } from "./isr-config-Czzb4mIq.mjs";
|
|
14
|
+
import { a as buildEnv } from "./version-metadata-C8hLzQkv.mjs";
|
|
15
|
+
import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BBlVXZCU.mjs";
|
|
16
16
|
import { i as validateMigrations, r as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-Ddzl-IwT.mjs";
|
|
17
17
|
import { L as log$1, N as intro, X as text, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
18
18
|
import { t as formatCloudflareUserMessage } from "./cloudflare-user-output-zEwuGrEJ.mjs";
|
|
19
|
-
import { c as platformErrorMessage, i as isCliOutdatedError, n as PlatformApiError, o as isHeadersTimeoutError, s as parsePlatformErrorBody } from "./client-
|
|
19
|
+
import { c as platformErrorMessage, i as isCliOutdatedError, n as PlatformApiError, o as isHeadersTimeoutError, s as parsePlatformErrorBody } from "./client-CoxPEhJq.mjs";
|
|
20
20
|
import { f as import_picocolors, h as sanitizeTerminalText, m as printSuccess, o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-BCdLioKP.mjs";
|
|
21
|
-
import { a as promptProjectSelection, i as reportProjectCreationWarnings, o as promptProjectSetupAction, r as promptAndCreateProject } from "./create-project-
|
|
21
|
+
import { a as promptProjectSelection, i as reportProjectCreationWarnings, o as promptProjectSetupAction, r as promptAndCreateProject } from "./create-project-Bq0M8MtO.mjs";
|
|
22
22
|
import { o as detectPreset, s as formatProjectCommand, u as resolveProjectCommand } from "./cloudflare-process-DjJ638A-.mjs";
|
|
23
23
|
import { d as formatEnvReport, g as validateProdEnv, u as fetchRemoteSecretNames } from "./env-validation-GV1oD4EV.mjs";
|
|
24
|
-
import { a as needsWrapper, i as generateWrapper } from "./wrapper-
|
|
24
|
+
import { a as needsWrapper, i as generateWrapper } from "./wrapper-C9SUxoj7.mjs";
|
|
25
25
|
import { n as drizzleKitBin } from "./yarn-pnp-DgWbE7z5.mjs";
|
|
26
|
-
import { t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-
|
|
26
|
+
import { t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-DEyOUfac.mjs";
|
|
27
27
|
import { cpSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync } from "node:fs";
|
|
28
28
|
import { createDeployArtifact, createDeployUploadPayload } from "@void/deploy-core";
|
|
29
29
|
import { createHash } from "node:crypto";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as join } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { n as scanWranglerDotenvKeys } from "./dotenv-CEI8hapP.mjs";
|
|
3
3
|
import { t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-CuzZZyjB.mjs";
|
|
4
|
-
import { i as WRANGLER_AUTH_CREDENTIAL_ENV_VARS, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-
|
|
5
|
-
import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-
|
|
4
|
+
import { i as WRANGLER_AUTH_CREDENTIAL_ENV_VARS, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-C8hLzQkv.mjs";
|
|
5
|
+
import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-BbCzpbXs.mjs";
|
|
6
6
|
import { readWranglerTopLevelString } from "@void/deploy-cloudflare";
|
|
7
7
|
// src/cli/deploy-transport.ts
|
|
8
8
|
/**
|
package/dist/deploy.mjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { a as join, c as resolve } from "./dist-DMYe8CZJ.mjs";
|
|
2
|
-
import { p as readConfig, u as isNodeTarget } from "./config-
|
|
2
|
+
import { p as readConfig, u as isNodeTarget } from "./config-BITKQ3O6.mjs";
|
|
3
3
|
import { o as validateSsrEntry } from "./entry-CBZsCy3O.mjs";
|
|
4
4
|
import { r as hasEmailHandlers } from "./email-BHY72ixO.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { d as hasDocumentRoutes, f as resolveAssetConfig, u as hasApiRoutes } from "./headers-CuTEdP9C.mjs";
|
|
6
|
+
import { a as resolveDistDir, n as collectRevalidate, o as resolveWorkerDirName } from "./isr-config-Czzb4mIq.mjs";
|
|
7
|
+
import { t as analyzeApplication } from "./application-routing-P4TggvWp.mjs";
|
|
7
8
|
import { t as prepareCfBuildOutput$1 } from "./cf-build-output-B1C8U83u.mjs";
|
|
8
9
|
import { o as detectPreset } from "./cloudflare-process-DjJ638A-.mjs";
|
|
9
|
-
import { I as resolveStaticDeployPreset, L as toManifestSchedulesAndQueues, M as resolveDeployWorkerMain, N as resolveDeployWranglerCompat, R as validateDeployMigrations, a as collectAndHashAssets, f as mergeAndLintRoutingRules, g as assertDeploySchemaDriftFree, i as buildStaticManifest, o as collectWorkerFiles, t as assembleVoidManifest, x as assertWorkerMainUploaded } from "./deploy-managed-static-
|
|
10
|
+
import { I as resolveStaticDeployPreset, L as toManifestSchedulesAndQueues, M as resolveDeployWorkerMain, N as resolveDeployWranglerCompat, R as validateDeployMigrations, a as collectAndHashAssets, f as mergeAndLintRoutingRules, g as assertDeploySchemaDriftFree, i as buildStaticManifest, o as collectWorkerFiles, t as assembleVoidManifest, x as assertWorkerMainUploaded } from "./deploy-managed-static-BHVbB_-A.mjs";
|
|
10
11
|
import { existsSync } from "node:fs";
|
|
11
12
|
import { createDeployArtifact } from "@void/deploy-core";
|
|
12
13
|
// src/deploy.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as bytesToBase64, t as base64ToBytes } from "./base64-ikl9yBy3.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as newId, t as MAX_MESSAGE_BYTES } from "./mime-CtP6-qAF.mjs";
|
|
3
3
|
// src/runtime/email/dev-inbox.ts
|
|
4
4
|
/**
|
|
5
5
|
* In-memory email capture for `void dev` and tests. The inbox buffer lives in
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join, i as isAbsolute, n as dirname, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { i as resolveProjectPaths, n as readProjectPaths } from "./project-paths-CdGv9Tmi.mjs";
|
|
3
3
|
import { t as discoverSchema } from "./discover-Dhkzxgdt.mjs";
|
|
4
|
-
import { c as getDatabaseCasing, l as getDatabaseDialect, m as resolveBindingNames, p as readConfig } from "./config-
|
|
4
|
+
import { c as getDatabaseCasing, l as getDatabaseDialect, m as resolveBindingNames, p as readConfig } from "./config-BITKQ3O6.mjs";
|
|
5
5
|
import { i as voidWarn } from "./log-D9hwSySP.mjs";
|
|
6
6
|
import { n as CLOUDFLARE_QUEUE_NAMES_BUILD_ENV } from "./env-CuzZZyjB.mjs";
|
|
7
7
|
import { n as ensureProjectTsconfig } from "./project-tsconfig-Cf2NFjlM.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as readDeploymentPlatform } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { L as log } from "./dist-D23AAMxT.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-CoxPEhJq.mjs";
|
|
5
5
|
import { f as import_picocolors, m as printSuccess, p as note } from "./output-BCdLioKP.mjs";
|
|
6
6
|
import { i as resolveCommandProjectId } from "./resolve-project-D0YNnJfm.mjs";
|
|
7
7
|
// src/cli/domain.ts
|
|
@@ -25,7 +25,7 @@ async function runDomainCommand(root, args) {
|
|
|
25
25
|
}
|
|
26
26
|
async function runCloudflareDomainCommand(root, args) {
|
|
27
27
|
if (args.projectSlug) throw new Error("domain: --project selects a Void platform project and is not used for direct Cloudflare apps.");
|
|
28
|
-
const { changeCloudflareDomain, listCloudflareDomains } = await import("./cloudflare-operations-
|
|
28
|
+
const { changeCloudflareDomain, listCloudflareDomains } = await import("./cloudflare-operations-oLvAd9Nd.mjs");
|
|
29
29
|
if (args.subcommand === "add") {
|
|
30
30
|
const result = await changeCloudflareDomain(root, args.hostname, "add");
|
|
31
31
|
note("Cloudflare Custom Domains manages the DNS record and TLS certificate in the zone on your account.", "Cloudflare Domain");
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { a as join } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { n as readProjectPaths } from "./project-paths-CdGv9Tmi.mjs";
|
|
3
|
-
import { p as readConfig } from "./config-
|
|
3
|
+
import { p as readConfig } from "./config-BITKQ3O6.mjs";
|
|
4
4
|
import { i as scanEmailHandlersSync } from "./email-BHY72ixO.mjs";
|
|
5
|
-
import { M as writeProvisionedWranglerConfig } from "./wrangler-
|
|
5
|
+
import { M as writeProvisionedWranglerConfig } from "./wrangler-DESSbN8L.mjs";
|
|
6
6
|
import { c as getToken, u as openBrowser } from "./auth-Dy8svcqQ.mjs";
|
|
7
|
-
import { a as emailConfigInputs, c as renderAddressMap, i as createNodeEmailDns, l as renderEmailChecklist, o as preflightEmail, r as applyEmailSetup, s as probeMx } from "./email-cloudflare-
|
|
7
|
+
import { a as emailConfigInputs, c as renderAddressMap, i as createNodeEmailDns, l as renderEmailChecklist, o as preflightEmail, r as applyEmailSetup, s as probeMx } from "./email-cloudflare-MvJIxrwx.mjs";
|
|
8
8
|
import { A as confirm, L as log, U as password, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
9
|
-
import { n as PlatformApiError, r as PlatformClient } from "./client-
|
|
9
|
+
import { n as PlatformApiError, r as PlatformClient } from "./client-CoxPEhJq.mjs";
|
|
10
10
|
import { f as import_picocolors, l as formatUrl, m as printSuccess, p as note, r as createSpinner } from "./output-BCdLioKP.mjs";
|
|
11
11
|
import { i as resolveCommandProjectId } from "./resolve-project-D0YNnJfm.mjs";
|
|
12
|
-
import { o as resolveDeployTransport } from "./deploy-transport-
|
|
13
|
-
import { a as discoverRootWranglerConfig, c as runWranglerAuthToken, l as deriveWorkerName, o as createDeployWranglerRunner, s as isWranglerNonInteractiveOrCI } from "./deploy-
|
|
12
|
+
import { o as resolveDeployTransport } from "./deploy-transport-DEyOUfac.mjs";
|
|
13
|
+
import { a as discoverRootWranglerConfig, c as runWranglerAuthToken, l as deriveWorkerName, o as createDeployWranglerRunner, s as isWranglerNonInteractiveOrCI } from "./deploy-D_gEojD2.mjs";
|
|
14
14
|
import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
15
15
|
import { tmpdir } from "node:os";
|
|
16
16
|
import { execSync } from "node:child_process";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-uD8oG6U2.mjs";
|
|
2
2
|
import { a as join, n as dirname, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
3
3
|
import { t as require_picocolors } from "./picocolors-D1NxSLw-.mjs";
|
|
4
|
-
import { p as readConfig } from "./config-
|
|
4
|
+
import { p as readConfig } from "./config-BITKQ3O6.mjs";
|
|
5
5
|
import { i as voidWarn, r as voidLog } from "./log-D9hwSySP.mjs";
|
|
6
|
-
import { i as collectFiles } from "./isr-config-DhBkzCdY.mjs";
|
|
7
6
|
import { i as readProjectIdField } from "./project-CLwxcEdq.mjs";
|
|
8
|
-
import { p as findBindingNameOwner, u as ensureWranglerCompat } from "./wrangler-
|
|
7
|
+
import { p as findBindingNameOwner, u as ensureWranglerCompat } from "./wrangler-DESSbN8L.mjs";
|
|
9
8
|
import { n as scopedAccessCredentials } from "./cf-access-pejlJmuy.mjs";
|
|
10
9
|
import { n as ensurePlatformProxyAccess } from "./cf-access-BmBT2h8_.mjs";
|
|
11
10
|
import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-Dy8svcqQ.mjs";
|
|
12
11
|
import { u as stripInternalEnvKeys } from "./env-CuzZZyjB.mjs";
|
|
12
|
+
import { i as collectFiles } from "./isr-config-Czzb4mIq.mjs";
|
|
13
13
|
import { i as renderPrerenderPaths, n as outputFileForPath, r as readPrerenderPathsResponse } from "./prerender-render-RlAj6hh8.mjs";
|
|
14
14
|
import { t as renderDefaultErrorPage } from "./error-pages-COVBnzK7.mjs";
|
|
15
|
-
import { a as buildEnv } from "./version-metadata-
|
|
15
|
+
import { a as buildEnv } from "./version-metadata-C8hLzQkv.mjs";
|
|
16
16
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
17
17
|
import { isRecord } from "@void/deploy-core";
|
|
18
18
|
import { execFile } from "node:child_process";
|
|
@@ -296,108 +296,6 @@ async function prerenderPagesNode(options) {
|
|
|
296
296
|
for (const { path, error } of result.failed) voidWarn(`prerender ${path} failed: ${error}`);
|
|
297
297
|
return result;
|
|
298
298
|
}
|
|
299
|
-
// src/asset-worker-bypass.ts
|
|
300
|
-
/**
|
|
301
|
-
* Build-time decision for letting Cloudflare serve fingerprinted build files
|
|
302
|
-
* without starting the Worker. Native Cloudflare builds of apps with no global
|
|
303
|
-
* middleware and no edge rules gain nothing from running the Worker for those
|
|
304
|
-
* files: the Worker would only copy the asset response. Skipping it makes
|
|
305
|
-
* those requests free static requests and keeps auth and its session read off
|
|
306
|
-
* them. Each file gets its own negative `run_worker_first` rule, because a
|
|
307
|
-
* request matching a negative rule never reaches the Worker, even when the
|
|
308
|
-
* file is missing. Misses and other paths in the folder keep the Worker's
|
|
309
|
-
* not-found, SPA and page handling.
|
|
310
|
-
* `routing.alwaysUseHttps` alone does not count as an edge rule: hashed files
|
|
311
|
-
* are only linked from pages the Worker has already moved to HTTPS.
|
|
312
|
-
*
|
|
313
|
-
* The asset layer does not know which files are fingerprinted, so a generated
|
|
314
|
-
* `_headers` file gives every bypassed chunk the immutable policy the Worker
|
|
315
|
-
* would have set.
|
|
316
|
-
*/
|
|
317
|
-
const GENERATED_ASSET_HEADERS_MARKER = "# Generated by Void: immutable caching for fingerprinted build files. Do not edit.";
|
|
318
|
-
/** Cloudflare accepts at most 100 `run_worker_first` rules, `/**` included. */
|
|
319
|
-
const MAX_BYPASS_FILES = 99;
|
|
320
|
-
/** Cloudflare limits each `run_worker_first` rule to 100 characters. */
|
|
321
|
-
const MAX_RUN_WORKER_FIRST_RULE_LENGTH = 100;
|
|
322
|
-
const INTERNAL_PATTERNS = ["/__void/*"];
|
|
323
|
-
const AUTH_PATTERNS = ["/api/auth/*"];
|
|
324
|
-
/** Trim surrounding slashes; null when nothing is left. */
|
|
325
|
-
function normalizeAssetsDir(dir) {
|
|
326
|
-
let start = 0;
|
|
327
|
-
let end = dir.length;
|
|
328
|
-
while (start < end && dir[start] === "/") start++;
|
|
329
|
-
while (end > start && dir[end - 1] === "/") end--;
|
|
330
|
-
const trimmed = dir.slice(start, end);
|
|
331
|
-
return trimmed === "" || trimmed === "." ? null : trimmed;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Whether a route pattern can match a path below `/<dir>/`. Parameters,
|
|
335
|
-
* wildcards and patterns with more segments than the directory count as a
|
|
336
|
-
* match, so the answer errs towards keeping the Worker in front.
|
|
337
|
-
*/
|
|
338
|
-
function patternCanReachUnder(pattern, dir) {
|
|
339
|
-
const patternSegments = (pattern.startsWith("/") ? pattern.slice(1) : pattern).split("/");
|
|
340
|
-
const dirSegments = (dir.startsWith("/") ? dir.slice(1) : dir).split("/");
|
|
341
|
-
for (let i = 0; i < dirSegments.length; i++) {
|
|
342
|
-
const segment = patternSegments[i];
|
|
343
|
-
if (segment === void 0) return false;
|
|
344
|
-
if (segment.includes("*") || segment.includes("{")) return true;
|
|
345
|
-
if (segment.startsWith(":")) continue;
|
|
346
|
-
if (segment.toLowerCase() !== dirSegments[i].toLowerCase()) return false;
|
|
347
|
-
}
|
|
348
|
-
return patternSegments.length > dirSegments.length;
|
|
349
|
-
}
|
|
350
|
-
/**
|
|
351
|
-
* Characters that are plain text in both a `_headers` path and a
|
|
352
|
-
* `run_worker_first` rule. `*`, `:` and `!` have meaning there, and anything
|
|
353
|
-
* that needs URL encoding would not match the request path as written.
|
|
354
|
-
*/
|
|
355
|
-
function isPlainPath(path) {
|
|
356
|
-
for (const char of path) if (!(char >= "a" && char <= "z" || char >= "A" && char <= "Z" || char >= "0" && char <= "9" || char === "-" || char === "_" || char === "." || char === "~" || char === "/")) return false;
|
|
357
|
-
return path.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Whether `run_worker_first` is the rule an earlier bypass wrote. A watch
|
|
361
|
-
* rebuild of only the client still finds it, because the Worker build that
|
|
362
|
-
* would write `['/**']` again did not run.
|
|
363
|
-
*/
|
|
364
|
-
function isAssetBypassRule(runWorkerFirst, assetsDir) {
|
|
365
|
-
const dir = normalizeAssetsDir(assetsDir);
|
|
366
|
-
return dir !== null && Array.isArray(runWorkerFirst) && runWorkerFirst.length > 1 && runWorkerFirst[0] === "/**" && runWorkerFirst.slice(1).every((rule) => typeof rule === "string" && rule.startsWith("!/" + dir + "/"));
|
|
367
|
-
}
|
|
368
|
-
/** The bypass this build can use, or null when any rule keeps the Worker in front. */
|
|
369
|
-
function resolveAssetWorkerBypass(facts) {
|
|
370
|
-
const { runWorkerFirst } = facts;
|
|
371
|
-
if (!(Array.isArray(runWorkerFirst) && runWorkerFirst.length === 1 && runWorkerFirst[0] === "/**" || isAssetBypassRule(runWorkerFirst, facts.assetsDir)) || facts.notFoundHandling !== "none" || facts.base !== "/" || facts.hasMiddleware || facts.headerRuleCount > 0 || facts.redirectRuleCount > 0 || facts.fallbackRuleCount > 0 || facts.publicEdgeFiles) return null;
|
|
372
|
-
const assetsDir = normalizeAssetsDir(facts.assetsDir);
|
|
373
|
-
if (!assetsDir || !isPlainPath(assetsDir)) return null;
|
|
374
|
-
if ([
|
|
375
|
-
...facts.patterns,
|
|
376
|
-
...INTERNAL_PATTERNS,
|
|
377
|
-
...facts.authEnabled ? AUTH_PATTERNS : []
|
|
378
|
-
].some((pattern) => patternCanReachUnder(pattern, assetsDir))) return null;
|
|
379
|
-
const prefix = assetsDir + "/";
|
|
380
|
-
const files = [...new Set(facts.immutableFiles)].filter((file) => file.startsWith(prefix)).sort();
|
|
381
|
-
const rules = files.map((file) => "!/" + file);
|
|
382
|
-
if (files.length === 0 || files.length > MAX_BYPASS_FILES || files.some((file) => !isPlainPath(file)) || rules.some((rule) => rule.length > MAX_RUN_WORKER_FIRST_RULE_LENGTH)) return null;
|
|
383
|
-
return {
|
|
384
|
-
runWorkerFirst: ["/**", ...rules],
|
|
385
|
-
headers: renderGeneratedAssetHeaders(files)
|
|
386
|
-
};
|
|
387
|
-
}
|
|
388
|
-
/** One immutable rule per file after the marker line. */
|
|
389
|
-
function renderGeneratedAssetHeaders(files) {
|
|
390
|
-
const lines = [GENERATED_ASSET_HEADERS_MARKER];
|
|
391
|
-
for (const file of files) lines.push("/" + file, " Cache-Control: public, max-age=31536000, immutable");
|
|
392
|
-
return lines.join("\n") + "\n";
|
|
393
|
-
}
|
|
394
|
-
/** Whether a `_headers` file is the one Void generated. */
|
|
395
|
-
function isGeneratedAssetHeaders(text) {
|
|
396
|
-
const newline = text.indexOf("\n");
|
|
397
|
-
let firstLine = newline === -1 ? text : text.slice(0, newline);
|
|
398
|
-
if (firstLine.endsWith("\r")) firstLine = firstLine.slice(0, -1);
|
|
399
|
-
return firstLine === GENERATED_ASSET_HEADERS_MARKER;
|
|
400
|
-
}
|
|
401
299
|
// src/cli/email-cloudflare.ts
|
|
402
300
|
/** The `send_email` binding name Void provisions and the runtime reads. */
|
|
403
301
|
const SEND_EMAIL_BINDING = "SEND_EMAIL";
|
|
@@ -1201,4 +1099,4 @@ async function createNodeEmailDns() {
|
|
|
1201
1099
|
resolveTxt: (name) => dns.resolveTxt(name)
|
|
1202
1100
|
};
|
|
1203
1101
|
}
|
|
1204
|
-
export { emailConfigInputs as a, renderAddressMap as c,
|
|
1102
|
+
export { emailConfigInputs as a, renderAddressMap as c, collectPrerenderPathsNode as d, prerenderPages as f, createNodeEmailDns as i, renderEmailChecklist as l, SEND_EMAIL_BINDING as n, preflightEmail as o, prerenderPagesNode as p, applyEmailSetup as r, probeMx as s, EMAIL_FROM_VAR as t, collectPrerenderPaths as u };
|
|
@@ -3,7 +3,7 @@ import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-C
|
|
|
3
3
|
import { c as getToken } from "./auth-Dy8svcqQ.mjs";
|
|
4
4
|
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-DqzVBKnS.mjs";
|
|
5
5
|
import { H as outro, L as log } from "./dist-D23AAMxT.mjs";
|
|
6
|
-
import { r as PlatformClient } from "./client-
|
|
6
|
+
import { r as PlatformClient } from "./client-CoxPEhJq.mjs";
|
|
7
7
|
import { m as printSuccess, p as note } from "./output-BCdLioKP.mjs";
|
|
8
8
|
import { d as formatEnvReport, g as validateProdEnv, u as fetchRemoteSecretNames } from "./env-validation-GV1oD4EV.mjs";
|
|
9
9
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
@@ -25,7 +25,7 @@ async function runCheck(root, useRemoteSecrets) {
|
|
|
25
25
|
const platform = readDeploymentPlatform(root);
|
|
26
26
|
if (platform === "none") throw new Error("env: Deployment is disabled. Run `void init` to choose a platform.");
|
|
27
27
|
if (platform === "cloudflare") {
|
|
28
|
-
const { listCloudflareSecrets, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
28
|
+
const { listCloudflareSecrets, resolveCloudflareOperationContext } = await import("./cloudflare-operations-oLvAd9Nd.mjs");
|
|
29
29
|
remoteSecrets = await listCloudflareSecrets(resolveCloudflareOperationContext(root));
|
|
30
30
|
} else {
|
|
31
31
|
const token = getToken(root);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as join, n as dirname, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { n as readProjectPaths } from "./project-paths-CdGv9Tmi.mjs";
|
|
3
|
-
import { l as getDatabaseDialect, p as readConfig } from "./config-
|
|
3
|
+
import { l as getDatabaseDialect, p as readConfig } from "./config-BITKQ3O6.mjs";
|
|
4
4
|
import { n as readJournal, t as collectMigrations } from "./collect-C6Blu9yw.mjs";
|
|
5
|
-
import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-
|
|
5
|
+
import { r as writeDrizzleConfig, t as PLACEHOLDER_DB_URL } from "./config-BBlVXZCU.mjs";
|
|
6
6
|
import { t as assertJournalCoherence } from "./validate-Ddzl-IwT.mjs";
|
|
7
7
|
import { K as select, L as log, O as cancel, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
8
8
|
import { m as printSuccess } from "./output-BCdLioKP.mjs";
|
|
@@ -329,7 +329,7 @@ async function runModel(root, name, columns) {
|
|
|
329
329
|
const existing = readFileSync(barrelPath, "utf-8");
|
|
330
330
|
if (!existing.includes(exportLine)) writeFileSync(barrelPath, existing.trimEnd() + "\n" + exportLine + "\n");
|
|
331
331
|
} else writeFileSync(barrelPath, exportLine + "\n");
|
|
332
|
-
const { prepareProject } = await import("./prepare-
|
|
332
|
+
const { prepareProject } = await import("./prepare-BdxJJCMv.mjs");
|
|
333
333
|
await prepareProject(root);
|
|
334
334
|
log.step(`Created ${relative(root, modelPath)}`);
|
|
335
335
|
log.step(`Updated ${relative(root, barrelPath)}`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as runGenCommand } from "./gen-BD-dfjxY.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken, n as createCodeChallenge, r as createCodeVerifier, t as awaitBrowserCallback, u as openBrowser } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
4
|
-
import { c as platformErrorMessage, n as PlatformApiError, r as PlatformClient, s as parsePlatformErrorBody } from "./client-
|
|
4
|
+
import { c as platformErrorMessage, n as PlatformApiError, r as PlatformClient, s as parsePlatformErrorBody } from "./client-CoxPEhJq.mjs";
|
|
5
5
|
import { f as import_picocolors, l as formatUrl, m as printSuccess } from "./output-BCdLioKP.mjs";
|
|
6
6
|
import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D0YNnJfm.mjs";
|
|
7
7
|
import { t as collectGitDeployMetadata } from "./git-metadata-Cukp5kV5.mjs";
|
|
@@ -2,9 +2,10 @@ import { l as VoidPlatformSandbox } from "./sandbox-DE1WsxuB.mjs";
|
|
|
2
2
|
import { t as StandardSchemaV1 } from "./standard-schema-CuDawHOC.mjs";
|
|
3
3
|
import { n as HeadDescriptor } from "./head-MeF_5M_3.mjs";
|
|
4
4
|
import { r as AuthUser, t as AuthSession } from "./auth-CH4PLAX1.mjs";
|
|
5
|
+
import { l as TypedRoutes } from "./route-url-C_YIH_zO.mjs";
|
|
5
6
|
import { t as DevCssAsset } from "./types-agfx0alu.mjs";
|
|
6
7
|
import { Context, Env, ExecutionContext as ExecutionContext$1, MiddlewareHandler, Next } from "hono";
|
|
7
|
-
import { RewriteDestination, RouteDestination } from "void/routes";
|
|
8
|
+
import { RewriteDestination, RouteDestination, RouteUrl } from "void/routes";
|
|
8
9
|
type ClientAssetTags = {
|
|
9
10
|
css: string;
|
|
10
11
|
preloads: string;
|
|
@@ -133,6 +134,7 @@ declare class VoidAssetRewriteError extends Error {
|
|
|
133
134
|
override name: string;
|
|
134
135
|
constructor(destination: string);
|
|
135
136
|
}
|
|
137
|
+
type RewritePath = TypedRoutes extends true ? RouteUrl : RewriteDestination;
|
|
136
138
|
/** Hono `Variables` for Void workers, including auth values populated by Better Auth middleware. */
|
|
137
139
|
interface CloudContextVariables {
|
|
138
140
|
user: AuthUser | null;
|
|
@@ -177,6 +179,7 @@ declare module "hono" {
|
|
|
177
179
|
* ```ts
|
|
178
180
|
* export default defineMiddleware(async (c, next) => {
|
|
179
181
|
* if (!hasLocalePrefix(c.req.path)) {
|
|
182
|
+
* // With `routing.typedRoutes`, add `as RouteUrl` to a path built at runtime.
|
|
180
183
|
* return c.rewrite(`/en${c.req.path}`);
|
|
181
184
|
* }
|
|
182
185
|
* return next();
|
|
@@ -190,9 +193,10 @@ declare module "hono" {
|
|
|
190
193
|
*
|
|
191
194
|
* Accepts a typed `{ pathname, params, query, hash }` destination or a string.
|
|
192
195
|
* String destinations retain route autocomplete and support dynamic paths
|
|
193
|
-
* (e.g. `` `/users/${id}` ``).
|
|
196
|
+
* (e.g. `` `/users/${id}` ``). With `routing.typedRoutes`, a string must be a
|
|
197
|
+
* `RouteUrl`: cast a path built at runtime with `as RouteUrl`.
|
|
194
198
|
*/
|
|
195
|
-
rewrite: (path:
|
|
199
|
+
rewrite: (path: RewritePath | RouteDestination) => Promise<Response>;
|
|
196
200
|
/**
|
|
197
201
|
* Returns the URL the client actually requested — the pre-rewrite URL as
|
|
198
202
|
* a `URL` object — or `null` when the current request was not rewritten.
|
|
@@ -296,6 +300,7 @@ type TypedHandler<V extends ValidatorSlots = {}, R = unknown> = {
|
|
|
296
300
|
* Multiple arguments: middleware chain + final handler, composed at runtime.
|
|
297
301
|
*/
|
|
298
302
|
declare function defineHandler<R>(handler: LoaderFn<R>): TypedHandler<{}, Exclude<Awaited<R>, Response>>;
|
|
303
|
+
declare function defineHandler<V extends ValidatorSlots, R>(...args: [MiddlewareFn, ...Array<MiddlewareFn>, TypedHandler<V, R>]): TypedHandler<V, R>;
|
|
299
304
|
declare function defineHandler<R>(firstMiddleware: MiddlewareFn, handler: LoaderFn<R>): TypedHandler<{}, Exclude<Awaited<R>, Response>>;
|
|
300
305
|
declare function defineHandler<F extends HandlerFn>(firstMiddleware: MiddlewareFn, handler: F): TypedHandler<{}, LoaderOutput<F>>;
|
|
301
306
|
declare function defineHandler<R>(firstMiddleware: MiddlewareFn, secondMiddleware: MiddlewareFn, handler: LoaderFn<R>): TypedHandler<{}, Exclude<Awaited<R>, Response>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { t as base64ToBytes } from "./base64-ikl9yBy3.mjs";
|
|
2
|
+
import { a as executeComposedHandler, s as setHandlerComposition } from "./validation-error-uAAjlsiW.mjs";
|
|
2
3
|
import { t as convertReturnValue } from "./response-HmNjB30w.mjs";
|
|
3
4
|
import { t as runValidation } from "./validator-CTfmzZYb.mjs";
|
|
4
5
|
// src/runtime/handler.ts
|
|
@@ -21,18 +22,7 @@ function defineHandler(...args) {
|
|
|
21
22
|
if (args.length === 1) return args[0];
|
|
22
23
|
const middlewares = args.slice(0, -1);
|
|
23
24
|
const handler = args[args.length - 1];
|
|
24
|
-
return (async (c) =>
|
|
25
|
-
let index = 0;
|
|
26
|
-
const dispatch = async () => {
|
|
27
|
-
if (index < middlewares.length) {
|
|
28
|
-
const middleware = middlewares[index++];
|
|
29
|
-
const middlewareResponse = await middleware(c, dispatch);
|
|
30
|
-
if (middlewareResponse instanceof Response) c.res = middlewareResponse;
|
|
31
|
-
} else c.res = convertReturnValue(await handler(c));
|
|
32
|
-
};
|
|
33
|
-
await dispatch();
|
|
34
|
-
return c.res;
|
|
35
|
-
});
|
|
25
|
+
return setHandlerComposition(async (c) => executeComposedHandler(c, middlewares, async () => convertReturnValue(await handler(c))), middlewares, handler);
|
|
36
26
|
}
|
|
37
27
|
(function(_defineHandler) {
|
|
38
28
|
function withValidator(validators) {
|