rari 0.2.23 → 0.2.24
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/dist/chunk-D2j_47x6.js +7 -0
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +5 -6
- package/dist/client.js +1 -1
- package/dist/index.js +3 -3
- package/dist/platform-CmbdpkH7.js +3 -0
- package/dist/{platform-BI_YMKuR.js → platform-gndtVykV.js} +3 -5
- package/dist/{railway-XPhB0Ls4.js → railway-_SVjSy6_.js} +2 -3
- package/dist/{render-BtA14L2P.js → render-DZ66RSJC.js} +2 -3
- package/dist/{runtime-client-BXoadxa8.js → runtime-client-DgZI7OGo.js} +9 -20
- package/dist/server-BYQ_UgvJ.js +4109 -0
- package/dist/{server-build-DeJfuJb8.js → server-build-CC1DF9LZ.js} +20 -39
- package/dist/server-build-fiKbAR1s.js +3 -0
- package/dist/server.js +3 -3
- package/package.json +10 -10
- package/src/vite/index.ts +2 -2
- package/dist/chunk-BLXvPPr8.js +0 -30
- package/dist/platform-Dy5tQwpO.js +0 -3
- package/dist/server-C3POnIbO.js +0 -7676
- package/dist/server-build-Cs2pfA52.js +0 -3
package/dist/cli.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {};
|
|
1
|
+
export { };
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { getBinaryPath, getInstallationInstructions } from "./platform-
|
|
2
|
+
import { getBinaryPath, getInstallationInstructions } from "./platform-gndtVykV.js";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
5
|
import colors from "picocolors";
|
|
@@ -56,15 +56,14 @@ async function startRustServer() {
|
|
|
56
56
|
logInfo(`Mode: ${mode}, Host: ${host}, Port: ${port}`);
|
|
57
57
|
} else logInfo(`starting Rari server in ${mode} mode on port ${port}...`);
|
|
58
58
|
logInfo(`using binary: ${binaryPath}`);
|
|
59
|
-
const
|
|
59
|
+
const rustServer = spawn(binaryPath, [
|
|
60
60
|
"--mode",
|
|
61
61
|
mode,
|
|
62
62
|
"--port",
|
|
63
63
|
port,
|
|
64
64
|
"--host",
|
|
65
65
|
host
|
|
66
|
-
]
|
|
67
|
-
const rustServer = spawn(binaryPath, args$1, {
|
|
66
|
+
], {
|
|
68
67
|
stdio: "inherit",
|
|
69
68
|
cwd: process.cwd(),
|
|
70
69
|
env: {
|
|
@@ -99,7 +98,7 @@ async function deployToRailway() {
|
|
|
99
98
|
logError(`Already running in ${getPlatformName()} environment. Use "rari start" instead.`);
|
|
100
99
|
process.exit(1);
|
|
101
100
|
}
|
|
102
|
-
const { createRailwayDeployment } = await import("./railway-
|
|
101
|
+
const { createRailwayDeployment } = await import("./railway-_SVjSy6_.js");
|
|
103
102
|
await createRailwayDeployment();
|
|
104
103
|
}
|
|
105
104
|
async function deployToRender() {
|
|
@@ -108,7 +107,7 @@ async function deployToRender() {
|
|
|
108
107
|
logError(`Already running in ${getPlatformName()} environment. Use "rari start" instead.`);
|
|
109
108
|
process.exit(1);
|
|
110
109
|
}
|
|
111
|
-
const { createRenderDeployment } = await import("./render-
|
|
110
|
+
const { createRenderDeployment } = await import("./render-DZ66RSJC.js");
|
|
112
111
|
await createRenderDeployment();
|
|
113
112
|
}
|
|
114
113
|
async function main() {
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, RouterProvider, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-
|
|
1
|
+
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, RouterProvider, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-DgZI7OGo.js";
|
|
2
2
|
|
|
3
3
|
export { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, RouterProvider, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, RouterProvider, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, defineRariOptions, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-
|
|
3
|
-
import "./server-build-
|
|
1
|
+
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, RouterProvider, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-DgZI7OGo.js";
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, defineRariOptions, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-BYQ_UgvJ.js";
|
|
3
|
+
import "./server-build-CC1DF9LZ.js";
|
|
4
4
|
|
|
5
5
|
export { FileRouteGenerator, HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, RouterProvider, Routes, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createRouteManifest, defineRariConfig, defineRariOptions, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __require } from "./chunk-
|
|
1
|
+
import { __require } from "./chunk-D2j_47x6.js";
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
@@ -40,12 +40,11 @@ function getPlatformInfo() {
|
|
|
40
40
|
const platformKey = `${normalizedPlatform}-${normalizedArch}`;
|
|
41
41
|
const packageName = SUPPORTED_PLATFORMS[platformKey];
|
|
42
42
|
if (!packageName) throw new Error(`Unsupported platform combination: ${normalizedPlatform}-${normalizedArch}. Supported platforms: ${Object.keys(SUPPORTED_PLATFORMS).join(", ")}`);
|
|
43
|
-
const binaryName = normalizedPlatform === "win32" ? "rari.exe" : "rari";
|
|
44
43
|
return {
|
|
45
44
|
platform: normalizedPlatform,
|
|
46
45
|
arch: normalizedArch,
|
|
47
46
|
packageName,
|
|
48
|
-
binaryName
|
|
47
|
+
binaryName: normalizedPlatform === "win32" ? "rari.exe" : "rari"
|
|
49
48
|
};
|
|
50
49
|
}
|
|
51
50
|
function getBinaryPath() {
|
|
@@ -68,8 +67,7 @@ function getBinaryPath() {
|
|
|
68
67
|
}
|
|
69
68
|
} catch {}
|
|
70
69
|
try {
|
|
71
|
-
const
|
|
72
|
-
const packageDir = packagePath.replace("/package.json", "");
|
|
70
|
+
const packageDir = __require.resolve(`${packageName}/package.json`).replace("/package.json", "");
|
|
73
71
|
const binaryPath = join(packageDir, "bin", binaryName);
|
|
74
72
|
if (existsSync(binaryPath)) return binaryPath;
|
|
75
73
|
throw new Error(`Binary not found at ${binaryPath}`);
|
|
@@ -84,7 +84,7 @@ async function createRailwayDeployment() {
|
|
|
84
84
|
logSuccess("Updated .gitignore with Railway entries");
|
|
85
85
|
}
|
|
86
86
|
} else {
|
|
87
|
-
|
|
87
|
+
writeFileSync(gitignorePath, `# Dependencies
|
|
88
88
|
node_modules/
|
|
89
89
|
.pnpm-store/
|
|
90
90
|
|
|
@@ -119,8 +119,7 @@ Thumbs.db
|
|
|
119
119
|
# Temporary files
|
|
120
120
|
.tmp/
|
|
121
121
|
tmp/
|
|
122
|
-
|
|
123
|
-
writeFileSync(gitignorePath, defaultGitignore);
|
|
122
|
+
`);
|
|
124
123
|
logSuccess("Created .gitignore with Railway entries");
|
|
125
124
|
}
|
|
126
125
|
const readmePath = join(cwd, "README.md");
|
|
@@ -85,7 +85,7 @@ async function createRenderDeployment() {
|
|
|
85
85
|
logSuccess("Updated .gitignore with Render entries");
|
|
86
86
|
}
|
|
87
87
|
} else {
|
|
88
|
-
|
|
88
|
+
writeFileSync(gitignorePath, `# Dependencies
|
|
89
89
|
node_modules/
|
|
90
90
|
.pnpm-store/
|
|
91
91
|
|
|
@@ -120,8 +120,7 @@ Thumbs.db
|
|
|
120
120
|
# Temporary files
|
|
121
121
|
.tmp/
|
|
122
122
|
tmp/
|
|
123
|
-
|
|
124
|
-
writeFileSync(gitignorePath, defaultGitignore);
|
|
123
|
+
`);
|
|
125
124
|
logSuccess("Created .gitignore with Render entries");
|
|
126
125
|
}
|
|
127
126
|
const readmePath = join(cwd, "README.md");
|
|
@@ -15,8 +15,7 @@ function filePathToRoutePath(filePath) {
|
|
|
15
15
|
}
|
|
16
16
|
function extractParamNames(routePath) {
|
|
17
17
|
const params = [];
|
|
18
|
-
const
|
|
19
|
-
const matches = Array.from(routePath.matchAll(paramRegex));
|
|
18
|
+
const matches = Array.from(routePath.matchAll(/:([^/]+)/g));
|
|
20
19
|
for (const match of matches) {
|
|
21
20
|
let paramName = match[1];
|
|
22
21
|
if (paramName.endsWith("*")) paramName = paramName.slice(0, -1);
|
|
@@ -45,10 +44,8 @@ function matchRoute(pathname, route) {
|
|
|
45
44
|
for (let i = 0; i < paramNames.length; i++) {
|
|
46
45
|
const paramName = paramNames[i];
|
|
47
46
|
const paramValue = match[i + 1];
|
|
48
|
-
if (paramValue !== void 0) if (route.path.includes(`:${paramName}*`))
|
|
49
|
-
|
|
50
|
-
params[paramName] = segments;
|
|
51
|
-
} else params[paramName] = decodeURIComponent(paramValue);
|
|
47
|
+
if (paramValue !== void 0) if (route.path.includes(`:${paramName}*`)) params[paramName] = paramValue.split("/").filter(Boolean);
|
|
48
|
+
else params[paramName] = decodeURIComponent(paramValue);
|
|
52
49
|
}
|
|
53
50
|
return {
|
|
54
51
|
route,
|
|
@@ -257,10 +254,9 @@ function RouterProvider({ config = DEFAULT_CONFIG, routes = DEFAULT_ROUTES, chil
|
|
|
257
254
|
console.error("Error resolving initial route:", error);
|
|
258
255
|
initialRoute = null;
|
|
259
256
|
}
|
|
260
|
-
const isReady$1 = true;
|
|
261
257
|
return {
|
|
262
258
|
currentRoute: initialRoute,
|
|
263
|
-
isReady:
|
|
259
|
+
isReady: true
|
|
264
260
|
};
|
|
265
261
|
});
|
|
266
262
|
const currentRoute = routerState.currentRoute;
|
|
@@ -419,8 +415,7 @@ function RouteComponent({ path, component: Component, exact = false, render, chi
|
|
|
419
415
|
const { currentRoute } = useRouter();
|
|
420
416
|
const match = useMemo(() => {
|
|
421
417
|
if (!currentRoute) return null;
|
|
422
|
-
|
|
423
|
-
return isMatch ? currentRoute : null;
|
|
418
|
+
return (exact ? currentRoute.pathname === path : isPathActive(currentRoute.pathname, path, exact)) ? currentRoute : null;
|
|
424
419
|
}, [
|
|
425
420
|
currentRoute,
|
|
426
421
|
path,
|
|
@@ -481,8 +476,7 @@ function RouteRenderer({ routeMatch }) {
|
|
|
481
476
|
searchParams: routeMatch.searchParams
|
|
482
477
|
});
|
|
483
478
|
for (let i = routeMatch.layouts.length - 1; i >= 0; i--) {
|
|
484
|
-
const
|
|
485
|
-
const LayoutComponent = layout.component;
|
|
479
|
+
const LayoutComponent = routeMatch.layouts[i].component;
|
|
486
480
|
if (LayoutComponent) rendered = /* @__PURE__ */ jsx(LayoutComponent, {
|
|
487
481
|
route: routeMatch,
|
|
488
482
|
children: rendered
|
|
@@ -513,10 +507,7 @@ function findDeepestChildMatch(routeMatch, pathname) {
|
|
|
513
507
|
const remainingPath = `/${pathSegments.slice(routePathSegments.length).join("/")}`;
|
|
514
508
|
for (const childRoute of routeMatch.route.children) {
|
|
515
509
|
const childMatch = matchRoute(remainingPath, childRoute);
|
|
516
|
-
if (childMatch)
|
|
517
|
-
const deeperChild = findDeepestChildMatch(childMatch, pathname);
|
|
518
|
-
return deeperChild || childMatch;
|
|
519
|
-
}
|
|
510
|
+
if (childMatch) return findDeepestChildMatch(childMatch, pathname) || childMatch;
|
|
520
511
|
}
|
|
521
512
|
return null;
|
|
522
513
|
}
|
|
@@ -551,8 +542,7 @@ var HttpRuntimeClient = class {
|
|
|
551
542
|
initialized = false;
|
|
552
543
|
constructor(options = {}) {
|
|
553
544
|
const { host = "127.0.0.1", port = 3e3, timeout = 3e4, ssl = false } = options;
|
|
554
|
-
|
|
555
|
-
this.baseUrl = `${protocol}://${host}:${port}`;
|
|
545
|
+
this.baseUrl = `${ssl ? "https" : "http"}://${host}:${port}`;
|
|
556
546
|
this.timeout = timeout;
|
|
557
547
|
}
|
|
558
548
|
async request(endpoint, options = {}) {
|
|
@@ -573,8 +563,7 @@ var HttpRuntimeClient = class {
|
|
|
573
563
|
const errorText = await response.text();
|
|
574
564
|
throw new Error(`HTTP ${response.status}: ${errorText}`);
|
|
575
565
|
}
|
|
576
|
-
|
|
577
|
-
if (contentType?.includes("application/json")) return await response.json();
|
|
566
|
+
if (response.headers.get("content-type")?.includes("application/json")) return await response.json();
|
|
578
567
|
else return await response.text();
|
|
579
568
|
} catch (error) {
|
|
580
569
|
if (error instanceof Error) {
|