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
package/dist/cli/cli.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import { t as formatCloudflareUserMessage } from "../cloudflare-user-output-Q-k0
|
|
|
4
4
|
import { n as getOwnVersion } from "../agents-CuNtT0D_.mjs";
|
|
5
5
|
import { f as import_picocolors, l as formatUrl } from "../output-BpgYODYx.mjs";
|
|
6
6
|
import { n as isD1Bookmark } from "../cf-command-values-ByHk0xg4.mjs";
|
|
7
|
-
import { i as printVoidHeader, n as printGlobalHelp, r as printHelpPage, t as getHelpPath } from "../help-
|
|
7
|
+
import { i as printVoidHeader, n as printGlobalHelp, r as printHelpPage, t as getHelpPath } from "../help-CKbrhZha.mjs";
|
|
8
8
|
import { r as OperatorClientError } from "../operator-client-C-ROjk1I.mjs";
|
|
9
|
-
import { n as operatorGroups } from "../operator-args-
|
|
10
|
-
import { n as platformSubcommands, t as parsePlatformArgs } from "../platform-args-
|
|
9
|
+
import { n as operatorGroups } from "../operator-args-BsJIYXaT.mjs";
|
|
10
|
+
import { n as platformSubcommands, t as parsePlatformArgs } from "../platform-args-BMD2gjc_.mjs";
|
|
11
11
|
import { parseArgs } from "node:util";
|
|
12
12
|
//#region src/cli/account-args.ts
|
|
13
13
|
const accountSubcommands = [
|
|
@@ -627,6 +627,11 @@ const emailSubcommands = [
|
|
|
627
627
|
arg: "<address>",
|
|
628
628
|
description: "Remove a verified recipient"
|
|
629
629
|
},
|
|
630
|
+
{
|
|
631
|
+
name: "alias",
|
|
632
|
+
arg: "[name]",
|
|
633
|
+
description: "Show the shared mail address, or set a shorter permanent name for it"
|
|
634
|
+
},
|
|
630
635
|
{
|
|
631
636
|
name: "domain",
|
|
632
637
|
arg: "<add|status|list|sync|rotate-secret|remove>",
|
|
@@ -649,6 +654,7 @@ const EMAIL_SUBCOMMANDS = [
|
|
|
649
654
|
"destinations",
|
|
650
655
|
"allow",
|
|
651
656
|
"disallow",
|
|
657
|
+
"alias",
|
|
652
658
|
"domain",
|
|
653
659
|
"status",
|
|
654
660
|
"setup"
|
|
@@ -685,11 +691,12 @@ function readFlagValue(rest, i, flag) {
|
|
|
685
691
|
}
|
|
686
692
|
function parseEmailArgs(args) {
|
|
687
693
|
const subcommand = args[0];
|
|
688
|
-
if (!subcommand || !EMAIL_SUBCOMMANDS.includes(subcommand)) throw new Error("email: Usage: void email <usage|logs|destinations|allow|disallow|domain|status|setup> [args] [--project <name>] [--limit <n>] [--platform cloudflare].");
|
|
694
|
+
if (!subcommand || !EMAIL_SUBCOMMANDS.includes(subcommand)) throw new Error("email: Usage: void email <usage|logs|destinations|allow|disallow|alias|domain|status|setup> [args] [--project <name>] [--limit <n>] [--platform cloudflare].");
|
|
689
695
|
let limit;
|
|
690
696
|
const projectValues = [];
|
|
691
697
|
const platformValues = [];
|
|
692
698
|
const positional = [];
|
|
699
|
+
let yes = false;
|
|
693
700
|
const rest = args.slice(1);
|
|
694
701
|
for (let i = 0; i < rest.length; i++) if (rest[i] === "--project" || rest[i]?.startsWith("--project=")) {
|
|
695
702
|
const { value, next } = readFlagValue(rest, i, "--project");
|
|
@@ -708,7 +715,8 @@ function parseEmailArgs(args) {
|
|
|
708
715
|
if (value === void 0) throw new Error("email: --platform requires a value ('cloudflare' or 'void').");
|
|
709
716
|
platformValues.push(value);
|
|
710
717
|
i = next;
|
|
711
|
-
} else if (rest[i] === "--
|
|
718
|
+
} else if (rest[i] === "--yes" && subcommand === "alias") yes = true;
|
|
719
|
+
else if (rest[i] === "--backend" || rest[i]?.startsWith("--backend=")) throw new Error("email: Unknown option '--backend'.");
|
|
712
720
|
else if (rest[i] === "--subdomain" || rest[i]?.startsWith("--subdomain=")) throw new Error("email: Unknown option '--subdomain'.");
|
|
713
721
|
else positional.push(rest[i]);
|
|
714
722
|
if (projectValues.length > 1) throw new Error("email: --project can only be specified once.");
|
|
@@ -741,7 +749,8 @@ function parseEmailArgs(args) {
|
|
|
741
749
|
projectSlug,
|
|
742
750
|
limit,
|
|
743
751
|
address,
|
|
744
|
-
platform
|
|
752
|
+
platform,
|
|
753
|
+
...yes ? { yes } : {}
|
|
745
754
|
};
|
|
746
755
|
}
|
|
747
756
|
/**
|
|
@@ -1632,19 +1641,19 @@ const args = process.argv.slice(2);
|
|
|
1632
1641
|
const command = args[0];
|
|
1633
1642
|
const helpPath = getHelpPath(args);
|
|
1634
1643
|
const subcommandGroups = {
|
|
1635
|
-
auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-
|
|
1636
|
-
account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-
|
|
1637
|
-
platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-
|
|
1638
|
-
cloudflare: () => runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-
|
|
1639
|
-
project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-
|
|
1640
|
-
secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-
|
|
1641
|
-
domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-
|
|
1642
|
-
email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-
|
|
1643
|
-
db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-
|
|
1644
|
-
env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-
|
|
1645
|
-
gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-
|
|
1646
|
-
github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-
|
|
1647
|
-
build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-
|
|
1644
|
+
auth: () => runSubcommandGroup("auth", authSubcommands, parseAuthArgs, (root, parsed) => import("../auth-router-vafo7x8w.mjs").then(({ runAuthRouter }) => runAuthRouter(root, parsed))),
|
|
1645
|
+
account: () => runSubcommandGroup("account", accountSubcommands, parseAccountArgs, (root, parsed) => import("../account-cmd-HP8bixYo.mjs").then(({ runAccountCommand }) => runAccountCommand(root, parsed))),
|
|
1646
|
+
platform: () => runSubcommandGroup("platform", platformSubcommands, parsePlatformArgs, (root, parsed) => import("../platform-cmd-CV8NxIIn.mjs").then(({ runPlatformCommand }) => runPlatformCommand(root, parsed))),
|
|
1647
|
+
cloudflare: () => runSubcommandGroup("cloudflare", cloudflareSubcommands, parseCloudflareArgs, (root, parsed) => import("../cloudflare-cmd-D-b_u3T4.mjs").then(({ runCloudflareCommand }) => runCloudflareCommand(root, parsed))),
|
|
1648
|
+
project: () => runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-DBYqAIbe.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed))),
|
|
1649
|
+
secret: () => runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-3X0PxmuX.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed))),
|
|
1650
|
+
domain: () => runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-DyhNtdYf.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed))),
|
|
1651
|
+
email: () => runSubcommandGroup("email", emailSubcommands, parseEmailArgs, (root, parsed) => import("../email-DM2wDcBN.mjs").then(({ runEmailCommand }) => runEmailCommand(root, parsed))),
|
|
1652
|
+
db: () => runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-Cdvr3zwG.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed))),
|
|
1653
|
+
env: () => runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-78hbN-oI.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed))),
|
|
1654
|
+
gen: () => runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-BhWBT4iu.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed))),
|
|
1655
|
+
github: () => runSubcommandGroup("github", githubSubcommands, parseGithubArgs, (root, parsed) => import("../github-cmd-De-_IWbM.mjs").then(({ runGithubCommand }) => runGithubCommand(root, parsed))),
|
|
1656
|
+
build: () => runSubcommandGroup("build", buildSubcommands, parseBuildArgs, (root, parsed) => import("../build-cmd-9vUAQ1_V.mjs").then(({ runBuildCommand }) => runBuildCommand(root, parsed)))
|
|
1648
1657
|
};
|
|
1649
1658
|
if (helpPath) {
|
|
1650
1659
|
if (helpPath.length === 0) printGlobalHelp();
|
|
@@ -1663,7 +1672,7 @@ if (helpPath) {
|
|
|
1663
1672
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
1664
1673
|
process.exit(1);
|
|
1665
1674
|
}
|
|
1666
|
-
import("../deploy-
|
|
1675
|
+
import("../deploy-CX94CmKa.mjs").then(({ runDeploy }) => {
|
|
1667
1676
|
runDeploy(root, deployArgs).catch((err) => {
|
|
1668
1677
|
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
1669
1678
|
process.exit(1);
|
|
@@ -1671,14 +1680,14 @@ if (helpPath) {
|
|
|
1671
1680
|
});
|
|
1672
1681
|
} else if (command === "connect") (async () => {
|
|
1673
1682
|
const parsed = parseConnectArgs(args.slice(1));
|
|
1674
|
-
const { runConnectCommand } = await import("../connect-
|
|
1683
|
+
const { runConnectCommand } = await import("../connect-BOM6zvFX.mjs");
|
|
1675
1684
|
await runConnectCommand(process.cwd(), parsed);
|
|
1676
1685
|
})().catch((err) => {
|
|
1677
1686
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
1678
1687
|
process.exit(1);
|
|
1679
1688
|
});
|
|
1680
1689
|
else if (command && Object.hasOwn(subcommandGroups, command)) subcommandGroups[command]();
|
|
1681
|
-
else if (command === "info") import("../info-
|
|
1690
|
+
else if (command === "info") import("../info-Yg0-V5Rs.mjs").then(async ({ runInfoCommand }) => {
|
|
1682
1691
|
try {
|
|
1683
1692
|
await runInfoCommand(process.cwd(), parseInfoArgs(args.slice(1)));
|
|
1684
1693
|
} catch (err) {
|
|
@@ -1699,7 +1708,7 @@ else if (command === "prepare") {
|
|
|
1699
1708
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
1700
1709
|
process.exit(1);
|
|
1701
1710
|
}
|
|
1702
|
-
import("../prepare-
|
|
1711
|
+
import("../prepare-BuOS18AM.mjs").then(({ runPrepareCommand }) => {
|
|
1703
1712
|
runPrepareCommand(root).catch((err) => {
|
|
1704
1713
|
log.error(formatCloudflareUserMessage(err.message ?? String(err)));
|
|
1705
1714
|
process.exit(1);
|
|
@@ -1707,7 +1716,7 @@ else if (command === "prepare") {
|
|
|
1707
1716
|
});
|
|
1708
1717
|
} else if (command === "init") {
|
|
1709
1718
|
const root = process.cwd();
|
|
1710
|
-
import("../init-
|
|
1719
|
+
import("../init-CDiJQycf.mjs").then(({ runInitCommand, parseInitArgs }) => {
|
|
1711
1720
|
let initArgs;
|
|
1712
1721
|
try {
|
|
1713
1722
|
initArgs = parseInitArgs(args.slice(1));
|
|
@@ -1725,7 +1734,7 @@ else if (command === "prepare") {
|
|
|
1725
1734
|
log.error("migrate: This command takes no arguments.");
|
|
1726
1735
|
process.exit(1);
|
|
1727
1736
|
}
|
|
1728
|
-
import("../migrate-
|
|
1737
|
+
import("../migrate-BIYTPQE6.mjs").then(({ runMigrateCommand }) => {
|
|
1729
1738
|
runMigrateCommand(process.cwd()).catch((err) => {
|
|
1730
1739
|
log.error(formatCloudflareUserMessage(err instanceof Error ? err.message : String(err)));
|
|
1731
1740
|
process.exit(1);
|
|
@@ -1800,7 +1809,7 @@ else if (command) {
|
|
|
1800
1809
|
},
|
|
1801
1810
|
{
|
|
1802
1811
|
name: "email",
|
|
1803
|
-
hint: "usage | logs | destinations | allow | disallow | domain | status | setup",
|
|
1812
|
+
hint: "usage | logs | destinations | allow | disallow | alias | domain | status | setup",
|
|
1804
1813
|
description: "Inspect email activity and manage verified recipients"
|
|
1805
1814
|
},
|
|
1806
1815
|
{
|
|
@@ -1847,32 +1856,32 @@ else if (command) {
|
|
|
1847
1856
|
if (Object.hasOwn(subcommandGroups, cmd)) return subcommandGroups[cmd]();
|
|
1848
1857
|
switch (cmd) {
|
|
1849
1858
|
case "connect": {
|
|
1850
|
-
const { runConnectCommand } = await import("../connect-
|
|
1859
|
+
const { runConnectCommand } = await import("../connect-BOM6zvFX.mjs");
|
|
1851
1860
|
await runConnectCommand(root, parseConnectArgs([]));
|
|
1852
1861
|
return;
|
|
1853
1862
|
}
|
|
1854
1863
|
case "init": {
|
|
1855
|
-
const { runInitCommand, parseInitArgs } = await import("../init-
|
|
1864
|
+
const { runInitCommand, parseInitArgs } = await import("../init-CDiJQycf.mjs");
|
|
1856
1865
|
await runInitCommand(root, parseInitArgs([]));
|
|
1857
1866
|
return;
|
|
1858
1867
|
}
|
|
1859
1868
|
case "migrate": {
|
|
1860
|
-
const { runMigrateCommand } = await import("../migrate-
|
|
1869
|
+
const { runMigrateCommand } = await import("../migrate-BIYTPQE6.mjs");
|
|
1861
1870
|
await runMigrateCommand(root);
|
|
1862
1871
|
return;
|
|
1863
1872
|
}
|
|
1864
1873
|
case "deploy": {
|
|
1865
|
-
const { runDeploy } = await import("../deploy-
|
|
1874
|
+
const { runDeploy } = await import("../deploy-CX94CmKa.mjs");
|
|
1866
1875
|
await runDeploy(root);
|
|
1867
1876
|
return;
|
|
1868
1877
|
}
|
|
1869
1878
|
case "info": {
|
|
1870
|
-
const { runInfoCommand } = await import("../info-
|
|
1879
|
+
const { runInfoCommand } = await import("../info-Yg0-V5Rs.mjs");
|
|
1871
1880
|
await runInfoCommand(root, parseInfoArgs([]));
|
|
1872
1881
|
return;
|
|
1873
1882
|
}
|
|
1874
1883
|
case "prepare": {
|
|
1875
|
-
const { runPrepareCommand } = await import("../prepare-
|
|
1884
|
+
const { runPrepareCommand } = await import("../prepare-BuOS18AM.mjs");
|
|
1876
1885
|
await runPrepareCommand(root);
|
|
1877
1886
|
return;
|
|
1878
1887
|
}
|
|
@@ -4,7 +4,7 @@ import { a as join, c as resolve, n as dirname } from "../dist-ipQi0Q8y.mjs";
|
|
|
4
4
|
import { t as require_picocolors } from "../picocolors-BsDfhxIw.mjs";
|
|
5
5
|
import { l as formatUrl } from "../output-BpgYODYx.mjs";
|
|
6
6
|
import { i as safePositional, n as isD1Bookmark, r as readCfUploadOutput, t as CF_VERSION_SOURCE_MAX_OUTPUT_BYTES } from "../cf-command-values-ByHk0xg4.mjs";
|
|
7
|
-
import { n as getCfCliVersion, r as getVoidUserAgent, t as
|
|
7
|
+
import { n as getCfCliVersion, r as getVoidUserAgent, t as publishCloudflareWorkerSettings } from "../cf-worker-settings-Dg27RzyT.mjs";
|
|
8
8
|
import { t as sanitizeTerminalLogText } from "../terminal-log-text-D9ACPOuG.mjs";
|
|
9
9
|
import { copyFileSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
@@ -254,7 +254,7 @@ async function withBuildOutput(raw, sourceMain, action) {
|
|
|
254
254
|
}), { mode: 384 });
|
|
255
255
|
const accountId = process.env.CLOUDFLARE_ACCOUNT_ID ?? raw.account_id;
|
|
256
256
|
if (typeof accountId !== "string" || !accountId) throw new Error("Cloudflare account is not pinned for Worker deployment.");
|
|
257
|
-
const { prepareCfBuildOutput } = await import("../cf-build-output-
|
|
257
|
+
const { prepareCfBuildOutput } = await import("../cf-build-output-bd8Uwv1P.mjs");
|
|
258
258
|
const output = await prepareCfBuildOutput(scratch, accountId);
|
|
259
259
|
if (!output) throw new Error("Could not prepare the Cloudflare Worker build output.");
|
|
260
260
|
try {
|
|
@@ -530,6 +530,25 @@ function listAllResourcePages(command, extraFlags = []) {
|
|
|
530
530
|
}
|
|
531
531
|
throw new Error(`Cloudflare ${command.join(" ")} exceeded the supported page limit.`);
|
|
532
532
|
}
|
|
533
|
+
/**
|
|
534
|
+
* Each consumer's Worker script name, or null for one that is not a Worker (HTTP pull).
|
|
535
|
+
* Undefined when the list is incomplete or unreadable; only queue naming needs it.
|
|
536
|
+
*/
|
|
537
|
+
function queueConsumerWorkers(queue) {
|
|
538
|
+
const consumers = queue.consumers;
|
|
539
|
+
if (!Array.isArray(consumers) || queue.consumers_total_count !== void 0 && queue.consumers_total_count !== consumers.length) return;
|
|
540
|
+
const workers = [];
|
|
541
|
+
for (const entry of consumers) {
|
|
542
|
+
const consumer = object(entry);
|
|
543
|
+
const { script_name: scriptName, script } = consumer;
|
|
544
|
+
if (scriptName !== void 0 && (typeof scriptName !== "string" || !scriptName) || script !== void 0 && (typeof script !== "string" || !script) || scriptName !== void 0 && script !== void 0 && scriptName !== script) return;
|
|
545
|
+
const name = scriptName ?? script;
|
|
546
|
+
if (typeof name === "string" && (consumer.type === void 0 || consumer.type === "worker")) workers.push(name);
|
|
547
|
+
else if (name === void 0 && consumer.type === "http_pull") workers.push(null);
|
|
548
|
+
else return;
|
|
549
|
+
}
|
|
550
|
+
return workers;
|
|
551
|
+
}
|
|
533
552
|
async function readAllQueues() {
|
|
534
553
|
const queues = [];
|
|
535
554
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -550,12 +569,16 @@ async function readAllQueues() {
|
|
|
550
569
|
}
|
|
551
570
|
async function resources() {
|
|
552
571
|
switch (operation.type) {
|
|
572
|
+
case "workers.subdomain.get": {
|
|
573
|
+
const { subdomain } = object((await cloudflareApiGet(`/accounts/${encodeURIComponent(accountId())}/workers/subdomain`, "Cloudflare did not return the account workers.dev subdomain.")).result);
|
|
574
|
+
if (typeof subdomain !== "string" || !subdomain.trim()) throw new Error("Cloudflare returned an invalid account workers.dev subdomain.");
|
|
575
|
+
return result(0, "", "", { subdomain });
|
|
576
|
+
}
|
|
553
577
|
case "d1.execute": return runCf([
|
|
554
578
|
"d1",
|
|
555
579
|
"query",
|
|
556
580
|
d1Database(operation.database).id,
|
|
557
|
-
|
|
558
|
-
operation.sql
|
|
581
|
+
`--sql=${operation.sql}`
|
|
559
582
|
]);
|
|
560
583
|
case "d1.migrations.list":
|
|
561
584
|
case "d1.migrations.apply": {
|
|
@@ -718,9 +741,11 @@ async function resources() {
|
|
|
718
741
|
]);
|
|
719
742
|
case "queues.info": {
|
|
720
743
|
const queue = (await readAllQueues()).find((item) => item.queue_name === operation.name);
|
|
744
|
+
const consumers = queue && queueConsumerWorkers(queue);
|
|
721
745
|
return queue ? result(0, "", "", {
|
|
722
746
|
id: queue.queue_id,
|
|
723
|
-
name: queue.queue_name
|
|
747
|
+
name: queue.queue_name,
|
|
748
|
+
...consumers ? { consumers } : {}
|
|
724
749
|
}) : {
|
|
725
750
|
...result(1, "", "Cloudflare Queue does not exist."),
|
|
726
751
|
failure: "not-found"
|
|
@@ -944,7 +969,8 @@ async function workerHistory() {
|
|
|
944
969
|
strategy: "percentage",
|
|
945
970
|
versions,
|
|
946
971
|
...operation.message ? { annotations: { "workers/message": operation.message } } : {}
|
|
947
|
-
})
|
|
972
|
+
}),
|
|
973
|
+
...operation.bypassDeploymentChecks ? ["--bypass-deployment-checks"] : []
|
|
948
974
|
]);
|
|
949
975
|
}
|
|
950
976
|
default: throw new Error("Unsupported Cloudflare Worker history operation.");
|
|
@@ -1002,11 +1028,12 @@ async function workerChanges() {
|
|
|
1002
1028
|
"deploy",
|
|
1003
1029
|
"--prebuilt"
|
|
1004
1030
|
], directory));
|
|
1005
|
-
if (deployed.status === 0 && raw.observability !== void 0) await
|
|
1031
|
+
if (deployed.status === 0 && (raw.observability !== void 0 || raw.logpush !== void 0)) await publishCloudflareWorkerSettings({
|
|
1006
1032
|
apiBaseUrl: apiBaseUrl(),
|
|
1007
1033
|
accountId: accountId(),
|
|
1008
1034
|
workerName: name,
|
|
1009
1035
|
observability: raw.observability,
|
|
1036
|
+
logpush: raw.logpush,
|
|
1010
1037
|
headers: await apiHeaders()
|
|
1011
1038
|
});
|
|
1012
1039
|
return deployed;
|
|
@@ -1023,7 +1050,7 @@ async function workerChanges() {
|
|
|
1023
1050
|
"create"
|
|
1024
1051
|
],
|
|
1025
1052
|
"--prebuilt",
|
|
1026
|
-
...request.message ? [
|
|
1053
|
+
...request.message ? [`--message=${request.message}`] : [],
|
|
1027
1054
|
...request.secretsFilePath ? ["--secrets-file", request.secretsFilePath] : []
|
|
1028
1055
|
], directory, void 0, request.interactive === true));
|
|
1029
1056
|
if (called.status !== 0 || request.interactive === true) return called;
|
|
@@ -109,7 +109,7 @@ function emitResult(result) {
|
|
|
109
109
|
writeSync(RESULT_FD, JSON.stringify(result));
|
|
110
110
|
}
|
|
111
111
|
async function runFactsChild(root) {
|
|
112
|
-
const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-
|
|
112
|
+
const { deriveSelfHostSchemaFacts, SelfHostSchemaError } = await import("../env-validation-BUfFZ6bt.mjs");
|
|
113
113
|
try {
|
|
114
114
|
emitResult({
|
|
115
115
|
kind: "ok",
|
|
@@ -128,7 +128,7 @@ async function runFactsChild(root) {
|
|
|
128
128
|
}
|
|
129
129
|
/** The parent already found the emitted config, so a read failure here fails closed. */
|
|
130
130
|
async function runValidateEmittedChild(root) {
|
|
131
|
-
const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-
|
|
131
|
+
const { computeInvalidEmittedKeys, readEmittedWorkerVars, SelfHostSchemaError } = await import("../env-validation-BUfFZ6bt.mjs");
|
|
132
132
|
const emitted = readEmittedWorkerVars(root);
|
|
133
133
|
if (!emitted.ok) {
|
|
134
134
|
emitResult({
|
|
@@ -95,7 +95,7 @@ function readCliVersion() {
|
|
|
95
95
|
}
|
|
96
96
|
const VOID_CLI_VERSION = readCliVersion();
|
|
97
97
|
/** The oldest Void platform release this CLI supports. */
|
|
98
|
-
const MIN_PLATFORM_VERSION = "1.
|
|
98
|
+
const MIN_PLATFORM_VERSION = "1.4.0";
|
|
99
99
|
const RELEASE_VERSION = /^(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
|
|
100
100
|
/**
|
|
101
101
|
* Discovery probes keyed by platform base URL. Every outcome (pass,
|
|
@@ -1013,6 +1013,13 @@ var PlatformClient = class {
|
|
|
1013
1013
|
async getEmailSettings(projectId) {
|
|
1014
1014
|
return this.json(`${this.baseUrl}/projects/${projectId}/email/settings`, "Failed to read email settings", { permission: "read" });
|
|
1015
1015
|
}
|
|
1016
|
+
async setEmailAlias(projectId, alias) {
|
|
1017
|
+
return this.json(`${this.baseUrl}/projects/${projectId}/email/alias`, "Failed to set the email alias", {
|
|
1018
|
+
method: "PUT",
|
|
1019
|
+
body: { alias },
|
|
1020
|
+
permission: "settings"
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1016
1023
|
async listEmailDomains(projectId) {
|
|
1017
1024
|
return this.json(`${this.baseUrl}/projects/${projectId}/email/domains`, "Failed to list email domains", { permission: "read" });
|
|
1018
1025
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
@@ -145,7 +145,7 @@ function cloudflareAuthEnvironment(source = process.env) {
|
|
|
145
145
|
"WRANGLER_LOG_SANITIZE",
|
|
146
146
|
"CLOUDFLARE_AUTH_USE_KEYRING"
|
|
147
147
|
]);
|
|
148
|
-
for (const key of Object.keys(env)) if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN|VOID_ACCESS_CREDENTIALS|VOID_ACCESS_ORIGIN)$/i.test(key) || scrubbedKeys.has(key.toUpperCase())) delete env[key];
|
|
148
|
+
for (const key of Object.keys(env)) if (/^VOID_PLATFORM_/i.test(key) || /^(?:DATABASE_URL|CF_ACCESS_CLIENT_ID|CF_ACCESS_CLIENT_SECRET|CF_ACCESS_TOKEN|CF_ACCESS_READINESS_ORIGIN|VOID_ACCESS_CREDENTIALS|VOID_ACCESS_ORIGIN)$/i.test(key) || scrubbedKeys.has(key.toUpperCase())) delete env[key];
|
|
149
149
|
env.CLOUDFLARE_AUTH_USE_KEYRING = "true";
|
|
150
150
|
return env;
|
|
151
151
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as basename } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
-
import { b as readRootWranglerConfig } from "./wrangler-
|
|
2
|
+
import { b as readRootWranglerConfig } from "./wrangler-I-scB_1t.mjs";
|
|
3
3
|
import { L as log } from "./dist-Cor9XGoz.mjs";
|
|
4
4
|
import { m as printSuccess } from "./output-BpgYODYx.mjs";
|
|
5
5
|
import { i as isCleanCloudflareExit } from "./cloudflare-process-8jEYIeim.mjs";
|
|
6
|
-
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-
|
|
6
|
+
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-DyD_kVFr.mjs";
|
|
7
7
|
//#region src/cli/cloudflare-cmd.ts
|
|
8
8
|
async function runCloudflareCommand(root, args) {
|
|
9
9
|
const runWrangler = createBundledCloudflareAuthRunner(root);
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import "./project-paths-DGu_QZ_Q.mjs";
|
|
3
|
-
import { p as readConfig } from "./config-
|
|
3
|
+
import { p as readConfig } from "./config-OFOAimzt.mjs";
|
|
4
4
|
import { t as writeFileAtomic } from "./atomic-write-Dq6R0BPN.mjs";
|
|
5
5
|
import { t as parseJsoncObject } from "./generated-wrangler-config-DeWj5F9Y.mjs";
|
|
6
|
-
import { existsSync, mkdirSync, readFileSync, rmSync } from "node:fs";
|
|
6
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { isRecord } from "@void/deploy-core";
|
|
8
8
|
import { isDeepStrictEqual } from "node:util";
|
|
9
9
|
//#region src/cloudflare-config.ts
|
|
10
10
|
const MATERIALIZED_CLOUDFLARE_FILE = ".void-wrangler.jsonc";
|
|
11
11
|
const VOID_LOCK_FILE = "void.lock.json";
|
|
12
12
|
const PREVIEW_POINTER_FILE = "preview-deploy-config.json";
|
|
13
|
+
/** Add the generated Cloudflare config to `.gitignore` unless a line already ignores it. */
|
|
14
|
+
function ignoreMaterializedCloudflareConfig(root) {
|
|
15
|
+
const path = join(root, ".gitignore");
|
|
16
|
+
const source = existsSync(path) ? readFileSync(path, "utf8") : "";
|
|
17
|
+
if (source.split("\n").some((line) => {
|
|
18
|
+
const entry = line.trim();
|
|
19
|
+
return entry === ".void-wrangler.jsonc" || entry === `/.void-wrangler.jsonc`;
|
|
20
|
+
})) return;
|
|
21
|
+
const separator = source && !source.endsWith("\n") ? "\n" : "";
|
|
22
|
+
writeFileSync(path, `${source}${separator}${MATERIALIZED_CLOUDFLARE_FILE}\n`);
|
|
23
|
+
}
|
|
13
24
|
function arrayIdentity(value) {
|
|
14
25
|
if (isRecord(value)) {
|
|
15
26
|
for (const key of [
|
|
@@ -167,4 +178,4 @@ function seedCloudflareConfig(root, source, text) {
|
|
|
167
178
|
});
|
|
168
179
|
}
|
|
169
180
|
//#endregion
|
|
170
|
-
export {
|
|
181
|
+
export { persistCloudflareConfig as a, stashCloudflareDeployPointer as c, materializeCloudflareConfig as i, VOID_LOCK_FILE as n, restoreCloudflarePreviewPointer as o, ignoreMaterializedCloudflareConfig as r, seedCloudflareConfig as s, MATERIALIZED_CLOUDFLARE_FILE as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join, t as basename } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
-
import { M as writeProvisionedWranglerConfig, b as readRootWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE } from "./wrangler-
|
|
2
|
+
import { M as writeProvisionedWranglerConfig, b as readRootWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE } from "./wrangler-I-scB_1t.mjs";
|
|
3
3
|
import { K as select, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { i as ensureCloudflareAuthentication, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-
|
|
4
|
+
import { i as ensureCloudflareAuthentication, r as createBundledCloudflareAuthRunner } from "./cloudflare-auth-DyD_kVFr.mjs";
|
|
5
5
|
import { existsSync } from "node:fs";
|
|
6
6
|
//#region src/cli/cloudflare-connect.ts
|
|
7
7
|
async function connectCloudflare(root, interactive = Boolean(process.stdin.isTTY)) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { N as writeWranglerPublishedTrafficSnapshot, S as readWranglerCustomDomains, j as updateWranglerCustomDomain, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-
|
|
2
|
+
import { a as persistCloudflareConfig, i as materializeCloudflareConfig } from "./cloudflare-config-CH1AylZT.mjs";
|
|
3
|
+
import { N as writeWranglerPublishedTrafficSnapshot, S as readWranglerCustomDomains, j as updateWranglerCustomDomain, w as readWranglerPublishedTrafficSnapshot } from "./wrangler-I-scB_1t.mjs";
|
|
4
4
|
import { u as getErrorMessage } from "./output-BpgYODYx.mjs";
|
|
5
5
|
import { t as createCloudflareProcessRunner } from "./cloudflare-process-8jEYIeim.mjs";
|
|
6
|
-
import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-
|
|
7
|
-
import { a as findWranglerCiOverrideDotenvFile, i as findAmbientConfigOverride } from "./deploy-transport-
|
|
6
|
+
import { _ as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware, v as resolvePinnedApiBaseUrl } from "./provision-DztLJ97X.mjs";
|
|
7
|
+
import { a as findWranglerCiOverrideDotenvFile, i as findAmbientConfigOverride } from "./deploy-transport-DIq_gFTP.mjs";
|
|
8
8
|
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
9
9
|
import { tmpdir } from "node:os";
|
|
10
10
|
import { deployCloudflareVersionTraffic, encodeCloudflareVersionMessage, parseCloudflareVersionMessage, parseRootWranglerConfig, readBindingFieldPresence, readCloudflareTriggerConfig, readWranglerTopLevelString, resolveD1MigrateTarget, stabilizeCloudflareVersionTriggers } from "@void/deploy-cloudflare";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as activateCloudflareExistingVersion, n as applyCloudflareD1Migrations, r as changeCloudflareDomain, o as deleteCloudflareSecret, s as executeCloudflareD1Sql, c as listCloudflareDomains, l as listCloudflareSecrets, m as putCloudflareSecret, h as readCloudflareD1Migrations, g as readCloudflareWorkerStatus, _ as resolveCloudflareD1Context, v as resolveCloudflareOperationContext, y as restoreCloudflareD1Database, b as syncCloudflareSecrets, x as tailCloudflareWorker } from "./cloudflare-operations-
|
|
1
|
+
export { t as activateCloudflareExistingVersion, n as applyCloudflareD1Migrations, r as changeCloudflareDomain, o as deleteCloudflareSecret, s as executeCloudflareD1Sql, c as listCloudflareDomains, l as listCloudflareSecrets, m as putCloudflareSecret, h as readCloudflareD1Migrations, g as readCloudflareWorkerStatus, _ as resolveCloudflareD1Context, v as resolveCloudflareOperationContext, y as restoreCloudflareD1Database, b as syncCloudflareSecrets, x as tailCloudflareWorker } from "./cloudflare-operations-Bc-7fN44.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as PLACEHOLDER_DB_URL, n as withPrivateDrizzleConfig, r as writeDrizzleConfig } from "./config-
|
|
1
|
+
export { t as PLACEHOLDER_DB_URL, n as withPrivateDrizzleConfig, r as writeDrizzleConfig } from "./config-tqMM6DwY.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./types-CKWnYgfy.mjs";
|
|
2
2
|
import { t as VoidAuthProvider } from "./providers-BNKRacMr.mjs";
|
|
3
3
|
import { t as HeadConfig } from "./head-C8K_iGe6.mjs";
|
|
4
|
-
import "@void/deploy-core";
|
|
4
|
+
import { AssetConfig } from "@void/deploy-core";
|
|
5
5
|
import { RewriteDestination } from "void/routes";
|
|
6
6
|
//#region src/sandbox/config.d.ts
|
|
7
7
|
type SandboxInstanceType = "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4";
|
|
@@ -46,6 +46,8 @@ type WranglerConfig = {
|
|
|
46
46
|
type NotFoundHandling = "single-page-application" | "404-page" | "none";
|
|
47
47
|
/** Routing configuration — headers, redirects, rewrites, fallbacks, revalidation, prerendering. */
|
|
48
48
|
type RoutingConfig = {
|
|
49
|
+
/** Redirect HTTP to HTTPS with a 308. Requires the Cloudflare target. Omitted means off. */
|
|
50
|
+
alwaysUseHttps?: boolean;
|
|
49
51
|
/** Disable ISR and edge prerendering, including per-page policies. Static output is unaffected. */
|
|
50
52
|
isr?: boolean;
|
|
51
53
|
revalidate?: number | Record<string, number>;
|
|
@@ -166,6 +168,7 @@ type CloudflareConfig = Record<string, unknown> & {
|
|
|
166
168
|
directory?: string;
|
|
167
169
|
binding?: string;
|
|
168
170
|
not_found_handling?: NotFoundHandling;
|
|
171
|
+
html_handling?: AssetConfig["html_handling"];
|
|
169
172
|
run_worker_first?: boolean | Array<string>;
|
|
170
173
|
}>;
|
|
171
174
|
triggers?: CloudflareField<{
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
|
|
2
|
+
import { t as discoverSchema } from "./discover-LaV0tbIu.mjs";
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
import { isRunnableDevEnvironment, parseSync, runnerImport } from "vite";
|
|
5
|
+
//#region src/auth/config.ts
|
|
6
|
+
function isVoidAuthConfigSource(code, filename) {
|
|
7
|
+
if (!code.includes("void/auth")) return false;
|
|
8
|
+
let program;
|
|
9
|
+
try {
|
|
10
|
+
program = parseSync(filename, code).program;
|
|
11
|
+
} catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return (program.body ?? []).some((node) => {
|
|
15
|
+
if (node.type !== "ImportDeclaration" && node.type !== "ExportNamedDeclaration" && node.type !== "ExportAllDeclaration") return false;
|
|
16
|
+
return node.source?.value === "void/auth";
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function findVoidAuthConfig(root, paths = readProjectPaths(root)) {
|
|
20
|
+
for (const absPath of paths.authConfigCandidates) {
|
|
21
|
+
if (!existsSync(absPath)) continue;
|
|
22
|
+
if (isVoidAuthConfigSource(readFileSync(absPath, "utf-8"), absPath)) return absPath;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The dev server evaluates the auth config in this Node environment. A native
|
|
28
|
+
* `import()` would keep the first evaluation for the life of the process; the
|
|
29
|
+
* module runner reads the config again once its files are invalidated, and the
|
|
30
|
+
* module graph lists the local files the config imports.
|
|
31
|
+
*/
|
|
32
|
+
const AUTH_CONFIG_ENVIRONMENT = "void_auth_config";
|
|
33
|
+
/**
|
|
34
|
+
* The dev server's importer for the auth config: its auth config environment, or
|
|
35
|
+
* a one-off runner with the server's aliases when it has no such environment.
|
|
36
|
+
*/
|
|
37
|
+
function devAuthConfigImporter(server) {
|
|
38
|
+
const environment = server.environments[AUTH_CONFIG_ENVIRONMENT];
|
|
39
|
+
return environment && isRunnableDevEnvironment(environment) ? (path) => environment.runner.import(path) : (path) => {
|
|
40
|
+
const { root, mode, resolve } = server.config;
|
|
41
|
+
return viteAuthConfigImporter(root, mode, resolve)(path);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Builds and CLI commands evaluate the auth config once in a throwaway module
|
|
46
|
+
* runner, so its imports resolve as in dev: without file extensions and through
|
|
47
|
+
* the app's aliases. A native `import()` resolves neither.
|
|
48
|
+
*/
|
|
49
|
+
function viteAuthConfigImporter(root, mode, resolve) {
|
|
50
|
+
return async (path) => {
|
|
51
|
+
const { module } = await runnerImport(path, {
|
|
52
|
+
root,
|
|
53
|
+
mode,
|
|
54
|
+
logLevel: "silent",
|
|
55
|
+
resolve: {
|
|
56
|
+
alias: resolve?.alias,
|
|
57
|
+
tsconfigPaths: resolve?.tsconfigPaths
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return module;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The importer for commands outside Vite, such as `void prepare`. It does not load
|
|
65
|
+
* the app's Vite config: evaluating it constructs the app's plugins, and Void's
|
|
66
|
+
* write generated files and Cloudflare config when constructed. Imports resolve
|
|
67
|
+
* without extensions, through tsconfig `paths`, and through Void's `@schema`
|
|
68
|
+
* alias; an alias set only in vite.config resolves in dev and builds.
|
|
69
|
+
*/
|
|
70
|
+
function projectAuthConfigImporter(root) {
|
|
71
|
+
return (path) => {
|
|
72
|
+
const schema = discoverSchema(root);
|
|
73
|
+
return viteAuthConfigImporter(root, "development", {
|
|
74
|
+
alias: schema ? { "@schema": schema.path } : void 0,
|
|
75
|
+
tsconfigPaths: true
|
|
76
|
+
})(path);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/** Evaluate the auth config through the importer of the current command. */
|
|
80
|
+
async function loadVoidAuthConfig(configPath, importModule) {
|
|
81
|
+
if (!configPath) return;
|
|
82
|
+
const mod = await importModule(configPath);
|
|
83
|
+
if (!Object.hasOwn(mod, "default")) throw new Error(`${configPath} has no default export. Export the auth config with \`export default defineAuth(...)\`.`);
|
|
84
|
+
return mod.default;
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { projectAuthConfigImporter as a, loadVoidAuthConfig as i, devAuthConfigImporter as n, viteAuthConfigImporter as o, findVoidAuthConfig as r, AUTH_CONFIG_ENVIRONMENT as t };
|
|
@@ -113,12 +113,12 @@ const LITERAL_HOSTNAME_REGEX = /^([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z]{2,}$/;
|
|
|
113
113
|
/**
|
|
114
114
|
* Split an optional `https://host` prefix from a rule source. The host is
|
|
115
115
|
* lowercased (dispatch compares `url.hostname`), and a bare `https://host` gets
|
|
116
|
-
* path `/`.
|
|
117
|
-
*
|
|
116
|
+
* path `/`. Sources scope rules by hostname and path, without matching the
|
|
117
|
+
* request scheme. Returns `{ error }` for unsupported schemes and non-literal hosts.
|
|
118
118
|
*/
|
|
119
119
|
function parseHostPrefixedSource(raw) {
|
|
120
120
|
if (raw.startsWith("//")) return { error: `must not start with "//" (protocol-relative URLs are ambiguous; use "/path" for path-only or "https://host/path")` };
|
|
121
|
-
if (raw.startsWith("http://")) return { error: `must not start with "http://" (
|
|
121
|
+
if (raw.startsWith("http://")) return { error: `must not start with "http://" (use "https://host/path" to scope a rule by hostname, or "routing.alwaysUseHttps" to redirect HTTP to HTTPS)` };
|
|
122
122
|
if (!raw.startsWith("https://")) return {
|
|
123
123
|
host: void 0,
|
|
124
124
|
path: raw
|
|
@@ -239,6 +239,8 @@ function validateConfigObject(obj) {
|
|
|
239
239
|
if (obj.routing !== void 0) {
|
|
240
240
|
if (!isRecord(obj.routing)) throw new Error(`config: "routing" in ${CONFIG_FILE} must be an object.`);
|
|
241
241
|
const routing = obj.routing;
|
|
242
|
+
if (routing.alwaysUseHttps !== void 0 && typeof routing.alwaysUseHttps !== "boolean") throw new Error(`config: "routing.alwaysUseHttps" in ${CONFIG_FILE} must be a boolean.`);
|
|
243
|
+
if (routing.alwaysUseHttps === true && isNodeTarget(obj.target)) throw new Error(`config: "routing.alwaysUseHttps" in ${CONFIG_FILE} requires target: "cloudflare". It is not available with target: "${obj.target}".`);
|
|
242
244
|
if (routing.notFound !== void 0) {
|
|
243
245
|
if (typeof routing.notFound !== "string" || !VALID_NOT_FOUND_HANDLING.has(routing.notFound)) throw new Error(`config: "routing.notFound" in ${CONFIG_FILE} must be one of: ${[...VALID_NOT_FOUND_HANDLING].join(", ")}.`);
|
|
244
246
|
}
|
package/dist/config-entry.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as VoidConfig } from "./config-
|
|
1
|
+
import { t as VoidConfig } from "./config-CAdZVTLN.mjs";
|
|
2
2
|
//#region src/config-entry.d.ts
|
|
3
3
|
/** Define a typed Void project configuration without loading the Vite plugin. */
|
|
4
4
|
export declare function defineConfig<const T extends VoidConfig>(config: T): T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import { i as resolveProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
|
|
3
|
-
import { c as getDatabaseCasing, p as readConfig } from "./config-DHgSEWT7.mjs";
|
|
4
3
|
import { n as schemaSpecifier, t as discoverSchema } from "./discover-LaV0tbIu.mjs";
|
|
4
|
+
import { c as getDatabaseCasing, p as readConfig } from "./config-OFOAimzt.mjs";
|
|
5
5
|
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { tmpdir } from "node:os";
|
|
7
7
|
//#region src/drizzle/config.ts
|
|
@@ -2,11 +2,11 @@ import { c as normalizePlatformApiUrl, s as listPlatformConnections } from "./pl
|
|
|
2
2
|
import { c as writeDeploymentPlatform, l as writePlatformSelection, n as readDeploymentPlatform } from "./project-rqDnVsJN.mjs";
|
|
3
3
|
import { d as readPlatformToken } from "./auth-B6iOCjKI.mjs";
|
|
4
4
|
import { K as select, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
5
|
-
import { a as isExpiredTokenError, r as PlatformClient } from "./client-
|
|
5
|
+
import { a as isExpiredTokenError, r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
6
6
|
import { m as printSuccess } from "./output-BpgYODYx.mjs";
|
|
7
|
-
import { t as promptForLoginToken } from "./login-
|
|
8
|
-
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-
|
|
9
|
-
import { t as connectCloudflare } from "./cloudflare-connect-
|
|
7
|
+
import { t as promptForLoginToken } from "./login-PcFy5mlC.mjs";
|
|
8
|
+
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-DZK2ixMl.mjs";
|
|
9
|
+
import { t as connectCloudflare } from "./cloudflare-connect-zTJh8UnN.mjs";
|
|
10
10
|
//#region src/cli/connect.ts
|
|
11
11
|
async function selectVoidPlatform(interactive) {
|
|
12
12
|
if (!interactive) throw new Error("connect: Supply a Void platform URL in non-interactive mode.");
|