reroute-js 1.0.0-alpha.21 → 1.0.0-alpha.22
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/README.md +1 -0
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +631 -238
- package/cli/bin.js.map +13 -10
- package/cli/index.d.ts +1 -1
- package/cli/index.js +14 -7
- package/cli/index.js.map +5 -5
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/build.d.ts.map +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/dev.d.ts.map +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/gen.d.ts.map +1 -1
- package/cli/src/commands/index.d.ts +1 -1
- package/cli/src/commands/init.d.ts +1 -1
- package/cli/src/commands/lib/assets.d.ts +1 -1
- package/cli/src/commands/lib/bundler.d.ts +1 -1
- package/cli/src/commands/lib/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/images.d.ts +12 -0
- package/cli/src/commands/lib/images.d.ts.map +1 -0
- package/cli/src/commands/lib/index.d.ts +1 -1
- package/cli/src/commands/lib/log.d.ts +1 -1
- package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
- package/cli/src/commands/lib/markdown/index.d.ts +1 -1
- package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +3 -3
- package/cli/src/commands/lib/production.d.ts.map +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/theme.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/lib/watch.d.ts +1 -1
- package/cli/src/commands/og.d.ts +1 -1
- package/cli/src/commands/start.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +61 -2
- package/core/index.js.map +6 -5
- package/core/src/app-paths.d.ts +1 -1
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +41 -2
- package/core/src/config.d.ts.map +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/i18n/catalog.d.ts +1 -1
- package/core/src/i18n/discover.d.ts +1 -1
- package/core/src/i18n/index.d.ts +1 -1
- package/core/src/i18n/messages.d.ts +1 -1
- package/core/src/i18n/negotiate.d.ts +1 -1
- package/core/src/i18n/pathname.d.ts +1 -1
- package/core/src/i18n/resolve.d.ts +1 -1
- package/core/src/i18n/types.d.ts +1 -1
- package/core/src/image.d.ts +29 -0
- package/core/src/image.d.ts.map +1 -0
- package/core/src/index.d.ts +2 -1
- package/core/src/index.d.ts.map +1 -1
- package/core/src/llms/discovery.d.ts +1 -1
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index.d.ts +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/index.d.ts +1 -1
- package/core/src/robots/policies.d.ts +1 -1
- package/core/src/rss/discovery.d.ts +1 -1
- package/core/src/rss/generator.d.ts +1 -1
- package/core/src/rss/index.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts +1 -1
- package/core/src/sitemap/generator.d.ts +1 -1
- package/core/src/sitemap/index.d.ts +1 -1
- package/core/src/ssr/index.d.ts +1 -1
- package/core/src/ssr/lib/cache.d.ts +1 -1
- package/core/src/ssr/lib/cleanup.d.ts +1 -1
- package/core/src/ssr/lib/collections.d.ts +1 -1
- package/core/src/ssr/lib/compression.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts +1 -1
- package/core/src/ssr/lib/compute/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/content-path.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts +1 -1
- package/core/src/ssr/lib/html.d.ts +1 -1
- package/core/src/ssr/lib/imports.d.ts +1 -1
- package/core/src/ssr/lib/index.d.ts +1 -1
- package/core/src/ssr/lib/layouts.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts +1 -1
- package/core/src/ssr/lib/mime.d.ts +1 -1
- package/core/src/ssr/lib/modules.d.ts +1 -1
- package/core/src/ssr/lib/path.d.ts +1 -1
- package/core/src/ssr/lib/preload.d.ts +1 -1
- package/core/src/ssr/lib/route-match.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +1 -1
- package/core/src/ssr/lib/styles.d.ts +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +295 -135
- package/elysia/index.js.map +7 -6
- package/elysia/src/index.d.ts +2 -1
- package/elysia/src/index.d.ts.map +1 -1
- package/elysia/src/libs/assets.d.ts +1 -1
- package/elysia/src/libs/cache.d.ts +1 -1
- package/elysia/src/libs/caching.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/i18n.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +30 -1
- package/elysia/src/libs/image.d.ts.map +1 -1
- package/elysia/src/libs/index.d.ts +2 -2
- package/elysia/src/libs/index.d.ts.map +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +1 -1
- package/elysia/src/routes/liveReloadClient.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/routes/themeCssRefresh.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +29 -5
- package/react/index.js.map +3 -3
- package/react/src/components/ClientOnly.d.ts +1 -1
- package/react/src/components/ContentRoute.d.ts +1 -1
- package/react/src/components/Image.d.ts +5 -1
- package/react/src/components/Image.d.ts.map +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/i18n/LocaleProvider.d.ts +1 -1
- package/react/src/i18n/helpers.d.ts +1 -1
- package/react/src/i18n/index.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/bundle.d.ts +1 -1
- package/react/src/lib/collection.d.ts +1 -1
- package/react/src/lib/content.d.ts +1 -1
- package/react/src/lib/head.d.ts +1 -1
- package/react/src/lib/index.d.ts +1 -1
- package/react/src/lib/lazy-route.d.ts +1 -1
- package/react/src/lib/route-loader.d.ts +1 -1
- package/react/src/providers/ContentProvider.d.ts +1 -1
- package/react/src/providers/RerouteProvider.d.ts +1 -1
- package/react/src/providers/RouterProvider.d.ts +1 -1
- package/react/src/providers/index.d.ts +1 -1
- package/react/src/types/any.d.ts +1 -1
- package/react/src/types/index.d.ts +1 -1
- package/react/src/types/router.d.ts +1 -1
- package/telemetry/react.d.ts +1 -1
- package/telemetry/react.js +2 -2
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +6 -2
- package/telemetry/server.js.map +4 -4
- package/telemetry/src/react/api.d.ts +1 -1
- package/telemetry/src/react/context.d.ts +1 -1
- package/telemetry/src/react/index.d.ts +1 -1
- package/telemetry/src/react/telemetry.d.ts +1 -1
- package/telemetry/src/server/context.d.ts +1 -1
- package/telemetry/src/server/headers/extractor.d.ts +1 -1
- package/telemetry/src/server/headers/index.d.ts +1 -1
- package/telemetry/src/server/headers/presets.d.ts +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
package/cli/index.d.ts
CHANGED
package/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v1.0.0-alpha.
|
|
2
|
+
* reroute-js v1.0.0-alpha.22
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -104,6 +104,9 @@ var init_i18n = __esm(() => {
|
|
|
104
104
|
init_resolve();
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
+
// packages/core/src/image.ts
|
|
108
|
+
var init_image = () => {};
|
|
109
|
+
|
|
107
110
|
// packages/telemetry/src/server/context.ts
|
|
108
111
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
109
112
|
var contextStorage;
|
|
@@ -554,6 +557,7 @@ var init_src = __esm(() => {
|
|
|
554
557
|
init_config();
|
|
555
558
|
init_content();
|
|
556
559
|
init_i18n();
|
|
560
|
+
init_image();
|
|
557
561
|
init_llms();
|
|
558
562
|
init_og();
|
|
559
563
|
init_robots();
|
|
@@ -1116,17 +1120,20 @@ function stripMarkdown(content) {
|
|
|
1116
1120
|
return text;
|
|
1117
1121
|
}
|
|
1118
1122
|
// packages/cli/src/commands/lib/production.ts
|
|
1123
|
+
function hasProdFlag(args = []) {
|
|
1124
|
+
return args.includes("--prod") || args.includes("--production");
|
|
1125
|
+
}
|
|
1119
1126
|
function isProductionMode(args = []) {
|
|
1120
|
-
return args
|
|
1127
|
+
return hasProdFlag(args);
|
|
1121
1128
|
}
|
|
1122
1129
|
function ensureProductionEnv(args = []) {
|
|
1123
|
-
if (args
|
|
1130
|
+
if (hasProdFlag(args)) {
|
|
1124
1131
|
process.env.NODE_ENV = "production";
|
|
1125
1132
|
Bun.env.NODE_ENV = "production";
|
|
1126
1133
|
}
|
|
1127
1134
|
}
|
|
1128
1135
|
function filterProdFlag(args) {
|
|
1129
|
-
return args.filter((arg) => arg !== "--prod");
|
|
1136
|
+
return args.filter((arg) => arg !== "--prod" && arg !== "--production");
|
|
1130
1137
|
}
|
|
1131
1138
|
// packages/cli/src/commands/lib/server.ts
|
|
1132
1139
|
async function isServerRunning(port, timeout = 1000) {
|
|
@@ -1258,7 +1265,7 @@ async function getVersionString() {
|
|
|
1258
1265
|
}
|
|
1259
1266
|
async function getVersion() {
|
|
1260
1267
|
if (true) {
|
|
1261
|
-
return "1.0.0-alpha.
|
|
1268
|
+
return "1.0.0-alpha.22";
|
|
1262
1269
|
}
|
|
1263
1270
|
const possiblePaths = [
|
|
1264
1271
|
path2.join(import.meta.dir, "../../../../package.json"),
|
|
@@ -1276,7 +1283,7 @@ async function getVersion() {
|
|
|
1276
1283
|
}
|
|
1277
1284
|
async function getCommit() {
|
|
1278
1285
|
if (true) {
|
|
1279
|
-
return "
|
|
1286
|
+
return "53ae62b";
|
|
1280
1287
|
}
|
|
1281
1288
|
return "dev";
|
|
1282
1289
|
}
|
|
@@ -1306,4 +1313,4 @@ export {
|
|
|
1306
1313
|
waitForServerReady
|
|
1307
1314
|
};
|
|
1308
1315
|
|
|
1309
|
-
//# debugId=
|
|
1316
|
+
//# debugId=4254BC224E45447764756E2164756E21
|
package/cli/index.js.map
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"sources": ["../../packages/core/src/app-paths.ts", "../../packages/core/src/config.ts", "../../packages/core/src/content/index.ts", "../../packages/core/src/i18n/messages.ts", "../../packages/core/src/i18n/resolve.ts", "../../packages/core/src/i18n/index.ts", "../../packages/telemetry/src/server/context.ts", "../../packages/telemetry/src/server/headers/index.ts", "../../packages/telemetry/src/server/instrumentation.ts", "../../packages/telemetry/src/server/sourcemap.ts", "../../packages/telemetry/src/server/plugin.ts", "../../packages/telemetry/src/server/index.ts", "../../packages/telemetry/server.ts", "../../packages/core/src/ssr/lib/cache.ts", "../../packages/core/src/ssr/lib/imports.ts", "../../packages/core/src/ssr/lib/collections.ts", "../../packages/core/src/ssr/lib/content-path.ts", "../../packages/core/src/ssr/lib/compute/content.ts", "../../packages/core/src/ssr/lib/compute/layouts.ts", "../../packages/core/src/ssr/lib/compute/routes.ts", "../../packages/core/src/ssr/lib/compute/index.ts", "../../packages/core/src/ssr/lib/modules.ts", "../../packages/core/src/ssr/lib/seed.ts", "../../packages/core/src/ssr/lib/data.ts", "../../packages/core/src/og/meta.ts", "../../packages/core/src/ssr/lib/metadata.ts", "../../packages/core/src/ssr/lib/preload.ts", "../../packages/core/src/ssr/lib/scripts/data.ts", "../../packages/core/src/ssr/lib/scripts/index.ts", "../../packages/core/src/ssr/lib/setup.ts", "../../packages/core/src/ssr/lib/index.ts", "../../packages/core/src/ssr/render.ts", "../../packages/core/src/llms/extractor.ts", "../../packages/core/src/llms/discovery.ts", "../../packages/core/src/llms/full-generator.ts", "../../packages/core/src/llms/index-generator.ts", "../../packages/core/src/llms/index.ts", "../../packages/core/src/og/render.ts", "../../packages/core/src/og/index.ts", "../../packages/core/src/robots/generator.ts", "../../packages/core/src/robots/index.ts", "../../packages/core/src/rss/discovery.ts", "../../packages/core/src/rss/index.ts", "../../packages/core/src/sitemap/index.ts", "../../packages/core/src/ssr/stream.ts", "../../packages/core/src/ssr/index.ts", "../../packages/core/src/index.ts", "../../packages/core/index.ts", "../../packages/cli/src/commands/lib/command.ts", "../../packages/cli/src/commands/lib/log.ts", "../../packages/cli/src/commands/lib/markdown/availability.ts", "../../packages/cli/src/commands/lib/markdown/processor.ts", "../../packages/cli/src/commands/lib/production.ts", "../../packages/cli/src/commands/lib/server.ts", "../../packages/cli/src/commands/lib/theme.ts", "../../packages/cli/src/commands/lib/version.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { posix } from 'node:path';\nimport type { RerouteConfig } from './config';\n\nconst DEFAULT_APP_SRC = './src/client/App';\nconst DEFAULT_APP_SERVER = './src/index.ts';\n\ntype AppPaths = {\n\t/** App component, e.g. `./src/client/App` */\n\tsrc: string;\n\t/** Directory containing App, routes, index.css, and assets */\n\tclientDir: string;\n\troutesDir: string;\n\tcssEntry: string;\n\tassetsDir: string;\n\t/** Server entry, e.g. `./src/index.ts` */\n\tserver: string;\n};\n\nfunction toPosix(p: string): string {\n\treturn p.replace(/\\\\/g, '/');\n}\n\n/**\n * Resolve client/server roots from `app.src` and `app.server`.\n * Client dir is the parent of the App component.\n */\nfunction resolveAppPaths(config: RerouteConfig = {}): AppPaths {\n\tconst src = config.app?.src ?? DEFAULT_APP_SRC;\n\tconst server = config.app?.server ?? DEFAULT_APP_SERVER;\n\tconst clientDir = toPosix(posix.dirname(src));\n\n\treturn {\n\t\tsrc,\n\t\tclientDir,\n\t\troutesDir: toPosix(posix.join(clientDir, 'routes')),\n\t\tcssEntry: toPosix(posix.join(clientDir, 'index.css')),\n\t\tassetsDir: toPosix(posix.join(clientDir, 'assets')),\n\t\tserver,\n\t};\n}\n\n/** Import specifier from a `.reroute/*.ts` file to a project-relative path. */\nfunction importFromReroute(relPath: string): string {\n\tconst cleaned = toPosix(relPath)\n\t\t.replace(/^\\.\\//, '')\n\t\t.replace(/\\.(tsx|ts|jsx|js)$/, '');\n\treturn `../${cleaned}`;\n}\n\nexport {\n\tDEFAULT_APP_SERVER,\n\tDEFAULT_APP_SRC,\n\timportFromReroute,\n\tresolveAppPaths,\n\ttype AppPaths,\n};\n",
|
|
6
|
-
"import { pathToFileURL } from 'node:url';\nimport type { ComponentType } from 'react';\nimport type { I18nOptions } from './i18n/types';\n\n// biome-ignore lint/suspicious/noExplicitAny: The user document\ntype Doc = any;\ninterface StreamingOptions {\n\tenabled?: boolean;\n\tdefaultSkeleton?: ComponentType | string;\n\tdefaultLayoutSkeleton?: ComponentType | string;\n\ttimeout?: number;\n}\n\ninterface StaticOptions {\n\t/**\n\t * Patterns to ignore when serving static files\n\t * @default ['.DS_Store', '.git', '.env']\n\t */\n\tignorePatterns?: (string | RegExp)[];\n\t/**\n\t * Custom headers to add to static file responses\n\t */\n\theaders?: Record<string, string>;\n\t/**\n\t * Cache duration in seconds for static assets\n\t * @default 3600 (1 hour)\n\t */\n\tmaxAge?: number;\n\t/**\n\t * Cache-Control directive\n\t * @default 'public'\n\t */\n\tdirective?: string;\n}\n\ninterface ImageOptions {\n\t/**\n\t * Cache duration in seconds for optimized images\n\t * @default 31536000 (1 year)\n\t */\n\tmaxAge?: number;\n\t/**\n\t * Allowed external domains for image optimization\n\t * @default []\n\t */\n\tallowedDomains?: string[];\n\t/**\n\t * Maximum image width in pixels\n\t * @default 3840\n\t */\n\tmaxWidth?: number;\n\t/**\n\t * Maximum image height in pixels\n\t * @default 2160\n\t */\n\tmaxHeight?: number;\n}\n\n/**\n * Sitemap configuration options\n */\ninterface SitemapOptions {\n\t/** Enable sitemap generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for sitemap generation (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/**\n\t * Maximum URLs per sitemap file before pagination (default: 50000)\n\t * When exceeded, creates multiple sitemap files with a sitemap index\n\t * Set lower for testing (e.g., 10) to verify pagination works\n\t */\n\tmaxUrlsPerPage?: number;\n\n\t/**\n\t * Completely exclude specific routes from the sitemap\n\t * Routes listed here will not appear in the sitemap at all\n\t * @example ['/admin', '/api']\n\t */\n\texcludeRoutes?: string[];\n\n\t/**\n\t * Exclude specific routes from SSR data array discovery\n\t * Routes listed here will still appear in the sitemap as single entries,\n\t * but won't generate multiple URLs from arrays found in their SSR data\n\t * @example ['/download', '/pricing'] - these routes appear once, not per array item\n\t */\n\texcludeDiscovery?: string[];\n\n\t/**\n\t * Extract urls from ssr.data result (full control over data shape)\n\t * If provided, this takes precedence over automatic array discovery\n\t * @param data - Full ssr.data result\n\t * @param routePattern - The route pattern (e.g., '/changelog')\n\t * @returns Array of items to process, or null/undefined to skip this route\n\t */\n\textractUrls?: (data: Doc, routePattern: string) => Doc[] | null | undefined;\n\n\t/**\n\t * Extract URL segment from ssr.data items\n\t * @param item - Data item from ssr.data result\n\t * @param routePattern - The route pattern (e.g., '/changelog')\n\t * @returns URL segment to append to routePattern (e.g., '0.1.0' -> '/changelog/0.1.0'),\n\t * null/undefined to use default extraction, or false to skip this item entirely\n\t */\n\textractUrl?: (\n\t\titem: Doc,\n\t\troutePattern: string,\n\t) => string | null | undefined | false;\n\n\t/**\n\t * Extract lastmod date from ssr.data items\n\t * @param item - Data item from ssr.data result\n\t * @returns ISO date string or undefined\n\t */\n\textractLastmod?: (item: Doc) => string | undefined;\n\n\t/** Default changefreq for URLs */\n\tchangefreq?:\n\t\t| 'always'\n\t\t| 'hourly'\n\t\t| 'daily'\n\t\t| 'weekly'\n\t\t| 'monthly'\n\t\t| 'yearly'\n\t\t| 'never';\n\n\t/** Default priority for URLs */\n\tpriority?: number;\n}\n\n/**\n * RSS feed configuration options\n */\ninterface RSSOptions {\n\t/** Enable RSS feed generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for RSS feeds (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/** Feed title (e.g., 'My Blog') */\n\ttitle?: string;\n\n\t/** Feed description */\n\tdescription?: string;\n\n\t/** Maximum number of items per feed (default: 50) */\n\tlimit?: number;\n\n\t/** Feed format: 'rss' or 'atom' (default: 'rss') */\n\tformat?: 'rss' | 'atom';\n\n\t/**\n\t * Completely exclude specific routes from the RSS feed\n\t * Routes listed here will not appear in the feed at all\n\t * @example ['/admin', '/api']\n\t */\n\texcludeRoutes?: string[];\n\n\t/**\n\t * Exclude specific routes from SSR data array discovery\n\t * Routes listed here won't generate multiple feed items from arrays in their SSR data,\n\t * but may still generate a single feed item if appropriate\n\t * @example ['/download', '/pricing'] - won't generate items per array entry\n\t */\n\texcludeDiscovery?: string[];\n\n\t/**\n\t * Extract items from ssr.data result (full control over data shape)\n\t * If provided, this takes precedence over automatic array discovery\n\t * @param data - Full ssr.data result\n\t * @param routePattern - The route pattern (e.g., '/changelog')\n\t * @returns Array of items to process, or null/undefined to skip this route\n\t */\n\textractUrls?: (data: Doc, routePattern: string) => Doc[] | null | undefined;\n\n\t/**\n\t * Extract URL segment from ssr.data items (same as sitemap)\n\t * @returns URL segment, null/undefined for default extraction, or false to skip item\n\t */\n\textractUrl?: (\n\t\titem: Doc,\n\t\troutePattern: string,\n\t) => string | null | undefined | false;\n\n\t/**\n\t * Extract publication date from items\n\t */\n\textractPubDate?: (item: Doc) => string | undefined;\n\n\t/**\n\t * Extract author from items\n\t */\n\textractAuthor?: (item: Doc) => string | undefined;\n\n\t/**\n\t * Extract content/body from items\n\t */\n\textractContent?: (item: Doc) => string | undefined;\n\n\t/**\n\t * Extract description/summary from items\n\t * Falls back to item.description or item.excerpt if not provided\n\t */\n\textractDescription?: (item: Doc) => string | undefined;\n}\n\n/**\n * Markdown configuration options\n */\ninterface MarkdownOptions {\n\t/**\n\t * Custom components to use when rendering markdown\n\t * Path to a module that exports a components object compatible with Streamdown\n\t * @example './src/client/lib/markdown-components'\n\t */\n\tcomponents?: string;\n\n\t/** Enable GitHub Flavored Markdown (default: true if remark-gfm is installed) */\n\tenableGfm?: boolean;\n\n\t/** Shiki theme for syntax highlighting (default: 'github-dark') */\n\ttheme?: string;\n}\n\n/**\n * Search index configuration options\n */\ninterface SearchOptions {\n\t/** Enable search index generation (default: false) */\n\tenabled?: boolean;\n\n\t/**\n\t * Collections to include in search index\n\t * @default [] - all collections will be indexed\n\t * @example ['blog', 'docs']\n\t */\n\tcollections?: string[];\n\n\t/**\n\t * Include full content text in search (increases index size significantly)\n\t * @default false - only index headings and metadata\n\t */\n\tincludeContent?: boolean;\n\n\t/**\n\t * Maximum content length to index per item (characters)\n\t * @default 5000 - prevents huge content from bloating index\n\t */\n\tcontentLimit?: number;\n\n\t/**\n\t * Fields to index from frontmatter metadata\n\t * @default ['title', 'description', 'excerpt', 'tags']\n\t */\n\tmetaFields?: string[];\n\n\t/**\n\t * Minimum heading level to index (1-6)\n\t * @default 1 - index all headings\n\t */\n\tminHeadingLevel?: number;\n\n\t/**\n\t * Maximum heading level to index (1-6)\n\t * @default 6 - index all headings\n\t */\n\tmaxHeadingLevel?: number;\n\n\t/**\n\t * Default page size for paginated results\n\t * @default 20\n\t */\n\tdefaultPageSize?: number;\n\n\t/**\n\t * Maximum allowed page size (prevents excessive results)\n\t * @default 100\n\t */\n\tmaxPageSize?: number;\n}\n\ninterface OGImageFont {\n\t/** Font family name (e.g., 'Inter') */\n\tname: string;\n\t/** Path to font file (TTF, OTF, or WOFF) relative to project root */\n\tpath: string;\n\t/** Font weight (e.g., 400, 700, 900) */\n\tweight?: number;\n\t/** Font style (default: 'normal') */\n\tstyle?:\n\t\t| 'normal'\n\t\t| 'italic'\n\t\t| 'bold'\n\t\t| 'bold-italic'\n\t\t| 'medium'\n\t\t| 'medium-italic'\n\t\t| 'semibold'\n\t\t| 'semibold-italic'\n\t\t| 'light'\n\t\t| 'light-italic'\n\t\t| 'thin'\n\t\t| 'thin-italic'\n\t\t| 'black'\n\t\t| 'black-italic'\n\t\t| 'extra-bold'\n\t\t| 'extra-bold-italic'\n\t\t| 'extra-light'\n\t\t| 'extra-light-italic'\n\t\t| 'extra-medium'\n\t\t| 'extra-medium-italic'\n\t\t| 'extra-semibold'\n\t\t| 'extra-semibold-italic'\n\t\t| 'extra-light'\n\t\t| 'extra-light-italic'\n\t\t| 'extra-medium'\n\t\t| 'extra-medium-italic'\n\t\t| 'extra-semibold'\n\t\t| 'extra-semibold-italic';\n\tdata?: ArrayBuffer | undefined;\n}\n\n/**\n * Open Graph and social meta tags configuration\n */\ninterface OGOptions {\n\t/**\n\t * Site name used for og:site_name meta tag\n\t * This appears as the website name in social media shares\n\t * @example 'My Awesome Site'\n\t */\n\tsiteName?: string;\n\n\t/**\n\t * Default site description used as fallback for og:description\n\t * when a page doesn't define its own description\n\t * @example 'A modern web application built with Reroute'\n\t */\n\tsiteDescription?: string;\n\n\t/**\n\t * Default Open Graph type for pages without explicit og:type\n\t * Common types: 'website', 'article', 'product', 'profile'\n\t * @default 'website'\n\t * @see https://ogp.me/#types\n\t */\n\tdefaultType?: string;\n\n\t/**\n\t * Twitter/X handle for twitter:site meta tag (with or without @)\n\t * @example '@mysite' or 'mysite'\n\t */\n\ttwitterSite?: string;\n\n\t/**\n\t * Twitter/X card type (default: 'summary_large_image')\n\t * @default 'summary_large_image'\n\t */\n\ttwitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';\n\n\t/**\n\t * Default locale for og:locale meta tag\n\t * @example 'en_US', 'en_GB', 'es_ES'\n\t */\n\tlocale?: string;\n}\n\n/**\n * OG Image generation configuration options\n */\ninterface OGImageOptions {\n\t/** Enable OG image generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for absolute OG image URLs (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/** Path to default template component or 'default' for built-in template */\n\tdefaultTemplate?: string;\n\n\t/** Image width in pixels (default: 1200) */\n\twidth?: number;\n\n\t/** Image height in pixels (default: 630) */\n\theight?: number;\n\n\t/** Cache duration in seconds (default: 3600 = 1 hour) */\n\tmaxAge?: number;\n\n\t/** Default avatar/logo URL (can be external or local path) */\n\tavatar?: string;\n\n\t/** Site name to display */\n\tsiteName?: string;\n\n\t/** Custom fonts to load for OG images */\n\tfonts?: OGImageFont[];\n}\n\n/**\n * Preferences for how fetched content may be used (Content Signals).\n * Omitted keys default to yes.\n */\ninterface ContentSignalPolicy {\n\t/** Use in search results */\n\tsearch?: boolean;\n\n\t/** Use as live context for an AI answer */\n\taiInput?: boolean;\n\n\t/** Use to train or fine-tune a model */\n\taiTrain?: boolean;\n}\n\n/**\n * LLMs content configuration options\n */\ninterface LLMsOptions {\n\t/** Enable LLM content features (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for absolute URLs in llms.txt index (e.g., 'https://example.com') */\n\tbaseUrl?: string;\n\n\t/** Enable .txt extension for routes (default: true when enabled) */\n\tenableTextExtension?: boolean;\n\n\t/** Enable .md extension for routes (default: true when enabled) */\n\tenableMarkdownExtension?: boolean;\n\n\t/** Enable Accept header content negotiation (default: true when enabled) */\n\tenableContentNegotiation?: boolean;\n\n\t/** Enable /llms.txt index generation (default: true when enabled) */\n\tenableIndex?: boolean;\n\n\t/** Enable /llms-full.txt generation (default: true when enabled) */\n\tenableFullContent?: boolean;\n\n\t/**\n\t * Content-Signal header on HTML and markdown/text responses.\n\t * Default when enabled: `ai-train=yes, search=yes, ai-input=yes`.\n\t * Set `false` to omit the header.\n\t */\n\tcontentSignal?: ContentSignalPolicy | false;\n\n\t/** Cache duration in seconds for LLM content (default: 86400 = 24 hours, or falls back to options.maxAge) */\n\tmaxAge?: number;\n\n\t/** Cache duration in seconds for llms-full.txt specifically (default: 604800 = 7 days, or falls back to llms.maxAge) */\n\tmaxAgeFull?: number;\n\n\t/** Maximum items in full content bundle (default: 10000) */\n\tmaxItems?: number;\n\n\t/** Maximum file size for full content in bytes (default: 50MB) */\n\tmaxSize?: number;\n\n\t/**\n\t * Exclude specific routes from LLM features\n\t * Supports strings (exact match or substring), RegExp, or custom functions\n\t * @example ['/admin', '/api', /^\\/private/, (path) => path.includes('draft')]\n\t */\n\texcludeRoutes?: (string | RegExp | ((pathname: string) => boolean))[];\n\n\t/**\n\t * Exclude collections from LLM features\n\t * @example ['drafts', 'private']\n\t */\n\texcludeCollections?: string[];\n\n\t/** Site name for index header */\n\tsiteName?: string;\n\n\t/** Site description for index header (brief context for LLMs) */\n\tsiteDescription?: string;\n\n\t/**\n\t * Include each page's description next to the index link\n\t * (`- [Title](url.txt): description`). Default: true.\n\t * Set false for compact title+link only.\n\t */\n\tindexSummaries?: boolean;\n\n\t/**\n\t * Per-collection customization for titles and descriptions\n\t * @example\n\t * ```ts\n\t * collections: {\n\t * blog: {\n\t * title: 'My Awesome Blog',\n\t * description: 'Insights and tutorials about web development'\n\t * },\n\t * docs: {\n\t * title: 'Documentation',\n\t * description: 'Complete API reference and guides'\n\t * }\n\t * }\n\t * ```\n\t */\n\tcollections?: Record<\n\t\tstring,\n\t\t{\n\t\t\t/** Custom title for this collection's LLMS index */\n\t\t\ttitle?: string;\n\t\t\t/** Custom description for this collection's LLMS index */\n\t\t\tdescription?: string;\n\t\t}\n\t>;\n}\n\n/**\n * Robots policy for specific user-agents\n */\ninterface RobotsPolicy {\n\t/** User-Agent (e.g., '*', 'Googlebot', 'GPTBot') */\n\tuserAgent: string;\n\n\t/** Paths to explicitly allow */\n\tallow?: string[];\n\n\t/** Paths to disallow */\n\tdisallow?: string[];\n\n\t/** Crawl delay for this user-agent (seconds) */\n\tcrawlDelay?: number;\n}\n\n/**\n * Robots.txt generation configuration options\n */\ninterface RobotsOptions {\n\t/** Enable robots.txt generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for sitemap reference (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/** Cache duration in seconds (default: 86400 = 24 hours) */\n\tmaxAge?: number;\n\n\t/** Custom policies per user-agent (default: permissive) */\n\tpolicies?: RobotsPolicy[];\n\n\t/** Auto-reference sitemap.xml if sitemap is enabled (default: true) */\n\treferenceSitemap?: boolean;\n\n\t/** Auto-disallow routes excluded from sitemap (default: true) */\n\tsitemapExclusion?: boolean;\n\n\t/** Auto-disallow old redirect source paths (default: true) */\n\tredirectExclusion?: boolean;\n\n\t/**\n\t * Content-Signal line on the `User-agent: *` group.\n\t * When omitted, no line is written (the plugin copies `llms.contentSignal`\n\t * when both features are enabled).\n\t */\n\tcontentSignal?: ContentSignalPolicy | false;\n\n\t/** Additional raw text appended to robots.txt */\n\tcustomRules?: string;\n\n\t/** Global crawl delay in seconds (optional) */\n\tcrawlDelay?: number;\n}\n\n/**\n * Telemetry proxy configuration for forwarding browser telemetry\n */\ninterface TelemetryProxyOptions {\n\t/**\n\t * Enable browser telemetry proxy (default: true when proxy config exists)\n\t * Creates endpoints to forward browser traces/metrics/logs to OTLP backend\n\t * This avoids CORS issues and ad blockers\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Base path for proxy endpoints (default: '/__reroute_telemetry')\n\t * Creates:\n\t * - {pathname}/v1/traces\n\t * - {pathname}/v1/metrics\n\t * - {pathname}/v1/logs\n\t * - {pathname}/health\n\t */\n\tpathname?: string;\n\n\t/**\n\t * Enable verbose logging for proxy requests\n\t * @default false\n\t */\n\tverbose?: boolean;\n\n\t/**\n\t * Custom handler for proxy requests (advanced)\n\t * If provided, replaces default OTLP forwarding logic\n\t *\n\t * @example\n\t * ```ts\n\t * handler: async ({ body, endpoint, headers }) => {\n\t * // Custom logic: filter, transform, or route to different backends\n\t * await fetch(`https://custom-backend${endpoint}`, {\n\t * method: 'POST',\n\t * headers,\n\t * body: JSON.stringify(body),\n\t * });\n\t * return { status: 200 };\n\t * }\n\t * ```\n\t */\n\thandler?: (params: {\n\t\tbody: unknown;\n\t\tendpoint: string;\n\t\theaders: Record<string, string>;\n\t\totlpEndpoint: string;\n\t}) => Promise<{ status: number }>;\n}\n\n/**\n * Browser telemetry configuration options\n */\ninterface BrowserTelemetryOptions {\n\t/**\n\t * Enable browser telemetry\n\t * @default true\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Service name for browser telemetry\n\t * @default 'reroute-app-browser'\n\t */\n\tserviceName?: string;\n\n\t/**\n\t * Service version\n\t * @default '1.0.0'\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL (use relative URL for same-origin proxy)\n\t * @default '/__reroute_telemetry'\n\t */\n\totlpEndpoint?: string;\n\n\t/**\n\t * API key for authentication (optional)\n\t */\n\tapiKey?: string;\n\n\t/**\n\t * Deployment environment (e.g., 'production', 'staging', 'development')\n\t * @default 'development'\n\t */\n\tenvironment?: string;\n\n\t/**\n\t * Enable console.error capture\n\t * @default true\n\t */\n\tenableConsoleCapture?: boolean;\n\n\t/**\n\t * Ignore specific routes/URLs from breadcrumbs and network tracking\n\t *\n\t * Note: Functions are NOT supported for browser telemetry (closures cannot be serialized)\n\t * Use strings or regex patterns instead\n\t *\n\t * @example\n\t * ```ts\n\t * ignoreRoutes: [\n\t * '/bundles/', // String prefix match\n\t * /\\.(js|css|png)$/, // Regex pattern\n\t * /^\\/assets\\//, // Regex for path prefix\n\t * ]\n\t * ```\n\t */\n\tignoreRoutes?: Array<string | RegExp>;\n}\n\n/**\n * Telemetry configuration options for OpenTelemetry integration\n */\ninterface TelemetryOptions {\n\t/**\n\t * Enable server telemetry collection (default: false)\n\t * Must be explicitly enabled to start collecting traces, metrics, and logs\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Browser telemetry configuration\n\t * Configure browser-side telemetry separately from server\n\t */\n\tbrowser?: BrowserTelemetryOptions;\n\n\t/**\n\t * Service name for server telemetry\n\t * @default 'reroute-app'\n\t */\n\tserviceName?: string;\n\n\t/**\n\t * Service version\n\t * @default process.env.npm_package_version || '1.0.0'\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL\n\t * @default process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318'\n\t */\n\totlpEndpoint?: string;\n\n\t/**\n\t * API key for authentication (optional, only needed for SigNoz Cloud)\n\t */\n\tapiKey?: string;\n\n\t/**\n\t * Deployment environment (e.g., 'production', 'staging', 'development')\n\t * Used as a deployment.environment attribute on all telemetry\n\t * @default process.env.NODE_ENV || 'development'\n\t */\n\tenvironment?: string;\n\n\t/**\n\t * Metric export interval in milliseconds\n\t * @default 5000\n\t */\n\tmetricsInterval?: number;\n\n\t/**\n\t * Browser telemetry proxy configuration\n\t * When configured, creates endpoints to forward browser telemetry to OTLP backend\n\t * This avoids CORS issues and ad blockers\n\t */\n\tproxy?: TelemetryProxyOptions;\n\n\t/**\n\t * Ignore specific routes from telemetry collection\n\t * Supports flexible pattern matching:\n\t * - String: Matches if pathname contains the string (e.g., '/assets' matches '/assets/logo.png')\n\t * - RegExp: Tests pathname against regex (e.g., /\\.(js|css)$/ matches file extensions)\n\t * - Function: Custom logic with pathname and method (server-side only)\n\t *\n\t * Note: For browser telemetry, only strings and regex are supported (functions use closures that cannot be serialized)\n\t *\n\t * @example\n\t * ```ts\n\t * ignoreRoutes: [\n\t * '/health', // String match\n\t * /\\.(js|css|png|jpg|svg|ico|woff2?)$/, // Regex for static assets\n\t * (pathname) => pathname.startsWith('/assets/'), // Function (server-side only)\n\t * (pathname, method) => method === 'OPTIONS', // Access to HTTP method (server-side only)\n\t * ]\n\t * ```\n\t */\n\tignoreRoutes?: (\n\t\t| string\n\t\t| RegExp\n\t\t| ((pathname: string, method: string) => boolean)\n\t)[];\n\n\t/**\n\t * Enable distributed tracing (default: true)\n\t * Captures request flows across services with OpenTelemetry traces\n\t */\n\tenableTraces?: boolean;\n\n\t/**\n\t * Enable metrics collection (default: true)\n\t * Captures counters, gauges, and histograms for request volume, duration, etc.\n\t */\n\tenableMetrics?: boolean;\n\n\t/**\n\t * Enable structured logging (default: true)\n\t * Captures log events with structured attributes for better querying\n\t */\n\tenableLogs?: boolean;\n\n\t/**\n\t * Enable system metrics collection (default: true)\n\t * Captures CPU usage, memory consumption, and process metrics\n\t */\n\tenableSystemMetrics?: boolean;\n\n\t/**\n\t * Enable console.error and console.warn capture (default: true)\n\t * Automatically creates telemetry spans for console.error/warn calls\n\t * Useful for catching errors that are logged but not thrown\n\t */\n\tenableConsoleCapture?: boolean;\n\n\t/**\n\t * Sample rate for regular requests (default: 1.0)\n\t * Controls what percentage of requests to track (0.0 = 0%, 1.0 = 100%)\n\t *\n\t * Use sampling to reduce telemetry volume and costs on high-traffic applications:\n\t * - 1.0 = Track every request (100%)\n\t * - 0.5 = Track half of requests (50%)\n\t * - 0.1 = Track 10% of requests\n\t * - 0.01 = Track 1% of requests\n\t *\n\t * Sampling uses random selection, so a 10% sample of 100,000 requests\n\t * still provides ~10,000 data points for statistical analysis\n\t *\n\t * @example sampleRate: 0.1 // Track 10% of requests\n\t */\n\tsampleRate?: number;\n\n\t/**\n\t * Sample rate for error requests (default: 1.0)\n\t * Controls what percentage of errors to track (0.0 = 0%, 1.0 = 100%)\n\t *\n\t * Typically set higher than sampleRate since errors are more important to track.\n\t * Common pattern: low sample rate for normal requests, 100% for errors\n\t *\n\t * @example\n\t * ```ts\n\t * sampleRate: 0.1, // Track 10% of normal requests\n\t * errorSampleRate: 1.0, // Track 100% of errors\n\t * ```\n\t */\n\terrorSampleRate?: number;\n\n\t/**\n\t * Capture and map HTTP headers to custom telemetry attributes\n\t * Provides fine-grained control over header extraction and attribute naming\n\t *\n\t * Use presets for common scenarios or define custom mappings for any header\n\t *\n\t * @example\n\t * ```ts\n\t * import { RerouteHeaders, CloudflareHeaders } from 'reroute-js/telemetry/server';\n\t *\n\t * capture: [\n\t * ...RerouteHeaders.http(), // user-agent, referer, accept-language, etc.\n\t * ...CloudflareHeaders.geo(), // Cloudflare geolocation (IP, country, city, etc.)\n\t * { header: 'x-custom', as: 'custom.value' }, // Custom mapping\n\t * ]\n\t * ```\n\t */\n\tcapture?: Array<{ header: string; as: string }>;\n\n\t/**\n\t * Custom attributes to add to all spans and logs\n\t * Useful for tagging telemetry with environment, region, version, etc.\n\t *\n\t * @example\n\t * ```ts\n\t * customAttributes: {\n\t * environment: 'production',\n\t * region: 'us-east-1',\n\t * version: '1.2.3',\n\t * }\n\t * ```\n\t */\n\tcustomAttributes?: Record<string, string | number | boolean>;\n\n\t/**\n\t * Source map configuration for production error tracking\n\t * When enabled, error stack traces are mapped to original source files\n\t * instead of compiled/minified code\n\t *\n\t * @example\n\t * ```ts\n\t * sourcemaps: {\n\t * enabled: true, // Enable sourcemap resolution\n\t * }\n\t * ```\n\t */\n\tsourcemaps?: {\n\t\t/**\n\t\t * Enable sourcemap resolution\n\t\t * @default true in production, false in development\n\t\t */\n\t\tenabled?: boolean;\n\t};\n}\n\n/**\n * Redirect handler function that can dynamically determine destination\n * @param url - The original URL object\n * @returns The destination path/url or null to skip redirect\n */\ntype RedirectHandler = (url: URL) => string | null | Promise<string | null>;\n\n/**\n * Individual redirect rule\n */\ninterface RedirectRule {\n\t/** Enable or disable this redirect rule (default: true) */\n\tenabled?: boolean;\n\t/** Source path (string or regex pattern) */\n\tsource: string | RegExp;\n\t/** Destination path or handler function */\n\tdestination: string | RedirectHandler;\n\t/** HTTP status code (301 = permanent, 302 = temporary, 307 = preserve method, 308 = permanent preserve method) */\n\tstatus?: 301 | 302 | 307 | 308;\n\t/** Whether source is a regex pattern (auto-detected if source is RegExp) */\n\tregex?: boolean;\n}\n\n/**\n * Server-side caching configuration.\n * Controls in-process HTML, `ssr.data()`, and `/__reroute_data` caches.\n */\ninterface ServerOptions {\n\t/**\n\t * Enable server-side caching.\n\t * `false` recomputes `ssr.data()` on every origin request.\n\t * @default true\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Cache duration in seconds for server-side cache\n\t * @default 3600 (1 hour)\n\t */\n\tmaxAge?: number;\n}\n\n/**\n * Browser caching configuration\n * Controls Cache-Control headers sent to browsers\n */\ninterface BrowserOptions {\n\t/**\n\t * Enable sending Cache-Control headers to browsers\n\t * Set to false when running behind a CDN like Cloudflare that handles caching\n\t * @default true\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Cache duration in seconds for browser caching\n\t * @default 300 (5 minutes)\n\t */\n\tmaxAge?: number;\n\n\t/**\n\t * Cache-Control directive ('public' | 'private')\n\t * @default 'public'\n\t */\n\tdirective?: 'public' | 'private';\n}\n\ninterface AppOptions {\n\t/**\n\t * App component path. The parent directory is the client root\n\t * (routes, index.css, assets).\n\t * @default './src/client/App'\n\t * @example './src/client/App'\n\t * @example './client/App'\n\t */\n\tsrc?: string;\n\n\t/**\n\t * Server entry used by `reroute dev`, `reroute start`, and compiled binaries.\n\t * @default './src/index.ts'\n\t * @example './src/index.ts'\n\t * @example './index.ts'\n\t */\n\tserver?: string;\n\n\t/**\n\t * Base URL for the application (e.g., 'https://example.com')\n\t * Used for canonical URLs, social meta tags, and other absolute URLs\n\t */\n\tbaseUrl?: string;\n\n\t/** Custom HTML to inject into <head> */\n\thead?: string;\n\n\t/** HTML lang attribute @default 'en' */\n\tlang?: string;\n\n\t/** Root element ID @default 'root' */\n\tappId?: string;\n\n\t/** Enable automatic canonical URL generation @default true when baseUrl is set */\n\tautoCanonical?: boolean;\n\n\t/**\n\t * Suffix to append to all page titles (e.g., ' | My Site')\n\t * Applied automatically to page titles and og:title meta tags\n\t */\n\ttitleSuffix?: string;\n\n\t/** Minify HTML output */\n\tminify?: boolean;\n\n\t/** Enable compression for SSR responses @default true */\n\tcompression?: boolean;\n\n\t/** Enable detailed performance logging */\n\tdebug?: boolean;\n\n\t/** Cache duration for JS bundles in seconds @default 31536000 (1 year) */\n\tbundleMaxAge?: number;\n}\n\ninterface RerouteConfig {\n\tapp?: AppOptions;\n\tstatic?: StaticOptions;\n\tstreaming?: StreamingOptions;\n\tredirects?: RedirectRule[];\n\timage?: ImageOptions;\n\tog?: OGOptions;\n\togImage?: OGImageOptions;\n\tsitemap?: SitemapOptions;\n\trss?: RSSOptions;\n\tmarkdown?: MarkdownOptions;\n\tsearch?: SearchOptions;\n\tllms?: LLMsOptions;\n\trobots?: RobotsOptions;\n\ttelemetry?: TelemetryOptions;\n\t/** Optional i18n overrides. Feature still requires a `locales/` directory. */\n\ti18n?: I18nOptions;\n\n\t/**\n\t * Server-side caching configuration\n\t * Controls internal LRU cache for rendered HTML\n\t *\n\t * @example\n\t * ```ts\n\t * // Disable in-process HTML and ssr.data() caches (use behind a CDN)\n\t * server: { cache: false }\n\t *\n\t * // Custom server cache TTL\n\t * server: { cache: true, maxAge: 3600 }\n\t * ```\n\t */\n\tserver?: ServerOptions;\n\n\t/**\n\t * Browser caching configuration\n\t * Controls Cache-Control headers sent to browsers\n\t *\n\t * @example\n\t * ```ts\n\t * // Disable browser caching (recommended when using Cloudflare)\n\t * browser: { cache: false }\n\t *\n\t * // Custom browser cache settings\n\t * browser: { cache: true, maxAge: 60, directive: 'private' }\n\t * ```\n\t */\n\tbrowser?: BrowserOptions;\n}\n\nfunction defineConfig(config: RerouteConfig): RerouteConfig {\n\treturn config;\n}\n\nasync function loadConfig(cwd: string): Promise<RerouteConfig> {\n\t// Check for bundled config first (compiled binary support)\n\tconst bundledConfig = (globalThis as Record<string, unknown>)\n\t\t.__REROUTE_CONFIG__ as RerouteConfig | undefined;\n\tif (bundledConfig) {\n\t\treturn bundledConfig;\n\t}\n\n\t// Fallback to filesystem read (dev mode)\n\tconst configPath = `${cwd}/reroute.config.ts`;\n\tconst configFile = Bun.file(configPath);\n\n\tif (!(await configFile.exists())) {\n\t\treturn {};\n\t}\n\n\ttry {\n\t\tconst mod = await import(\n\t\t\t`${pathToFileURL(configPath).href}?t=${Date.now()}`\n\t\t);\n\t\treturn (mod.default || mod) as RerouteConfig;\n\t} catch (error) {\n\t\tconsole.warn('[reroute] Failed to load reroute.config.ts:', error);\n\t\treturn {};\n\t}\n}\n\nexport {\n\tdefineConfig,\n\tloadConfig,\n\ttype AppOptions,\n\ttype BrowserOptions,\n\ttype ContentSignalPolicy,\n\ttype I18nOptions,\n\ttype ImageOptions,\n\ttype LLMsOptions,\n\ttype MarkdownOptions,\n\ttype OGOptions,\n\ttype OGImageOptions,\n\ttype OGImageFont,\n\ttype RedirectRule,\n\ttype RerouteConfig,\n\ttype RobotsOptions,\n\ttype RobotsPolicy,\n\ttype RSSOptions,\n\ttype SearchOptions,\n\ttype ServerOptions,\n\ttype SitemapOptions,\n\ttype StaticOptions,\n\ttype StreamingOptions,\n\ttype TelemetryOptions,\n\ttype TelemetryProxyOptions,\n\ttype BrowserTelemetryOptions,\n};\n",
|
|
6
|
+
"import { pathToFileURL } from 'node:url';\nimport type { ComponentType } from 'react';\nimport type { I18nOptions } from './i18n/types';\n\n// biome-ignore lint/suspicious/noExplicitAny: The user document\ntype Doc = any;\ninterface StreamingOptions {\n\tenabled?: boolean;\n\tdefaultSkeleton?: ComponentType | string;\n\tdefaultLayoutSkeleton?: ComponentType | string;\n\ttimeout?: number;\n}\n\ninterface StaticOptions {\n\t/**\n\t * Patterns to ignore when serving static files\n\t * @default ['.DS_Store', '.git', '.env']\n\t */\n\tignorePatterns?: (string | RegExp)[];\n\t/**\n\t * Custom headers to add to static file responses\n\t */\n\theaders?: Record<string, string>;\n\t/**\n\t * Cache duration in seconds for static assets\n\t * @default 3600 (1 hour)\n\t */\n\tmaxAge?: number;\n\t/**\n\t * Cache-Control directive\n\t * @default 'public'\n\t */\n\tdirective?: string;\n}\n\ntype ImagePreprocessFormat = 'webp' | 'avif' | 'jpeg';\n\ninterface ImagePreprocessOptions {\n\t/**\n\t * Mobile srcset width in pixels\n\t * @default 640\n\t */\n\tmobile?: number;\n\t/**\n\t * Tablet srcset width in pixels\n\t * @default 1024\n\t */\n\ttablet?: number;\n\t/**\n\t * Desktop / web srcset width in pixels\n\t * @default 1920\n\t */\n\tdesktop?: number;\n\t/**\n\t * Formats written into `.reroute/image-cache` at `reroute gen --prod`\n\t * and `reroute build`. `auto` URLs are always warmed as well.\n\t * @default ['webp', 'avif']\n\t */\n\tformats?: ImagePreprocessFormat[];\n\t/**\n\t * Quality used for baked variants and the Image default when unset\n\t * @default 75\n\t */\n\tquality?: number;\n\t/**\n\t * Extra qualities to bake. Use when `Image` / loaders pass their own `q`.\n\t */\n\tqualities?: number[];\n}\n\ninterface ImageOptions {\n\t/**\n\t * Cache duration in seconds for optimized images\n\t * @default 31536000 (1 year)\n\t */\n\tmaxAge?: number;\n\t/**\n\t * Allowed external domains for image optimization\n\t * @default []\n\t */\n\tallowedDomains?: string[];\n\t/**\n\t * Maximum image width in pixels\n\t * @default 3840\n\t */\n\tmaxWidth?: number;\n\t/**\n\t * Maximum image height in pixels\n\t * @default 2160\n\t */\n\tmaxHeight?: number;\n\t/**\n\t * Bake mobile / tablet / desktop variants during `reroute gen --prod`\n\t * and `reroute build` so the first `/__reroute_image` request hits disk\n\t * cache instead of running Sharp.\n\t */\n\tpreprocess?: boolean | ImagePreprocessOptions;\n}\n\n/**\n * Sitemap configuration options\n */\ninterface SitemapOptions {\n\t/** Enable sitemap generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for sitemap generation (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/**\n\t * Maximum URLs per sitemap file before pagination (default: 50000)\n\t * When exceeded, creates multiple sitemap files with a sitemap index\n\t * Set lower for testing (e.g., 10) to verify pagination works\n\t */\n\tmaxUrlsPerPage?: number;\n\n\t/**\n\t * Completely exclude specific routes from the sitemap\n\t * Routes listed here will not appear in the sitemap at all\n\t * @example ['/admin', '/api']\n\t */\n\texcludeRoutes?: string[];\n\n\t/**\n\t * Exclude specific routes from SSR data array discovery\n\t * Routes listed here will still appear in the sitemap as single entries,\n\t * but won't generate multiple URLs from arrays found in their SSR data\n\t * @example ['/download', '/pricing'] - these routes appear once, not per array item\n\t */\n\texcludeDiscovery?: string[];\n\n\t/**\n\t * Extract urls from ssr.data result (full control over data shape)\n\t * If provided, this takes precedence over automatic array discovery\n\t * @param data - Full ssr.data result\n\t * @param routePattern - The route pattern (e.g., '/changelog')\n\t * @returns Array of items to process, or null/undefined to skip this route\n\t */\n\textractUrls?: (data: Doc, routePattern: string) => Doc[] | null | undefined;\n\n\t/**\n\t * Extract URL segment from ssr.data items\n\t * @param item - Data item from ssr.data result\n\t * @param routePattern - The route pattern (e.g., '/changelog')\n\t * @returns URL segment to append to routePattern (e.g., '0.1.0' -> '/changelog/0.1.0'),\n\t * null/undefined to use default extraction, or false to skip this item entirely\n\t */\n\textractUrl?: (\n\t\titem: Doc,\n\t\troutePattern: string,\n\t) => string | null | undefined | false;\n\n\t/**\n\t * Extract lastmod date from ssr.data items\n\t * @param item - Data item from ssr.data result\n\t * @returns ISO date string or undefined\n\t */\n\textractLastmod?: (item: Doc) => string | undefined;\n\n\t/** Default changefreq for URLs */\n\tchangefreq?:\n\t\t| 'always'\n\t\t| 'hourly'\n\t\t| 'daily'\n\t\t| 'weekly'\n\t\t| 'monthly'\n\t\t| 'yearly'\n\t\t| 'never';\n\n\t/** Default priority for URLs */\n\tpriority?: number;\n}\n\n/**\n * RSS feed configuration options\n */\ninterface RSSOptions {\n\t/** Enable RSS feed generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for RSS feeds (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/** Feed title (e.g., 'My Blog') */\n\ttitle?: string;\n\n\t/** Feed description */\n\tdescription?: string;\n\n\t/** Maximum number of items per feed (default: 50) */\n\tlimit?: number;\n\n\t/** Feed format: 'rss' or 'atom' (default: 'rss') */\n\tformat?: 'rss' | 'atom';\n\n\t/**\n\t * Completely exclude specific routes from the RSS feed\n\t * Routes listed here will not appear in the feed at all\n\t * @example ['/admin', '/api']\n\t */\n\texcludeRoutes?: string[];\n\n\t/**\n\t * Exclude specific routes from SSR data array discovery\n\t * Routes listed here won't generate multiple feed items from arrays in their SSR data,\n\t * but may still generate a single feed item if appropriate\n\t * @example ['/download', '/pricing'] - won't generate items per array entry\n\t */\n\texcludeDiscovery?: string[];\n\n\t/**\n\t * Extract items from ssr.data result (full control over data shape)\n\t * If provided, this takes precedence over automatic array discovery\n\t * @param data - Full ssr.data result\n\t * @param routePattern - The route pattern (e.g., '/changelog')\n\t * @returns Array of items to process, or null/undefined to skip this route\n\t */\n\textractUrls?: (data: Doc, routePattern: string) => Doc[] | null | undefined;\n\n\t/**\n\t * Extract URL segment from ssr.data items (same as sitemap)\n\t * @returns URL segment, null/undefined for default extraction, or false to skip item\n\t */\n\textractUrl?: (\n\t\titem: Doc,\n\t\troutePattern: string,\n\t) => string | null | undefined | false;\n\n\t/**\n\t * Extract publication date from items\n\t */\n\textractPubDate?: (item: Doc) => string | undefined;\n\n\t/**\n\t * Extract author from items\n\t */\n\textractAuthor?: (item: Doc) => string | undefined;\n\n\t/**\n\t * Extract content/body from items\n\t */\n\textractContent?: (item: Doc) => string | undefined;\n\n\t/**\n\t * Extract description/summary from items\n\t * Falls back to item.description or item.excerpt if not provided\n\t */\n\textractDescription?: (item: Doc) => string | undefined;\n}\n\n/**\n * Markdown configuration options\n */\ninterface MarkdownOptions {\n\t/**\n\t * Custom components to use when rendering markdown\n\t * Path to a module that exports a components object compatible with Streamdown\n\t * @example './src/client/lib/markdown-components'\n\t */\n\tcomponents?: string;\n\n\t/** Enable GitHub Flavored Markdown (default: true if remark-gfm is installed) */\n\tenableGfm?: boolean;\n\n\t/** Shiki theme for syntax highlighting (default: 'github-dark') */\n\ttheme?: string;\n}\n\n/**\n * Search index configuration options\n */\ninterface SearchOptions {\n\t/** Enable search index generation (default: false) */\n\tenabled?: boolean;\n\n\t/**\n\t * Collections to include in search index\n\t * @default [] - all collections will be indexed\n\t * @example ['blog', 'docs']\n\t */\n\tcollections?: string[];\n\n\t/**\n\t * Include full content text in search (increases index size significantly)\n\t * @default false - only index headings and metadata\n\t */\n\tincludeContent?: boolean;\n\n\t/**\n\t * Maximum content length to index per item (characters)\n\t * @default 5000 - prevents huge content from bloating index\n\t */\n\tcontentLimit?: number;\n\n\t/**\n\t * Fields to index from frontmatter metadata\n\t * @default ['title', 'description', 'excerpt', 'tags']\n\t */\n\tmetaFields?: string[];\n\n\t/**\n\t * Minimum heading level to index (1-6)\n\t * @default 1 - index all headings\n\t */\n\tminHeadingLevel?: number;\n\n\t/**\n\t * Maximum heading level to index (1-6)\n\t * @default 6 - index all headings\n\t */\n\tmaxHeadingLevel?: number;\n\n\t/**\n\t * Default page size for paginated results\n\t * @default 20\n\t */\n\tdefaultPageSize?: number;\n\n\t/**\n\t * Maximum allowed page size (prevents excessive results)\n\t * @default 100\n\t */\n\tmaxPageSize?: number;\n}\n\ninterface OGImageFont {\n\t/** Font family name (e.g., 'Inter') */\n\tname: string;\n\t/** Path to font file (TTF, OTF, or WOFF) relative to project root */\n\tpath: string;\n\t/** Font weight (e.g., 400, 700, 900) */\n\tweight?: number;\n\t/** Font style (default: 'normal') */\n\tstyle?:\n\t\t| 'normal'\n\t\t| 'italic'\n\t\t| 'bold'\n\t\t| 'bold-italic'\n\t\t| 'medium'\n\t\t| 'medium-italic'\n\t\t| 'semibold'\n\t\t| 'semibold-italic'\n\t\t| 'light'\n\t\t| 'light-italic'\n\t\t| 'thin'\n\t\t| 'thin-italic'\n\t\t| 'black'\n\t\t| 'black-italic'\n\t\t| 'extra-bold'\n\t\t| 'extra-bold-italic'\n\t\t| 'extra-light'\n\t\t| 'extra-light-italic'\n\t\t| 'extra-medium'\n\t\t| 'extra-medium-italic'\n\t\t| 'extra-semibold'\n\t\t| 'extra-semibold-italic'\n\t\t| 'extra-light'\n\t\t| 'extra-light-italic'\n\t\t| 'extra-medium'\n\t\t| 'extra-medium-italic'\n\t\t| 'extra-semibold'\n\t\t| 'extra-semibold-italic';\n\tdata?: ArrayBuffer | undefined;\n}\n\n/**\n * Open Graph and social meta tags configuration\n */\ninterface OGOptions {\n\t/**\n\t * Site name used for og:site_name meta tag\n\t * This appears as the website name in social media shares\n\t * @example 'My Awesome Site'\n\t */\n\tsiteName?: string;\n\n\t/**\n\t * Default site description used as fallback for og:description\n\t * when a page doesn't define its own description\n\t * @example 'A modern web application built with Reroute'\n\t */\n\tsiteDescription?: string;\n\n\t/**\n\t * Default Open Graph type for pages without explicit og:type\n\t * Common types: 'website', 'article', 'product', 'profile'\n\t * @default 'website'\n\t * @see https://ogp.me/#types\n\t */\n\tdefaultType?: string;\n\n\t/**\n\t * Twitter/X handle for twitter:site meta tag (with or without @)\n\t * @example '@mysite' or 'mysite'\n\t */\n\ttwitterSite?: string;\n\n\t/**\n\t * Twitter/X card type (default: 'summary_large_image')\n\t * @default 'summary_large_image'\n\t */\n\ttwitterCard?: 'summary' | 'summary_large_image' | 'app' | 'player';\n\n\t/**\n\t * Default locale for og:locale meta tag\n\t * @example 'en_US', 'en_GB', 'es_ES'\n\t */\n\tlocale?: string;\n}\n\n/**\n * OG Image generation configuration options\n */\ninterface OGImageOptions {\n\t/** Enable OG image generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for absolute OG image URLs (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/** Path to default template component or 'default' for built-in template */\n\tdefaultTemplate?: string;\n\n\t/** Image width in pixels (default: 1200) */\n\twidth?: number;\n\n\t/** Image height in pixels (default: 630) */\n\theight?: number;\n\n\t/** Cache duration in seconds (default: 3600 = 1 hour) */\n\tmaxAge?: number;\n\n\t/** Default avatar/logo URL (can be external or local path) */\n\tavatar?: string;\n\n\t/** Site name to display */\n\tsiteName?: string;\n\n\t/** Custom fonts to load for OG images */\n\tfonts?: OGImageFont[];\n}\n\n/**\n * Preferences for how fetched content may be used (Content Signals).\n * Omitted keys default to yes.\n */\ninterface ContentSignalPolicy {\n\t/** Use in search results */\n\tsearch?: boolean;\n\n\t/** Use as live context for an AI answer */\n\taiInput?: boolean;\n\n\t/** Use to train or fine-tune a model */\n\taiTrain?: boolean;\n}\n\n/**\n * LLMs content configuration options\n */\ninterface LLMsOptions {\n\t/** Enable LLM content features (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for absolute URLs in llms.txt index (e.g., 'https://example.com') */\n\tbaseUrl?: string;\n\n\t/** Enable .txt extension for routes (default: true when enabled) */\n\tenableTextExtension?: boolean;\n\n\t/** Enable .md extension for routes (default: true when enabled) */\n\tenableMarkdownExtension?: boolean;\n\n\t/** Enable Accept header content negotiation (default: true when enabled) */\n\tenableContentNegotiation?: boolean;\n\n\t/** Enable /llms.txt index generation (default: true when enabled) */\n\tenableIndex?: boolean;\n\n\t/** Enable /llms-full.txt generation (default: true when enabled) */\n\tenableFullContent?: boolean;\n\n\t/**\n\t * Content-Signal header on HTML and markdown/text responses.\n\t * Default when enabled: `ai-train=yes, search=yes, ai-input=yes`.\n\t * Set `false` to omit the header.\n\t */\n\tcontentSignal?: ContentSignalPolicy | false;\n\n\t/** Cache duration in seconds for LLM content (default: 86400 = 24 hours, or falls back to options.maxAge) */\n\tmaxAge?: number;\n\n\t/** Cache duration in seconds for llms-full.txt specifically (default: 604800 = 7 days, or falls back to llms.maxAge) */\n\tmaxAgeFull?: number;\n\n\t/** Maximum items in full content bundle (default: 10000) */\n\tmaxItems?: number;\n\n\t/** Maximum file size for full content in bytes (default: 50MB) */\n\tmaxSize?: number;\n\n\t/**\n\t * Exclude specific routes from LLM features\n\t * Supports strings (exact match or substring), RegExp, or custom functions\n\t * @example ['/admin', '/api', /^\\/private/, (path) => path.includes('draft')]\n\t */\n\texcludeRoutes?: (string | RegExp | ((pathname: string) => boolean))[];\n\n\t/**\n\t * Exclude collections from LLM features\n\t * @example ['drafts', 'private']\n\t */\n\texcludeCollections?: string[];\n\n\t/** Site name for index header */\n\tsiteName?: string;\n\n\t/** Site description for index header (brief context for LLMs) */\n\tsiteDescription?: string;\n\n\t/**\n\t * Include each page's description next to the index link\n\t * (`- [Title](url.txt): description`). Default: true.\n\t * Set false for compact title+link only.\n\t */\n\tindexSummaries?: boolean;\n\n\t/**\n\t * Per-collection customization for titles and descriptions\n\t * @example\n\t * ```ts\n\t * collections: {\n\t * blog: {\n\t * title: 'My Awesome Blog',\n\t * description: 'Insights and tutorials about web development'\n\t * },\n\t * docs: {\n\t * title: 'Documentation',\n\t * description: 'Complete API reference and guides'\n\t * }\n\t * }\n\t * ```\n\t */\n\tcollections?: Record<\n\t\tstring,\n\t\t{\n\t\t\t/** Custom title for this collection's LLMS index */\n\t\t\ttitle?: string;\n\t\t\t/** Custom description for this collection's LLMS index */\n\t\t\tdescription?: string;\n\t\t}\n\t>;\n}\n\n/**\n * Robots policy for specific user-agents\n */\ninterface RobotsPolicy {\n\t/** User-Agent (e.g., '*', 'Googlebot', 'GPTBot') */\n\tuserAgent: string;\n\n\t/** Paths to explicitly allow */\n\tallow?: string[];\n\n\t/** Paths to disallow */\n\tdisallow?: string[];\n\n\t/** Crawl delay for this user-agent (seconds) */\n\tcrawlDelay?: number;\n}\n\n/**\n * Robots.txt generation configuration options\n */\ninterface RobotsOptions {\n\t/** Enable robots.txt generation (default: false) */\n\tenabled?: boolean;\n\n\t/** Base URL for sitemap reference (e.g., 'https://example.com') - required when enabled */\n\tbaseUrl?: string;\n\n\t/** Cache duration in seconds (default: 86400 = 24 hours) */\n\tmaxAge?: number;\n\n\t/** Custom policies per user-agent (default: permissive) */\n\tpolicies?: RobotsPolicy[];\n\n\t/** Auto-reference sitemap.xml if sitemap is enabled (default: true) */\n\treferenceSitemap?: boolean;\n\n\t/** Auto-disallow routes excluded from sitemap (default: true) */\n\tsitemapExclusion?: boolean;\n\n\t/** Auto-disallow old redirect source paths (default: true) */\n\tredirectExclusion?: boolean;\n\n\t/**\n\t * Content-Signal line on the `User-agent: *` group.\n\t * When omitted, no line is written (the plugin copies `llms.contentSignal`\n\t * when both features are enabled).\n\t */\n\tcontentSignal?: ContentSignalPolicy | false;\n\n\t/** Additional raw text appended to robots.txt */\n\tcustomRules?: string;\n\n\t/** Global crawl delay in seconds (optional) */\n\tcrawlDelay?: number;\n}\n\n/**\n * Telemetry proxy configuration for forwarding browser telemetry\n */\ninterface TelemetryProxyOptions {\n\t/**\n\t * Enable browser telemetry proxy (default: true when proxy config exists)\n\t * Creates endpoints to forward browser traces/metrics/logs to OTLP backend\n\t * This avoids CORS issues and ad blockers\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Base path for proxy endpoints (default: '/__reroute_telemetry')\n\t * Creates:\n\t * - {pathname}/v1/traces\n\t * - {pathname}/v1/metrics\n\t * - {pathname}/v1/logs\n\t * - {pathname}/health\n\t */\n\tpathname?: string;\n\n\t/**\n\t * Enable verbose logging for proxy requests\n\t * @default false\n\t */\n\tverbose?: boolean;\n\n\t/**\n\t * Custom handler for proxy requests (advanced)\n\t * If provided, replaces default OTLP forwarding logic\n\t *\n\t * @example\n\t * ```ts\n\t * handler: async ({ body, endpoint, headers }) => {\n\t * // Custom logic: filter, transform, or route to different backends\n\t * await fetch(`https://custom-backend${endpoint}`, {\n\t * method: 'POST',\n\t * headers,\n\t * body: JSON.stringify(body),\n\t * });\n\t * return { status: 200 };\n\t * }\n\t * ```\n\t */\n\thandler?: (params: {\n\t\tbody: unknown;\n\t\tendpoint: string;\n\t\theaders: Record<string, string>;\n\t\totlpEndpoint: string;\n\t}) => Promise<{ status: number }>;\n}\n\n/**\n * Browser telemetry configuration options\n */\ninterface BrowserTelemetryOptions {\n\t/**\n\t * Enable browser telemetry\n\t * @default true\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Service name for browser telemetry\n\t * @default 'reroute-app-browser'\n\t */\n\tserviceName?: string;\n\n\t/**\n\t * Service version\n\t * @default '1.0.0'\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL (use relative URL for same-origin proxy)\n\t * @default '/__reroute_telemetry'\n\t */\n\totlpEndpoint?: string;\n\n\t/**\n\t * API key for authentication (optional)\n\t */\n\tapiKey?: string;\n\n\t/**\n\t * Deployment environment (e.g., 'production', 'staging', 'development')\n\t * @default 'development'\n\t */\n\tenvironment?: string;\n\n\t/**\n\t * Enable console.error capture\n\t * @default true\n\t */\n\tenableConsoleCapture?: boolean;\n\n\t/**\n\t * Ignore specific routes/URLs from breadcrumbs and network tracking\n\t *\n\t * Note: Functions are NOT supported for browser telemetry (closures cannot be serialized)\n\t * Use strings or regex patterns instead\n\t *\n\t * @example\n\t * ```ts\n\t * ignoreRoutes: [\n\t * '/bundles/', // String prefix match\n\t * /\\.(js|css|png)$/, // Regex pattern\n\t * /^\\/assets\\//, // Regex for path prefix\n\t * ]\n\t * ```\n\t */\n\tignoreRoutes?: Array<string | RegExp>;\n}\n\n/**\n * Telemetry configuration options for OpenTelemetry integration\n */\ninterface TelemetryOptions {\n\t/**\n\t * Enable server telemetry collection (default: false)\n\t * Must be explicitly enabled to start collecting traces, metrics, and logs\n\t */\n\tenabled?: boolean;\n\n\t/**\n\t * Browser telemetry configuration\n\t * Configure browser-side telemetry separately from server\n\t */\n\tbrowser?: BrowserTelemetryOptions;\n\n\t/**\n\t * Service name for server telemetry\n\t * @default 'reroute-app'\n\t */\n\tserviceName?: string;\n\n\t/**\n\t * Service version\n\t * @default process.env.npm_package_version || '1.0.0'\n\t */\n\tserviceVersion?: string;\n\n\t/**\n\t * OTLP endpoint URL\n\t * @default process.env.OTEL_EXPORTER_OTLP_ENDPOINT || 'http://localhost:4318'\n\t */\n\totlpEndpoint?: string;\n\n\t/**\n\t * API key for authentication (optional, only needed for SigNoz Cloud)\n\t */\n\tapiKey?: string;\n\n\t/**\n\t * Deployment environment (e.g., 'production', 'staging', 'development')\n\t * Used as a deployment.environment attribute on all telemetry\n\t * @default process.env.NODE_ENV || 'development'\n\t */\n\tenvironment?: string;\n\n\t/**\n\t * Metric export interval in milliseconds\n\t * @default 5000\n\t */\n\tmetricsInterval?: number;\n\n\t/**\n\t * Browser telemetry proxy configuration\n\t * When configured, creates endpoints to forward browser telemetry to OTLP backend\n\t * This avoids CORS issues and ad blockers\n\t */\n\tproxy?: TelemetryProxyOptions;\n\n\t/**\n\t * Ignore specific routes from telemetry collection\n\t * Supports flexible pattern matching:\n\t * - String: Matches if pathname contains the string (e.g., '/assets' matches '/assets/logo.png')\n\t * - RegExp: Tests pathname against regex (e.g., /\\.(js|css)$/ matches file extensions)\n\t * - Function: Custom logic with pathname and method (server-side only)\n\t *\n\t * Note: For browser telemetry, only strings and regex are supported (functions use closures that cannot be serialized)\n\t *\n\t * @example\n\t * ```ts\n\t * ignoreRoutes: [\n\t * '/health', // String match\n\t * /\\.(js|css|png|jpg|svg|ico|woff2?)$/, // Regex for static assets\n\t * (pathname) => pathname.startsWith('/assets/'), // Function (server-side only)\n\t * (pathname, method) => method === 'OPTIONS', // Access to HTTP method (server-side only)\n\t * ]\n\t * ```\n\t */\n\tignoreRoutes?: (\n\t\t| string\n\t\t| RegExp\n\t\t| ((pathname: string, method: string) => boolean)\n\t)[];\n\n\t/**\n\t * Enable distributed tracing (default: true)\n\t * Captures request flows across services with OpenTelemetry traces\n\t */\n\tenableTraces?: boolean;\n\n\t/**\n\t * Enable metrics collection (default: true)\n\t * Captures counters, gauges, and histograms for request volume, duration, etc.\n\t */\n\tenableMetrics?: boolean;\n\n\t/**\n\t * Enable structured logging (default: true)\n\t * Captures log events with structured attributes for better querying\n\t */\n\tenableLogs?: boolean;\n\n\t/**\n\t * Enable system metrics collection (default: true)\n\t * Captures CPU usage, memory consumption, and process metrics\n\t */\n\tenableSystemMetrics?: boolean;\n\n\t/**\n\t * Enable console.error and console.warn capture (default: true)\n\t * Automatically creates telemetry spans for console.error/warn calls\n\t * Useful for catching errors that are logged but not thrown\n\t */\n\tenableConsoleCapture?: boolean;\n\n\t/**\n\t * Sample rate for regular requests (default: 1.0)\n\t * Controls what percentage of requests to track (0.0 = 0%, 1.0 = 100%)\n\t *\n\t * Use sampling to reduce telemetry volume and costs on high-traffic applications:\n\t * - 1.0 = Track every request (100%)\n\t * - 0.5 = Track half of requests (50%)\n\t * - 0.1 = Track 10% of requests\n\t * - 0.01 = Track 1% of requests\n\t *\n\t * Sampling uses random selection, so a 10% sample of 100,000 requests\n\t * still provides ~10,000 data points for statistical analysis\n\t *\n\t * @example sampleRate: 0.1 // Track 10% of requests\n\t */\n\tsampleRate?: number;\n\n\t/**\n\t * Sample rate for error requests (default: 1.0)\n\t * Controls what percentage of errors to track (0.0 = 0%, 1.0 = 100%)\n\t *\n\t * Typically set higher than sampleRate since errors are more important to track.\n\t * Common pattern: low sample rate for normal requests, 100% for errors\n\t *\n\t * @example\n\t * ```ts\n\t * sampleRate: 0.1, // Track 10% of normal requests\n\t * errorSampleRate: 1.0, // Track 100% of errors\n\t * ```\n\t */\n\terrorSampleRate?: number;\n\n\t/**\n\t * Capture and map HTTP headers to custom telemetry attributes\n\t * Provides fine-grained control over header extraction and attribute naming\n\t *\n\t * Use presets for common scenarios or define custom mappings for any header\n\t *\n\t * @example\n\t * ```ts\n\t * import { RerouteHeaders, CloudflareHeaders } from 'reroute-js/telemetry/server';\n\t *\n\t * capture: [\n\t * ...RerouteHeaders.http(), // user-agent, referer, accept-language, etc.\n\t * ...CloudflareHeaders.geo(), // Cloudflare geolocation (IP, country, city, etc.)\n\t * { header: 'x-custom', as: 'custom.value' }, // Custom mapping\n\t * ]\n\t * ```\n\t */\n\tcapture?: Array<{ header: string; as: string }>;\n\n\t/**\n\t * Custom attributes to add to all spans and logs\n\t * Useful for tagging telemetry with environment, region, version, etc.\n\t *\n\t * @example\n\t * ```ts\n\t * customAttributes: {\n\t * environment: 'production',\n\t * region: 'us-east-1',\n\t * version: '1.2.3',\n\t * }\n\t * ```\n\t */\n\tcustomAttributes?: Record<string, string | number | boolean>;\n\n\t/**\n\t * Source map configuration for production error tracking\n\t * When enabled, error stack traces are mapped to original source files\n\t * instead of compiled/minified code\n\t *\n\t * @example\n\t * ```ts\n\t * sourcemaps: {\n\t * enabled: true, // Enable sourcemap resolution\n\t * }\n\t * ```\n\t */\n\tsourcemaps?: {\n\t\t/**\n\t\t * Enable sourcemap resolution\n\t\t * @default true in production, false in development\n\t\t */\n\t\tenabled?: boolean;\n\t};\n}\n\n/**\n * Redirect handler function that can dynamically determine destination\n * @param url - The original URL object\n * @returns The destination path/url or null to skip redirect\n */\ntype RedirectHandler = (url: URL) => string | null | Promise<string | null>;\n\n/**\n * Individual redirect rule\n */\ninterface RedirectRule {\n\t/** Enable or disable this redirect rule (default: true) */\n\tenabled?: boolean;\n\t/** Source path (string or regex pattern) */\n\tsource: string | RegExp;\n\t/** Destination path or handler function */\n\tdestination: string | RedirectHandler;\n\t/** HTTP status code (301 = permanent, 302 = temporary, 307 = preserve method, 308 = permanent preserve method) */\n\tstatus?: 301 | 302 | 307 | 308;\n\t/** Whether source is a regex pattern (auto-detected if source is RegExp) */\n\tregex?: boolean;\n}\n\n/**\n * Server-side caching configuration.\n * Controls in-process HTML, `ssr.data()`, and `/__reroute_data` caches.\n */\ninterface ServerOptions {\n\t/**\n\t * Enable server-side caching.\n\t * `false` recomputes `ssr.data()` on every origin request.\n\t * @default true\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Cache duration in seconds for server-side cache\n\t * @default 3600 (1 hour)\n\t */\n\tmaxAge?: number;\n}\n\n/**\n * Browser caching configuration\n * Controls Cache-Control headers sent to browsers\n */\ninterface BrowserOptions {\n\t/**\n\t * Enable sending Cache-Control headers to browsers\n\t * Set to false when running behind a CDN like Cloudflare that handles caching\n\t * @default true\n\t */\n\tcache?: boolean;\n\n\t/**\n\t * Cache duration in seconds for browser caching\n\t * @default 300 (5 minutes)\n\t */\n\tmaxAge?: number;\n\n\t/**\n\t * Cache-Control directive ('public' | 'private')\n\t * @default 'public'\n\t */\n\tdirective?: 'public' | 'private';\n}\n\ninterface AppOptions {\n\t/**\n\t * App component path. The parent directory is the client root\n\t * (routes, index.css, assets).\n\t * @default './src/client/App'\n\t * @example './src/client/App'\n\t * @example './client/App'\n\t */\n\tsrc?: string;\n\n\t/**\n\t * Server entry used by `reroute dev`, `reroute start`, and compiled binaries.\n\t * @default './src/index.ts'\n\t * @example './src/index.ts'\n\t * @example './index.ts'\n\t */\n\tserver?: string;\n\n\t/**\n\t * Base URL for the application (e.g., 'https://example.com')\n\t * Used for canonical URLs, social meta tags, and other absolute URLs\n\t */\n\tbaseUrl?: string;\n\n\t/** Custom HTML to inject into <head> */\n\thead?: string;\n\n\t/** HTML lang attribute @default 'en' */\n\tlang?: string;\n\n\t/** Root element ID @default 'root' */\n\tappId?: string;\n\n\t/** Enable automatic canonical URL generation @default true when baseUrl is set */\n\tautoCanonical?: boolean;\n\n\t/**\n\t * Suffix to append to all page titles (e.g., ' | My Site')\n\t * Applied automatically to page titles and og:title meta tags\n\t */\n\ttitleSuffix?: string;\n\n\t/** Minify HTML output */\n\tminify?: boolean;\n\n\t/** Enable compression for SSR responses @default true */\n\tcompression?: boolean;\n\n\t/** Enable detailed performance logging */\n\tdebug?: boolean;\n\n\t/** Cache duration for JS bundles in seconds @default 31536000 (1 year) */\n\tbundleMaxAge?: number;\n}\n\ninterface RerouteConfig {\n\tapp?: AppOptions;\n\tstatic?: StaticOptions;\n\tstreaming?: StreamingOptions;\n\tredirects?: RedirectRule[];\n\timage?: ImageOptions;\n\tog?: OGOptions;\n\togImage?: OGImageOptions;\n\tsitemap?: SitemapOptions;\n\trss?: RSSOptions;\n\tmarkdown?: MarkdownOptions;\n\tsearch?: SearchOptions;\n\tllms?: LLMsOptions;\n\trobots?: RobotsOptions;\n\ttelemetry?: TelemetryOptions;\n\t/** Optional i18n overrides. Feature still requires a `locales/` directory. */\n\ti18n?: I18nOptions;\n\n\t/**\n\t * Server-side caching configuration\n\t * Controls internal LRU cache for rendered HTML\n\t *\n\t * @example\n\t * ```ts\n\t * // Disable in-process HTML and ssr.data() caches (use behind a CDN)\n\t * server: { cache: false }\n\t *\n\t * // Custom server cache TTL\n\t * server: { cache: true, maxAge: 3600 }\n\t * ```\n\t */\n\tserver?: ServerOptions;\n\n\t/**\n\t * Browser caching configuration\n\t * Controls Cache-Control headers sent to browsers\n\t *\n\t * @example\n\t * ```ts\n\t * // Disable browser caching (recommended when using Cloudflare)\n\t * browser: { cache: false }\n\t *\n\t * // Custom browser cache settings\n\t * browser: { cache: true, maxAge: 60, directive: 'private' }\n\t * ```\n\t */\n\tbrowser?: BrowserOptions;\n}\n\nfunction defineConfig(config: RerouteConfig): RerouteConfig {\n\treturn config;\n}\n\nasync function loadConfig(cwd: string): Promise<RerouteConfig> {\n\t// Check for bundled config first (compiled binary support)\n\tconst bundledConfig = (globalThis as Record<string, unknown>)\n\t\t.__REROUTE_CONFIG__ as RerouteConfig | undefined;\n\tif (bundledConfig) {\n\t\treturn bundledConfig;\n\t}\n\n\t// Fallback to filesystem read (dev mode)\n\tconst configPath = `${cwd}/reroute.config.ts`;\n\tconst configFile = Bun.file(configPath);\n\n\tif (!(await configFile.exists())) {\n\t\treturn {};\n\t}\n\n\ttry {\n\t\tconst mod = await import(\n\t\t\t`${pathToFileURL(configPath).href}?t=${Date.now()}`\n\t\t);\n\t\treturn (mod.default || mod) as RerouteConfig;\n\t} catch (error) {\n\t\tconsole.warn('[reroute] Failed to load reroute.config.ts:', error);\n\t\treturn {};\n\t}\n}\n\nexport {\n\tdefineConfig,\n\tloadConfig,\n\ttype AppOptions,\n\ttype BrowserOptions,\n\ttype ContentSignalPolicy,\n\ttype I18nOptions,\n\ttype ImageOptions,\n\ttype ImagePreprocessFormat,\n\ttype ImagePreprocessOptions,\n\ttype LLMsOptions,\n\ttype MarkdownOptions,\n\ttype OGOptions,\n\ttype OGImageOptions,\n\ttype OGImageFont,\n\ttype RedirectRule,\n\ttype RerouteConfig,\n\ttype RobotsOptions,\n\ttype RobotsPolicy,\n\ttype RSSOptions,\n\ttype SearchOptions,\n\ttype ServerOptions,\n\ttype SitemapOptions,\n\ttype StaticOptions,\n\ttype StreamingOptions,\n\ttype TelemetryOptions,\n\ttype TelemetryProxyOptions,\n\ttype BrowserTelemetryOptions,\n};\n",
|
|
7
7
|
"export * from './discovery';\nexport * from './metadata';\n",
|
|
8
8
|
"import { IntlMessageFormat } from 'intl-messageformat';\nimport { lookupMessage } from './catalog';\nimport type { MessageCatalog } from './types';\n\ntype MessageValues = Record<\n\tstring,\n\tstring | number | boolean | Date | null | undefined\n>;\n\nconst formatterCache = new Map<string, IntlMessageFormat>();\n\nfunction formatMessage(\n\tmessage: string,\n\tlocale: string,\n\tvalues?: MessageValues,\n): string {\n\tif (!values || Object.keys(values).length === 0) {\n\t\t// Fast path: no values — still format if message has ICU syntax without args needed\n\t\tif (!/\\{[^}]+\\}/.test(message)) return message;\n\t}\n\n\tconst cacheKey = `${locale}\\0${message}`;\n\tlet formatter = formatterCache.get(cacheKey);\n\tif (!formatter) {\n\t\tformatter = new IntlMessageFormat(message, locale);\n\t\tformatterCache.set(cacheKey, formatter);\n\t}\n\n\ttry {\n\t\tconst result = formatter.format(values as Record<string, unknown>);\n\t\treturn typeof result === 'string' ? result : String(result);\n\t} catch {\n\t\treturn message;\n\t}\n}\n\n/**\n * Translate a key using catalogs. Missing keys return the key itself.\n */\nfunction createTranslator(\n\tcatalogs: Record<string, MessageCatalog>,\n\tlocale: string,\n\tdefaultLocale: string,\n): (key: string, values?: MessageValues) => string {\n\treturn (key: string, values?: MessageValues) => {\n\t\tconst message = lookupMessage(catalogs, locale, defaultLocale, key);\n\t\tif (message == null) return key;\n\t\treturn formatMessage(message, locale, values);\n\t};\n}\n\nexport { createTranslator, formatMessage, type MessageValues };\n",
|
|
9
9
|
"import { DEFAULT_COOKIE } from './discover';\nimport { negotiateLocale, parseCookieValue } from './negotiate';\nimport { localizeContentHref, parseContentPath } from './pathname';\nimport type { LocaleResolution, LocaleResolutionInput } from './types';\n\nfunction canonicalLocale(\n\tvalue: string,\n\tavailableLocales: string[],\n): string {\n\treturn (\n\t\tavailableLocales.find((l) => l.toLowerCase() === value.toLowerCase()) ||\n\t\tvalue\n\t);\n}\n\nfunction parseLangParam(\n\tsearch: string | null | undefined,\n\tisAvailable: (locale: string | undefined) => locale is string,\n\tavailableLocales: string[],\n): string | undefined {\n\tif (!search) return undefined;\n\tconst params = new URLSearchParams(\n\t\tsearch.startsWith('?') ? search.slice(1) : search,\n\t);\n\tconst raw = params.get('lang') ?? undefined;\n\tif (!isAvailable(raw)) return undefined;\n\treturn canonicalLocale(raw, availableLocales);\n}\n\nfunction stripLangParam(search: string | null | undefined): string {\n\tif (!search) return '';\n\tconst params = new URLSearchParams(\n\t\tsearch.startsWith('?') ? search.slice(1) : search,\n\t);\n\tparams.delete('lang');\n\tconst rest = params.toString();\n\treturn rest ? `?${rest}` : '';\n}\n\n/**\n * Resolve active locale: `?lang=` → content URL → cookie → Accept-Language → default.\n * `?lang=` is an explicit override (language switcher). A content URL locale\n * always beats cookie / Accept-Language.\n */\nfunction resolveLocale(input: LocaleResolutionInput): LocaleResolution {\n\tconst {\n\t\tpathname,\n\t\tsearch,\n\t\tcookieHeader,\n\t\tacceptLanguage,\n\t\tavailableLocales,\n\t\tdefaultLocale,\n\t\tcookieName = DEFAULT_COOKIE,\n\t\tcollections,\n\t} = input;\n\n\tconst parsed = parseContentPath(pathname, availableLocales, collections);\n\tconst availableLower = new Set(availableLocales.map((l) => l.toLowerCase()));\n\n\tconst isAvailable = (locale: string | undefined): locale is string =>\n\t\t!!locale && availableLower.has(locale.toLowerCase());\n\n\tconst routingPathname = parsed?.routingPathname ?? pathname.split('?')[0];\n\tconst restSearch = stripLangParam(search);\n\n\t// 1) Explicit ?lang= override — then 302 to the canonical URL without the param\n\tconst queryLocale = parseLangParam(search, isAvailable, availableLocales);\n\tif (queryLocale) {\n\t\tconst target = parsed\n\t\t\t? localizeContentHref(\n\t\t\t\t\tparsed.collection,\n\t\t\t\t\tparsed.name,\n\t\t\t\t\tqueryLocale,\n\t\t\t\t\tdefaultLocale,\n\t\t\t\t)\n\t\t\t: routingPathname;\n\t\treturn {\n\t\t\tlocale: queryLocale,\n\t\t\troutingPathname,\n\t\t\tfromPath: false,\n\t\t\tfromQuery: true,\n\t\t\tredirectTo: `${target}${restSearch}`,\n\t\t\tparsed: parsed\n\t\t\t\t? {\n\t\t\t\t\t\t...parsed,\n\t\t\t\t\t\tlocale: queryLocale === defaultLocale ? undefined : queryLocale,\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t};\n\t}\n\n\t// 2) Locale from content URL — URL wins over cookie / Accept-Language\n\tif (parsed?.locale && isAvailable(parsed.locale)) {\n\t\tconst locale = canonicalLocale(parsed.locale, availableLocales);\n\n\t\tif (\n\t\t\tlocale === defaultLocale &&\n\t\t\tparsed.pathname !== parsed.routingPathname\n\t\t) {\n\t\t\treturn {\n\t\t\t\tlocale,\n\t\t\t\troutingPathname: parsed.routingPathname,\n\t\t\t\tfromPath: true,\n\t\t\t\tfromQuery: false,\n\t\t\t\tredirectTo: `${parsed.routingPathname}${restSearch}`,\n\t\t\t\tparsed: { ...parsed, locale },\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tlocale,\n\t\t\troutingPathname: parsed.routingPathname,\n\t\t\tfromPath: true,\n\t\t\tfromQuery: false,\n\t\t\tparsed: { ...parsed, locale },\n\t\t};\n\t}\n\n\t// 3) Cookie\n\tconst cookieLocale = parseCookieValue(cookieHeader, cookieName);\n\tif (isAvailable(cookieLocale)) {\n\t\tconst locale = canonicalLocale(cookieLocale, availableLocales);\n\t\treturn {\n\t\t\tlocale,\n\t\t\troutingPathname,\n\t\t\tfromPath: false,\n\t\t\tfromQuery: false,\n\t\t\tparsed: parsed ? { ...parsed, locale: undefined } : undefined,\n\t\t};\n\t}\n\n\t// 4) Accept-Language\n\tconst negotiated = negotiateLocale(\n\t\tacceptLanguage,\n\t\tavailableLocales,\n\t\tdefaultLocale,\n\t);\n\n\treturn {\n\t\tlocale: negotiated,\n\t\troutingPathname,\n\t\tfromPath: false,\n\t\tfromQuery: false,\n\t\tparsed: parsed ? { ...parsed, locale: undefined } : undefined,\n\t};\n}\n\n/**\n * If content negotiation wants a non-default locale on a default content URL,\n * return the localized path to redirect to.\n */\nfunction contentNegotiateRedirect(\n\tresolution: LocaleResolution,\n\tdefaultLocale: string,\n\tenabled: boolean,\n): string | undefined {\n\tif (!enabled) return undefined;\n\tif (resolution.fromPath || resolution.fromQuery) return undefined;\n\tif (resolution.locale === defaultLocale) return undefined;\n\tconst parsed = resolution.parsed;\n\tif (!parsed) return undefined;\n\treturn localizeContentHref(\n\t\tparsed.collection,\n\t\tparsed.name,\n\t\tresolution.locale,\n\t\tdefaultLocale,\n\t);\n}\n\nexport { contentNegotiateRedirect, resolveLocale };\n",
|
|
@@ -48,18 +48,18 @@
|
|
|
48
48
|
"export * from './discovery';\nexport * from './generator';\n",
|
|
49
49
|
"import type { Span } from '@opentelemetry/api';\nimport { cloneElement, type ReactElement } from 'react';\nimport { renderToReadableStream } from 'react-dom/server';\nimport {\n\tgetTraceContextForInjection,\n\twithParentSpan,\n\twithSpan,\n} from 'reroute-js/telemetry/server';\nimport { loadConfig, type OGImageOptions, type OGOptions } from '../config';\nimport { appendLlmsAlternateHead } from '../llms/discovery';\nimport {\n\tcleanupPathScopedSSRData,\n\tcreateDataScript,\n\tcreateFeedsScript,\n\tcreateLlmsScript,\n\ttype Doc,\n\tgenerateCollectionScripts,\n\tperformSSRSetup,\n\ttype SSR,\n} from './lib';\nimport {\n\tdeduplicateMetaTags,\n\tloadIndexHtml,\n\tremoveOverriddenMetaTags,\n} from './lib/html';\nimport { isThenable } from './lib/imports';\nimport { splitTemplate } from './lib/template';\n\ntype StreamingSSROptions = {\n\tpathname: string;\n\trootComponent: ReactElement;\n\tclientDir: string;\n\tcwd: string;\n\tisWatchMode: boolean;\n\tbundleUrl: string;\n\tcachedCollections?: Record<string, unknown[]>;\n\tcachedThemeCSS?: string;\n\tcachedIndexHtml?: string;\n\tdebug?: boolean;\n\thead?: string;\n\tlang?: string;\n\tappId?: string;\n\tmaxAge?: number;\n\tsearchParams?: URLSearchParams;\n\togConfig?: OGImageOptions;\n\togMetaConfig?: OGOptions;\n\tbaseUrl?: string;\n\tautoCanonical?: boolean;\n\tparentSpan?: Span | null;\n\t/** Request headers from the incoming HTTP request */\n\theaders?: Record<string, string>;\n\t/** Maximum streaming timeout in milliseconds (default: 120000 / 120s) */\n\ttimeout?: number;\n\t/** Suffix to append to all page titles */\n\ttitleSuffix?: string;\n\t/** Hydrated i18n state (opt-in) */\n\ti18n?: Record<string, unknown>;\n};\n\ntype StreamingSSRResult = {\n\tstream: ReadableStream<Uint8Array>;\n\tstatus: number;\n};\n\n/**\n * Render a React component to a streaming HTML response.\n * Uses React 19's streaming with progressive Suspense resolution.\n */\nasync function renderSSRDocumentStream(\n\toptions: StreamingSSROptions,\n): Promise<StreamingSSRResult> {\n\tconst debug = options.debug ?? false;\n\tconst t0 = debug ? performance.now() : 0;\n\tconst {\n\t\tpathname,\n\t\trootComponent,\n\t\tclientDir,\n\t\tcwd,\n\t\tisWatchMode,\n\t\tbundleUrl,\n\t\thead = '',\n\t\tlang = 'en',\n\t\tappId = 'root',\n\t\tmaxAge = 0,\n\t\tsearchParams,\n\t\togConfig,\n\t} = options;\n\n\tif (debug) console.log(`[renderStream] ${pathname} - start: 0ms`);\n\n\t// Perform shared SSR setup\n\tconst setup = await performSSRSetup(\n\t\t{\n\t\t\tpathname,\n\t\t\tclientDir,\n\t\t\tcwd,\n\t\t\tisWatchMode,\n\t\t\tparentSpan: options.parentSpan,\n\t\t\tbundleUrl,\n\t\t\tmaxAge,\n\t\t\tsearchParams,\n\t\t\togConfig,\n\t\t\togMetaConfig: options.ogMetaConfig,\n\t\t\tbaseUrl: options.baseUrl,\n\t\t\tautoCanonical: options.autoCanonical,\n\t\t\tcachedCollections: options.cachedCollections,\n\t\t\tcachedThemeCSS: options.cachedThemeCSS,\n\t\t\tdebug,\n\t\t\theaders: options.headers,\n\t\t\ttitleSuffix: options.titleSuffix,\n\t\t\ttimeout: options.timeout,\n\t\t},\n\t\ttrue, // streaming mode\n\t);\n\tif (debug)\n\t\tconsole.log(\n\t\t\t`[renderStream] ${pathname} - performSSRSetup: ${(performance.now() - t0).toFixed(2)}ms`,\n\t\t);\n\n\t// Determine status (only override if value is set)\n\tlet statusOverride = setup.preloadStatusOverride;\n\tif (setup.statusContainer.value !== undefined) {\n\t\tstatusOverride = setup.statusContainer.value;\n\t}\n\tif (setup.metadataResult.statusOverride !== undefined) {\n\t\tstatusOverride = setup.metadataResult.statusOverride;\n\t}\n\n\t// Set up streaming\n\tconst encoder = new TextEncoder();\n\tconst { readable, writable } = new TransformStream<Uint8Array>();\n\tconst writer = writable.getWriter();\n\n\t// Load and split template (use cached if available)\n\tconst usingCache = !!options.cachedIndexHtml;\n\tconst { htmlHead, rootStart, rootEnd, htmlTail } = await withSpan(\n\t\t'ssr.load.template',\n\t\tasync (span) => {\n\t\t\tconst template = options.cachedIndexHtml\n\t\t\t\t? options.cachedIndexHtml\n\t\t\t\t: await loadIndexHtml(clientDir);\n\n\t\t\tspan.setAttribute('reroute.cached', usingCache);\n\t\t\tspan.setAttribute('reroute.template.size', template.length);\n\n\t\t\tif (debug)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`[renderStream] ${pathname} - loadIndexHtml (cached: ${usingCache}): ${(performance.now() - t0).toFixed(2)}ms`,\n\t\t\t\t);\n\n\t\t\tconst parts = splitTemplate(template, appId);\n\n\t\t\tif (debug)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`[renderStream] ${pathname} - splitTemplate: ${(performance.now() - t0).toFixed(2)}ms`,\n\t\t\t\t);\n\n\t\t\treturn {\n\t\t\t\t...parts,\n\t\t\t};\n\t\t},\n\t);\n\n\t// Build head with lang attribute (replace existing lang or add new one)\n\tconst i18nLocale = options.i18n?.enabled\n\t\t? String(options.i18n.locale || '')\n\t\t: '';\n\tconst pageLang = setup.metadataResult.pageLang || i18nLocale || lang;\n\tlet headWithLang = htmlHead.replace(/<html([^>]*)>/i, (_m, attrs: string) => {\n\t\tconst hasLang = /(^|\\s)lang\\s*=/.test(attrs);\n\t\tconst newAttrs = hasLang\n\t\t\t? attrs.replace(\n\t\t\t\t\t/lang\\s*=\\s*(\"[^\"]*\"|'[^']*'|[^\\s>]+)/i,\n\t\t\t\t\t`lang=\"${pageLang}\"`,\n\t\t\t\t)\n\t\t\t: `${attrs} lang=\"${pageLang}\"`;\n\t\treturn `<html${newAttrs}>`;\n\t});\n\n\t// Build extra head content\n\tconst extraHeadBase =\n\t\tsetup.bundlePreload +\n\t\tsetup.preloadExtraHead +\n\t\tsetup.metadataResult.perPageHead;\n\n\t// Remove default title/description from template if we have page-specific ones\n\tif (/<title[\\s\\S]*?<\\/title>/i.test(extraHeadBase)) {\n\t\theadWithLang = headWithLang.replace(/<title[\\s\\S]*?<\\/title>/i, '');\n\t}\n\tif (/<meta\\s+name\\s*=\\s*['\"]description['\"][^>]*>/i.test(extraHeadBase)) {\n\t\theadWithLang = headWithLang.replace(\n\t\t\t/<meta\\s+name\\s*=\\s*['\"]description['\"][^>]*>/i,\n\t\t\t'',\n\t\t);\n\t}\n\n\t// Remove OG/Twitter meta tags from template that will be overridden\n\theadWithLang = removeOverriddenMetaTags(headWithLang, extraHeadBase);\n\n\t// Load config to get browser telemetry settings\n\tconst config = await loadConfig(cwd);\n\tconst extraHead = appendLlmsAlternateHead(\n\t\textraHeadBase,\n\t\tpathname,\n\t\tstatusOverride || 200,\n\t\tconfig.llms,\n\t);\n\tconst browserTelemetryConfigRaw = config.telemetry?.browser as\n\t\t| Record<string, unknown>\n\t\t| undefined;\n\n\t// Serialize browser telemetry config (convert functions to strings for JSON)\n\tconst { serializeBrowserTelemetryConfig } = await import('./lib/serialize');\n\tconst browserTelemetryConfig = serializeBrowserTelemetryConfig(\n\t\tbrowserTelemetryConfigRaw,\n\t);\n\n\t// Extract trace context from parent span for distributed tracing\n\tconst traceContext = getTraceContextForInjection(options.parentSpan);\n\n\t// Start streaming in background\n\tstreamSSRContent(writer, encoder, {\n\t\trootComponent,\n\t\tpathname,\n\t\tsearchParams,\n\t\theadWithLang,\n\t\thead,\n\t\textraHead,\n\t\tinlineStyleTag: setup.inlineStyleTag,\n\t\tpageLang,\n\t\trootStart,\n\t\trootEnd,\n\t\thtmlTail,\n\t\tbundleUrl,\n\t\tisWatchMode,\n\t\tdebug,\n\t\tssrData: setup.ssrData,\n\t\tssrError: setup.ssrError,\n\t\tbyCollectionForSSR: setup.byCollectionForSSR,\n\t\tpreloadHydrationScript: setup.preloadHydrationScript,\n\t\tbrowserTelemetryConfig,\n\t\ttraceContext,\n\t\tparentSpan: options.parentSpan,\n\t\ttimeout: options.timeout,\n\t\tssrExport: setup.metadataResult.ssrExport,\n\t\ttitleSuffix: options.titleSuffix,\n\t\ti18n: options.i18n,\n\t});\n\n\tif (debug)\n\t\tconsole.log(\n\t\t\t`[renderStream] ${pathname} - returning stream: ${(performance.now() - t0).toFixed(2)}ms`,\n\t\t);\n\treturn { stream: readable, status: statusOverride || 200 };\n}\n\ntype StreamContext = {\n\trootComponent: ReactElement;\n\tpathname: string;\n\tsearchParams?: URLSearchParams;\n\theadWithLang: string;\n\thead: string;\n\textraHead: string;\n\tinlineStyleTag: string;\n\tpageLang: string;\n\trootStart: string;\n\trootEnd: string;\n\thtmlTail: string;\n\tbundleUrl: string;\n\tisWatchMode: boolean;\n\tdebug: boolean;\n\tssrData: Record<string, unknown>;\n\tssrError?: string;\n\tbyCollectionForSSR: Record<string, unknown[]>;\n\tpreloadHydrationScript: string;\n\tbrowserTelemetryConfig?: Record<string, unknown>;\n\ttraceContext?: { traceparent?: string; tracestate?: string };\n\tparentSpan?: Span | null;\n\ttimeout?: number;\n\t/** SSR export for dynamic head generation at stream end */\n\tssrExport?: SSR;\n\t/** Suffix to append to page titles */\n\ttitleSuffix?: string;\n\t/** Hydrated i18n state (opt-in) */\n\ti18n?: Record<string, unknown>;\n};\n\n/**\n * Stream SSR content progressively\n * NOTE: This runs during the HTTP request lifecycle - Elysia waits for the stream\n * to complete before calling onAfterResponse\n */\nasync function streamSSRContent(\n\twriter: WritableStreamDefaultWriter<Uint8Array>,\n\tencoder: TextEncoder,\n\tctx: StreamContext,\n): Promise<void> {\n\t// Execute within parent span context to properly nest spans\n\treturn withParentSpan(ctx.parentSpan, async () => {\n\t\tconst t0 = ctx.debug ? performance.now() : 0;\n\t\t// Set a maximum streaming timeout to prevent server hangs\n\t\t// This ensures the stream always completes even if React is waiting for promises\n\t\t// Default to 120 seconds, but allow configuration for long operations like AI analysis\n\t\tconst STREAM_TIMEOUT_MS = ctx.timeout ?? 120000;\n\t\tlet streamTimedOut = false;\n\t\tlet timeoutId: ReturnType<typeof setTimeout> | null = null;\n\n\t\tconst cleanup = () => {\n\t\t\tif (timeoutId) {\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\ttimeoutId = null;\n\t\t\t}\n\t\t};\n\n\t\ttry {\n\t\t\t// 1. Send HTML head immediately (shell)\n\t\t\tconst combinedHead = deduplicateMetaTags(\n\t\t\t\t[ctx.inlineStyleTag, ctx.head, ctx.extraHead]\n\t\t\t\t\t.filter(Boolean)\n\t\t\t\t\t.join('\\n'),\n\t\t\t);\n\t\t\t// Inject combined head BEFORE </head> (lang is already handled in headWithLang)\n\t\t\tconst headWithLangAndContent = ctx.headWithLang.replace(\n\t\t\t\t/<\\/head>/i,\n\t\t\t\t`${combinedHead ? `${combinedHead}\\n` : ''}</head>`,\n\t\t\t);\n\t\t\tconst headContent = `${headWithLangAndContent}`;\n\t\t\tawait writer.write(encoder.encode(headContent));\n\t\t\tif (ctx.debug)\n\t\t\t\tconsole.log(\n\t\t\t\t\t`[Stream] ${ctx.pathname} - first byte written: ${(performance.now() - t0).toFixed(2)}ms`,\n\t\t\t\t);\n\n\t\t\t// 2. Send root div start\n\t\t\tawait writer.write(encoder.encode(ctx.rootStart));\n\n\t\t\t// 3. Stream React content (both create and pipe)\n\t\t\t// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Stream creation and piping requires timeout handling\n\t\t\tawait withSpan('ssr.document.stream', async (span) => {\n\t\t\t\tconst componentWithPathname = cloneElement(ctx.rootComponent, {\n\t\t\t\t\tpathname: ctx.pathname,\n\t\t\t\t\tsearchParams: ctx.searchParams,\n\t\t\t\t} as Doc);\n\n\t\t\t\tspan.setAttribute('reroute.pathname', ctx.pathname);\n\n\t\t\t\tlet streamError: Error | null = null;\n\t\t\t\tconst streamPromise = renderToReadableStream(componentWithPathname, {\n\t\t\t\t\tonError(error) {\n\t\t\t\t\t\tconsole.error('[reroute] SSR stream error:', error);\n\t\t\t\t\t\tstreamError =\n\t\t\t\t\t\t\terror instanceof Error ? error : new Error(String(error));\n\t\t\t\t\t},\n\t\t\t\t}).catch((err) => {\n\t\t\t\t\tstreamError = err;\n\t\t\t\t\tthrow err;\n\t\t\t\t});\n\n\t\t\t\tconst reactStream = await streamPromise;\n\t\t\t\tif (streamError) throw streamError;\n\n\t\t\t\t// Pipe React stream to writer\n\t\t\t\t// Set up streaming timeout - if React takes too long, force close\n\t\t\t\tconst streamTimeoutPromise = new Promise<{\n\t\t\t\t\tdone: true;\n\t\t\t\t\tvalue: undefined;\n\t\t\t\t}>((resolve) => {\n\t\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`[reroute] Stream timeout after ${STREAM_TIMEOUT_MS}ms for ${ctx.pathname}, forcing close`,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tstreamTimedOut = true;\n\t\t\t\t\t\tresolve({ done: true, value: undefined });\n\t\t\t\t\t}, STREAM_TIMEOUT_MS);\n\t\t\t\t});\n\n\t\t\t\tconst reader = reactStream.getReader();\n\t\t\t\tlet chunkCount = 0;\n\t\t\t\twhile (true) {\n\t\t\t\t\t// Race between getting next chunk and timeout\n\t\t\t\t\tconst result = await Promise.race([\n\t\t\t\t\t\treader.read(),\n\t\t\t\t\t\tstreamTimeoutPromise,\n\t\t\t\t\t]);\n\n\t\t\t\t\tif (result.done || streamTimedOut) {\n\t\t\t\t\t\tif (streamTimedOut) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait reader.cancel(\n\t\t\t\t\t\t\t\t\t`[reroute] stream timeout for ${ctx.pathname}`,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Release the reader lock before breaking\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\treader.releaseLock();\n\t\t\t\t\t\t} catch {}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif (result.value) {\n\t\t\t\t\t\t// Decode, obfuscate emails, and re-encode if needed\n\t\t\t\t\t\tawait writer.write(result.value);\n\t\t\t\t\t\tchunkCount++;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcleanup();\n\n\t\t\t\tspan.setAttributes({\n\t\t\t\t\t'reroute.stream.chunks': chunkCount,\n\t\t\t\t\t'reroute.stream.timedOut': streamTimedOut,\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tif (streamTimedOut) {\n\t\t\t\tcleanupPathScopedSSRData(ctx.pathname);\n\t\t\t}\n\n\t\t\t// 4. Close root div\n\t\t\tawait writer.write(encoder.encode(ctx.rootEnd));\n\n\t\t\t// 5. Generate scripts\n\t\t\tconst allScripts = await withSpan(\n\t\t\t\t'ssr.generate.scripts',\n\t\t\t\tasync (span) => {\n\t\t\t\t\tconst scripts = buildStreamingScripts(ctx);\n\t\t\t\t\tspan.setAttribute('reroute.script_size', scripts.length);\n\t\t\t\t\treturn scripts;\n\t\t\t\t},\n\t\t\t);\n\t\t\tawait writer.write(encoder.encode(allScripts + ctx.htmlTail));\n\t\t\tawait writer.close();\n\t\t} catch (error) {\n\t\t\tcleanup();\n\t\t\tcleanupPathScopedSSRData(ctx.pathname);\n\t\t\tconsole.error('[reroute] Stream error:', error);\n\t\t\ttry {\n\t\t\t\tawait writer.abort(error);\n\t\t\t} catch {\n\t\t\t\t// Writer might already be closed\n\t\t\t}\n\t\t}\n\t});\n}\n\n/**\n * Build all scripts for streaming SSR\n */\nfunction buildStreamingScripts(ctx: StreamContext): string {\n\t// Generate collection scripts\n\tconst collectionScripts = generateCollectionScripts(ctx.byCollectionForSSR);\n\n\t// Create snapshot of resolved SSR data\n\tconst ssrDataSnapshot: Record<string, unknown> = {};\n\tfor (const key of Object.keys(ctx.ssrData)) {\n\t\tconst value = ctx.ssrData[key];\n\t\tif (!isThenable(value)) {\n\t\t\tssrDataSnapshot[key] = value;\n\t\t}\n\t}\n\n\t// Build scripts\n\tconst dataScript = createDataScript(\n\t\tssrDataSnapshot,\n\t\tctx.isWatchMode ? ctx.ssrError : undefined,\n\t\tctx.pathname,\n\t\tctx.browserTelemetryConfig,\n\t\tctx.traceContext,\n\t\tctx.titleSuffix,\n\t\tctx.i18n,\n\t);\n\tconst feedsScript = createFeedsScript();\n\tconst llmsScript = createLlmsScript();\n\n\tlet allScripts =\n\t\tdataScript +\n\t\tfeedsScript +\n\t\tllmsScript +\n\t\tcollectionScripts +\n\t\tctx.preloadHydrationScript;\n\n\t// Generate meta update script if route has dynamic head function\n\tconst metaUpdateScript = generateMetaUpdateScript(ctx, ssrDataSnapshot);\n\tif (metaUpdateScript) {\n\t\tallScripts += metaUpdateScript;\n\t}\n\n\t// Add bundle script\n\tallScripts += `<script type=\"module\" src=\"${ctx.bundleUrl}\"></script>`;\n\n\t// Add dev watcher\n\tif (ctx.isWatchMode) {\n\t\tallScripts += `<script type=\"module\" src=\"/__reroute_watch.js\"></script>`;\n\t}\n\n\treturn allScripts;\n}\n\n/**\n * Apply titleSuffix to title-related fields in meta updates\n */\nfunction applyTitleSuffixToMetaUpdates(\n\tmetaUpdates: Record<string, string>,\n\ttitleSuffix: string,\n): void {\n\tif (metaUpdates.title && !metaUpdates.title.endsWith(titleSuffix)) {\n\t\tmetaUpdates.title = metaUpdates.title + titleSuffix;\n\t}\n\tif (\n\t\tmetaUpdates['og:title'] &&\n\t\t!metaUpdates['og:title'].endsWith(titleSuffix)\n\t) {\n\t\tmetaUpdates['og:title'] = metaUpdates['og:title'] + titleSuffix;\n\t}\n\tif (\n\t\tmetaUpdates['twitter:title'] &&\n\t\t!metaUpdates['twitter:title'].endsWith(titleSuffix)\n\t) {\n\t\tmetaUpdates['twitter:title'] = metaUpdates['twitter:title'] + titleSuffix;\n\t}\n}\n\n/**\n * Generate a script to update head meta tags at stream end.\n * This is used when streaming SSR needs to update dynamic meta tags\n * after data has resolved.\n */\nfunction generateMetaUpdateScript(\n\tctx: StreamContext,\n\tssrDataSnapshot: Record<string, unknown>,\n): string {\n\t// Only generate if route has dynamic head function\n\tif (typeof ctx.ssrExport?.head !== 'function') {\n\t\treturn '';\n\t}\n\n\t// Get the resolved route data\n\tconst routeData = ssrDataSnapshot[ctx.pathname];\n\tif (!routeData) {\n\t\treturn '';\n\t}\n\n\t// Call the head function with resolved data\n\tlet headResult: string | string[] | undefined;\n\ttry {\n\t\theadResult = ctx.ssrExport.head({ data: routeData });\n\t} catch (err) {\n\t\tconsole.error('[reroute] Error calling ssr.head() at stream end:', err);\n\t\treturn '';\n\t}\n\n\tif (!headResult) {\n\t\treturn '';\n\t}\n\n\t// Convert to string\n\tconst headHtml = Array.isArray(headResult)\n\t\t? headResult.join('\\n')\n\t\t: headResult;\n\tif (!headHtml) {\n\t\treturn '';\n\t}\n\n\t// Parse the head HTML to extract meta tag values\n\tconst metaUpdates = parseHeadForMetaUpdates(headHtml);\n\tif (Object.keys(metaUpdates).length === 0) {\n\t\treturn '';\n\t}\n\n\t// Apply titleSuffix to title and related meta tags\n\tif (ctx.titleSuffix) {\n\t\tapplyTitleSuffixToMetaUpdates(metaUpdates, ctx.titleSuffix);\n\t}\n\n\t// Generate inline script to update the head\n\tconst updatesJson = JSON.stringify(metaUpdates);\n\treturn `<script>(function(){var u=${updatesJson};if(u.title){document.title=u.title}Object.keys(u).forEach(function(k){if(k==='title')return;var s=k.split(':');var isOg=s[0]==='og'||s[0]==='twitter';var el=isOg?document.querySelector('meta[property=\"'+k+'\"]')||document.querySelector('meta[name=\"'+k+'\"]'):document.querySelector('meta[name=\"'+k+'\"]');if(el){el.setAttribute('content',u[k])}else{var m=document.createElement('meta');m.setAttribute(isOg?'property':'name',k);m.setAttribute('content',u[k]);document.head.appendChild(m)}})})()</script>`;\n}\n\n/**\n * Parse head HTML to extract values for meta tag updates\n */\nfunction parseHeadForMetaUpdates(headHtml: string): Record<string, string> {\n\tconst updates: Record<string, string> = {};\n\n\t// Extract title\n\tconst titleMatch = headHtml.match(/<title[^>]*>(.*?)<\\/title>/is);\n\tif (titleMatch?.[1]) {\n\t\tupdates.title = unescapeHtmlEntities(titleMatch[1].trim());\n\t}\n\n\t// Extract meta description\n\tlet descMatch = headHtml.match(\n\t\t/<meta\\s+name=[\"']description[\"']\\s+content=[\"'](.+?)[\"']/i,\n\t);\n\tif (!descMatch) {\n\t\tdescMatch = headHtml.match(\n\t\t\t/<meta\\s+content=[\"'](.+?)[\"']\\s+name=[\"']description[\"']/i,\n\t\t);\n\t}\n\tif (descMatch?.[1]) {\n\t\tupdates.description = unescapeHtmlEntities(descMatch[1].trim());\n\t}\n\n\t// Extract og:title\n\tlet ogTitleMatch = headHtml.match(\n\t\t/<meta\\s+property=[\"']og:title[\"']\\s+content=[\"'](.+?)[\"']/i,\n\t);\n\tif (!ogTitleMatch) {\n\t\togTitleMatch = headHtml.match(\n\t\t\t/<meta\\s+content=[\"'](.+?)[\"']\\s+property=[\"']og:title[\"']/i,\n\t\t);\n\t}\n\tif (ogTitleMatch?.[1]) {\n\t\tupdates['og:title'] = unescapeHtmlEntities(ogTitleMatch[1].trim());\n\t} else if (updates.title) {\n\t\t// Fallback: use title for og:title\n\t\tupdates['og:title'] = updates.title;\n\t}\n\n\t// Extract og:description\n\tlet ogDescMatch = headHtml.match(\n\t\t/<meta\\s+property=[\"']og:description[\"']\\s+content=[\"'](.+?)[\"']/i,\n\t);\n\tif (!ogDescMatch) {\n\t\togDescMatch = headHtml.match(\n\t\t\t/<meta\\s+content=[\"'](.+?)[\"']\\s+property=[\"']og:description[\"']/i,\n\t\t);\n\t}\n\tif (ogDescMatch?.[1]) {\n\t\tupdates['og:description'] = unescapeHtmlEntities(ogDescMatch[1].trim());\n\t} else if (updates.description) {\n\t\t// Fallback: use description for og:description\n\t\tupdates['og:description'] = updates.description;\n\t}\n\n\t// Extract twitter:title\n\tlet twitterTitleMatch = headHtml.match(\n\t\t/<meta\\s+name=[\"']twitter:title[\"']\\s+content=[\"'](.+?)[\"']/i,\n\t);\n\tif (!twitterTitleMatch) {\n\t\ttwitterTitleMatch = headHtml.match(\n\t\t\t/<meta\\s+content=[\"'](.+?)[\"']\\s+name=[\"']twitter:title[\"']/i,\n\t\t);\n\t}\n\tif (twitterTitleMatch?.[1]) {\n\t\tupdates['twitter:title'] = unescapeHtmlEntities(\n\t\t\ttwitterTitleMatch[1].trim(),\n\t\t);\n\t} else if (updates.title) {\n\t\t// Fallback: use title for twitter:title\n\t\tupdates['twitter:title'] = updates.title;\n\t}\n\n\t// Extract twitter:description\n\tlet twitterDescMatch = headHtml.match(\n\t\t/<meta\\s+name=[\"']twitter:description[\"']\\s+content=[\"'](.+?)[\"']/i,\n\t);\n\tif (!twitterDescMatch) {\n\t\ttwitterDescMatch = headHtml.match(\n\t\t\t/<meta\\s+content=[\"'](.+?)[\"']\\s+name=[\"']twitter:description[\"']/i,\n\t\t);\n\t}\n\tif (twitterDescMatch?.[1]) {\n\t\tupdates['twitter:description'] = unescapeHtmlEntities(\n\t\t\ttwitterDescMatch[1].trim(),\n\t\t);\n\t} else if (updates.description) {\n\t\t// Fallback: use description for twitter:description\n\t\tupdates['twitter:description'] = updates.description;\n\t}\n\n\treturn updates;\n}\n\n/**\n * Unescape HTML entities\n */\nfunction unescapeHtmlEntities(str: string): string {\n\treturn str\n\t\t.replace(/"/g, '\"')\n\t\t.replace(/'/g, \"'\")\n\t\t.replace(/</g, '<')\n\t\t.replace(/>/g, '>')\n\t\t.replace(/&/g, '&');\n}\n\nexport { renderSSRDocumentStream };\nexport type { StreamingSSROptions, StreamingSSRResult };\n",
|
|
50
50
|
"export * from './lib';\nexport * from './render';\nexport * from './stream';\n",
|
|
51
|
-
"export * from './app-paths';\nexport * from './bundler';\nexport * from './config';\nexport * from './content';\nexport * from './i18n';\nexport * from './llms';\nexport * from './og';\nexport * from './robots';\nexport * from './rss';\nexport * from './sitemap';\nexport * from './ssr';\n",
|
|
51
|
+
"export * from './app-paths';\nexport * from './bundler';\nexport * from './config';\nexport * from './content';\nexport * from './i18n';\nexport * from './image';\nexport * from './llms';\nexport * from './og';\nexport * from './robots';\nexport * from './rss';\nexport * from './sitemap';\nexport * from './ssr';\n",
|
|
52
52
|
"export * from './src';\n",
|
|
53
53
|
"import { existsSync } from 'node:fs';\nimport { join } from 'node:path';\n\n/**\n * Get the reroute command to execute\n * Handles both development mode (running from source) and installed mode\n */\nexport function getRerouteCommand(): string {\n\t// Check if we're running from source (development mode)\n\t// Look for bin.ts in the expected location relative to this file\n\tconst binPath = join(import.meta.dir, '..', '..', 'bin.ts');\n\tconst isBunDev = existsSync(binPath);\n\n\tif (isBunDev) {\n\t\t// Running via bun during development from source\n\t\treturn `bun ${binPath}`;\n\t}\n\n\t// Check for reroute binary in node_modules/.bin, checking up to 3 levels up\n\tconst cwd = process.cwd();\n\tconst nodeModulesPaths = [\n\t\tjoin(cwd, 'node_modules', '.bin', 'reroute'),\n\t\tjoin(cwd, '..', 'node_modules', '.bin', 'reroute'),\n\t\tjoin(cwd, '..', '..', 'node_modules', '.bin', 'reroute'),\n\t\tjoin(cwd, '..', '..', '..', 'node_modules', '.bin', 'reroute'),\n\t];\n\n\tfor (const binPath of nodeModulesPaths) {\n\t\tif (existsSync(binPath)) {\n\t\t\treturn binPath;\n\t\t}\n\t}\n\n\t// Fallback: assume reroute is installed globally and available in PATH\n\treturn 'reroute';\n}\n",
|
|
54
54
|
"/**\n * Log colorization utilities\n *\n * Provides colorization for log prefixes in both blessed (TUI) and ANSI (console) formats.\n * Consumers can use [api] and [app] prefixes to differentiate their application logs.\n */\n\n/**\n * Map of prefix patterns to blessed color tags\n * Each prefix has a unique color for easy visual distinction\n */\nconst PREFIX_COLORS: Record<string, string> = {\n\t'[reroute]': '{cyan-fg}', // Base reroute logs - cyan\n\t'[reroute/gen]': '{bright-blue-fg}', // Generator - bright blue\n\t'[reroute/content]': '{magenta-fg}', // Content - magenta\n\t'[reroute/markdown]': '{yellow-fg}', // Markdown - yellow\n\t'[reroute/theme]': '{red-fg}', // Theme CSS - red\n\t'[reroute/mdx]': '{bright-red-fg}', // MDX - bright red\n\t'[reroute/dev]': '{green-fg}', // Dev command - green\n\t'[reroute/start]': '{bright-cyan-fg}', // Start command - bright cyan\n\t'[reroute/build]': '{bright-magenta-fg}', // Build command - bright magenta\n\t'[reroute/analyze]': '{bright-green-fg}', // Analyze command - bright green\n\t'[api]': '{blue-fg}', // API logs - blue\n\t'[app]': '{bright-green-fg}', // App logs - bright green\n};\n\n/**\n * Colorize log prefixes using blessed color tags (for TUI output)\n *\n * @param text - The log text to colorize\n * @returns Text with colorized prefixes using blessed tags\n */\nexport function colorizeLogPrefix(text: string): string {\n\tlet colored = text;\n\t// Sort prefixes by length (longest first) to match more specific prefixes before general ones\n\t// e.g., [reroute/markdown] should match before [reroute]\n\tconst sortedPrefixes = Object.entries(PREFIX_COLORS).sort(\n\t\t([a], [b]) => b.length - a.length,\n\t);\n\n\tfor (const [prefix, colorTag] of sortedPrefixes) {\n\t\t// Replace prefix with colored version\n\t\tcolored = colored.replace(\n\t\t\tnew RegExp(`(${prefix.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')})`, 'g'),\n\t\t\t`${colorTag}$1{/}`,\n\t\t);\n\t}\n\n\treturn colored;\n}\n\n/**\n * Convert blessed color tags to ANSI escape codes (for console output)\n *\n * @param text - Text with blessed color tags\n * @returns Text with ANSI escape codes\n */\nexport function blessedToAnsi(text: string): string {\n\treturn (\n\t\ttext\n\t\t\t// Standard colors\n\t\t\t.replace(/\\{cyan-fg\\}/g, '\\x1b[36m')\n\t\t\t.replace(/\\{blue-fg\\}/g, '\\x1b[34m')\n\t\t\t.replace(/\\{magenta-fg\\}/g, '\\x1b[35m')\n\t\t\t.replace(/\\{yellow-fg\\}/g, '\\x1b[33m')\n\t\t\t.replace(/\\{green-fg\\}/g, '\\x1b[32m')\n\t\t\t.replace(/\\{red-fg\\}/g, '\\x1b[31m')\n\t\t\t// Bright colors\n\t\t\t.replace(/\\{bright-cyan-fg\\}/g, '\\x1b[96m')\n\t\t\t.replace(/\\{bright-blue-fg\\}/g, '\\x1b[94m')\n\t\t\t.replace(/\\{bright-magenta-fg\\}/g, '\\x1b[95m')\n\t\t\t.replace(/\\{bright-yellow-fg\\}/g, '\\x1b[93m')\n\t\t\t.replace(/\\{bright-green-fg\\}/g, '\\x1b[92m')\n\t\t\t.replace(/\\{bright-red-fg\\}/g, '\\x1b[91m')\n\t\t\t.replace(/\\{\\/\\}/g, '\\x1b[0m')\n\t);\n}\n\n/**\n * Colorize log prefixes and convert to ANSI codes (for console output)\n *\n * @param text - The log text to colorize\n * @returns Text with colorized prefixes using ANSI escape codes\n */\nexport function colorizeLogPrefixAnsi(text: string): string {\n\treturn blessedToAnsi(colorizeLogPrefix(text));\n}\n\n/**\n * Create a handler function for server output that colorizes logs\n *\n * @param buffer - Reference to a buffer string for incomplete lines\n * @returns Handler function for Buffer data\n */\nexport function createServerOutputHandler(buffer: { current: string }) {\n\treturn (data: Buffer) => {\n\t\tconst text = buffer.current + data.toString();\n\t\tconst lines = text.split('\\n');\n\t\tbuffer.current = lines.pop() || ''; // Keep last incomplete line\n\n\t\tfor (const line of lines) {\n\t\t\t// Skip empty lines\n\t\t\tconst trimmedLine = line.trim();\n\t\t\tif (!trimmedLine) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Colorize the line (preserves existing prefixes or leaves unprefixed lines as-is)\n\t\t\tconst ansiColored = colorizeLogPrefixAnsi(line);\n\t\t\tconsole.log(ansiColored);\n\t\t}\n\t};\n}\n",
|
|
55
55
|
"/**\n * Markdown integration utility\n *\n * Manages markdown and syntax highlighting packages for the Reroute framework\n */\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { dirname, join } from 'node:path';\n\n/**\n * Check if a package is available in package.json, searching up to 5 parent directories\n */\nfunction isPackageAvailable(cwd: string, packageName: string): boolean {\n\tlet currentDir = cwd;\n\n\t// Check up to 5 levels up\n\tfor (let i = 0; i < 5; i++) {\n\t\tconst packageJsonPath = join(currentDir, 'package.json');\n\n\t\tif (existsSync(packageJsonPath)) {\n\t\t\ttry {\n\t\t\t\tconst packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n\t\t\t\tconst deps = {\n\t\t\t\t\t...packageJson.dependencies,\n\t\t\t\t\t...packageJson.devDependencies,\n\t\t\t\t\t...packageJson.peerDependencies,\n\t\t\t\t};\n\n\t\t\t\tif (packageName in deps) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Continue to parent directory\n\t\t\t}\n\t\t}\n\n\t\tconst parentDir = dirname(currentDir);\n\t\t// Stop if we've reached the root\n\t\tif (parentDir === currentDir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrentDir = parentDir;\n\t}\n\n\treturn false;\n}\n\n/**\n * Check if streamdown is available in the project\n */\nfunction isStreamdownAvailable(cwd: string): boolean {\n\treturn isPackageAvailable(cwd, 'streamdown');\n}\n\n/**\n * Check if Shiki is available in the project (deprecated: now built into streamdown)\n */\nfunction isShikiAvailable(cwd: string): boolean {\n\treturn isPackageAvailable(cwd, '@shikijs/rehype');\n}\n\n/**\n * @deprecated Streamdown includes GFM support built-in\n * Check if remark-gfm (GitHub Flavored Markdown) is available\n */\nfunction isRemarkGfmAvailable(cwd: string): boolean {\n\treturn isPackageAvailable(cwd, 'remark-gfm');\n}\n\n/**\n * Check if @mdx-js/mdx is available in the project\n */\nfunction isMdxAvailable(cwd: string): boolean {\n\treturn isPackageAvailable(cwd, '@mdx-js/mdx');\n}\n\n/**\n * Get markdown configuration status for the project\n */\nexport function getMarkdownConfig(cwd: string) {\n\tconst hasStreamdown = isStreamdownAvailable(cwd);\n\tconst hasShiki = isShikiAvailable(cwd);\n\tconst hasRemarkGfm = isRemarkGfmAvailable(cwd);\n\tconst hasMdx = isMdxAvailable(cwd);\n\n\treturn {\n\t\thasStreamdown,\n\t\thasShiki,\n\t\thasRemarkGfm,\n\t\thasMdx,\n\t\tisConfigured: hasStreamdown,\n\t};\n}\n\n/**\n * Log markdown configuration status\n */\nexport function logMarkdownStatus(cwd: string): void {\n\tconst config = getMarkdownConfig(cwd);\n\n\tif (config.isConfigured) {\n\t\tconsole.log(\n\t\t\t'[reroute/markdown] Streamdown available (GFM, syntax highlighting, math, mermaid built-in)',\n\t\t);\n\t\tif (config.hasMdx) {\n\t\t\tconsole.log('[reroute/markdown] MDX compiler enabled (JSX in markdown)');\n\t\t}\n\t}\n}\n\n/**\n * Check if markdown packages are configured and log status\n */\nexport function checkMarkdownIfConfigured(cwd: string): boolean {\n\ttry {\n\t\tconst config = getMarkdownConfig(cwd);\n\t\tif (config.isConfigured) {\n\t\t\tlogMarkdownStatus(cwd);\n\t\t}\n\t\treturn config.isConfigured;\n\t} catch (e) {\n\t\tconsole.warn('[reroute/markdown] check failed:', e);\n\t\treturn false;\n\t}\n}\n",
|
|
56
56
|
"/**\n * Markdown/MDX processor for route files\n *\n * Processes .md and .mdx files with frontmatter support for use in the routing system\n */\n\nimport { existsSync, readFileSync } from 'node:fs';\nimport { basename, dirname, extname, join, relative, resolve } from 'node:path';\nimport matter from 'gray-matter';\n\n// biome-ignore lint/suspicious/noExplicitAny: yes\ntype Any = any;\n\n/**\n * HTML attribute to JSX prop mapping\n */\nconst htmlToJsxAttributes: Record<string, string> = {\n\tclass: 'className',\n\tfor: 'htmlFor',\n\t'accept-charset': 'acceptCharset',\n\t'http-equiv': 'httpEquiv',\n\taccesskey: 'accessKey',\n\tcontenteditable: 'contentEditable',\n\tcrossorigin: 'crossOrigin',\n\ttabindex: 'tabIndex',\n\t// SVG attributes\n\t'stroke-width': 'strokeWidth',\n\t'stroke-linecap': 'strokeLinecap',\n\t'stroke-linejoin': 'strokeLinejoin',\n\t'stroke-miterlimit': 'strokeMiterlimit',\n\t'stroke-dasharray': 'strokeDasharray',\n\t'stroke-dashoffset': 'strokeDashoffset',\n\t'stroke-opacity': 'strokeOpacity',\n\t'fill-opacity': 'fillOpacity',\n\t'fill-rule': 'fillRule',\n\t'clip-path': 'clipPath',\n\t'clip-rule': 'clipRule',\n\t'font-family': 'fontFamily',\n\t'font-size': 'fontSize',\n\t'font-weight': 'fontWeight',\n\t'text-anchor': 'textAnchor',\n\t'text-decoration': 'textDecoration',\n\t'vector-effect': 'vectorEffect',\n};\n\nfunction convertPropertiesToJsx(\n\tproperties: Record<string, Any>,\n): Record<string, Any> {\n\tconst newProperties: Record<string, Any> = {};\n\tfor (const [key, value] of Object.entries(properties)) {\n\t\tconst jsxKey = htmlToJsxAttributes[key] || key;\n\t\tnewProperties[jsxKey] = value;\n\t}\n\treturn newProperties;\n}\n\nfunction visitNode(node: Any): void {\n\tif (node.type === 'element' && node.properties) {\n\t\tnode.properties = convertPropertiesToJsx(node.properties);\n\t}\n\tif (node.children) {\n\t\tfor (const child of node.children) {\n\t\t\tvisitNode(child);\n\t\t}\n\t}\n}\n\n/**\n * Rehype plugin to convert HTML attributes to React JSX props\n */\nfunction rehypeHtmlToJsx() {\n\treturn (tree: Any) => {\n\t\tvisitNode(tree);\n\t\treturn tree;\n\t};\n}\n\nexport interface MarkdownFrontmatter {\n\ttitle?: string;\n\tdescription?: string;\n\tdate?: string;\n\tslug?: string;\n\texcerpt?: string;\n\tdraft?: boolean;\n\t[key: string]: Any;\n}\n\nexport interface ProcessedMarkdown {\n\tfrontmatter: MarkdownFrontmatter;\n\tcontent: string;\n\trawContent: string;\n\thasJSX: boolean;\n}\n\nexport interface HeadingNode {\n\tlevel: number;\n\ttext: string;\n\tslug: string;\n}\n\n/**\n * Frontmatter parser using gray-matter\n * Extracts metadata from markdown files between --- delimiters\n * Supports YAML data types: strings, numbers, booleans, arrays, objects, null\n */\nfunction parseFrontmatter(content: string): {\n\tdata: MarkdownFrontmatter;\n\tcontent: string;\n} {\n\ttry {\n\t\tconst { data, content: markdownContent } = matter(content);\n\t\treturn { data, content: markdownContent };\n\t} catch (error) {\n\t\tconsole.warn('[reroute/frontmatter] Failed to parse frontmatter:', error);\n\t\treturn { data: {}, content };\n\t}\n}\n\n/**\n * Check if markdown content contains JSX syntax\n */\nfunction hasJSXSyntax(content: string): boolean {\n\t// Simple heuristic: look for JSX-like patterns\n\tconst jsxPatterns = [\n\t\t/<[A-Z][a-zA-Z0-9]*/, // Component tags like <Component>\n\t\t/import\\s+{[^}]+}\\s+from/, // ES6 imports\n\t\t/import\\s+\\w+\\s+from/, // Default imports\n\t\t/export\\s+(default|const|function)/, // Exports\n\t\t/<\\w+\\s+\\w+={/, // Props with curly braces\n\t];\n\n\treturn jsxPatterns.some((pattern) => pattern.test(content));\n}\n\n/**\n * Process a markdown/MDX file and return structured data\n */\nexport function processMarkdownFile(filePath: string): ProcessedMarkdown {\n\tconst rawContent = readFileSync(filePath, 'utf-8');\n\tconst { data, content } = parseFrontmatter(rawContent);\n\tconst hasJSX = hasJSXSyntax(content);\n\n\treturn {\n\t\tfrontmatter: data,\n\t\tcontent,\n\t\trawContent,\n\t\thasJSX,\n\t};\n}\n\n/**\n * Check if @mdx-js/mdx is available in the project\n */\nfunction isMdxAvailable(cwd: string): boolean {\n\tlet currentDir = cwd;\n\n\t// Check up to 5 levels up\n\tfor (let i = 0; i < 5; i++) {\n\t\tconst packageJsonPath = join(currentDir, 'package.json');\n\n\t\tif (existsSync(packageJsonPath)) {\n\t\t\ttry {\n\t\t\t\tconst packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));\n\t\t\t\tconst deps = {\n\t\t\t\t\t...packageJson.dependencies,\n\t\t\t\t\t...packageJson.devDependencies,\n\t\t\t\t\t...packageJson.peerDependencies,\n\t\t\t\t};\n\n\t\t\t\tif ('@mdx-js/mdx' in deps) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} catch {\n\t\t\t\t// Continue to parent directory\n\t\t\t}\n\t\t}\n\n\t\tconst parentDir = dirname(currentDir);\n\t\t// Stop if we've reached the root\n\t\tif (parentDir === currentDir) {\n\t\t\tbreak;\n\t\t}\n\t\tcurrentDir = parentDir;\n\t}\n\n\treturn false;\n}\n\nfunction tryLoadModule(cwd: string, moduleName: string): Any {\n\tconst pathsToTry = [\n\t\tjoin(cwd, `node_modules/${moduleName}`),\n\t\tjoin(cwd, `../node_modules/${moduleName}`),\n\t\tjoin(cwd, `../../node_modules/${moduleName}`),\n\t\tjoin(cwd, `../../../node_modules/${moduleName}`),\n\t];\n\n\tfor (const modulePath of pathsToTry) {\n\t\ttry {\n\t\t\treturn require(modulePath);\n\t\t} catch {\n\t\t\t// Try next path\n\t\t}\n\t}\n\treturn null;\n}\n\nfunction loadMdxCompiler(cwd: string): Any {\n\tconst mdxModule = tryLoadModule(cwd, '@mdx-js/mdx');\n\tif (!mdxModule) {\n\t\tconsole.error('[reroute/mdx] Could not load @mdx-js/mdx from any path');\n\t\treturn null;\n\t}\n\treturn mdxModule.compile;\n}\n\nfunction setupRemarkPlugins(cwd: string, enableGfm: boolean): Any[] {\n\tconst remarkPlugins = [] as Any[];\n\n\tif (!enableGfm) return remarkPlugins;\n\n\tconst remarkGfm = tryLoadModule(cwd, 'remark-gfm');\n\tif (remarkGfm) {\n\t\tremarkPlugins.push(remarkGfm.default || remarkGfm);\n\t} else {\n\t\tconsole.warn(\n\t\t\t'[reroute/mdx] remark-gfm not available for MDX compilation (Streamdown includes GFM for .md files)',\n\t\t);\n\t}\n\n\treturn remarkPlugins;\n}\n\nfunction setupRehypePlugins(cwd: string, theme: string): Any[] {\n\tconst rehypePlugins = [] as Any[];\n\n\tconst rehypeRaw = tryLoadModule(cwd, 'rehype-raw');\n\tif (rehypeRaw) {\n\t\trehypePlugins.push([\n\t\t\trehypeRaw.default || rehypeRaw,\n\t\t\t{\n\t\t\t\tpassThrough: [\n\t\t\t\t\t'mdxFlowExpression',\n\t\t\t\t\t'mdxJsxFlowElement',\n\t\t\t\t\t'mdxJsxTextElement',\n\t\t\t\t\t'mdxTextExpression',\n\t\t\t\t\t'mdxjsEsm',\n\t\t\t\t],\n\t\t\t},\n\t\t]);\n\t\trehypePlugins.push(rehypeHtmlToJsx);\n\t}\n\n\tconst rehypeShiki = tryLoadModule(cwd, '@shikijs/rehype');\n\tif (rehypeShiki) {\n\t\trehypePlugins.push([rehypeShiki.default || rehypeShiki, { theme }]);\n\t} else {\n\t\tconsole.warn(\n\t\t\t'[reroute/mdx] @shikijs/rehype not available, skipping highlighting',\n\t\t);\n\t}\n\n\treturn rehypePlugins;\n}\n\nfunction formatMdxError(error: unknown, options: { filename?: string }): void {\n\tconst errorMessage = error instanceof Error ? error.message : String(error);\n\tconst errorLocation =\n\t\terror &&\n\t\ttypeof error === 'object' &&\n\t\t'place' in error &&\n\t\terror.place &&\n\t\ttypeof error.place === 'object'\n\t\t\t? `at line ${(error.place as Any).line || '?'}, column ${(error.place as Any).column || '?'}`\n\t\t\t: '';\n\tconst fileInfo = options.filename ? ` in ${options.filename}` : '';\n\n\tconsole.warn(\n\t\t`[reroute/mdx] Compilation failed${fileInfo}${errorLocation ? ` ${errorLocation}` : ''}: ${errorMessage}`,\n\t);\n\tconsole.warn(\n\t\t'[reroute/mdx] MDX compilation failed (Streamdown will handle .md files)',\n\t);\n}\n\n/**\n * Compile MDX content to JSX using @mdx-js/mdx\n */\nasync function compileMdx(\n\tcontent: string,\n\tcwd: string,\n\toptions: {\n\t\tenableGfm?: boolean;\n\t\ttheme?: string;\n\t\tfilename?: string;\n\t} = {},\n): Promise<string | null> {\n\tif (!isMdxAvailable(cwd)) {\n\t\tconsole.warn(\n\t\t\t'[reroute/mdx] @mdx-js/mdx not installed. Install with: bun add @mdx-js/mdx',\n\t\t);\n\t\treturn null;\n\t}\n\n\ttry {\n\t\tconst compile = loadMdxCompiler(cwd);\n\t\tif (!compile) return null;\n\n\t\tconst { enableGfm = true, theme = 'github-dark' } = options;\n\n\t\tconst remarkPlugins = setupRemarkPlugins(cwd, enableGfm);\n\t\tconst rehypePlugins = setupRehypePlugins(cwd, theme);\n\n\t\tconst result = await compile(content, {\n\t\t\tremarkPlugins,\n\t\t\trehypePlugins,\n\t\t\toutputFormat: 'program',\n\t\t\tdevelopment: false,\n\t\t});\n\n\t\treturn String(result);\n\t} catch (error) {\n\t\tformatMdxError(error, options);\n\t\treturn null;\n\t}\n}\n\n/**\n * Rewrite relative imports in compiled MDX to be correct from the target location\n */\nfunction rewriteImportPaths(\n\tcode: string,\n\tsourcePath: string,\n\ttargetPath: string,\n): string {\n\t// Find all import statements with relative paths\n\tconst importRegex =\n\t\t/import\\s+(?:{[^}]+}|[\\w\\s,]+)\\s+from\\s+['\"](\\.[^'\"]+)['\"]/g;\n\n\treturn code.replace(importRegex, (match, importPath) => {\n\t\t// Resolve the import path relative to the source file\n\t\tconst sourceDir = dirname(sourcePath);\n\t\tconst absoluteImportPath = resolve(sourceDir, importPath);\n\n\t\t// Calculate the new relative path from the target file\n\t\tconst targetDir = dirname(targetPath);\n\t\tlet newRelativePath = relative(targetDir, absoluteImportPath);\n\n\t\t// Ensure the path starts with ./ or ../\n\t\tif (!newRelativePath.startsWith('.')) {\n\t\t\tnewRelativePath = `./${newRelativePath}`;\n\t\t}\n\n\t\t// Replace backslashes with forward slashes for consistency\n\t\tnewRelativePath = newRelativePath.replace(/\\\\/g, '/');\n\n\t\t// Replace the import path in the original match\n\t\treturn match.replace(importPath, newRelativePath);\n\t});\n}\n\n/**\n * Generate a React component wrapper for markdown content\n * This creates a TypeScript module that can be imported as a route\n */\nexport async function generateMarkdownModule(\n\tprocessed: ProcessedMarkdown,\n\tcwd: string,\n\toptions: {\n\t\tenableGfm?: boolean;\n\t\ttheme?: string;\n\t\tisMdx?: boolean;\n\t\tfilename?: string;\n\t\tsourcePath?: string;\n\t\ttargetPath?: string;\n\t\tcomponentsPath?: string;\n\t} = {},\n): Promise<string> {\n\tconst { frontmatter, content } = processed;\n\tconst {\n\t\tenableGfm = true,\n\t\ttheme = 'github-dark',\n\t\tisMdx = false,\n\t\tfilename,\n\t\tsourcePath,\n\t\ttargetPath,\n\t\tcomponentsPath,\n\t} = options;\n\n\t// Prefer MDX engine for both .mdx and .md when available to ensure\n\t// identical SSR/CSR output. MD is a subset of MDX, so compile it too.\n\tlet compiledMdx = await compileMdx(content, cwd, {\n\t\tenableGfm,\n\t\ttheme,\n\t\tfilename,\n\t});\n\tif (compiledMdx) {\n\t\t// Rewrite import paths if source and target paths are provided\n\t\tif (sourcePath && targetPath) {\n\t\t\tcompiledMdx = rewriteImportPaths(compiledMdx, sourcePath, targetPath);\n\t\t}\n\t\t// Add TypeScript type definitions for MDX props\n\t\t// Using proper JSX types to avoid ElementType errors\n\t\tconst typeDefinitions = `// TypeScript types for MDX components\ntype MDXProps = {\n components?: Record<string, React.ComponentType<any>>;\n [key: string]: any;\n};\n\n// Suppress JSX element type checking for MDX-generated code\n// @ts-nocheck enables this for the entire generated file\n`;\n\n\t\t// Fix type annotations in the compiled MDX by adding types to function parameters\n\t\t// Also remove 'export default' from MDXContent if we're adding custom components wrapper\n\t\tconst typedMdx = compiledMdx\n\t\t\t.replace(\n\t\t\t\t/function\\s+_createMdxContent\\s*\\(\\s*props\\s*\\)/g,\n\t\t\t\t'function _createMdxContent(props: MDXProps)',\n\t\t\t)\n\t\t\t.replace(\n\t\t\t\t/function\\s+MDXContent\\s*\\(\\s*props\\s*\\)/g,\n\t\t\t\t'function MDXContent(props: MDXProps)',\n\t\t\t);\n\n\t\t// MDX already supports passing components as props at runtime\n\t\t// No need to import them at build time - this avoids bundling issues\n\n\t\t// Already a complete program that exports a default component\n\t\treturn `// @ts-nocheck\n// Generated from ${isMdx ? 'MDX' : 'Markdown'} file with @mdx-js/mdx\n// TypeScript checking is disabled for MDX-generated code\n\n${typeDefinitions}\n\n// MDX compiled content with imports and component\n${typedMdx}\n\n// Frontmatter exports\nexport const meta = ${JSON.stringify(frontmatter, null, 2)};\n\n// Table of Contents\nexport const toc = ${JSON.stringify(extractHeadings(content), null, 2)};\n\nexport const ssr = {\n head: [\n '<meta property=\"og:type\" content=\"article\" />',\n '<meta name=\"twitter:card\" content=\"summary_large_image\" />',\n ],\n};\n`;\n\t}\n\n\t// Regular markdown - wrap with Markdown component\n\tconst escapedContent = content\n\t\t.replace(/\\\\/g, '\\\\\\\\')\n\t\t.replace(/`/g, '\\\\`')\n\t\t.replace(/\\$/g, '\\\\$');\n\n\t// Build plugin imports\n\tconst pluginImports: string[] = [];\n\tconst remarkPluginsList: string[] = [];\n\tconst rehypePluginsList: string[] = [];\n\n\t// Add custom components import if provided\n\tif (componentsPath) {\n\t\tpluginImports.push(`import markdownComponents from '${componentsPath}';`);\n\t}\n\n\t// Note: GFM is built into Streamdown, no need to import remark-gfm for .md files\n\t// This is only used for MDX files\n\tif (enableGfm) {\n\t\tpluginImports.push(\"import remarkGfm from 'remark-gfm';\");\n\t\tremarkPluginsList.push('remarkGfm');\n\t}\n\n\t// Note: Shiki is async and breaks SSR - skip it\n\n\tconst pluginImportsStr =\n\t\tpluginImports.length > 0 ? `${pluginImports.join('\\n')}\\n` : '';\n\tconst remarkPluginsStr =\n\t\tremarkPluginsList.length > 0\n\t\t\t? `remarkPlugins={[${remarkPluginsList.join(', ')}]}`\n\t\t\t: '';\n\tconst rehypePluginsStr =\n\t\trehypePluginsList.length > 0\n\t\t\t? `rehypePlugins={[${rehypePluginsList.join(', ')}]}`\n\t\t\t: '';\n\tconst componentsStr = componentsPath ? 'components={markdownComponents}' : '';\n\tconst pluginsPropsStr = [remarkPluginsStr, rehypePluginsStr, componentsStr]\n\t\t.filter(Boolean)\n\t\t.join('\\n ');\n\n\treturn `// Generated from markdown file\nimport { Markdown } from 'reroute-js/react';\n${pluginImportsStr}\nconst meta = ${JSON.stringify(frontmatter, null, 2)};\n\nconst ssr = {\n head: [\n '<meta property=\"og:type\" content=\"article\" />',\n '<meta name=\"twitter:card\" content=\"summary_large_image\" />',\n ],\n};\n\nconst markdownContent = \\`${escapedContent}\\`;\n\nfunction MarkdownRoute() {\n return (\n <div>\n <Markdown\n ${pluginsPropsStr}\n >\n {markdownContent}\n </Markdown>\n </div>\n );\n}\n\n// Table of Contents\nexport const toc = ${JSON.stringify(extractHeadings(content), null, 2)};\n\nexport { meta, ssr, toc };\nexport default MarkdownRoute;\n`;\n}\n\n/**\n * Generate a plain fallback TSX module when markdown tooling\n * is not configured. Renders raw markdown content in a <pre> block\n * so routes still work without extra deps.\n */\nexport function generatePlainMarkdownModule(\n\tprocessed: ProcessedMarkdown,\n): string {\n\tconst { frontmatter, content } = processed;\n\tconst escapedContent = content\n\t\t.replace(/\\\\/g, '\\\\\\\\')\n\t\t.split(String.fromCharCode(96))\n\t\t.join(`\\\\${String.fromCharCode(96)}`)\n\t\t.split('$')\n\t\t.join('\\\\$');\n\n\treturn `// Generated from markdown file (plain fallback)\n// No markdown renderer detected; showing raw content.\nexport const meta = ${JSON.stringify(frontmatter, null, 2)};\n\n// Table of Contents (empty for fallback)\nexport const toc = [];\n\nexport const ssr = {\n head: [\n '<meta property=\"og:type\" content=\"article\" />',\n '<meta name=\"twitter:card\" content=\"summary_large_image\" />',\n ],\n};\n\nconst markdownContent = \\`${escapedContent}\\`;\n\nexport default function MarkdownFallback() {\n return (\n <div style={{ padding: '1rem' }}>\n {meta?.title && (\n <h1 style={{ fontSize: '1.5rem', fontWeight: 600 }}>{meta.title}</h1>\n )}\n <div style={{\n margin: '0.75rem 0',\n padding: '0.75rem',\n borderLeft: '4px solid #eab308',\n background: '#fefce8',\n color: '#713f12'\n }}>\n <strong>Markdown rendering not configured.</strong>\n <div style={{ marginTop: '0.25rem' }}>\n Install: streamdown (required - includes GFM, syntax highlighting, math, and mermaid), @mdx-js/mdx (optional for JSX in markdown).\n </div>\n </div>\n <pre style={{ whiteSpace: 'pre-wrap', lineHeight: 1.6 }}>{markdownContent}</pre>\n </div>\n );\n}\n`;\n}\n\n/**\n * Check if a file is a markdown file\n */\nexport function isMarkdownFile(filePath: string): boolean {\n\tconst ext = extname(filePath).toLowerCase();\n\treturn ext === '.md' || ext === '.mdx';\n}\n\n/**\n * Get the route name from a markdown filename\n * Converts kebab-case to the route path\n */\nexport function getMarkdownRouteName(filePath: string): string {\n\tconst name = basename(filePath, extname(filePath));\n\treturn name;\n}\n\n/**\n * Extract headings from markdown content\n * Parses markdown headers (# ## ### etc) and returns structured data\n */\nexport function extractHeadings(\n\tcontent: string,\n\toptions: { minLevel?: number; maxLevel?: number } = {},\n): HeadingNode[] {\n\tconst { minLevel = 1, maxLevel = 6 } = options;\n\tconst headings: HeadingNode[] = [];\n\n\t// Match markdown headings: # Title, ## Title, etc.\n\tconst headingRegex = /^(#{1,6})\\s+(.+)$/gm;\n\tlet match: RegExpExecArray | null = headingRegex.exec(content);\n\n\twhile (match !== null) {\n\t\tconst level = match[1].length;\n\n\t\t// Only include headings within the specified level range\n\t\tif (level >= minLevel && level <= maxLevel) {\n\t\t\tconst text = match[2].trim();\n\t\t\t// Generate slug from heading text (lowercase, replace spaces with hyphens)\n\t\t\tconst slug = text\n\t\t\t\t.toLowerCase()\n\t\t\t\t.replace(/[^\\w\\s-]/g, '')\n\t\t\t\t.replace(/\\s+/g, '-')\n\t\t\t\t.replace(/-+/g, '-')\n\t\t\t\t.trim();\n\n\t\t\theadings.push({ level, text, slug });\n\t\t}\n\n\t\tmatch = headingRegex.exec(content);\n\t}\n\n\treturn headings;\n}\n\n/**\n * Strip markdown syntax and return plain text\n * Useful for creating search-friendly content\n */\nexport function stripMarkdown(content: string): string {\n\tlet text = content;\n\n\t// Keep code block content but remove fences (code is often searchable!)\n\ttext = text.replace(/```(?:\\w+)?\\n?([\\s\\S]*?)```/g, '$1');\n\t// Keep inline code content but remove backticks\n\ttext = text.replace(/`([^`]+)`/g, '$1');\n\n\t// Remove HTML tags\n\ttext = text.replace(/<[^>]+>/g, '');\n\n\t// Remove images\n\ttext = text.replace(/!\\[([^\\]]*)\\]\\([^)]+\\)/g, '$1');\n\n\t// Remove links but keep text\n\ttext = text.replace(/\\[([^\\]]+)\\]\\([^)]+\\)/g, '$1');\n\n\t// Remove headings markers\n\ttext = text.replace(/^#{1,6}\\s+/gm, '');\n\n\t// Remove bold/italic\n\ttext = text.replace(/[*_]{1,3}([^*_]+)[*_]{1,3}/g, '$1');\n\n\t// Remove blockquotes\n\ttext = text.replace(/^>\\s+/gm, '');\n\n\t// Remove horizontal rules\n\ttext = text.replace(/^[-*_]{3,}$/gm, '');\n\n\t// Remove list markers\n\ttext = text.replace(/^[-*+]\\s+/gm, '');\n\ttext = text.replace(/^\\d+\\.\\s+/gm, '');\n\n\t// Normalize whitespace\n\ttext = text.replace(/\\n{3,}/g, '\\n\\n');\n\ttext = text.trim();\n\n\treturn text;\n}\n",
|
|
57
|
-
"/**\n * Production mode utility\n *\n * Provides utilities to check if the CLI is running in production mode.\n * Production mode can be enabled either via NODE_ENV=production or --prod flag.\n */\n\n/**\n * Check if production mode is enabled\n * @param args Command line arguments to check for --prod
|
|
57
|
+
"/**\n * Production mode utility\n *\n * Provides utilities to check if the CLI is running in production mode.\n * Production mode can be enabled either via NODE_ENV=production or --prod flag.\n */\n\nfunction hasProdFlag(args: string[] = []): boolean {\n\treturn args.includes('--prod') || args.includes('--production');\n}\n\n/**\n * Check if production mode is enabled\n * @param args Command line arguments to check for --prod / --production\n * @returns true if a production flag is present\n */\nexport function isProductionMode(args: string[] = []): boolean {\n\treturn hasProdFlag(args);\n}\n\n/**\n * Set NODE_ENV to production if --prod flag is present\n * This ensures child processes inherit the production setting\n * @param args Command line arguments to check for --prod flag\n */\nexport function ensureProductionEnv(args: string[] = []): void {\n\tif (hasProdFlag(args)) {\n\t\tprocess.env.NODE_ENV = 'production';\n\t\tBun.env.NODE_ENV = 'production';\n\t}\n}\n\n/**\n * Filter out --prod flag from arguments since it's handled globally\n * @param args Command line arguments\n * @returns Filtered arguments without --prod\n */\nexport function filterProdFlag(args: string[]): string[] {\n\treturn args.filter((arg) => arg !== '--prod' && arg !== '--production');\n}\n",
|
|
58
58
|
"/**\n * Server utilities for waiting and polling\n */\n\nexport async function isServerRunning(\n\tport: number,\n\ttimeout = 1000,\n): Promise<boolean> {\n\ttry {\n\t\tconst response = await fetch(`http://localhost:${port}/`, {\n\t\t\tmethod: 'GET',\n\t\t\tsignal: AbortSignal.timeout(timeout),\n\t\t});\n\t\treturn response.status < 500;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\n/**\n * Wait for server to be ready by checking if it responds to HTTP requests\n * Uses exponential backoff for efficient polling without artificial delays\n * This ensures the server is fully initialized before declaring it ready\n */\nexport async function waitForServerReady(\n\tport = 3000,\n\ttimeout = 30000, // 30 seconds, more reasonable for large projects\n): Promise<void> {\n\tconst startTime = Date.now();\n\tlet checkInterval = 50; // Start with 50ms\n\tconst maxInterval = 1000; // Max 1 second between checks\n\n\twhile (Date.now() - startTime < timeout) {\n\t\ttry {\n\t\t\tconst response = await fetch(`http://localhost:${port}/`, {\n\t\t\t\tmethod: 'GET',\n\t\t\t\tsignal: AbortSignal.timeout(2000), // 2 second timeout per request\n\t\t\t});\n\t\t\t// Accept both success and 404 (means server is responding)\n\t\t\tif (response.status < 500) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} catch {\n\t\t\t// Server not ready yet, continue with exponential backoff\n\t\t}\n\n\t\tawait new Promise((resolve) => setTimeout(resolve, checkInterval));\n\n\t\t// Exponential backoff: increase interval but cap at maxInterval\n\t\tcheckInterval = Math.min(checkInterval * 1.5, maxInterval);\n\t}\n\n\tthrow new Error(\n\t\t`Timeout waiting for server to respond after ${timeout}ms. ` +\n\t\t\t`Make sure your server is starting correctly on port ${port}.`,\n\t);\n}\n",
|
|
59
59
|
"/**\n * Client CSS sync utility\n *\n * Bundles the client CSS entry (resolving @import) into\n * .reroute/bundles/index.css and .reroute/bundles/index.<hash>.css\n * for serving at /bundles/… alongside the JS.\n *\n * Default entry is src/client/index.css (parent of app.src).\n *\n * DX pattern — keep the design system modular and import from the entry:\n *\n * src/client/index.css → @import './theme/index.css';\n * src/client/theme/index.css → tokens, fonts, base, components…\n *\n * Absolute public URLs (e.g. url('/assets/fonts/…')) and remote @imports\n * are left untouched. Relative url() assets are not rewritten.\n */\n\nimport { createHash } from 'node:crypto';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { mkdir, readdir, unlink, writeFile } from 'node:fs/promises';\nimport { dirname, isAbsolute, join, resolve } from 'node:path';\nimport { loadConfig, resolveAppPaths } from 'reroute-js/core';\n\nconst HASHED_THEME_RE = /^index\\.[a-z0-9]{8,}\\.css$/i;\n\nasync function getCssPaths(cwd: string) {\n\tconst paths = resolveAppPaths(await loadConfig(cwd));\n\tconst input = join(cwd, paths.cssEntry);\n\tconst bundlesDir = join(cwd, '.reroute/bundles');\n\n\treturn { input, bundlesDir };\n}\n\nfunction themeCssFileName(css: string): string {\n\tconst hash = createHash('sha1').update(css).digest('hex').slice(0, 8);\n\treturn `index.${hash}.css`;\n}\n\n/**\n * Match @import with optional url(), quoted/unquoted path, and trailing condition.\n * Examples:\n * @import url('./theme/index.css');\n * @import './theme/index.css';\n * @import url('./print.css') print;\n */\nconst IMPORT_RE =\n\t/@import\\s+(?:url\\(\\s*)?(?:'([^']+)'|\"([^\"]+)\"|([^'\")\\s]+))\\s*\\)?\\s*([^;]*);/g;\n\nfunction isFileImport(specifier: string): boolean {\n\tif (\n\t\tspecifier.startsWith('http://') ||\n\t\tspecifier.startsWith('https://') ||\n\t\tspecifier.startsWith('data:') ||\n\t\tspecifier.startsWith('/')\n\t) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\n/**\n * Resolve relative @import into a single CSS string. Non-file imports\n * (absolute `/…`, http(s), data, or @import with media conditions) stay as-is.\n */\nexport function bundleCssEntrypoint(entryPath: string): string {\n\tconst absEntry = resolve(entryPath);\n\tconst stack = new Set<string>();\n\tconst completed = new Set<string>();\n\n\tfunction bundleFile(filePath: string): string {\n\t\tconst absPath = resolve(filePath);\n\n\t\t// Already inlined earlier in this graph — skip duplicates.\n\t\tif (completed.has(absPath)) {\n\t\t\treturn '';\n\t\t}\n\t\tif (stack.has(absPath)) {\n\t\t\tthrow new Error(`[reroute/theme] Circular @import detected: ${absPath}`);\n\t\t}\n\t\tif (!existsSync(absPath)) {\n\t\t\tthrow new Error(`[reroute/theme] Missing CSS import: ${absPath}`);\n\t\t}\n\n\t\tstack.add(absPath);\n\t\tconst source = readFileSync(absPath, 'utf-8');\n\t\tconst baseDir = dirname(absPath);\n\n\t\tconst bundled = source.replace(\n\t\t\tIMPORT_RE,\n\t\t\t(full, single: string, double: string, bare: string, rest: string) => {\n\t\t\t\tconst specifier = single || double || bare;\n\t\t\t\tconst condition = (rest ?? '').trim();\n\n\t\t\t\t// Keep conditional / non-file imports for the browser to resolve.\n\t\t\t\tif (condition || !isFileImport(specifier)) {\n\t\t\t\t\treturn full;\n\t\t\t\t}\n\n\t\t\t\tconst importedPath = isAbsolute(specifier)\n\t\t\t\t\t? specifier\n\t\t\t\t\t: resolve(baseDir, specifier);\n\n\t\t\t\treturn `/* ${specifier} */\\n${bundleFile(importedPath)}\\n`;\n\t\t\t},\n\t\t);\n\n\t\tstack.delete(absPath);\n\t\tcompleted.add(absPath);\n\t\treturn bundled;\n\t}\n\n\treturn bundleFile(absEntry);\n}\n\nasync function pruneStaleThemeCss(\n\tbundlesDir: string,\n\tkeep: string,\n): Promise<void> {\n\tconst files = await readdir(bundlesDir);\n\tfor (const file of files) {\n\t\tif (HASHED_THEME_RE.test(file) && file !== keep) {\n\t\t\tawait unlink(join(bundlesDir, file));\n\t\t}\n\t}\n}\n\n/**\n * Bundle index.css (with @import resolution) into .reroute/bundles.\n * Returns true if a sync was performed, false if skipped.\n */\nexport async function syncThemeCss(cwd: string): Promise<boolean> {\n\tconst { input, bundlesDir } = await getCssPaths(cwd);\n\n\tif (!existsSync(input)) {\n\t\treturn false;\n\t}\n\n\tawait mkdir(bundlesDir, { recursive: true });\n\n\ttry {\n\t\tconst css = bundleCssEntrypoint(input);\n\t\tconst hashedName = themeCssFileName(css);\n\t\tawait writeFile(join(bundlesDir, 'index.css'), css, 'utf-8');\n\t\tawait writeFile(join(bundlesDir, hashedName), css, 'utf-8');\n\t\tawait pruneStaleThemeCss(bundlesDir, hashedName);\n\t} catch (err) {\n\t\tconst message = err instanceof Error ? err.message : String(err);\n\t\tif (message.startsWith('[reroute/theme]')) {\n\t\t\tthrow err;\n\t\t}\n\t\tthrow new Error(`[reroute/theme] Failed to bundle index.css:\\n${message}`);\n\t}\n\n\tconsole.log('[reroute/theme] synced /bundles/index.css');\n\treturn true;\n}\n",
|
|
60
60
|
"import path from 'node:path';\n\n// Version and commit injected at build time\ndeclare const __REROUTE_VERSION__: string;\ndeclare const __REROUTE_COMMIT__: string;\n\nexport async function getVersionString(): Promise<string> {\n\tconst version = await getVersion();\n\tconst commit = await getCommit();\n\treturn `Reroute v${version} ${commit}`;\n}\n\nasync function getVersion(): Promise<string> {\n\t// Use version injected at build time\n\tif (typeof __REROUTE_VERSION__ !== 'undefined') {\n\t\treturn __REROUTE_VERSION__;\n\t}\n\n\t// Fallback for development: try to find package.json\n\tconst possiblePaths = [\n\t\tpath.join(import.meta.dir, '../../../../package.json'),\n\t\tpath.join(import.meta.dir, '../../../package.json'),\n\t\tpath.join(import.meta.dir, '../../package.json'),\n\t\tpath.join(import.meta.dir, '../package.json'),\n\t];\n\n\tfor (const pkgPath of possiblePaths) {\n\t\ttry {\n\t\t\tconst pkg = await Bun.file(pkgPath).json();\n\t\t\treturn pkg.version;\n\t\t} catch {}\n\t}\n\n\treturn 'unknown';\n}\n\nasync function getCommit(): Promise<string> {\n\t// Use commit injected at build time\n\tif (typeof __REROUTE_COMMIT__ !== 'undefined') {\n\t\treturn __REROUTE_COMMIT__;\n\t}\n\n\t// Fallback for development\n\treturn 'dev';\n}\n"
|
|
61
61
|
],
|
|
62
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAkBA,SAAS,OAAO,CAAC,GAAmB;AAAA,EACnC,OAAO,EAAE,QAAQ,OAAO,GAAG;AAAA;AAO5B,SAAS,eAAe,CAAC,SAAwB,CAAC,GAAa;AAAA,EAC9D,MAAM,MAAM,OAAO,KAAK,OAAO;AAAA,EAC/B,MAAM,SAAS,OAAO,KAAK,UAAU;AAAA,EACrC,MAAM,YAAY,QAAQ,MAAM,QAAQ,GAAG,CAAC;AAAA,EAE5C,OAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA,WAAW,QAAQ,MAAM,KAAK,WAAW,QAAQ,CAAC;AAAA,IAClD,UAAU,QAAQ,MAAM,KAAK,WAAW,WAAW,CAAC;AAAA,IACpD,WAAW,QAAQ,MAAM,KAAK,WAAW,QAAQ,CAAC;AAAA,IAClD;AAAA,EACD;AAAA;AAAA,IAnCK,kBAAkB,oBAClB,qBAAqB;AAAA;;;;;ACJ3B;AAqiCA,eAAe,UAAU,CAAC,KAAqC;AAAA,EAE9D,MAAM,gBAAiB,WACrB;AAAA,EACF,IAAI,eAAe;AAAA,IAClB,OAAO;AAAA,EACR;AAAA,EAGA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",
|
|
64
64
|
"names": []
|
|
65
65
|
}
|
package/cli/src/cli.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/build.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAiUH,wBAA8B,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,iBA+BjD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA+JH,wBAA8B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,iBAgC/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gen.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/gen.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"gen.d.ts","sourceRoot":"","sources":["../../../../../../packages/cli/src/commands/gen.ts"],"names":[],"mappings":";AAkxEA,wBAAsB,aAAa,CAClC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EAAE,GACZ,OAAO,CAAC;IAAE,KAAK,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC,CAmehC;AAED,wBAA8B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,iBA0B/C"}
|