reroute-js 0.40.0 → 0.40.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 +2 -2
- package/cli/bin.js +31 -22
- package/cli/bin.js.map +5 -5
- package/cli/index.d.ts +2 -2
- package/cli/index.js +5 -5
- package/cli/index.js.map +1 -1
- package/cli/src/cli.d.ts +2 -2
- package/cli/src/commands/analyze.d.ts +2 -2
- package/cli/src/commands/build.d.ts +2 -2
- package/cli/src/commands/dev.d.ts +2 -2
- package/cli/src/commands/gen.d.ts +2 -2
- package/cli/src/commands/index.d.ts +2 -2
- package/cli/src/commands/init.d.ts +2 -2
- package/cli/src/commands/lib/assets.d.ts +2 -2
- package/cli/src/commands/lib/bundler.d.ts +2 -2
- package/cli/src/commands/lib/command.d.ts +2 -2
- package/cli/src/commands/lib/env.d.ts +2 -2
- package/cli/src/commands/lib/index.d.ts +2 -2
- package/cli/src/commands/lib/log.d.ts +2 -2
- package/cli/src/commands/lib/markdown/availability.d.ts +2 -2
- package/cli/src/commands/lib/markdown/index.d.ts +2 -2
- package/cli/src/commands/lib/markdown/processor.d.ts +2 -2
- package/cli/src/commands/lib/production.d.ts +2 -2
- package/cli/src/commands/lib/server.d.ts +2 -2
- package/cli/src/commands/lib/streaming/analyzer.d.ts +2 -2
- package/cli/src/commands/lib/streaming/suspense.d.ts +2 -2
- package/cli/src/commands/lib/tailwind.d.ts +2 -2
- package/cli/src/commands/lib/terminal-ui.d.ts +2 -2
- package/cli/src/commands/lib/version.d.ts +2 -2
- package/cli/src/commands/og.d.ts +2 -2
- package/cli/src/commands/start.d.ts +2 -2
- package/cli/src/index.d.ts +2 -2
- package/core/index.d.ts +2 -2
- package/core/index.js +27 -18
- package/core/index.js.map +5 -5
- package/core/src/bundler/hash.d.ts +2 -2
- package/core/src/bundler/index.d.ts +2 -2
- package/core/src/config.d.ts +2 -2
- package/core/src/content/discovery.d.ts +2 -2
- package/core/src/content/index.d.ts +2 -2
- package/core/src/content/metadata.d.ts +2 -2
- package/core/src/index.d.ts +2 -2
- package/core/src/llms/extractor.d.ts +2 -2
- package/core/src/llms/formatter.d.ts +2 -2
- package/core/src/llms/full-generator.d.ts +2 -2
- package/core/src/llms/index-generator.d.ts +2 -2
- package/core/src/llms/index.d.ts +2 -2
- package/core/src/og/discovery.d.ts +2 -2
- package/core/src/og/index.d.ts +2 -2
- package/core/src/og/meta.d.ts +2 -2
- package/core/src/og/render.d.ts +2 -2
- package/core/src/og/types.d.ts +2 -2
- package/core/src/robots/discovery.d.ts +2 -2
- package/core/src/robots/generator.d.ts +2 -2
- package/core/src/robots/index.d.ts +2 -2
- package/core/src/robots/policies.d.ts +2 -2
- package/core/src/rss/discovery.d.ts +2 -2
- package/core/src/rss/discovery.d.ts.map +1 -1
- package/core/src/rss/generator.d.ts +2 -2
- package/core/src/rss/index.d.ts +2 -2
- package/core/src/sitemap/discovery.d.ts +2 -2
- package/core/src/sitemap/discovery.d.ts.map +1 -1
- package/core/src/sitemap/generator.d.ts +2 -2
- package/core/src/sitemap/index.d.ts +2 -2
- package/core/src/ssr/index.d.ts +2 -2
- package/core/src/ssr/lib/cache.d.ts +2 -2
- package/core/src/ssr/lib/collections.d.ts +2 -2
- package/core/src/ssr/lib/compression.d.ts +2 -2
- package/core/src/ssr/lib/compute/content.d.ts +2 -2
- package/core/src/ssr/lib/compute/index.d.ts +2 -2
- package/core/src/ssr/lib/compute/layouts.d.ts +2 -2
- package/core/src/ssr/lib/compute/routes.d.ts +2 -2
- package/core/src/ssr/lib/data.d.ts +2 -2
- package/core/src/ssr/lib/html.d.ts +2 -2
- package/core/src/ssr/lib/imports.d.ts +2 -2
- package/core/src/ssr/lib/index.d.ts +2 -2
- package/core/src/ssr/lib/layouts.d.ts +2 -2
- package/core/src/ssr/lib/metadata.d.ts +2 -2
- package/core/src/ssr/lib/metadata.d.ts.map +1 -1
- package/core/src/ssr/lib/mime.d.ts +2 -2
- package/core/src/ssr/lib/modules.d.ts +2 -2
- package/core/src/ssr/lib/path.d.ts +2 -2
- package/core/src/ssr/lib/preload.d.ts +2 -2
- package/core/src/ssr/lib/scripts/collections.d.ts +2 -2
- package/core/src/ssr/lib/scripts/data.d.ts +2 -2
- package/core/src/ssr/lib/scripts/escape.d.ts +2 -2
- package/core/src/ssr/lib/scripts/feeds.d.ts +2 -2
- package/core/src/ssr/lib/scripts/index.d.ts +2 -2
- package/core/src/ssr/lib/seed.d.ts +2 -2
- package/core/src/ssr/lib/serialize.d.ts +2 -2
- package/core/src/ssr/lib/setup.d.ts +2 -2
- package/core/src/ssr/lib/styles.d.ts +2 -2
- package/core/src/ssr/lib/template.d.ts +2 -2
- package/core/src/ssr/lib/types.d.ts +2 -2
- package/core/src/ssr/render.d.ts +2 -2
- package/core/src/ssr/stream.d.ts +2 -2
- package/elysia/index.d.ts +2 -2
- package/elysia/index.js +27 -18
- package/elysia/index.js.map +5 -5
- package/elysia/src/index.d.ts +2 -2
- package/elysia/src/libs/assets.d.ts +2 -2
- package/elysia/src/libs/cache.d.ts +2 -2
- package/elysia/src/libs/caching.d.ts +2 -2
- package/elysia/src/libs/http.d.ts +2 -2
- package/elysia/src/libs/image.d.ts +2 -2
- package/elysia/src/libs/index.d.ts +2 -2
- package/elysia/src/libs/llms.d.ts +2 -2
- package/elysia/src/libs/response.d.ts +2 -2
- package/elysia/src/libs/serving.d.ts +2 -2
- package/elysia/src/plugin.d.ts +2 -2
- package/elysia/src/routes/artifacts.d.ts +2 -2
- package/elysia/src/routes/content.d.ts +2 -2
- package/elysia/src/routes/image.d.ts +2 -2
- package/elysia/src/routes/index.d.ts +2 -2
- package/elysia/src/routes/internal.d.ts +2 -2
- package/elysia/src/routes/llms.d.ts +2 -2
- package/elysia/src/routes/og.d.ts +2 -2
- package/elysia/src/routes/redirects.d.ts +2 -2
- package/elysia/src/routes/robots.d.ts +2 -2
- package/elysia/src/routes/rss.d.ts +2 -2
- package/elysia/src/routes/search.d.ts +2 -2
- package/elysia/src/routes/sitemap.d.ts +2 -2
- package/elysia/src/routes/ssr.d.ts +2 -2
- package/elysia/src/routes/static.d.ts +2 -2
- package/elysia/src/types.d.ts +2 -2
- package/package.json +1 -1
- package/react/index.d.ts +2 -2
- package/react/index.js +3 -3
- package/react/index.js.map +1 -1
- package/react/src/components/ClientOnly.d.ts +2 -2
- package/react/src/components/ContentRoute.d.ts +2 -2
- package/react/src/components/Image.d.ts +2 -2
- package/react/src/components/LazyRoute.d.ts +2 -2
- package/react/src/components/Link.d.ts +2 -2
- package/react/src/components/Markdown.d.ts +2 -2
- package/react/src/components/Outlet.d.ts +2 -2
- package/react/src/components/index.d.ts +2 -2
- package/react/src/hooks/index.d.ts +2 -2
- package/react/src/hooks/useContent.d.ts +2 -2
- package/react/src/hooks/useData.d.ts +2 -2
- package/react/src/hooks/useFeed.d.ts +2 -2
- package/react/src/hooks/useLayoutData.d.ts +2 -2
- package/react/src/hooks/useLlms.d.ts +2 -2
- package/react/src/hooks/useNavigate.d.ts +2 -2
- package/react/src/hooks/useParams.d.ts +2 -2
- package/react/src/hooks/useRouter.d.ts +2 -2
- package/react/src/hooks/useSearch.d.ts +2 -2
- package/react/src/hooks/useSearchParams.d.ts +2 -2
- package/react/src/hooks/useToc.d.ts +2 -2
- package/react/src/index.d.ts +2 -2
- package/react/src/lib/collection.d.ts +2 -2
- package/react/src/lib/content.d.ts +2 -2
- package/react/src/lib/head.d.ts +2 -2
- package/react/src/lib/index.d.ts +2 -2
- package/react/src/lib/lazy-route.d.ts +2 -2
- package/react/src/lib/route-loader.d.ts +2 -2
- package/react/src/providers/ContentProvider.d.ts +2 -2
- package/react/src/providers/RerouteProvider.d.ts +2 -2
- package/react/src/providers/RouterProvider.d.ts +2 -2
- package/react/src/providers/index.d.ts +2 -2
- package/react/src/types/any.d.ts +2 -2
- package/react/src/types/index.d.ts +2 -2
- package/react/src/types/router.d.ts +2 -2
- package/telemetry/react.d.ts +2 -2
- package/telemetry/react.js +3 -3
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +2 -2
- package/telemetry/server.js +3 -3
- package/telemetry/server.js.map +2 -2
- package/telemetry/src/react/api.d.ts +2 -2
- package/telemetry/src/react/context.d.ts +2 -2
- package/telemetry/src/react/index.d.ts +2 -2
- package/telemetry/src/react/telemetry.d.ts +2 -2
- package/telemetry/src/server/context.d.ts +2 -2
- package/telemetry/src/server/headers/extractor.d.ts +2 -2
- package/telemetry/src/server/headers/index.d.ts +2 -2
- package/telemetry/src/server/headers/presets.d.ts +2 -2
- package/telemetry/src/server/index.d.ts +2 -2
- package/telemetry/src/server/instrumentation.d.ts +2 -2
- package/telemetry/src/server/plugin.d.ts +2 -2
- package/telemetry/src/server/sourcemap.d.ts +2 -2
package/core/src/ssr/render.d.ts
CHANGED
package/core/src/ssr/stream.d.ts
CHANGED
package/elysia/index.d.ts
CHANGED
package/elysia/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v0.40.
|
|
2
|
+
* reroute-js v0.40.2
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
|
-
* @copyright
|
|
5
|
+
* @copyright 2026 stewones <hi@stewan.io>
|
|
6
6
|
* @see https://github.com/stewones/reroute
|
|
7
7
|
*
|
|
8
8
|
* Built with Bun <3
|
|
@@ -1776,6 +1776,22 @@ var init_meta = __esm(() => {
|
|
|
1776
1776
|
});
|
|
1777
1777
|
|
|
1778
1778
|
// packages/core/src/ssr/lib/metadata.ts
|
|
1779
|
+
async function loadModuleMetaAndSSR(moduleObj, absolutePath, isWatchMode) {
|
|
1780
|
+
const bundledMeta = moduleObj?.meta;
|
|
1781
|
+
const bundledSSR = moduleObj?.ssr;
|
|
1782
|
+
if (bundledMeta !== undefined || bundledSSR !== undefined) {
|
|
1783
|
+
return { meta: bundledMeta, ssr: bundledSSR };
|
|
1784
|
+
}
|
|
1785
|
+
try {
|
|
1786
|
+
const mod = await dynamicImport(absolutePath, isWatchMode);
|
|
1787
|
+
return {
|
|
1788
|
+
meta: mod?.meta,
|
|
1789
|
+
ssr: mod?.ssr
|
|
1790
|
+
};
|
|
1791
|
+
} catch {
|
|
1792
|
+
return {};
|
|
1793
|
+
}
|
|
1794
|
+
}
|
|
1779
1795
|
function generateCanonicalUrl(baseUrl, pathname) {
|
|
1780
1796
|
const cleanBaseUrl = baseUrl.replace(/\/$/, "");
|
|
1781
1797
|
const cleanPathname = pathname.split("?")[0];
|
|
@@ -1835,9 +1851,7 @@ async function processLayoutForMetadata(layout, clientDir, isWatchMode, addHead,
|
|
|
1835
1851
|
return;
|
|
1836
1852
|
try {
|
|
1837
1853
|
const abs = join(clientDir, "routes", String(layout.path));
|
|
1838
|
-
const
|
|
1839
|
-
const meta = mod?.meta;
|
|
1840
|
-
const ssr = mod?.ssr;
|
|
1854
|
+
const { meta, ssr } = await loadModuleMetaAndSSR(layout, abs, isWatchMode);
|
|
1841
1855
|
if (meta)
|
|
1842
1856
|
addHead(buildHeadFromMeta(meta));
|
|
1843
1857
|
if (ssr) {
|
|
@@ -1853,8 +1867,7 @@ ${ssrHead}`);
|
|
|
1853
1867
|
}
|
|
1854
1868
|
async function extractLayoutMetadata(pathname, clientDir, cwd, isWatchMode, addHead, setLang) {
|
|
1855
1869
|
try {
|
|
1856
|
-
const
|
|
1857
|
-
const m = await dynamicImport(routesPath, isWatchMode);
|
|
1870
|
+
const m = await loadRoutesModule(cwd, isWatchMode);
|
|
1858
1871
|
const matchingLayouts = getMatchingLayouts(pathname, m?.layouts);
|
|
1859
1872
|
for (const layout of matchingLayouts) {
|
|
1860
1873
|
await processLayoutForMetadata(layout, clientDir, isWatchMode, addHead, setLang);
|
|
@@ -1891,9 +1904,7 @@ async function extractMatchedRouteMetadata(pathname, clientDir, m, isWatchMode,
|
|
|
1891
1904
|
if (r && typeof r.path === "string") {
|
|
1892
1905
|
try {
|
|
1893
1906
|
const abs = join(clientDir, "routes", String(r.path));
|
|
1894
|
-
const
|
|
1895
|
-
const meta = mod?.meta;
|
|
1896
|
-
const ssr = mod?.ssr;
|
|
1907
|
+
const { meta, ssr } = await loadModuleMetaAndSSR(r, abs, isWatchMode);
|
|
1897
1908
|
let head = "";
|
|
1898
1909
|
if (meta)
|
|
1899
1910
|
head += buildHeadFromMeta(meta);
|
|
@@ -1962,9 +1973,7 @@ async function extractNotFoundMetadata(pathname, clientDir, routesModule, isWatc
|
|
|
1962
1973
|
const chosen = findBestNotFoundRoute(list, pathname);
|
|
1963
1974
|
if (chosen && typeof chosen.path === "string") {
|
|
1964
1975
|
const abs = join(clientDir, "routes", String(chosen.path));
|
|
1965
|
-
const
|
|
1966
|
-
const meta = mod?.meta;
|
|
1967
|
-
const ssr = mod?.ssr;
|
|
1976
|
+
const { meta, ssr } = await loadModuleMetaAndSSR(chosen, abs, isWatchMode);
|
|
1968
1977
|
if (meta)
|
|
1969
1978
|
head += buildHeadFromMeta(meta);
|
|
1970
1979
|
const ssrHead = extractSSRHead(ssr);
|
|
@@ -3988,7 +3997,7 @@ async function discoverSSRDataRoutes2(cwd, staticRoutes, isWatchMode, baseUrl, s
|
|
|
3988
3997
|
const bundledRoutes = globalThis.__REROUTE_ROUTES__;
|
|
3989
3998
|
if (bundledRoutes && Array.isArray(bundledRoutes)) {
|
|
3990
3999
|
for (const route of staticRoutes) {
|
|
3991
|
-
if (sitemapConfig?.excludeDiscovery?.
|
|
4000
|
+
if (sitemapConfig?.excludeDiscovery?.some((excluded) => route.pattern.startsWith(excluded))) {
|
|
3992
4001
|
continue;
|
|
3993
4002
|
}
|
|
3994
4003
|
const bundledRoute = bundledRoutes.find((r) => r?.pattern === route.pattern);
|
|
@@ -4013,7 +4022,7 @@ async function discoverSSRDataRoutes2(cwd, staticRoutes, isWatchMode, baseUrl, s
|
|
|
4013
4022
|
}
|
|
4014
4023
|
} else {
|
|
4015
4024
|
for (const route of staticRoutes) {
|
|
4016
|
-
if (sitemapConfig?.excludeDiscovery?.
|
|
4025
|
+
if (sitemapConfig?.excludeDiscovery?.some((excluded) => route.pattern.startsWith(excluded))) {
|
|
4017
4026
|
continue;
|
|
4018
4027
|
}
|
|
4019
4028
|
try {
|
|
@@ -4421,7 +4430,7 @@ async function discoverRSSData(cwd, collections2, baseUrl, isWatchMode, rssConfi
|
|
|
4421
4430
|
const { discoverRoutes: discoverRoutes2 } = await Promise.resolve().then(() => (init_discovery4(), exports_discovery));
|
|
4422
4431
|
const { staticRoutes } = await discoverRoutes2(cwd, isWatchMode);
|
|
4423
4432
|
for (const route of staticRoutes) {
|
|
4424
|
-
if (rssConfig?.excludeDiscovery?.
|
|
4433
|
+
if (rssConfig?.excludeDiscovery?.some((excluded) => route.pattern.startsWith(excluded))) {
|
|
4425
4434
|
continue;
|
|
4426
4435
|
}
|
|
4427
4436
|
const bundledRoute = bundledRoutes.find((r) => r?.pattern === route.pattern);
|
|
@@ -4448,7 +4457,7 @@ async function discoverRSSData(cwd, collections2, baseUrl, isWatchMode, rssConfi
|
|
|
4448
4457
|
const { discoverRoutes: discoverRoutes2 } = await Promise.resolve().then(() => (init_discovery4(), exports_discovery));
|
|
4449
4458
|
const { staticRoutes } = await discoverRoutes2(cwd, isWatchMode);
|
|
4450
4459
|
for (const route of staticRoutes) {
|
|
4451
|
-
if (rssConfig?.excludeDiscovery?.
|
|
4460
|
+
if (rssConfig?.excludeDiscovery?.some((excluded) => route.pattern.startsWith(excluded))) {
|
|
4452
4461
|
continue;
|
|
4453
4462
|
}
|
|
4454
4463
|
const items = await discoverSSRDataFeedItems(cwd, route.pattern, route.path, isWatchMode, baseUrl, rssConfig);
|
|
@@ -8258,4 +8267,4 @@ export {
|
|
|
8258
8267
|
reroute
|
|
8259
8268
|
};
|
|
8260
8269
|
|
|
8261
|
-
//# debugId=
|
|
8270
|
+
//# debugId=E9B46B80C24001D364756E2164756E21
|