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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// src/cli/platform-runtime-logs.ts
|
|
2
|
+
/**
|
|
3
|
+
* Namespace scripts that run project code: one `user-<slug>-<deployment>` per
|
|
4
|
+
* deployment, and `void-do-<project>-<hash>` hosts for custom Durable Objects.
|
|
5
|
+
*/
|
|
6
|
+
const PROJECT_WORKER_PREFIXES = ["user-", "void-do-"];
|
|
7
|
+
const CONCURRENCY = 4;
|
|
8
|
+
/** Printed by log readers when the platform answers `runtimeLogs: 'minimal'`. */
|
|
9
|
+
const MINIMAL_RUNTIME_LOGS_NOTE = "Log messages, exception messages and URLs are not recorded on this platform.";
|
|
10
|
+
/** Same `observability` the API sends when it uploads a project Worker. */
|
|
11
|
+
function projectWorkerObservability(minimal) {
|
|
12
|
+
return minimal ? { enabled: false } : {
|
|
13
|
+
enabled: true,
|
|
14
|
+
logs: {
|
|
15
|
+
invocation_logs: true,
|
|
16
|
+
head_sampling_rate: 1
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function assertPlatformRuntimeLogsSupported(deployment, runtime) {
|
|
21
|
+
if (deployment.runtimeLogs && runtime.runtimeLogs !== 1) throw new Error("platform: This platform runtime cannot keep runtime logs minimal. Upgrade Void or use a current platform runtime.");
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Project Workers keep the settings they were uploaded with, so a changed
|
|
25
|
+
* mode is pushed to them. While minimal, every operation pushes it again, so
|
|
26
|
+
* a run that stopped before this step is finished by the next one.
|
|
27
|
+
*/
|
|
28
|
+
function shouldUpdateProjectWorkerRuntimeLogs(input) {
|
|
29
|
+
const minimal = !!input.next.runtimeLogs;
|
|
30
|
+
return minimal || input.explicit || minimal !== !!input.previous?.runtimeLogs;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Update every project Worker's `observability` setting. Never throws: returns
|
|
34
|
+
* a warning to print when some Workers could not be updated.
|
|
35
|
+
*/
|
|
36
|
+
async function updateProjectWorkerRuntimeLogs(client, input) {
|
|
37
|
+
const finish = input.minimal ? ` Run \`void platform repair ${input.installationId}\` to finish.` : ` Run \`void platform upgrade ${input.installationId} --runtime-logs full\` again to finish.`;
|
|
38
|
+
let scripts;
|
|
39
|
+
try {
|
|
40
|
+
scripts = (await client.listDispatchNamespaceScripts(input.accountId, input.namespace)).filter((name) => PROJECT_WORKER_PREFIXES.some((prefix) => name.startsWith(prefix)));
|
|
41
|
+
} catch (error) {
|
|
42
|
+
return `Could not list project Workers to update their Workers Logs setting: ${errorMessage(error)}.${finish}`;
|
|
43
|
+
}
|
|
44
|
+
const settings = { observability: projectWorkerObservability(input.minimal) };
|
|
45
|
+
const failed = [];
|
|
46
|
+
let next = 0;
|
|
47
|
+
const work = async () => {
|
|
48
|
+
while (next < scripts.length) {
|
|
49
|
+
const script = scripts[next++];
|
|
50
|
+
try {
|
|
51
|
+
await client.patchDispatchNamespaceScriptSettings(input.accountId, input.namespace, script, settings);
|
|
52
|
+
} catch {
|
|
53
|
+
failed.push(script);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
await Promise.all(Array.from({ length: Math.min(CONCURRENCY, scripts.length) }, work));
|
|
58
|
+
if (failed.length === 0) return;
|
|
59
|
+
failed.sort();
|
|
60
|
+
const shown = failed.slice(0, 5).join(", ");
|
|
61
|
+
const more = failed.length > 5 ? ` and ${failed.length - 5} more` : "";
|
|
62
|
+
return `Could not update the Workers Logs setting of ${failed.length} project Worker${failed.length === 1 ? "" : "s"} (${shown}${more}).${finish}`;
|
|
63
|
+
}
|
|
64
|
+
function errorMessage(error) {
|
|
65
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
66
|
+
return message.endsWith(".") ? message.slice(0, -1) : message;
|
|
67
|
+
}
|
|
68
|
+
export { updateProjectWorkerRuntimeLogs as i, assertPlatformRuntimeLogsSupported as n, shouldUpdateProjectWorkerRuntimeLogs as r, MINIMAL_RUNTIME_LOGS_NOTE as t };
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { u as openBrowser } from "./auth-Dy8svcqQ.mjs";
|
|
2
2
|
import { L as log, tt as isCancel } from "./dist-D23AAMxT.mjs";
|
|
3
3
|
import { f as import_picocolors, s as formatLink } from "./output-BCdLioKP.mjs";
|
|
4
|
+
// src/cli/platform-plan-writes.ts
|
|
5
|
+
function planCreatesZone(plan) {
|
|
6
|
+
return plan.actions.some((action) => action.kind === "zone" && action.action === "create");
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Whether applying the plan writes a DNS record, which needs Zone → DNS → Edit.
|
|
10
|
+
* 'reuse' changes nothing and 'adopt' only records an existing record in the
|
|
11
|
+
* manifest; only 'create' calls the DNS API.
|
|
12
|
+
*/
|
|
13
|
+
function planWritesDns(plan) {
|
|
14
|
+
return plan.actions.some((action) => action.kind === "dns-record" && action.action !== "reuse" && action.action !== "adopt");
|
|
15
|
+
}
|
|
4
16
|
// src/cli/platform-setup.ts
|
|
5
17
|
/** Return a prompt answer, or stop the platform command when the prompt was cancelled. */
|
|
6
18
|
function platformPromptAnswer(value) {
|
|
@@ -215,7 +227,7 @@ function platformSetupPages(plan) {
|
|
|
215
227
|
};
|
|
216
228
|
}
|
|
217
229
|
function formatPlatformSetupPlan(plan, options = {}) {
|
|
218
|
-
const writesDns = plan
|
|
230
|
+
const writesDns = planCreatesZone(plan) || planWritesDns(plan);
|
|
219
231
|
return [
|
|
220
232
|
"The installation will guide you through setting up the following credentials:",
|
|
221
233
|
"",
|
|
@@ -268,6 +280,7 @@ function platformInstallCommandArguments(options) {
|
|
|
268
280
|
}
|
|
269
281
|
flag("--dashboard-url", options.dashboardUrl ?? "");
|
|
270
282
|
flag("--runtime", options.runtime);
|
|
283
|
+
flag("--runtime-logs", options.runtimeLogs ?? "");
|
|
271
284
|
if (options.yes) parts.push("--yes");
|
|
272
285
|
return parts;
|
|
273
286
|
}
|
|
@@ -289,4 +302,4 @@ function openPlatformSetupPage(page, dependencies = {}) {
|
|
|
289
302
|
log.info("Could not open the browser. Use the link above.");
|
|
290
303
|
}
|
|
291
304
|
}
|
|
292
|
-
export { platformManagementSetupPage as a, platformSetupLink as c, platformInstallCommandArguments as i, platformSetupPages as l, formatPlatformSetupPlan as n, platformPromptAnswer as o, openPlatformSetupPage as r, platformSetupFieldHelp as s, formatPlatformInstallCommand as t };
|
|
305
|
+
export { platformManagementSetupPage as a, platformSetupLink as c, planWritesDns as d, platformInstallCommandArguments as i, platformSetupPages as l, formatPlatformSetupPlan as n, platformPromptAnswer as o, openPlatformSetupPage as r, platformSetupFieldHelp as s, formatPlatformInstallCommand as t, planCreatesZone as u };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join, l as toSlash, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { n as readProjectPaths } from "./project-paths-CdGv9Tmi.mjs";
|
|
3
3
|
import { n as globSync } from "./dist-BWNkVq50.mjs";
|
|
4
|
-
import { d as deriveFromSource, g as ROUTE_EXTENSIONS, h as parseWebSocketFilename, m as parseRouteFilename, p as isRouteEnabledForEnvironment, t as pageFileEnvironment } from "./scan-
|
|
4
|
+
import { d as deriveFromSource, g as ROUTE_EXTENSIONS, h as parseWebSocketFilename, m as parseRouteFilename, p as isRouteEnabledForEnvironment, t as pageFileEnvironment } from "./scan-X2rDDRNa.mjs";
|
|
5
5
|
import { a as isObjectExpression, i as isMemberExpression, n as isIdentifier, r as isLiteral, t as isCallExpression } from "./ast-Cv0JwXqb.mjs";
|
|
6
6
|
import { a as staticLiteral, n as bindingResolver, o as unwrapStaticExpression, r as walk } from "./ast-bindings-BkivMJIo.mjs";
|
|
7
7
|
import { n as resourceNameWords, t as isResourceName } from "./resource-name-DlJ9QXzg.mjs";
|
|
@@ -1,4 +1,22 @@
|
|
|
1
1
|
// src/pages/prefetch.ts
|
|
2
|
+
const LINK_PREFETCH_STRATEGIES = [
|
|
3
|
+
"hover",
|
|
4
|
+
"click",
|
|
5
|
+
"mount",
|
|
6
|
+
"visible"
|
|
7
|
+
];
|
|
8
|
+
function isLinkPrefetchStrategy(value) {
|
|
9
|
+
return LINK_PREFETCH_STRATEGIES.includes(value);
|
|
10
|
+
}
|
|
11
|
+
/** Rejects an invalid `prefetch.defaultStrategy` when the plugin is configured. */
|
|
12
|
+
function assertLinkPrefetchValue(value, name) {
|
|
13
|
+
if (typeof value === "boolean") return;
|
|
14
|
+
const strategies = Array.isArray(value) ? value : [value];
|
|
15
|
+
for (const strategy of strategies) if (!isLinkPrefetchStrategy(strategy)) {
|
|
16
|
+
const allowed = LINK_PREFETCH_STRATEGIES.map((s) => `'${s}'`).join(", ");
|
|
17
|
+
throw new Error(`${name}: Invalid prefetch strategy ${JSON.stringify(strategy)}. Use true, false, ${allowed}, or an array of strategies.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
2
20
|
const UNITS = {
|
|
3
21
|
ms: 1,
|
|
4
22
|
s: 1e3,
|
|
@@ -86,4 +104,4 @@ var PrefetchCache = class {
|
|
|
86
104
|
this.entries.clear();
|
|
87
105
|
}
|
|
88
106
|
};
|
|
89
|
-
export {
|
|
107
|
+
export { assertLinkPrefetchValue as n, parseCacheFor as r, PrefetchCache as t };
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
declare const LINK_PREFETCH_STRATEGIES: readonly ["hover", "click", "mount", "visible"];
|
|
2
|
+
type LinkPrefetchStrategy = (typeof LINK_PREFETCH_STRATEGIES)[number];
|
|
3
|
+
/** A Link's `prefetch` prop, and the `prefetch.defaultStrategy` of an adapter plugin. */
|
|
4
|
+
type LinkPrefetchValue = boolean | LinkPrefetchStrategy | ReadonlyArray<LinkPrefetchStrategy>;
|
|
1
5
|
type CacheForResult = {
|
|
2
6
|
stale: number;
|
|
3
7
|
expires: number;
|
|
4
8
|
};
|
|
5
9
|
type CacheForInput = number | string | [string, string];
|
|
10
|
+
/** Rejects an invalid `prefetch.defaultStrategy` when the plugin is configured. */
|
|
11
|
+
declare function assertLinkPrefetchValue(value: unknown, name: string): asserts value is LinkPrefetchValue;
|
|
6
12
|
declare function parseCacheFor(value: CacheForInput): CacheForResult;
|
|
7
13
|
type CacheEntry = {
|
|
8
14
|
url: string;
|
|
@@ -26,4 +32,4 @@ declare class PrefetchCache {
|
|
|
26
32
|
flush(url: string, method?: string): void;
|
|
27
33
|
flushAll(): void;
|
|
28
34
|
}
|
|
29
|
-
export {
|
|
35
|
+
export { LinkPrefetchValue as a, parseCacheFor as c, LinkPrefetchStrategy as i, CacheForInput as n, PrefetchCache as o, CacheForResult as r, assertLinkPrefetchValue as s, CacheEntry as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { a as join } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { t as discoverSchema } from "./discover-Dhkzxgdt.mjs";
|
|
3
3
|
import { a as projectAuthConfigImporter, i as loadVoidAuthConfig } from "./config-WlvEcL82.mjs";
|
|
4
|
-
import { c as getDatabaseCasing, p as readConfig } from "./config-
|
|
4
|
+
import { c as getDatabaseCasing, p as readConfig } from "./config-BITKQ3O6.mjs";
|
|
5
5
|
import { s as loadLocalEnv } from "./env-CuzZZyjB.mjs";
|
|
6
6
|
import { i as writeFileIfChanged, n as ensureProjectTsconfig } from "./project-tsconfig-Cf2NFjlM.mjs";
|
|
7
7
|
import { n as generateDbDts } from "./db-types-C_8amnB0.mjs";
|
|
8
8
|
import { n as findEnvFileForPaths, r as generateEnvTypes } from "./env-types-DqzVBKnS.mjs";
|
|
9
|
-
import { t as analyzeApplication } from "./application-routing-
|
|
10
|
-
import { n as generateQueueTypes, r as generateAuthTypes, t as generateRouteTypes } from "./route-types-
|
|
9
|
+
import { t as analyzeApplication } from "./application-routing-P4TggvWp.mjs";
|
|
10
|
+
import { n as generateQueueTypes, r as generateAuthTypes, t as generateRouteTypes } from "./route-types-CZc1YXjF.mjs";
|
|
11
11
|
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-lFdzSEa9.mjs";
|
|
12
12
|
import { existsSync, rmSync } from "node:fs";
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
@@ -38,7 +38,7 @@ async function prepareProject(root) {
|
|
|
38
38
|
} else removeGeneratedFile(outDir, "auth.d.ts", removed);
|
|
39
39
|
const hasRouteTypes = scan.routes.length > 0 || (scan.websockets?.length ?? 0) > 0 || scan.pages.pages.length > 0;
|
|
40
40
|
if (hasRouteTypes) {
|
|
41
|
-
const { dts } = generateRouteTypes(scan, paths.routesDir, outDir, paths.pagesDir);
|
|
41
|
+
const { dts } = generateRouteTypes(scan, paths.routesDir, outDir, paths.pagesDir, { typedRoutes: config.routing?.typedRoutes });
|
|
42
42
|
writeGeneratedFile(outDir, "routes.d.ts", dts, written);
|
|
43
43
|
} else removeGeneratedFile(outDir, "routes.d.ts", removed);
|
|
44
44
|
if (existsSync(paths.queuesDir)) writeGeneratedFile(outDir, "queues.d.ts", generateQueueTypes(scan.queues, paths.queuesDir, outDir), written);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { L as log } from "./dist-D23AAMxT.mjs";
|
|
2
2
|
import { m as printSuccess, p as note } from "./output-BCdLioKP.mjs";
|
|
3
|
-
import { t as prepareProject } from "./prepare-
|
|
3
|
+
import { t as prepareProject } from "./prepare-BJW-f1f1.mjs";
|
|
4
4
|
// src/cli/prepare.ts
|
|
5
5
|
async function runPrepareCommand(root) {
|
|
6
6
|
console.log();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as prepareProject } from "./prepare-BJW-f1f1.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as readDeploymentPlatform } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken, s as getSiteDomain } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { H as outro, 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 { _ as tablePrefix, f as import_picocolors, i as dim, l as formatUrl, o as formatCount } from "./output-BCdLioKP.mjs";
|
|
6
6
|
// src/cli/projects.ts
|
|
7
7
|
async function runProjectsCommand(root) {
|
|
@@ -37,77 +37,77 @@ async function runProjectsCommand(root) {
|
|
|
37
37
|
async function runProjectCommand(root, args) {
|
|
38
38
|
const cloudflare = readDeploymentPlatform(root) === "cloudflare";
|
|
39
39
|
if (args.subcommand === "status") {
|
|
40
|
-
const { runListCommand } = await import("./list-
|
|
40
|
+
const { runListCommand } = await import("./list-BYSOo9fm.mjs");
|
|
41
41
|
return runListCommand(root, args.name || void 0);
|
|
42
42
|
}
|
|
43
43
|
if (args.subcommand === "link") {
|
|
44
44
|
if (cloudflare) throw new Error("project: Direct Cloudflare apps are identified by cloudflare.name in void.config.ts and do not need linking.");
|
|
45
|
-
const { runLink } = await import("./link-
|
|
45
|
+
const { runLink } = await import("./link-DAXOT-G_.mjs");
|
|
46
46
|
return runLink(root, args.name || void 0);
|
|
47
47
|
}
|
|
48
48
|
if (args.subcommand === "list") {
|
|
49
49
|
if (cloudflare) {
|
|
50
|
-
const { runListCommand } = await import("./list-
|
|
50
|
+
const { runListCommand } = await import("./list-BYSOo9fm.mjs");
|
|
51
51
|
return runListCommand(root);
|
|
52
52
|
}
|
|
53
53
|
return runProjectsCommand(root);
|
|
54
54
|
}
|
|
55
55
|
if (args.subcommand === "token") {
|
|
56
56
|
if (cloudflare) throw new Error("project: CI deploy credentials are available only for Void platform projects.");
|
|
57
|
-
const { runProjectTokenCommand } = await import("./project-token-
|
|
57
|
+
const { runProjectTokenCommand } = await import("./project-token-BKHGwY3k.mjs");
|
|
58
58
|
return runProjectTokenCommand(root, args);
|
|
59
59
|
}
|
|
60
60
|
if (args.subcommand === "team") {
|
|
61
61
|
if (args.action === "") {
|
|
62
|
-
const { printHelpPage } = await import("./help-
|
|
62
|
+
const { printHelpPage } = await import("./help-Ba8Dq5-r.mjs");
|
|
63
63
|
printHelpPage(["project", "team"]);
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
66
66
|
const accountInvitationAction = args.action === "pending" || args.action === "accept" || args.action === "decline";
|
|
67
67
|
if (cloudflare && !accountInvitationAction) throw new Error("project: Teams are available only for projects hosted on a Void platform, not direct Cloudflare deployments.");
|
|
68
|
-
const { runProjectTeamCommand } = await import("./project-team-
|
|
68
|
+
const { runProjectTeamCommand } = await import("./project-team-MjT5K4rQ.mjs");
|
|
69
69
|
return runProjectTeamCommand(root, args);
|
|
70
70
|
}
|
|
71
71
|
if (args.subcommand === "zero-trust") {
|
|
72
72
|
if (cloudflare) throw new Error("project: Zero Trust overrides are available only for projects hosted on a Void platform.");
|
|
73
73
|
if (args.action === "") {
|
|
74
|
-
const { printHelpPage } = await import("./help-
|
|
74
|
+
const { printHelpPage } = await import("./help-Ba8Dq5-r.mjs");
|
|
75
75
|
printHelpPage(["project", "zero-trust"]);
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
const action = args.action;
|
|
79
|
-
const { runProjectZeroTrustCommand } = await import("./project-zero-trust-
|
|
79
|
+
const { runProjectZeroTrustCommand } = await import("./project-zero-trust-Bzdd05-h.mjs");
|
|
80
80
|
return runProjectZeroTrustCommand(root, {
|
|
81
81
|
...args,
|
|
82
82
|
action
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
if (args.subcommand === "logs") {
|
|
86
|
-
const { runLogsCommand } = await import("./logs-
|
|
86
|
+
const { runLogsCommand } = await import("./logs-DE0weBsR.mjs");
|
|
87
87
|
return runLogsCommand(root, args.filter, args.range, args.deployment || void 0, args.level || void 0);
|
|
88
88
|
}
|
|
89
89
|
if (args.subcommand === "requests") {
|
|
90
90
|
if (cloudflare) throw new Error("project: Historical request analytics require the Void platform. Use `void project logs` for a live Cloudflare tail.");
|
|
91
|
-
const { runRequestsCommand } = await import("./requests-
|
|
91
|
+
const { runRequestsCommand } = await import("./requests-daJmVpjk.mjs");
|
|
92
92
|
return runRequestsCommand(root, args.range, args.status || void 0);
|
|
93
93
|
}
|
|
94
94
|
if (args.subcommand === "rollback") {
|
|
95
|
-
const { runRollbackCommand } = await import("./rollback-
|
|
95
|
+
const { runRollbackCommand } = await import("./rollback-BgL0wY1J.mjs");
|
|
96
96
|
return runRollbackCommand(root, args.deployId || void 0, args.platform);
|
|
97
97
|
}
|
|
98
98
|
if (args.subcommand === "cancel") {
|
|
99
99
|
if (cloudflare) throw new Error("project: Direct Cloudflare deploys activate only after readiness succeeds, so there is no remote build to cancel.");
|
|
100
|
-
const { runCancelDeployCommand } = await import("./cancel-deploy-
|
|
100
|
+
const { runCancelDeployCommand } = await import("./cancel-deploy-_itbbvY3.mjs");
|
|
101
101
|
return runCancelDeployCommand(root, args.deployId || void 0);
|
|
102
102
|
}
|
|
103
103
|
if (args.subcommand === "delete") {
|
|
104
104
|
if (cloudflare) throw new Error("project: Refusing to delete Cloudflare resources through this command. Direct deployments are additive and existing resources may be shared.");
|
|
105
|
-
const { runDeleteCommand } = await import("./delete-
|
|
105
|
+
const { runDeleteCommand } = await import("./delete-CY4L8fi2.mjs");
|
|
106
106
|
return runDeleteCommand(root, args.name || void 0, { force: args.force });
|
|
107
107
|
}
|
|
108
108
|
if (args.subcommand === "purge-cache") {
|
|
109
109
|
if (cloudflare) throw new Error("project: `void project purge-cache` is available only for projects hosted on a Void platform. For a direct Cloudflare deploy, redeploy or purge the configured ISR KV namespace.");
|
|
110
|
-
const { runPurgeCacheCommand } = await import("./cache-
|
|
110
|
+
const { runPurgeCacheCommand } = await import("./cache-2khBO1MR.mjs");
|
|
111
111
|
return runPurgeCacheCommand(root, args.projectSlug || void 0);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken, i as getAccountCredential } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { H as outro, L as log } 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 { h as sanitizeTerminalText, l as formatUrl, m as printSuccess, o as formatCount, p as note } from "./output-BCdLioKP.mjs";
|
|
6
6
|
import { r as requireProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D0YNnJfm.mjs";
|
|
7
7
|
// src/cli/project-team.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { H as outro, 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 { _ as tablePrefix, i as dim, m as printSuccess } from "./output-BCdLioKP.mjs";
|
|
6
6
|
import { r as requireProjectBySlug } from "./resolve-project-D0YNnJfm.mjs";
|
|
7
7
|
// src/cli/project-token.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-Dy8svcqQ.mjs";
|
|
3
3
|
import { H as outro, 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 { h as sanitizeTerminalText, m as printSuccess, p as note } from "./output-BCdLioKP.mjs";
|
|
6
6
|
import { r as requireProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D0YNnJfm.mjs";
|
|
7
7
|
// src/cli/project-zero-trust.ts
|