reroute-js 0.45.0 → 0.45.2
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/cli/bin.d.ts +1 -1
- package/cli/bin.js +58 -11
- package/cli/bin.js.map +4 -4
- package/cli/index.d.ts +1 -1
- package/cli/index.js +4 -4
- package/cli/index.js.map +1 -1
- 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/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +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/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 +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/tailwind.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/version.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 +54 -7
- package/core/index.js.map +4 -4
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +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/index.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/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/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/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/core/src/ssr/stream.d.ts.map +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +54 -12
- package/elysia/index.js.map +5 -5
- package/elysia/src/index.d.ts +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/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +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/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/og.d.ts.map +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/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +2 -2
- package/react/index.js.map +1 -1
- 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 +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/index.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 +2 -2
- package/telemetry/server.js.map +3 -3
- 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/bin.d.ts
CHANGED
package/cli/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
3
|
/**
|
|
4
|
-
* reroute-js v0.45.
|
|
4
|
+
* reroute-js v0.45.2
|
|
5
5
|
*
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -48,7 +48,7 @@ async function getVersionString() {
|
|
|
48
48
|
}
|
|
49
49
|
async function getVersion() {
|
|
50
50
|
if (true) {
|
|
51
|
-
return "0.45.
|
|
51
|
+
return "0.45.2";
|
|
52
52
|
}
|
|
53
53
|
const possiblePaths = [
|
|
54
54
|
path.join(import.meta.dir, "../../../../package.json"),
|
|
@@ -66,7 +66,7 @@ async function getVersion() {
|
|
|
66
66
|
}
|
|
67
67
|
async function getCommit() {
|
|
68
68
|
if (true) {
|
|
69
|
-
return "
|
|
69
|
+
return "3df0c37";
|
|
70
70
|
}
|
|
71
71
|
return "dev";
|
|
72
72
|
}
|
|
@@ -2299,7 +2299,7 @@ async function processLayoutForMetadata(layout, clientDir, isWatchMode, addHead,
|
|
|
2299
2299
|
if (meta)
|
|
2300
2300
|
addHead(buildHeadFromMeta(meta, ogConfig, titleSuffix));
|
|
2301
2301
|
if (ssr) {
|
|
2302
|
-
const ssrHead = extractSSRHead(ssr, undefined, ogConfig, undefined, meta);
|
|
2302
|
+
const ssrHead = extractSSRHead(ssr, undefined, ogConfig, undefined, meta, titleSuffix);
|
|
2303
2303
|
if (ssrHead)
|
|
2304
2304
|
addHead(`
|
|
2305
2305
|
${ssrHead}`);
|
|
@@ -2329,7 +2329,7 @@ function extractContentMetadata(pathname, addHead, setLang, ogConfig, titleSuffi
|
|
|
2329
2329
|
const meta = exp?.meta;
|
|
2330
2330
|
const ssr = exp?.ssr;
|
|
2331
2331
|
addHead(buildHeadFromMeta(meta, ogConfig, titleSuffix));
|
|
2332
|
-
const ssrHead = extractSSRHead(ssr, undefined, ogConfig, undefined, meta);
|
|
2332
|
+
const ssrHead = extractSSRHead(ssr, undefined, ogConfig, undefined, meta, titleSuffix);
|
|
2333
2333
|
if (ssrHead)
|
|
2334
2334
|
addHead(`
|
|
2335
2335
|
${ssrHead}`);
|
|
@@ -2384,7 +2384,7 @@ async function extractMatchedRouteMetadata(pathname, clientDir, m, isWatchMode,
|
|
|
2384
2384
|
}
|
|
2385
2385
|
const contentMeta = getContentMetaFromExports(pathnameOnly);
|
|
2386
2386
|
const headMeta = contentMeta || meta;
|
|
2387
|
-
const ssrHead = extractSSRHead(ssr, routeData, ogConfig, head, headMeta);
|
|
2387
|
+
const ssrHead = extractSSRHead(ssr, routeData, ogConfig, head, headMeta, titleSuffix);
|
|
2388
2388
|
if (ssrHead)
|
|
2389
2389
|
head += `
|
|
2390
2390
|
${ssrHead}`;
|
|
@@ -2457,7 +2457,7 @@ async function extractNotFoundMetadata(pathname, clientDir, routesModule, isWatc
|
|
|
2457
2457
|
const { meta, ssr } = await loadModuleMetaAndSSR(chosen, abs, isWatchMode);
|
|
2458
2458
|
if (meta)
|
|
2459
2459
|
head += buildHeadFromMeta(meta, ogConfig, titleSuffix);
|
|
2460
|
-
const ssrHead = extractSSRHead(ssr, undefined, ogConfig, undefined, meta);
|
|
2460
|
+
const ssrHead = extractSSRHead(ssr, undefined, ogConfig, undefined, meta, titleSuffix);
|
|
2461
2461
|
if (ssrHead)
|
|
2462
2462
|
head += `
|
|
2463
2463
|
${ssrHead}`;
|
|
@@ -2520,7 +2520,7 @@ function generateMissingOGTags(head, ogConfig) {
|
|
|
2520
2520
|
${additionalTags.join(`
|
|
2521
2521
|
`)}` : "";
|
|
2522
2522
|
}
|
|
2523
|
-
function extractSSRHead(ssr, data, ogConfig, existingHead, meta) {
|
|
2523
|
+
function extractSSRHead(ssr, data, ogConfig, existingHead, meta, titleSuffix) {
|
|
2524
2524
|
if (!ssr)
|
|
2525
2525
|
return "";
|
|
2526
2526
|
let headContent = "";
|
|
@@ -2544,6 +2544,9 @@ function extractSSRHead(ssr, data, ogConfig, existingHead, meta) {
|
|
|
2544
2544
|
}
|
|
2545
2545
|
if (!headContent)
|
|
2546
2546
|
return "";
|
|
2547
|
+
if (titleSuffix) {
|
|
2548
|
+
headContent = applyTitleSuffixToHead(headContent, titleSuffix);
|
|
2549
|
+
}
|
|
2547
2550
|
const combinedHead = existingHead ? `${existingHead}
|
|
2548
2551
|
${headContent}` : headContent;
|
|
2549
2552
|
const additionalOGTags = generateMissingOGTags(combinedHead, ogConfig);
|
|
@@ -2557,6 +2560,36 @@ function extractSSRLang(ssr) {
|
|
|
2557
2560
|
}
|
|
2558
2561
|
return;
|
|
2559
2562
|
}
|
|
2563
|
+
function applyTitleSuffixToHead(headContent, titleSuffix) {
|
|
2564
|
+
let result = headContent;
|
|
2565
|
+
const titleMatch = result.match(/<title[^>]*>(.*?)<\/title>/is);
|
|
2566
|
+
if (titleMatch?.[1]) {
|
|
2567
|
+
const originalTitle = titleMatch[1].trim();
|
|
2568
|
+
if (originalTitle && !originalTitle.endsWith(titleSuffix)) {
|
|
2569
|
+
const newTitle = `${originalTitle}${titleSuffix}`;
|
|
2570
|
+
result = result.replace(/<title[^>]*>(.*?)<\/title>/is, `<title>${escapeHtml2(unescapeHtml(newTitle))}</title>`);
|
|
2571
|
+
const ogTitleRegex = /<meta\s+(?:property\s*=\s*["']og:title["']\s+content\s*=\s*["']([^"']+)["']|content\s*=\s*["']([^"']+)["']\s+property\s*=\s*["']og:title["'])[^>]*>/gi;
|
|
2572
|
+
result = result.replace(ogTitleRegex, (match, content1, content2) => {
|
|
2573
|
+
const content = content1 || content2;
|
|
2574
|
+
if (content && !content.endsWith(titleSuffix)) {
|
|
2575
|
+
const newContent = `${content}${titleSuffix}`;
|
|
2576
|
+
return `<meta property="og:title" content="${escapeHtml2(unescapeHtml(newContent))}" />`;
|
|
2577
|
+
}
|
|
2578
|
+
return match;
|
|
2579
|
+
});
|
|
2580
|
+
const twitterTitleRegex = /<meta\s+(?:name\s*=\s*["']twitter:title["']\s+content\s*=\s*["']([^"']+)["']|content\s*=\s*["']([^"']+)["']\s+name\s*=\s*["']twitter:title["'])[^>]*>/gi;
|
|
2581
|
+
result = result.replace(twitterTitleRegex, (match, content1, content2) => {
|
|
2582
|
+
const content = content1 || content2;
|
|
2583
|
+
if (content && !content.endsWith(titleSuffix)) {
|
|
2584
|
+
const newContent = `${content}${titleSuffix}`;
|
|
2585
|
+
return `<meta name="twitter:title" content="${escapeHtml2(unescapeHtml(newContent))}" />`;
|
|
2586
|
+
}
|
|
2587
|
+
return match;
|
|
2588
|
+
});
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
return result;
|
|
2592
|
+
}
|
|
2560
2593
|
var init_metadata2 = __esm(() => {
|
|
2561
2594
|
init_metadata();
|
|
2562
2595
|
init_meta();
|
|
@@ -5556,6 +5589,17 @@ function buildStreamingScripts(ctx) {
|
|
|
5556
5589
|
}
|
|
5557
5590
|
return allScripts;
|
|
5558
5591
|
}
|
|
5592
|
+
function applyTitleSuffixToMetaUpdates(metaUpdates, titleSuffix) {
|
|
5593
|
+
if (metaUpdates.title && !metaUpdates.title.endsWith(titleSuffix)) {
|
|
5594
|
+
metaUpdates.title = metaUpdates.title + titleSuffix;
|
|
5595
|
+
}
|
|
5596
|
+
if (metaUpdates["og:title"] && !metaUpdates["og:title"].endsWith(titleSuffix)) {
|
|
5597
|
+
metaUpdates["og:title"] = metaUpdates["og:title"] + titleSuffix;
|
|
5598
|
+
}
|
|
5599
|
+
if (metaUpdates["twitter:title"] && !metaUpdates["twitter:title"].endsWith(titleSuffix)) {
|
|
5600
|
+
metaUpdates["twitter:title"] = metaUpdates["twitter:title"] + titleSuffix;
|
|
5601
|
+
}
|
|
5602
|
+
}
|
|
5559
5603
|
function generateMetaUpdateScript(ctx, ssrDataSnapshot) {
|
|
5560
5604
|
if (typeof ctx.ssrExport?.head !== "function") {
|
|
5561
5605
|
return "";
|
|
@@ -5583,6 +5627,9 @@ function generateMetaUpdateScript(ctx, ssrDataSnapshot) {
|
|
|
5583
5627
|
if (Object.keys(metaUpdates).length === 0) {
|
|
5584
5628
|
return "";
|
|
5585
5629
|
}
|
|
5630
|
+
if (ctx.titleSuffix) {
|
|
5631
|
+
applyTitleSuffixToMetaUpdates(metaUpdates, ctx.titleSuffix);
|
|
5632
|
+
}
|
|
5586
5633
|
const updatesJson = JSON.stringify(metaUpdates);
|
|
5587
5634
|
return `<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>`;
|
|
5588
5635
|
}
|
|
@@ -106034,7 +106081,7 @@ async function getVersionString2() {
|
|
|
106034
106081
|
}
|
|
106035
106082
|
async function getVersion2() {
|
|
106036
106083
|
if (true) {
|
|
106037
|
-
return "0.45.
|
|
106084
|
+
return "0.45.2";
|
|
106038
106085
|
}
|
|
106039
106086
|
const possiblePaths = [
|
|
106040
106087
|
path3.join(import.meta.dir, "../../../package.json"),
|
|
@@ -106051,10 +106098,10 @@ async function getVersion2() {
|
|
|
106051
106098
|
}
|
|
106052
106099
|
async function getCommit2() {
|
|
106053
106100
|
if (true) {
|
|
106054
|
-
return "
|
|
106101
|
+
return "3df0c37";
|
|
106055
106102
|
}
|
|
106056
106103
|
return "dev";
|
|
106057
106104
|
}
|
|
106058
106105
|
main();
|
|
106059
106106
|
|
|
106060
|
-
//# debugId=
|
|
106107
|
+
//# debugId=0448E20E0CE344EC64756E2164756E21
|