reroute-js 0.34.7 → 0.34.8
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 +30 -13
- package/cli/bin.js.map +9 -9
- 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/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/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 +25 -9
- package/core/index.js.map +8 -8
- 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 +4 -2
- package/core/src/ssr/lib/compute/index.d.ts.map +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/metadata.d.ts.map +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/preload.d.ts.map +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 +25 -9
- package/elysia/index.js.map +8 -8
- 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/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 +3 -2
- package/telemetry/server.js.map +8 -8
- 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/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.34.
|
|
4
|
+
* reroute-js v0.34.8
|
|
5
5
|
*
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2025 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.34.
|
|
51
|
+
return "0.34.8";
|
|
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 "61ce1ff";
|
|
70
70
|
}
|
|
71
71
|
return "dev";
|
|
72
72
|
}
|
|
@@ -1352,9 +1352,11 @@ function matchPatternUtil(pattern, pathname) {
|
|
|
1352
1352
|
return params;
|
|
1353
1353
|
}
|
|
1354
1354
|
function createBundledRoutesModule(bundledRoutes, bundledLayouts) {
|
|
1355
|
+
const bundledNotFoundRoutes = globalThis.__REROUTE_NOT_FOUND_ROUTES__;
|
|
1355
1356
|
return {
|
|
1356
1357
|
routes: bundledRoutes,
|
|
1357
1358
|
layouts: bundledLayouts,
|
|
1359
|
+
notFoundRoutes: bundledNotFoundRoutes,
|
|
1358
1360
|
matchRoute: (pathname) => {
|
|
1359
1361
|
for (const route of bundledRoutes) {
|
|
1360
1362
|
const pattern = String(route?.pattern || "");
|
|
@@ -2179,8 +2181,10 @@ async function extractRouteMetadata(pathname, clientDir, cwd, isWatchMode, curre
|
|
|
2179
2181
|
let lang;
|
|
2180
2182
|
let statusOverride = currentStatusOverride;
|
|
2181
2183
|
try {
|
|
2182
|
-
const
|
|
2183
|
-
|
|
2184
|
+
const m = await loadRoutesModule(cwd, isWatchMode);
|
|
2185
|
+
if (!m) {
|
|
2186
|
+
return { head, lang, statusOverride: statusOverride || 404 };
|
|
2187
|
+
}
|
|
2184
2188
|
const pathnameOnly = pathname.split("?")[0];
|
|
2185
2189
|
const match = typeof m.matchRoute === "function" ? m.matchRoute(pathnameOnly) : null;
|
|
2186
2190
|
const r = match?.route;
|
|
@@ -2261,6 +2265,7 @@ function extractSSRLang(ssr) {
|
|
|
2261
2265
|
var init_metadata2 = __esm(() => {
|
|
2262
2266
|
init_metadata();
|
|
2263
2267
|
init_meta();
|
|
2268
|
+
init_compute();
|
|
2264
2269
|
init_imports();
|
|
2265
2270
|
});
|
|
2266
2271
|
|
|
@@ -2298,6 +2303,16 @@ async function preloadContentModule(pathname, clientDir, cwd, isWatchMode) {
|
|
|
2298
2303
|
}
|
|
2299
2304
|
async function isContentCollection(clientDir, collection) {
|
|
2300
2305
|
try {
|
|
2306
|
+
const isProduction = clientDir.endsWith(".reroute");
|
|
2307
|
+
if (isProduction) {
|
|
2308
|
+
const collectionFile = join2(clientDir, "collections", `${collection}.js`);
|
|
2309
|
+
try {
|
|
2310
|
+
const s2 = await stat4(collectionFile);
|
|
2311
|
+
return s2?.isFile() ?? false;
|
|
2312
|
+
} catch {
|
|
2313
|
+
return false;
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2301
2316
|
const maybeDir = join2(clientDir, "routes", collection, "content");
|
|
2302
2317
|
const s = await stat4(maybeDir);
|
|
2303
2318
|
return typeof s?.isDirectory === "function" ? s.isDirectory() : true;
|
|
@@ -2748,7 +2763,7 @@ async function performSSRSetupInternal(options, streaming) {
|
|
|
2748
2763
|
return css;
|
|
2749
2764
|
});
|
|
2750
2765
|
let statusOverride = preloadResult.statusOverride;
|
|
2751
|
-
if (computeResult.statusContainer.value) {
|
|
2766
|
+
if (computeResult.statusContainer.value !== undefined) {
|
|
2752
2767
|
statusOverride = computeResult.statusContainer.value;
|
|
2753
2768
|
}
|
|
2754
2769
|
const metadataResult = await withSpan("ssr.extract.metadata", async (span) => {
|
|
@@ -2956,10 +2971,10 @@ async function renderSSRDocument(options) {
|
|
|
2956
2971
|
return script;
|
|
2957
2972
|
});
|
|
2958
2973
|
let statusOverride = setup2.preloadStatusOverride;
|
|
2959
|
-
if (setup2.statusContainer.value) {
|
|
2974
|
+
if (setup2.statusContainer.value !== undefined) {
|
|
2960
2975
|
statusOverride = setup2.statusContainer.value;
|
|
2961
2976
|
}
|
|
2962
|
-
if (setup2.metadataResult.statusOverride) {
|
|
2977
|
+
if (setup2.metadataResult.statusOverride !== undefined) {
|
|
2963
2978
|
statusOverride = setup2.metadataResult.statusOverride;
|
|
2964
2979
|
}
|
|
2965
2980
|
const extraHead = setup2.bundlePreload + setup2.preloadExtraHead;
|
|
@@ -4933,10 +4948,10 @@ async function renderSSRDocumentStream(options) {
|
|
|
4933
4948
|
if (debug)
|
|
4934
4949
|
console.log(`[renderStream] ${pathname} - performSSRSetup: ${(performance.now() - t0).toFixed(2)}ms`);
|
|
4935
4950
|
let statusOverride = setup2.preloadStatusOverride;
|
|
4936
|
-
if (setup2.statusContainer.value) {
|
|
4951
|
+
if (setup2.statusContainer.value !== undefined) {
|
|
4937
4952
|
statusOverride = setup2.statusContainer.value;
|
|
4938
4953
|
}
|
|
4939
|
-
if (setup2.metadataResult.statusOverride) {
|
|
4954
|
+
if (setup2.metadataResult.statusOverride !== undefined) {
|
|
4940
4955
|
statusOverride = setup2.metadataResult.statusOverride;
|
|
4941
4956
|
}
|
|
4942
4957
|
const encoder = new TextEncoder;
|
|
@@ -5156,6 +5171,7 @@ __export(exports_core, {
|
|
|
5156
5171
|
preloadContentModule: () => preloadContentModule,
|
|
5157
5172
|
performSSRSetup: () => performSSRSetup,
|
|
5158
5173
|
mergeLayoutData: () => mergeLayoutData,
|
|
5174
|
+
loadRoutesModule: () => loadRoutesModule,
|
|
5159
5175
|
loadOGImageComponent: () => loadOGImageComponent,
|
|
5160
5176
|
loadIndexHtml: () => loadIndexHtml,
|
|
5161
5177
|
loadConfig: () => loadConfig,
|
|
@@ -6491,6 +6507,7 @@ function matchPattern(pattern: string, pathname: string): Record<string, string>
|
|
|
6491
6507
|
// Set globals for compiled binary support (sitemap/RSS/robots discovery)
|
|
6492
6508
|
(globalThis as any).__REROUTE_ROUTES__ = routes;
|
|
6493
6509
|
(globalThis as any).__REROUTE_LAYOUTS__ = layouts;
|
|
6510
|
+
(globalThis as any).__REROUTE_NOT_FOUND_ROUTES__ = notFoundRoutes;
|
|
6494
6511
|
`;
|
|
6495
6512
|
}
|
|
6496
6513
|
async function buildStreamingWrappersForTree(cwd, routesPath, tree, config2) {
|
|
@@ -105460,7 +105477,7 @@ async function getVersionString2() {
|
|
|
105460
105477
|
}
|
|
105461
105478
|
async function getVersion2() {
|
|
105462
105479
|
if (true) {
|
|
105463
|
-
return "0.34.
|
|
105480
|
+
return "0.34.8";
|
|
105464
105481
|
}
|
|
105465
105482
|
const possiblePaths = [
|
|
105466
105483
|
path3.join(import.meta.dir, "../../../package.json"),
|
|
@@ -105477,10 +105494,10 @@ async function getVersion2() {
|
|
|
105477
105494
|
}
|
|
105478
105495
|
async function getCommit2() {
|
|
105479
105496
|
if (true) {
|
|
105480
|
-
return "
|
|
105497
|
+
return "61ce1ff";
|
|
105481
105498
|
}
|
|
105482
105499
|
return "dev";
|
|
105483
105500
|
}
|
|
105484
105501
|
main();
|
|
105485
105502
|
|
|
105486
|
-
//# debugId=
|
|
105503
|
+
//# debugId=C0212B02D1FE7E5C64756E2164756E21
|