@vertz/ui-server 0.2.19 → 0.2.20
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
CHANGED
|
@@ -25,6 +25,14 @@ interface SSRSessionInfo {
|
|
|
25
25
|
* Returns null when no valid session exists (expired, missing, or invalid cookie).
|
|
26
26
|
*/
|
|
27
27
|
type SessionResolver = (request: Request) => Promise<SSRSessionInfo | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Detect `public/favicon.svg` and return a `<link>` tag for it.
|
|
30
|
+
* Returns empty string when the file does not exist.
|
|
31
|
+
*
|
|
32
|
+
* Detection runs once at server startup — adding or removing the file
|
|
33
|
+
* requires a dev server restart (consistent with production build).
|
|
34
|
+
*/
|
|
35
|
+
declare function detectFaviconTag(projectRoot: string): string;
|
|
28
36
|
interface BunDevServerOptions {
|
|
29
37
|
/** SSR entry module (e.g., './src/app.tsx') */
|
|
30
38
|
entry: string;
|
|
@@ -177,4 +185,4 @@ declare function clearSSRRequireCache(): number;
|
|
|
177
185
|
* SSR is always on. HMR always works. No mode toggle needed.
|
|
178
186
|
*/
|
|
179
187
|
declare function createBunDevServer(options: BunDevServerOptions): BunDevServer;
|
|
180
|
-
export { parseHMRAssets, generateSSRPageHtml, formatTerminalRuntimeError, createRuntimeErrorDeduplicator, createFetchInterceptor, createBunDevServer, clearSSRRequireCache, buildScriptTag, SSRPageHtmlOptions, HMRAssets, FetchInterceptorOptions, ErrorDetail, ErrorCategory, BunDevServerOptions, BunDevServer };
|
|
188
|
+
export { parseHMRAssets, generateSSRPageHtml, formatTerminalRuntimeError, detectFaviconTag, createRuntimeErrorDeduplicator, createFetchInterceptor, createBunDevServer, clearSSRRequireCache, buildScriptTag, SSRPageHtmlOptions, HMRAssets, FetchInterceptorOptions, ErrorDetail, ErrorCategory, BunDevServerOptions, BunDevServer };
|
package/dist/bun-dev-server.js
CHANGED
|
@@ -1464,6 +1464,10 @@ function escapeAttr3(s) {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
|
|
1466
1466
|
// src/bun-dev-server.ts
|
|
1467
|
+
function detectFaviconTag(projectRoot) {
|
|
1468
|
+
const faviconPath = resolve(projectRoot, "public", "favicon.svg");
|
|
1469
|
+
return existsSync(faviconPath) ? '<link rel="icon" type="image/svg+xml" href="/favicon.svg">' : "";
|
|
1470
|
+
}
|
|
1467
1471
|
var MAX_TERMINAL_STACK_FRAMES = 5;
|
|
1468
1472
|
function formatTerminalRuntimeError(errors, parsedStack) {
|
|
1469
1473
|
const primary = errors[0];
|
|
@@ -1791,9 +1795,12 @@ function createBunDevServer(options) {
|
|
|
1791
1795
|
projectRoot = process.cwd(),
|
|
1792
1796
|
logRequests = true,
|
|
1793
1797
|
editor: editorOption,
|
|
1794
|
-
headTags = "",
|
|
1798
|
+
headTags: headTagsOption = "",
|
|
1795
1799
|
sessionResolver
|
|
1796
1800
|
} = options;
|
|
1801
|
+
const faviconTag = detectFaviconTag(projectRoot);
|
|
1802
|
+
const headTags = [faviconTag, headTagsOption].filter(Boolean).join(`
|
|
1803
|
+
`);
|
|
1797
1804
|
const editor = detectEditor(editorOption);
|
|
1798
1805
|
if (apiHandler) {
|
|
1799
1806
|
installFetchProxy();
|
|
@@ -2635,6 +2642,7 @@ export {
|
|
|
2635
2642
|
parseHMRAssets,
|
|
2636
2643
|
generateSSRPageHtml,
|
|
2637
2644
|
formatTerminalRuntimeError,
|
|
2645
|
+
detectFaviconTag,
|
|
2638
2646
|
createRuntimeErrorDeduplicator,
|
|
2639
2647
|
createFetchInterceptor,
|
|
2640
2648
|
createBunDevServer,
|