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 +1 @@
|
|
|
1
|
-
export { t as
|
|
1
|
+
export { t as assertNoPrerenderFailures, n as outputFileForPath, r as readPrerenderPathsResponse, i as renderPrerenderPaths } from "./prerender-render-CaShbHJ3.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as readDeploymentPlatform } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken, s as getSiteDomain } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
5
5
|
import { _ as tablePrefix, f as import_picocolors, i as dim, l as formatUrl, o as formatCount } from "./output-BpgYODYx.mjs";
|
|
6
6
|
//#region src/cli/projects.ts
|
|
7
7
|
async function runProjectsCommand(root) {
|
|
@@ -38,77 +38,77 @@ async function runProjectsCommand(root) {
|
|
|
38
38
|
async function runProjectCommand(root, args) {
|
|
39
39
|
const cloudflare = readDeploymentPlatform(root) === "cloudflare";
|
|
40
40
|
if (args.subcommand === "status") {
|
|
41
|
-
const { runListCommand } = await import("./list-
|
|
41
|
+
const { runListCommand } = await import("./list-BYRP6am0.mjs");
|
|
42
42
|
return runListCommand(root, args.name || void 0);
|
|
43
43
|
}
|
|
44
44
|
if (args.subcommand === "link") {
|
|
45
45
|
if (cloudflare) throw new Error("project: Direct Cloudflare apps are identified by cloudflare.name in void.config.ts and do not need linking.");
|
|
46
|
-
const { runLink } = await import("./link-
|
|
46
|
+
const { runLink } = await import("./link-Dllip08S.mjs");
|
|
47
47
|
return runLink(root, args.name || void 0);
|
|
48
48
|
}
|
|
49
49
|
if (args.subcommand === "list") {
|
|
50
50
|
if (cloudflare) {
|
|
51
|
-
const { runListCommand } = await import("./list-
|
|
51
|
+
const { runListCommand } = await import("./list-BYRP6am0.mjs");
|
|
52
52
|
return runListCommand(root);
|
|
53
53
|
}
|
|
54
54
|
return runProjectsCommand(root);
|
|
55
55
|
}
|
|
56
56
|
if (args.subcommand === "token") {
|
|
57
57
|
if (cloudflare) throw new Error("project: CI deploy credentials are available only for Void platform projects.");
|
|
58
|
-
const { runProjectTokenCommand } = await import("./project-token-
|
|
58
|
+
const { runProjectTokenCommand } = await import("./project-token-BB6PwaA9.mjs");
|
|
59
59
|
return runProjectTokenCommand(root, args);
|
|
60
60
|
}
|
|
61
61
|
if (args.subcommand === "team") {
|
|
62
62
|
if (args.action === "") {
|
|
63
|
-
const { printHelpPage } = await import("./help-
|
|
63
|
+
const { printHelpPage } = await import("./help-qOZr3wng.mjs");
|
|
64
64
|
printHelpPage(["project", "team"]);
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
const accountInvitationAction = args.action === "pending" || args.action === "accept" || args.action === "decline";
|
|
68
68
|
if (cloudflare && !accountInvitationAction) throw new Error("project: Teams are available only for projects hosted on a Void platform, not direct Cloudflare deployments.");
|
|
69
|
-
const { runProjectTeamCommand } = await import("./project-team-
|
|
69
|
+
const { runProjectTeamCommand } = await import("./project-team-BjCLgTRC.mjs");
|
|
70
70
|
return runProjectTeamCommand(root, args);
|
|
71
71
|
}
|
|
72
72
|
if (args.subcommand === "zero-trust") {
|
|
73
73
|
if (cloudflare) throw new Error("project: Zero Trust overrides are available only for projects hosted on a Void platform.");
|
|
74
74
|
if (args.action === "") {
|
|
75
|
-
const { printHelpPage } = await import("./help-
|
|
75
|
+
const { printHelpPage } = await import("./help-qOZr3wng.mjs");
|
|
76
76
|
printHelpPage(["project", "zero-trust"]);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
const action = args.action;
|
|
80
|
-
const { runProjectZeroTrustCommand } = await import("./project-zero-trust-
|
|
80
|
+
const { runProjectZeroTrustCommand } = await import("./project-zero-trust-CWDh1P_t.mjs");
|
|
81
81
|
return runProjectZeroTrustCommand(root, {
|
|
82
82
|
...args,
|
|
83
83
|
action
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
86
|
if (args.subcommand === "logs") {
|
|
87
|
-
const { runLogsCommand } = await import("./logs-
|
|
87
|
+
const { runLogsCommand } = await import("./logs-DmJTBhed.mjs");
|
|
88
88
|
return runLogsCommand(root, args.filter, args.range, args.deployment || void 0, args.level || void 0);
|
|
89
89
|
}
|
|
90
90
|
if (args.subcommand === "requests") {
|
|
91
91
|
if (cloudflare) throw new Error("project: Historical request analytics require the Void platform. Use `void project logs` for a live Cloudflare tail.");
|
|
92
|
-
const { runRequestsCommand } = await import("./requests-
|
|
92
|
+
const { runRequestsCommand } = await import("./requests-D_pbzDyz.mjs");
|
|
93
93
|
return runRequestsCommand(root, args.range, args.status || void 0);
|
|
94
94
|
}
|
|
95
95
|
if (args.subcommand === "rollback") {
|
|
96
|
-
const { runRollbackCommand } = await import("./rollback-
|
|
96
|
+
const { runRollbackCommand } = await import("./rollback-CjfIYsJx.mjs");
|
|
97
97
|
return runRollbackCommand(root, args.deployId || void 0, args.platform);
|
|
98
98
|
}
|
|
99
99
|
if (args.subcommand === "cancel") {
|
|
100
100
|
if (cloudflare) throw new Error("project: Direct Cloudflare deploys activate only after readiness succeeds, so there is no remote build to cancel.");
|
|
101
|
-
const { runCancelDeployCommand } = await import("./cancel-deploy-
|
|
101
|
+
const { runCancelDeployCommand } = await import("./cancel-deploy-Dw0UmWKO.mjs");
|
|
102
102
|
return runCancelDeployCommand(root, args.deployId || void 0);
|
|
103
103
|
}
|
|
104
104
|
if (args.subcommand === "delete") {
|
|
105
105
|
if (cloudflare) throw new Error("project: Refusing to delete Cloudflare resources through this command. Direct deployments are additive and existing resources may be shared.");
|
|
106
|
-
const { runDeleteCommand } = await import("./delete-
|
|
106
|
+
const { runDeleteCommand } = await import("./delete-lETE6Tpt.mjs");
|
|
107
107
|
return runDeleteCommand(root, args.name || void 0, { force: args.force });
|
|
108
108
|
}
|
|
109
109
|
if (args.subcommand === "purge-cache") {
|
|
110
110
|
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.");
|
|
111
|
-
const { runPurgeCacheCommand } = await import("./cache-
|
|
111
|
+
const { runPurgeCacheCommand } = await import("./cache-jvwLNb0h.mjs");
|
|
112
112
|
return runPurgeCacheCommand(root, args.projectSlug || void 0);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken, i as getAccountCredential } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log } 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 { h as sanitizeTerminalText, l as formatUrl, m as printSuccess, o as formatCount, p as note } from "./output-BpgYODYx.mjs";
|
|
6
6
|
import { r as requireProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
|
|
7
7
|
//#region src/cli/project-team.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
5
5
|
import { _ as tablePrefix, i as dim, m as printSuccess } from "./output-BpgYODYx.mjs";
|
|
6
6
|
import { r as requireProjectBySlug } from "./resolve-project-Xoi6eTWY.mjs";
|
|
7
7
|
//#region src/cli/project-token.ts
|
|
@@ -34,12 +34,14 @@ function createProjectTsconfig(root, hasRouteTypes, hasDb, hasSchema, options =
|
|
|
34
34
|
const includeQueues = existsSync(pathsConfig.queuesDir);
|
|
35
35
|
const includeMd = existsSync(join(outDir, "md.d.ts"));
|
|
36
36
|
const includeEnv = existsSync(join(outDir, "env.d.ts"));
|
|
37
|
+
const includeAuth = existsSync(join(outDir, "auth.d.ts"));
|
|
37
38
|
const tsconfig = { files: [
|
|
38
39
|
...includeRoutes ? ["routes.d.ts"] : [],
|
|
39
40
|
...hasDb ? ["db.d.ts"] : [],
|
|
40
41
|
...includeQueues ? ["queues.d.ts"] : [],
|
|
41
42
|
...includeMd ? ["md.d.ts"] : [],
|
|
42
|
-
...includeEnv ? ["env.d.ts"] : []
|
|
43
|
+
...includeEnv ? ["env.d.ts"] : [],
|
|
44
|
+
...includeAuth ? ["auth.d.ts"] : []
|
|
43
45
|
] };
|
|
44
46
|
if (hasDb) {
|
|
45
47
|
const paths = {};
|
|
@@ -77,5 +79,25 @@ function ensureProjectTsconfig(root, hasRouteTypes, hasDb, hasSchema, options =
|
|
|
77
79
|
const tsconfig = createProjectTsconfig(root, hasRouteTypes, hasDb, hasSchema, options);
|
|
78
80
|
return writeFileIfChanged(join(root, ".void", "tsconfig.json"), JSON.stringify(tsconfig, null, 2) + "\n");
|
|
79
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Add or drop `auth.d.ts` in an existing .void/tsconfig.json to match whether
|
|
84
|
+
* `.void/auth.d.ts` exists, keeping every other entry as written. The dev/build
|
|
85
|
+
* routing plugin uses this after it writes or removes auth.d.ts, so it does not
|
|
86
|
+
* recompute the routes/db choices the Drizzle plugin or `void prepare` made.
|
|
87
|
+
* A missing or unreadable tsconfig is left for those writers to create.
|
|
88
|
+
*/
|
|
89
|
+
function syncAuthTypesInProjectTsconfig(root) {
|
|
90
|
+
const outDir = join(root, ".void");
|
|
91
|
+
const tsconfigPath = join(outDir, "tsconfig.json");
|
|
92
|
+
let tsconfig;
|
|
93
|
+
try {
|
|
94
|
+
tsconfig = JSON.parse(readFileSync(tsconfigPath, "utf8"));
|
|
95
|
+
} catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
const others = (Array.isArray(tsconfig.files) ? tsconfig.files : []).filter((file) => file !== "auth.d.ts");
|
|
99
|
+
tsconfig.files = existsSync(join(outDir, "auth.d.ts")) ? [...others, "auth.d.ts"] : others;
|
|
100
|
+
return writeFileIfChanged(tsconfigPath, JSON.stringify(tsconfig, null, 2) + "\n");
|
|
101
|
+
}
|
|
80
102
|
//#endregion
|
|
81
|
-
export { ensureProjectTsconfig as n,
|
|
103
|
+
export { writeFileIfChanged as i, ensureProjectTsconfig as n, syncAuthTypesInProjectTsconfig as r, createProjectTsconfig as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
5
5
|
import { h as sanitizeTerminalText, m as printSuccess, p as note } from "./output-BpgYODYx.mjs";
|
|
6
6
|
import { r as requireProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Xoi6eTWY.mjs";
|
|
7
7
|
//#region src/cli/project-zero-trust.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as HeadDescriptor, t as HeadConfig } from "./head-C8K_iGe6.mjs";
|
|
2
|
-
import { a as PageRenderMode, t as DevCssAsset } from "./types-
|
|
3
|
-
import { n as CloudBindings, r as CloudContext } from "./handler-
|
|
2
|
+
import { a as PageRenderMode, t as DevCssAsset } from "./types-w72dljaA.mjs";
|
|
3
|
+
import { n as CloudBindings, r as CloudContext } from "./handler-BHktmuTL.mjs";
|
|
4
4
|
//#region src/pages/protocol.d.ts
|
|
5
5
|
/** Escape characters that are unsafe inside inline <script> tags to prevent XSS. */
|
|
6
6
|
declare function safeJsonStringify(value: unknown): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { f as isRealD1Id, p as isRealHyperdriveId } from "./provision-
|
|
1
|
+
export { f as isRealD1Id, p as isRealHyperdriveId } from "./provision-DztLJ97X.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join, c as resolve$2, n as dirname, o as normalize, t as basename } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import { i as voidWarn, r as voidLog } from "./log-BMwmN5Ae.mjs";
|
|
3
|
-
import { M as writeProvisionedWranglerConfig, _ as persistMaterializedWranglerConfig, s as assertNoDuplicateMembers, y as readProvisionedBindingEntry } from "./wrangler-
|
|
3
|
+
import { M as writeProvisionedWranglerConfig, _ as persistMaterializedWranglerConfig, s as assertNoDuplicateMembers, y as readProvisionedBindingEntry } from "./wrangler-I-scB_1t.mjs";
|
|
4
4
|
import { n as scanWranglerDotenvKeys } from "./dotenv-CNazY3-w.mjs";
|
|
5
5
|
import { l as resolveCloudflareOperationArgv, n as decodeCloudflareOperationResult, r as encodeCloudflareOperation } from "./cloudflare-process-8jEYIeim.mjs";
|
|
6
6
|
import { createRequire } from "node:module";
|
|
@@ -91,8 +91,9 @@ const defaultLogger = {
|
|
|
91
91
|
warn: (msg) => voidWarn(msg)
|
|
92
92
|
};
|
|
93
93
|
/**
|
|
94
|
-
* Env vars that move
|
|
95
|
-
* env. Provisioning pins one base ({@link provisionEnv}) and rejects them in project
|
|
94
|
+
* Env vars that move the Cloudflare CLI's API transport to another endpoint or select another
|
|
95
|
+
* config env. Provisioning pins one base ({@link provisionEnv}) and rejects them in project
|
|
96
|
+
* dotenv.
|
|
96
97
|
*/
|
|
97
98
|
const TRANSPORT_REDIRECT_ENV_VARS = [
|
|
98
99
|
"CLOUDFLARE_API_BASE_URL",
|
|
@@ -108,22 +109,36 @@ const TRANSPORT_REDIRECT_ENV_VARS = [
|
|
|
108
109
|
const OUTPUT_FILE_ENV_VARS = ["WRANGLER_OUTPUT_FILE_PATH", "WRANGLER_OUTPUT_FILE_DIRECTORY"];
|
|
109
110
|
/**
|
|
110
111
|
* The one API base URL this provision uses, resolved like wrangler's `getCloudflareApiBaseUrl`
|
|
111
|
-
* so the Hyperdrive REST lister and
|
|
112
|
+
* so the Hyperdrive REST lister and the Cloudflare CLI agree:
|
|
112
113
|
* 1. a present `CLOUDFLARE_API_BASE_URL` (then `CF_API_BASE_URL`) is used as-is, even empty;
|
|
113
114
|
* 2. otherwise the staging and compliance selectors derive it, and invalid values fail;
|
|
114
115
|
* 3. the config's `compliance_region` is always validated.
|
|
115
116
|
*/
|
|
116
117
|
function resolvePinnedApiBaseUrl(env = process.env, configComplianceRegion) {
|
|
117
|
-
const configRegion = configComplianceRegion !== void 0 ? assertComplianceChoice(configComplianceRegion, "the
|
|
118
|
+
const configRegion = configComplianceRegion !== void 0 ? assertComplianceChoice(configComplianceRegion, "the Cloudflare config \"compliance_region\"") : void 0;
|
|
118
119
|
const direct = env.CLOUDFLARE_API_BASE_URL !== void 0 ? env.CLOUDFLARE_API_BASE_URL : env.CF_API_BASE_URL;
|
|
119
120
|
if (direct !== void 0) return direct;
|
|
120
121
|
return `https://api${resolveComplianceRegion(env, configRegion) === "fedramp_high" ? ".fed" : ""}${resolveApiEnvironment(env) === "staging" ? ".staging" : ""}.cloudflare.com/client/v4`;
|
|
121
122
|
}
|
|
123
|
+
/**
|
|
124
|
+
* The compliance region that names the workers.dev host, resolved like wrangler's
|
|
125
|
+
* `getComplianceRegionSubdomain`. It reads the same inputs as {@link resolvePinnedApiBaseUrl},
|
|
126
|
+
* but a direct API base does not skip the region checks, because the base does not name the
|
|
127
|
+
* workers.dev host. Returns undefined for an invalid or conflicting region, so that a caller
|
|
128
|
+
* does not guess a host. Without a direct base, the API base resolution fails first.
|
|
129
|
+
*/
|
|
130
|
+
function resolveWorkersDevComplianceRegion(env = process.env, configComplianceRegion) {
|
|
131
|
+
try {
|
|
132
|
+
return resolveComplianceRegion(env, configComplianceRegion !== void 0 ? assertComplianceChoice(configComplianceRegion, "the Cloudflare config \"compliance_region\"") : void 0);
|
|
133
|
+
} catch {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
122
137
|
/** `WRANGLER_API_ENVIRONMENT` like wrangler: absent means production; other values fail. */
|
|
123
138
|
function resolveApiEnvironment(env) {
|
|
124
139
|
const raw = env.WRANGLER_API_ENVIRONMENT;
|
|
125
140
|
if (raw === void 0) return "production";
|
|
126
|
-
if (raw !== "production" && raw !== "staging") throw new Error(`provision: the WRANGLER_API_ENVIRONMENT environment variable must be one of "production" or "staging", got ${JSON.stringify(raw)}.
|
|
141
|
+
if (raw !== "production" && raw !== "staging") throw new Error(`provision: the WRANGLER_API_ENVIRONMENT environment variable must be one of "production" or "staging", got ${JSON.stringify(raw)}. The Cloudflare tooling rejects this value, so provisioning refuses to guess an endpoint; fix or unset it and retry.`);
|
|
127
142
|
return raw;
|
|
128
143
|
}
|
|
129
144
|
/** Compliance-region values wrangler accepts. */
|
|
@@ -136,7 +151,7 @@ function assertComplianceChoice(value, source) {
|
|
|
136
151
|
function resolveComplianceRegion(env, configRegion) {
|
|
137
152
|
const rawEnv = env.CLOUDFLARE_COMPLIANCE_REGION;
|
|
138
153
|
const envRegion = rawEnv !== void 0 ? assertComplianceChoice(rawEnv, "the CLOUDFLARE_COMPLIANCE_REGION environment variable") : void 0;
|
|
139
|
-
if (envRegion !== void 0 && configRegion !== void 0 && envRegion !== configRegion) throw new Error(`provision: the Cloudflare compliance region is set to conflicting values — the CLOUDFLARE_COMPLIANCE_REGION environment variable is ${JSON.stringify(envRegion)} but the
|
|
154
|
+
if (envRegion !== void 0 && configRegion !== void 0 && envRegion !== configRegion) throw new Error(`provision: the Cloudflare compliance region is set to conflicting values — the CLOUDFLARE_COMPLIANCE_REGION environment variable is ${JSON.stringify(envRegion)} but the Cloudflare config "compliance_region" is ${JSON.stringify(configRegion)}. The Cloudflare tooling refuses to run with a mismatched compliance region; reconcile them (remove one, or set them equal) and retry.`);
|
|
140
155
|
return envRegion ?? configRegion ?? "public";
|
|
141
156
|
}
|
|
142
157
|
/** Project dotenv files the fence scans for `env`; provisioning selects no named env (`''`). */
|
|
@@ -198,6 +213,7 @@ function provisionEnv(ctx) {
|
|
|
198
213
|
scrub("CF_ACCESS_TOKEN");
|
|
199
214
|
scrub("VOID_ACCESS_CREDENTIALS");
|
|
200
215
|
scrub("VOID_ACCESS_ORIGIN");
|
|
216
|
+
scrub("CF_ACCESS_READINESS_ORIGIN");
|
|
201
217
|
for (const name of TRANSPORT_REDIRECT_ENV_VARS) scrub(name);
|
|
202
218
|
for (const name of OUTPUT_FILE_ENV_VARS) scrub(name);
|
|
203
219
|
scrub("WRANGLER_LOG_SANITIZE");
|
|
@@ -1794,4 +1810,4 @@ async function provisionCloudflareResourcesLocked(root, configPath, desired, opt
|
|
|
1794
1810
|
};
|
|
1795
1811
|
}
|
|
1796
1812
|
//#endregion
|
|
1797
|
-
export { provisionEnv as _, checkCloudflareProvisionDrift as a, enableD1ReadReplicationViaApi as c, isQueueConfirmedAbsent as d, isRealD1Id as f, provisionCloudflareResources as g, normalizeRunWranglerResult as h, assertValidResourceName as i, isAlreadyGoneKillError as l, isRealKvId as m, acquireProvisionLock as n, createDefaultRunWrangler as o, isRealHyperdriveId as p, assertNoTransportRedirectInProjectDotenv as r, deleteEnvVarCaseAware as s, WranglerQuarantineError as t, isQuarantineError as u, resolvePinnedApiBaseUrl as v, resolveProperLockfileKey as y };
|
|
1813
|
+
export { provisionEnv as _, checkCloudflareProvisionDrift as a, resolveWorkersDevComplianceRegion as b, enableD1ReadReplicationViaApi as c, isQueueConfirmedAbsent as d, isRealD1Id as f, provisionCloudflareResources as g, normalizeRunWranglerResult as h, assertValidResourceName as i, isAlreadyGoneKillError as l, isRealKvId as m, acquireProvisionLock as n, createDefaultRunWrangler as o, isRealHyperdriveId as p, assertNoTransportRedirectInProjectDotenv as r, deleteEnvVarCaseAware as s, WranglerQuarantineError as t, isQuarantineError as u, resolvePinnedApiBaseUrl as v, resolveProperLockfileKey as y };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { H as outro, L as log } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
5
5
|
import { f as import_picocolors, i as dim } from "./output-BpgYODYx.mjs";
|
|
6
6
|
//#region src/cli/requests.ts
|
|
7
7
|
async function runRequestsCommand(root, range, status) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { A as confirm, H as outro, K as select, L as log, O as cancel, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
5
5
|
import { c as formatRelativeTime, i as dim, m as printSuccess, o as formatCount, r as createSpinner } from "./output-BpgYODYx.mjs";
|
|
6
6
|
//#region src/cli/rollback.ts
|
|
7
7
|
async function runRollbackCommand(root, deployId, explicitPlatform) {
|
|
@@ -74,7 +74,7 @@ async function runRollbackCommand(root, deployId, explicitPlatform) {
|
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
async function runCloudflareRollback(root, deployId, restorePlatformFlag) {
|
|
77
|
-
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
77
|
+
const { activateCloudflareExistingVersion, readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-BtulCNOg.mjs");
|
|
78
78
|
const context = resolveCloudflareOperationContext(root);
|
|
79
79
|
const status = await readCloudflareWorkerStatus(context);
|
|
80
80
|
const deployedVersionIds = new Set(status.deployedVersionIds);
|
|
@@ -1,4 +1,60 @@
|
|
|
1
|
-
import { s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
1
|
+
import { a as join, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { i as writeFileIfChanged } from "./project-tsconfig-CVvk6Z_e.mjs";
|
|
3
|
+
import { existsSync, rmSync } from "node:fs";
|
|
4
|
+
//#region src/codegen/auth-types.ts
|
|
5
|
+
/**
|
|
6
|
+
* Generate `.void/auth.d.ts` content. Fills `void/auth`'s `VoidAuthTypes`
|
|
7
|
+
* registry with Better Auth inference from the app's `defineAuth` config
|
|
8
|
+
* (plugins, `user.additionalFields`, etc.), which `AuthUser` and `AuthSession`
|
|
9
|
+
* read from.
|
|
10
|
+
*
|
|
11
|
+
* Uses `typeof import(...)` on the auth config file so TypeScript handles the
|
|
12
|
+
* inference — codegen never analyses types itself. `better-auth` is reached
|
|
13
|
+
* through `void/auth`'s `InferAuthSession`, because apps usually do not depend
|
|
14
|
+
* on `better-auth` directly and could not resolve it from `.void/`.
|
|
15
|
+
*
|
|
16
|
+
* @param authFileAbs Absolute path to the user's auth config file.
|
|
17
|
+
* @param outDir Absolute path to the project's `.void/` directory.
|
|
18
|
+
*/
|
|
19
|
+
function generateAuthTypes(authFileAbs, outDir) {
|
|
20
|
+
const importPath = relative(outDir, authFileAbs);
|
|
21
|
+
const lines = [];
|
|
22
|
+
lines.push("// Auto-generated by void — do not edit");
|
|
23
|
+
lines.push("export {}");
|
|
24
|
+
lines.push("");
|
|
25
|
+
lines.push("import type { InferAuthSession } from \"void/auth\";");
|
|
26
|
+
lines.push("");
|
|
27
|
+
lines.push(`type _VoidAuthSession = InferAuthSession<typeof import("${importPath}")["default"]>;`);
|
|
28
|
+
lines.push("");
|
|
29
|
+
lines.push("declare module \"void/auth\" {");
|
|
30
|
+
lines.push(" interface VoidAuthTypes {");
|
|
31
|
+
lines.push(" user: _VoidAuthSession[\"user\"];");
|
|
32
|
+
lines.push(" session: _VoidAuthSession[\"session\"];");
|
|
33
|
+
lines.push(" }");
|
|
34
|
+
lines.push("}");
|
|
35
|
+
lines.push("");
|
|
36
|
+
return { dts: lines.join("\n") };
|
|
37
|
+
}
|
|
38
|
+
function authTypesPath(outDir) {
|
|
39
|
+
return join(outDir, "auth.d.ts");
|
|
40
|
+
}
|
|
41
|
+
/** Remove `.void/auth.d.ts` when auth is disabled or the config file is gone. */
|
|
42
|
+
function removeAuthTypesIfPresent(outDir) {
|
|
43
|
+
const filePath = authTypesPath(outDir);
|
|
44
|
+
if (!existsSync(filePath)) return false;
|
|
45
|
+
rmSync(filePath, { force: true });
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Write or remove `.void/auth.d.ts` from the current auth config path.
|
|
50
|
+
* Returns whether the file on disk changed.
|
|
51
|
+
*/
|
|
52
|
+
function syncAuthTypesFile(authConfigPath, outDir) {
|
|
53
|
+
if (!authConfigPath) return removeAuthTypesIfPresent(outDir);
|
|
54
|
+
const { dts } = generateAuthTypes(authConfigPath, outDir);
|
|
55
|
+
return writeFileIfChanged(authTypesPath(outDir), dts);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
2
58
|
//#region src/codegen/queue-types.ts
|
|
3
59
|
/**
|
|
4
60
|
* Generate .void/queues.d.ts content.
|
|
@@ -99,19 +155,29 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
99
155
|
lines.push(" action: never;");
|
|
100
156
|
lines.push(" };");
|
|
101
157
|
lines.push("");
|
|
158
|
+
lines.push(" type PageActionBody<P> = [Extract<P, { body: unknown }>] extends [never]");
|
|
159
|
+
lines.push(" ? Record<string, unknown>");
|
|
160
|
+
lines.push(" : Extract<P, { body: unknown }>[\"body\"];");
|
|
161
|
+
lines.push("");
|
|
162
|
+
lines.push(" type PageNamedActionBody<P, K> = P extends { actions: infer A }");
|
|
163
|
+
lines.push(" ? K extends keyof A");
|
|
164
|
+
lines.push(" ? A[K] extends { body: infer B }");
|
|
165
|
+
lines.push(" ? B");
|
|
166
|
+
lines.push(" : Record<string, unknown>");
|
|
167
|
+
lines.push(" : never");
|
|
168
|
+
lines.push(" : never;");
|
|
169
|
+
lines.push("");
|
|
170
|
+
lines.push(" type PageActionUrl<K extends string, P> = P extends { body: any }");
|
|
171
|
+
lines.push(" ? K");
|
|
172
|
+
lines.push(" : P extends { actions: infer A }");
|
|
173
|
+
lines.push(" ? `${K}?${keyof A & string}`");
|
|
174
|
+
lines.push(" : never;");
|
|
175
|
+
lines.push("");
|
|
102
176
|
lines.push(" export type ResolveActionBody<U extends string> =");
|
|
103
177
|
lines.push(" ParseActionUrl<U>[\"base\"] extends keyof PageActionMap");
|
|
104
178
|
lines.push(" ? ParseActionUrl<U>[\"action\"] extends never");
|
|
105
|
-
lines.push(" ? PageActionMap[ParseActionUrl<U>[\"base\"]]
|
|
106
|
-
lines.push("
|
|
107
|
-
lines.push(" : Record<string, unknown>");
|
|
108
|
-
lines.push(" : PageActionMap[ParseActionUrl<U>[\"base\"]] extends { actions: infer A }");
|
|
109
|
-
lines.push(" ? ParseActionUrl<U>[\"action\"] extends keyof A");
|
|
110
|
-
lines.push(" ? A[ParseActionUrl<U>[\"action\"]] extends { body: infer B }");
|
|
111
|
-
lines.push(" ? B");
|
|
112
|
-
lines.push(" : Record<string, unknown>");
|
|
113
|
-
lines.push(" : never");
|
|
114
|
-
lines.push(" : never");
|
|
179
|
+
lines.push(" ? PageActionBody<PageActionMap[ParseActionUrl<U>[\"base\"]]>");
|
|
180
|
+
lines.push(" : PageNamedActionBody<PageActionMap[ParseActionUrl<U>[\"base\"]], ParseActionUrl<U>[\"action\"]>");
|
|
115
181
|
lines.push(" : Record<string, unknown>;");
|
|
116
182
|
lines.push("");
|
|
117
183
|
lines.push(" export type ResolveActionParams<U extends string> =");
|
|
@@ -122,20 +188,22 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
122
188
|
lines.push(" : never;");
|
|
123
189
|
lines.push("");
|
|
124
190
|
lines.push(" export type HasActionParams<U extends string> =");
|
|
125
|
-
lines.push(" ResolveActionParams<U> extends
|
|
191
|
+
lines.push(" [ResolveActionParams<U>] extends [never]");
|
|
192
|
+
lines.push(" ? false");
|
|
193
|
+
lines.push(" : ResolveActionParams<U> extends Record<string, string> ? true : false;");
|
|
126
194
|
lines.push("");
|
|
127
|
-
lines.push("
|
|
128
|
-
lines.push("
|
|
195
|
+
lines.push(" type ActionFormBaseOptions = {");
|
|
196
|
+
lines.push(" resetOnSuccess?: boolean;");
|
|
197
|
+
lines.push(" };");
|
|
129
198
|
lines.push("");
|
|
130
|
-
lines.push(" export type
|
|
131
|
-
lines.push("
|
|
132
|
-
lines.push("
|
|
133
|
-
lines.push(" }
|
|
134
|
-
lines.push("
|
|
135
|
-
lines.push("
|
|
136
|
-
lines.push("
|
|
137
|
-
lines.push("
|
|
138
|
-
lines.push(" }[keyof PageActionMap]");
|
|
199
|
+
lines.push(" export type ActionFormOptions<U extends string> = ActionFormBaseOptions &");
|
|
200
|
+
lines.push(" (HasActionParams<U> extends true");
|
|
201
|
+
lines.push(" ? { params: ResolveActionParams<U> }");
|
|
202
|
+
lines.push(" : { params?: never });");
|
|
203
|
+
lines.push("");
|
|
204
|
+
lines.push(" export type ActionUrl = {");
|
|
205
|
+
lines.push(" [K in keyof PageActionMap]: PageActionUrl<K & string, PageActionMap[K]>;");
|
|
206
|
+
lines.push(" }[keyof PageActionMap]");
|
|
139
207
|
lines.push("");
|
|
140
208
|
lines.push(" interface RouteMap {");
|
|
141
209
|
const routesByPattern = /* @__PURE__ */ new Map();
|
|
@@ -190,25 +258,36 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
190
258
|
const actionPages = scan.pages.pages.filter((p) => p.methods.includes("action") || p.methods.includes("actions"));
|
|
191
259
|
if (actionPages.length > 0 && pagesDir) {
|
|
192
260
|
lines.push(" interface PageActionMap {");
|
|
261
|
+
const bodiesByPattern = /* @__PURE__ */ new Map();
|
|
193
262
|
for (const page of actionPages) {
|
|
194
263
|
const hasAction = page.methods.includes("action");
|
|
195
264
|
const hasActions = page.methods.includes("actions");
|
|
196
265
|
if (hasAction && hasActions) throw new Error(`pages: Page '${page.pattern}' exports both "action" and "actions". Use one or the other.`);
|
|
197
|
-
|
|
266
|
+
const body = [];
|
|
198
267
|
const importPath = relative(outDir, `${pagesDir}/${page.serverPath}`);
|
|
199
268
|
if (hasActions) {
|
|
200
269
|
const actionsImport = `(typeof import(${JSON.stringify(importPath)}))["actions"]`;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
270
|
+
body.push(` actions: { [K in keyof ${actionsImport}]: {`);
|
|
271
|
+
body.push(` body: ExtractInput<${actionsImport}[K]["__validators"]> extends { body: infer B } ? B : Record<string, unknown>;`);
|
|
272
|
+
body.push(" } };");
|
|
204
273
|
} else {
|
|
205
274
|
const importExpr = `(typeof import(${JSON.stringify(importPath)}))["action"]`;
|
|
206
|
-
|
|
275
|
+
body.push(` body: ExtractInput<${importExpr}["__validators"]> extends { body: infer B } ? B : Record<string, unknown>;`);
|
|
207
276
|
}
|
|
208
277
|
if (page.params.length > 0) {
|
|
209
278
|
const paramsType = page.params.map((p) => `${p}: string`).join("; ");
|
|
210
|
-
|
|
279
|
+
body.push(` params: { ${paramsType} };`);
|
|
211
280
|
}
|
|
281
|
+
const bodies = bodiesByPattern.get(page.pattern);
|
|
282
|
+
if (bodies) bodies.push(body);
|
|
283
|
+
else bodiesByPattern.set(page.pattern, [body]);
|
|
284
|
+
}
|
|
285
|
+
for (const [pattern, bodies] of bodiesByPattern) {
|
|
286
|
+
lines.push(` ${JSON.stringify(pattern)}: {`);
|
|
287
|
+
bodies.forEach((body, index) => {
|
|
288
|
+
if (index > 0) lines.push(" } | {");
|
|
289
|
+
lines.push(...body);
|
|
290
|
+
});
|
|
212
291
|
lines.push(" };");
|
|
213
292
|
}
|
|
214
293
|
lines.push(" }");
|
|
@@ -218,4 +297,4 @@ function generateRouteTypes(scan, routesDir, outDir, pagesDir) {
|
|
|
218
297
|
return { dts: lines.join("\n") };
|
|
219
298
|
}
|
|
220
299
|
//#endregion
|
|
221
|
-
export { generateQueueTypes as n, generateRouteTypes as t };
|
|
300
|
+
export { syncAuthTypesFile as a, removeAuthTypesIfPresent as i, generateQueueTypes as n, generateAuthTypes as r, generateRouteTypes as t };
|
package/dist/routes-stub.d.mts
CHANGED
|
@@ -26,29 +26,38 @@ export type ParseActionUrl<U extends string> = U extends `${infer Base}?${infer
|
|
|
26
26
|
action: never;
|
|
27
27
|
};
|
|
28
28
|
/** Resolve body type for a useForm URL (single action or named action) */
|
|
29
|
-
|
|
30
|
-
body:
|
|
31
|
-
}
|
|
29
|
+
type PageActionBody<P> = [Extract<P, {
|
|
30
|
+
body: unknown;
|
|
31
|
+
}>] extends [never] ? Record<string, unknown> : Extract<P, {
|
|
32
|
+
body: unknown;
|
|
33
|
+
}>["body"];
|
|
34
|
+
type PageNamedActionBody<P, K> = P extends {
|
|
32
35
|
actions: infer A;
|
|
33
|
-
} ?
|
|
36
|
+
} ? K extends keyof A ? A[K] extends {
|
|
34
37
|
body: infer B;
|
|
35
|
-
} ? B : Record<string, unknown> : never : never
|
|
38
|
+
} ? B : Record<string, unknown> : never : never;
|
|
39
|
+
export type ResolveActionBody<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? ParseActionUrl<U>["action"] extends never ? PageActionBody<PageActionMap[ParseActionUrl<U>["base"]]> : PageNamedActionBody<PageActionMap[ParseActionUrl<U>["base"]], ParseActionUrl<U>["action"]> : Record<string, unknown>;
|
|
36
40
|
/** Resolve params type */
|
|
37
41
|
export type ResolveActionParams<U extends string> = ParseActionUrl<U>["base"] extends keyof PageActionMap ? PageActionMap[ParseActionUrl<U>["base"]] extends {
|
|
38
42
|
params: infer P;
|
|
39
43
|
} ? P : never : never;
|
|
40
44
|
/** Has params check */
|
|
41
|
-
export type HasActionParams<U extends string> = ResolveActionParams<U> extends Record<string, string> ? true : false;
|
|
45
|
+
export type HasActionParams<U extends string> = [ResolveActionParams<U>] extends [never] ? false : ResolveActionParams<U> extends Record<string, string> ? true : false;
|
|
46
|
+
type ActionFormBaseOptions = {
|
|
47
|
+
resetOnSuccess?: boolean;
|
|
48
|
+
};
|
|
42
49
|
/** Form options type (requires params for dynamic routes) */
|
|
43
|
-
export type ActionFormOptions<U extends string> = HasActionParams<U> extends true ? {
|
|
50
|
+
export type ActionFormOptions<U extends string> = ActionFormBaseOptions & (HasActionParams<U> extends true ? {
|
|
44
51
|
params: ResolveActionParams<U>;
|
|
45
52
|
} : {
|
|
46
53
|
params?: never;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export type ActionUrl = { [K in keyof PageActionMap]: PageActionMap[K] extends {
|
|
54
|
+
});
|
|
55
|
+
type PageActionUrl<K extends string, P> = P extends {
|
|
50
56
|
body: unknown;
|
|
51
|
-
} ? K :
|
|
57
|
+
} ? K : P extends {
|
|
52
58
|
actions: infer A;
|
|
53
|
-
} ? `${K
|
|
54
|
-
|
|
59
|
+
} ? `${K}?${keyof A & string}` : never;
|
|
60
|
+
/** Valid useForm URLs — single-action pages + "page?name" combos + default actions */
|
|
61
|
+
export type ActionUrl = { [K in keyof PageActionMap]: PageActionUrl<K & string, PageActionMap[K]>; }[keyof PageActionMap];
|
|
62
|
+
//#endregion
|
|
63
|
+
export {};
|
package/dist/runtime/auth.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { AuthSession, AuthState, AuthUser, VoidAuthConfig, VoidAuthConfigContext, authContext, defineAuth, getSession, getUser, requireAuth };
|
|
1
|
+
import { a as VoidAuthConfig, c as authContext, d as getUser, f as requireAuth, i as InferAuthSession, l as defineAuth, n as AuthState, o as VoidAuthConfigContext, r as AuthUser, s as VoidAuthTypes, t as AuthSession, u as getSession } from "../auth-g2TQbDLD.mjs";
|
|
2
|
+
export { AuthSession, AuthState, AuthUser, InferAuthSession, VoidAuthConfig, VoidAuthConfigContext, VoidAuthTypes, authContext, defineAuth, getSession, getUser, requireAuth };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-
|
|
1
|
+
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-BHB8kiTE.mjs";
|
|
2
2
|
//#region src/runtime/better-auth-mysql.d.ts
|
|
3
3
|
export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
|
|
4
4
|
export declare const runVoidAuthMiddleware: VoidAuthRuntimeApi["runVoidAuthMiddleware"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as mysqlMigrationRunner, t as applyMySqlAuthMigrations } from "../auth-migrations-BO27GDNr.mjs";
|
|
2
|
-
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
2
|
+
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-7FM3Uk2N.mjs";
|
|
3
3
|
//#region src/runtime/better-auth-mysql.ts
|
|
4
4
|
async function applyMigrations(env, migrationSchema) {
|
|
5
5
|
const { createConnection } = await import("mysql2/promise");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-
|
|
1
|
+
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-BHB8kiTE.mjs";
|
|
2
2
|
//#region src/runtime/better-auth-pg.d.ts
|
|
3
3
|
export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
|
|
4
4
|
export declare const runVoidAuthMiddleware: VoidAuthRuntimeApi["runVoidAuthMiddleware"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as pgMigrationRunner, n as applyPgAuthMigrations } from "../auth-migrations-BO27GDNr.mjs";
|
|
2
|
-
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
2
|
+
import { n as resolveConnectionString, t as createVoidAuthRuntime } from "../better-auth-shared-7FM3Uk2N.mjs";
|
|
3
3
|
import { t as disablePgPassFallback } from "../pg-J2HbZIkX.mjs";
|
|
4
4
|
//#region src/runtime/better-auth-pg.ts
|
|
5
5
|
async function applyMigrations(env, migrationSchema) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-
|
|
1
|
+
import { n as VoidAuthRuntimeApi } from "../better-auth-shared-BHB8kiTE.mjs";
|
|
2
2
|
//#region src/runtime/better-auth.d.ts
|
|
3
3
|
export declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
|
|
4
4
|
export declare const resolveVoidAuthState: VoidAuthRuntimeApi["resolveVoidAuthState"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as applySqliteAuthMigrations } from "../auth-migrations-BO27GDNr.mjs";
|
|
2
|
-
import { t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
2
|
+
import { t as createVoidAuthRuntime } from "../better-auth-shared-7FM3Uk2N.mjs";
|
|
3
3
|
//#region src/runtime/better-auth.ts
|
|
4
4
|
async function applyMigrations(env, migrationSchema) {
|
|
5
5
|
const database = env.DB;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-g2TQbDLD.mjs";
|
|
2
2
|
import { n as createAuthClient, t as auth } from "../auth-client-react-7GFffu8R.mjs";
|
|
3
3
|
import { c as FetchError, s as fetch } from "../fetch-CUX0tB78.mjs";
|
|
4
4
|
import { t as fetchStream } from "../fetch-stream-DfkAzZf-.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-g2TQbDLD.mjs";
|
|
2
2
|
import { n as createAuthClient, t as auth } from "../auth-client-solid-DyTFL4cq.mjs";
|
|
3
3
|
import { c as FetchError, s as fetch } from "../fetch-CUX0tB78.mjs";
|
|
4
4
|
import { t as fetchStream } from "../fetch-stream-DfkAzZf-.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-g2TQbDLD.mjs";
|
|
2
2
|
import { n as createAuthClient, t as auth } from "../auth-client-svelte-zetW0KIH.mjs";
|
|
3
3
|
import { c as FetchError, s as fetch } from "../fetch-CUX0tB78.mjs";
|
|
4
4
|
import { t as fetchStream } from "../fetch-stream-DfkAzZf-.mjs";
|