void 0.7.5 → 0.7.7
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/{auth-DrfOTMmr.d.mts → auth-DmuALf16.d.mts} +4 -4
- package/dist/{better-auth-shared-CZsIpjey.d.mts → better-auth-shared-HXlHRw02.d.mts} +15 -15
- package/dist/cli/cli.mjs +14 -14
- package/dist/{config-BIa9HwVX.mjs → config-DqkeX_Fa.mjs} +5 -5
- package/dist/{db-RqxhOT2E.mjs → db-BnKZW1J7.mjs} +26 -22
- package/dist/{deploy-CRIz77mw.mjs → deploy-D3t53kng.mjs} +46 -16
- package/dist/{domain-CDQhvYNZ.mjs → domain-ClDdX9I1.mjs} +24 -1
- package/dist/{dotenv-DwO4ti0Z.mjs → dotenv-zdFCCgFU.mjs} +26 -26
- package/dist/{env-CnrQY2b6.mjs → env-CU97_4YK.mjs} +1 -1
- package/dist/{env-helpers-CbeM_7-k.d.mts → env-helpers-Dw95CU8e.d.mts} +4 -4
- package/dist/{env-validation-DJKjR_8q.mjs → env-validation-Bc_aiBUm.mjs} +1 -1
- package/dist/{fetch-error-DflegrF3.d.mts → fetch-error-DZ868Xq4.d.mts} +4 -4
- package/dist/{gen-C0EY2k27.mjs → gen-CpeKIqlM.mjs} +2 -2
- package/dist/{handler-dKQWyF-G.d.mts → handler-DJTuxB10.d.mts} +24 -27
- package/dist/{head-CZGAunBV.d.mts → head-C7QW7UY1.d.mts} +5 -6
- package/dist/{headers-YVkHjOyq.mjs → headers-C7Yf6_CN.mjs} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +501 -63
- package/dist/{init-FMZ29UZW.mjs → init-CTtDfVVo.mjs} +4 -4
- package/dist/{node-DFqMcZR1.mjs → node-DHVCtkgt.mjs} +1 -1
- package/dist/pages/client.d.mts +35 -41
- package/dist/pages/head-client.d.mts +1 -1
- package/dist/pages/head.d.mts +1 -1
- package/dist/pages/head.mjs +4 -4
- package/dist/pages/index.d.mts +6 -6
- package/dist/pages/index.mjs +6 -6
- package/dist/pages/islands-plugin.d.mts +4 -13
- package/dist/pages/islands-plugin.mjs +2 -64
- package/dist/pages/prefetch.d.mts +5 -5
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +98 -14
- package/dist/plugin-inference-CXUuq0aC.mjs +577 -0
- package/dist/{prepare-PqAbhLte.mjs → prepare-CKzO06-Z.mjs} +4 -4
- package/dist/{preset-jKn1hQwP.mjs → preset-BhnZpb7t.mjs} +1 -1
- package/dist/{protocol-DxGzKEz2.d.mts → protocol-D7r_deVZ.d.mts} +7 -4
- package/dist/{route-types-DReF1gUY.mjs → route-types-Cnqj_8a7.mjs} +2 -2
- package/dist/runtime/ai.d.mts +33 -40
- package/dist/runtime/auth.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.d.mts +2 -2
- package/dist/runtime/env-helpers.d.mts +1 -1
- package/dist/runtime/env-helpers.mjs +3 -3
- package/dist/runtime/env-public-client.d.mts +3 -3
- package/dist/runtime/env-public.d.mts +7 -7
- package/dist/runtime/fetch-stream.d.mts +1 -1
- package/dist/runtime/fetch.d.mts +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/handler.mjs +3 -3
- package/dist/runtime/isr.d.mts +2 -2
- package/dist/runtime/kv.d.mts +12 -12
- package/dist/runtime/live-server.d.mts +4 -4
- package/dist/runtime/live.d.mts +2 -2
- package/dist/runtime/migration-handler.d.mts +6 -6
- package/dist/runtime/seed.d.mts +4 -4
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +8 -8
- package/dist/runtime/ws.d.mts +21 -21
- package/dist/{scan-QtRTdh94.mjs → scan-B8iEm8xn.mjs} +6 -6
- package/dist/{scan-Ba4hFwlH.mjs → scan-CWfLxtOe.mjs} +8 -8
- package/dist/{standard-schema-BfGDWXff.d.mts → standard-schema-D2qvCEYV.d.mts} +14 -14
- package/dist/sveltekit.d.mts +3 -5
- package/dist/types-DG_Ynnyd.d.mts +42 -0
- package/package.json +3 -3
- package/dist/plugin-inference-CCtRkt9O.mjs +0 -2476
- package/dist/types-AdKzPp2C.d.mts +0 -57
|
@@ -3,16 +3,16 @@ import { n as cliTitle } from "./output-BwlcIYSR.mjs";
|
|
|
3
3
|
import { _ as me, c as R, g as ge, i as Ee, u as Se, v as ue, x as q, y as ye } from "./dist-Dayj3gCK.mjs";
|
|
4
4
|
import { a as writeProjectConfig, r as readProjectConfig } from "./project-TqORyHn8.mjs";
|
|
5
5
|
import { c as getToken, n as PlatformClient, u as isStagingMode } from "./client-DCqnMpDt.mjs";
|
|
6
|
-
import { c as getDatabaseDialect, f as readConfig } from "./config-
|
|
7
|
-
import { r as detectFramework } from "./plugin-inference-
|
|
8
|
-
import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-
|
|
6
|
+
import { c as getDatabaseDialect, f as readConfig } from "./config-DqkeX_Fa.mjs";
|
|
7
|
+
import { r as detectFramework } from "./plugin-inference-CXUuq0aC.mjs";
|
|
8
|
+
import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-zdFCCgFU.mjs";
|
|
9
9
|
import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-DfkESbDL.mjs";
|
|
10
10
|
import { t as MagicString } from "./magic-string.es-D6g9UnIy.mjs";
|
|
11
11
|
import { n as writeDrizzleConfig } from "./config-BzM9Dy7T.mjs";
|
|
12
12
|
import { n as getAgentById, r as getPackageDir, t as detectAgents } from "./agents-DqkFfc2c.mjs";
|
|
13
13
|
import { n as promptProjectSelection, t as promptAndCreateProject } from "./create-project-Bg88Kq_I.mjs";
|
|
14
14
|
import { t as promptForLoginToken } from "./login-B5HHT32i.mjs";
|
|
15
|
-
import { r as formatProjectCommand } from "./preset-
|
|
15
|
+
import { r as formatProjectCommand } from "./preset-BhnZpb7t.mjs";
|
|
16
16
|
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-6LD6_3Ej.mjs";
|
|
17
17
|
import { createRequire } from "node:module";
|
|
18
18
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
2
2
|
import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-CvHtTM0q.mjs";
|
|
3
|
-
import { f as readConfig } from "./config-
|
|
3
|
+
import { f as readConfig } from "./config-DqkeX_Fa.mjs";
|
|
4
4
|
import { r as resolveVoidAuthMigrationSchema } from "./drizzle-C-NRqGhx.mjs";
|
|
5
5
|
import { n as applySqliteAuthMigrations, t as applyPgAuthMigrations } from "./auth-migrations-BwLPwRgH.mjs";
|
|
6
6
|
import { getMiniflareDatabasePath } from "./runner-BUPRnMFN.mjs";
|
package/dist/pages/client.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as PageObject } from "../protocol-
|
|
1
|
+
import { t as PageObject } from "../protocol-D7r_deVZ.mjs";
|
|
2
2
|
import { CacheForInput, CacheForResult } from "./prefetch.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/pages/action-result.d.ts
|
|
@@ -32,39 +32,36 @@ declare function isCallSiteActionError(error: unknown): error is VoidActionError
|
|
|
32
32
|
declare function isAbortError(error: unknown): boolean;
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/pages/navigation-engine.d.ts
|
|
35
|
-
|
|
35
|
+
type PageComponentModule = {
|
|
36
36
|
default: unknown;
|
|
37
|
-
}
|
|
37
|
+
};
|
|
38
38
|
type PageData = PageObject;
|
|
39
|
-
|
|
39
|
+
type VisitOptions$1 = {
|
|
40
40
|
method?: string;
|
|
41
41
|
data?: unknown;
|
|
42
42
|
preserveScroll?: boolean;
|
|
43
43
|
preserveState?: boolean;
|
|
44
44
|
replace?: boolean;
|
|
45
|
-
viewTransition?: boolean;
|
|
46
|
-
/** @internal Used by
|
|
47
|
-
_resolveOnShell?: boolean;
|
|
48
|
-
/** @internal Used by popstate handler to pass saved scroll position */
|
|
45
|
+
viewTransition?: boolean; /** @internal Used by React Actions to avoid waiting for a commit blocked by the action itself. */
|
|
46
|
+
_resolveOnShell?: boolean; /** @internal Used by popstate handler to pass saved scroll position */
|
|
49
47
|
_scrollPosition?: {
|
|
50
48
|
x: number;
|
|
51
49
|
y: number;
|
|
52
|
-
} | null;
|
|
53
|
-
/** @internal Used by popstate handler to avoid writing history while traversing */
|
|
50
|
+
} | null; /** @internal Used by popstate handler to avoid writing history while traversing */
|
|
54
51
|
_popstate?: boolean;
|
|
55
|
-
}
|
|
56
|
-
|
|
52
|
+
};
|
|
53
|
+
type PrefetchOptions$1 = {
|
|
57
54
|
method?: string;
|
|
58
55
|
cacheFor?: CacheForInput;
|
|
59
|
-
}
|
|
60
|
-
|
|
56
|
+
};
|
|
57
|
+
type VoidRouterAdapter$1 = {
|
|
61
58
|
createDeferred(): unknown;
|
|
62
59
|
resolveDeferred(ref: unknown, value: unknown): unknown;
|
|
63
60
|
rejectDeferred(ref: unknown, error: string): unknown;
|
|
64
61
|
isLoading(ref: unknown): boolean;
|
|
65
62
|
onDeferredUpdate?(props: Record<string, unknown>): void;
|
|
66
|
-
}
|
|
67
|
-
|
|
63
|
+
};
|
|
64
|
+
type PageNavigationEngineConfig = {
|
|
68
65
|
adapter: VoidRouterAdapter$1;
|
|
69
66
|
components: Record<string, () => Promise<PageComponentModule>>;
|
|
70
67
|
layoutTree: Record<string, Array<string>>;
|
|
@@ -77,13 +74,13 @@ interface PageNavigationEngineConfig {
|
|
|
77
74
|
viewTransitions: boolean;
|
|
78
75
|
prefetchHoverDelay: number;
|
|
79
76
|
prefetchDefaultCacheFor: CacheForResult;
|
|
80
|
-
}
|
|
81
|
-
|
|
77
|
+
};
|
|
78
|
+
type PageNavigationResult = {
|
|
82
79
|
pageData: PageData;
|
|
83
80
|
component: unknown;
|
|
84
81
|
layouts: Array<unknown>;
|
|
85
|
-
}
|
|
86
|
-
|
|
82
|
+
};
|
|
83
|
+
type PageNavigationResource = {
|
|
87
84
|
id: number;
|
|
88
85
|
url: string;
|
|
89
86
|
fetchUrl: string;
|
|
@@ -95,8 +92,8 @@ interface PageNavigationResource {
|
|
|
95
92
|
abort(): void;
|
|
96
93
|
commit(): Promise<void>;
|
|
97
94
|
dispose(): void;
|
|
98
|
-
}
|
|
99
|
-
|
|
95
|
+
};
|
|
96
|
+
type PageNavigationEngine = {
|
|
100
97
|
_hoverDelay: number;
|
|
101
98
|
initialPageData: PageData;
|
|
102
99
|
initialComponent: unknown;
|
|
@@ -107,42 +104,39 @@ interface PageNavigationEngine {
|
|
|
107
104
|
flushAll(): void;
|
|
108
105
|
setPopStateHandler(handler: (url: string, options: VisitOptions$1) => void): void;
|
|
109
106
|
start(): void;
|
|
110
|
-
}
|
|
107
|
+
};
|
|
111
108
|
declare function createPageNavigationEngine(config: PageNavigationEngineConfig): Promise<PageNavigationEngine>;
|
|
112
109
|
//#endregion
|
|
113
110
|
//#region src/pages/form-value-equality.d.ts
|
|
114
111
|
declare function isEqualFormValue(a: unknown, b: unknown): boolean;
|
|
115
112
|
//#endregion
|
|
116
113
|
//#region src/pages/client.d.ts
|
|
117
|
-
|
|
114
|
+
type VisitOptions = {
|
|
118
115
|
method?: string;
|
|
119
116
|
data?: unknown;
|
|
120
117
|
preserveScroll?: boolean;
|
|
121
118
|
preserveState?: boolean;
|
|
122
119
|
replace?: boolean;
|
|
123
|
-
viewTransition?: boolean;
|
|
124
|
-
/** @internal Used by
|
|
125
|
-
_resolveOnShell?: boolean;
|
|
126
|
-
/** @internal Used by popstate handler to pass saved scroll position */
|
|
120
|
+
viewTransition?: boolean; /** @internal Used by React Actions to avoid waiting for a commit blocked by the action itself. */
|
|
121
|
+
_resolveOnShell?: boolean; /** @internal Used by popstate handler to pass saved scroll position */
|
|
127
122
|
_scrollPosition?: {
|
|
128
123
|
x: number;
|
|
129
124
|
y: number;
|
|
130
|
-
} | null;
|
|
131
|
-
/** @internal Used by popstate handler to avoid writing history while traversing */
|
|
125
|
+
} | null; /** @internal Used by popstate handler to avoid writing history while traversing */
|
|
132
126
|
_popstate?: boolean;
|
|
133
|
-
}
|
|
134
|
-
|
|
127
|
+
};
|
|
128
|
+
type PrefetchOptions = {
|
|
135
129
|
method?: string;
|
|
136
130
|
cacheFor?: CacheForInput;
|
|
137
|
-
}
|
|
131
|
+
};
|
|
138
132
|
type NavigationStateType = "idle" | "loading" | "submitting";
|
|
139
133
|
type NavigationMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
140
|
-
|
|
134
|
+
type NavigationState = {
|
|
141
135
|
state: NavigationStateType;
|
|
142
136
|
location: URL | null;
|
|
143
137
|
method: NavigationMethod | null;
|
|
144
|
-
}
|
|
145
|
-
|
|
138
|
+
};
|
|
139
|
+
type VoidRouter = {
|
|
146
140
|
_hoverDelay: number;
|
|
147
141
|
readonly url: URL;
|
|
148
142
|
readonly path: string;
|
|
@@ -153,16 +147,16 @@ interface VoidRouter {
|
|
|
153
147
|
prefetch(url: string | URL, options?: PrefetchOptions): Promise<unknown>;
|
|
154
148
|
flush(url: string | URL, method?: string): void;
|
|
155
149
|
flushAll(): void;
|
|
156
|
-
}
|
|
157
|
-
|
|
150
|
+
};
|
|
151
|
+
type VoidRouterAdapter = {
|
|
158
152
|
createDeferred(): unknown;
|
|
159
153
|
resolveDeferred(ref: unknown, value: unknown): unknown;
|
|
160
154
|
rejectDeferred(ref: unknown, error: string): unknown;
|
|
161
155
|
isLoading(ref: unknown): boolean;
|
|
162
156
|
applyUpdate(pageData: PageData, component: unknown, layouts: Array<unknown>): void | Promise<void>;
|
|
163
157
|
onDeferredUpdate?(props: Record<string, unknown>): void;
|
|
164
|
-
}
|
|
165
|
-
|
|
158
|
+
};
|
|
159
|
+
type VoidRouterConfig = {
|
|
166
160
|
adapter: VoidRouterAdapter;
|
|
167
161
|
components: Record<string, () => Promise<PageComponentModule>>;
|
|
168
162
|
layoutTree: Record<string, Array<string>>;
|
|
@@ -177,7 +171,7 @@ interface VoidRouterConfig {
|
|
|
177
171
|
prefetchDefaultCacheFor: CacheForResult;
|
|
178
172
|
onRouteChange?(url: string): void;
|
|
179
173
|
onNavigationChange?(navigation: NavigationState): void;
|
|
180
|
-
}
|
|
174
|
+
};
|
|
181
175
|
declare function idleNavigationState(): NavigationState;
|
|
182
176
|
declare function createRouterFacade(router: VoidRouter, getCurrentUrl: () => string, getCurrentParams?: () => Record<string, string>): VoidRouter;
|
|
183
177
|
declare function createSsrRouter(url?: string, params?: Record<string, string>): VoidRouter;
|
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-C7QW7UY1.mjs";
|
|
2
2
|
export { HeadConfig, HeadDescriptor, renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead };
|
package/dist/pages/head.mjs
CHANGED
|
@@ -85,12 +85,12 @@ function renderHeadToString(head) {
|
|
|
85
85
|
parts.push(`<meta ${attrs.join(" ")}>`);
|
|
86
86
|
}
|
|
87
87
|
if (head.link) for (const entry of head.link) {
|
|
88
|
-
const attrs = Object.entries(entry).filter(([,
|
|
88
|
+
const attrs = Object.entries(entry).filter(([, value]) => value != null).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
|
|
89
89
|
parts.push(`<link ${attrs}>`);
|
|
90
90
|
}
|
|
91
91
|
if (head.script) for (const entry of head.script) {
|
|
92
92
|
const { innerHTML, ...rest } = entry;
|
|
93
|
-
const attrs = Object.entries(rest).filter(([,
|
|
93
|
+
const attrs = Object.entries(rest).filter(([, value]) => value != null).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
|
|
94
94
|
if (innerHTML) parts.push(`<script${attrs ? " " + attrs : ""}>${innerHTML}<\/script>`);
|
|
95
95
|
else if (attrs) parts.push(`<script ${attrs}><\/script>`);
|
|
96
96
|
}
|
|
@@ -99,13 +99,13 @@ function renderHeadToString(head) {
|
|
|
99
99
|
/** Serialize htmlAttrs to an attribute string (includes leading space). */
|
|
100
100
|
function renderHtmlAttrs(head) {
|
|
101
101
|
if (!head.htmlAttrs) return "";
|
|
102
|
-
const attrs = Object.entries(head.htmlAttrs).map(([
|
|
102
|
+
const attrs = Object.entries(head.htmlAttrs).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
|
|
103
103
|
return attrs ? " " + attrs : "";
|
|
104
104
|
}
|
|
105
105
|
/** Serialize bodyAttrs to an attribute string (includes leading space). */
|
|
106
106
|
function renderBodyAttrs(head) {
|
|
107
107
|
if (!head.bodyAttrs) return "";
|
|
108
|
-
const attrs = Object.entries(head.bodyAttrs).map(([
|
|
108
|
+
const attrs = Object.entries(head.bodyAttrs).map(([key, value]) => `${key}="${escapeHtml(value)}"`).join(" ");
|
|
109
109
|
return attrs ? " " + attrs : "";
|
|
110
110
|
}
|
|
111
111
|
//#endregion
|
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 {
|
|
1
|
+
import { a as renderHtmlAttrs, i as renderHeadToString, n as HeadDescriptor, o as resolveHead, r as renderBodyAttrs, t as HeadConfig } from "../head-C7QW7UY1.mjs";
|
|
2
|
+
import { a as PageScanResult, i as PageDefinition, n as LayoutDefinition, r as NamedLayoutDefinition } from "../types-DG_Ynnyd.mjs";
|
|
3
3
|
import { serializePageData } from "./serialize.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/pages/layout-resolution.d.ts
|
|
@@ -26,13 +26,13 @@ declare function scanPages(root: string, options?: {
|
|
|
26
26
|
declare function generateComponentManifest(scan: PageScanResult, pagesDir: string): string;
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region src/pages/static-data.d.ts
|
|
29
|
-
|
|
29
|
+
type StaticPageDataBuildOptions = {
|
|
30
30
|
enabled: boolean;
|
|
31
31
|
fastPath: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
32
|
+
};
|
|
33
|
+
type ResolveStaticPageDataBuildOptionsInput = {
|
|
34
34
|
publicDir?: string | false;
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
declare function resolveStaticPageDataBuildOptions(root: string, options?: ResolveStaticPageDataBuildOptionsInput): StaticPageDataBuildOptions;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { type HeadConfig, type HeadDescriptor, type LayoutDefinition, type NamedLayoutDefinition, type PageDefinition, type PageScanResult, type StaticPageDataBuildOptions, generateComponentManifest, renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveEffectiveLayoutChain, resolveHead, resolveLayoutChain, resolveNamedLayout, resolveStaticPageDataBuildOptions, scanPages, serializePageData };
|
package/dist/pages/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as join } from "../pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
2
|
-
import { f as readConfig } from "../config-
|
|
3
|
-
import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-
|
|
4
|
-
import { i as parseRedirectsFile } from "../headers-
|
|
2
|
+
import { f as readConfig } from "../config-DqkeX_Fa.mjs";
|
|
3
|
+
import { a as resolveNamedLayout, i as resolveLayoutIds, n as resolveEffectiveLayoutChain, r as resolveLayoutChain, t as scanPages } from "../scan-CWfLxtOe.mjs";
|
|
4
|
+
import { i as parseRedirectsFile } from "../headers-C7Yf6_CN.mjs";
|
|
5
5
|
import { renderBodyAttrs, renderHeadToString, renderHtmlAttrs, resolveHead } from "./head.mjs";
|
|
6
6
|
import { serializePageData } from "./serialize.mjs";
|
|
7
7
|
//#region src/pages/manifest.ts
|
|
@@ -21,9 +21,9 @@ function generateComponentManifest(scan, pagesDir) {
|
|
|
21
21
|
const layoutId = layout.directory ? `${layout.directory}/layout` : "layout";
|
|
22
22
|
lines.push(` ${JSON.stringify(layoutId)}: () => import(${JSON.stringify(importPath)}),`);
|
|
23
23
|
}
|
|
24
|
-
for (const
|
|
25
|
-
const importPath = `${pagesDir}/${
|
|
26
|
-
const layoutId =
|
|
24
|
+
for (const namedLayout of scan.namedLayouts) {
|
|
25
|
+
const importPath = `${pagesDir}/${namedLayout.filePath}`;
|
|
26
|
+
const layoutId = namedLayout.directory ? `${namedLayout.directory}/_layouts/${namedLayout.name}` : `_layouts/${namedLayout.name}`;
|
|
27
27
|
lines.push(` ${JSON.stringify(layoutId)}: () => import(${JSON.stringify(importPath)}),`);
|
|
28
28
|
}
|
|
29
29
|
lines.push("};");
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as PageScanResult } from "../types-DG_Ynnyd.mjs";
|
|
2
2
|
import { ResolvedConfig, ViteDevServer } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/pages/islands-plugin.d.ts
|
|
5
5
|
declare const ISLANDS_RENDERER_ID = "virtual:void-islands-renderer";
|
|
6
6
|
declare const ISLANDS_CLIENT_ENTRY_ID = "virtual:void-islands-client";
|
|
7
|
-
|
|
7
|
+
type IslandEntry = {
|
|
8
8
|
componentPath: string;
|
|
9
9
|
islandId: string;
|
|
10
10
|
hydrate: string;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
/** Resolve a relative import specifier to an absolute path by checking extensions. */
|
|
13
13
|
declare function resolveSpecifier(specifier: string, importerDir: string, extensions: Array<string>): string | null;
|
|
14
14
|
/**
|
|
@@ -17,8 +17,6 @@ declare function resolveSpecifier(specifier: string, importerDir: string, extens
|
|
|
17
17
|
* or any .md file has a `<script>` block.
|
|
18
18
|
*/
|
|
19
19
|
declare function needsIslandClientBundle(dir: string, islandFilePattern: RegExp, checkStyleBlocks: boolean): boolean;
|
|
20
|
-
/** Check if a file has CSS import statements (JS-style imports). */
|
|
21
|
-
declare function fileHasCssImports(filePath: string): boolean;
|
|
22
20
|
/**
|
|
23
21
|
* Rewrite a matched CSS import line so relative specifiers resolve from the
|
|
24
22
|
* virtual module. Absolute and bare specifiers are kept as-is.
|
|
@@ -26,16 +24,9 @@ declare function fileHasCssImports(filePath: string): boolean;
|
|
|
26
24
|
declare function rewriteCssImportForVirtualModule(matchedLine: string, specifier: string, sourceFilePath: string): string;
|
|
27
25
|
/** Extract CSS import statements from a file and return them as @import rules. */
|
|
28
26
|
declare function extractCssImports(filePath: string): string;
|
|
29
|
-
/** Rebuild islandCssMap from current file contents. */
|
|
30
|
-
declare function rebuildIslandCssMap(pageScan: PageScanResult, pagesDir: string, islandCssMap: Map<string, Array<string>>, fileHasCssFn: (filePath: string) => boolean): void;
|
|
31
27
|
/** Compute which island pages need client-side JavaScript. */
|
|
32
28
|
declare function computePagesNeedingClientJS(pageScan: PageScanResult, pagesDir: string, resolvedConfig: ResolvedConfig | null): Set<string>;
|
|
33
29
|
/**
|
|
34
|
-
* Configure the Vite dev server for island CSS serving.
|
|
35
|
-
* Sets up file watching and a middleware for serving virtual CSS modules.
|
|
36
|
-
*/
|
|
37
|
-
declare function configureIslandCssServer(server: ViteDevServer, islandCssFiles: Set<string>, viteRoot: string, rebuildCssMap: () => void): void;
|
|
38
|
-
/**
|
|
39
30
|
* Watch the pages directory for structural changes (add/remove) and .md content
|
|
40
31
|
* changes (frontmatter layout field) so that new layouts and named layouts are
|
|
41
32
|
* picked up without a dev server restart.
|
|
@@ -47,4 +38,4 @@ declare function watchPagesForRescan(server: ViteDevServer, pagesDir: string, ro
|
|
|
47
38
|
flush: () => Promise<void>;
|
|
48
39
|
};
|
|
49
40
|
//#endregion
|
|
50
|
-
export { ISLANDS_CLIENT_ENTRY_ID, ISLANDS_RENDERER_ID, IslandEntry, computePagesNeedingClientJS,
|
|
41
|
+
export { ISLANDS_CLIENT_ENTRY_ID, ISLANDS_RENDERER_ID, IslandEntry, computePagesNeedingClientJS, extractCssImports, needsIslandClientBundle, resolveSpecifier, rewriteCssImportForVirtualModule, watchPagesForRescan };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as dirname, s as resolve } from "../pathe.M-eThtNZ-D-kmWkCS.mjs";
|
|
2
|
-
import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-
|
|
2
|
+
import { n as resolveEffectiveLayoutChain, t as scanPages } from "../scan-CWfLxtOe.mjs";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
4
4
|
import { normalizePath } from "vite";
|
|
5
5
|
//#region src/pages/islands-plugin.ts
|
|
@@ -43,15 +43,6 @@ function needsIslandClientBundle(dir, islandFilePattern, checkStyleBlocks) {
|
|
|
43
43
|
} catch {}
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
|
-
/** Check if a file has CSS import statements (JS-style imports). */
|
|
47
|
-
function fileHasCssImports(filePath) {
|
|
48
|
-
try {
|
|
49
|
-
const code = readFileSync(filePath, "utf-8");
|
|
50
|
-
return /import\b[^"']*["'][^"']+\.(?:css|scss|sass|less|styl|stylus|pcss|postcss)["']/.test(code);
|
|
51
|
-
} catch {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
46
|
/**
|
|
56
47
|
* Rewrite a matched CSS import line so relative specifiers resolve from the
|
|
57
48
|
* virtual module. Absolute and bare specifiers are kept as-is.
|
|
@@ -72,22 +63,6 @@ function extractCssImports(filePath) {
|
|
|
72
63
|
while ((match = re.exec(code)) !== null) imports.push(`@import ${JSON.stringify(match[1])};`);
|
|
73
64
|
return imports.join("\n");
|
|
74
65
|
}
|
|
75
|
-
/** Rebuild islandCssMap from current file contents. */
|
|
76
|
-
function rebuildIslandCssMap(pageScan, pagesDir, islandCssMap, fileHasCssFn) {
|
|
77
|
-
islandCssMap.clear();
|
|
78
|
-
for (const page of pageScan.pages) {
|
|
79
|
-
if (!page.island) continue;
|
|
80
|
-
const cssPaths = [];
|
|
81
|
-
const layoutChain = resolveEffectiveLayoutChain(page, pageScan.layouts, pageScan.namedLayouts);
|
|
82
|
-
for (const layout of layoutChain) {
|
|
83
|
-
const layoutPath = resolve(pagesDir, layout.filePath);
|
|
84
|
-
if (fileHasCssFn(layoutPath)) cssPaths.push(layoutPath);
|
|
85
|
-
}
|
|
86
|
-
const pagePath = resolve(pagesDir, page.componentPath);
|
|
87
|
-
if (fileHasCssFn(pagePath)) cssPaths.push(pagePath);
|
|
88
|
-
if (cssPaths.length > 0) islandCssMap.set(page.componentId, cssPaths);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
66
|
/** Compute which island pages need client-side JavaScript. */
|
|
92
67
|
function computePagesNeedingClientJS(pageScan, pagesDir, resolvedConfig) {
|
|
93
68
|
const mdPlugin = resolvedConfig?.plugins?.find((plugin) => plugin.name === "void-md");
|
|
@@ -122,43 +97,6 @@ function computePagesNeedingClientJS(pageScan, pagesDir, resolvedConfig) {
|
|
|
122
97
|
return result;
|
|
123
98
|
}
|
|
124
99
|
/**
|
|
125
|
-
* Configure the Vite dev server for island CSS serving.
|
|
126
|
-
* Sets up file watching and a middleware for serving virtual CSS modules.
|
|
127
|
-
*/
|
|
128
|
-
function configureIslandCssServer(server, islandCssFiles, viteRoot, rebuildCssMap) {
|
|
129
|
-
server.watcher.on("change", (path) => {
|
|
130
|
-
const normalizedPath = normalizePath(path);
|
|
131
|
-
if (!islandCssFiles.has(normalizedPath)) return;
|
|
132
|
-
rebuildCssMap();
|
|
133
|
-
for (const env of Object.values(server.environments)) {
|
|
134
|
-
const mod = env.moduleGraph.getModuleById("\0" + ISLANDS_RENDERER_ID);
|
|
135
|
-
if (mod) env.moduleGraph.invalidateModule(mod);
|
|
136
|
-
}
|
|
137
|
-
const cssMod = server.environments.client?.moduleGraph.getModuleById(normalizedPath + ".css");
|
|
138
|
-
if (cssMod) server.environments.client.moduleGraph.invalidateModule(cssMod);
|
|
139
|
-
});
|
|
140
|
-
server.middlewares.use(async (req, res, next) => {
|
|
141
|
-
if (!req.url) return next();
|
|
142
|
-
const url = req.url.split("?")[0];
|
|
143
|
-
if (!url.endsWith(".css")) return next();
|
|
144
|
-
const srcPath = normalizePath(resolve(viteRoot, url.slice(1, -4)));
|
|
145
|
-
if (!islandCssFiles.has(srcPath)) return next();
|
|
146
|
-
try {
|
|
147
|
-
const result = await server.environments.client.transformRequest(url);
|
|
148
|
-
if (result) {
|
|
149
|
-
const m = result.code.match(/\b__vite__css\s*=\s*("(?:[^"\\]|\\.)*")/) || result.code.match(/export\s+default\s+("(?:[^"\\]|\\.)*")/);
|
|
150
|
-
if (m) {
|
|
151
|
-
res.setHeader("Content-Type", "text/css");
|
|
152
|
-
res.statusCode = 200;
|
|
153
|
-
res.end(JSON.parse(m[1]));
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
} catch {}
|
|
158
|
-
next();
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
100
|
* Watch the pages directory for structural changes (add/remove) and .md content
|
|
163
101
|
* changes (frontmatter layout field) so that new layouts and named layouts are
|
|
164
102
|
* picked up without a dev server restart.
|
|
@@ -192,4 +130,4 @@ function watchPagesForRescan(server, pagesDir, root, onRescan) {
|
|
|
192
130
|
return { flush: () => pending ?? Promise.resolve() };
|
|
193
131
|
}
|
|
194
132
|
//#endregion
|
|
195
|
-
export { ISLANDS_CLIENT_ENTRY_ID, ISLANDS_RENDERER_ID, computePagesNeedingClientJS,
|
|
133
|
+
export { ISLANDS_CLIENT_ENTRY_ID, ISLANDS_RENDERER_ID, computePagesNeedingClientJS, extractCssImports, needsIslandClientBundle, resolveSpecifier, rewriteCssImportForVirtualModule, watchPagesForRescan };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//#region src/pages/prefetch.d.ts
|
|
2
|
-
|
|
2
|
+
type CacheForResult = {
|
|
3
3
|
stale: number;
|
|
4
4
|
expires: number;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
type CacheForInput = number | string | [string, string];
|
|
7
7
|
declare function parseCacheFor(value: CacheForInput): CacheForResult;
|
|
8
|
-
|
|
8
|
+
type CacheEntry = {
|
|
9
9
|
url: string;
|
|
10
10
|
method: string;
|
|
11
11
|
response: Promise<unknown>;
|
|
@@ -13,9 +13,9 @@ interface CacheEntry {
|
|
|
13
13
|
expiresAt: number;
|
|
14
14
|
singleUse: boolean;
|
|
15
15
|
timer: ReturnType<typeof setTimeout> | null;
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
17
|
declare class PrefetchCache {
|
|
18
|
-
private entries;
|
|
18
|
+
private readonly entries;
|
|
19
19
|
private key;
|
|
20
20
|
has(url: string, method?: string): boolean;
|
|
21
21
|
get(url: string, method?: string): CacheEntry | null;
|
|
@@ -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-DJTuxB10.mjs";
|
|
2
|
+
import { a as handlePageMutation, i as handlePageGet, n as PageRenderResult, o as safeJsonStringify, r as flattenValidationErrors, t as PageObject } from "../protocol-D7r_deVZ.mjs";
|
|
3
3
|
export { PageObject, PageRenderResult, ValidationError, flattenValidationErrors, handlePageGet, handlePageMutation, safeJsonStringify };
|