void 1.3.0 → 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-B4i71m7k.mjs → account-cmd-HP8bixYo.mjs} +3 -3
- package/dist/{application-analysis-DYdVoMAY.mjs → application-analysis-DDOQwiXk.mjs} +11 -7
- package/dist/{application-routing-C8EqRDfv.mjs → application-routing-4719u_kf.mjs} +1 -1
- package/dist/auth-g2TQbDLD.d.mts +70 -0
- package/dist/{auth-link-BKwHPbdv.mjs → auth-link-CedYpDCy.mjs} +3 -3
- package/dist/{auth-router-DqLx8E0F.mjs → auth-router-vafo7x8w.mjs} +11 -6
- package/dist/{better-auth-shared-DVk2DkTW.d.mts → better-auth-shared-BHB8kiTE.d.mts} +1 -1
- package/dist/{build-cmd-Dy4psnt1.mjs → build-cmd-9vUAQ1_V.mjs} +1 -1
- package/dist/{cache-DV37S6dl.mjs → cache-jvwLNb0h.mjs} +1 -1
- package/dist/{cancel-deploy-DMPyu1Vt.mjs → cancel-deploy-Dw0UmWKO.mjs} +1 -1
- package/dist/{cf-build-output-Bapzc_8Z.mjs → cf-build-output-XpNR9zoh.mjs} +20 -4
- 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 +25 -25
- package/dist/cli/cloudflare-operation-process.mjs +9 -3
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/{client-BEMtySaV.mjs → client-B3LnB_bE.mjs} +1 -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-BaqIigwI.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-pNLQmr_e.mjs → cloudflare-connect-zTJh8UnN.mjs} +2 -2
- package/dist/{cloudflare-operations-vP3b5CQf.mjs → cloudflare-operations-Bc-7fN44.mjs} +4 -4
- package/dist/{cloudflare-operations-PCM4wucv.mjs → cloudflare-operations-BtulCNOg.mjs} +1 -1
- package/dist/{config-BU6hMu1W.mjs → config-BV2ASlpn.mjs} +1 -1
- package/dist/{config-Du88-7Y8.d.mts → config-CAdZVTLN.d.mts} +2 -0
- 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-DwVsBvVh.mjs → connect-BOM6zvFX.mjs} +4 -4
- package/dist/{create-project-CjzbBlTv.mjs → create-project-Bxd02EHN.mjs} +1 -1
- package/dist/{create-project-CgrnvzyA.mjs → create-project-C2K0DN2O.mjs} +1 -1
- package/dist/{db-rvo64snS.mjs → db-Cdvr3zwG.mjs} +16 -16
- package/dist/{db-types-NGxPwnlt.mjs → db-types-0eCiqYb1.mjs} +1 -1
- package/dist/{delete-DWX6dP4M.mjs → delete-lETE6Tpt.mjs} +1 -1
- package/dist/deploy-CX94CmKa.mjs +2 -0
- package/dist/{deploy-hRPvw8ci.mjs → deploy-CdM-LAxX.mjs} +260 -95
- package/dist/{deploy-managed-static-CDYA2p3L.mjs → deploy-managed-static-DjeBFG2c.mjs} +24 -17
- package/dist/{deploy-transport-JCxw7QDi.mjs → deploy-transport-DIq_gFTP.mjs} +13 -12
- package/dist/deploy.d.mts +2 -0
- package/dist/deploy.mjs +7 -5
- package/dist/{dispatch-OVLeWW8K.mjs → dispatch-CLa2LThw.mjs} +5 -5
- package/dist/{domain-CH5iBD9Y.mjs → domain-DyhNtdYf.mjs} +2 -2
- package/dist/{email-CbTO1l78.mjs → email-DM2wDcBN.mjs} +6 -6
- package/dist/{email-cloudflare-B8-pq_-W.mjs → email-cloudflare-PMbAev9Q.mjs} +20 -7
- package/dist/{env-BBdw236G.mjs → env-78hbN-oI.mjs} +3 -3
- package/dist/{env-validation-XcukUlFM.mjs → env-validation-B3VobvXm.mjs} +1 -0
- package/dist/{env-validation-BfBVvBNe.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-CCx3t2Ju.mjs → gen-CFmsUsW1.mjs} +3 -3
- package/dist/{github-cmd-BzkRLkbg.mjs → github-cmd-De-_IWbM.mjs} +1 -1
- package/dist/{handler-CQv5YDS0.d.mts → handler-BHktmuTL.d.mts} +3 -1
- package/dist/{headers-D522zd0A.mjs → headers--vaK_chu.mjs} +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +68 -33
- package/dist/{info-oBm8yK8J.mjs → info-Yg0-V5Rs.mjs} +3 -3
- package/dist/{init-CBp_uMve.mjs → init-CDiJQycf.mjs} +31 -16
- package/dist/{link-Dt_QXmM4.mjs → link-Dllip08S.mjs} +2 -2
- package/dist/{list-DF6asTdt.mjs → list-BYRP6am0.mjs} +2 -2
- package/dist/{live-CXJ9yC98.d.mts → live-BllfDuzA.d.mts} +2 -2
- package/dist/{local-d1-CUhH3qtj.mjs → local-d1-CAwAs9GH.mjs} +1 -1
- package/dist/login-BAPmYnb7.mjs +1 -0
- package/dist/{login-BjSyhXlT.mjs → login-PcFy5mlC.mjs} +2 -2
- package/dist/{logs-DmvBl6xA.mjs → logs-DmJTBhed.mjs} +2 -2
- package/dist/{migrate-BXRHpYwR.mjs → migrate-B8S2xTcb.mjs} +5 -66
- package/dist/migrate-BIYTPQE6.mjs +1 -0
- package/dist/nitro.mjs +4 -4
- package/dist/{node-DtD7ZiPf.mjs → node-CDOPrGSl.mjs} +3 -3
- package/dist/operator-cmd-CjazwOyb.mjs +1 -0
- package/dist/{operator-cmd-DjZKGGgN.mjs → operator-cmd-DmkmS2wL.mjs} +2 -2
- package/dist/pages/client.d.mts +17 -2
- package/dist/pages/client.mjs +26 -1
- package/dist/pages/index.d.mts +17 -1
- package/dist/pages/index.mjs +95 -4
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{platform-auth-config-BgnuMbml.mjs → platform-auth-config-CImnfohz.mjs} +3 -3
- package/dist/{platform-auth-protection-NjRejttU.mjs → platform-auth-protection-BogLhtHi.mjs} +2 -2
- package/dist/{platform-auth-recovery-Ug12d9W5.mjs → platform-auth-recovery-B-mEaWEi.mjs} +2 -2
- package/dist/{platform-cmd-BYKLMPCn.mjs → platform-cmd-CV8NxIIn.mjs} +1 -1
- package/dist/{platform-cmd-HByuZAO7.mjs → platform-cmd-DZK2ixMl.mjs} +3 -3
- package/dist/{platform-domain-DLSQ8GF8.mjs → platform-domain-CRvelPGE.mjs} +2 -2
- package/dist/{platform-lifecycle-3dwFJmnq.mjs → platform-lifecycle-CPYY7E9B.mjs} +8 -8
- package/dist/{platform-lifecycle-BRqcxerG.mjs → platform-lifecycle-DwXq7kZt.mjs} +1 -1
- package/dist/{platform-management-ZZ6bQM5j.mjs → platform-management-BOnGbMSM.mjs} +1 -1
- package/dist/{platform-management-ZK6XcbCo.mjs → platform-management-lXdgGgAM.mjs} +1 -1
- package/dist/{platform-recovery-8vNE5dNN.mjs → platform-recovery-noaALXnE.mjs} +2 -2
- package/dist/{prepare-5BR7Splm.mjs → prepare-BuOS18AM.mjs} +1 -1
- package/dist/{prepare-Dseww74N.mjs → prepare-D604Yiyr.mjs} +11 -7
- package/dist/prepare-DU-tOpS5.mjs +1 -0
- package/dist/{project-cmd-CjLNNxwe.mjs → project-cmd-DBYqAIbe.mjs} +13 -13
- package/dist/{project-team-DE5drjcl.mjs → project-team-BjCLgTRC.mjs} +1 -1
- package/dist/{project-token-XEYEXfiJ.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-6VPU8zmV.mjs → project-zero-trust-CWDh1P_t.mjs} +1 -1
- package/dist/{protocol-BekmFxCI.d.mts → protocol-D5XDySYu.d.mts} +1 -1
- package/dist/{provision-Chq0NRAV.mjs → provision-DfxLCg-d.mjs} +1 -1
- package/dist/{provision-B7UFrBH7.mjs → provision-DztLJ97X.mjs} +24 -8
- package/dist/{requests-CG-Pj8ze.mjs → requests-D_pbzDyz.mjs} +1 -1
- package/dist/{rollback-CIrm2txZ.mjs → rollback-CjfIYsJx.mjs} +2 -2
- package/dist/{route-types--PAOzHlH.mjs → route-types-DvEGmPif.mjs} +61 -3
- package/dist/runtime/auth.d.mts +2 -2
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth.d.mts +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/routing.d.mts +5 -4
- package/dist/runtime/routing.mjs +10 -70
- 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/{secret-BL6g7mF5.mjs → secret-3X0PxmuX.mjs} +9 -12
- package/dist/{version-metadata-DmaZNTYW.mjs → version-metadata-D2vfMQzv.mjs} +2 -1
- package/dist/{wrangler-CDiEBCdS.mjs → wrangler-I-scB_1t.mjs} +80 -12
- package/dist/wrangler-UnwdISay.mjs +1 -0
- package/dist/{wrapper-CEiDeCqD.mjs → wrapper-BBl1rC32.mjs} +3 -3
- package/dist/{ws-D1zWiB_P.d.mts → ws-B3ClMVDh.d.mts} +3 -2
- package/docs/guide/auth.md +1 -1
- package/docs/guide/edge/redirects.md +22 -0
- package/docs/guide/pages-routing/actions-and-forms.md +24 -0
- package/docs/guide/platform/installation/maintenance.md +3 -1
- package/docs/guide/server-routing.md +2 -0
- package/docs/guide/ssg.md +8 -0
- 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 +2 -0
- package/docs/reference/cli/deploy.md +10 -9
- package/docs/reference/config.md +11 -1
- package/package.json +8 -7
- package/schema.json +4 -0
- package/skills/void/SKILL.md +1 -1
- package/dist/auth-DkcFflXV.d.mts +0 -42
- package/dist/cf-build-output-DlBkWdNU.mjs +0 -1
- package/dist/client-DyxPQnF_.mjs +0 -1
- package/dist/config-BTu1o3Dc.mjs +0 -49
- package/dist/deploy-CtHE2A3R.mjs +0 -2
- package/dist/gen-TgXy93Rr.mjs +0 -1
- package/dist/login-Cdo8Aco1.mjs +0 -1
- package/dist/migrate-COPncCGx.mjs +0 -1
- package/dist/operator-cmd-DDiX7Y3f.mjs +0 -1
- package/dist/prepare-B3VrSF1Z.mjs +0 -1
- package/dist/wrangler-DOPr4jyI.mjs +0 -1
|
@@ -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";
|
|
@@ -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>;
|
|
@@ -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.");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as attachSelectedPlatform, u as writeProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { s as getSiteDomain } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { A as confirm, K as select, L as log, O as cancel, X as text, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { n as PlatformApiError } from "./client-
|
|
4
|
+
import { n as PlatformApiError } from "./client-B3LnB_bE.mjs";
|
|
5
5
|
import { f as import_picocolors, h as sanitizeTerminalText } from "./output-BpgYODYx.mjs";
|
|
6
6
|
import { t as validateProjectSlug } from "./project-slug-23TpquG4.mjs";
|
|
7
7
|
import { n as inferDefaultSlug } from "./resolve-project-Xoi6eTWY.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as createProjectWithSlugRetry } from "./create-project-
|
|
1
|
+
export { t as createProjectWithSlugRetry } from "./create-project-Bxd02EHN.mjs";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { a as join, c as resolve, n as dirname, r as extname, s as relative, t as basename } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import { r as detectFramework } from "./plugin-inference-CeiB6BG5.mjs";
|
|
3
3
|
import { n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
|
|
4
|
-
import { c as getDatabaseCasing, l as getDatabaseDialect, m as resolveBindingNames, p as readConfig } from "./config-
|
|
4
|
+
import { c as getDatabaseCasing, l as getDatabaseDialect, m as resolveBindingNames, p as readConfig } from "./config-OFOAimzt.mjs";
|
|
5
5
|
import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-Dew86qce.mjs";
|
|
6
6
|
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
7
|
-
import { t as resolveLocalD1Target } from "./local-d1-
|
|
7
|
+
import { t as resolveLocalD1Target } from "./local-d1-CAwAs9GH.mjs";
|
|
8
8
|
import { t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
|
|
9
9
|
import { n as ensurePlatformProxyAccess, r as isCloudflareAccessChallenge, t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
|
|
10
10
|
import { c as getToken, o as getProxyUrl } from "./auth-B6iOCjKI.mjs";
|
|
11
11
|
import { s as loadLocalEnv } from "./env-BaMz0j7H.mjs";
|
|
12
12
|
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CnZPMq4q.mjs";
|
|
13
13
|
import { A as confirm, H as outro, L as log, X as text, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
14
|
-
import { n as PlatformApiError, r as PlatformClient } from "./client-
|
|
14
|
+
import { n as PlatformApiError, r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
15
15
|
import { f as import_picocolors, i as dim, l as formatUrl, m as printSuccess, o as formatCount, u as getErrorMessage } from "./output-BpgYODYx.mjs";
|
|
16
16
|
import { n as drizzleKitBin } from "./yarn-pnp-DLbEFMT0.mjs";
|
|
17
|
-
import { n as formatTimestamp } from "./gen-
|
|
17
|
+
import { n as formatTimestamp } from "./gen-CFmsUsW1.mjs";
|
|
18
18
|
import { createRequire } from "node:module";
|
|
19
19
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
20
20
|
import { pathToFileURL } from "node:url";
|
|
@@ -156,7 +156,7 @@ function runDrizzleKit(root, args) {
|
|
|
156
156
|
* already printed its own error.
|
|
157
157
|
*/
|
|
158
158
|
async function runDrizzleKitWithDatabaseUrl(root, url, dialect, command) {
|
|
159
|
-
const { withPrivateDrizzleConfig } = await import("./config-
|
|
159
|
+
const { withPrivateDrizzleConfig } = await import("./config-BV2ASlpn.mjs");
|
|
160
160
|
if (!withPrivateDrizzleConfig(root, url, dialect, (configPath) => {
|
|
161
161
|
try {
|
|
162
162
|
runDrizzleKit(root, [
|
|
@@ -312,7 +312,7 @@ async function runPush(root, dialect) {
|
|
|
312
312
|
printSuccess("Database schema pushed.");
|
|
313
313
|
return;
|
|
314
314
|
}
|
|
315
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
315
|
+
const { writeDrizzleConfig } = await import("./config-BV2ASlpn.mjs");
|
|
316
316
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
317
317
|
mkdirSync(dirname(dbPath), { recursive: true });
|
|
318
318
|
const configPath = writeDrizzleConfig(root, dbPath);
|
|
@@ -328,8 +328,8 @@ async function runPush(root, dialect) {
|
|
|
328
328
|
printSuccess("Database schema pushed.");
|
|
329
329
|
}
|
|
330
330
|
async function runGenerate(root, dialect) {
|
|
331
|
-
const { prepareProject } = await import("./prepare-
|
|
332
|
-
const { PLACEHOLDER_DB_URL, writeDrizzleConfig } = await import("./config-
|
|
331
|
+
const { prepareProject } = await import("./prepare-DU-tOpS5.mjs");
|
|
332
|
+
const { PLACEHOLDER_DB_URL, writeDrizzleConfig } = await import("./config-BV2ASlpn.mjs");
|
|
333
333
|
await prepareProject(root);
|
|
334
334
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
335
335
|
const additionalSchemas = existsSync(authSchemaPath) ? [authSchemaPath] : void 0;
|
|
@@ -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-BtulCNOg.mjs");
|
|
403
403
|
remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, configuredD1Binding(root)))).map((name) => ({
|
|
404
404
|
name,
|
|
405
405
|
applied_at: ""
|
|
@@ -711,7 +711,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
711
711
|
process.exit(0);
|
|
712
712
|
}
|
|
713
713
|
if (dialect === "sqlite") {
|
|
714
|
-
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
714
|
+
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-BtulCNOg.mjs");
|
|
715
715
|
const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, configuredD1Binding(root)), sql);
|
|
716
716
|
if (rows.length > 0) printTable(rows);
|
|
717
717
|
} else {
|
|
@@ -905,7 +905,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
905
905
|
log.info(`No migration files found in ${paths.sourceRelative("db/migrations")}/`);
|
|
906
906
|
return;
|
|
907
907
|
}
|
|
908
|
-
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
908
|
+
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-BtulCNOg.mjs");
|
|
909
909
|
const binding = configuredD1Binding(root);
|
|
910
910
|
const context = resolveCloudflareD1Context(root, binding);
|
|
911
911
|
const remoteBefore = new Set(await readCloudflareD1Migrations(context));
|
|
@@ -925,7 +925,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
925
925
|
log.error(`db: D1 binding ${binding} has no "migrations_dir", so Cloudflare would apply ./migrations instead of ${dir}/. Add "migrations_dir": "./${dir}" to that D1 binding in your Cloudflare config, then run the command again.`);
|
|
926
926
|
process.exit(1);
|
|
927
927
|
}
|
|
928
|
-
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-
|
|
928
|
+
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-CX94CmKa.mjs");
|
|
929
929
|
const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations, paths.sourceRelative("db/migrations"));
|
|
930
930
|
if (!applySet.ok) {
|
|
931
931
|
log.error(applySet.reason);
|
|
@@ -1052,7 +1052,7 @@ async function runRestore(root, dialect, { target, platform: explicitPlatform, y
|
|
|
1052
1052
|
log.error("db: `void db restore` restores the D1 database of a direct Cloudflare deploy. After a one-off `void deploy --platform cloudflare`, run it with `--platform cloudflare`.");
|
|
1053
1053
|
process.exit(1);
|
|
1054
1054
|
}
|
|
1055
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context, restoreCloudflareD1Database } = await import("./cloudflare-operations-
|
|
1055
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context, restoreCloudflareD1Database } = await import("./cloudflare-operations-BtulCNOg.mjs");
|
|
1056
1056
|
const binding = configuredD1Binding(root);
|
|
1057
1057
|
const context = resolveCloudflareD1Context(root, binding);
|
|
1058
1058
|
const database = `D1 database ${context.migrateToken} (${binding})`;
|
|
@@ -1126,7 +1126,7 @@ async function runStudio(root, dialect, remote) {
|
|
|
1126
1126
|
await runDrizzleKitWithDatabaseUrl(root, url, dialect, "studio");
|
|
1127
1127
|
return;
|
|
1128
1128
|
}
|
|
1129
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
1129
|
+
const { writeDrizzleConfig } = await import("./config-BV2ASlpn.mjs");
|
|
1130
1130
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1131
1131
|
if (!existsSync(dbPath)) {
|
|
1132
1132
|
log.error("No local database found. Start the dev server first.");
|
|
@@ -1146,8 +1146,8 @@ async function runStudio(root, dialect, remote) {
|
|
|
1146
1146
|
}
|
|
1147
1147
|
/** A direct Cloudflare deploy records its D1 or Hyperdrive id in the checked-in Cloudflare config. */
|
|
1148
1148
|
async function hasDeployedCloudflareDatabase(root) {
|
|
1149
|
-
const { readRootWranglerConfig } = await import("./wrangler-
|
|
1150
|
-
const { isRealD1Id, isRealHyperdriveId } = await import("./provision-
|
|
1149
|
+
const { readRootWranglerConfig } = await import("./wrangler-UnwdISay.mjs");
|
|
1150
|
+
const { isRealD1Id, isRealHyperdriveId } = await import("./provision-DfxLCg-d.mjs");
|
|
1151
1151
|
const config = readRootWranglerConfig(root)?.config;
|
|
1152
1152
|
const entries = (key) => {
|
|
1153
1153
|
const value = config?.[key];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as writeFileIfChanged } from "./project-tsconfig-CVvk6Z_e.mjs";
|
|
3
3
|
//#region src/codegen/db-types.ts
|
|
4
4
|
const DRIZZLE_OPERATORS = "sql, eq, ne, gt, gte, lt, lte, and, or, not, desc, asc, like, ilike, notLike, inArray, notInArray, isNull, isNotNull, between, notBetween, exists, notExists, count, sum, avg, min, max";
|
|
5
5
|
const DIALECT_DB_TYPES = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as removeProjectConfig, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
3
|
import { L as log, O as cancel, X as text, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
4
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
+
import { r as PlatformClient } from "./client-B3LnB_bE.mjs";
|
|
5
5
|
import { m as printSuccess, p as note, r as createSpinner } from "./output-BpgYODYx.mjs";
|
|
6
6
|
import { a as resolveProjectBySlug } from "./resolve-project-Xoi6eTWY.mjs";
|
|
7
7
|
//#region src/cli/delete.ts
|