void 0.10.8 → 0.10.11
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/AGENT_PROMPT.md +4 -0
- package/README.md +1 -1
- package/dist/{agents-Bmr5tFFb.mjs → agents-CtgBYqld.mjs} +1 -1
- package/dist/{auth-cmd-DlgNwByu.mjs → auth-cmd-BqsdZJp5.mjs} +3 -3
- package/dist/{better-auth-shared-BvnM9px6.d.mts → better-auth-shared-DealXecJ.d.mts} +1 -1
- package/dist/{build-cmd-Br8qL0rA.mjs → build-cmd-Bujrv5q-.mjs} +3 -3
- package/dist/{cache-wH-mP8UE.mjs → cache-C11V8Fxq.mjs} +3 -3
- package/dist/{cancel-deploy-BEBOEgtu.mjs → cancel-deploy-fwFYF04b.mjs} +2 -2
- package/dist/cli/cli.mjs +175 -43
- package/dist/cli/env-schema-probe.d.mts +96 -0
- package/dist/cli/env-schema-probe.mjs +272 -0
- package/dist/{client-Cj96iiBH.mjs → client-Gb71-XkG.mjs} +20 -2
- package/dist/{config-BdUctCZD.mjs → config-CutEMNGJ.mjs} +3 -3
- package/dist/{config-1twldYCW.mjs → config-E03l1C_h.mjs} +8 -2
- package/dist/{create-project-DD9n8Ho-.mjs → create-project-DsYvl3TB.mjs} +3 -3
- package/dist/{db-DjKE2-A-.mjs → db-PZBsLSGb.mjs} +27 -27
- package/dist/{delete-D2kr3Kmk.mjs → delete-mh6p-zkQ.mjs} +3 -3
- package/dist/deploy-DT8wsPZd.mjs +6990 -0
- package/dist/{discover-BuVVSAum.mjs → discover-CJHyvYfR.mjs} +2 -2
- package/dist/dist-DaKKDf8D.mjs +41 -0
- package/dist/{domain-_luIsM_B.mjs → domain-DiaNQbrl.mjs} +2 -2
- package/dist/entry-D7yy4xVH.mjs +100 -0
- package/dist/{env-CO5XAS9t.mjs → env-AAHU02L6.mjs} +5 -5
- package/dist/env-mask-Dd47NbR6.mjs +90 -0
- package/dist/env-public-BfiLcMBk.d.mts +140 -0
- package/dist/env-raw-Cx8ElDdj.mjs +58 -0
- package/dist/{env-types-D51bnR-c.mjs → env-types-QBj-ndax.mjs} +2 -2
- package/dist/env-validation-BdDlGhbN.mjs +1069 -0
- package/dist/{gen-Cf79J4aw.mjs → gen-oup1xBN0.mjs} +8 -8
- package/dist/{github-cmd-B6OX9c7d.mjs → github-cmd-BdNaOVNa.mjs} +102 -3
- package/dist/{handler-imD0UVDT.d.mts → handler-Cjh8uM3Y.d.mts} +1 -1
- package/dist/{headers-BwvFGhkx.mjs → headers-BQknpzkn.mjs} +2 -2
- package/dist/index.d.mts +14 -2
- package/dist/index.mjs +102 -55
- package/dist/{init-KirOzVDs.mjs → init-Dl2PKuQn.mjs} +13 -14
- package/dist/{link-CUmiosyb.mjs → link-CdGHSIy-.mjs} +4 -4
- package/dist/{list-3GEw7b6m.mjs → list-CPwFDZ_c.mjs} +3 -3
- package/dist/{login-DJReaT_Q.mjs → login-BT3H8PN3.mjs} +2 -2
- package/dist/{logs-D-rQ56Lq.mjs → logs-Bt313ax7.mjs} +3 -2
- package/dist/{mcp-D7yc0dXY.mjs → mcp-DoM3_nhd.mjs} +7 -2
- package/dist/{node-yFFk626c.mjs → node-BDx8pmhq.mjs} +5 -5
- package/dist/{package-json-B0NuUWGd.mjs → package-json-Cx1osYo6.mjs} +1 -1
- package/dist/pages/client.d.mts +1 -1
- package/dist/pages/index.d.mts +1 -23
- package/dist/pages/index.mjs +5 -5
- package/dist/pages/islands-plugin.mjs +2 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/{plugin-inference-CJxi_fWI.mjs → plugin-inference-DMeavIJ6.mjs} +4 -98
- package/dist/{prepare-C_cVurhP.mjs → prepare-DOBTY0o4.mjs} +10 -10
- package/dist/preset-BGrvB4Bl.mjs +539 -0
- package/dist/{project-cmd-DnU7u9QF.mjs → project-cmd-D_w-4w5B.mjs} +13 -9
- package/dist/{project-paths-tpdR1mJR.mjs → project-paths-BQd7OmIo.mjs} +1 -1
- package/dist/project-paths-GpziKeQQ.d.mts +25 -0
- package/dist/{project-tsconfig-D9uSVVpA.mjs → project-tsconfig-B-QtXjLQ.mjs} +2 -2
- package/dist/{protocol-6hTJ04T1.d.mts → protocol-Bnb0LFp3.d.mts} +1 -1
- package/dist/provision-BLrCEBbI.mjs +2557 -0
- package/dist/requests-B8sZxaFM.mjs +50 -0
- package/dist/{resolve-project-D2HI3TrG.mjs → resolve-project-BBMtLLV9.mjs} +1 -1
- package/dist/{rollback-Yh7bCKob.mjs → rollback-CkvTFXx5.mjs} +2 -2
- package/dist/{route-types-CfKfhbIg.mjs → route-types-COI2DsZv.mjs} +2 -2
- package/dist/{runner-h272wcPj.mjs → runner-kapo9aPs.mjs} +3 -3
- package/dist/{runner-pg-waxJOnBb.mjs → runner-pg-CHM76xuC.mjs} +1 -1
- package/dist/runtime/ai.mjs +113 -15
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/env-public.d.mts +1 -139
- package/dist/runtime/env-public.mjs +10 -93
- package/dist/runtime/env.d.mts +14 -1
- package/dist/runtime/env.mjs +24 -10
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/isr-cache.d.mts +207 -0
- package/dist/runtime/isr-cache.mjs +523 -0
- package/dist/runtime/isr.d.mts +4 -3
- package/dist/runtime/isr.mjs +44 -5
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/live.mjs +1 -1
- package/dist/runtime/sandbox.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +1 -1
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/{scan-Dp_Gyzs3.mjs → scan-DEwlM_Xy.mjs} +2 -2
- package/dist/{scan-i7Yz54fv.mjs → scan-DYXkrasO.mjs} +4 -4
- package/dist/{secret-u7FRvg8d.mjs → secret-Dt32J6RI.mjs} +3 -3
- package/dist/{skills-DsdNDtX3.mjs → skills-CLjN0uUO.mjs} +2 -2
- package/dist/{subcommand-prompt-DtES-oP6.mjs → subcommand-prompt-BzV8iQZo.mjs} +1 -1
- package/dist/sveltekit.mjs +1 -1
- package/dist/{validate-DT7nFMlf.mjs → validate-Cw_RLeTj.mjs} +1 -1
- package/dist/{yarn-pnp-CW8LB6g_.mjs → yarn-pnp-DJn3SAHF.mjs} +1 -1
- package/getting-started-prompt.txt +3 -1
- package/package.json +6 -3
- package/schema.json +11 -0
- package/skills/void/SKILL.md +34 -33
- package/skills/void/docs/guide/auth.md +8 -0
- package/skills/void/docs/guide/deployment.md +1 -1
- package/skills/void/docs/guide/env-vars.md +14 -6
- package/skills/void/docs/guide/queues.md +4 -0
- package/skills/void/docs/integrations/cloudflare.md +171 -5
- package/skills/void/docs/node_modules/void/AGENT_PROMPT.md +4 -0
- package/skills/void/docs/node_modules/void/{AGENTS.md → CLAUDE.md} +14 -0
- package/skills/void/docs/node_modules/void/README.md +1 -1
- package/skills/void/docs/node_modules/void/node_modules/@types/proper-lockfile/README.md +51 -0
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathslash/README.md +64 -0
- package/skills/void/docs/node_modules/void/node_modules/pathslash/README.md +64 -0
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/CHANGELOG.md +108 -0
- package/skills/void/docs/node_modules/void/node_modules/proper-lockfile/README.md +183 -0
- package/skills/void/docs/node_modules/void/skills/void/SKILL.md +34 -33
- package/skills/void/docs/node_modules/void/test/e2e/README.md +85 -0
- package/skills/void/docs/reference/cli.md +97 -14
- package/dist/deploy-C4PbkFyE.mjs +0 -3705
- package/dist/dotenv-D_UbC_vc.mjs +0 -173
- package/dist/env-raw-CoS20LHP.mjs +0 -32
- package/dist/env-validation-CeC2FL66.mjs +0 -163
- package/dist/pathe.M-eThtNZ-CQzLbt4c.mjs +0 -150
- package/dist/preset-CVvwCeIy.mjs +0 -208
- package/skills/void/docs/node_modules/void/node_modules/@void/md/node_modules/pathe/README.md +0 -73
- package/skills/void/docs/node_modules/void/node_modules/pathe/README.md +0 -73
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as outro, T as log, a as cliTitle, s as dim, u as import_picocolors, w as intro } from "./agents-
|
|
2
|
-
import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-
|
|
1
|
+
import { D as outro, T as log, a as cliTitle, s as dim, u as import_picocolors, w as intro } from "./agents-CtgBYqld.mjs";
|
|
2
|
+
import { b as readProjectConfig, f as getToken, n as PlatformClient } from "./client-Gb71-XkG.mjs";
|
|
3
3
|
//#region src/cli/logs.ts
|
|
4
4
|
async function runLogsCommand(root, filter, range, deployment, level) {
|
|
5
5
|
console.log();
|
|
@@ -73,6 +73,7 @@ function filterLogEntries(entries, level, filter) {
|
|
|
73
73
|
if (level === "error") {
|
|
74
74
|
if (entry.outcome !== "ok") return true;
|
|
75
75
|
if (entry.exceptions.length > 0) return true;
|
|
76
|
+
if (parseInt(entry.status, 10) >= 500) return true;
|
|
76
77
|
for (const l of entry.logs) if (l.level === "error") return true;
|
|
77
78
|
return false;
|
|
78
79
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as join, n as dirname } from "./
|
|
2
|
-
import { S as writeProjectConfig, f as getToken, n as PlatformClient } from "./client-
|
|
1
|
+
import { a as join, n as dirname } from "./dist-DaKKDf8D.mjs";
|
|
2
|
+
import { S as writeProjectConfig, f as getToken, n as PlatformClient } from "./client-Gb71-XkG.mjs";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { createInterface } from "node:readline";
|
|
@@ -179,6 +179,11 @@ Available methods on the "void_" object:
|
|
|
179
179
|
void_.getLogs(projectId, since, limit?, deploymentId?) → { timestamp, outcome, logs, exceptions, url, method, status }[]
|
|
180
180
|
since: duration string (e.g. "1h"), limit: number (default 200)
|
|
181
181
|
|
|
182
|
+
Requests:
|
|
183
|
+
void_.getRequests(projectId, since, limit?, status?) → { timestamp, type, method, status, bytes, durationMs }[]
|
|
184
|
+
since: duration string (e.g. "1h"), limit: number (default 200), status: class like "5xx" or exact code like "500"
|
|
185
|
+
Edge request metering — includes edge-generated 5xx and static/SPA requests that never invoke a worker.
|
|
186
|
+
|
|
182
187
|
Secrets:
|
|
183
188
|
void_.listSecrets(projectId) → { name }[]
|
|
184
189
|
void_.setSecret(projectId, name, value) → { ok, name }
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as join } from "./
|
|
2
|
-
import { c as loadVoidAuthConfig, s as findVoidAuthConfig } from "./scan-
|
|
3
|
-
import { f as readConfig } from "./config-
|
|
4
|
-
import { a as resolveVoidAuthMigrationSchema } from "./route-types-
|
|
1
|
+
import { a as join } from "./dist-DaKKDf8D.mjs";
|
|
2
|
+
import { c as loadVoidAuthConfig, s as findVoidAuthConfig } from "./scan-DYXkrasO.mjs";
|
|
3
|
+
import { f as readConfig } from "./config-E03l1C_h.mjs";
|
|
4
|
+
import { a as resolveVoidAuthMigrationSchema } from "./route-types-COI2DsZv.mjs";
|
|
5
5
|
import { n as applySqliteAuthMigrations, t as applyPgAuthMigrations } from "./auth-migrations-BTZ-ATvQ.mjs";
|
|
6
|
-
import { getMiniflareDatabasePath } from "./runner-
|
|
6
|
+
import { getMiniflareDatabasePath } from "./runner-kapo9aPs.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)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as join, n as dirname } from "./
|
|
1
|
+
import { a as join, n as dirname } from "./dist-DaKKDf8D.mjs";
|
|
2
2
|
import { existsSync, readFileSync } from "node:fs";
|
|
3
3
|
//#region src/shared/package-json.ts
|
|
4
4
|
const DEFAULT_DEPENDENCY_FIELDS = ["dependencies", "devDependencies"];
|
package/dist/pages/client.d.mts
CHANGED
package/dist/pages/index.d.mts
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-nmvOgFjd.mjs";
|
|
2
|
+
import { n as resolvePagesDir, t as ProjectPaths } from "../project-paths-GpziKeQQ.mjs";
|
|
2
3
|
import { i as PageDefinition, n as LayoutDefinition, o as PageScanResult, r as NamedLayoutDefinition } from "../types-lLjNE9Qp.mjs";
|
|
3
4
|
import { serializePageData } from "./serialize.mjs";
|
|
4
|
-
import { RewriteDestination } from "void/routes";
|
|
5
5
|
|
|
6
|
-
//#region src/project-paths.d.ts
|
|
7
|
-
type ProjectPaths = {
|
|
8
|
-
root: string;
|
|
9
|
-
sourceDir: string;
|
|
10
|
-
sourceRoot: string;
|
|
11
|
-
routesDir: string;
|
|
12
|
-
middlewareDir: string;
|
|
13
|
-
cronsDir: string;
|
|
14
|
-
queuesDir: string;
|
|
15
|
-
pagesDir: string;
|
|
16
|
-
dbDir: string;
|
|
17
|
-
migrationsDir: string;
|
|
18
|
-
schemaFile: string;
|
|
19
|
-
schemaDir: string;
|
|
20
|
-
srcDir: string;
|
|
21
|
-
ssrDir: string;
|
|
22
|
-
sourceRelative: (path: string) => string;
|
|
23
|
-
authConfigCandidates: ReadonlyArray<string>;
|
|
24
|
-
envFileCandidates: ReadonlyArray<string>;
|
|
25
|
-
};
|
|
26
|
-
declare function resolvePagesDir(root?: string): string;
|
|
27
|
-
//#endregion
|
|
28
6
|
//#region src/pages/layout-resolution.d.ts
|
|
29
7
|
/** Resolve the layout chain for a component (innermost last) */
|
|
30
8
|
declare function resolveLayoutChain(componentId: string, layouts: Array<LayoutDefinition>, componentPath?: string): Array<LayoutDefinition>;
|
package/dist/pages/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as join } from "../
|
|
2
|
-
import { r as resolvePagesDir } from "../project-paths-
|
|
3
|
-
import { f as readConfig } from "../config-
|
|
4
|
-
import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-
|
|
5
|
-
import { i as parseRedirectsFile } from "../headers-
|
|
1
|
+
import { a as join } from "../dist-DaKKDf8D.mjs";
|
|
2
|
+
import { r as resolvePagesDir } from "../project-paths-BQd7OmIo.mjs";
|
|
3
|
+
import { f as readConfig } from "../config-E03l1C_h.mjs";
|
|
4
|
+
import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-DEwlM_Xy.mjs";
|
|
5
|
+
import { i as parseRedirectsFile } from "../headers-BQknpzkn.mjs";
|
|
6
6
|
import { renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead } from "./head.mjs";
|
|
7
7
|
import { serializePageData } from "./serialize.mjs";
|
|
8
8
|
//#region src/pages/manifest.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as resolve, n as dirname } from "../
|
|
2
|
-
import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-
|
|
1
|
+
import { c as resolve, n as dirname } from "../dist-DaKKDf8D.mjs";
|
|
2
|
+
import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-DEwlM_Xy.mjs";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
4
|
import { normalizePath } from "vite";
|
|
5
5
|
//#region src/pages/islands-plugin.ts
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { w 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 { w as ValidationError } from "../handler-Cjh8uM3Y.mjs";
|
|
2
|
+
import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-Bnb0LFp3.mjs";
|
|
3
3
|
export { PageObject, PageRenderResult, ValidationError, flattenValidationErrors, handlePageGet, handlePageMutation, safeJsonStringify };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as join
|
|
2
|
-
import { n as readProjectPaths } from "./project-paths-
|
|
1
|
+
import { a as join } from "./dist-DaKKDf8D.mjs";
|
|
2
|
+
import { n as readProjectPaths } from "./project-paths-BQd7OmIo.mjs";
|
|
3
3
|
import { n as globSync } from "./dist-BuiRJkTd.mjs";
|
|
4
|
+
import { c as isIdentifier, r as getSsrServerEntryPath, u as isMemberExpression } from "./entry-D7yy4xVH.mjs";
|
|
4
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
6
|
import { parseSync } from "vite";
|
|
6
7
|
import { parse } from "es-module-lexer/js";
|
|
@@ -187,23 +188,6 @@ function walk(ast, { enter, leave }) {
|
|
|
187
188
|
return new SyncWalker(enter, leave).visit(ast, null);
|
|
188
189
|
}
|
|
189
190
|
//#endregion
|
|
190
|
-
//#region src/shared/ast.ts
|
|
191
|
-
function isIdentifier(node) {
|
|
192
|
-
return node?.type === "Identifier" && typeof node.name === "string";
|
|
193
|
-
}
|
|
194
|
-
function isLiteral(node) {
|
|
195
|
-
return node?.type === "Literal";
|
|
196
|
-
}
|
|
197
|
-
function isMemberExpression(node) {
|
|
198
|
-
return node?.type === "MemberExpression";
|
|
199
|
-
}
|
|
200
|
-
function isCallExpression(node) {
|
|
201
|
-
return node?.type === "CallExpression";
|
|
202
|
-
}
|
|
203
|
-
function isObjectExpression(node) {
|
|
204
|
-
return node?.type === "ObjectExpression";
|
|
205
|
-
}
|
|
206
|
-
//#endregion
|
|
207
191
|
//#region src/inference/walk.ts
|
|
208
192
|
const ENV_BINDING_RE = /\benv\s*\.\s*(DB|KV|STORAGE|QUEUE_\w+|AI|SANDBOX)\b/;
|
|
209
193
|
/**
|
|
@@ -354,84 +338,6 @@ function mergeBindings(bindings) {
|
|
|
354
338
|
};
|
|
355
339
|
}
|
|
356
340
|
//#endregion
|
|
357
|
-
//#region src/ssr/entry.ts
|
|
358
|
-
const SSR_SERVER_ENTRY_RELATIVE_PATHS = ["src/main.ssr.ts", "src/main.ssr.tsx"];
|
|
359
|
-
const SSR_CLIENT_ENTRY_RELATIVE_PATHS = ["src/main.client.ts", "src/main.client.tsx"];
|
|
360
|
-
function resolveSingleEntry(root, entries, label, paths = readProjectPaths(root)) {
|
|
361
|
-
const matches = entries.map((entryName) => ({
|
|
362
|
-
relativePath: relative(root, join(paths.ssrDir, entryName)),
|
|
363
|
-
absolutePath: join(paths.ssrDir, entryName)
|
|
364
|
-
})).filter((entry) => existsSync(entry.absolutePath));
|
|
365
|
-
if (matches.length === 0) return null;
|
|
366
|
-
if (matches.length > 1) {
|
|
367
|
-
const names = matches.map((entry) => entry.relativePath).join(", ");
|
|
368
|
-
throw new Error(`ssr: Multiple ${label} entry files found: ${names}. Keep only one.`);
|
|
369
|
-
}
|
|
370
|
-
return matches[0];
|
|
371
|
-
}
|
|
372
|
-
const SSR_SERVER_ENTRY_NAMES = ["main.ssr.ts", "main.ssr.tsx"];
|
|
373
|
-
const SSR_CLIENT_ENTRY_NAMES = ["main.client.ts", "main.client.tsx"];
|
|
374
|
-
function getSsrServerEntryPath(root, paths = readProjectPaths(root)) {
|
|
375
|
-
return resolveSingleEntry(root, SSR_SERVER_ENTRY_NAMES, "SSR", paths)?.absolutePath ?? null;
|
|
376
|
-
}
|
|
377
|
-
function hasSsrEntry(root, paths = readProjectPaths(root)) {
|
|
378
|
-
return getSsrServerEntryPath(root, paths) !== null;
|
|
379
|
-
}
|
|
380
|
-
function validateServerRenderExport(entry) {
|
|
381
|
-
const { absolutePath, relativePath } = entry;
|
|
382
|
-
const source = readFileSync(absolutePath, "utf-8");
|
|
383
|
-
if (/\bexport\s+(?:async\s+)?function\s+render\b/.test(source) || /\bexport\s+const\s+render\b/.test(source) || /\bexport\s+default\s+(?:defineRender\b|(?:async\s+)?function\b)/.test(source)) return;
|
|
384
|
-
let parsed;
|
|
385
|
-
try {
|
|
386
|
-
parsed = parseSync(relativePath, source);
|
|
387
|
-
} catch (err) {
|
|
388
|
-
throw new Error(`ssr: Invalid entry '${relativePath}'. Could not parse source: '${err instanceof Error ? err.message : String(err)}'.`);
|
|
389
|
-
}
|
|
390
|
-
if (!(parsed.program.body ?? []).some((node) => {
|
|
391
|
-
if (node.type === "ExportDefaultDeclaration") {
|
|
392
|
-
const declaration = node.declaration;
|
|
393
|
-
if (declaration?.type === "FunctionDeclaration" || declaration?.type === "FunctionExpression" || declaration?.type === "ArrowFunctionExpression") return true;
|
|
394
|
-
if (declaration?.type === "CallExpression") {
|
|
395
|
-
const call = declaration;
|
|
396
|
-
return isIdentifier(call.callee) && call.callee.name === "defineRender";
|
|
397
|
-
}
|
|
398
|
-
return false;
|
|
399
|
-
}
|
|
400
|
-
if (node.type !== "ExportNamedDeclaration") return false;
|
|
401
|
-
if (node.exportKind === "type") return false;
|
|
402
|
-
const declaration = node.declaration;
|
|
403
|
-
if (declaration?.type === "FunctionDeclaration") {
|
|
404
|
-
const fn = declaration;
|
|
405
|
-
return isIdentifier(fn.id) && fn.id.name === "render";
|
|
406
|
-
}
|
|
407
|
-
if (declaration?.type === "VariableDeclaration") return (declaration.declarations ?? []).some((decl) => isIdentifier(decl.id) && decl.id.name === "render");
|
|
408
|
-
return (node.specifiers ?? []).some((specifier) => {
|
|
409
|
-
if (specifier.exportKind === "type") return false;
|
|
410
|
-
const exported = specifier.exported;
|
|
411
|
-
return isIdentifier(exported) && exported.name === "render";
|
|
412
|
-
});
|
|
413
|
-
})) throw new Error(`ssr: Invalid entry '${relativePath}'. Export \`render(c, assetTags)\` or \`export default defineRender(...)\`.`);
|
|
414
|
-
}
|
|
415
|
-
/**
|
|
416
|
-
* Validate SSR mode entry conventions.
|
|
417
|
-
* Returns null when SSR mode is not used.
|
|
418
|
-
*/
|
|
419
|
-
function validateSsrEntries(root, paths = readProjectPaths(root)) {
|
|
420
|
-
const server = resolveSingleEntry(root, SSR_SERVER_ENTRY_NAMES, "SSR", paths);
|
|
421
|
-
const client = resolveSingleEntry(root, SSR_CLIENT_ENTRY_NAMES, "SSR client", paths);
|
|
422
|
-
if (!server && !client) return null;
|
|
423
|
-
if (server && !client) throw new Error(`ssr: Missing client entry. Add one of: ${SSR_CLIENT_ENTRY_RELATIVE_PATHS.join(", ")}.`);
|
|
424
|
-
if (!server && client) throw new Error(`ssr: Missing server entry. Add one of: ${SSR_SERVER_ENTRY_RELATIVE_PATHS.join(", ")}.`);
|
|
425
|
-
validateServerRenderExport(server);
|
|
426
|
-
return {
|
|
427
|
-
server,
|
|
428
|
-
client
|
|
429
|
-
};
|
|
430
|
-
}
|
|
431
|
-
function validateSsrEntry(root, paths = readProjectPaths(root)) {
|
|
432
|
-
return validateSsrEntries(root, paths)?.server.absolutePath ?? null;
|
|
433
|
-
}
|
|
434
|
-
//#endregion
|
|
435
341
|
//#region src/plugin-inference.ts
|
|
436
342
|
const SOURCE_GLOB = "**/*.{ts,tsx,mts,js,jsx,mjs,astro}";
|
|
437
343
|
/** Directories to scan for binding inference in framework mode. */
|
|
@@ -586,4 +492,4 @@ function inferProjectBindings(root, options, scanDirs) {
|
|
|
586
492
|
return mergeBindings(allBindings);
|
|
587
493
|
}
|
|
588
494
|
//#endregion
|
|
589
|
-
export {
|
|
495
|
+
export { inferBindingsFromSource as a, inferProjectBindings as i, FRAMEWORK_SCAN_DIRS as n, walk as o, detectFramework as r, DEFAULT_SCAN_DIRS as t };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as join } from "./
|
|
2
|
-
import { D as outro, E as note, T as log, a as cliTitle, w as intro } from "./agents-
|
|
3
|
-
import { i as resolveProjectPaths } from "./project-paths-
|
|
4
|
-
import { c as loadVoidAuthConfig, r as scanRoutes, s as findVoidAuthConfig } from "./scan-
|
|
5
|
-
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-
|
|
6
|
-
import { c as getDatabaseDialect, f as readConfig } from "./config-
|
|
7
|
-
import { i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-
|
|
8
|
-
import { i as generateVoidAuthDrizzleSchema, n as generateQueueTypes, r as generateVoidAuthDatabaseModule, s as generateDbDts, t as generateRouteTypes } from "./route-types-
|
|
9
|
-
import { t as discoverSchema } from "./discover-
|
|
10
|
-
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-
|
|
1
|
+
import { a as join } from "./dist-DaKKDf8D.mjs";
|
|
2
|
+
import { D as outro, E as note, T as log, a as cliTitle, w as intro } from "./agents-CtgBYqld.mjs";
|
|
3
|
+
import { i as resolveProjectPaths } from "./project-paths-BQd7OmIo.mjs";
|
|
4
|
+
import { c as loadVoidAuthConfig, r as scanRoutes, s as findVoidAuthConfig } from "./scan-DYXkrasO.mjs";
|
|
5
|
+
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-B-QtXjLQ.mjs";
|
|
6
|
+
import { c as getDatabaseDialect, f as readConfig } from "./config-E03l1C_h.mjs";
|
|
7
|
+
import { i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-DMeavIJ6.mjs";
|
|
8
|
+
import { i as generateVoidAuthDrizzleSchema, n as generateQueueTypes, r as generateVoidAuthDatabaseModule, s as generateDbDts, t as generateRouteTypes } from "./route-types-COI2DsZv.mjs";
|
|
9
|
+
import { t as discoverSchema } from "./discover-CJHyvYfR.mjs";
|
|
10
|
+
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-QBj-ndax.mjs";
|
|
11
11
|
import { existsSync, mkdirSync, rmSync } from "node:fs";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { loadEnv } from "vite";
|