@vertz/ui-server 0.2.23 → 0.2.25
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/bun-dev-server.d.ts +19 -1
- package/dist/bun-dev-server.js +806 -25
- package/dist/bun-plugin/fast-refresh-dom-state.js +1 -1
- package/dist/bun-plugin/fast-refresh-runtime.js +6 -2
- package/dist/bun-plugin/index.d.ts +1 -1
- package/dist/bun-plugin/index.js +138 -47
- package/dist/dom-shim/index.d.ts +4 -0
- package/dist/dom-shim/index.js +1 -1
- package/dist/index.d.ts +186 -2
- package/dist/index.js +583 -3
- package/dist/shared/{chunk-2qsqp9xj.js → chunk-eenfpa59.js} +20 -10
- package/dist/shared/{chunk-bm16zy8d.js → chunk-gcwqkynf.js} +23 -3
- package/dist/shared/{chunk-5cny4vzm.js → chunk-yr65qdge.js} +7 -1
- package/dist/ssr/index.d.ts +2 -0
- package/dist/ssr/index.js +2 -2
- package/package.json +5 -5
package/dist/bun-dev-server.d.ts
CHANGED
|
@@ -82,6 +82,22 @@ interface BunDevServerOptions {
|
|
|
82
82
|
* @default false
|
|
83
83
|
*/
|
|
84
84
|
watchDeps?: boolean | string[];
|
|
85
|
+
/**
|
|
86
|
+
* Resolve theme from request for SSR. Returns the value for `data-theme`
|
|
87
|
+
* on the `<html>` tag and patches any `data-theme` attributes in the SSR body.
|
|
88
|
+
* Use this to read a theme cookie and eliminate dark→light flash on reload.
|
|
89
|
+
*/
|
|
90
|
+
themeFromRequest?: (request: Request) => string | null | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Called when the SSR module fails to recover from a broken state and a
|
|
93
|
+
* process restart is needed. Bun's ESM module cache retains failed imports
|
|
94
|
+
* process-wide — the only way to clear it is to restart the process.
|
|
95
|
+
*
|
|
96
|
+
* The dev server calls stop() before invoking this callback.
|
|
97
|
+
* Typically, the callback calls `process.exit(75)` and a supervisor
|
|
98
|
+
* script restarts the process.
|
|
99
|
+
*/
|
|
100
|
+
onRestartNeeded?: () => void;
|
|
85
101
|
}
|
|
86
102
|
interface ErrorDetail {
|
|
87
103
|
message: string;
|
|
@@ -157,11 +173,13 @@ interface SSRPageHtmlOptions {
|
|
|
157
173
|
headTags?: string;
|
|
158
174
|
/** Pre-built session + access set script tags for SSR injection. */
|
|
159
175
|
sessionScript?: string;
|
|
176
|
+
/** Theme value for `data-theme` attribute on `<html>`. */
|
|
177
|
+
htmlDataTheme?: string;
|
|
160
178
|
}
|
|
161
179
|
/**
|
|
162
180
|
* Generate a full SSR HTML page with the given content, CSS, SSR data, and script tag.
|
|
163
181
|
*/
|
|
164
|
-
declare function generateSSRPageHtml({ title, css, bodyHtml, ssrData, scriptTag, editor, headTags, sessionScript }: SSRPageHtmlOptions): string;
|
|
182
|
+
declare function generateSSRPageHtml({ title, css, bodyHtml, ssrData, scriptTag, editor, headTags, sessionScript, htmlDataTheme }: SSRPageHtmlOptions): string;
|
|
165
183
|
interface FetchInterceptorOptions {
|
|
166
184
|
apiHandler: (req: Request) => Promise<Response>;
|
|
167
185
|
origin: string;
|