reroute-js 0.13.0 → 0.13.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/README.md +2 -0
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +20 -9
- 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/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/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts.map +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/version.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 +2 -2
- package/core/index.js.map +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 +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/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.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/index.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.d.ts +1 -1
- package/core/src/ssr/lib/seed.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 +2 -2
- package/elysia/index.js.map +1 -1
- package/elysia/src/index.d.ts +1 -1
- package/elysia/src/libs/cache.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/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/internal.d.ts +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/rss.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/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/useSearchParams.d.ts +1 -1
- package/react/src/index.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/README.md
CHANGED
|
@@ -301,6 +301,8 @@ Reroute supports multiple environment files with priority:
|
|
|
301
301
|
|
|
302
302
|
Files are loaded in order, with later files overriding earlier ones.
|
|
303
303
|
|
|
304
|
+
**Important:** The mode (development vs production) is controlled by the `--prod` flag, not by `NODE_ENV` in `.env` files. Use `reroute gen --prod` or `reroute build` for production mode.
|
|
305
|
+
|
|
304
306
|
**Hot Reload:** Changes to any `.env` file automatically rebuild the bundle and reload your browser in watch mode - no server restart needed!
|
|
305
307
|
|
|
306
308
|
### Security
|
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.13.
|
|
4
|
+
* reroute-js v0.13.2
|
|
5
5
|
*
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2025 stewones <hi@stewan.io>
|
|
@@ -47,7 +47,7 @@ async function getVersionString() {
|
|
|
47
47
|
}
|
|
48
48
|
async function getVersion() {
|
|
49
49
|
if (true) {
|
|
50
|
-
return "0.13.
|
|
50
|
+
return "0.13.2";
|
|
51
51
|
}
|
|
52
52
|
const possiblePaths = [
|
|
53
53
|
path.join(import.meta.dir, "../../../../package.json"),
|
|
@@ -65,7 +65,7 @@ async function getVersion() {
|
|
|
65
65
|
}
|
|
66
66
|
async function getCommit() {
|
|
67
67
|
if (true) {
|
|
68
|
-
return "
|
|
68
|
+
return "5393b71";
|
|
69
69
|
}
|
|
70
70
|
return "dev";
|
|
71
71
|
}
|
|
@@ -2913,18 +2913,26 @@ function parseEnvFile(content2) {
|
|
|
2913
2913
|
function loadEnvFiles(cwd, mode = "development") {
|
|
2914
2914
|
const envFiles = [".env", `.env.${mode}`, ".env.local", `.env.${mode}.local`];
|
|
2915
2915
|
const env = {};
|
|
2916
|
+
const loadedFiles = [];
|
|
2916
2917
|
for (const file of envFiles) {
|
|
2917
2918
|
const filePath = join3(cwd, file);
|
|
2918
2919
|
if (existsSync2(filePath)) {
|
|
2919
2920
|
try {
|
|
2920
2921
|
const content2 = readFileSync(filePath, "utf-8");
|
|
2921
2922
|
const parsed = parseEnvFile(content2);
|
|
2923
|
+
const varCount = Object.keys(parsed).length;
|
|
2924
|
+
if (varCount > 0) {
|
|
2925
|
+
loadedFiles.push(`${file} (${varCount} vars)`);
|
|
2926
|
+
}
|
|
2922
2927
|
Object.assign(env, parsed);
|
|
2923
2928
|
} catch (error) {
|
|
2924
2929
|
console.warn(`[reroute/env] Failed to load ${file}:`, error);
|
|
2925
2930
|
}
|
|
2926
2931
|
}
|
|
2927
2932
|
}
|
|
2933
|
+
if (loadedFiles.length > 0) {
|
|
2934
|
+
console.log(`[reroute/env] Loaded: ${loadedFiles.join(", ")}`);
|
|
2935
|
+
}
|
|
2928
2936
|
return env;
|
|
2929
2937
|
}
|
|
2930
2938
|
function getPublicEnvVars(cwd, mode = "development") {
|
|
@@ -4171,13 +4179,16 @@ async function buildEntrypointBundle(cwd, args = []) {
|
|
|
4171
4179
|
return;
|
|
4172
4180
|
}
|
|
4173
4181
|
console.log("[reroute/gen] Building entrypoint bundle with code splitting...");
|
|
4174
|
-
const isProd =
|
|
4182
|
+
const isProd = args.includes("--prod");
|
|
4175
4183
|
const bundlesDir = join9(cwd, ".reroute", "bundles");
|
|
4176
4184
|
await mkdir2(bundlesDir, { recursive: true });
|
|
4177
|
-
const
|
|
4185
|
+
const mode = isProd ? "production" : "development";
|
|
4186
|
+
const publicEnv = getPublicEnvVars(cwd, mode);
|
|
4178
4187
|
const envDefines = envToDefineObject(publicEnv);
|
|
4179
4188
|
if (Object.keys(publicEnv).length > 0) {
|
|
4180
|
-
console.log(`[reroute/gen] Loaded ${Object.keys(publicEnv).length} public environment variable(s): ${Object.keys(publicEnv).join(", ")}`);
|
|
4189
|
+
console.log(`[reroute/gen] ✓ Loaded ${Object.keys(publicEnv).length} public environment variable(s): ${Object.keys(publicEnv).join(", ")}`);
|
|
4190
|
+
} else {
|
|
4191
|
+
console.log(`[reroute/gen] No REROUTE_* environment variables found (checked .env, .env.${mode}, .env.local, .env.${mode}.local)`);
|
|
4181
4192
|
}
|
|
4182
4193
|
const result = await Bun.build({
|
|
4183
4194
|
entrypoints: [entrypoint],
|
|
@@ -7486,7 +7497,7 @@ async function getVersionString2() {
|
|
|
7486
7497
|
}
|
|
7487
7498
|
async function getVersion2() {
|
|
7488
7499
|
if (true) {
|
|
7489
|
-
return "0.13.
|
|
7500
|
+
return "0.13.2";
|
|
7490
7501
|
}
|
|
7491
7502
|
const possiblePaths = [
|
|
7492
7503
|
path3.join(import.meta.dir, "../../../package.json"),
|
|
@@ -7503,10 +7514,10 @@ async function getVersion2() {
|
|
|
7503
7514
|
}
|
|
7504
7515
|
async function getCommit2() {
|
|
7505
7516
|
if (true) {
|
|
7506
|
-
return "
|
|
7517
|
+
return "5393b71";
|
|
7507
7518
|
}
|
|
7508
7519
|
return "dev";
|
|
7509
7520
|
}
|
|
7510
7521
|
main();
|
|
7511
7522
|
|
|
7512
|
-
//# debugId=
|
|
7523
|
+
//# debugId=2E979D53E88FD6DB64756E2164756E21
|