void 0.21.9 → 0.22.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-DZZGK80W.mjs → account-cmd-CjyxcGkM.mjs} +4 -4
- package/dist/{auth-link-B_CeugBw.mjs → auth-link-BLO4ptzo.mjs} +4 -4
- package/dist/{auth-router-BgEFRuvZ.mjs → auth-router-ZUg9MF_U.mjs} +5 -5
- package/dist/{build-cmd-Dpt0jd-x.mjs → build-cmd-BxR5FROK.mjs} +3 -3
- package/dist/{cache-7_UeZdTk.mjs → cache-D0sWhgKI.mjs} +3 -3
- package/dist/{cancel-deploy-D23R1RXT.mjs → cancel-deploy-D4NUqFbi.mjs} +3 -3
- package/dist/{cf-build-output-CGT03qCD.mjs → cf-build-output-BJ6yGEIS.mjs} +139 -62
- package/dist/cli/cf-compat.mjs +164 -50
- package/dist/cli/cli.mjs +73 -44
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/{client-QTl6ko_D.mjs → client-BTZ3XkrB.mjs} +25 -0
- package/dist/client-Czz8o5jP.mjs +2 -0
- package/dist/{cloudflare-auth-C4_GPZr0.mjs → cloudflare-auth-DQkqoMYa.mjs} +1 -6
- package/dist/{cloudflare-cmd-bSmZ1d5L.mjs → cloudflare-cmd-BKlfGHAy.mjs} +6 -7
- package/dist/{cloudflare-connect-jAwacxxP.mjs → cloudflare-connect-Ctmrw579.mjs} +3 -3
- package/dist/{cloudflare-operations-sMZXpk_S.mjs → cloudflare-operations-B9tzgjmf.mjs} +10 -39
- package/dist/{cloudflare-operations-BipGMJ5O.mjs → cloudflare-operations-BT6OWFBk.mjs} +1 -1
- package/dist/{config-CafTW6Cz.mjs → config-Br_JZD6u.mjs} +2 -7
- package/dist/{config-s7Xj7tPb.mjs → config-CyQ-wVd7.mjs} +1 -1
- package/dist/{config-CF69HgXc.d.mts → config-VavjpDnp.d.mts} +1 -2
- package/dist/config-entry.d.mts +1 -1
- package/dist/{config-write-BSduPMY8.mjs → config-write-B1f88wJA.mjs} +1 -1
- package/dist/{connect-BsUSRzln.mjs → connect-Dg-WkW-C.mjs} +5 -5
- package/dist/{create-project-BniEV0OW.mjs → create-project-DdoqwFLF.mjs} +1 -1
- package/dist/{create-project-DBfFSZKY.mjs → create-project-l9J7pbtm.mjs} +8 -4
- package/dist/{db-hRrvZaq_.mjs → db-gp2sCXyN.mjs} +14 -14
- package/dist/{delete-D6dZ9B6B.mjs → delete-TTedbH6B.mjs} +3 -3
- package/dist/{deploy-DDz7c8LK.mjs → deploy-B19L2Bra.mjs} +1 -1
- package/dist/{deploy-WaAQez1O.mjs → deploy-CH-o2CaZ.mjs} +47 -36
- package/dist/{dist-BR1quN_w.mjs → dist-AoCzRTJE.mjs} +226 -60
- package/dist/{dist-C5fND3R0.mjs → dist-BuDuKZJv.mjs} +1 -1
- package/dist/{dist-Dn6nn2IU.mjs → dist-CTBk70IR.mjs} +42 -42
- package/dist/{domain-Dmhvb2oU.mjs → domain-JRF59P_r.mjs} +4 -4
- package/dist/{email-DFi-s2t4.mjs → email-Bo6G9LOZ.mjs} +6 -6
- package/dist/{env-Csi-tMbT.mjs → env-BYOrWQnv.mjs} +4 -4
- package/dist/{env-public-D_6u46fX.d.mts → env-public-BxU_0yTL.d.mts} +2 -1
- package/dist/gen-CNJ62MM7.mjs +2 -0
- package/dist/{gen-Dz3X1Qab.mjs → gen-sCtlCOdA.mjs} +3 -3
- package/dist/{github-cmd-BED3_9JD.mjs → github-cmd-0-7PexDq.mjs} +5 -7
- package/dist/{handler-BXJTXd02.d.mts → handler-HEcZsaij.d.mts} +2 -1
- package/dist/{headers-BOg_velo.mjs → headers-DWi2IXWx.mjs} +1 -1
- package/dist/help-CmZzxUba.mjs +2 -0
- package/dist/{help-DC7gdz7L.mjs → help-GKtwl07I.mjs} +124 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +53 -24
- package/dist/{init-WO0JlPx8.mjs → init-FZx3Elvz.mjs} +13 -13
- package/dist/{link-CsHOinF7.mjs → link-BrQfb_CU.mjs} +4 -4
- package/dist/{list-CDb-4bZ1.mjs → list-D44jmIAM.mjs} +4 -4
- package/dist/{live-CKiJilLr.d.mts → live-CKJlvlNp.d.mts} +1 -1
- package/dist/{local-d1-CC8sKFGu.mjs → local-d1-Bg9OzEEO.mjs} +1 -1
- package/dist/{login-DvqXsfGs.mjs → login-CAsAsQ-_.mjs} +4 -4
- package/dist/login-CGcRKEoi.mjs +2 -0
- package/dist/{logs-BdfiOezj.mjs → logs-BjKvFnVM.mjs} +4 -4
- package/dist/{migrate-B8KuoYsO.mjs → migrate-BPITvDJN.mjs} +4 -4
- package/dist/migrate-CYfbKkXh.mjs +2 -0
- package/dist/{node-BM43oz4G.mjs → node-Dt7z256D.mjs} +1 -1
- package/dist/{operator-cmd-03819ATr.mjs → operator-cmd-BK5CCiT9.mjs} +4 -4
- package/dist/output-Dm_A4Tbv.mjs +81 -0
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +2 -2
- package/dist/pages/islands-plugin.d.mts +16 -6
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{output-CCH48AMM.mjs → picocolors-BTps1_gs.mjs} +2 -76
- package/dist/{platform-auth-config-z92h63q5.mjs → platform-auth-config-BlN8xTdD.mjs} +3 -3
- package/dist/{platform-auth-protection-DeE3yr2R.mjs → platform-auth-protection-7d5aV2Jg.mjs} +3 -3
- package/dist/{platform-auth-recovery-o_340Ixx.mjs → platform-auth-recovery-Dxij8ZbR.mjs} +3 -3
- package/dist/{platform-cmd-DNl8WosH.mjs → platform-cmd-B3hwKrFK.mjs} +5 -5
- package/dist/{platform-cmd-C4ZV3Vpy.mjs → platform-cmd-E0FuL212.mjs} +1 -1
- package/dist/{platform-domain-CU1JtJkW.mjs → platform-domain-D6Xcy9ZX.mjs} +36 -9
- package/dist/{platform-lifecycle-Bs2qx1E3.mjs → platform-lifecycle-DMh_qrry.mjs} +1 -1
- package/dist/{platform-lifecycle-Bc047IeT.mjs → platform-lifecycle-k0E0xoxx.mjs} +548 -86
- package/dist/{platform-management-CVpGI9Y5.mjs → platform-management-Brz_BDiT.mjs} +54 -9
- package/dist/{platform-management-C8tt6D8h.mjs → platform-management-DOtss0BN.mjs} +1 -1
- package/dist/{platform-recovery-dvUaptLr.mjs → platform-recovery-BvtcXON5.mjs} +2 -2
- package/dist/prepare-Bm3iq-u4.mjs +2 -0
- package/dist/{prepare-DyZ-Yok5.mjs → prepare-C-6YZyyg.mjs} +3 -3
- package/dist/{prepare-C3kt3Rst.mjs → prepare-CRhJbVrG.mjs} +1 -1
- package/dist/{project-cmd-B44I8J_W.mjs → project-cmd-BZLCqOqw.mjs} +29 -15
- package/dist/{project-team-BkbYIsXN.mjs → project-team-BvgM0WoX.mjs} +3 -3
- package/dist/{project-token-C8xEEQnB.mjs → project-token-l5DqK6Az.mjs} +3 -3
- package/dist/project-zero-trust-v6Mvpp8y.mjs +63 -0
- package/dist/{protocol-ZH3jP4a7.d.mts → protocol-BBa6cstI.d.mts} +1 -1
- package/dist/{provision-BhreDAOS.mjs → provision-C4IGqkBf.mjs} +24 -19
- package/dist/{provision-DNtrtaVD.mjs → provision-Fr9pRqce.mjs} +1 -1
- package/dist/{requests-DFyhBMaf.mjs → requests-DN-BbNiM.mjs} +3 -3
- package/dist/{rollback-DHHxXZiS.mjs → rollback-D7rzSaZM.mjs} +4 -4
- package/dist/runtime/env-public.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/sandbox-container.d.mts +3 -0
- package/dist/runtime/sandbox-container.mjs +2 -0
- package/dist/runtime/sandbox.d.mts +4 -32
- package/dist/runtime/sandbox.mjs +118 -72
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/sandbox-container-4fdqLnyb.mjs +279 -0
- package/dist/sandbox-container-DdNEBfCc.d.mts +72 -0
- package/dist/sandbox-qpNBT8a3.d.mts +49 -0
- package/dist/{secret-DN9sSNiV.mjs → secret-BOtOl_cb.mjs} +4 -4
- package/dist/{skills-O6FUaizK.mjs → skills-D1II1Juz.mjs} +1 -1
- package/dist/{subcommand-prompt-BuGYkAkC.mjs → subcommand-prompt-CY1C4fvl.mjs} +2 -2
- package/dist/{wrangler-BymcxrRa.mjs → wrangler-DQF1vKyf.mjs} +37 -27
- package/dist/{ws-BwcqizuH.d.mts → ws-BoY7vQML.d.mts} +1 -1
- package/package.json +40 -32
- package/sandbox.Dockerfile +4 -0
- package/schema.json +10 -22
- package/skills/void/SKILL.md +2 -0
- package/skills/void/docs/guide/deployment.md +1 -1
- package/skills/void/docs/guide/edge/revalidation.md +1 -1
- package/skills/void/docs/guide/edge/static-assets.md +1 -0
- package/skills/void/docs/guide/platform/administration/zero-trust.md +318 -0
- package/skills/void/docs/guide/platform/development/local.md +2 -2
- package/skills/void/docs/guide/platform/installation/domains.md +1 -1
- package/skills/void/docs/guide/platform/installation/first-deployment.md +4 -0
- package/skills/void/docs/guide/platform/installation/prerequisites.md +1 -1
- package/skills/void/docs/guide/platform/installation/uninstall.md +17 -2
- package/skills/void/docs/guide/platform-administration.md +1 -0
- package/skills/void/docs/guide/sandboxes.md +70 -41
- package/skills/void/docs/integrations/cloudflare.md +1 -1
- package/skills/void/docs/reference/api.md +35 -35
- package/skills/void/docs/reference/cli.md +68 -6
- package/skills/void/docs/reference/config.md +16 -16
- package/dist/client-4cDVv7BO.mjs +0 -2
- package/dist/gen-Vnv2f65C.mjs +0 -2
- package/dist/help-DQMfeKMz.mjs +0 -2
- package/dist/login-DFQk7rbW.mjs +0 -2
- package/dist/migrate-TsHGBnDA.mjs +0 -2
- package/dist/prepare-BZXkjdNe.mjs +0 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { A as writeWranglerPublishedTrafficSnapshot,
|
|
2
|
+
import { A as writeWranglerPublishedTrafficSnapshot, B as materializeCloudflareConfig, O as updateWranglerCustomDomain, S as readWranglerPublishedTrafficSnapshot, V as persistCloudflareConfig, b as readWranglerCustomDomains } from "./wrangler-DQF1vKyf.mjs";
|
|
3
3
|
import { r as scanWranglerDotenvKeys } from "./dotenv-VQxupEUv.mjs";
|
|
4
4
|
import { o as resolveWranglerArgv } from "./preset-UHj9ARyP.mjs";
|
|
5
|
-
import { _ as resolvePinnedApiBaseUrl, g as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware } from "./provision-
|
|
5
|
+
import { _ as resolvePinnedApiBaseUrl, g as provisionEnv, r as assertNoTransportRedirectInProjectDotenv, s as deleteEnvVarCaseAware } from "./provision-C4IGqkBf.mjs";
|
|
6
6
|
import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { tmpdir } from "node:os";
|
|
8
8
|
import { spawnSync } from "node:child_process";
|
|
@@ -336,11 +336,6 @@ async function changeCloudflareDomain(root, hostname, action, runner, emptyDomai
|
|
|
336
336
|
const original = readFileSync(before.configPath, "utf-8");
|
|
337
337
|
const update = updateWranglerCustomDomain(root, hostname, action);
|
|
338
338
|
if (!update.modified) return update;
|
|
339
|
-
if (update.domains.length === 0 && !emptyDomainPublisher && !resolveCloudflareApiToken()) {
|
|
340
|
-
writeFileSync(before.configPath, original);
|
|
341
|
-
persistCloudflareConfig(root);
|
|
342
|
-
throw new Error("Deleting the final Cloudflare custom domain requires CLOUDFLARE_API_TOKEN for the empty-domain API update. Export a scoped token with Workers Scripts: Edit permission and retry. No local or remote state changed.");
|
|
343
|
-
}
|
|
344
339
|
const triggerConfigDir = mkdtempSync(join(tmpdir(), "void-domain-triggers-"));
|
|
345
340
|
const triggerConfigPath = join(triggerConfigDir, "wrangler.json");
|
|
346
341
|
const deployRoutes = async () => {
|
|
@@ -385,37 +380,16 @@ async function changeCloudflareDomain(root, hostname, action, runner, emptyDomai
|
|
|
385
380
|
return update;
|
|
386
381
|
}
|
|
387
382
|
/**
|
|
388
|
-
*
|
|
389
|
-
*
|
|
390
|
-
*
|
|
391
|
-
* domain. Direct API access is deliberately limited to an explicit API token;
|
|
392
|
-
* OAuth credential storage is Wrangler-private and must not be scraped.
|
|
383
|
+
* Publish an explicit empty Custom Domain set through the pinned cf transport.
|
|
384
|
+
* Trigger deploy omits empty domain sets; this operation must reconcile them
|
|
385
|
+
* explicitly using the same verified browser/API credentials as other commands.
|
|
393
386
|
*/
|
|
394
387
|
async function publishEmptyCloudflareCustomDomainSet(context) {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
Authorization: `Bearer ${token}`,
|
|
401
|
-
"Content-Type": "application/json"
|
|
402
|
-
},
|
|
403
|
-
body: JSON.stringify({
|
|
404
|
-
override_scope: true,
|
|
405
|
-
override_existing_origin: false,
|
|
406
|
-
override_existing_dns_record: false,
|
|
407
|
-
origins: []
|
|
408
|
-
}),
|
|
409
|
-
redirect: "error",
|
|
410
|
-
signal: AbortSignal.timeout(3e4)
|
|
411
|
-
});
|
|
412
|
-
let body;
|
|
413
|
-
try {
|
|
414
|
-
body = await response.json();
|
|
415
|
-
} catch {
|
|
416
|
-
throw new Error(`Cloudflare returned HTTP ${response.status} with a non-JSON custom-domain response.`);
|
|
417
|
-
}
|
|
418
|
-
if (!response.ok || typeof body !== "object" || body === null || body.success !== true) throw new Error(`Cloudflare rejected the empty custom-domain set (HTTP ${response.status}).`);
|
|
388
|
+
await run(context, [
|
|
389
|
+
"triggers",
|
|
390
|
+
"clear-domains",
|
|
391
|
+
...targetArgs(context)
|
|
392
|
+
]);
|
|
419
393
|
}
|
|
420
394
|
/** Adapt the direct empty-domain API call to the deployment package's result contract. */
|
|
421
395
|
function createCloudflareEmptyDomainPublisher(context) {
|
|
@@ -456,9 +430,6 @@ function createCloudflareEmptyCronPublisher(context) {
|
|
|
456
430
|
}
|
|
457
431
|
};
|
|
458
432
|
}
|
|
459
|
-
function resolveCloudflareApiToken() {
|
|
460
|
-
return process.env.CLOUDFLARE_API_TOKEN || process.env.CF_API_TOKEN || void 0;
|
|
461
|
-
}
|
|
462
433
|
/**
|
|
463
434
|
* Build a route-only Wrangler config for a domain update. `triggers deploy`
|
|
464
435
|
* also reconciles cron, queue-consumer, and workflow triggers found in its
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as resolveCloudflareD1Context, b as tailCloudflareWorker, c as listCloudflareDomains, g as readCloudflareWorkerStatus, h as readCloudflareD1Migrations, l as listCloudflareSecrets, m as putCloudflareSecret, n as applyCloudflareD1Migrations, o as deleteCloudflareSecret, r as changeCloudflareDomain, s as executeCloudflareD1Sql, t as activateCloudflareExistingVersion, v as resolveCloudflareOperationContext, y as syncCloudflareSecrets } from "./cloudflare-operations-
|
|
1
|
+
import { _ as resolveCloudflareD1Context, b as tailCloudflareWorker, c as listCloudflareDomains, g as readCloudflareWorkerStatus, h as readCloudflareD1Migrations, l as listCloudflareSecrets, m as putCloudflareSecret, n as applyCloudflareD1Migrations, o as deleteCloudflareSecret, r as changeCloudflareDomain, s as executeCloudflareD1Sql, t as activateCloudflareExistingVersion, v as resolveCloudflareOperationContext, y as syncCloudflareSecrets } from "./cloudflare-operations-B9tzgjmf.mjs";
|
|
2
2
|
export { activateCloudflareExistingVersion, applyCloudflareD1Migrations, changeCloudflareDomain, deleteCloudflareSecret, executeCloudflareD1Sql, listCloudflareDomains, listCloudflareSecrets, putCloudflareSecret, readCloudflareD1Migrations, readCloudflareWorkerStatus, resolveCloudflareD1Context, resolveCloudflareOperationContext, syncCloudflareSecrets, tailCloudflareWorker };
|
|
@@ -42,10 +42,7 @@ const VALID_DATABASE_VALUES = /* @__PURE__ */ new Set(["pg", "mysql"]);
|
|
|
42
42
|
/** Cloudflare's hard maximum for Workers CPU time per request (5 minutes). */
|
|
43
43
|
const MAX_WORKER_CPU_MS = 3e5;
|
|
44
44
|
const VALID_SANDBOX_INSTANCE_TYPES = /* @__PURE__ */ new Set([
|
|
45
|
-
"dev",
|
|
46
45
|
"lite",
|
|
47
|
-
"basic",
|
|
48
|
-
"standard",
|
|
49
46
|
"standard-1",
|
|
50
47
|
"standard-2",
|
|
51
48
|
"standard-3",
|
|
@@ -396,9 +393,8 @@ function validateConfigObject(config) {
|
|
|
396
393
|
"image",
|
|
397
394
|
"imageBuildContext",
|
|
398
395
|
"platformImage",
|
|
399
|
-
"instanceType"
|
|
400
|
-
|
|
401
|
-
].includes(key)) throw new Error(`config: Unknown key 'sandbox.${key}' in ${CONFIG_FILE}. Valid: binding, className, containerName, image, imageBuildContext, platformImage, instanceType, maxInstances.`);
|
|
396
|
+
"instanceType"
|
|
397
|
+
].includes(key)) throw new Error(`config: Unknown key 'sandbox.${key}' in ${CONFIG_FILE}. Valid: binding, className, containerName, image, imageBuildContext, platformImage, instanceType.`);
|
|
402
398
|
for (const key of [
|
|
403
399
|
"binding",
|
|
404
400
|
"className",
|
|
@@ -408,7 +404,6 @@ function validateConfigObject(config) {
|
|
|
408
404
|
"platformImage"
|
|
409
405
|
]) if (sandbox[key] !== void 0 && typeof sandbox[key] !== "string") throw new Error(`config: "sandbox.${key}" in ${CONFIG_FILE} must be a string.`);
|
|
410
406
|
if (sandbox.instanceType !== void 0 && (typeof sandbox.instanceType !== "string" || !VALID_SANDBOX_INSTANCE_TYPES.has(sandbox.instanceType))) throw new Error(`config: "sandbox.instanceType" in ${CONFIG_FILE} must be one of: ${[...VALID_SANDBOX_INSTANCE_TYPES].join(", ")}.`);
|
|
411
|
-
if (sandbox.maxInstances !== void 0 && (typeof sandbox.maxInstances !== "number" || !Number.isInteger(sandbox.maxInstances) || sandbox.maxInstances < 1)) throw new Error(`config: "sandbox.maxInstances" in ${CONFIG_FILE} must be a positive integer.`);
|
|
412
407
|
} else throw new Error(`config: "sandbox" in ${CONFIG_FILE} must be a boolean or an object.`);
|
|
413
408
|
}
|
|
414
409
|
if (obj.worker !== void 0) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { m as readConfig, u as getDatabaseDialect } from "./config-
|
|
1
|
+
import { m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
2
2
|
export { getDatabaseDialect, readConfig };
|
|
@@ -3,7 +3,7 @@ import { t as VoidAuthProvider } from "./providers-BNKRacMr.mjs";
|
|
|
3
3
|
import { t as HeadConfig } from "./head-Do8P4puT.mjs";
|
|
4
4
|
import { RewriteDestination } from "void/routes";
|
|
5
5
|
//#region src/sandbox/config.d.ts
|
|
6
|
-
type SandboxInstanceType = "
|
|
6
|
+
type SandboxInstanceType = "lite" | "standard-1" | "standard-2" | "standard-3" | "standard-4";
|
|
7
7
|
type SandboxConfig = {
|
|
8
8
|
binding?: string;
|
|
9
9
|
className?: string;
|
|
@@ -12,7 +12,6 @@ type SandboxConfig = {
|
|
|
12
12
|
imageBuildContext?: string;
|
|
13
13
|
platformImage?: string;
|
|
14
14
|
instanceType?: SandboxInstanceType;
|
|
15
|
-
maxInstances?: number;
|
|
16
15
|
};
|
|
17
16
|
//#endregion
|
|
18
17
|
//#region src/config.d.ts
|
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-VavjpDnp.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,6 +1,6 @@
|
|
|
1
1
|
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
2
|
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-GgcMozYz.mjs";
|
|
3
|
-
import { g as validateConfig } from "./config-
|
|
3
|
+
import { g as validateConfig } from "./config-Br_JZD6u.mjs";
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { parse } from "acorn";
|
|
6
6
|
//#region src/config-write.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { f as readPlatformToken } from "./auth-DLNN0D3Z.mjs";
|
|
2
2
|
import { o as listPlatformConnections, s as normalizePlatformApiUrl } from "./platform-registry-QBa4DK32.mjs";
|
|
3
3
|
import { i as readDeploymentPlatform, l as writeDeploymentPlatform, u as writePlatformSelection } from "./project-C0Fqu05O.mjs";
|
|
4
|
-
import { I as select, W as isCancel, j as log } from "./dist-
|
|
5
|
-
import { i as isExpiredTokenError, n as PlatformClient } from "./client-
|
|
6
|
-
import { t as promptForLoginToken } from "./login-
|
|
7
|
-
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-
|
|
8
|
-
import { t as connectCloudflare } from "./cloudflare-connect-
|
|
4
|
+
import { I as select, W as isCancel, j as log } from "./dist-CTBk70IR.mjs";
|
|
5
|
+
import { i as isExpiredTokenError, n as PlatformClient } from "./client-BTZ3XkrB.mjs";
|
|
6
|
+
import { t as promptForLoginToken } from "./login-CAsAsQ-_.mjs";
|
|
7
|
+
import { i as saveDiscoveredPlatform, n as promptPlatformUrl, t as discoverPlatform } from "./platform-cmd-B3hwKrFK.mjs";
|
|
8
|
+
import { t as connectCloudflare } from "./cloudflare-connect-Ctmrw579.mjs";
|
|
9
9
|
//#region src/cli/connect.ts
|
|
10
10
|
async function selectVoidPlatform(interactive) {
|
|
11
11
|
if (!interactive) throw new Error("connect: Supply a Void platform URL in non-interactive mode.");
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as createProjectWithSlugRetry } from "./create-project-
|
|
1
|
+
import { t as createProjectWithSlugRetry } from "./create-project-l9J7pbtm.mjs";
|
|
2
2
|
export { createProjectWithSlugRetry };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as import_picocolors } from "./output-CCH48AMM.mjs";
|
|
2
1
|
import { s as getSiteDomain } from "./auth-DLNN0D3Z.mjs";
|
|
3
2
|
import { d as writeProjectConfig, t as attachSelectedPlatform } from "./project-C0Fqu05O.mjs";
|
|
4
|
-
import { B as text, E as confirm, I as select, T as cancel, W as isCancel, j as log } from "./dist-
|
|
5
|
-
import { t as PlatformApiError } from "./client-
|
|
3
|
+
import { B as text, E as confirm, I as select, T as cancel, W as isCancel, j as log } from "./dist-CTBk70IR.mjs";
|
|
4
|
+
import { t as PlatformApiError } from "./client-BTZ3XkrB.mjs";
|
|
5
|
+
import { c as import_picocolors, l as sanitizeTerminalText } from "./output-Dm_A4Tbv.mjs";
|
|
6
6
|
import { t as validateProjectSlug } from "./project-slug-23TpquG4.mjs";
|
|
7
7
|
import { n as inferDefaultSlug } from "./resolve-project-BG5ORGID.mjs";
|
|
8
8
|
//#region src/cli/prompt.ts
|
|
@@ -87,6 +87,7 @@ async function createProjectWithSlugRetry(client, initialDefaultSlug, promptSlug
|
|
|
87
87
|
log.step(`Creating project ${import_picocolors.default.blue(slug)}...`);
|
|
88
88
|
const project = await client.createProject(slug);
|
|
89
89
|
log.success(`Project created: ${import_picocolors.default.blue(project.slug)}`);
|
|
90
|
+
reportProjectCreationWarnings(project);
|
|
90
91
|
return project;
|
|
91
92
|
} catch (error) {
|
|
92
93
|
if (error instanceof PlatformApiError && isRetryableCreateError(error)) {
|
|
@@ -98,6 +99,9 @@ async function createProjectWithSlugRetry(client, initialDefaultSlug, promptSlug
|
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
}
|
|
102
|
+
function reportProjectCreationWarnings(project) {
|
|
103
|
+
for (const warning of project.warnings ?? []) log.warn(sanitizeTerminalText(warning));
|
|
104
|
+
}
|
|
101
105
|
async function promptAndCreateProject(root, client) {
|
|
102
106
|
const project = await createProjectWithSlugRetry(client, inferDefaultSlug(root), async (defaultSlug) => promptProjectSlug(defaultSlug));
|
|
103
107
|
if (!project) throw new Error("Project creation cancelled.");
|
|
@@ -121,4 +125,4 @@ function isSlugRelatedError(error) {
|
|
|
121
125
|
return `${error.code ?? ""} ${error.body ?? ""}`.toLowerCase().includes("slug");
|
|
122
126
|
}
|
|
123
127
|
//#endregion
|
|
124
|
-
export {
|
|
128
|
+
export { promptProjectSelection as a, reportProjectCreationWarnings as i, isRetryableCreateError as n, promptProjectSetupAction as o, promptAndCreateProject as r, createProjectWithSlugRetry as t };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { a as join, l as relative, r as extname, t as basename, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { a as dim, c as import_picocolors, r as cliTitle } from "./output-CCH48AMM.mjs";
|
|
3
2
|
import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
|
|
4
3
|
import { t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
|
|
5
4
|
import { c as getToken, o as getProxyUrl } from "./auth-DLNN0D3Z.mjs";
|
|
6
5
|
import { i as isCloudflareAccessChallenge, n as ensurePlatformAccessToken, r as ensurePlatformProxyAccess } from "./cf-access-P0iZnu0q.mjs";
|
|
7
6
|
import { i as readDeploymentPlatform, o as readProjectConfig } from "./project-C0Fqu05O.mjs";
|
|
8
|
-
import { h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-
|
|
7
|
+
import { h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
9
8
|
import { r as detectFramework } from "./plugin-inference-BMfKRSqE.mjs";
|
|
10
9
|
import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-DiTn9yr6.mjs";
|
|
11
|
-
import { t as resolveLocalD1Target } from "./local-d1-
|
|
10
|
+
import { t as resolveLocalD1Target } from "./local-d1-Bg9OzEEO.mjs";
|
|
12
11
|
import { a as loadLocalEnv } from "./env-_v349JBd.mjs";
|
|
13
|
-
import { E as confirm, O as intro, P as outro, W as isCancel, j as log } from "./dist-
|
|
12
|
+
import { E as confirm, O as intro, P as outro, W as isCancel, j as log } from "./dist-CTBk70IR.mjs";
|
|
14
13
|
import { i as validateMigrations, r as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-CIUwFpjB.mjs";
|
|
15
|
-
import { n as PlatformClient, t as PlatformApiError } from "./client-
|
|
16
|
-
import {
|
|
14
|
+
import { n as PlatformClient, t as PlatformApiError } from "./client-BTZ3XkrB.mjs";
|
|
15
|
+
import { a as dim, c as import_picocolors, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
|
|
16
|
+
import { n as formatTimestamp } from "./gen-sCtlCOdA.mjs";
|
|
17
17
|
import { createRequire } from "node:module";
|
|
18
18
|
import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
19
19
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
@@ -273,7 +273,7 @@ async function runConnect(root, dialect, args) {
|
|
|
273
273
|
if (result.dashboardUrl) log.info(`Dashboard: ${result.dashboardUrl}`);
|
|
274
274
|
}
|
|
275
275
|
if (!connectionString) {
|
|
276
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./dist-
|
|
276
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./dist-BuDuKZJv.mjs");
|
|
277
277
|
const answer = await promptText({
|
|
278
278
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
279
279
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/database" : "postgresql://user:pass@host:5432/database"
|
|
@@ -318,7 +318,7 @@ async function runPush(root, dialect) {
|
|
|
318
318
|
outro("Done.");
|
|
319
319
|
}
|
|
320
320
|
async function runGenerate(root, dialect) {
|
|
321
|
-
const { prepareProject } = await import("./prepare-
|
|
321
|
+
const { prepareProject } = await import("./prepare-Bm3iq-u4.mjs");
|
|
322
322
|
const { writeDrizzleConfig } = await import("./config-0acf1oys.mjs");
|
|
323
323
|
await prepareProject(root);
|
|
324
324
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
@@ -399,7 +399,7 @@ async function runStatus(root, dialect) {
|
|
|
399
399
|
applied_at: ""
|
|
400
400
|
}));
|
|
401
401
|
} else {
|
|
402
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
402
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BT6OWFBk.mjs");
|
|
403
403
|
remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"))).map((name) => ({
|
|
404
404
|
name,
|
|
405
405
|
applied_at: ""
|
|
@@ -641,7 +641,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
641
641
|
process.exit(0);
|
|
642
642
|
}
|
|
643
643
|
if (dialect === "sqlite") {
|
|
644
|
-
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
644
|
+
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-BT6OWFBk.mjs");
|
|
645
645
|
const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB"), sql);
|
|
646
646
|
if (rows.length > 0) printTable(rows);
|
|
647
647
|
else log.success("Executed successfully.");
|
|
@@ -846,7 +846,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
846
846
|
outro("Done.");
|
|
847
847
|
return;
|
|
848
848
|
}
|
|
849
|
-
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
849
|
+
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BT6OWFBk.mjs");
|
|
850
850
|
const binding = resolveBindingNames(readConfig(root).inference?.bindings)?.d1 ?? "DB";
|
|
851
851
|
const context = resolveCloudflareD1Context(root, binding);
|
|
852
852
|
const remoteBefore = new Set(await readCloudflareD1Migrations(context));
|
|
@@ -862,7 +862,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
862
862
|
log.error(getErrorMessage(error));
|
|
863
863
|
process.exit(1);
|
|
864
864
|
}
|
|
865
|
-
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-
|
|
865
|
+
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-B19L2Bra.mjs");
|
|
866
866
|
const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations);
|
|
867
867
|
if (!applySet.ok) {
|
|
868
868
|
log.error(applySet.reason);
|
|
@@ -1508,7 +1508,7 @@ async function runExport(root, args, dialect) {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
1510
1510
|
async function runSetUrl(root) {
|
|
1511
|
-
const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-
|
|
1511
|
+
const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-CyQ-wVd7.mjs");
|
|
1512
1512
|
const dialect = getDialect(readVoidConfig(root));
|
|
1513
1513
|
if (dialect === "sqlite") {
|
|
1514
1514
|
log.error("db: This command is only for PostgreSQL and MySQL projects. Set \"database\" to \"pg\" or \"mysql\" in void.config.ts.");
|
|
@@ -1524,7 +1524,7 @@ async function runSetUrl(root) {
|
|
|
1524
1524
|
log.error("No project linked. Run `void deploy` first or link a project.");
|
|
1525
1525
|
process.exit(1);
|
|
1526
1526
|
}
|
|
1527
|
-
const { text: promptText, isCancel: isCancelCheck } = await import("./dist-
|
|
1527
|
+
const { text: promptText, isCancel: isCancelCheck } = await import("./dist-BuDuKZJv.mjs");
|
|
1528
1528
|
const connectionString = await promptText({
|
|
1529
1529
|
message: `Enter your ${dialect === "mysql" ? "MySQL" : "PostgreSQL"} connection string:`,
|
|
1530
1530
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/dbname" : "postgresql://user:pass@host:5432/dbname",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as createSpinner, r as cliTitle } from "./output-CCH48AMM.mjs";
|
|
2
1
|
import { c as getToken } from "./auth-DLNN0D3Z.mjs";
|
|
3
2
|
import { c as removeProjectConfig, o as readProjectConfig } from "./project-C0Fqu05O.mjs";
|
|
4
|
-
import { B as text, N as note, O as intro, P as outro, T as cancel, W as isCancel, j as log } from "./dist-
|
|
5
|
-
import { n as PlatformClient } from "./client-
|
|
3
|
+
import { B as text, N as note, O as intro, P as outro, T as cancel, W as isCancel, j as log } from "./dist-CTBk70IR.mjs";
|
|
4
|
+
import { n as PlatformClient } from "./client-BTZ3XkrB.mjs";
|
|
5
|
+
import { i as createSpinner, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
|
|
6
6
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
7
7
|
//#region src/cli/delete.ts
|
|
8
8
|
async function runDeleteCommand(root, slug, options) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as parseRootWranglerConfig, J as runDeploy, f as checkWranglerMigrationApplySet } from "./deploy-
|
|
1
|
+
import { A as parseRootWranglerConfig, J as runDeploy, f as checkWranglerMigrationApplySet } from "./deploy-CH-o2CaZ.mjs";
|
|
2
2
|
export { checkWranglerMigrationApplySet, parseRootWranglerConfig, runDeploy };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { n as __toESM, t as __commonJSMin } from "./rolldown-runtime-DXIUcv95.mjs";
|
|
2
2
|
import { a as join, l as relative, n as dirname, o as normalize, r as extname, t as basename, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
|
|
4
4
|
import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-GgcMozYz.mjs";
|
|
5
5
|
import { t as findVoidAuthConfig } from "./config-DPByhVck.mjs";
|
|
6
6
|
import { i as trustedCloudflareWorkerAccessHeaders, r as scopedAccessCredentials, t as cfAccessHeaders } from "./cf-access-DRsQRe6k.mjs";
|
|
7
7
|
import { a as getApiUrl, c as getToken, l as getTokenSource, o as getProxyUrl, u as isStagingMode } from "./auth-DLNN0D3Z.mjs";
|
|
8
8
|
import { r as ensurePlatformProxyAccess, t as ensureCloudflaredToken } from "./cf-access-P0iZnu0q.mjs";
|
|
9
9
|
import { d as writeProjectConfig, i as readDeploymentPlatform, l as writeDeploymentPlatform, o as readProjectConfig, t as attachSelectedPlatform } from "./project-C0Fqu05O.mjs";
|
|
10
|
-
import { d as isNodeTarget, h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-
|
|
11
|
-
import { A as writeWranglerPublishedTrafficSnapshot, D as syncWranglerWebSockets, E as syncWranglerDurableObjects,
|
|
10
|
+
import { d as isNodeTarget, h as resolveBindingNames, m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
11
|
+
import { A as writeWranglerPublishedTrafficSnapshot, B as materializeCloudflareConfig, D as syncWranglerWebSockets, E as syncWranglerDurableObjects, F as requiresSandboxPlatformImage, I as resolveSandboxConfig, L as sandboxContainerConfig, M as SANDBOX_MIGRATION_TAG, P as isSandboxEnabled, S as readWranglerPublishedTrafficSnapshot, T as syncWranglerBindings, V as persistCloudflareConfig, W as stashCloudflareDeployPointer, a as LIVE_MIGRATION_TAG, c as bindingEntriesForField, f as findBindingNameOwner, g as readExistingLiveBindingConfig, h as normalizeWranglerCompatibilityFlags, k as writeProvisionedWranglerConfig, l as ensureWranglerCompat, m as nextDurableObjectMigrationTag, o as acknowledgeWranglerManagedQueueRemovals, p as hasDurableObjectSqliteMigration, r as FRIENDLY_BINDING_NAMES, w as resolveLiveBindingConfig, x as readWranglerManagedQueueCleanupCandidates } from "./wrangler-DQF1vKyf.mjs";
|
|
12
12
|
import { i as voidWarn, r as voidLog } from "./log-ChfPKsVd.mjs";
|
|
13
|
-
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-
|
|
13
|
+
import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-DWi2IXWx.mjs";
|
|
14
14
|
import { n as isIdentifier, r as isLiteral } from "./ast-CPGPjb0V.mjs";
|
|
15
15
|
import { t as scanPages } from "./scan-4tfN-PSn.mjs";
|
|
16
16
|
import { a as scanJobsSync, i as scanQueuesSync, r as scanRoutes } from "./scan-ClYmX3sa.mjs";
|
|
@@ -19,12 +19,12 @@ import { t as collectMigrations } from "./collect-DiTn9yr6.mjs";
|
|
|
19
19
|
import { r as buildMigrationPlanBundle } from "./plan-BEZ8VJW0.mjs";
|
|
20
20
|
import { r as scanWranglerDotenvKeys } from "./dotenv-VQxupEUv.mjs";
|
|
21
21
|
import { t as discoverSchema } from "./discover-BcPPiF1o.mjs";
|
|
22
|
-
import { t as MagicString } from "./dist-
|
|
22
|
+
import { t as MagicString } from "./dist-AoCzRTJE.mjs";
|
|
23
23
|
import { t as findEnvFile } from "./env-types-C2_bIk_b.mjs";
|
|
24
24
|
import { d as formatEnvReport, f as listSelfHostSecretNames, g as validateProdEnv, h as selfHostSchemaFailureMessage, i as SelfHostSecretListError, l as dischargeSelfHostEnvContext, n as SelfHostFirstDeployError, p as readEmittedWorkerVars, r as SelfHostSchemaError, s as deriveSelfHostEnvContextFromVars, t as SelfHostEnvValidationError, u as fetchRemoteSecretNames, v as readGeneratedWranglerConfigFile } from "./env-validation-BB4GkLxn.mjs";
|
|
25
25
|
import { n as CLOUDFLARE_DEPLOY_BUILD_ENV, o as resolveRemoteMode, s as stripInternalEnvKeys } from "./env-_v349JBd.mjs";
|
|
26
26
|
import { o as validateSsrEntry } from "./entry-CF5wvH4w.mjs";
|
|
27
|
-
import { E as confirm, I as select, N as note, O as intro, P as outro, W as isCancel, j as log$1 } from "./dist-
|
|
27
|
+
import { E as confirm, I as select, N as note, O as intro, P as outro, W as isCancel, j as log$1 } from "./dist-CTBk70IR.mjs";
|
|
28
28
|
import { t as writeDrizzleConfig } from "./config-D8MOgiQV.mjs";
|
|
29
29
|
import { i as runMySqlMigrations } from "./runner-mysql-DmWchSWJ.mjs";
|
|
30
30
|
import { i as runPgMigrations } from "./runner-pg-D4OPlil-.mjs";
|
|
@@ -32,19 +32,20 @@ import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from
|
|
|
32
32
|
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CIUwFpjB.mjs";
|
|
33
33
|
import { t as renderPrerenderPaths } from "./prerender-render-D9qbLs2f.mjs";
|
|
34
34
|
import { a as scanEmailHandlersSync, r as hasEmailHandlers } from "./email--tEtMoj_.mjs";
|
|
35
|
-
import { i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-
|
|
35
|
+
import { i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-BJ6yGEIS.mjs";
|
|
36
36
|
import { n as getPackageDir } from "./agents-B_pX_HmQ.mjs";
|
|
37
|
-
import { i as isExpiredTokenError, n as PlatformClient, o as parsePlatformErrorBody, r as isCliOutdatedError, s as platformErrorMessage, t as PlatformApiError } from "./client-
|
|
37
|
+
import { i as isExpiredTokenError, n as PlatformClient, o as parsePlatformErrorBody, r as isCliOutdatedError, s as platformErrorMessage, t as PlatformApiError } from "./client-BTZ3XkrB.mjs";
|
|
38
38
|
import { a as resolveProjectCommand, i as hasBackendFiles, n as detectPreset, o as resolveWranglerArgv, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-UHj9ARyP.mjs";
|
|
39
|
-
import {
|
|
40
|
-
import { n as writeVoidProjectConfig } from "./config-write-
|
|
41
|
-
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-
|
|
42
|
-
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-
|
|
39
|
+
import { a as ensureCloudflareAuthentication, n as cloudflareAuthNeedsTerminal, o as parseCloudflareAuthSession, r as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-DQkqoMYa.mjs";
|
|
40
|
+
import { n as writeVoidProjectConfig } from "./config-write-B1f88wJA.mjs";
|
|
41
|
+
import { r as discoverFrameworkWranglerFiles, t as migrateLegacyVoidConfig } from "./migrate-BPITvDJN.mjs";
|
|
42
|
+
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-B9tzgjmf.mjs";
|
|
43
43
|
import { t as formatCloudflareUserMessage } from "./cloudflare-user-output-Q-k0QoNQ.mjs";
|
|
44
|
-
import {
|
|
44
|
+
import { c as import_picocolors$1, i as createSpinner, r as cliTitle } from "./output-Dm_A4Tbv.mjs";
|
|
45
|
+
import { a as promptProjectSelection, i as reportProjectCreationWarnings, o as promptProjectSetupAction, r as promptAndCreateProject } from "./create-project-l9J7pbtm.mjs";
|
|
45
46
|
import { t as getRequestedProjectSlug } from "./resolve-project-BG5ORGID.mjs";
|
|
46
47
|
import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
|
|
47
|
-
import { t as promptForLoginToken } from "./login-
|
|
48
|
+
import { t as promptForLoginToken } from "./login-CAsAsQ-_.mjs";
|
|
48
49
|
import { createRequire } from "node:module";
|
|
49
50
|
import { copyFileSync, cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
50
51
|
import { fileURLToPath } from "node:url";
|
|
@@ -59,6 +60,7 @@ import { Minimatch } from "minimatch";
|
|
|
59
60
|
import { CloudflareWorkerInspectionError, activateCloudflareVersion, assertCloudflareBindingsPreserved, assertCloudflareDurableObjectLifecycleSupported, assertExistingCloudflareConfig, encodeCloudflareVersionMessage, extractWorkersDevSubdomain, normalizeWorkersDevSubdomain, parseRootWranglerConfig, parseRootWranglerConfig as parseRootWranglerConfig$1, readBindingFieldPresence, readCloudflareTriggerConfig, readConfigEntryString, readExistingCloudflareWorker, readStoredResourceName, readWranglerTopLevelString, renderCloudflareStaticEntry, resolveD1MigrateTarget, stageCloudflareStaticAssets, writeCloudflareFrameworkDeployConfig, writeCloudflareStaticDeployConfig } from "@void/deploy-cloudflare";
|
|
60
61
|
import { getWorkerAssetsDir, getWorkerBundleDir, getWorkerConfigPath, readBuildOutput } from "@cloudflare/build-output-utils";
|
|
61
62
|
import ignore from "ignore";
|
|
63
|
+
import mime from "mime";
|
|
62
64
|
import { hash } from "blake3-jit";
|
|
63
65
|
//#region src/asset-routing.ts
|
|
64
66
|
function isApiRoutePattern(pattern) {
|
|
@@ -2081,7 +2083,7 @@ async function uploadAssets(options) {
|
|
|
2081
2083
|
for (const hash of bucket) {
|
|
2082
2084
|
const path = byHash.get(hash);
|
|
2083
2085
|
if (!path) throw new Error("Cloudflare requested an asset outside the verified Worker output.");
|
|
2084
|
-
form.append(hash, readFileSync(path).toString("base64"));
|
|
2086
|
+
form.append(hash, new File([readFileSync(path).toString("base64")], hash, { type: mime.getType(path) ?? "application/null" }));
|
|
2085
2087
|
}
|
|
2086
2088
|
const uploaded = await apiResult(`${options.accountUrl}/workers/assets/upload?base64=true`, uploadJwt, "POST", form, options.verifyUploader);
|
|
2087
2089
|
if (uploaded.jwt !== void 0) completionJwt = requiredString(uploaded.jwt, "asset completion token");
|
|
@@ -2679,8 +2681,8 @@ function assertCloudflareCandidateUnchanged(root, expected) {
|
|
|
2679
2681
|
}
|
|
2680
2682
|
function recordCloudflareCandidateUpload(root, expected, accountId, workerName, parentVersionId, versionId) {
|
|
2681
2683
|
assertCloudflareCandidateUnchanged(root, expected);
|
|
2682
|
-
if (expected && (expected.accountId !== accountId || expected.workerName !== workerName || expected.parentVersionId !== parentVersionId)) throw new Error("The saved Cloudflare candidate belongs to a different Worker or live version. Inspect the deployment before retrying.");
|
|
2683
|
-
const versionIds = [...expected?.versionIds
|
|
2684
|
+
if (expected && (expected.accountId !== accountId || expected.workerName !== workerName || expected.parentVersionId !== parentVersionId && expected.versionIds.at(-1) !== parentVersionId)) throw new Error("The saved Cloudflare candidate belongs to a different Worker or live version. Inspect the deployment before retrying.");
|
|
2685
|
+
const versionIds = [...expected?.parentVersionId === parentVersionId ? expected.versionIds : [], versionId];
|
|
2684
2686
|
mkdirSync(join(root, ".void"), { recursive: true });
|
|
2685
2687
|
const path = join(root, CANDIDATE_FILE);
|
|
2686
2688
|
const temp = `${path}.${process.pid}.tmp`;
|
|
@@ -3970,13 +3972,12 @@ function toWebSocketManifest(routes) {
|
|
|
3970
3972
|
}
|
|
3971
3973
|
function toSandboxManifest(sandbox) {
|
|
3972
3974
|
return {
|
|
3973
|
-
controllerProtocol:
|
|
3975
|
+
controllerProtocol: 2,
|
|
3974
3976
|
bindingName: sandbox.binding,
|
|
3975
3977
|
className: sandbox.className,
|
|
3976
3978
|
containerName: sandbox.containerName,
|
|
3977
3979
|
image: sandbox.platformImage,
|
|
3978
|
-
...sandbox.instanceType && { instanceType: sandbox.instanceType }
|
|
3979
|
-
...sandbox.maxInstances != null && { maxInstances: sandbox.maxInstances }
|
|
3980
|
+
...sandbox.instanceType && { instanceType: sandbox.instanceType }
|
|
3980
3981
|
};
|
|
3981
3982
|
}
|
|
3982
3983
|
function toLiveManifest(live) {
|
|
@@ -4805,7 +4806,7 @@ let loadedProvisionModule;
|
|
|
4805
4806
|
* so a managed deploy never imports it — and thus never loads `proper-lockfile`.
|
|
4806
4807
|
*/
|
|
4807
4808
|
async function loadProvisionModule() {
|
|
4808
|
-
loadedProvisionModule ??= await import("./provision-
|
|
4809
|
+
loadedProvisionModule ??= await import("./provision-Fr9pRqce.mjs");
|
|
4809
4810
|
return loadedProvisionModule;
|
|
4810
4811
|
}
|
|
4811
4812
|
/**
|
|
@@ -5356,21 +5357,30 @@ function snapshotPassthroughRawFields(config) {
|
|
|
5356
5357
|
* build injected, dropped, or retargeted.
|
|
5357
5358
|
*/
|
|
5358
5359
|
function reconstructExpectedContainers(config, root, rootConfig, needsSandbox) {
|
|
5359
|
-
const
|
|
5360
|
-
const expected = [...rootContainers];
|
|
5360
|
+
const expected = [...Array.isArray(rootConfig.containers) ? rootConfig.containers : []];
|
|
5361
5361
|
if (needsSandbox) {
|
|
5362
5362
|
const sandbox = resolveSandboxConfig(config, root);
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
image: sandbox.image,
|
|
5367
|
-
...sandbox.imageBuildContext && { image_build_context: sandbox.imageBuildContext },
|
|
5368
|
-
...sandbox.instanceType && { instance_type: sandbox.instanceType },
|
|
5369
|
-
...sandbox.maxInstances != null && { max_instances: sandbox.maxInstances }
|
|
5370
|
-
});
|
|
5363
|
+
const index = expected.findIndex((container) => readConfigEntryString(container, "class_name") === sandbox.className);
|
|
5364
|
+
if (index >= 0) expected.splice(index, 1);
|
|
5365
|
+
expected.push(sandboxContainerConfig(sandbox));
|
|
5371
5366
|
}
|
|
5372
5367
|
return expected;
|
|
5373
5368
|
}
|
|
5369
|
+
/** Normalize only the named-image path fields Vite relocates into its output config. */
|
|
5370
|
+
function normalizeContainerImagePaths(container, base) {
|
|
5371
|
+
if (!container || typeof container !== "object" || Array.isArray(container)) return container;
|
|
5372
|
+
const value = container;
|
|
5373
|
+
if (!value.images || typeof value.images !== "object" || Array.isArray(value.images)) return container;
|
|
5374
|
+
return {
|
|
5375
|
+
...value,
|
|
5376
|
+
images: Object.fromEntries(Object.entries(value.images).map(([name, source]) => {
|
|
5377
|
+
if (!source || typeof source !== "object" || Array.isArray(source)) return [name, source];
|
|
5378
|
+
const image = { ...source };
|
|
5379
|
+
for (const key of ["dockerfile", "build_context"]) if (typeof image[key] === "string") image[key] = resolve(base, image[key]);
|
|
5380
|
+
return [name, image];
|
|
5381
|
+
}))
|
|
5382
|
+
};
|
|
5383
|
+
}
|
|
5374
5384
|
/** Reconstruct the Durable Object state emitted after the pre-build root config is synced. */
|
|
5375
5385
|
function reconstructExpectedDurableObjectState(config, root, rootConfig, options) {
|
|
5376
5386
|
const bindings = bindingEntriesForField("durable_objects", rootConfig.durable_objects).map(({ entry }) => entry);
|
|
@@ -5381,7 +5391,7 @@ function reconstructExpectedDurableObjectState(config, root, rootConfig, options
|
|
|
5381
5391
|
name: sandbox.binding,
|
|
5382
5392
|
class_name: sandbox.className
|
|
5383
5393
|
});
|
|
5384
|
-
if (!migrations.some((migration) => migration.tag === "void-sandbox-
|
|
5394
|
+
if (!migrations.some((migration) => migration.tag === "void-sandbox-v2" || Array.isArray(migration.new_sqlite_classes) && migration.new_sqlite_classes.includes(sandbox.className))) migrations.push({
|
|
5385
5395
|
tag: SANDBOX_MIGRATION_TAG,
|
|
5386
5396
|
new_sqlite_classes: [sandbox.className]
|
|
5387
5397
|
});
|
|
@@ -6052,7 +6062,7 @@ function verifyGeneratedDeployConfig(root, expected) {
|
|
|
6052
6062
|
ok: false,
|
|
6053
6063
|
reason: `generated config declares a container application ${JSON.stringify(className)} that Void did not derive from source — refusing to deploy a container application the build injected.`
|
|
6054
6064
|
};
|
|
6055
|
-
if (!deepEqual(container, expectedContainer)) return {
|
|
6065
|
+
if (!deepEqual(normalizeContainerImagePaths(container, dirname(redirectedPath)), normalizeContainerImagePaths(expectedContainer, root))) return {
|
|
6056
6066
|
ok: false,
|
|
6057
6067
|
reason: `generated config container application ${JSON.stringify(className)} does not match the pre-build config — refusing to deploy a container application the build retargeted.`
|
|
6058
6068
|
};
|
|
@@ -7759,7 +7769,7 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
7759
7769
|
log.error("deploy: cf could not prepare the built Worker for deployment.");
|
|
7760
7770
|
return exit(1);
|
|
7761
7771
|
}
|
|
7762
|
-
preflight.dispose();
|
|
7772
|
+
await preflight.dispose();
|
|
7763
7773
|
}
|
|
7764
7774
|
let workerWasMissingBeforeSecretProvisioning = false;
|
|
7765
7775
|
let initialAuthSecret;
|
|
@@ -9202,7 +9212,7 @@ async function runFrameworkDeploy(root, config, client, detected, fwPreset, void
|
|
|
9202
9212
|
} catch {}
|
|
9203
9213
|
if (resources) {
|
|
9204
9214
|
if (!resources.some((resource) => resource.type === "hyperdrive")) {
|
|
9205
|
-
const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-
|
|
9215
|
+
const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-BuDuKZJv.mjs");
|
|
9206
9216
|
const connectionString = await promptText({
|
|
9207
9217
|
message: `Your project uses ${dialect === "mysql" ? "MySQL" : "PostgreSQL"}. Enter your connection string:`,
|
|
9208
9218
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/dbname" : "postgresql://user:pass@host:5432/dbname",
|
|
@@ -9451,7 +9461,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
9451
9461
|
} catch {}
|
|
9452
9462
|
if (resources) {
|
|
9453
9463
|
if (!resources.some((resource) => resource.type === "hyperdrive")) {
|
|
9454
|
-
const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-
|
|
9464
|
+
const { text: promptText, isCancel: isCancelPrompt } = await import("./dist-BuDuKZJv.mjs");
|
|
9455
9465
|
const connectionString = await promptText({
|
|
9456
9466
|
message: `Your project uses ${dialect === "mysql" ? "MySQL" : "PostgreSQL"}. Enter your connection string:`,
|
|
9457
9467
|
placeholder: dialect === "mysql" ? "mysql://user:pass@host:3306/dbname" : "postgresql://user:pass@host:5432/dbname",
|
|
@@ -9672,6 +9682,7 @@ async function createProjectFromSlug(root, client, slug, cliLog) {
|
|
|
9672
9682
|
};
|
|
9673
9683
|
writeProjectConfig(root, attachSelectedPlatform(root, config, client.apiUrl));
|
|
9674
9684
|
log.success(`Project created: ${import_picocolors$1.default.blue(config.slug)}`);
|
|
9685
|
+
reportProjectCreationWarnings(project);
|
|
9675
9686
|
cliLog?.info("project_create_success", {
|
|
9676
9687
|
projectId: config.projectId,
|
|
9677
9688
|
slug: config.slug
|