void 1.2.1 → 1.4.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-HP8bixYo.mjs} +3 -3
- package/dist/{application-analysis-fEqoSeMp.mjs → application-analysis-DDOQwiXk.mjs} +18 -12
- package/dist/{application-routing-DAhNP4u3.mjs → application-routing-4719u_kf.mjs} +3 -1
- package/dist/auth-g2TQbDLD.d.mts +70 -0
- package/dist/{auth-link-C87vGXM-.mjs → auth-link-CedYpDCy.mjs} +3 -3
- package/dist/{auth-router-6I81r-ix.mjs → auth-router-vafo7x8w.mjs} +11 -6
- package/dist/{better-auth-shared-D-6z0q0f.mjs → better-auth-shared-7FM3Uk2N.mjs} +48 -2
- package/dist/{better-auth-shared-DVk2DkTW.d.mts → better-auth-shared-BHB8kiTE.d.mts} +1 -1
- package/dist/{build-cmd-ex1g-j_e.mjs → build-cmd-9vUAQ1_V.mjs} +1 -1
- package/dist/{cache-oHzrnY3z.mjs → cache-jvwLNb0h.mjs} +1 -1
- package/dist/{cancel-deploy-viAMD0Q_.mjs → cancel-deploy-Dw0UmWKO.mjs} +1 -1
- package/dist/{cf-build-output-BhVxldCw.mjs → cf-build-output-XpNR9zoh.mjs} +122 -5
- package/dist/cf-build-output-bd8Uwv1P.mjs +1 -0
- package/dist/{cf-worker-settings-BECvvTVd.mjs → cf-worker-settings-Dg27RzyT.mjs} +11 -5
- package/dist/cli/cli.mjs +41 -32
- package/dist/cli/cloudflare-operation-process.mjs +35 -8
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/{client-BEkdj1kx.mjs → client-B3LnB_bE.mjs} +8 -1
- package/dist/client-BZb9j66F.mjs +1 -0
- package/dist/{cloudflare-auth-Byo_0_N9.mjs → cloudflare-auth-DyD_kVFr.mjs} +1 -1
- package/dist/{cloudflare-cmd-DMzCv12s.mjs → cloudflare-cmd-D-b_u3T4.mjs} +2 -2
- package/dist/{cloudflare-config-DchHxPTo.mjs → cloudflare-config-CH1AylZT.mjs} +14 -3
- package/dist/{cloudflare-connect-CCRTVg-I.mjs → cloudflare-connect-zTJh8UnN.mjs} +2 -2
- package/dist/{cloudflare-operations-Dh9dEHJj.mjs → cloudflare-operations-Bc-7fN44.mjs} +4 -4
- package/dist/{cloudflare-operations-DsSaw2BT.mjs → cloudflare-operations-BtulCNOg.mjs} +1 -1
- package/dist/{config-BU6hMu1W.mjs → config-BV2ASlpn.mjs} +1 -1
- package/dist/{config-DQfHOKh9.d.mts → config-CAdZVTLN.d.mts} +4 -1
- package/dist/config-D-6q7EBH.mjs +87 -0
- package/dist/{config-DHgSEWT7.mjs → config-OFOAimzt.mjs} +5 -3
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-BIaXIkkv.mjs → config-tqMM6DwY.mjs} +1 -1
- package/dist/{connect-k7R2rPVA.mjs → connect-BOM6zvFX.mjs} +4 -4
- package/dist/{create-project-DV71ol5d.mjs → create-project-Bxd02EHN.mjs} +1 -1
- package/dist/{create-project-DTuy-l0z.mjs → create-project-C2K0DN2O.mjs} +1 -1
- package/dist/{db-DVOkLH5X.mjs → db-Cdvr3zwG.mjs} +18 -18
- package/dist/{db-types-NGxPwnlt.mjs → db-types-0eCiqYb1.mjs} +1 -1
- package/dist/{delete-BbP5eopu.mjs → delete-lETE6Tpt.mjs} +1 -1
- package/dist/deploy-CX94CmKa.mjs +2 -0
- package/dist/{deploy-7H32EnUs.mjs → deploy-CdM-LAxX.mjs} +473 -148
- package/dist/{deploy-managed-static-DlvcvnQT.mjs → deploy-managed-static-DjeBFG2c.mjs} +43 -20
- package/dist/{deploy-transport-BzGEj0Ge.mjs → deploy-transport-DIq_gFTP.mjs} +14 -13
- package/dist/deploy.d.mts +2 -0
- package/dist/deploy.mjs +8 -5
- package/dist/{dispatch-DoUnxTNo.mjs → dispatch-CLa2LThw.mjs} +76 -7
- package/dist/{domain-CA2wBgra.mjs → domain-DyhNtdYf.mjs} +2 -2
- package/dist/{email-DXpCc77w.mjs → email-DM2wDcBN.mjs} +59 -10
- package/dist/{email-cloudflare-D03g2TkS.mjs → email-cloudflare-PMbAev9Q.mjs} +124 -10
- package/dist/{env-DgOQ9_8S.mjs → env-78hbN-oI.mjs} +3 -3
- package/dist/{env-BJjULvL0.mjs → env-BaMz0j7H.mjs} +6 -1
- package/dist/{env-validation-Dwq3PJzK.mjs → env-validation-B3VobvXm.mjs} +2 -1
- package/dist/{env-validation-BmsdCZEk.mjs → env-validation-BUfFZ6bt.mjs} +1 -1
- package/dist/error-pages-CLIJ7aYq.mjs +37 -0
- package/dist/gen-BhWBT4iu.mjs +1 -0
- package/dist/{gen-BfmcIi2g.mjs → gen-CFmsUsW1.mjs} +3 -3
- package/dist/{github-cmd-CY9LUqLh.mjs → github-cmd-De-_IWbM.mjs} +1 -1
- package/dist/{handler-BbkSPzGF.d.mts → handler-BHktmuTL.d.mts} +4 -2
- package/dist/{headers-D522zd0A.mjs → headers--vaK_chu.mjs} +1 -1
- package/dist/{help-CxSlPpzJ.mjs → help-CKbrhZha.mjs} +16 -1
- package/dist/help-qOZr3wng.mjs +1 -0
- package/dist/index.d.mts +3 -5
- package/dist/index.mjs +370 -140
- package/dist/{info-7VDlhtyy.mjs → info-Yg0-V5Rs.mjs} +4 -4
- package/dist/{init-DxYyOs4-.mjs → init-CDiJQycf.mjs} +241 -206
- package/dist/{link-Ddmod1dZ.mjs → link-Dllip08S.mjs} +2 -2
- package/dist/{list-MogaugiO.mjs → list-BYRP6am0.mjs} +2 -2
- package/dist/{live-Bt8Y_0bg.d.mts → live-BllfDuzA.d.mts} +2 -2
- package/dist/{local-d1-BHBnKWRb.mjs → local-d1-CAwAs9GH.mjs} +1 -1
- package/dist/login-BAPmYnb7.mjs +1 -0
- package/dist/{login-Cttnagmm.mjs → login-PcFy5mlC.mjs} +2 -2
- package/dist/{logs-CAszUWZI.mjs → logs-DmJTBhed.mjs} +2 -2
- package/dist/{migrate-DyT2jJ8y.mjs → migrate-B8S2xTcb.mjs} +5 -66
- package/dist/migrate-BIYTPQE6.mjs +1 -0
- package/dist/nitro.mjs +4 -4
- package/dist/{node-WB7c2N4L.mjs → node-CDOPrGSl.mjs} +5 -5
- package/dist/{operator-args-UnE8Y2eK.mjs → operator-args-BsJIYXaT.mjs} +8 -1
- package/dist/operator-cmd-CjazwOyb.mjs +1 -0
- package/dist/{operator-cmd-skshjMGl.mjs → operator-cmd-DmkmS2wL.mjs} +4 -3
- package/dist/pages/client.d.mts +32 -4
- package/dist/pages/client.mjs +186 -29
- package/dist/pages/index.d.mts +34 -2
- package/dist/pages/index.mjs +96 -55
- 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-CImnfohz.mjs} +3 -3
- package/dist/{platform-auth-protection-SHhvim1L.mjs → platform-auth-protection-BogLhtHi.mjs} +2 -2
- package/dist/{platform-auth-recovery-DXVWs-wA.mjs → platform-auth-recovery-B-mEaWEi.mjs} +2 -2
- package/dist/{platform-cmd-PiNRkopU.mjs → platform-cmd-CV8NxIIn.mjs} +1 -1
- package/dist/{platform-cmd-D5I1beUX.mjs → platform-cmd-DZK2ixMl.mjs} +4 -4
- package/dist/{platform-domain-jpmBfZeb.mjs → platform-domain-CRvelPGE.mjs} +2 -2
- package/dist/{platform-lifecycle-DyKmuNY6.mjs → platform-lifecycle-CPYY7E9B.mjs} +103 -41
- package/dist/{platform-lifecycle-DH3Yr1qQ.mjs → platform-lifecycle-DwXq7kZt.mjs} +1 -1
- package/dist/{platform-management--vDwSn35.mjs → platform-management-BOnGbMSM.mjs} +1 -1
- package/dist/{platform-management-7m-PLaPJ.mjs → platform-management-lXdgGgAM.mjs} +1 -1
- package/dist/{platform-recovery-BiNpZZab.mjs → platform-recovery-noaALXnE.mjs} +2 -2
- package/dist/{plugin-inference-DUjCd55H.mjs → plugin-inference-CeiB6BG5.mjs} +53 -18
- package/dist/{prepare-BcAE5Sdj.mjs → prepare-BuOS18AM.mjs} +1 -1
- package/dist/{prepare-DA-17DhO.mjs → prepare-D604Yiyr.mjs} +12 -8
- package/dist/prepare-DU-tOpS5.mjs +1 -0
- 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-DBYqAIbe.mjs} +15 -15
- package/dist/{project-team-CQBNveX3.mjs → project-team-BjCLgTRC.mjs} +1 -1
- package/dist/{project-token-CCalFyQf.mjs → project-token-BB6PwaA9.mjs} +1 -1
- package/dist/{project-tsconfig-Itv1f4WC.mjs → project-tsconfig-CVvk6Z_e.mjs} +24 -2
- package/dist/{project-zero-trust-DPnkiEuT.mjs → project-zero-trust-CWDh1P_t.mjs} +1 -1
- package/dist/{protocol-BBDpJz3G.d.mts → protocol-D5XDySYu.d.mts} +2 -2
- package/dist/{provision-BFLCrnUp.mjs → provision-DfxLCg-d.mjs} +1 -1
- package/dist/{provision-DtROpNNI.mjs → provision-DztLJ97X.mjs} +24 -8
- package/dist/{requests-BpH0kImL.mjs → requests-D_pbzDyz.mjs} +1 -1
- package/dist/{rollback-CXS1tAa-.mjs → rollback-CjfIYsJx.mjs} +2 -2
- package/dist/{route-types-BZi26DVS.mjs → route-types-DvEGmPif.mjs} +109 -30
- package/dist/routes-stub.d.mts +22 -13
- package/dist/runtime/auth.d.mts +2 -2
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.d.mts +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/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 +5 -4
- package/dist/runtime/routing.mjs +14 -73
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/runtime/ws.mjs +4 -2
- package/dist/{scan-8IzYXiU_.mjs → scan-N9WzdcAl.mjs} +302 -23
- package/dist/{secret-BbXHfLAt.mjs → secret-3X0PxmuX.mjs} +9 -12
- 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-D2vfMQzv.mjs} +2 -1
- package/dist/worker-conditions-AWFRcFxR.mjs +11 -0
- package/dist/{wrangler-F96NnLyb.mjs → wrangler-I-scB_1t.mjs} +82 -13
- package/dist/wrangler-UnwdISay.mjs +1 -0
- package/dist/{wrapper-D3sZyh2C.mjs → wrapper-BBl1rC32.mjs} +8 -12
- package/dist/{ws-BH-im_tX.d.mts → ws-B3ClMVDh.d.mts} +3 -2
- package/docs/guide/auth.md +4 -2
- package/docs/guide/edge/redirects.md +22 -0
- 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 +43 -13
- package/docs/guide/pages-routing/markdown.md +2 -0
- package/docs/guide/pages-routing/overview.md +33 -2
- package/docs/guide/platform/administration/email.md +18 -0
- package/docs/guide/platform/installation/maintenance.md +3 -1
- 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/server-routing.md +40 -2
- package/docs/guide/ssg.md +8 -0
- package/docs/guide/type-safety.md +7 -7
- package/docs/guide/websockets.md +4 -2
- package/docs/integrations/cloudflare.md +16 -7
- package/docs/reference/api/auth.md +6 -2
- package/docs/reference/api/deploy.md +9 -5
- package/docs/reference/api/pages.md +6 -4
- package/docs/reference/cli/deploy.md +10 -9
- package/docs/reference/cli/email.md +13 -0
- package/docs/reference/cli/platform-email.md +2 -2
- package/docs/reference/cli.md +1 -0
- package/docs/reference/config.md +11 -1
- package/docs/reference/structure.md +3 -1
- package/package.json +9 -7
- package/schema.json +4 -0
- package/skills/void/SKILL.md +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/auth-DkcFflXV.d.mts +0 -42
- 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
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { n as __toESM } from "./rolldown-runtime-3h0WiCiA.mjs";
|
|
2
2
|
import { a as join, n as dirname, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
3
3
|
import { t as require_picocolors } from "./picocolors-BsDfhxIw.mjs";
|
|
4
|
-
import { p as readConfig } from "./config-
|
|
4
|
+
import { p as readConfig } from "./config-OFOAimzt.mjs";
|
|
5
5
|
import { i as voidWarn, r as voidLog } from "./log-BMwmN5Ae.mjs";
|
|
6
6
|
import { i as collectFiles } from "./isr-config-fZaJJ8t7.mjs";
|
|
7
7
|
import { i as readProjectIdField } from "./project-rqDnVsJN.mjs";
|
|
8
|
-
import { p as findBindingNameOwner, u as ensureWranglerCompat } from "./wrangler-
|
|
8
|
+
import { p as findBindingNameOwner, u as ensureWranglerCompat } from "./wrangler-I-scB_1t.mjs";
|
|
9
9
|
import { n as scopedAccessCredentials } from "./cf-access-BM9G0lhO.mjs";
|
|
10
10
|
import { n as ensurePlatformProxyAccess } from "./cf-access-CWP4avfP.mjs";
|
|
11
11
|
import { a as getApiUrl, c as getToken, o as getProxyUrl } from "./auth-B6iOCjKI.mjs";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
12
|
+
import { u as stripInternalEnvKeys } from "./env-BaMz0j7H.mjs";
|
|
13
|
+
import { i as renderPrerenderPaths, n as outputFileForPath, r as readPrerenderPathsResponse } from "./prerender-render-CaShbHJ3.mjs";
|
|
14
|
+
import { t as renderDefaultErrorPage } from "./error-pages-CLIJ7aYq.mjs";
|
|
15
|
+
import { a as buildEnv } from "./version-metadata-D2vfMQzv.mjs";
|
|
15
16
|
import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
|
|
16
17
|
import { isRecord } from "@void/deploy-core";
|
|
17
18
|
import { execFile } from "node:child_process";
|
|
@@ -162,6 +163,12 @@ async function collectPrerenderPaths(options) {
|
|
|
162
163
|
await runner.close();
|
|
163
164
|
}
|
|
164
165
|
}
|
|
166
|
+
function ensureStatic404(clientDir) {
|
|
167
|
+
const file = join(clientDir, "404.html");
|
|
168
|
+
if (existsSync(file)) return;
|
|
169
|
+
mkdirSync(clientDir, { recursive: true });
|
|
170
|
+
writeFileSync(file, renderDefaultErrorPage(404));
|
|
171
|
+
}
|
|
165
172
|
/**
|
|
166
173
|
* Prerender pages by spinning up Miniflare with the built worker.
|
|
167
174
|
* Collects paths through the built worker's internal endpoint and then
|
|
@@ -176,12 +183,14 @@ async function prerenderPages(options) {
|
|
|
176
183
|
rendered: [],
|
|
177
184
|
failed: []
|
|
178
185
|
};
|
|
186
|
+
const result = await renderPrerenderPaths(paths, options.clientDir, (path) => runner.fetchPath(path), (path) => runner.fetchPageData(path), (path, outputFile, error) => {
|
|
187
|
+
if (error !== void 0) voidWarn(`prerender ${path} failed: ${error}`);
|
|
188
|
+
else voidLog(`prerender ${import_picocolors.default.blue(outputFile)}`);
|
|
189
|
+
});
|
|
190
|
+
ensureStatic404(options.clientDir);
|
|
179
191
|
return {
|
|
180
192
|
paths,
|
|
181
|
-
...
|
|
182
|
-
if (error !== void 0) voidWarn(`prerender ${path} failed: ${error}`);
|
|
183
|
-
else voidLog(`prerender ${import_picocolors.default.blue(outputFile)}`);
|
|
184
|
-
})
|
|
193
|
+
...result
|
|
185
194
|
};
|
|
186
195
|
} finally {
|
|
187
196
|
await runner.close();
|
|
@@ -281,11 +290,116 @@ async function prerenderPagesNode(options) {
|
|
|
281
290
|
ssrDir: options.ssrDir,
|
|
282
291
|
clientDir: options.clientDir
|
|
283
292
|
});
|
|
293
|
+
if (result.paths.length === 0) return result;
|
|
294
|
+
ensureStatic404(options.clientDir);
|
|
284
295
|
for (const path of result.rendered) voidLog(`prerender ${import_picocolors.default.blue(outputFileForPath(path))}`);
|
|
285
296
|
for (const { path, error } of result.failed) voidWarn(`prerender ${path} failed: ${error}`);
|
|
286
297
|
return result;
|
|
287
298
|
}
|
|
288
299
|
//#endregion
|
|
300
|
+
//#region src/asset-worker-bypass.ts
|
|
301
|
+
/**
|
|
302
|
+
* Build-time decision for letting Cloudflare serve fingerprinted build files
|
|
303
|
+
* without starting the Worker. Native Cloudflare builds of apps with no global
|
|
304
|
+
* middleware and no edge rules gain nothing from running the Worker for those
|
|
305
|
+
* files: the Worker would only copy the asset response. Skipping it makes
|
|
306
|
+
* those requests free static requests and keeps auth and its session read off
|
|
307
|
+
* them. Each file gets its own negative `run_worker_first` rule, because a
|
|
308
|
+
* request matching a negative rule never reaches the Worker, even when the
|
|
309
|
+
* file is missing. Misses and other paths in the folder keep the Worker's
|
|
310
|
+
* not-found, SPA and page handling.
|
|
311
|
+
* `routing.alwaysUseHttps` alone does not count as an edge rule: hashed files
|
|
312
|
+
* are only linked from pages the Worker has already moved to HTTPS.
|
|
313
|
+
*
|
|
314
|
+
* The asset layer does not know which files are fingerprinted, so a generated
|
|
315
|
+
* `_headers` file gives every bypassed chunk the immutable policy the Worker
|
|
316
|
+
* would have set.
|
|
317
|
+
*/
|
|
318
|
+
const GENERATED_ASSET_HEADERS_MARKER = "# Generated by Void: immutable caching for fingerprinted build files. Do not edit.";
|
|
319
|
+
/** Cloudflare accepts at most 100 `run_worker_first` rules, `/**` included. */
|
|
320
|
+
const MAX_BYPASS_FILES = 99;
|
|
321
|
+
/** Cloudflare limits each `run_worker_first` rule to 100 characters. */
|
|
322
|
+
const MAX_RUN_WORKER_FIRST_RULE_LENGTH = 100;
|
|
323
|
+
const INTERNAL_PATTERNS = ["/__void/*"];
|
|
324
|
+
const AUTH_PATTERNS = ["/api/auth/*"];
|
|
325
|
+
/** Trim surrounding slashes; null when nothing is left. */
|
|
326
|
+
function normalizeAssetsDir(dir) {
|
|
327
|
+
let start = 0;
|
|
328
|
+
let end = dir.length;
|
|
329
|
+
while (start < end && dir[start] === "/") start++;
|
|
330
|
+
while (end > start && dir[end - 1] === "/") end--;
|
|
331
|
+
const trimmed = dir.slice(start, end);
|
|
332
|
+
return trimmed === "" || trimmed === "." ? null : trimmed;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Whether a route pattern can match a path below `/<dir>/`. Parameters,
|
|
336
|
+
* wildcards and patterns with more segments than the directory count as a
|
|
337
|
+
* match, so the answer errs towards keeping the Worker in front.
|
|
338
|
+
*/
|
|
339
|
+
function patternCanReachUnder(pattern, dir) {
|
|
340
|
+
const patternSegments = (pattern.startsWith("/") ? pattern.slice(1) : pattern).split("/");
|
|
341
|
+
const dirSegments = (dir.startsWith("/") ? dir.slice(1) : dir).split("/");
|
|
342
|
+
for (let i = 0; i < dirSegments.length; i++) {
|
|
343
|
+
const segment = patternSegments[i];
|
|
344
|
+
if (segment === void 0) return false;
|
|
345
|
+
if (segment.includes("*") || segment.includes("{")) return true;
|
|
346
|
+
if (segment.startsWith(":")) continue;
|
|
347
|
+
if (segment.toLowerCase() !== dirSegments[i].toLowerCase()) return false;
|
|
348
|
+
}
|
|
349
|
+
return patternSegments.length > dirSegments.length;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Characters that are plain text in both a `_headers` path and a
|
|
353
|
+
* `run_worker_first` rule. `*`, `:` and `!` have meaning there, and anything
|
|
354
|
+
* that needs URL encoding would not match the request path as written.
|
|
355
|
+
*/
|
|
356
|
+
function isPlainPath(path) {
|
|
357
|
+
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;
|
|
358
|
+
return path.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..");
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Whether `run_worker_first` is the rule an earlier bypass wrote. A watch
|
|
362
|
+
* rebuild of only the client still finds it, because the Worker build that
|
|
363
|
+
* would write `['/**']` again did not run.
|
|
364
|
+
*/
|
|
365
|
+
function isAssetBypassRule(runWorkerFirst, assetsDir) {
|
|
366
|
+
const dir = normalizeAssetsDir(assetsDir);
|
|
367
|
+
return dir !== null && Array.isArray(runWorkerFirst) && runWorkerFirst.length > 1 && runWorkerFirst[0] === "/**" && runWorkerFirst.slice(1).every((rule) => typeof rule === "string" && rule.startsWith("!/" + dir + "/"));
|
|
368
|
+
}
|
|
369
|
+
/** The bypass this build can use, or null when any rule keeps the Worker in front. */
|
|
370
|
+
function resolveAssetWorkerBypass(facts) {
|
|
371
|
+
const { runWorkerFirst } = facts;
|
|
372
|
+
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;
|
|
373
|
+
const assetsDir = normalizeAssetsDir(facts.assetsDir);
|
|
374
|
+
if (!assetsDir || !isPlainPath(assetsDir)) return null;
|
|
375
|
+
if ([
|
|
376
|
+
...facts.patterns,
|
|
377
|
+
...INTERNAL_PATTERNS,
|
|
378
|
+
...facts.authEnabled ? AUTH_PATTERNS : []
|
|
379
|
+
].some((pattern) => patternCanReachUnder(pattern, assetsDir))) return null;
|
|
380
|
+
const prefix = assetsDir + "/";
|
|
381
|
+
const files = [...new Set(facts.immutableFiles)].filter((file) => file.startsWith(prefix)).sort();
|
|
382
|
+
const rules = files.map((file) => "!/" + file);
|
|
383
|
+
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;
|
|
384
|
+
return {
|
|
385
|
+
runWorkerFirst: ["/**", ...rules],
|
|
386
|
+
headers: renderGeneratedAssetHeaders(files)
|
|
387
|
+
};
|
|
388
|
+
}
|
|
389
|
+
/** One immutable rule per file after the marker line. */
|
|
390
|
+
function renderGeneratedAssetHeaders(files) {
|
|
391
|
+
const lines = [GENERATED_ASSET_HEADERS_MARKER];
|
|
392
|
+
for (const file of files) lines.push("/" + file, " Cache-Control: public, max-age=31536000, immutable");
|
|
393
|
+
return lines.join("\n") + "\n";
|
|
394
|
+
}
|
|
395
|
+
/** Whether a `_headers` file is the one Void generated. */
|
|
396
|
+
function isGeneratedAssetHeaders(text) {
|
|
397
|
+
const newline = text.indexOf("\n");
|
|
398
|
+
let firstLine = newline === -1 ? text : text.slice(0, newline);
|
|
399
|
+
if (firstLine.endsWith("\r")) firstLine = firstLine.slice(0, -1);
|
|
400
|
+
return firstLine === GENERATED_ASSET_HEADERS_MARKER;
|
|
401
|
+
}
|
|
402
|
+
//#endregion
|
|
289
403
|
//#region src/cli/email-cloudflare.ts
|
|
290
404
|
/** The `send_email` binding name Void provisions and the runtime reads. */
|
|
291
405
|
const SEND_EMAIL_BINDING = "SEND_EMAIL";
|
|
@@ -1090,4 +1204,4 @@ async function createNodeEmailDns() {
|
|
|
1090
1204
|
};
|
|
1091
1205
|
}
|
|
1092
1206
|
//#endregion
|
|
1093
|
-
export { emailConfigInputs as a, renderAddressMap as c,
|
|
1207
|
+
export { emailConfigInputs as a, renderAddressMap as c, isGeneratedAssetHeaders as d, resolveAssetWorkerBypass as f, prerenderPagesNode as g, prerenderPages as h, createNodeEmailDns as i, renderEmailChecklist as l, collectPrerenderPathsNode as m, SEND_EMAIL_BINDING as n, preflightEmail as o, collectPrerenderPaths as p, applyEmailSetup as r, probeMx as s, EMAIL_FROM_VAR as t, isAssetBypassRule as u };
|
|
@@ -3,9 +3,9 @@ import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-r
|
|
|
3
3
|
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
4
4
|
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-BicfKBhV.mjs";
|
|
5
5
|
import { H as outro, L as log } from "./dist-Cor9XGoz.mjs";
|
|
6
|
-
import { r as PlatformClient } from "./client-
|
|
6
|
+
import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
7
7
|
import { m as printSuccess, p as note } from "./output-BpgYODYx.mjs";
|
|
8
|
-
import { d as formatEnvReport, g as validateProdEnv, u as fetchRemoteSecretNames } from "./env-validation-
|
|
8
|
+
import { d as formatEnvReport, g as validateProdEnv, u as fetchRemoteSecretNames } from "./env-validation-B3VobvXm.mjs";
|
|
9
9
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
10
10
|
//#region src/cli/env.ts
|
|
11
11
|
async function runEnvCommand(root, args) {
|
|
@@ -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-BtulCNOg.mjs");
|
|
29
29
|
remoteSecrets = await listCloudflareSecrets(resolveCloudflareOperationContext(root));
|
|
30
30
|
} else {
|
|
31
31
|
const token = getToken(root);
|
|
@@ -23,6 +23,11 @@ function loadLocalEnv(root, options = {}) {
|
|
|
23
23
|
*/
|
|
24
24
|
const CLOUDFLARE_DEPLOY_BUILD_ENV = "VOID_CLOUDFLARE_DEPLOY_BUILD";
|
|
25
25
|
/**
|
|
26
|
+
* JSON map from each `queues/` name to the Cloudflare queue name that
|
|
27
|
+
* `void deploy --platform cloudflare` chose. Set only for its Vite build.
|
|
28
|
+
*/
|
|
29
|
+
const CLOUDFLARE_QUEUE_NAMES_BUILD_ENV = "VOID_CLOUDFLARE_QUEUE_NAMES";
|
|
30
|
+
/**
|
|
26
31
|
* Find legacy Vite dotenv variants. Void intentionally supports only `.env`;
|
|
27
32
|
* production configuration is project-scoped remote state instead of a file.
|
|
28
33
|
*/
|
|
@@ -112,4 +117,4 @@ function stripInternalEnvKeys(input) {
|
|
|
112
117
|
};
|
|
113
118
|
}
|
|
114
119
|
//#endregion
|
|
115
|
-
export {
|
|
120
|
+
export { findReservedEnvKeys as a, reservedEnvKeysMessage as c, findLegacyEnvFiles as i, resolveRemoteMode as l, CLOUDFLARE_QUEUE_NAMES_BUILD_ENV as n, isClientEnvKey as o, LOCAL_ENV_FILE as r, loadLocalEnv as s, CLOUDFLARE_DEPLOY_BUILD_ENV as t, stripInternalEnvKeys as u };
|
|
@@ -2,7 +2,7 @@ import { a as join, c as resolve, n as dirname } from "./dist-ipQi0Q8y.mjs";
|
|
|
2
2
|
import { i as voidWarn } from "./log-BMwmN5Ae.mjs";
|
|
3
3
|
import { n as readGeneratedWranglerConfigFile } from "./generated-wrangler-config-DeWj5F9Y.mjs";
|
|
4
4
|
import { n as scanWranglerDotenvKeys } from "./dotenv-CNazY3-w.mjs";
|
|
5
|
-
import { a as
|
|
5
|
+
import { a as findReservedEnvKeys, c as reservedEnvKeysMessage, i as findLegacyEnvFiles, o as isClientEnvKey, r as LOCAL_ENV_FILE, s as loadLocalEnv } from "./env-BaMz0j7H.mjs";
|
|
6
6
|
import { t as findEnvFile } from "./env-types-BicfKBhV.mjs";
|
|
7
7
|
import { t as loadUserEnvFile } from "./load-user-env-DD5qveNU.mjs";
|
|
8
8
|
import { l as resolveCloudflareOperationArgv, n as decodeCloudflareOperationResult, r as encodeCloudflareOperation } from "./cloudflare-process-8jEYIeim.mjs";
|
|
@@ -476,6 +476,7 @@ function secretListEnv(accountId, platform) {
|
|
|
476
476
|
scrub("CF_ACCESS_CLIENT_SECRET");
|
|
477
477
|
scrub("VOID_ACCESS_CREDENTIALS");
|
|
478
478
|
scrub("VOID_ACCESS_ORIGIN");
|
|
479
|
+
scrub("CF_ACCESS_READINESS_ORIGIN");
|
|
479
480
|
scrub("WRANGLER_LOG_SANITIZE");
|
|
480
481
|
env.WRANGLER_LOG_SANITIZE = "true";
|
|
481
482
|
if (accountId) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as SelfHostSchemaError, a as computeInvalidEmittedKeys, c as deriveSelfHostSchemaFacts, p as readEmittedWorkerVars } from "./env-validation-
|
|
1
|
+
export { r as SelfHostSchemaError, a as computeInvalidEmittedKeys, c as deriveSelfHostSchemaFacts, p as readEmittedWorkerVars } from "./env-validation-B3VobvXm.mjs";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
//#region src/runtime/error-pages/404.html?raw
|
|
2
|
+
var _404_default = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>404: Not Found</title>\n <!-- inject:css -->\n <!--\n Do not add code here. At runtime, the file referenced by the tag below is\n inlined, replacing this entire block (including this comment).\n The tag is kept so you can preview this HTML file by opening it directly in a browser.\n -->\n <link rel=\"stylesheet\" href=\"./style.css\" />\n <!-- endinject -->\n <!-- inject:js -->\n <!--\n Do not add code here. At runtime, the file referenced by the tag below is\n inlined, replacing this entire block (including this comment).\n The tag is kept so you can preview this HTML file by opening it directly in a browser.\n -->\n <script src=\"./script.js\"><\/script>\n <!-- endinject -->\n </head>\n <body>\n <div class=\"error-page\">\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <main class=\"error-content\">\n <span class=\"grid-tick top left\" aria-hidden=\"true\"></span>\n <span class=\"grid-tick top right\" aria-hidden=\"true\"></span>\n <span class=\"grid-tick bottom left\" aria-hidden=\"true\"></span>\n <span class=\"grid-tick bottom right\" aria-hidden=\"true\"></span>\n <h1>\n <span class=\"error-code\">404</span><span class=\"error-title\">Lost in the void</span>\n </h1>\n <p class=\"error-description\">This page doesn't exist</p>\n <button class=\"error-action\" type=\"button\" id=\"void-error-back\" hidden>\n <span class=\"error-arrow\" aria-hidden=\"true\">←</span>Go back\n </button>\n </main>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <canvas class=\"error-texture\" aria-hidden=\"true\"></canvas>\n </div>\n </body>\n</html>\n";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/runtime/error-pages/500.html?raw
|
|
5
|
+
var _500_default = "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n <title>500: Internal Server Error</title>\n <!-- inject:css -->\n <!--\n Do not add code here. At runtime, the file referenced by the tag below is\n inlined, replacing this entire block (including this comment).\n The tag is kept so you can preview this HTML file by opening it directly in a browser.\n -->\n <link rel=\"stylesheet\" href=\"./style.css\" />\n <!-- endinject -->\n <!-- inject:js -->\n <!--\n Do not add code here. At runtime, the file referenced by the tag below is\n inlined, replacing this entire block (including this comment).\n The tag is kept so you can preview this HTML file by opening it directly in a browser.\n -->\n <script src=\"./script.js\"><\/script>\n <!-- endinject -->\n </head>\n <body>\n <div class=\"error-page\">\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <main class=\"error-content\">\n <span class=\"grid-tick top left\" aria-hidden=\"true\"></span>\n <span class=\"grid-tick top right\" aria-hidden=\"true\"></span>\n <span class=\"grid-tick bottom left\" aria-hidden=\"true\"></span>\n <span class=\"grid-tick bottom right\" aria-hidden=\"true\"></span>\n <h1>\n <span class=\"error-code\">500</span><span class=\"error-title\">Something went wrong</span>\n </h1>\n <p class=\"error-description\">Please try again in a moment</p>\n <a class=\"error-action\" href=\"\"\n ><span class=\"error-arrow\" aria-hidden=\"true\">↻</span>Reload page</a\n >\n </main>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <div class=\"grid-cell\" aria-hidden=\"true\"></div>\n <canvas class=\"error-texture\" aria-hidden=\"true\"></canvas>\n </div>\n </body>\n</html>\n";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/runtime/error-pages/inline.ts
|
|
8
|
+
const closing = "<!-- endinject -->";
|
|
9
|
+
function replaceAssetBlock(html, name, content) {
|
|
10
|
+
const opening = `<!-- inject:${name} -->`;
|
|
11
|
+
const start = html.indexOf(opening);
|
|
12
|
+
const end = html.indexOf(closing, start + opening.length);
|
|
13
|
+
if (start === -1 || end === -1 || html.lastIndexOf(opening) !== start) throw new Error(`Expected one complete ${name} block in the default error page.`);
|
|
14
|
+
return html.slice(0, start) + content + html.slice(end + 18);
|
|
15
|
+
}
|
|
16
|
+
function inlineErrorPageAssets(html, stylesheet, script) {
|
|
17
|
+
if (html.split(closing).length !== 3) throw new Error("Expected two endinject markers in the default error page.");
|
|
18
|
+
for (const [name, content] of [["css", `<style>\n${stylesheet}</style>`], ["js", `<script>\n${script}<\/script>`]]) html = replaceAssetBlock(html, name, content);
|
|
19
|
+
return html;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/runtime/error-pages/script.js?raw
|
|
23
|
+
var script_default = "(() => {\n const designs = ['signal', 'grid', 'fold'];\n document.documentElement.dataset.design = designs[Math.floor(Math.random() * designs.length)];\n\n function setup() {\n const back = document.getElementById('void-error-back');\n const canGoBack = window.navigation ? window.navigation.canGoBack : window.history.length > 1;\n if (back && canGoBack) {\n back.hidden = false;\n back.addEventListener('click', () => window.history.back());\n }\n\n if (document.documentElement.dataset.design !== 'signal') {\n return;\n }\n const canvas = document.querySelector('.error-texture');\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n return;\n }\n\n function draw() {\n const { width, height } = canvas.getBoundingClientRect();\n const ratio = Math.min(window.devicePixelRatio || 1, 2);\n canvas.width = Math.round(width * ratio);\n canvas.height = Math.round(height * ratio);\n ctx.setTransform(ratio, 0, 0, ratio, 0, 0);\n const colors = getComputedStyle(canvas);\n const chars = ['·', '/', '0', '1', '+', '[', ']', '—'];\n ctx.font = '8px ui-monospace, monospace';\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = colors.color;\n\n for (let y = 8, row = 0; y < height; y += 12, row++) {\n for (let x = 8, col = 0; x < width; x += 9, col++) {\n const distance = Math.hypot(\n (x - width / 2) / (width * 0.47),\n (y - height * 0.48) / (height * 0.55),\n );\n const seed = (Math.imul(row + 11, 61) ^ Math.imul(col + 7, 137)) >>> 0;\n const core = Math.max(0, Math.min(1, (distance - 0.28) / 0.55));\n const opacity = core * (0.15 + (seed % 7) * 0.025) * 0.75;\n if (seed % 17 === 0 || opacity < 0.015) {\n continue;\n }\n ctx.globalAlpha = opacity;\n ctx.fillText(chars[(seed >>> 3) % chars.length], x, y);\n }\n }\n\n ctx.globalAlpha = 1;\n ctx.strokeStyle = colors.borderTopColor;\n for (const [x, y] of [\n [28, 28],\n [width - 28, 28],\n [28, height - 28],\n [width - 28, height - 28],\n ]) {\n ctx.beginPath();\n ctx.moveTo(x - 4, y);\n ctx.lineTo(x + 4, y);\n ctx.moveTo(x, y - 4);\n ctx.lineTo(x, y + 4);\n ctx.stroke();\n }\n }\n\n new ResizeObserver(draw).observe(canvas);\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', draw);\n draw();\n }\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', setup, { once: true });\n } else {\n setup();\n }\n})();\n";
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/runtime/error-pages/style.css?raw
|
|
26
|
+
var style_default = ":root {\n color-scheme: light dark;\n --background: light-dark(#fff, #16171d);\n --foreground: light-dark(#16171d, #f6f5f8);\n --muted: light-dark(#6e6874, #a8a2ae);\n --line: light-dark(#e5e4e7, #36323c);\n --ink: light-dark(#4e4856, #c3bdcd);\n --corner: light-dark(#e5e4e7, #3b3440);\n background: var(--background);\n color: var(--foreground);\n font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;\n -webkit-font-smoothing: antialiased;\n}\n\n* {\n box-sizing: border-box;\n}\n\nbody {\n margin: 0;\n}\n\n.error-page {\n position: relative;\n isolation: isolate;\n display: flex;\n align-items: center;\n justify-content: center;\n min-block-size: 100svh;\n overflow: hidden;\n}\n\n.error-content {\n min-inline-size: 0;\n padding: 32px 24px;\n text-align: center;\n}\n\n.error-content h1 {\n display: flex;\n flex-direction: column;\n gap: 18px;\n margin: 0;\n font-weight: 500;\n}\n\n.error-code {\n font-size: 64px;\n line-height: 1;\n letter-spacing: -0.045em;\n}\n\n.error-title {\n font-size: 15px;\n line-height: 1.4;\n letter-spacing: -0.02em;\n text-wrap: balance;\n}\n\n.error-description {\n margin: 6px 0 0;\n color: var(--muted);\n font-size: 12px;\n line-height: 1.5;\n letter-spacing: -0.01em;\n}\n\n.error-action {\n position: relative;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 7px;\n min-block-size: 32px;\n margin-block-start: 20px;\n padding: 6px 12px;\n border: 1px solid var(--line);\n border-radius: 6px;\n background: var(--background);\n color: var(--foreground);\n font:\n 500 12px/18px system-ui,\n -apple-system,\n BlinkMacSystemFont,\n 'Segoe UI',\n sans-serif;\n letter-spacing: -0.01em;\n text-decoration: none;\n white-space: nowrap;\n cursor: pointer;\n}\n\n.error-action::after {\n position: absolute;\n inset: -6px -3px;\n content: '';\n}\n\n.error-action:hover {\n border-color: var(--foreground);\n background: var(--foreground);\n color: var(--background);\n}\n\n.error-action:focus-visible {\n outline: 2px solid var(--foreground);\n outline-offset: 4px;\n}\n\n.error-action[hidden] {\n visibility: hidden;\n}\n\n.error-arrow {\n font-size: 15px;\n line-height: 14px;\n}\n\n.error-texture {\n position: absolute;\n z-index: -1;\n inset: 0;\n display: block;\n inline-size: 100%;\n block-size: 100%;\n border-color: var(--line);\n color: var(--ink);\n}\n\n.grid-cell,\n.grid-tick {\n display: none;\n}\n\n.grid-tick {\n position: absolute;\n z-index: 1;\n inline-size: 0;\n block-size: 0;\n border: 5px solid transparent;\n pointer-events: none;\n}\n\n:root[data-design='grid'] .error-page {\n display: grid;\n grid-template-columns: minmax(24px, 1fr) minmax(0, 456px) minmax(24px, 1fr);\n grid-template-rows: minmax(24px, 1fr) minmax(272px, auto) minmax(24px, 1fr);\n align-items: stretch;\n}\n\n:root[data-design='grid'] .grid-cell,\n:root[data-design='grid'] .error-content {\n min-inline-size: 0;\n border-inline-end: 1px solid var(--line);\n border-block-end: 1px solid var(--line);\n}\n\n:root[data-design='grid'] .grid-cell {\n display: block;\n}\n\n:root[data-design='grid'] .grid-cell:nth-child(3n) {\n border-inline-end: 0;\n}\n\n:root[data-design='grid'] .grid-cell:nth-child(n + 7) {\n border-block-end: 0;\n}\n\n:root[data-design='grid'] .error-content {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 32px;\n}\n\n:root[data-design='grid'] .grid-tick {\n display: block;\n}\n\n.grid-tick.left {\n left: -1px;\n border-left-color: var(--corner);\n}\n\n.grid-tick.right {\n right: 0;\n border-right-color: var(--corner);\n}\n\n.grid-tick.top {\n top: -5px;\n}\n\n.grid-tick.bottom {\n bottom: -5px;\n}\n\n:root[data-design='grid'] .error-texture,\n:root[data-design='fold'] .error-texture {\n display: none;\n}\n\n:root[data-design='fold'] .error-page {\n padding: 40px 42px;\n}\n\n:root[data-design='fold'] .error-content {\n flex: 0 1 560px;\n margin-inline-end: auto;\n padding: 0;\n text-align: start;\n}\n\n:root[data-design='fold'] h1 {\n flex-direction: row;\n align-items: baseline;\n gap: 14px;\n}\n\n:root[data-design='fold'] .error-code,\n:root[data-design='fold'] .error-title {\n font-size: 26px;\n line-height: 1.2;\n letter-spacing: -0.025em;\n}\n\n:root[data-design='fold'] .error-code {\n flex: none;\n color: var(--muted);\n font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;\n font-weight: 400;\n letter-spacing: -0.045em;\n}\n\n:root[data-design='fold'] .error-description {\n margin-block-start: 12px;\n font-size: 14px;\n line-height: 1.6;\n text-wrap: pretty;\n}\n\n:root[data-design='fold'] .error-action {\n margin-block-start: 24px;\n}\n\n@supports (corner-shape: squircle) {\n .error-action {\n border-radius: 12px;\n corner-shape: squircle;\n }\n}\n\n@media (pointer: coarse) {\n .error-action {\n min-block-size: 40px;\n }\n}\n\n@media (max-width: 620px) {\n :root[data-design='fold'] .error-page {\n padding: 36px 30px;\n }\n\n :root[data-design='fold'] .error-code,\n :root[data-design='fold'] .error-title {\n font-size: 24px;\n }\n}\n\n@media (max-width: 440px) {\n .error-code {\n font-size: 56px;\n }\n\n :root[data-design='grid'] .error-page {\n grid-template-columns: 24px minmax(0, 1fr) 24px;\n }\n\n :root[data-design='grid'] .error-content {\n padding: 24px;\n }\n\n :root[data-design='fold'] .error-code {\n display: none;\n }\n\n :root[data-design='fold'] .error-action {\n margin-block-start: 20px;\n }\n}\n";
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/runtime/error-pages/index.ts
|
|
29
|
+
const pages = {
|
|
30
|
+
404: inlineErrorPageAssets(_404_default, style_default, script_default),
|
|
31
|
+
500: inlineErrorPageAssets(_500_default, style_default, script_default)
|
|
32
|
+
};
|
|
33
|
+
function renderDefaultErrorPage(status) {
|
|
34
|
+
return pages[status];
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { renderDefaultErrorPage as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as runGenCommand } from "./gen-CFmsUsW1.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as join, n as dirname, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import { n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
|
|
3
|
-
import { l as getDatabaseDialect, p as readConfig } from "./config-
|
|
3
|
+
import { l as getDatabaseDialect, p as readConfig } from "./config-OFOAimzt.mjs";
|
|
4
4
|
import { n as readJournal, t as collectMigrations } from "./collect-Dew86qce.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-tqMM6DwY.mjs";
|
|
6
6
|
import { t as assertJournalCoherence } from "./validate-CnZPMq4q.mjs";
|
|
7
7
|
import { K as select, L as log, O as cancel, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
8
8
|
import { m as printSuccess } from "./output-BpgYODYx.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-DU-tOpS5.mjs");
|
|
333
333
|
await prepareProject(root);
|
|
334
334
|
log.step(`Created ${relative(root, modelPath)}`);
|
|
335
335
|
log.step(`Updated ${relative(root, barrelPath)}`);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken, n as createCodeChallenge, r as createCodeVerifier, t as awaitBrowserCallback, u as openBrowser } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-Cor9XGoz.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-B3LnB_bE.mjs";
|
|
5
5
|
import { f as import_picocolors, l as formatUrl, m as printSuccess } from "./output-BpgYODYx.mjs";
|
|
6
6
|
import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
|
|
7
7
|
import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { l as VoidPlatformSandbox } from "./sandbox-q3waMc2T.mjs";
|
|
2
2
|
import { t as StandardSchemaV1 } from "./standard-schema-Fo_vCAZh.mjs";
|
|
3
3
|
import { n as HeadDescriptor } from "./head-C8K_iGe6.mjs";
|
|
4
|
-
import { r as AuthUser, t as AuthSession } from "./auth-
|
|
5
|
-
import { t as DevCssAsset } from "./types-
|
|
4
|
+
import { r as AuthUser, t as AuthSession } from "./auth-g2TQbDLD.mjs";
|
|
5
|
+
import { t as DevCssAsset } from "./types-w72dljaA.mjs";
|
|
6
6
|
import { Context, Env, ExecutionContext as ExecutionContext$1, MiddlewareHandler } from "hono";
|
|
7
7
|
import { RewriteDestination } from "void/routes";
|
|
8
8
|
//#region src/runtime/routing-assets.d.ts
|
|
@@ -64,6 +64,8 @@ type WorkerFetchOptions = {
|
|
|
64
64
|
withRuntimeEnv: (env: RuntimeEnvironment, fn: () => Promise<Response>) => Promise<Response>;
|
|
65
65
|
filterBindings: (env: RuntimeEnvironment) => RuntimeEnvironment;
|
|
66
66
|
validateEnv?: (env: RuntimeEnvironment) => Promise<void>;
|
|
67
|
+
/** Native Cloudflare production builds redirect public HTTP requests to HTTPS. */
|
|
68
|
+
alwaysUseHttps?: boolean;
|
|
67
69
|
/** Authored/generated version metadata binding used to prove the served native version. */
|
|
68
70
|
versionMetadataBinding?: string;
|
|
69
71
|
remoteEnv?: (env: RuntimeEnvironment) => RuntimeEnvironment;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
-
import { a as convertRewritesConfig, d as isProtocolRelative, f as parseHostPrefixedSource, i as convertRedirectsConfig, n as convertFallbacksConfig, o as countSplats, r as convertHeadersConfig, t as VALID_REDIRECT_STATUSES } from "./config-
|
|
2
|
+
import { a as convertRewritesConfig, d as isProtocolRelative, f as parseHostPrefixedSource, i as convertRedirectsConfig, n as convertFallbacksConfig, o as countSplats, r as convertHeadersConfig, t as VALID_REDIRECT_STATUSES } from "./config-OFOAimzt.mjs";
|
|
3
3
|
import { i as voidWarn } from "./log-BMwmN5Ae.mjs";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
//#region src/cli/headers.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { H as outro } from "./dist-Cor9XGoz.mjs";
|
|
2
2
|
import { n as getOwnVersion } from "./agents-CuNtT0D_.mjs";
|
|
3
3
|
import { d as helpLine, f as import_picocolors, g as sectionTitle, l as formatUrl, p as note, t as categoryTitle } from "./output-BpgYODYx.mjs";
|
|
4
|
-
import { n as operatorGroups, t as operatorCommands } from "./operator-args-
|
|
4
|
+
import { n as operatorGroups, t as operatorCommands } from "./operator-args-BsJIYXaT.mjs";
|
|
5
5
|
//#region src/cli/ascii.ts
|
|
6
6
|
const asciiArts = [
|
|
7
7
|
`
|
|
@@ -1110,6 +1110,10 @@ const HELP_TREE = {
|
|
|
1110
1110
|
command: "disallow <address>",
|
|
1111
1111
|
description: "Remove a recipient from the allowlist"
|
|
1112
1112
|
},
|
|
1113
|
+
{
|
|
1114
|
+
command: "alias [name]",
|
|
1115
|
+
description: "Show the shared mail address, or set a shorter permanent name for it"
|
|
1116
|
+
},
|
|
1113
1117
|
{
|
|
1114
1118
|
command: "domain <add|status|list|sync|rotate-secret|remove>",
|
|
1115
1119
|
description: "Send and receive at your own domain on a Cloudflare zone"
|
|
@@ -1139,6 +1143,17 @@ const HELP_TREE = {
|
|
|
1139
1143
|
destinations: withProjectOption("List verified recipient addresses.", "void email destinations [options]"),
|
|
1140
1144
|
allow: withProjectOption("Add a recipient and trigger a Cloudflare verification email.", "void email allow <address> [options]"),
|
|
1141
1145
|
disallow: withProjectOption("Remove a recipient from the verified allowlist.", "void email disallow <address> [options]"),
|
|
1146
|
+
alias: {
|
|
1147
|
+
summary: "Show the project address on the shared mail domain, or give it a shorter name. The alias is permanent; the slug address keeps working.",
|
|
1148
|
+
usage: ["void email alias [options]", "void email alias <name> [options]"],
|
|
1149
|
+
options: [{
|
|
1150
|
+
command: "--project <name>",
|
|
1151
|
+
description: "Project name override"
|
|
1152
|
+
}, {
|
|
1153
|
+
command: "--yes",
|
|
1154
|
+
description: "Set the alias without asking (it cannot be changed)"
|
|
1155
|
+
}]
|
|
1156
|
+
},
|
|
1142
1157
|
domain: {
|
|
1143
1158
|
summary: "Send and receive at your own domain on a Cloudflare zone.",
|
|
1144
1159
|
usage: ["void email domain <verb> [<domain>] [options]"],
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as printHelpPage } from "./help-CKbrhZha.mjs";
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { n as HeadDescriptor } from "./head-C8K_iGe6.mjs";
|
|
2
|
-
import { r as AuthUser } from "./auth-
|
|
3
|
-
import {
|
|
2
|
+
import { r as AuthUser } from "./auth-g2TQbDLD.mjs";
|
|
3
|
+
import { s as RouteEnvironment } from "./types-w72dljaA.mjs";
|
|
4
|
+
import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, x as DeferredState, y as defineScheduled } from "./handler-BHktmuTL.mjs";
|
|
4
5
|
import { t as QueueMap } from "./queues-BWKt1Xo4.mjs";
|
|
5
6
|
import { PluginConfig } from "@cloudflare/vite-plugin";
|
|
6
7
|
import { Plugin } from "vite";
|
|
7
|
-
//#region src/router/parse-filename.d.ts
|
|
8
|
-
type RouteEnvironment = "dev" | "prod";
|
|
9
|
-
//#endregion
|
|
10
8
|
//#region src/plugin-binding-utils.d.ts
|
|
11
9
|
/**
|
|
12
10
|
* Decide whether to inject the `void dev` email-inbox loopback var.
|