void 0.8.10 → 0.9.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/{better-auth-shared-BXdg2Sur.d.mts → better-auth-shared-BxcgLiHN.d.mts} +2 -2
- package/dist/cli/cli.mjs +24 -24
- package/dist/{create-project-DmGoYMqF.mjs → create-project-Dg5hiuDE.mjs} +10 -2
- package/dist/{db-CSn2p-PN.mjs → db-D7l4OGV1.mjs} +13 -13
- package/dist/{deploy-FrfE1IPx.mjs → deploy-iR7ug73w.mjs} +19 -13
- package/dist/{env-helpers-GICENGaN.d.mts → env-helpers-bupZjGHq.d.mts} +1 -1
- package/dist/{gen-DVPMPTL1.mjs → gen-CsawhQZz.mjs} +1 -1
- package/dist/{handler-2mA_-sst.d.mts → handler-DMSGX5S6.d.mts} +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +180 -64
- package/dist/{init-BaXYK2PD.mjs → init-CD9yg4Xt.mjs} +6 -6
- package/dist/{link-PClO4q2M.mjs → link-27a64clx.mjs} +7 -9
- package/dist/{node-x1AzR6Yf.mjs → node-C2HhnBO_.mjs} +3 -3
- package/dist/package-json-BMdypFnO.mjs +44 -0
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/{plugin-inference-Ba1uGdIy.mjs → plugin-inference-BUBhHt_1.mjs} +6 -2
- package/dist/{prepare-D8znEv3-.mjs → prepare-BNuC8Ds9.mjs} +3 -3
- package/dist/{preset-BRsCi8ZB.mjs → preset-Lvi0ORmO.mjs} +6 -21
- package/dist/{project-cmd-CErG1vM7.mjs → project-cmd-DUkWHooP.mjs} +7 -7
- package/dist/{protocol-DXs_1QcC.d.mts → protocol-hjl3Nx5x.d.mts} +3 -3
- package/dist/{runner-DCYwTlee.mjs → runner-Cioqe5b2.mjs} +11 -3
- package/dist/runtime/ai.mjs +1 -1
- package/dist/runtime/auth.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth-pg.mjs +3 -3
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/better-auth.mjs +2 -2
- package/dist/runtime/client-react.d.mts +6 -0
- package/dist/runtime/client-react.mjs +5 -0
- package/dist/runtime/client-solid.d.mts +6 -0
- package/dist/runtime/client-solid.mjs +5 -0
- package/dist/runtime/client-svelte.d.mts +6 -0
- package/dist/runtime/client-svelte.mjs +5 -0
- package/dist/runtime/client-vue.d.mts +6 -0
- package/dist/runtime/client-vue.mjs +5 -0
- package/dist/runtime/client.d.mts +2 -2
- package/dist/runtime/client.mjs +1 -1
- package/dist/runtime/env-helpers.d.mts +1 -1
- package/dist/runtime/env-public-client.d.mts +1 -1
- package/dist/runtime/env-public.d.mts +2 -2
- package/dist/runtime/env-public.mjs +1 -1
- package/dist/runtime/env.mjs +1 -1
- package/dist/runtime/fetch-stream.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +1 -1
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/migration-handler-pg.mjs +1 -1
- package/dist/runtime/remote/index.d.mts +5 -1
- package/dist/runtime/remote/index.mjs +7 -4
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws.d.mts +3 -3
- package/dist/{scan-DzzHqtiT.mjs → scan-BNC_1OsY.mjs} +1 -1
- package/package.json +22 -2
- package/skills/void/docs/guide/env-vars.md +4 -1
- package/skills/void/docs/integrations/cloudflare.md +3 -2
- package/skills/void/docs/reference/api.md +42 -30
- package/skills/void/docs/reference/config.md +1 -1
- package/skills/void/docs/reference/resource-inference.md +11 -11
- /package/dist/{auth-CHfPhSta.d.mts → auth-BL0cU_Sy.d.mts} +0 -0
- /package/dist/{auth-cmd-DE2YDAk0.mjs → auth-cmd-BSdoU6dB.mjs} +0 -0
- /package/dist/{auth-migrations-BqJoGqGQ.mjs → auth-migrations-DBoTUBvq.mjs} +0 -0
- /package/dist/{better-auth-shared-CbAF6sOM.mjs → better-auth-shared-pR54mTD2.mjs} +0 -0
- /package/dist/{cache-ChOUXuMY.mjs → cache-Cb4Vs95q.mjs} +0 -0
- /package/dist/{cancel-deploy-g6bC-mpl.mjs → cancel-deploy-CLVkqGJB.mjs} +0 -0
- /package/dist/{defer-DkoEwda-.mjs → defer-BosTTQTi.mjs} +0 -0
- /package/dist/{delete-D446r1rC.mjs → delete-Bi-gbEHT.mjs} +0 -0
- /package/dist/{domain-Digh83lu.mjs → domain-C_atK_X9.mjs} +0 -0
- /package/dist/{drizzle-DmaANP4-.mjs → drizzle-Bvhm-Uug.mjs} +0 -0
- /package/dist/{env-CJMOHUbW.mjs → env-Dc073Aip.mjs} +0 -0
- /package/dist/{env-raw-zk5JQKZe.mjs → env-raw-DhK_myJu.mjs} +0 -0
- /package/dist/{fetch-error-rXermVU3.mjs → fetch-error-B8GTcrQw.mjs} +0 -0
- /package/dist/{fetch-error-7aWl0RiD.d.mts → fetch-error-Dn-En6Wg.d.mts} +0 -0
- /package/dist/{head-DnTAP4p-.d.mts → head-BW_f2L_4.d.mts} +0 -0
- /package/dist/{list-G03-pEN-.mjs → list-C3Xt_i8a.mjs} +0 -0
- /package/dist/{logs-D0a_HhLn.mjs → logs-CktUaLEr.mjs} +0 -0
- /package/dist/{mcp-BLsmImuJ.mjs → mcp-BU7CP6gX.mjs} +0 -0
- /package/dist/{pg-BDQxUp3Q.mjs → pg-C-ybKyFU.mjs} +0 -0
- /package/dist/{providers--6L9uf7j.d.mts → providers-BVUcW4Jo.d.mts} +0 -0
- /package/dist/{rollback-BtiabraI.mjs → rollback-CEjAG9uQ.mjs} +0 -0
- /package/dist/{runner-pg-CJ04wNk5.mjs → runner-pg-D8ciL41o.mjs} +0 -0
- /package/dist/{secret-CNnequJa.mjs → secret-Dab6XQdb.mjs} +0 -0
- /package/dist/{skills-C38GxuGT.mjs → skills-GPm5Kjev.mjs} +0 -0
- /package/dist/{standard-schema-BDiIJgp5.d.mts → standard-schema-DCIm8cwQ.d.mts} +0 -0
- /package/dist/{subcommand-prompt-BLewBtNI.mjs → subcommand-prompt-DUaWltdH.mjs} +0 -0
- /package/dist/{types-C0AOcrPN.d.mts → types-s2mK7ar_.d.mts} +0 -0
- /package/dist/{yarn-pnp-CLFC1T3p.mjs → yarn-pnp-BdM0hoCa.mjs} +0 -0
|
@@ -2,7 +2,8 @@ import { n as cliTitle, s as import_picocolors } from "./output-DeiS4oEX.mjs";
|
|
|
2
2
|
import { c as getToken, n as PlatformClient, s as getSiteDomain } from "./client-CCOKwNUz.mjs";
|
|
3
3
|
import { _ as me, c as R, g as ge, y as ye } from "./dist-abzUneor.mjs";
|
|
4
4
|
import { a as writeProjectConfig, r as readProjectConfig } from "./project-CH9pdo16.mjs";
|
|
5
|
-
import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-
|
|
5
|
+
import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-Dg5hiuDE.mjs";
|
|
6
|
+
import { r as resolveProjectBySlug } from "./resolve-project-CNpUbUHd.mjs";
|
|
6
7
|
//#region src/cli/link.ts
|
|
7
8
|
async function runLink(root, slug) {
|
|
8
9
|
console.log();
|
|
@@ -21,19 +22,16 @@ async function runLink(root, slug) {
|
|
|
21
22
|
const client = new PlatformClient(token, { root });
|
|
22
23
|
const projects = await client.listProjects();
|
|
23
24
|
if (slug) {
|
|
24
|
-
const
|
|
25
|
-
if (!
|
|
25
|
+
const config = resolveProjectBySlug(projects, slug);
|
|
26
|
+
if (!config) {
|
|
26
27
|
me(`project: No project found with slug '${slug}'.`);
|
|
27
28
|
process.exit(1);
|
|
28
29
|
}
|
|
29
|
-
writeProjectConfig(root,
|
|
30
|
-
|
|
31
|
-
slug: project.slug
|
|
32
|
-
});
|
|
33
|
-
ye(`Linked to ${import_picocolors.default.blue(project.slug)}.${getSiteDomain(root)}`);
|
|
30
|
+
writeProjectConfig(root, config);
|
|
31
|
+
ye(`Linked to ${import_picocolors.default.blue(config.slug)}.${getSiteDomain(root)}`);
|
|
34
32
|
return;
|
|
35
33
|
}
|
|
36
|
-
const result = await promptProjectSelection(projects, "Select a project:", root);
|
|
34
|
+
const result = await promptProjectSelection(projects, "Select a project:", root, { confirmExisting: true });
|
|
37
35
|
if (result.action === "create") {
|
|
38
36
|
const config = await promptAndCreateProject(root, client);
|
|
39
37
|
ye(`Created and linked to ${import_picocolors.default.blue(config.slug)}.${getSiteDomain(root)}`);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
2
2
|
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
|
|
3
3
|
import { f as readConfig } from "./config-BVEC0lti.mjs";
|
|
4
|
-
import { r as resolveVoidAuthMigrationSchema } from "./drizzle-
|
|
5
|
-
import { n as applySqliteAuthMigrations, t as applyPgAuthMigrations } from "./auth-migrations-
|
|
6
|
-
import { getMiniflareDatabasePath } from "./runner-
|
|
4
|
+
import { r as resolveVoidAuthMigrationSchema } from "./drizzle-Bvhm-Uug.mjs";
|
|
5
|
+
import { n as applySqliteAuthMigrations, t as applyPgAuthMigrations } from "./auth-migrations-DBoTUBvq.mjs";
|
|
6
|
+
import { getMiniflareDatabasePath } from "./runner-Cioqe5b2.mjs";
|
|
7
7
|
import { loadEnv } from "vite";
|
|
8
8
|
//#region src/auth/node.ts
|
|
9
9
|
async function runLocalVoidAuthMigrations(root, dialect, persistRoot = join(root, ".void"), databaseId = "local", configPath = findVoidAuthConfig(root)) {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { a as join, n as dirname } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
//#region src/shared/package-json.ts
|
|
4
|
+
const DEFAULT_DEPENDENCY_FIELDS = ["dependencies", "devDependencies"];
|
|
5
|
+
function isPackageJson(value) {
|
|
6
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
7
|
+
}
|
|
8
|
+
function readPackageJson(root) {
|
|
9
|
+
try {
|
|
10
|
+
const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf-8"));
|
|
11
|
+
return isPackageJson(pkg) ? pkg : null;
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function readNearestPackageJson(startDir) {
|
|
17
|
+
let dir = startDir;
|
|
18
|
+
while (true) {
|
|
19
|
+
if (existsSync(join(dir, "package.json"))) {
|
|
20
|
+
const packageJson = readPackageJson(dir);
|
|
21
|
+
return packageJson ? {
|
|
22
|
+
root: dir,
|
|
23
|
+
packageJson
|
|
24
|
+
} : null;
|
|
25
|
+
}
|
|
26
|
+
const parent = dirname(dir);
|
|
27
|
+
if (parent === dir) return null;
|
|
28
|
+
dir = parent;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function getPackageDependencies(packageJson, fields = DEFAULT_DEPENDENCY_FIELDS) {
|
|
32
|
+
const dependencies = {};
|
|
33
|
+
for (const field of fields) {
|
|
34
|
+
const group = packageJson[field];
|
|
35
|
+
if (!isPackageJson(group)) continue;
|
|
36
|
+
for (const [name, spec] of Object.entries(group)) if (typeof spec === "string") dependencies[name] = spec;
|
|
37
|
+
}
|
|
38
|
+
return dependencies;
|
|
39
|
+
}
|
|
40
|
+
function hasPackageDependency(packageJson, packageName, fields) {
|
|
41
|
+
return packageName in getPackageDependencies(packageJson, fields);
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { readPackageJson as i, hasPackageDependency as n, readNearestPackageJson as r, getPackageDependencies as t };
|
package/dist/pages/client.d.mts
CHANGED
package/dist/pages/head.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-
|
|
1
|
+
import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-BW_f2L_4.mjs";
|
|
2
2
|
export { HeadConfig, HeadDescriptor, renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead };
|
package/dist/pages/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-
|
|
2
|
-
import { a as PageScanResult, i as PageDefinition, n as LayoutDefinition, r as NamedLayoutDefinition } from "../types-
|
|
1
|
+
import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-BW_f2L_4.mjs";
|
|
2
|
+
import { a as PageScanResult, i as PageDefinition, n as LayoutDefinition, r as NamedLayoutDefinition } from "../types-s2mK7ar_.mjs";
|
|
3
3
|
import { serializePageData } from "./serialize.mjs";
|
|
4
4
|
import { RewriteDestination } from "void/routes";
|
|
5
5
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { S as ValidationError } from "../handler-
|
|
2
|
-
import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-
|
|
1
|
+
import { S as ValidationError } from "../handler-DMSGX5S6.mjs";
|
|
2
|
+
import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-hjl3Nx5x.mjs";
|
|
3
3
|
export { PageObject, PageRenderResult, ValidationError, flattenValidationErrors, handlePageGet, handlePageMutation, safeJsonStringify };
|
package/dist/pages/protocol.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isConvertedResponse } from "../runtime/response.mjs";
|
|
2
|
-
import { i as ValidationError, r as separateDeferred, t as DEFERRED } from "../defer-
|
|
2
|
+
import { i as ValidationError, r as separateDeferred, t as DEFERRED } from "../defer-BosTTQTi.mjs";
|
|
3
3
|
import { resolveHead } from "./head.mjs";
|
|
4
4
|
//#region src/pages/protocol.ts
|
|
5
5
|
const POWERED_BY = { "X-Powered-By": "Void" };
|
|
@@ -255,7 +255,11 @@ function inferBindingsFromSource(code, filename) {
|
|
|
255
255
|
case "void/live":
|
|
256
256
|
if (!isTypeOnlyImportStatement(code.slice(imp.ss, imp.se + 1))) result.needsLive = true;
|
|
257
257
|
break;
|
|
258
|
-
case "void/client":
|
|
258
|
+
case "void/client":
|
|
259
|
+
case "void/client/react":
|
|
260
|
+
case "void/client/vue":
|
|
261
|
+
case "void/client/svelte":
|
|
262
|
+
case "void/client/solid": {
|
|
259
263
|
const stmt = code.slice(imp.ss, imp.se + 1);
|
|
260
264
|
if (/\bauth\b/.test(stmt)) result.needsAuth = true;
|
|
261
265
|
break;
|
|
@@ -271,7 +275,7 @@ function inferBindingsFromSource(code, filename) {
|
|
|
271
275
|
if (/\bfrom\s+["']void\/ai["']/.test(code)) result.needsAI = true;
|
|
272
276
|
if (/\bfrom\s+["']void\/sandbox["']/.test(code)) result.needsSandbox = true;
|
|
273
277
|
if (hasRuntimeImportFrom(code, "void/live")) result.needsLive = true;
|
|
274
|
-
if (/\bfrom\s+["']void\/client["']/.test(code) && /\bauth\b/.test(code)) result.needsAuth = true;
|
|
278
|
+
if (/\bfrom\s+["']void\/client(?:\/(?:react|vue|svelte|solid))?["']/.test(code) && /\bauth\b/.test(code)) result.needsAuth = true;
|
|
275
279
|
}
|
|
276
280
|
if (result.needsD1 && result.needsKV && result.needsR2 && result.needsAI && result.needsSandbox && result.needsLive) return result;
|
|
277
281
|
if (!ENV_BINDING_RE.test(code)) return result;
|
|
@@ -4,13 +4,13 @@ import { i as resolveProjectPaths } from "./project-paths-CCMrHYQm.mjs";
|
|
|
4
4
|
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
|
|
5
5
|
import { c as R, g as ge, u as Se, y as ye } from "./dist-abzUneor.mjs";
|
|
6
6
|
import { c as getDatabaseDialect, f as readConfig } from "./config-BVEC0lti.mjs";
|
|
7
|
-
import { r as scanRoutes } from "./scan-
|
|
8
|
-
import { i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-
|
|
7
|
+
import { r as scanRoutes } from "./scan-BNC_1OsY.mjs";
|
|
8
|
+
import { i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-BUBhHt_1.mjs";
|
|
9
9
|
import { i as generateDbDts, n as generateQueueTypes, t as generateRouteTypes } from "./route-types-jxRfWuCb.mjs";
|
|
10
10
|
import { n as ensureProjectTsconfig } from "./project-tsconfig-HAGjfY6w.mjs";
|
|
11
11
|
import { t as discoverSchema } from "./discover-C8N1I4tK.mjs";
|
|
12
12
|
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-D6qI1ThV.mjs";
|
|
13
|
-
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-
|
|
13
|
+
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-Bvhm-Uug.mjs";
|
|
14
14
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
16
|
import { loadEnv } from "vite";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { a as join, c as resolve } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
2
2
|
import { n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
|
|
3
|
-
import { s as hasSsrEntry } from "./plugin-inference-
|
|
4
|
-
import {
|
|
3
|
+
import { s as hasSsrEntry } from "./plugin-inference-BUBhHt_1.mjs";
|
|
4
|
+
import { i as readPackageJson, n as hasPackageDependency, t as getPackageDependencies } from "./package-json-BMdypFnO.mjs";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
5
6
|
//#region src/cli/preset.ts
|
|
6
7
|
/**
|
|
7
8
|
* Known output conventions for SSGs.
|
|
@@ -123,7 +124,7 @@ function detectPreset(root, options) {
|
|
|
123
124
|
};
|
|
124
125
|
const pkg = readPackageJson(root);
|
|
125
126
|
if (pkg) {
|
|
126
|
-
const allDeps =
|
|
127
|
+
const allDeps = getPackageDependencies(pkg);
|
|
127
128
|
for (const preset of Object.values(SSG_PRESETS)) if (preset.dep in allDeps) {
|
|
128
129
|
const overrides = preset.resolve?.(root);
|
|
129
130
|
const cmd = overrides?.buildCommand ?? preset.buildCommand;
|
|
@@ -165,19 +166,6 @@ function resolveCommandBin(root, name) {
|
|
|
165
166
|
if (name === "vite") return detectViteBinary(root);
|
|
166
167
|
return name;
|
|
167
168
|
}
|
|
168
|
-
function readPackageJson(root) {
|
|
169
|
-
try {
|
|
170
|
-
return JSON.parse(readFileSync(join(root, "package.json"), "utf-8"));
|
|
171
|
-
} catch {
|
|
172
|
-
return null;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
function getAllDeps(pkg) {
|
|
176
|
-
return {
|
|
177
|
-
...pkg.dependencies ?? {},
|
|
178
|
-
...pkg.devDependencies ?? {}
|
|
179
|
-
};
|
|
180
|
-
}
|
|
181
169
|
function detectPackageManager(root) {
|
|
182
170
|
if (existsSync(join(root, "pnpm-lock.yaml"))) return "pnpm";
|
|
183
171
|
if (existsSync(join(root, "yarn.lock"))) return "yarn";
|
|
@@ -196,14 +184,11 @@ function resolveProjectScriptCommand(root, scriptName) {
|
|
|
196
184
|
}
|
|
197
185
|
}
|
|
198
186
|
function hasViteLike(pkg) {
|
|
199
|
-
|
|
200
|
-
return "vite" in deps || "vite-plus" in deps;
|
|
187
|
+
return hasPackageDependency(pkg, "vite") || hasPackageDependency(pkg, "vite-plus");
|
|
201
188
|
}
|
|
202
189
|
function detectViteBinary(root) {
|
|
203
190
|
const pkg = readPackageJson(root);
|
|
204
|
-
if (pkg)
|
|
205
|
-
if ("vite-plus" in getAllDeps(pkg)) return "vp";
|
|
206
|
-
}
|
|
191
|
+
if (pkg && hasPackageDependency(pkg, "vite-plus")) return "vp";
|
|
207
192
|
return "vite";
|
|
208
193
|
}
|
|
209
194
|
/**
|
|
@@ -34,32 +34,32 @@ async function runProjectsCommand(root) {
|
|
|
34
34
|
//#region src/cli/project-cmd.ts
|
|
35
35
|
async function runProjectCommand(root, args) {
|
|
36
36
|
if (args.subcommand === "status") {
|
|
37
|
-
const { runListCommand } = await import("./list-
|
|
37
|
+
const { runListCommand } = await import("./list-C3Xt_i8a.mjs");
|
|
38
38
|
return runListCommand(root, args.name || void 0);
|
|
39
39
|
}
|
|
40
40
|
if (args.subcommand === "link") {
|
|
41
|
-
const { runLink } = await import("./link-
|
|
41
|
+
const { runLink } = await import("./link-27a64clx.mjs");
|
|
42
42
|
return runLink(root, args.name || void 0);
|
|
43
43
|
}
|
|
44
44
|
if (args.subcommand === "list") return runProjectsCommand(root);
|
|
45
45
|
if (args.subcommand === "logs") {
|
|
46
|
-
const { runLogsCommand } = await import("./logs-
|
|
46
|
+
const { runLogsCommand } = await import("./logs-CktUaLEr.mjs");
|
|
47
47
|
return runLogsCommand(root, args.filter, args.range, args.deployment || void 0, args.level || void 0);
|
|
48
48
|
}
|
|
49
49
|
if (args.subcommand === "rollback") {
|
|
50
|
-
const { runRollbackCommand } = await import("./rollback-
|
|
50
|
+
const { runRollbackCommand } = await import("./rollback-CEjAG9uQ.mjs");
|
|
51
51
|
return runRollbackCommand(root, args.deployId || void 0);
|
|
52
52
|
}
|
|
53
53
|
if (args.subcommand === "cancel") {
|
|
54
|
-
const { runCancelDeployCommand } = await import("./cancel-deploy-
|
|
54
|
+
const { runCancelDeployCommand } = await import("./cancel-deploy-CLVkqGJB.mjs");
|
|
55
55
|
return runCancelDeployCommand(root, args.deployId || void 0);
|
|
56
56
|
}
|
|
57
57
|
if (args.subcommand === "delete") {
|
|
58
|
-
const { runDeleteCommand } = await import("./delete-
|
|
58
|
+
const { runDeleteCommand } = await import("./delete-Bi-gbEHT.mjs");
|
|
59
59
|
return runDeleteCommand(root, args.name || void 0, { force: args.force });
|
|
60
60
|
}
|
|
61
61
|
if (args.subcommand === "purge-cache") {
|
|
62
|
-
const { runPurgeCacheCommand } = await import("./cache-
|
|
62
|
+
const { runPurgeCacheCommand } = await import("./cache-Cb4Vs95q.mjs");
|
|
63
63
|
return runPurgeCacheCommand(root, args.projectSlug || void 0);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as HeadDescriptor, t as HeadConfig } from "./head-
|
|
2
|
-
import { n as CloudContext, t as CloudBindings } from "./handler-
|
|
3
|
-
import { t as DevCssAsset } from "./types-
|
|
1
|
+
import { n as HeadDescriptor, t as HeadConfig } from "./head-BW_f2L_4.mjs";
|
|
2
|
+
import { n as CloudContext, t as CloudBindings } from "./handler-DMSGX5S6.mjs";
|
|
3
|
+
import { t as DevCssAsset } from "./types-s2mK7ar_.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/pages/protocol.d.ts
|
|
6
6
|
/** Escape characters that are unsafe inside inline <script> tags to prevent XSS. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { a as join, n as dirname } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
|
|
2
2
|
import { t as collectMigrations } from "./collect-9rO3JFNM.mjs";
|
|
3
3
|
import { r as classifyMigration } from "./plan-aD3wRDqF.mjs";
|
|
4
|
+
import { n as hasPackageDependency, r as readNearestPackageJson } from "./package-json-BMdypFnO.mjs";
|
|
4
5
|
import { existsSync, mkdirSync } from "node:fs";
|
|
5
6
|
import { createHash, createHmac } from "node:crypto";
|
|
6
7
|
//#region src/migrations/runner.ts
|
|
@@ -10,10 +11,17 @@ const SQLITE_INTERNAL_TABLES = new Set([
|
|
|
10
11
|
"_void_migrations",
|
|
11
12
|
"__drizzle_migrations"
|
|
12
13
|
]);
|
|
13
|
-
function
|
|
14
|
+
function projectUsesVitePlus(startDir = process.cwd()) {
|
|
15
|
+
const nearest = readNearestPackageJson(startDir);
|
|
16
|
+
return nearest ? hasPackageDependency(nearest.packageJson, "vite-plus") : false;
|
|
17
|
+
}
|
|
18
|
+
function toBetterSqlite3Error(error, cwd = process.cwd()) {
|
|
14
19
|
const message = error instanceof Error ? error.message : String(error);
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
const isMissingBinding = message.includes("Could not locate the bindings file");
|
|
21
|
+
const isNodeVersionMismatch = message.includes("was compiled against a different Node.js version") || message.includes("NODE_MODULE_VERSION");
|
|
22
|
+
if (!isMissingBinding && !isNodeVersionMismatch) return error instanceof Error ? error : new Error(message);
|
|
23
|
+
const usesVitePlus = projectUsesVitePlus(cwd);
|
|
24
|
+
return /* @__PURE__ */ new Error(`db: better-sqlite3 is installed but its native binding was not built. Set \`allowBuilds.better-sqlite3\` to \`true\` in pnpm-workspace.yaml and run \`${usesVitePlus ? "vp rebuild" : "pnpm rebuild better-sqlite3"}\`. ${usesVitePlus ? "Vite+ uses its managed Node.js runtime for `vp dev`; rebuild native modules with `vp rebuild` and run Void CLI commands through Vite+ as `vp exec void <command>`." : "Plain Vite projects use your system Node.js runtime, so `pnpm rebuild better-sqlite3` rebuilds the matching native module."} See https://pnpm.io/settings#allowbuilds`);
|
|
17
25
|
}
|
|
18
26
|
async function openSqliteDatabase(dbPath, options) {
|
|
19
27
|
try {
|
package/dist/runtime/ai.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as cfAccessHeaders } from "../cf-access-DKDsgwOU.mjs";
|
|
2
|
-
import { i as getRawRuntimeEnv } from "../env-raw-
|
|
2
|
+
import { i as getRawRuntimeEnv } from "../env-raw-DhK_myJu.mjs";
|
|
3
3
|
//#region src/runtime/ai-types.ts
|
|
4
4
|
/** Maps provider prefix to expected env var name for the API key */
|
|
5
5
|
const PROVIDER_KEY_MAP = {
|
package/dist/runtime/auth.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as VoidAuthConfigContext, c as getSession, i as VoidAuthConfig, l as getUser, n as AuthState, o as authContext, r as AuthUser, s as defineAuth, t as AuthSession, u as requireAuth } from "../auth-
|
|
1
|
+
import { a as VoidAuthConfigContext, c as getSession, i as VoidAuthConfig, l as getUser, n as AuthState, o as authContext, r as AuthUser, s as defineAuth, t as AuthSession, u as requireAuth } from "../auth-BL0cU_Sy.mjs";
|
|
2
2
|
export { AuthSession, AuthState, AuthUser, VoidAuthConfig, VoidAuthConfigContext, authContext, defineAuth, getSession, getUser, requireAuth };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv, r as VoidAuthRuntimeApi, t as VoidAuthDialect } from "../better-auth-shared-
|
|
1
|
+
import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv, r as VoidAuthRuntimeApi, t as VoidAuthDialect } from "../better-auth-shared-BxcgLiHN.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/better-auth-pg.d.ts
|
|
4
4
|
declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as applyPgAuthMigrations } from "../auth-migrations-
|
|
2
|
-
import { t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
3
|
-
import { t as disablePgPassFallback } from "../pg-
|
|
1
|
+
import { t as applyPgAuthMigrations } from "../auth-migrations-DBoTUBvq.mjs";
|
|
2
|
+
import { t as createVoidAuthRuntime } from "../better-auth-shared-pR54mTD2.mjs";
|
|
3
|
+
import { t as disablePgPassFallback } from "../pg-C-ybKyFU.mjs";
|
|
4
4
|
//#region src/runtime/better-auth-pg.ts
|
|
5
5
|
function resolveConnectionString(env) {
|
|
6
6
|
const connectionString = typeof env.DATABASE_URL === "string" && env.DATABASE_URL.length > 0 ? env.DATABASE_URL : typeof env.HYPERDRIVE?.connectionString === "string" && env.HYPERDRIVE.connectionString.length > 0 ? env.HYPERDRIVE.connectionString : void 0;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv, r as VoidAuthRuntimeApi, t as VoidAuthDialect } from "../better-auth-shared-
|
|
1
|
+
import { i as VoidAuthRuntimeOptions, n as VoidAuthEnv, r as VoidAuthRuntimeApi, t as VoidAuthDialect } from "../better-auth-shared-BxcgLiHN.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/better-auth.d.ts
|
|
4
4
|
declare const resolveVoidAuthOptions: VoidAuthRuntimeApi["resolveVoidAuthOptions"];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as applySqliteAuthMigrations } from "../auth-migrations-
|
|
2
|
-
import { t as createVoidAuthRuntime } from "../better-auth-shared-
|
|
1
|
+
import { n as applySqliteAuthMigrations } from "../auth-migrations-DBoTUBvq.mjs";
|
|
2
|
+
import { t as createVoidAuthRuntime } from "../better-auth-shared-pR54mTD2.mjs";
|
|
3
3
|
//#region src/runtime/better-auth.ts
|
|
4
4
|
async function resolveDatabase(env) {
|
|
5
5
|
if (!env.DB) throw new Error("auth: Better Auth requires the \"DB\" D1 binding for sqlite apps.");
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-BL0cU_Sy.mjs";
|
|
2
|
+
import { auth, createAuthClient } from "./auth-client-react.mjs";
|
|
3
|
+
import { t as FetchError } from "../fetch-error-Dn-En6Wg.mjs";
|
|
4
|
+
import { fetch } from "./fetch.mjs";
|
|
5
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
6
|
+
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { t as FetchError } from "../fetch-error-B8GTcrQw.mjs";
|
|
2
|
+
import { fetch } from "./fetch.mjs";
|
|
3
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
4
|
+
import { auth, createAuthClient } from "./auth-client-react.mjs";
|
|
5
|
+
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-BL0cU_Sy.mjs";
|
|
2
|
+
import { auth, createAuthClient } from "./auth-client-solid.mjs";
|
|
3
|
+
import { t as FetchError } from "../fetch-error-Dn-En6Wg.mjs";
|
|
4
|
+
import { fetch } from "./fetch.mjs";
|
|
5
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
6
|
+
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { t as FetchError } from "../fetch-error-B8GTcrQw.mjs";
|
|
2
|
+
import { fetch } from "./fetch.mjs";
|
|
3
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
4
|
+
import { auth, createAuthClient } from "./auth-client-solid.mjs";
|
|
5
|
+
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-BL0cU_Sy.mjs";
|
|
2
|
+
import { auth, createAuthClient } from "./auth-client-svelte.mjs";
|
|
3
|
+
import { t as FetchError } from "../fetch-error-Dn-En6Wg.mjs";
|
|
4
|
+
import { fetch } from "./fetch.mjs";
|
|
5
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
6
|
+
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { t as FetchError } from "../fetch-error-B8GTcrQw.mjs";
|
|
2
|
+
import { fetch } from "./fetch.mjs";
|
|
3
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
4
|
+
import { auth, createAuthClient } from "./auth-client-svelte.mjs";
|
|
5
|
+
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-BL0cU_Sy.mjs";
|
|
2
|
+
import { auth, createAuthClient } from "./auth-client-vue.mjs";
|
|
3
|
+
import { t as FetchError } from "../fetch-error-Dn-En6Wg.mjs";
|
|
4
|
+
import { fetch } from "./fetch.mjs";
|
|
5
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
6
|
+
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { t as FetchError } from "../fetch-error-B8GTcrQw.mjs";
|
|
2
|
+
import { fetch } from "./fetch.mjs";
|
|
3
|
+
import { fetchStream } from "./fetch-stream.mjs";
|
|
4
|
+
import { auth, createAuthClient } from "./auth-client-vue.mjs";
|
|
5
|
+
export { FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-
|
|
1
|
+
import { n as AuthState, r as AuthUser, t as AuthSession } from "../auth-BL0cU_Sy.mjs";
|
|
2
2
|
import { auth, createAuthClient } from "./auth-client.mjs";
|
|
3
|
-
import { t as FetchError } from "../fetch-error-
|
|
3
|
+
import { t as FetchError } from "../fetch-error-Dn-En6Wg.mjs";
|
|
4
4
|
import { fetch } from "./fetch.mjs";
|
|
5
5
|
import { fetchStream } from "./fetch-stream.mjs";
|
|
6
6
|
export { type AuthSession, type AuthState, type AuthUser, FetchError, FetchError as StreamError, auth, createAuthClient, fetch, fetchStream };
|
package/dist/runtime/client.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as FetchError } from "../fetch-error-
|
|
1
|
+
import { t as FetchError } from "../fetch-error-B8GTcrQw.mjs";
|
|
2
2
|
import { fetch } from "./fetch.mjs";
|
|
3
3
|
import { fetchStream } from "./fetch-stream.mjs";
|
|
4
4
|
import { auth, createAuthClient } from "./auth-client.mjs";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getSecretOverride, c as oneOf, i as email, l as string, n as SECRET_OVERRIDE_SYMBOL, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-
|
|
1
|
+
import { a as getSecretOverride, c as oneOf, i as email, l as string, n as SECRET_OVERRIDE_SYMBOL, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-bupZjGHq.mjs";
|
|
2
2
|
export { EnvSchema, SECRET_OVERRIDE_SYMBOL, boolean, email, getSecretOverride, json, number, oneOf, string, url };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-
|
|
1
|
+
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-bupZjGHq.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/runtime/env-public-client.d.ts
|
|
4
4
|
declare const env: Record<string, unknown>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { t as StandardSchemaV1 } from "../standard-schema-
|
|
3
|
-
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-
|
|
2
|
+
import { t as StandardSchemaV1 } from "../standard-schema-DCIm8cwQ.mjs";
|
|
3
|
+
import { c as oneOf, i as email, l as string, o as json, r as boolean, s as number, t as EnvSchema, u as url } from "../env-helpers-bupZjGHq.mjs";
|
|
4
4
|
import * as _$_cloudflare_sandbox0 from "@cloudflare/sandbox";
|
|
5
5
|
|
|
6
6
|
//#region src/runtime/env-public.d.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getRawRuntimeEnv } from "../env-raw-
|
|
1
|
+
import { i as getRawRuntimeEnv } from "../env-raw-DhK_myJu.mjs";
|
|
2
2
|
import { getRuntimeEnv } from "./env.mjs";
|
|
3
3
|
import { boolean, email, getSecretOverride, json, number, oneOf, string, url } from "./env-helpers.mjs";
|
|
4
4
|
//#region src/shared/env-mask.ts
|
package/dist/runtime/env.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as getRawRuntimeEnv, n as asEnv, r as envContext, t as INTERNAL_BINDING_PREFIXES } from "../env-raw-
|
|
1
|
+
import { i as getRawRuntimeEnv, n as asEnv, r as envContext, t as INTERNAL_BINDING_PREFIXES } from "../env-raw-DhK_myJu.mjs";
|
|
2
2
|
//#region src/runtime/env.ts
|
|
3
3
|
/**
|
|
4
4
|
* Public runtime env API — exposed via "void/_env".
|
package/dist/runtime/fetch.d.mts
CHANGED
package/dist/runtime/fetch.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { C as HandlerInput, S as ValidationError, _ as defineScheduled, a as QueueBatch, b as InferProps, c as RenderAssetTags, d as VoidAssetRewriteError, f as defineHandler, g as defineRender, h as defineQueue, i as CloudEnv, l as TypedHandler, m as defineMiddleware, n as CloudContext, o as QueueMessage, p as defineHead, r as CloudContextVariables, s as QueueRetryOptions, t as CloudBindings, u as TypedQueueHandler, v as Deferred, w as ValidatorSlots, x as defer } from "../handler-
|
|
2
|
+
import { C as HandlerInput, S as ValidationError, _ as defineScheduled, a as QueueBatch, b as InferProps, c as RenderAssetTags, d as VoidAssetRewriteError, f as defineHandler, g as defineRender, h as defineQueue, i as CloudEnv, l as TypedHandler, m as defineMiddleware, n as CloudContext, o as QueueMessage, p as defineHead, r as CloudContextVariables, s as QueueRetryOptions, t as CloudBindings, u as TypedQueueHandler, v as Deferred, w as ValidatorSlots, x as defer } from "../handler-DMSGX5S6.mjs";
|
|
3
3
|
export { CloudBindings, CloudContext, CloudContextVariables, CloudEnv, Deferred, HandlerInput, InferProps, QueueBatch, QueueMessage, QueueRetryOptions, RenderAssetTags, TypedHandler, TypedQueueHandler, ValidationError, ValidatorSlots, VoidAssetRewriteError, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled };
|
package/dist/runtime/handler.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { convertReturnValue } from "./response.mjs";
|
|
2
2
|
import { runValidation } from "./validator.mjs";
|
|
3
|
-
import { i as ValidationError, n as defer } from "../defer-
|
|
3
|
+
import { i as ValidationError, n as defer } from "../defer-BosTTQTi.mjs";
|
|
4
4
|
//#region src/runtime/handler.ts
|
|
5
5
|
/**
|
|
6
6
|
* Thrown when `c.rewrite()` is called with a destination whose final path
|
package/dist/runtime/isr.mjs
CHANGED
package/dist/runtime/live.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="@cloudflare/workers-types" />
|
|
2
|
-
import { r as AuthUser } from "../auth-
|
|
3
|
-
import { i as CloudEnv, n as CloudContext } from "../handler-
|
|
2
|
+
import { r as AuthUser } from "../auth-BL0cU_Sy.mjs";
|
|
3
|
+
import { i as CloudEnv, n as CloudContext } from "../handler-DMSGX5S6.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/live.d.ts
|
|
6
6
|
type MaybePromise<T> = T | Promise<T>;
|
package/dist/runtime/live.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as disablePgPassFallback } from "../pg-
|
|
1
|
+
import { t as disablePgPassFallback } from "../pg-C-ybKyFU.mjs";
|
|
2
2
|
//#region src/runtime/migration-handler-pg.ts
|
|
3
3
|
function createMigrationHandler(env, migrations, _dialect, runAuthMigrations) {
|
|
4
4
|
return async (request) => {
|
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
* Replace local D1/KV/R2 bindings with proxy-backed versions.
|
|
4
4
|
* Called from the generated worker entry point when `__VOID_REMOTE` is set.
|
|
5
5
|
*/
|
|
6
|
-
declare function createRemoteEnv(env: Record<string, unknown
|
|
6
|
+
declare function createRemoteEnv(env: Record<string, unknown>, bindingNames?: {
|
|
7
|
+
d1?: string;
|
|
8
|
+
kv?: string;
|
|
9
|
+
r2?: string;
|
|
10
|
+
}): Record<string, unknown>;
|
|
7
11
|
//#endregion
|
|
8
12
|
export { createRemoteEnv };
|
|
@@ -448,13 +448,16 @@ function makeR2ObjectBody(key, res) {
|
|
|
448
448
|
* Replace local D1/KV/R2 bindings with proxy-backed versions.
|
|
449
449
|
* Called from the generated worker entry point when `__VOID_REMOTE` is set.
|
|
450
450
|
*/
|
|
451
|
-
function createRemoteEnv(env) {
|
|
451
|
+
function createRemoteEnv(env, bindingNames) {
|
|
452
452
|
const client = new ProxyClient(env.__VOID_PROXY_URL, env.__VOID_TOKEN, env.__VOID_PROJECT_ID, env);
|
|
453
|
+
const d1Name = bindingNames?.d1 ?? "DB";
|
|
454
|
+
const kvName = bindingNames?.kv ?? "KV";
|
|
455
|
+
const r2Name = bindingNames?.r2 ?? "STORAGE";
|
|
453
456
|
return {
|
|
454
457
|
...env,
|
|
455
|
-
...env
|
|
456
|
-
...env
|
|
457
|
-
...env
|
|
458
|
+
...env[d1Name] != null && { [d1Name]: new ProxyD1Database(client, d1Name) },
|
|
459
|
+
...env[kvName] != null && { [kvName]: new ProxyKVNamespace(client, kvName) },
|
|
460
|
+
...env[r2Name] != null && { [r2Name]: new ProxyR2Bucket(client, r2Name) }
|
|
458
461
|
};
|
|
459
462
|
}
|
|
460
463
|
//#endregion
|