@absolutejs/absolute 0.19.0-beta.225 → 0.19.0-beta.226
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/.absolutejs/vue-tsc.tsbuildinfo +1 -1
- package/.claude/settings.local.json +2 -1
- package/dist/angular/index.js +13 -3
- package/dist/angular/index.js.map +3 -3
- package/dist/build.js +17 -3
- package/dist/build.js.map +4 -4
- package/dist/index.js +17 -3
- package/dist/index.js.map +4 -4
- package/dist/react/index.js +13 -3
- package/dist/react/index.js.map +3 -3
- package/dist/svelte/index.js +13 -3
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/index.js +13 -3
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -206,7 +206,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
} catch (renderError) {
|
|
209
|
-
|
|
209
|
+
const message = renderError instanceof Error ? renderError.message : "";
|
|
210
|
+
if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
|
|
211
|
+
console.error(`[SSR] Convention error page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
|
|
212
|
+
} else {
|
|
213
|
+
console.error(`[SSR] Failed to render ${framework} convention error page:`, renderError);
|
|
214
|
+
}
|
|
210
215
|
}
|
|
211
216
|
return null;
|
|
212
217
|
}, renderConventionNotFound = async (framework) => {
|
|
@@ -270,7 +275,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
|
|
|
270
275
|
}
|
|
271
276
|
}
|
|
272
277
|
} catch (renderError) {
|
|
273
|
-
|
|
278
|
+
const message = renderError instanceof Error ? renderError.message : "";
|
|
279
|
+
if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
|
|
280
|
+
console.error(`[SSR] Convention not-found page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
|
|
281
|
+
} else {
|
|
282
|
+
console.error(`[SSR] Failed to render ${framework} convention not-found page:`, renderError);
|
|
283
|
+
}
|
|
274
284
|
}
|
|
275
285
|
return null;
|
|
276
286
|
}, NOT_FOUND_PRIORITY, renderFirstNotFound = async () => {
|
|
@@ -347,5 +357,5 @@ export {
|
|
|
347
357
|
handleReactPageRequest
|
|
348
358
|
};
|
|
349
359
|
|
|
350
|
-
//# debugId=
|
|
360
|
+
//# debugId=B03C8A21E51D1E2064756E2164756E21
|
|
351
361
|
//# sourceMappingURL=index.js.map
|
package/dist/react/index.js.map
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"export const ssrErrorPage = (framework: string, error: unknown) => {\n\tconst frameworkColors: Record<string, string> = {\n\t\tangular: '#dd0031',\n\t\thtml: '#e34c26',\n\t\thtmx: '#1a365d',\n\t\treact: '#61dafb',\n\t\tsvelte: '#ff3e00',\n\t\tvue: '#42b883'\n\t};\n\n\tconst accent = frameworkColors[framework] ?? '#94a3b8';\n\tconst label = framework.charAt(0).toUpperCase() + framework.slice(1);\n\tconst message = error instanceof Error ? error.message : String(error);\n\n\treturn `<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>SSR Error - AbsoluteJS</title>\n<style>\n*{margin:0;padding:0;box-sizing:border-box}\nbody{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:\"JetBrains Mono\",\"Fira Code\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}\n.card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}\n.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}\n.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}\n.badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}\n.kind{color:#94a3b8;font-size:13px;font-weight:500}\n.content{padding:24px}\n.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}\n.message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}\n.hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}\n</style>\n</head>\n<body>\n<div class=\"card\">\n<div class=\"header\">\n<div style=\"display:flex;align-items:center;gap:12px\">\n<span class=\"brand\">AbsoluteJS</span>\n<span class=\"badge\">${label}</span>\n</div>\n<span class=\"kind\">Server Render Error</span>\n</div>\n<div class=\"content\">\n<div class=\"label\">What went wrong</div>\n<pre class=\"message\">${message.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</pre>\n<div class=\"hint\">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>\n</div>\n</div>\n</body>\n</html>`;\n};\n",
|
|
6
6
|
"const normalizeSlug = (str: string) =>\n\tstr\n\t\t.trim()\n\t\t.replace(/\\s+/g, '-')\n\t\t.replace(/[^A-Za-z0-9\\-_]+/g, '')\n\t\t.replace(/[-_]{2,}/g, '-');\n\nexport const toKebab = (str: string) =>\n\tnormalizeSlug(str)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t.toLowerCase();\nexport const toPascal = (str: string) => {\n\tif (!str.includes('-') && !str.includes('_')) {\n\t\treturn str.charAt(0).toUpperCase() + str.slice(1);\n\t}\n\n\treturn normalizeSlug(str)\n\t\t.split(/[-_]/)\n\t\t.filter(Boolean)\n\t\t.map(\n\t\t\t(segment) =>\n\t\t\t\tsegment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()\n\t\t)\n\t\t.join('');\n};\nexport const toScreamingSnake = (str: string) =>\n\tstr.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toUpperCase();\n",
|
|
7
|
-
"import { basename } from 'node:path';\nimport type { ConventionsMap } from '../../types/conventions';\nimport { toPascal } from './stringModifiers';\n\n// Use globalThis so the conventions map is shared across all bundles.\n// The main bundle (dist/index.js) calls setConventions, but framework\n// bundles (dist/svelte/index.js, etc.) need to read the same map.\nconst CONVENTIONS_KEY = '__absoluteConventions';\n\nconst getMap = (): ConventionsMap =>\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] as ConventionsMap ?? {};\n\nexport const setConventions = (map: ConventionsMap) => {\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] = map;\n};\n\nexport const getConventions = () => getMap();\n\nexport const resolveErrorConventionPath = (\n\tframework: keyof ConventionsMap,\n\tpageName: string\n) => {\n\tconst fw = getMap()[framework];\n\tif (!fw) return undefined;\n\n\treturn fw.pages?.[pageName]?.error ?? fw.defaults?.error;\n};\n\nexport const resolveNotFoundConventionPath = (\n\tframework: keyof ConventionsMap\n) => getMap()[framework]?.defaults?.notFound;\n\n/**\n * Derive a PascalCase page name from a compiled server path.\n * Example: \"/build/svelte/pages/SvelteExample.abc123.js\" → \"SvelteExample\"\n */\nexport const derivePageName = (pagePath: string) => {\n\tconst base = basename(pagePath);\n\t// Strip hash and extension: \"SvelteExample.abc123.js\" → \"SvelteExample\"\n\tconst dotIndex = base.indexOf('.');\n\tconst name = dotIndex > 0 ? base.slice(0, dotIndex) : base;\n\n\treturn toPascal(name);\n};\n\nconst isDev = () => process.env.NODE_ENV === 'development';\n\nconst buildErrorProps = (error: unknown) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst stack = isDev() && error instanceof Error ? error.stack : undefined;\n\n\treturn { error: { message, stack } };\n};\n\nexport const renderConventionError = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terror: unknown\n) => {\n\tconst conventionPath = resolveErrorConventionPath(framework, pageName);\n\tif (!conventionPath) return null;\n\n\tconst errorProps = buildErrorProps(error);\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst firstKey = Object.keys(mod)[0];\n\t\t\tconst ErrorComponent = mod.default ?? (firstKey ? mod[firstKey] : undefined);\n\t\t\tconst element = createElement(ErrorComponent, errorProps);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst { head, body } = render(ErrorComponent, {\n\t\t\t\tprops: errorProps\n\t\t\t});\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(ErrorComponent, errorProps)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\t// Vue SSR escapes quotes inside <component is=\"style\"> tags.\n\t\t\t// Extract style content, unescape it, and move to <head>.\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\t// Angular error pages are rendered as plain HTML templates\n\t\t\t// since the full Angular SSR pipeline is too heavy for error pages\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderError = mod.default ?? mod.renderError;\n\t\t\tif (typeof renderError === 'function') {\n\t\t\t\tconst html = renderError(errorProps);\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 500\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconsole.error(\n\t\t\t`[SSR] Failed to render ${framework} convention error page:`,\n\t\t\trenderError\n\t\t);\n\t}\n\n\treturn null;\n};\n\nexport const renderConventionNotFound = async (\n\tframework: keyof ConventionsMap\n) => {\n\tconst conventionPath = resolveNotFoundConventionPath(framework);\n\tif (!conventionPath) return null;\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst nfKey = Object.keys(mod)[0];\n\t\t\tconst NotFoundComponent =\n\t\t\t\tmod.default ?? (nfKey ? mod[nfKey] : undefined);\n\t\t\tconst element = createElement(NotFoundComponent);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst { head, body } = render(NotFoundComponent);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(NotFoundComponent)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderNotFound = mod.default ?? mod.renderNotFound;\n\t\t\tif (typeof renderNotFound === 'function') {\n\t\t\t\tconst html = renderNotFound();\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 404\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconsole.error(\n\t\t\t`[SSR] Failed to render ${framework} convention not-found page:`,\n\t\t\trenderError\n\t\t);\n\t}\n\n\treturn null;\n};\n\nconst NOT_FOUND_PRIORITY: (keyof ConventionsMap)[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nexport const renderFirstNotFound = async () => {\n\tfor (const framework of NOT_FOUND_PRIORITY) {\n\t\tif (!getMap()[framework]?.defaults?.notFound) continue;\n\t\tconst response = await renderConventionNotFound(framework);\n\t\tif (response) return response;\n\t}\n\n\treturn null;\n};\n",
|
|
7
|
+
"import { basename } from 'node:path';\nimport type { ConventionsMap } from '../../types/conventions';\nimport { toPascal } from './stringModifiers';\n\n// Use globalThis so the conventions map is shared across all bundles.\n// The main bundle (dist/index.js) calls setConventions, but framework\n// bundles (dist/svelte/index.js, etc.) need to read the same map.\nconst CONVENTIONS_KEY = '__absoluteConventions';\n\nconst getMap = (): ConventionsMap =>\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] as ConventionsMap ?? {};\n\nexport const setConventions = (map: ConventionsMap) => {\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] = map;\n};\n\nexport const getConventions = () => getMap();\n\nexport const resolveErrorConventionPath = (\n\tframework: keyof ConventionsMap,\n\tpageName: string\n) => {\n\tconst fw = getMap()[framework];\n\tif (!fw) return undefined;\n\n\treturn fw.pages?.[pageName]?.error ?? fw.defaults?.error;\n};\n\nexport const resolveNotFoundConventionPath = (\n\tframework: keyof ConventionsMap\n) => getMap()[framework]?.defaults?.notFound;\n\n/**\n * Derive a PascalCase page name from a compiled server path.\n * Example: \"/build/svelte/pages/SvelteExample.abc123.js\" → \"SvelteExample\"\n */\nexport const derivePageName = (pagePath: string) => {\n\tconst base = basename(pagePath);\n\t// Strip hash and extension: \"SvelteExample.abc123.js\" → \"SvelteExample\"\n\tconst dotIndex = base.indexOf('.');\n\tconst name = dotIndex > 0 ? base.slice(0, dotIndex) : base;\n\n\treturn toPascal(name);\n};\n\nconst isDev = () => process.env.NODE_ENV === 'development';\n\nconst buildErrorProps = (error: unknown) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst stack = isDev() && error instanceof Error ? error.stack : undefined;\n\n\treturn { error: { message, stack } };\n};\n\nexport const renderConventionError = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terror: unknown\n) => {\n\tconst conventionPath = resolveErrorConventionPath(framework, pageName);\n\tif (!conventionPath) return null;\n\n\tconst errorProps = buildErrorProps(error);\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst firstKey = Object.keys(mod)[0];\n\t\t\tconst ErrorComponent = mod.default ?? (firstKey ? mod[firstKey] : undefined);\n\t\t\tconst element = createElement(ErrorComponent, errorProps);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst { head, body } = render(ErrorComponent, {\n\t\t\t\tprops: errorProps\n\t\t\t});\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(ErrorComponent, errorProps)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\t// Vue SSR escapes quotes inside <component is=\"style\"> tags.\n\t\t\t// Extract style content, unescape it, and move to <head>.\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\t// Angular error pages are rendered as plain HTML templates\n\t\t\t// since the full Angular SSR pipeline is too heavy for error pages\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderError = mod.default ?? mod.renderError;\n\t\t\tif (typeof renderError === 'function') {\n\t\t\t\tconst html = renderError(errorProps);\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 500\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconst message =\n\t\t\trenderError instanceof Error ? renderError.message : '';\n\t\tif (\n\t\t\tmessage.includes('Cannot find module') ||\n\t\t\tmessage.includes('Cannot find package') ||\n\t\t\tmessage.includes('not found in module')\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Convention error page for ${framework} failed: missing framework package. ` +\n\t\t\t\t\t`Ensure the ${framework} runtime is installed (e.g. bun add ${framework === 'react' ? 'react react-dom' : framework}).`\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Failed to render ${framework} convention error page:`,\n\t\t\t\trenderError\n\t\t\t);\n\t\t}\n\t}\n\n\treturn null;\n};\n\nexport const renderConventionNotFound = async (\n\tframework: keyof ConventionsMap\n) => {\n\tconst conventionPath = resolveNotFoundConventionPath(framework);\n\tif (!conventionPath) return null;\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst nfKey = Object.keys(mod)[0];\n\t\t\tconst NotFoundComponent =\n\t\t\t\tmod.default ?? (nfKey ? mod[nfKey] : undefined);\n\t\t\tconst element = createElement(NotFoundComponent);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst { head, body } = render(NotFoundComponent);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(NotFoundComponent)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderNotFound = mod.default ?? mod.renderNotFound;\n\t\t\tif (typeof renderNotFound === 'function') {\n\t\t\t\tconst html = renderNotFound();\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 404\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconst message =\n\t\t\trenderError instanceof Error ? renderError.message : '';\n\t\tif (\n\t\t\tmessage.includes('Cannot find module') ||\n\t\t\tmessage.includes('Cannot find package') ||\n\t\t\tmessage.includes('not found in module')\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Convention not-found page for ${framework} failed: missing framework package. ` +\n\t\t\t\t\t`Ensure the ${framework} runtime is installed (e.g. bun add ${framework === 'react' ? 'react react-dom' : framework}).`\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Failed to render ${framework} convention not-found page:`,\n\t\t\t\trenderError\n\t\t\t);\n\t\t}\n\t}\n\n\treturn null;\n};\n\nconst NOT_FOUND_PRIORITY: (keyof ConventionsMap)[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nexport const renderFirstNotFound = async () => {\n\tfor (const framework of NOT_FOUND_PRIORITY) {\n\t\tif (!getMap()[framework]?.defaults?.notFound) continue;\n\t\tconst response = await renderConventionNotFound(framework);\n\t\tif (response) return response;\n\t}\n\n\treturn null;\n};\n",
|
|
8
8
|
"import type { ComponentType as ReactComponent } from 'react';\nimport { ssrErrorPage } from '../utils/ssrErrorPage';\nimport { renderConventionError } from '../utils/resolveConvention';\n\nlet ssrDirty = false;\n\nconst buildDirtyResponse = (\n\tindex: string,\n\tmaybeProps: Record<string, unknown> | undefined\n) => {\n\tconst propsScript = maybeProps\n\t\t? `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps)};`\n\t\t: '';\n\tconst dirtyFlag = 'window.__SSR_DIRTY__=true;';\n\tconst refreshSetup =\n\t\tprocess.env.NODE_ENV !== 'production'\n\t\t\t? 'window.__REFRESH_BUFFER__=[];' +\n\t\t\t\t'window.$RefreshReg$=function(t,i){window.__REFRESH_BUFFER__.push([t,i])};' +\n\t\t\t\t'window.$RefreshSig$=function(){return function(t){return t}};'\n\t\t\t: '';\n\tconst inlineScript = `${propsScript}${dirtyFlag}${refreshSetup}`;\n\tconst html =\n\t\t`<!DOCTYPE html><html><head></head><body>` +\n\t\t`<script>${inlineScript}</script>` +\n\t\t`<script type=\"module\" src=\"${index}\"></script>` +\n\t\t`</body></html>`;\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\nexport const handleReactPageRequest = async <\n\tProps extends Record<string, unknown> = Record<never, never>\n>(\n\tPageComponent: ReactComponent<Props>,\n\tindex: string,\n\t...props: keyof Props extends never ? [] : [props: NoInfer<Props>]\n) => {\n\tconst [maybeProps] = props;\n\n\tif (ssrDirty) {\n\t\treturn buildDirtyResponse(index, maybeProps);\n\t}\n\n\ttry {\n\t\tconst { createElement } = await import('react');\n\t\tconst { renderToReadableStream } = await import('react-dom/server');\n\n\t\tconst element =\n\t\t\tmaybeProps !== undefined\n\t\t\t\t? createElement(PageComponent, maybeProps)\n\t\t\t\t: createElement(PageComponent);\n\n\t\tconst propsScript = maybeProps\n\t\t\t? `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps)};`\n\t\t\t: '';\n\n\t\t// Buffer React Refresh registrations until the runtime loads.\n\t\t// Bun.build injects $RefreshReg$ calls in the bundle, but the\n\t\t// real runtime isn't ready yet. This buffering function captures\n\t\t// all registrations, then replays them when the runtime is set up.\n\t\tconst refreshSetup =\n\t\t\tprocess.env.NODE_ENV !== 'production'\n\t\t\t\t? 'window.__REFRESH_BUFFER__=[];' +\n\t\t\t\t\t'window.$RefreshReg$=function(t,i){window.__REFRESH_BUFFER__.push([t,i])};' +\n\t\t\t\t\t'window.$RefreshSig$=function(){return function(t){return t}};'\n\t\t\t\t: '';\n\n\t\tconst stream = await renderToReadableStream(element, {\n\t\t\tbootstrapModules: [index],\n\t\t\tbootstrapScriptContent: propsScript + refreshSetup || undefined,\n\t\t\tonError(error: unknown) {\n\t\t\t\tconsole.error('[SSR] React streaming error:', error);\n\t\t\t}\n\t\t});\n\n\t\treturn new Response(stream, {\n\t\t\theaders: { 'Content-Type': 'text/html' }\n\t\t});\n\t} catch (error) {\n\t\tconsole.error('[SSR] React render error:', error);\n\n\t\tconst pageName = PageComponent.name || PageComponent.displayName || '';\n\t\tconst conventionResponse = await renderConventionError(\n\t\t\t'react',\n\t\t\tpageName,\n\t\t\terror\n\t\t);\n\t\tif (conventionResponse) return conventionResponse;\n\n\t\treturn new Response(ssrErrorPage('react', error), {\n\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\tstatus: 500\n\t\t});\n\t}\n};\n\nexport const invalidateReactSsrCache = () => {\n\tssrDirty = true;\n};\n",
|
|
9
9
|
"export { handleReactPageRequest } from './pageHandler';\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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A,QACvB,QAAQ,MAAM,gCAAgC,KAAK;AAAA;AAAA,IAErD,CAAC;AAAA,IAED,OAAO,IAAI,SAAS,QAAQ;AAAA,MAC3B,SAAS,EAAE,gBAAgB,YAAY;AAAA,IACxC,CAAC;AAAA,IACA,OAAO,OAAO;AAAA,IACf,QAAQ,MAAM,6BAA6B,KAAK;AAAA,IAEhD,MAAM,WAAW,cAAc,QAAQ,cAAc,eAAe;AAAA,IACpE,MAAM,qBAAqB,MAAM,sBAChC,SACA,UACA,KACD;AAAA,IACA,IAAI;AAAA,MAAoB,OAAO;AAAA,IAE/B,OAAO,IAAI,SAAS,aAAa,SAAS,KAAK,GAAG;AAAA,MACjD,SAAS,EAAE,gBAAgB,YAAY;AAAA,MACvC,QAAQ;AAAA,IACT,CAAC;AAAA;AAAA,GAIU,0BAA0B,MAAM;AAAA,EAC5C,WAAW;AAAA;AAAA;AAAA,EAjGZ;AAAA;;;ACFA;",
|
|
12
|
+
"debugId": "B03C8A21E51D1E2064756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
package/dist/svelte/index.js
CHANGED
|
@@ -206,7 +206,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
} catch (renderError) {
|
|
209
|
-
|
|
209
|
+
const message = renderError instanceof Error ? renderError.message : "";
|
|
210
|
+
if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
|
|
211
|
+
console.error(`[SSR] Convention error page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
|
|
212
|
+
} else {
|
|
213
|
+
console.error(`[SSR] Failed to render ${framework} convention error page:`, renderError);
|
|
214
|
+
}
|
|
210
215
|
}
|
|
211
216
|
return null;
|
|
212
217
|
}, renderConventionNotFound = async (framework) => {
|
|
@@ -270,7 +275,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
|
|
|
270
275
|
}
|
|
271
276
|
}
|
|
272
277
|
} catch (renderError) {
|
|
273
|
-
|
|
278
|
+
const message = renderError instanceof Error ? renderError.message : "";
|
|
279
|
+
if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
|
|
280
|
+
console.error(`[SSR] Convention not-found page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
|
|
281
|
+
} else {
|
|
282
|
+
console.error(`[SSR] Failed to render ${framework} convention not-found page:`, renderError);
|
|
283
|
+
}
|
|
274
284
|
}
|
|
275
285
|
return null;
|
|
276
286
|
}, NOT_FOUND_PRIORITY, renderFirstNotFound = async () => {
|
|
@@ -418,5 +428,5 @@ export {
|
|
|
418
428
|
handleSveltePageRequest
|
|
419
429
|
};
|
|
420
430
|
|
|
421
|
-
//# debugId=
|
|
431
|
+
//# debugId=4D7C796F850384E664756E2164756E21
|
|
422
432
|
//# sourceMappingURL=index.js.map
|
package/dist/svelte/index.js.map
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"export const ssrErrorPage = (framework: string, error: unknown) => {\n\tconst frameworkColors: Record<string, string> = {\n\t\tangular: '#dd0031',\n\t\thtml: '#e34c26',\n\t\thtmx: '#1a365d',\n\t\treact: '#61dafb',\n\t\tsvelte: '#ff3e00',\n\t\tvue: '#42b883'\n\t};\n\n\tconst accent = frameworkColors[framework] ?? '#94a3b8';\n\tconst label = framework.charAt(0).toUpperCase() + framework.slice(1);\n\tconst message = error instanceof Error ? error.message : String(error);\n\n\treturn `<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>SSR Error - AbsoluteJS</title>\n<style>\n*{margin:0;padding:0;box-sizing:border-box}\nbody{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:\"JetBrains Mono\",\"Fira Code\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}\n.card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}\n.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}\n.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}\n.badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}\n.kind{color:#94a3b8;font-size:13px;font-weight:500}\n.content{padding:24px}\n.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}\n.message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}\n.hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}\n</style>\n</head>\n<body>\n<div class=\"card\">\n<div class=\"header\">\n<div style=\"display:flex;align-items:center;gap:12px\">\n<span class=\"brand\">AbsoluteJS</span>\n<span class=\"badge\">${label}</span>\n</div>\n<span class=\"kind\">Server Render Error</span>\n</div>\n<div class=\"content\">\n<div class=\"label\">What went wrong</div>\n<pre class=\"message\">${message.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</pre>\n<div class=\"hint\">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>\n</div>\n</div>\n</body>\n</html>`;\n};\n",
|
|
6
6
|
"const normalizeSlug = (str: string) =>\n\tstr\n\t\t.trim()\n\t\t.replace(/\\s+/g, '-')\n\t\t.replace(/[^A-Za-z0-9\\-_]+/g, '')\n\t\t.replace(/[-_]{2,}/g, '-');\n\nexport const toKebab = (str: string) =>\n\tnormalizeSlug(str)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t.toLowerCase();\nexport const toPascal = (str: string) => {\n\tif (!str.includes('-') && !str.includes('_')) {\n\t\treturn str.charAt(0).toUpperCase() + str.slice(1);\n\t}\n\n\treturn normalizeSlug(str)\n\t\t.split(/[-_]/)\n\t\t.filter(Boolean)\n\t\t.map(\n\t\t\t(segment) =>\n\t\t\t\tsegment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()\n\t\t)\n\t\t.join('');\n};\nexport const toScreamingSnake = (str: string) =>\n\tstr.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toUpperCase();\n",
|
|
7
|
-
"import { basename } from 'node:path';\nimport type { ConventionsMap } from '../../types/conventions';\nimport { toPascal } from './stringModifiers';\n\n// Use globalThis so the conventions map is shared across all bundles.\n// The main bundle (dist/index.js) calls setConventions, but framework\n// bundles (dist/svelte/index.js, etc.) need to read the same map.\nconst CONVENTIONS_KEY = '__absoluteConventions';\n\nconst getMap = (): ConventionsMap =>\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] as ConventionsMap ?? {};\n\nexport const setConventions = (map: ConventionsMap) => {\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] = map;\n};\n\nexport const getConventions = () => getMap();\n\nexport const resolveErrorConventionPath = (\n\tframework: keyof ConventionsMap,\n\tpageName: string\n) => {\n\tconst fw = getMap()[framework];\n\tif (!fw) return undefined;\n\n\treturn fw.pages?.[pageName]?.error ?? fw.defaults?.error;\n};\n\nexport const resolveNotFoundConventionPath = (\n\tframework: keyof ConventionsMap\n) => getMap()[framework]?.defaults?.notFound;\n\n/**\n * Derive a PascalCase page name from a compiled server path.\n * Example: \"/build/svelte/pages/SvelteExample.abc123.js\" → \"SvelteExample\"\n */\nexport const derivePageName = (pagePath: string) => {\n\tconst base = basename(pagePath);\n\t// Strip hash and extension: \"SvelteExample.abc123.js\" → \"SvelteExample\"\n\tconst dotIndex = base.indexOf('.');\n\tconst name = dotIndex > 0 ? base.slice(0, dotIndex) : base;\n\n\treturn toPascal(name);\n};\n\nconst isDev = () => process.env.NODE_ENV === 'development';\n\nconst buildErrorProps = (error: unknown) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst stack = isDev() && error instanceof Error ? error.stack : undefined;\n\n\treturn { error: { message, stack } };\n};\n\nexport const renderConventionError = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terror: unknown\n) => {\n\tconst conventionPath = resolveErrorConventionPath(framework, pageName);\n\tif (!conventionPath) return null;\n\n\tconst errorProps = buildErrorProps(error);\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst firstKey = Object.keys(mod)[0];\n\t\t\tconst ErrorComponent = mod.default ?? (firstKey ? mod[firstKey] : undefined);\n\t\t\tconst element = createElement(ErrorComponent, errorProps);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst { head, body } = render(ErrorComponent, {\n\t\t\t\tprops: errorProps\n\t\t\t});\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(ErrorComponent, errorProps)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\t// Vue SSR escapes quotes inside <component is=\"style\"> tags.\n\t\t\t// Extract style content, unescape it, and move to <head>.\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\t// Angular error pages are rendered as plain HTML templates\n\t\t\t// since the full Angular SSR pipeline is too heavy for error pages\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderError = mod.default ?? mod.renderError;\n\t\t\tif (typeof renderError === 'function') {\n\t\t\t\tconst html = renderError(errorProps);\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 500\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconsole.error(\n\t\t\t`[SSR] Failed to render ${framework} convention error page:`,\n\t\t\trenderError\n\t\t);\n\t}\n\n\treturn null;\n};\n\nexport const renderConventionNotFound = async (\n\tframework: keyof ConventionsMap\n) => {\n\tconst conventionPath = resolveNotFoundConventionPath(framework);\n\tif (!conventionPath) return null;\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst nfKey = Object.keys(mod)[0];\n\t\t\tconst NotFoundComponent =\n\t\t\t\tmod.default ?? (nfKey ? mod[nfKey] : undefined);\n\t\t\tconst element = createElement(NotFoundComponent);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst { head, body } = render(NotFoundComponent);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(NotFoundComponent)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderNotFound = mod.default ?? mod.renderNotFound;\n\t\t\tif (typeof renderNotFound === 'function') {\n\t\t\t\tconst html = renderNotFound();\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 404\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconsole.error(\n\t\t\t`[SSR] Failed to render ${framework} convention not-found page:`,\n\t\t\trenderError\n\t\t);\n\t}\n\n\treturn null;\n};\n\nconst NOT_FOUND_PRIORITY: (keyof ConventionsMap)[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nexport const renderFirstNotFound = async () => {\n\tfor (const framework of NOT_FOUND_PRIORITY) {\n\t\tif (!getMap()[framework]?.defaults?.notFound) continue;\n\t\tconst response = await renderConventionNotFound(framework);\n\t\tif (response) return response;\n\t}\n\n\treturn null;\n};\n",
|
|
7
|
+
"import { basename } from 'node:path';\nimport type { ConventionsMap } from '../../types/conventions';\nimport { toPascal } from './stringModifiers';\n\n// Use globalThis so the conventions map is shared across all bundles.\n// The main bundle (dist/index.js) calls setConventions, but framework\n// bundles (dist/svelte/index.js, etc.) need to read the same map.\nconst CONVENTIONS_KEY = '__absoluteConventions';\n\nconst getMap = (): ConventionsMap =>\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] as ConventionsMap ?? {};\n\nexport const setConventions = (map: ConventionsMap) => {\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] = map;\n};\n\nexport const getConventions = () => getMap();\n\nexport const resolveErrorConventionPath = (\n\tframework: keyof ConventionsMap,\n\tpageName: string\n) => {\n\tconst fw = getMap()[framework];\n\tif (!fw) return undefined;\n\n\treturn fw.pages?.[pageName]?.error ?? fw.defaults?.error;\n};\n\nexport const resolveNotFoundConventionPath = (\n\tframework: keyof ConventionsMap\n) => getMap()[framework]?.defaults?.notFound;\n\n/**\n * Derive a PascalCase page name from a compiled server path.\n * Example: \"/build/svelte/pages/SvelteExample.abc123.js\" → \"SvelteExample\"\n */\nexport const derivePageName = (pagePath: string) => {\n\tconst base = basename(pagePath);\n\t// Strip hash and extension: \"SvelteExample.abc123.js\" → \"SvelteExample\"\n\tconst dotIndex = base.indexOf('.');\n\tconst name = dotIndex > 0 ? base.slice(0, dotIndex) : base;\n\n\treturn toPascal(name);\n};\n\nconst isDev = () => process.env.NODE_ENV === 'development';\n\nconst buildErrorProps = (error: unknown) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst stack = isDev() && error instanceof Error ? error.stack : undefined;\n\n\treturn { error: { message, stack } };\n};\n\nexport const renderConventionError = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terror: unknown\n) => {\n\tconst conventionPath = resolveErrorConventionPath(framework, pageName);\n\tif (!conventionPath) return null;\n\n\tconst errorProps = buildErrorProps(error);\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst firstKey = Object.keys(mod)[0];\n\t\t\tconst ErrorComponent = mod.default ?? (firstKey ? mod[firstKey] : undefined);\n\t\t\tconst element = createElement(ErrorComponent, errorProps);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst { head, body } = render(ErrorComponent, {\n\t\t\t\tprops: errorProps\n\t\t\t});\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(ErrorComponent, errorProps)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\t// Vue SSR escapes quotes inside <component is=\"style\"> tags.\n\t\t\t// Extract style content, unescape it, and move to <head>.\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\t// Angular error pages are rendered as plain HTML templates\n\t\t\t// since the full Angular SSR pipeline is too heavy for error pages\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderError = mod.default ?? mod.renderError;\n\t\t\tif (typeof renderError === 'function') {\n\t\t\t\tconst html = renderError(errorProps);\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 500\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconst message =\n\t\t\trenderError instanceof Error ? renderError.message : '';\n\t\tif (\n\t\t\tmessage.includes('Cannot find module') ||\n\t\t\tmessage.includes('Cannot find package') ||\n\t\t\tmessage.includes('not found in module')\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Convention error page for ${framework} failed: missing framework package. ` +\n\t\t\t\t\t`Ensure the ${framework} runtime is installed (e.g. bun add ${framework === 'react' ? 'react react-dom' : framework}).`\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Failed to render ${framework} convention error page:`,\n\t\t\t\trenderError\n\t\t\t);\n\t\t}\n\t}\n\n\treturn null;\n};\n\nexport const renderConventionNotFound = async (\n\tframework: keyof ConventionsMap\n) => {\n\tconst conventionPath = resolveNotFoundConventionPath(framework);\n\tif (!conventionPath) return null;\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst nfKey = Object.keys(mod)[0];\n\t\t\tconst NotFoundComponent =\n\t\t\t\tmod.default ?? (nfKey ? mod[nfKey] : undefined);\n\t\t\tconst element = createElement(NotFoundComponent);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst { head, body } = render(NotFoundComponent);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(NotFoundComponent)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderNotFound = mod.default ?? mod.renderNotFound;\n\t\t\tif (typeof renderNotFound === 'function') {\n\t\t\t\tconst html = renderNotFound();\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 404\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconst message =\n\t\t\trenderError instanceof Error ? renderError.message : '';\n\t\tif (\n\t\t\tmessage.includes('Cannot find module') ||\n\t\t\tmessage.includes('Cannot find package') ||\n\t\t\tmessage.includes('not found in module')\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Convention not-found page for ${framework} failed: missing framework package. ` +\n\t\t\t\t\t`Ensure the ${framework} runtime is installed (e.g. bun add ${framework === 'react' ? 'react react-dom' : framework}).`\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Failed to render ${framework} convention not-found page:`,\n\t\t\t\trenderError\n\t\t\t);\n\t\t}\n\t}\n\n\treturn null;\n};\n\nconst NOT_FOUND_PRIORITY: (keyof ConventionsMap)[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nexport const renderFirstNotFound = async () => {\n\tfor (const framework of NOT_FOUND_PRIORITY) {\n\t\tif (!getMap()[framework]?.defaults?.notFound) continue;\n\t\tconst response = await renderConventionNotFound(framework);\n\t\tif (response) return response;\n\t}\n\n\treturn null;\n};\n",
|
|
8
8
|
"export const ANGULAR_INIT_TIMEOUT_MS = 500;\nexport const ANSI_ESCAPE_LENGTH = 3;\nexport const ASCII_SPACE = 32;\nexport const BASE_36_RADIX = 36;\nexport const BUN_BUILD_WARNING_SUPPRESSION =\n\t'wildcard sideEffects are not supported yet';\nexport const BODY_SLICE_LENGTH = 2000;\nexport const BYTES_PER_KILOBYTE = 1024;\nexport const CLI_ARGS_OFFSET = 3;\nexport const CSS_ERROR_RESOLVE_DELAY_MS = 50;\nexport const CSS_MAX_CHECK_ATTEMPTS = 10;\nexport const CSS_MAX_PARSE_TIMEOUT_MS = 500;\nexport const CSS_SHEET_READY_TIMEOUT_MS = 100;\nexport const DEFAULT_CHUNK_SIZE = 16_384;\nexport const DEFAULT_DEBOUNCE_MS = 15;\nexport const DEFAULT_PORT = 3000;\nexport const DEV_SERVER_RESTART_DEBOUNCE_MS = 100;\nexport const DOM_UPDATE_DELAY_MS = 50;\nexport const FILE_PROTOCOL_PREFIX_LENGTH = 7;\nexport const FOCUS_ID_PREFIX_LENGTH = 3;\nexport const FOCUS_IDX_PREFIX_LENGTH = 4;\nexport const FOCUS_NAME_PREFIX_LENGTH = 5;\nexport const HMR_UPDATE_TIMEOUT_MS = 2000;\nexport const HOOK_SIGNATURE_LENGTH = 12;\nexport const HOURS_IN_DAY = 24;\nexport const HOURS_IN_HALF_DAY = 12;\nexport const MAX_ERROR_LENGTH = 200;\nexport const MAX_RECONNECT_ATTEMPTS = 60;\nexport const MILLISECONDS_IN_A_SECOND = 1000;\nexport const MINUTES_IN_AN_HOUR = 60;\nexport const SECONDS_IN_A_MINUTE = 60;\nexport const MILLISECONDS_IN_A_MINUTE =\n\tMILLISECONDS_IN_A_SECOND * SECONDS_IN_A_MINUTE;\nexport const MILLISECONDS_IN_A_DAY =\n\tMILLISECONDS_IN_A_SECOND *\n\tSECONDS_IN_A_MINUTE *\n\tMINUTES_IN_AN_HOUR *\n\tHOURS_IN_DAY;\nexport const OVERLAY_FADE_DURATION_MS = 150;\nexport const PING_INTERVAL_MS = 30_000;\nexport const RAF_BATCH_COUNT = 3;\nexport const RANDOM_ID_END_INDEX = 11;\nexport const REBUILD_BATCH_DELAY_MS = 10;\nexport const REBUILD_RELOAD_DELAY_MS = 200;\nexport const RECONNECT_INITIAL_DELAY_MS = 500;\nexport const RECONNECT_POLL_INTERVAL_MS = 300;\nexport const SIGINT_EXIT_CODE = 130;\nexport const SIGTERM_EXIT_CODE = 143;\nexport const SVELTE_CSS_LOAD_TIMEOUT_MS = 500;\nexport const TIME_PRECISION = 2;\nexport const TWO_THIRDS = 2 / 3;\nexport const UNFOUND_INDEX = -1;\nexport const WEBSOCKET_NORMAL_CLOSURE = 1000;\n",
|
|
9
9
|
"const ESCAPE_LOOKUP: Record<string, string> = {\n\t'\\u2028': '\\\\u2028',\n\t'\\u2029': '\\\\u2029',\n\t'&': '\\\\u0026',\n\t'<': '\\\\u003C',\n\t'>': '\\\\u003E'\n};\n\nconst ESCAPE_REGEX = /[&><\\u2028\\u2029]/g;\n\nexport const escapeScriptContent = (content: string) =>\n\tcontent.replace(ESCAPE_REGEX, (char) => {\n\t\tconst escaped = ESCAPE_LOOKUP[char];\n\n\t\treturn escaped !== undefined ? escaped : char;\n\t});\n",
|
|
10
10
|
"import type { Component } from 'svelte';\nimport { DEFAULT_CHUNK_SIZE } from '../constants';\nimport { escapeScriptContent } from '../utils/escapeScriptContent';\n\nexport type RenderStreamOptions = {\n\tbootstrapScriptContent?: string;\n\tbootstrapScripts?: string[];\n\tbootstrapModules?: string[];\n\tnonce?: string;\n\tonError?: (error: unknown) => void;\n\tprogressiveChunkSize?: number;\n\tsignal?: AbortSignal;\n\theadContent?: string;\n\tbodyContent?: string;\n};\n\nexport const renderToReadableStream = async <\n\tProps extends Record<string, unknown> = Record<string, never>\n>(\n\tcomponent: Component<Props>,\n\tprops?: Props,\n\t{\n\t\tbootstrapScriptContent,\n\t\tbootstrapScripts = [],\n\t\tbootstrapModules = [],\n\t\tnonce,\n\t\tonError = console.error,\n\t\tprogressiveChunkSize = DEFAULT_CHUNK_SIZE,\n\t\tsignal,\n\t\theadContent,\n\t\tbodyContent\n\t}: RenderStreamOptions = {}\n) => {\n\ttry {\n\t\tconst { render } = await import('svelte/server');\n\t\tconst { head, body } =\n\t\t\ttypeof props === 'undefined'\n\t\t\t\t? // @ts-expect-error Svelte's render function can't determine which overload to choose when the component is generic\n\t\t\t\t\trender(component)\n\t\t\t\t: render(component, { props });\n\t\tconst nonceAttr = nonce ? ` nonce=\"${nonce}\"` : '';\n\t\tconst scripts =\n\t\t\t(bootstrapScriptContent\n\t\t\t\t? `<script${nonceAttr}>${escapeScriptContent(bootstrapScriptContent)}</script>`\n\t\t\t\t: '') +\n\t\t\tbootstrapScripts\n\t\t\t\t.map((src) => `<script${nonceAttr} src=\"${src}\"></script>`)\n\t\t\t\t.join('') +\n\t\t\tbootstrapModules\n\t\t\t\t.map(\n\t\t\t\t\t(src) =>\n\t\t\t\t\t\t`<script${nonceAttr} type=\"module\" src=\"${src}\"></script>`\n\t\t\t\t)\n\t\t\t\t.join('');\n\t\tconst encoder = new TextEncoder();\n\t\t// Warning: this encodes the entire document into memory in one buffer\n\t\tconst full = encoder.encode(\n\t\t\t`<!DOCTYPE html><html lang=\"en\"><head>${head}${headContent ?? ''}</head><body>${body}${scripts}${bodyContent ?? ''}</body></html>`\n\t\t);\n\n\t\tlet offset = 0;\n\n\t\treturn new ReadableStream<Uint8Array>({\n\t\t\ttype: 'bytes',\n\t\t\tcancel(reason) {\n\t\t\t\tonError?.(reason);\n\t\t\t},\n\t\t\tpull(controller) {\n\t\t\t\tif (signal?.aborted) {\n\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (offset >= full.length) {\n\t\t\t\t\tcontroller.close();\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst end = Math.min(\n\t\t\t\t\toffset + progressiveChunkSize,\n\t\t\t\t\tfull.length\n\t\t\t\t);\n\t\t\t\tcontroller.enqueue(full.subarray(offset, end));\n\t\t\t\toffset = end;\n\t\t\t}\n\t\t});\n\t} catch (error) {\n\t\tonError?.(error);\n\t\tthrow error;\n\t}\n};\n",
|
|
11
11
|
"import type { Component as SvelteComponent } from 'svelte';\nimport { ssrErrorPage } from '../utils/ssrErrorPage';\nimport {\n\tderivePageName,\n\trenderConventionError\n} from '../utils/resolveConvention';\n\nlet ssrDirty = false;\n\nconst buildDirtyResponse = (indexPath: string, props?: unknown) => {\n\tconst propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(props)};`;\n\tconst dirtyFlag = 'window.__SSR_DIRTY__=true;';\n\tconst scriptTag = indexPath\n\t\t? `<script type=\"module\" src=\"${indexPath}\"></script>`\n\t\t: '';\n\tconst html = `<!DOCTYPE html><html><head></head><body><script>${propsScript}${dirtyFlag}</script>${scriptTag}</body></html>`;\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\nexport type HandleSveltePageRequest = {\n\t(\n\t\tPageComponent: SvelteComponent<Record<string, never>>,\n\t\tpagePath: string,\n\t\tindexPath: string\n\t): Promise<Response>;\n\t<P extends Record<string, unknown>>(\n\t\tPageComponent: SvelteComponent<P>,\n\t\tpagePath: string,\n\t\tindexPath: string,\n\t\tprops: NoInfer<P>\n\t): Promise<Response>;\n};\n\nexport const handleSveltePageRequest: HandleSveltePageRequest = async <\n\tP extends Record<string, unknown>\n>(\n\t_PageComponent: SvelteComponent<P>,\n\tpagePath: string,\n\tindexPath: string,\n\tprops?: P\n) => {\n\tif (ssrDirty) {\n\t\treturn buildDirtyResponse(indexPath, props);\n\t}\n\n\ttry {\n\t\tconst { default: ImportedPageComponent } = await import(pagePath);\n\t\tconst { renderToReadableStream } = await import(\n\t\t\t'./renderToReadableStream'\n\t\t);\n\n\t\tconst stream = await renderToReadableStream(\n\t\t\tImportedPageComponent,\n\t\t\tprops,\n\t\t\t{\n\t\t\t\tbootstrapModules: indexPath ? [indexPath] : [],\n\t\t\t\tbootstrapScriptContent: `window.__INITIAL_PROPS__=${JSON.stringify(\n\t\t\t\t\tprops\n\t\t\t\t)}`\n\t\t\t}\n\t\t);\n\n\t\treturn new Response(stream, {\n\t\t\theaders: { 'Content-Type': 'text/html' }\n\t\t});\n\t} catch (error) {\n\t\tconsole.error('[SSR] Svelte render error:', error);\n\n\t\tconst pageName = derivePageName(pagePath);\n\t\tconst conventionResponse = await renderConventionError(\n\t\t\t'svelte',\n\t\t\tpageName,\n\t\t\terror\n\t\t);\n\t\tif (conventionResponse) return conventionResponse;\n\n\t\treturn new Response(ssrErrorPage('svelte', error), {\n\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\tstatus: 500\n\t\t});\n\t}\n};\n\nexport const invalidateSvelteSsrCache = () => {\n\tssrDirty = true;\n};\n",
|
|
12
12
|
"export { handleSveltePageRequest } from './pageHandler';\nexport { renderToReadableStream } from './renderToReadableStream';\n"
|
|
13
13
|
],
|
|
14
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAa,eAAe,CAAC,WAAmB,UAAmB;AAAA,EAClE,MAAM,kBAA0C;AAAA,IAC/C,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;A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2B,MAAM;AAAA,EAC7C,WAAW;AAAA;AAAA;AAAA,EArFZ;AAAA;;;ACFA;AACA;",
|
|
15
|
+
"debugId": "4D7C796F850384E664756E2164756E21",
|
|
16
16
|
"names": []
|
|
17
17
|
}
|
package/dist/vue/index.js
CHANGED
|
@@ -206,7 +206,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
} catch (renderError) {
|
|
209
|
-
|
|
209
|
+
const message = renderError instanceof Error ? renderError.message : "";
|
|
210
|
+
if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
|
|
211
|
+
console.error(`[SSR] Convention error page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
|
|
212
|
+
} else {
|
|
213
|
+
console.error(`[SSR] Failed to render ${framework} convention error page:`, renderError);
|
|
214
|
+
}
|
|
210
215
|
}
|
|
211
216
|
return null;
|
|
212
217
|
}, renderConventionNotFound = async (framework) => {
|
|
@@ -270,7 +275,12 @@ var CONVENTIONS_KEY = "__absoluteConventions", getMap = () => globalThis[CONVENT
|
|
|
270
275
|
}
|
|
271
276
|
}
|
|
272
277
|
} catch (renderError) {
|
|
273
|
-
|
|
278
|
+
const message = renderError instanceof Error ? renderError.message : "";
|
|
279
|
+
if (message.includes("Cannot find module") || message.includes("Cannot find package") || message.includes("not found in module")) {
|
|
280
|
+
console.error(`[SSR] Convention not-found page for ${framework} failed: missing framework package. Ensure the ${framework} runtime is installed (e.g. bun add ${framework === "react" ? "react react-dom" : framework}).`);
|
|
281
|
+
} else {
|
|
282
|
+
console.error(`[SSR] Failed to render ${framework} convention not-found page:`, renderError);
|
|
283
|
+
}
|
|
274
284
|
}
|
|
275
285
|
return null;
|
|
276
286
|
}, NOT_FOUND_PRIORITY, renderFirstNotFound = async () => {
|
|
@@ -352,5 +362,5 @@ export {
|
|
|
352
362
|
handleVuePageRequest
|
|
353
363
|
};
|
|
354
364
|
|
|
355
|
-
//# debugId=
|
|
365
|
+
//# debugId=4A22AD08D929C19064756E2164756E21
|
|
356
366
|
//# sourceMappingURL=index.js.map
|
package/dist/vue/index.js.map
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"export const ssrErrorPage = (framework: string, error: unknown) => {\n\tconst frameworkColors: Record<string, string> = {\n\t\tangular: '#dd0031',\n\t\thtml: '#e34c26',\n\t\thtmx: '#1a365d',\n\t\treact: '#61dafb',\n\t\tsvelte: '#ff3e00',\n\t\tvue: '#42b883'\n\t};\n\n\tconst accent = frameworkColors[framework] ?? '#94a3b8';\n\tconst label = framework.charAt(0).toUpperCase() + framework.slice(1);\n\tconst message = error instanceof Error ? error.message : String(error);\n\n\treturn `<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n<title>SSR Error - AbsoluteJS</title>\n<style>\n*{margin:0;padding:0;box-sizing:border-box}\nbody{min-height:100vh;background:linear-gradient(135deg,rgba(15,23,42,0.98) 0%,rgba(30,41,59,0.98) 100%);color:#e2e8f0;font-family:\"JetBrains Mono\",\"Fira Code\",ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;font-size:14px;line-height:1.6;display:flex;align-items:flex-start;justify-content:center;padding:32px}\n.card{max-width:720px;width:100%;background:rgba(30,41,59,0.6);border:1px solid rgba(71,85,105,0.5);border-radius:16px;box-shadow:0 25px 50px -12px rgba(0,0,0,0.5),0 0 0 1px rgba(255,255,255,0.05);overflow:hidden}\n.header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;background:rgba(15,23,42,0.5);border-bottom:1px solid rgba(71,85,105,0.4)}\n.brand{font-weight:700;font-size:20px;color:#fff;letter-spacing:-0.02em}\n.badge{padding:5px 10px;border-radius:8px;font-size:12px;font-weight:600;background:${accent};color:#fff;opacity:0.95;box-shadow:0 2px 4px rgba(0,0,0,0.2)}\n.kind{color:#94a3b8;font-size:13px;font-weight:500}\n.content{padding:24px}\n.label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:0.08em;color:#94a3b8;margin-bottom:8px}\n.message{margin:0;padding:16px 20px;background:rgba(239,68,68,0.12);border:1px solid rgba(239,68,68,0.25);border-radius:10px;overflow-x:auto;white-space:pre-wrap;word-break:break-word;color:#fca5a5;font-size:13px;line-height:1.5}\n.hint{margin-top:20px;padding:12px 20px;background:rgba(71,85,105,0.3);border-radius:10px;border:1px solid rgba(71,85,105,0.4);color:#cbd5e1;font-size:13px}\n</style>\n</head>\n<body>\n<div class=\"card\">\n<div class=\"header\">\n<div style=\"display:flex;align-items:center;gap:12px\">\n<span class=\"brand\">AbsoluteJS</span>\n<span class=\"badge\">${label}</span>\n</div>\n<span class=\"kind\">Server Render Error</span>\n</div>\n<div class=\"content\">\n<div class=\"label\">What went wrong</div>\n<pre class=\"message\">${message.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</pre>\n<div class=\"hint\">A component threw during server-side rendering. Check the terminal for the full stack trace.</div>\n</div>\n</div>\n</body>\n</html>`;\n};\n",
|
|
6
6
|
"const normalizeSlug = (str: string) =>\n\tstr\n\t\t.trim()\n\t\t.replace(/\\s+/g, '-')\n\t\t.replace(/[^A-Za-z0-9\\-_]+/g, '')\n\t\t.replace(/[-_]{2,}/g, '-');\n\nexport const toKebab = (str: string) =>\n\tnormalizeSlug(str)\n\t\t.replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n\t\t.toLowerCase();\nexport const toPascal = (str: string) => {\n\tif (!str.includes('-') && !str.includes('_')) {\n\t\treturn str.charAt(0).toUpperCase() + str.slice(1);\n\t}\n\n\treturn normalizeSlug(str)\n\t\t.split(/[-_]/)\n\t\t.filter(Boolean)\n\t\t.map(\n\t\t\t(segment) =>\n\t\t\t\tsegment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()\n\t\t)\n\t\t.join('');\n};\nexport const toScreamingSnake = (str: string) =>\n\tstr.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toUpperCase();\n",
|
|
7
|
-
"import { basename } from 'node:path';\nimport type { ConventionsMap } from '../../types/conventions';\nimport { toPascal } from './stringModifiers';\n\n// Use globalThis so the conventions map is shared across all bundles.\n// The main bundle (dist/index.js) calls setConventions, but framework\n// bundles (dist/svelte/index.js, etc.) need to read the same map.\nconst CONVENTIONS_KEY = '__absoluteConventions';\n\nconst getMap = (): ConventionsMap =>\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] as ConventionsMap ?? {};\n\nexport const setConventions = (map: ConventionsMap) => {\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] = map;\n};\n\nexport const getConventions = () => getMap();\n\nexport const resolveErrorConventionPath = (\n\tframework: keyof ConventionsMap,\n\tpageName: string\n) => {\n\tconst fw = getMap()[framework];\n\tif (!fw) return undefined;\n\n\treturn fw.pages?.[pageName]?.error ?? fw.defaults?.error;\n};\n\nexport const resolveNotFoundConventionPath = (\n\tframework: keyof ConventionsMap\n) => getMap()[framework]?.defaults?.notFound;\n\n/**\n * Derive a PascalCase page name from a compiled server path.\n * Example: \"/build/svelte/pages/SvelteExample.abc123.js\" → \"SvelteExample\"\n */\nexport const derivePageName = (pagePath: string) => {\n\tconst base = basename(pagePath);\n\t// Strip hash and extension: \"SvelteExample.abc123.js\" → \"SvelteExample\"\n\tconst dotIndex = base.indexOf('.');\n\tconst name = dotIndex > 0 ? base.slice(0, dotIndex) : base;\n\n\treturn toPascal(name);\n};\n\nconst isDev = () => process.env.NODE_ENV === 'development';\n\nconst buildErrorProps = (error: unknown) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst stack = isDev() && error instanceof Error ? error.stack : undefined;\n\n\treturn { error: { message, stack } };\n};\n\nexport const renderConventionError = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terror: unknown\n) => {\n\tconst conventionPath = resolveErrorConventionPath(framework, pageName);\n\tif (!conventionPath) return null;\n\n\tconst errorProps = buildErrorProps(error);\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst firstKey = Object.keys(mod)[0];\n\t\t\tconst ErrorComponent = mod.default ?? (firstKey ? mod[firstKey] : undefined);\n\t\t\tconst element = createElement(ErrorComponent, errorProps);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst { head, body } = render(ErrorComponent, {\n\t\t\t\tprops: errorProps\n\t\t\t});\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(ErrorComponent, errorProps)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\t// Vue SSR escapes quotes inside <component is=\"style\"> tags.\n\t\t\t// Extract style content, unescape it, and move to <head>.\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\t// Angular error pages are rendered as plain HTML templates\n\t\t\t// since the full Angular SSR pipeline is too heavy for error pages\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderError = mod.default ?? mod.renderError;\n\t\t\tif (typeof renderError === 'function') {\n\t\t\t\tconst html = renderError(errorProps);\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 500\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconsole.error(\n\t\t\t`[SSR] Failed to render ${framework} convention error page:`,\n\t\t\trenderError\n\t\t);\n\t}\n\n\treturn null;\n};\n\nexport const renderConventionNotFound = async (\n\tframework: keyof ConventionsMap\n) => {\n\tconst conventionPath = resolveNotFoundConventionPath(framework);\n\tif (!conventionPath) return null;\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst nfKey = Object.keys(mod)[0];\n\t\t\tconst NotFoundComponent =\n\t\t\t\tmod.default ?? (nfKey ? mod[nfKey] : undefined);\n\t\t\tconst element = createElement(NotFoundComponent);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst { head, body } = render(NotFoundComponent);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(NotFoundComponent)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderNotFound = mod.default ?? mod.renderNotFound;\n\t\t\tif (typeof renderNotFound === 'function') {\n\t\t\t\tconst html = renderNotFound();\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 404\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconsole.error(\n\t\t\t`[SSR] Failed to render ${framework} convention not-found page:`,\n\t\t\trenderError\n\t\t);\n\t}\n\n\treturn null;\n};\n\nconst NOT_FOUND_PRIORITY: (keyof ConventionsMap)[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nexport const renderFirstNotFound = async () => {\n\tfor (const framework of NOT_FOUND_PRIORITY) {\n\t\tif (!getMap()[framework]?.defaults?.notFound) continue;\n\t\tconst response = await renderConventionNotFound(framework);\n\t\tif (response) return response;\n\t}\n\n\treturn null;\n};\n",
|
|
7
|
+
"import { basename } from 'node:path';\nimport type { ConventionsMap } from '../../types/conventions';\nimport { toPascal } from './stringModifiers';\n\n// Use globalThis so the conventions map is shared across all bundles.\n// The main bundle (dist/index.js) calls setConventions, but framework\n// bundles (dist/svelte/index.js, etc.) need to read the same map.\nconst CONVENTIONS_KEY = '__absoluteConventions';\n\nconst getMap = (): ConventionsMap =>\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] as ConventionsMap ?? {};\n\nexport const setConventions = (map: ConventionsMap) => {\n\t(globalThis as Record<string, unknown>)[CONVENTIONS_KEY] = map;\n};\n\nexport const getConventions = () => getMap();\n\nexport const resolveErrorConventionPath = (\n\tframework: keyof ConventionsMap,\n\tpageName: string\n) => {\n\tconst fw = getMap()[framework];\n\tif (!fw) return undefined;\n\n\treturn fw.pages?.[pageName]?.error ?? fw.defaults?.error;\n};\n\nexport const resolveNotFoundConventionPath = (\n\tframework: keyof ConventionsMap\n) => getMap()[framework]?.defaults?.notFound;\n\n/**\n * Derive a PascalCase page name from a compiled server path.\n * Example: \"/build/svelte/pages/SvelteExample.abc123.js\" → \"SvelteExample\"\n */\nexport const derivePageName = (pagePath: string) => {\n\tconst base = basename(pagePath);\n\t// Strip hash and extension: \"SvelteExample.abc123.js\" → \"SvelteExample\"\n\tconst dotIndex = base.indexOf('.');\n\tconst name = dotIndex > 0 ? base.slice(0, dotIndex) : base;\n\n\treturn toPascal(name);\n};\n\nconst isDev = () => process.env.NODE_ENV === 'development';\n\nconst buildErrorProps = (error: unknown) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst stack = isDev() && error instanceof Error ? error.stack : undefined;\n\n\treturn { error: { message, stack } };\n};\n\nexport const renderConventionError = async (\n\tframework: keyof ConventionsMap,\n\tpageName: string,\n\terror: unknown\n) => {\n\tconst conventionPath = resolveErrorConventionPath(framework, pageName);\n\tif (!conventionPath) return null;\n\n\tconst errorProps = buildErrorProps(error);\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst firstKey = Object.keys(mod)[0];\n\t\t\tconst ErrorComponent = mod.default ?? (firstKey ? mod[firstKey] : undefined);\n\t\t\tconst element = createElement(ErrorComponent, errorProps);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst { head, body } = render(ErrorComponent, {\n\t\t\t\tprops: errorProps\n\t\t\t});\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst ErrorComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(ErrorComponent, errorProps)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\t// Vue SSR escapes quotes inside <component is=\"style\"> tags.\n\t\t\t// Extract style content, unescape it, and move to <head>.\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 500\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\t// Angular error pages are rendered as plain HTML templates\n\t\t\t// since the full Angular SSR pipeline is too heavy for error pages\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderError = mod.default ?? mod.renderError;\n\t\t\tif (typeof renderError === 'function') {\n\t\t\t\tconst html = renderError(errorProps);\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 500\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconst message =\n\t\t\trenderError instanceof Error ? renderError.message : '';\n\t\tif (\n\t\t\tmessage.includes('Cannot find module') ||\n\t\t\tmessage.includes('Cannot find package') ||\n\t\t\tmessage.includes('not found in module')\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Convention error page for ${framework} failed: missing framework package. ` +\n\t\t\t\t\t`Ensure the ${framework} runtime is installed (e.g. bun add ${framework === 'react' ? 'react react-dom' : framework}).`\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Failed to render ${framework} convention error page:`,\n\t\t\t\trenderError\n\t\t\t);\n\t\t}\n\t}\n\n\treturn null;\n};\n\nexport const renderConventionNotFound = async (\n\tframework: keyof ConventionsMap\n) => {\n\tconst conventionPath = resolveNotFoundConventionPath(framework);\n\tif (!conventionPath) return null;\n\n\ttry {\n\t\tif (framework === 'react') {\n\t\t\tconst { createElement } = await import('react');\n\t\t\tconst { renderToReadableStream } = await import(\n\t\t\t\t'react-dom/server'\n\t\t\t);\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst nfKey = Object.keys(mod)[0];\n\t\t\tconst NotFoundComponent =\n\t\t\t\tmod.default ?? (nfKey ? mod[nfKey] : undefined);\n\t\t\tconst element = createElement(NotFoundComponent);\n\t\t\tconst stream = await renderToReadableStream(element);\n\n\t\t\treturn new Response(stream, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'svelte') {\n\t\t\tconst { render } = await import('svelte/server');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst { head, body } = render(NotFoundComponent);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${head}</head><body>${body}</body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'vue') {\n\t\t\tconst { createSSRApp, h } = await import('vue');\n\t\t\tconst { renderToString } = await import('vue/server-renderer');\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst NotFoundComponent = mod.default;\n\t\t\tconst app = createSSRApp({\n\t\t\t\trender: () => h(NotFoundComponent)\n\t\t\t});\n\t\t\tlet body = await renderToString(app);\n\n\t\t\tlet styles = '';\n\t\t\tbody = body.replace(\n\t\t\t\t/<style>([\\s\\S]*?)<\\/style>/g,\n\t\t\t\t(_, css: string) => {\n\t\t\t\t\tstyles += `<style>${css.replace(/"/g, '\"').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')}</style>`;\n\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst html = `<!DOCTYPE html><html><head>${styles}</head><body><div id=\"root\">${body}</div></body></html>`;\n\n\t\t\treturn new Response(html, {\n\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\tstatus: 404\n\t\t\t});\n\t\t}\n\n\t\tif (framework === 'angular') {\n\t\t\tconst mod = await import(conventionPath);\n\t\t\tconst renderNotFound = mod.default ?? mod.renderNotFound;\n\t\t\tif (typeof renderNotFound === 'function') {\n\t\t\t\tconst html = renderNotFound();\n\n\t\t\t\treturn new Response(html, {\n\t\t\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\t\t\tstatus: 404\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (renderError) {\n\t\tconst message =\n\t\t\trenderError instanceof Error ? renderError.message : '';\n\t\tif (\n\t\t\tmessage.includes('Cannot find module') ||\n\t\t\tmessage.includes('Cannot find package') ||\n\t\t\tmessage.includes('not found in module')\n\t\t) {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Convention not-found page for ${framework} failed: missing framework package. ` +\n\t\t\t\t\t`Ensure the ${framework} runtime is installed (e.g. bun add ${framework === 'react' ? 'react react-dom' : framework}).`\n\t\t\t);\n\t\t} else {\n\t\t\tconsole.error(\n\t\t\t\t`[SSR] Failed to render ${framework} convention not-found page:`,\n\t\t\t\trenderError\n\t\t\t);\n\t\t}\n\t}\n\n\treturn null;\n};\n\nconst NOT_FOUND_PRIORITY: (keyof ConventionsMap)[] = [\n\t'react',\n\t'svelte',\n\t'vue',\n\t'angular'\n];\n\nexport const renderFirstNotFound = async () => {\n\tfor (const framework of NOT_FOUND_PRIORITY) {\n\t\tif (!getMap()[framework]?.defaults?.notFound) continue;\n\t\tconst response = await renderConventionNotFound(framework);\n\t\tif (response) return response;\n\t}\n\n\treturn null;\n};\n",
|
|
8
8
|
"import type { Component as VueComponent } from 'vue';\nimport { ssrErrorPage } from '../utils/ssrErrorPage';\nimport {\n\tderivePageName,\n\trenderConventionError\n} from '../utils/resolveConvention';\n\nlet ssrDirty = false;\n\nconst buildDirtyResponse = (\n\theadTag: string,\n\tindexPath: string,\n\tmaybeProps: Record<string, unknown> | undefined\n) => {\n\tconst propsScript = `window.__INITIAL_PROPS__=${JSON.stringify(maybeProps ?? {})};`;\n\tconst dirtyFlag = 'window.__SSR_DIRTY__=true;';\n\tconst html =\n\t\t`<!DOCTYPE html><html>${headTag}<body><div id=\"root\"></div>` +\n\t\t`<script>${propsScript}${dirtyFlag}</script>` +\n\t\t`<script type=\"module\" src=\"${indexPath}\"></script>` +\n\t\t`</body></html>`;\n\n\treturn new Response(html, {\n\t\theaders: { 'Content-Type': 'text/html' }\n\t});\n};\n\nexport const handleVuePageRequest = async <\n\tProps extends Record<string, unknown> = Record<never, never>\n>(\n\t_PageComponent: VueComponent<Props>,\n\tpagePath: string,\n\tindexPath: string,\n\theadTag: `<head>${string}</head>` = '<head></head>',\n\t...props: keyof Props extends never ? [] : [props: NoInfer<Props>]\n) => {\n\tconst [maybeProps] = props;\n\n\tif (ssrDirty) {\n\t\treturn buildDirtyResponse(headTag, indexPath, maybeProps);\n\t}\n\n\ttry {\n\t\tconst { default: ImportedPageComponent } = await import(pagePath);\n\t\tconst { createSSRApp, h } = await import('vue');\n\t\tconst { renderToWebStream } = await import('vue/server-renderer');\n\n\t\tconst app = createSSRApp({\n\t\t\trender: () => h(ImportedPageComponent, maybeProps ?? null)\n\t\t});\n\n\t\tconst bodyStream = renderToWebStream(app);\n\n\t\tconst head = `<!DOCTYPE html><html>${headTag}<body><div id=\"root\">`;\n\t\tconst tail = `</div><script>window.__INITIAL_PROPS__=${JSON.stringify(\n\t\t\tmaybeProps ?? {}\n\t\t)}</script><script type=\"module\" src=\"${indexPath}\"></script></body></html>`;\n\n\t\tconst stream = new ReadableStream({\n\t\t\tstart(controller) {\n\t\t\t\tcontroller.enqueue(head);\n\t\t\t\tconst reader = bodyStream.getReader();\n\t\t\t\tconst pumpLoop = () => {\n\t\t\t\t\treader\n\t\t\t\t\t\t.read()\n\t\t\t\t\t\t.then(({ done, value }) =>\n\t\t\t\t\t\t\tdone\n\t\t\t\t\t\t\t\t? (controller.enqueue(tail), controller.close())\n\t\t\t\t\t\t\t\t: (controller.enqueue(value), pumpLoop())\n\t\t\t\t\t\t)\n\t\t\t\t\t\t.catch((err) => controller.error(err));\n\t\t\t\t};\n\t\t\t\tpumpLoop();\n\t\t\t}\n\t\t});\n\n\t\treturn new Response(stream, {\n\t\t\theaders: { 'Content-Type': 'text/html' }\n\t\t});\n\t} catch (error) {\n\t\tconsole.error('[SSR] Vue render error:', error);\n\n\t\tconst pageName = derivePageName(pagePath);\n\t\tconst conventionResponse = await renderConventionError(\n\t\t\t'vue',\n\t\t\tpageName,\n\t\t\terror\n\t\t);\n\t\tif (conventionResponse) return conventionResponse;\n\n\t\treturn new Response(ssrErrorPage('vue', error), {\n\t\t\theaders: { 'Content-Type': 'text/html' },\n\t\t\tstatus: 500\n\t\t});\n\t}\n};\n\nexport const invalidateVueSsrCache = () => {\n\tssrDirty = true;\n};\n",
|
|
9
9
|
"export { handleVuePageRequest } from './pageHandler';\n"
|
|
10
10
|
],
|
|
11
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAa,eAAe,CAAC,WAAmB,UAAmB;AAAA,EAClE,MAAM,kBAA0C;AAAA,IAC/C,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,KAAK;AAAA,EACN;AAAA,EAEA,MAAM,SAAS,gBAAgB,cAAc;AAAA,EAC7C,MAAM,QAAQ,UAAU,OAAO,CAAC,EAAE,YAAY,IAAI,UAAU,MAAM,CAAC;AAAA,EACnE,MAAM,UAAU,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;AAAA,EAErE,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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