rari 0.5.3 → 0.5.5
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/app-routes-CwvIlCCV.mjs +3 -0
- package/dist/cli.mjs +45 -136
- package/dist/client.d.mts +1 -1
- package/dist/client.mjs +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +5 -5
- package/dist/{loading-component-map-Dda5WP1L.mjs → loading-component-map-Db2B5rLX.mjs} +1 -1
- package/dist/platform-Bkxq5JBQ.mjs +3 -0
- package/dist/platform-CcycgWL3.mjs +96 -0
- package/dist/server-build-C5LYunyo.mjs +3 -0
- package/dist/{vite-2nVNlWc7.mjs → vite-CNKYWQs-.mjs} +8 -9
- package/dist/{vite-CEX_9o-t.d.mts → vite-qZf0Yyd1.d.mts} +1 -1
- package/dist/vite.d.mts +2 -2
- package/dist/vite.mjs +5 -5
- package/package.json +6 -6
- package/src/cli.ts +47 -46
- package/src/runtime/AppRouterProvider.tsx +21 -34
- package/dist/app-routes-CUB8L75K.mjs +0 -3
- package/dist/platform-Bv9HDvl_.mjs +0 -3
- package/dist/server-build-BGFb0d6Z.mjs +0 -3
- /package/dist/{app-routes-DpO5Hf-o.mjs → app-routes-BjA_L5R4.mjs} +0 -0
- /package/dist/{chunk-DFPPfDFE.mjs → chunk-DLSkYcPk.mjs} +0 -0
- /package/dist/{loading-component-map-DR9_TT5T.mjs → loading-component-map-UZ-MQYv0.mjs} +0 -0
- /package/dist/{railway-B8SUWVNF.mjs → railway-B8VEi9Qi.mjs} +0 -0
- /package/dist/{render-CnuI67F1.mjs → render-Dz1orMws.mjs} +0 -0
- /package/dist/{runtime-client-BWSSyzPt.mjs → runtime-client-B3FN-k1i.mjs} +0 -0
- /package/dist/{runtime-client-DrRcA8ca.d.mts → runtime-client-BwT0A6kC.d.mts} +0 -0
- /package/dist/{server-build-DXITrV8k.mjs → server-build-BVvKXTME.mjs} +0 -0
package/dist/cli.mjs
CHANGED
|
@@ -1,101 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { join } from "node:path";
|
|
2
|
+
import { n as getInstallationInstructions, t as getBinaryPath } from "./platform-CcycgWL3.mjs";
|
|
5
3
|
import process from "node:process";
|
|
6
4
|
import { spawn } from "node:child_process";
|
|
7
5
|
import colors from "picocolors";
|
|
8
6
|
|
|
9
|
-
//#region src/platform.ts
|
|
10
|
-
const SUPPORTED_PLATFORMS = {
|
|
11
|
-
"linux-x64": "rari-linux-x64",
|
|
12
|
-
"linux-arm64": "rari-linux-arm64",
|
|
13
|
-
"darwin-x64": "rari-darwin-x64",
|
|
14
|
-
"darwin-arm64": "rari-darwin-arm64",
|
|
15
|
-
"win32-x64": "rari-win32-x64"
|
|
16
|
-
};
|
|
17
|
-
function getPlatformInfo() {
|
|
18
|
-
const platform = process.platform;
|
|
19
|
-
const arch = process.arch;
|
|
20
|
-
let normalizedPlatform;
|
|
21
|
-
switch (platform) {
|
|
22
|
-
case "darwin":
|
|
23
|
-
normalizedPlatform = "darwin";
|
|
24
|
-
break;
|
|
25
|
-
case "linux":
|
|
26
|
-
normalizedPlatform = "linux";
|
|
27
|
-
break;
|
|
28
|
-
case "win32":
|
|
29
|
-
normalizedPlatform = "win32";
|
|
30
|
-
break;
|
|
31
|
-
default: throw new Error(`Unsupported platform: ${platform}. Rari supports Linux, macOS, and Windows.`);
|
|
32
|
-
}
|
|
33
|
-
let normalizedArch;
|
|
34
|
-
switch (arch) {
|
|
35
|
-
case "x64":
|
|
36
|
-
normalizedArch = "x64";
|
|
37
|
-
break;
|
|
38
|
-
case "arm64":
|
|
39
|
-
normalizedArch = "arm64";
|
|
40
|
-
break;
|
|
41
|
-
default: throw new Error(`Unsupported architecture: ${arch}. Rari supports x64 and ARM64.`);
|
|
42
|
-
}
|
|
43
|
-
const packageName = SUPPORTED_PLATFORMS[`${normalizedPlatform}-${normalizedArch}`];
|
|
44
|
-
if (!packageName) throw new Error(`Unsupported platform combination: ${normalizedPlatform}-${normalizedArch}. Supported platforms: ${Object.keys(SUPPORTED_PLATFORMS).join(", ")}`);
|
|
45
|
-
return {
|
|
46
|
-
platform: normalizedPlatform,
|
|
47
|
-
arch: normalizedArch,
|
|
48
|
-
packageName,
|
|
49
|
-
binaryName: normalizedPlatform === "win32" ? "rari.exe" : "rari"
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function getBinaryPath() {
|
|
53
|
-
const { packageName, binaryName } = getPlatformInfo();
|
|
54
|
-
try {
|
|
55
|
-
let currentDir = process.cwd();
|
|
56
|
-
let workspaceRoot = null;
|
|
57
|
-
while (currentDir !== "/" && currentDir !== "") {
|
|
58
|
-
if (existsSync(join(currentDir, "packages"))) {
|
|
59
|
-
workspaceRoot = currentDir;
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
currentDir = join(currentDir, "..");
|
|
63
|
-
}
|
|
64
|
-
if (workspaceRoot) {
|
|
65
|
-
const binaryPath = join(join(workspaceRoot, "packages", packageName), "bin", binaryName);
|
|
66
|
-
if (existsSync(binaryPath)) return binaryPath;
|
|
67
|
-
}
|
|
68
|
-
} catch {}
|
|
69
|
-
try {
|
|
70
|
-
const binaryPath = join(__require.resolve(`${packageName}/package.json`).replace("/package.json", ""), "bin", binaryName);
|
|
71
|
-
if (existsSync(binaryPath)) return binaryPath;
|
|
72
|
-
throw new Error(`Binary not found at ${binaryPath}`);
|
|
73
|
-
} catch {
|
|
74
|
-
throw new Error(`Failed to locate Rari binary for ${packageName}. Please ensure the platform package is installed: npm install ${packageName}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
function getInstallationInstructions() {
|
|
78
|
-
const { packageName } = getPlatformInfo();
|
|
79
|
-
return `
|
|
80
|
-
To install Rari for your platform, run:
|
|
81
|
-
|
|
82
|
-
npm install ${packageName}
|
|
83
|
-
|
|
84
|
-
Or if you're using pnpm:
|
|
85
|
-
|
|
86
|
-
pnpm add ${packageName}
|
|
87
|
-
|
|
88
|
-
Or if you're using yarn:
|
|
89
|
-
|
|
90
|
-
yarn add ${packageName}
|
|
91
|
-
|
|
92
|
-
If you continue to have issues, you can also install from source:
|
|
93
|
-
|
|
94
|
-
cargo install --git https://github.com/rari-build/rari
|
|
95
|
-
`;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
//#endregion
|
|
99
7
|
//#region src/cli.ts
|
|
100
8
|
const [, , command, ...args] = process.argv;
|
|
101
9
|
function logInfo(message) {
|
|
@@ -187,7 +95,7 @@ async function deployToRailway() {
|
|
|
187
95
|
logError(`Already running in ${getPlatformName()} environment. Use "rari start" instead.`);
|
|
188
96
|
process.exit(1);
|
|
189
97
|
}
|
|
190
|
-
const { createRailwayDeployment } = await import("./railway-
|
|
98
|
+
const { createRailwayDeployment } = await import("./railway-B8VEi9Qi.mjs");
|
|
191
99
|
await createRailwayDeployment();
|
|
192
100
|
}
|
|
193
101
|
async function deployToRender() {
|
|
@@ -196,79 +104,80 @@ async function deployToRender() {
|
|
|
196
104
|
logError(`Already running in ${getPlatformName()} environment. Use "rari start" instead.`);
|
|
197
105
|
process.exit(1);
|
|
198
106
|
}
|
|
199
|
-
const { createRenderDeployment } = await import("./render-
|
|
107
|
+
const { createRenderDeployment } = await import("./render-Dz1orMws.mjs");
|
|
200
108
|
await createRenderDeployment();
|
|
201
109
|
}
|
|
202
110
|
async function main() {
|
|
203
111
|
switch (command) {
|
|
204
|
-
case
|
|
205
|
-
await startRustServer();
|
|
206
|
-
break;
|
|
207
|
-
case "deploy":
|
|
208
|
-
if (args[0] === "railway") await deployToRailway();
|
|
209
|
-
else if (args[0] === "render") await deployToRender();
|
|
210
|
-
else {
|
|
211
|
-
logError("Unknown deployment target. Available: railway, render");
|
|
212
|
-
process.exit(1);
|
|
213
|
-
}
|
|
214
|
-
break;
|
|
112
|
+
case void 0:
|
|
215
113
|
case "help":
|
|
216
114
|
case "--help":
|
|
217
115
|
case "-h":
|
|
218
|
-
console.warn(`${colors.bold
|
|
116
|
+
console.warn(`${colors.bold("Rari CLI")}
|
|
219
117
|
|
|
220
|
-
${colors.bold
|
|
221
|
-
${colors.cyan
|
|
222
|
-
${colors.cyan
|
|
223
|
-
${colors.cyan
|
|
224
|
-
${colors.cyan
|
|
118
|
+
${colors.bold("Usage:")}
|
|
119
|
+
${colors.cyan("rari start")} Start the Rari server
|
|
120
|
+
${colors.cyan("rari deploy railway")} Setup Railway deployment
|
|
121
|
+
${colors.cyan("rari deploy render")} Setup Render deployment
|
|
122
|
+
${colors.cyan("rari help")} Show this help message
|
|
225
123
|
|
|
226
|
-
${colors.bold
|
|
227
|
-
${colors.yellow
|
|
228
|
-
${colors.yellow
|
|
229
|
-
${colors.yellow
|
|
230
|
-
${colors.yellow
|
|
124
|
+
${colors.bold("Environment Variables:")}
|
|
125
|
+
${colors.yellow("PORT")} Server port (default: 3000)
|
|
126
|
+
${colors.yellow("RSC_PORT")} Alternative server port
|
|
127
|
+
${colors.yellow("NODE_ENV")} Environment (development/production)
|
|
128
|
+
${colors.yellow("RUST_LOG")} Rust logging level (default: info)
|
|
231
129
|
|
|
232
|
-
${colors.bold
|
|
233
|
-
${colors.gray
|
|
234
|
-
${colors.cyan
|
|
130
|
+
${colors.bold("Examples:")}
|
|
131
|
+
${colors.gray("# Start development server on port 3000")}
|
|
132
|
+
${colors.cyan("rari start")}
|
|
235
133
|
|
|
236
|
-
${colors.gray
|
|
237
|
-
${colors.cyan
|
|
134
|
+
${colors.gray("# Start production server on port 8080")}
|
|
135
|
+
${colors.cyan("PORT=8080 NODE_ENV=production rari start")}
|
|
238
136
|
|
|
239
|
-
${colors.gray
|
|
240
|
-
${colors.cyan
|
|
137
|
+
${colors.gray("# Setup Railway deployment")}
|
|
138
|
+
${colors.cyan("rari deploy railway")}
|
|
241
139
|
|
|
242
|
-
${colors.gray
|
|
243
|
-
${colors.cyan
|
|
140
|
+
${colors.gray("# Setup Render deployment")}
|
|
141
|
+
${colors.cyan("rari deploy render")}
|
|
244
142
|
|
|
245
|
-
${colors.gray
|
|
246
|
-
${colors.cyan
|
|
143
|
+
${colors.gray("# Start with debug logging")}
|
|
144
|
+
${colors.cyan("RUST_LOG=debug rari start")}
|
|
247
145
|
|
|
248
|
-
${colors.bold
|
|
249
|
-
${colors.cyan
|
|
250
|
-
${colors.cyan
|
|
146
|
+
${colors.bold("Deployment:")}
|
|
147
|
+
${colors.cyan("rari deploy railway")} Creates Railway deployment files
|
|
148
|
+
${colors.cyan("rari deploy render")} Creates Render deployment files
|
|
251
149
|
|
|
252
150
|
Platform deployment automatically detects the environment and configures:
|
|
253
151
|
- Host binding (0.0.0.0 for platforms, 127.0.0.1 for local)
|
|
254
152
|
- Port from platform's PORT environment variable
|
|
255
153
|
- Production mode optimization
|
|
256
154
|
|
|
257
|
-
${colors.bold
|
|
155
|
+
${colors.bold("Binary Resolution:")}
|
|
258
156
|
1. Platform-specific package (rari-{platform}-{arch})
|
|
259
157
|
2. Global binary in PATH
|
|
260
158
|
3. Install from source with Cargo
|
|
261
159
|
|
|
262
|
-
${colors.bold
|
|
160
|
+
${colors.bold("Notes:")}
|
|
263
161
|
- Platform binary is automatically detected and used
|
|
264
162
|
- Platform deployment is automatically detected and configured
|
|
265
163
|
- Use Ctrl+C to stop the server gracefully
|
|
266
164
|
|
|
267
165
|
`);
|
|
268
166
|
break;
|
|
167
|
+
case "start":
|
|
168
|
+
await startRustServer();
|
|
169
|
+
break;
|
|
170
|
+
case "deploy":
|
|
171
|
+
if (args[0] === "railway") await deployToRailway();
|
|
172
|
+
else if (args[0] === "render") await deployToRender();
|
|
173
|
+
else {
|
|
174
|
+
logError("Unknown deployment target. Available: railway, render");
|
|
175
|
+
process.exit(1);
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
269
178
|
default:
|
|
270
|
-
console.error(`${colors.bold
|
|
271
|
-
console.warn(`Run "${colors.cyan
|
|
179
|
+
console.error(`${colors.bold("Unknown command:")} ${command}`);
|
|
180
|
+
console.warn(`Run "${colors.cyan("rari help")}" for available commands`);
|
|
272
181
|
process.exit(1);
|
|
273
182
|
}
|
|
274
183
|
}
|
|
@@ -279,4 +188,4 @@ main().catch((error) => {
|
|
|
279
188
|
});
|
|
280
189
|
|
|
281
190
|
//#endregion
|
|
282
|
-
export {
|
|
191
|
+
export { };
|
package/dist/client.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as RouteSegment, A as NavigationErrorType, B as AppRouteManifest, C as extractStaticParams, D as NavigationError, E as NavigationErrorOverlayProps, F as LayoutManager, G as GenerateStaticParams, H as ErrorEntry, I as LayoutErrorBoundary, J as LoadingEntry, K as LayoutEntry, L as ClientRouter, M as fetchWithTimeout, N as LayoutDiff, O as NavigationErrorHandler, P as LayoutInstance, Q as PageProps, R as ClientRouterProps, S as extractServerPropsWithCache, T as NavigationErrorOverlay, U as ErrorProps, V as AppRouteMatch, W as GenerateMetadata, X as NotFoundEntry, Y as LoadingProps, Z as NotFoundProps, _ as StaticParamsResult, a as LoadingSpinner, b as extractMetadata, c as createErrorBoundary, d as PreservedState, et as RouteSegmentType, f as ScrollPosition, g as ServerPropsResult, h as MetadataResult, i as HttpRuntimeClient, j as createNavigationError, k as NavigationErrorHandlerOptions, l as createHttpRuntimeClient, m as StatePreserverConfig, n as DefaultLoading, o as NotFound, p as StatePreserver, q as LayoutProps, r as ErrorBoundary, s as RuntimeClient, t as DefaultError, u as createLoadingBoundary, v as clearPropsCache, w as hasServerSideDataFetching, x as extractServerProps, y as clearPropsCacheForComponent, z as AppRouteEntry } from "./runtime-client-
|
|
1
|
+
import { $ as RouteSegment, A as NavigationErrorType, B as AppRouteManifest, C as extractStaticParams, D as NavigationError, E as NavigationErrorOverlayProps, F as LayoutManager, G as GenerateStaticParams, H as ErrorEntry, I as LayoutErrorBoundary, J as LoadingEntry, K as LayoutEntry, L as ClientRouter, M as fetchWithTimeout, N as LayoutDiff, O as NavigationErrorHandler, P as LayoutInstance, Q as PageProps, R as ClientRouterProps, S as extractServerPropsWithCache, T as NavigationErrorOverlay, U as ErrorProps, V as AppRouteMatch, W as GenerateMetadata, X as NotFoundEntry, Y as LoadingProps, Z as NotFoundProps, _ as StaticParamsResult, a as LoadingSpinner, b as extractMetadata, c as createErrorBoundary, d as PreservedState, et as RouteSegmentType, f as ScrollPosition, g as ServerPropsResult, h as MetadataResult, i as HttpRuntimeClient, j as createNavigationError, k as NavigationErrorHandlerOptions, l as createHttpRuntimeClient, m as StatePreserverConfig, n as DefaultLoading, o as NotFound, p as StatePreserver, q as LayoutProps, r as ErrorBoundary, s as RuntimeClient, t as DefaultError, u as createLoadingBoundary, v as clearPropsCache, w as hasServerSideDataFetching, x as extractServerProps, y as clearPropsCacheForComponent, z as AppRouteEntry } from "./runtime-client-BwT0A6kC.mjs";
|
|
2
2
|
export { type AppRouteEntry, type AppRouteManifest, type AppRouteMatch, ClientRouter, type ClientRouterProps, DefaultError, DefaultLoading, ErrorBoundary, type ErrorEntry, type ErrorProps, type GenerateMetadata, type GenerateStaticParams, HttpRuntimeClient, type LayoutDiff, type LayoutEntry, LayoutErrorBoundary, type LayoutInstance, LayoutManager, type LayoutProps, type LoadingEntry, type LoadingProps, LoadingSpinner, type MetadataResult, type NavigationError, NavigationErrorHandler, type NavigationErrorHandlerOptions, NavigationErrorOverlay, type NavigationErrorOverlayProps, type NavigationErrorType, NotFound, type NotFoundEntry, type NotFoundProps, type PageProps, type PreservedState, type RouteSegment, type RouteSegmentType, type RuntimeClient, type ScrollPosition, type ServerPropsResult, StatePreserver, type StatePreserverConfig, type StaticParamsResult, clearPropsCache, clearPropsCacheForComponent, createErrorBoundary, createHttpRuntimeClient, createLoadingBoundary, createNavigationError, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, fetchWithTimeout, hasServerSideDataFetching };
|
package/dist/client.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as fetchWithTimeout, S as createNavigationError, _ as LayoutErrorBoundary, a as LoadingSpinner, b as NavigationErrorOverlay, c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, l as createLoadingBoundary, m as extractServerPropsWithCache, n as DefaultLoading, o as NotFound, p as extractServerProps, r as ErrorBoundary, s as createErrorBoundary, t as DefaultError, u as clearPropsCache, v as ClientRouter, w as LayoutManager, x as NavigationErrorHandler, y as StatePreserver } from "./runtime-client-
|
|
1
|
+
import { C as fetchWithTimeout, S as createNavigationError, _ as LayoutErrorBoundary, a as LoadingSpinner, b as NavigationErrorOverlay, c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, l as createLoadingBoundary, m as extractServerPropsWithCache, n as DefaultLoading, o as NotFound, p as extractServerProps, r as ErrorBoundary, s as createErrorBoundary, t as DefaultError, u as clearPropsCache, v as ClientRouter, w as LayoutManager, x as NavigationErrorHandler, y as StatePreserver } from "./runtime-client-B3FN-k1i.mjs";
|
|
2
2
|
|
|
3
3
|
export { ClientRouter, DefaultError, DefaultLoading, ErrorBoundary, HttpRuntimeClient, LayoutErrorBoundary, LayoutManager, LoadingSpinner, NavigationErrorHandler, NavigationErrorOverlay, NotFound, StatePreserver, clearPropsCache, clearPropsCacheForComponent, createErrorBoundary, createHttpRuntimeClient, createLoadingBoundary, createNavigationError, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, fetchWithTimeout, hasServerSideDataFetching };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as RouteSegment, B as AppRouteManifest, C as extractStaticParams, G as GenerateStaticParams, H as ErrorEntry, J as LoadingEntry, K as LayoutEntry, Q as PageProps, S as extractServerPropsWithCache, U as ErrorProps, V as AppRouteMatch, W as GenerateMetadata, X as NotFoundEntry, Y as LoadingProps, Z as NotFoundProps, _ as StaticParamsResult, b as extractMetadata, et as RouteSegmentType, g as ServerPropsResult, h as MetadataResult, i as HttpRuntimeClient, l as createHttpRuntimeClient, q as LayoutProps, s as RuntimeClient, v as clearPropsCache, w as hasServerSideDataFetching, x as extractServerProps, y as clearPropsCacheForComponent, z as AppRouteEntry } from "./runtime-client-
|
|
2
|
-
import { a as rari, c as generateAppRouteManifest, d as headers, f as ApiRouteHandlers, h as RouteHandler, i as defineRariOptions, l as loadManifest, m as RouteContext, n as Response, o as rariRouter, p as RariResponse, r as defineRariConfig, s as AppRouteGenerator, t as Request, u as writeManifest } from "./vite-
|
|
1
|
+
import { $ as RouteSegment, B as AppRouteManifest, C as extractStaticParams, G as GenerateStaticParams, H as ErrorEntry, J as LoadingEntry, K as LayoutEntry, Q as PageProps, S as extractServerPropsWithCache, U as ErrorProps, V as AppRouteMatch, W as GenerateMetadata, X as NotFoundEntry, Y as LoadingProps, Z as NotFoundProps, _ as StaticParamsResult, b as extractMetadata, et as RouteSegmentType, g as ServerPropsResult, h as MetadataResult, i as HttpRuntimeClient, l as createHttpRuntimeClient, q as LayoutProps, s as RuntimeClient, v as clearPropsCache, w as hasServerSideDataFetching, x as extractServerProps, y as clearPropsCacheForComponent, z as AppRouteEntry } from "./runtime-client-BwT0A6kC.mjs";
|
|
2
|
+
import { a as rari, c as generateAppRouteManifest, d as headers, f as ApiRouteHandlers, h as RouteHandler, i as defineRariOptions, l as loadManifest, m as RouteContext, n as Response, o as rariRouter, p as RariResponse, r as defineRariConfig, s as AppRouteGenerator, t as Request, u as writeManifest } from "./vite-qZf0Yyd1.mjs";
|
|
3
3
|
export { ApiRouteHandlers, AppRouteEntry, AppRouteGenerator, AppRouteManifest, AppRouteMatch, ErrorEntry, ErrorProps, GenerateMetadata, GenerateStaticParams, HttpRuntimeClient, LayoutEntry, LayoutProps, LoadingEntry, LoadingProps, MetadataResult, NotFoundEntry, NotFoundProps, PageProps, RariResponse, Request, Response, RouteContext, RouteHandler, RouteSegment, RouteSegmentType, RuntimeClient, ServerPropsResult, StaticParamsResult, clearPropsCache, clearPropsCacheForComponent, createHttpRuntimeClient, defineRariConfig, defineRariOptions, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, generateAppRouteManifest, hasServerSideDataFetching, headers, loadManifest, rari, rariRouter, writeManifest };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as headers, i as rariRouter, n as defineRariOptions, o as RariResponse, r as rari, t as defineRariConfig } from "./vite-
|
|
2
|
-
import { i as writeManifest, n as generateAppRouteManifest, r as loadManifest, t as AppRouteGenerator } from "./app-routes-
|
|
3
|
-
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-
|
|
4
|
-
import "./loading-component-map-
|
|
5
|
-
import "./server-build-
|
|
1
|
+
import { a as headers, i as rariRouter, n as defineRariOptions, o as RariResponse, r as rari, t as defineRariConfig } from "./vite-CNKYWQs-.mjs";
|
|
2
|
+
import { i as writeManifest, n as generateAppRouteManifest, r as loadManifest, t as AppRouteGenerator } from "./app-routes-BjA_L5R4.mjs";
|
|
3
|
+
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-B3FN-k1i.mjs";
|
|
4
|
+
import "./loading-component-map-UZ-MQYv0.mjs";
|
|
5
|
+
import "./server-build-BVvKXTME.mjs";
|
|
6
6
|
|
|
7
7
|
export { AppRouteGenerator, HttpRuntimeClient, RariResponse, clearPropsCache, clearPropsCacheForComponent, createHttpRuntimeClient, defineRariConfig, defineRariOptions, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, generateAppRouteManifest, hasServerSideDataFetching, headers, loadManifest, rari, rariRouter, writeManifest };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { n as getLoadingComponentMapPath, t as generateLoadingComponentMap } from "./loading-component-map-
|
|
1
|
+
import { n as getLoadingComponentMapPath, t as generateLoadingComponentMap } from "./loading-component-map-UZ-MQYv0.mjs";
|
|
2
2
|
|
|
3
3
|
export { generateLoadingComponentMap, getLoadingComponentMapPath };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { t as __require } from "./chunk-DLSkYcPk.mjs";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import process from "node:process";
|
|
5
|
+
|
|
6
|
+
//#region src/platform.ts
|
|
7
|
+
const SUPPORTED_PLATFORMS = {
|
|
8
|
+
"linux-x64": "rari-linux-x64",
|
|
9
|
+
"linux-arm64": "rari-linux-arm64",
|
|
10
|
+
"darwin-x64": "rari-darwin-x64",
|
|
11
|
+
"darwin-arm64": "rari-darwin-arm64",
|
|
12
|
+
"win32-x64": "rari-win32-x64"
|
|
13
|
+
};
|
|
14
|
+
function getPlatformInfo() {
|
|
15
|
+
const platform = process.platform;
|
|
16
|
+
const arch = process.arch;
|
|
17
|
+
let normalizedPlatform;
|
|
18
|
+
switch (platform) {
|
|
19
|
+
case "darwin":
|
|
20
|
+
normalizedPlatform = "darwin";
|
|
21
|
+
break;
|
|
22
|
+
case "linux":
|
|
23
|
+
normalizedPlatform = "linux";
|
|
24
|
+
break;
|
|
25
|
+
case "win32":
|
|
26
|
+
normalizedPlatform = "win32";
|
|
27
|
+
break;
|
|
28
|
+
default: throw new Error(`Unsupported platform: ${platform}. Rari supports Linux, macOS, and Windows.`);
|
|
29
|
+
}
|
|
30
|
+
let normalizedArch;
|
|
31
|
+
switch (arch) {
|
|
32
|
+
case "x64":
|
|
33
|
+
normalizedArch = "x64";
|
|
34
|
+
break;
|
|
35
|
+
case "arm64":
|
|
36
|
+
normalizedArch = "arm64";
|
|
37
|
+
break;
|
|
38
|
+
default: throw new Error(`Unsupported architecture: ${arch}. Rari supports x64 and ARM64.`);
|
|
39
|
+
}
|
|
40
|
+
const packageName = SUPPORTED_PLATFORMS[`${normalizedPlatform}-${normalizedArch}`];
|
|
41
|
+
if (!packageName) throw new Error(`Unsupported platform combination: ${normalizedPlatform}-${normalizedArch}. Supported platforms: ${Object.keys(SUPPORTED_PLATFORMS).join(", ")}`);
|
|
42
|
+
return {
|
|
43
|
+
platform: normalizedPlatform,
|
|
44
|
+
arch: normalizedArch,
|
|
45
|
+
packageName,
|
|
46
|
+
binaryName: normalizedPlatform === "win32" ? "rari.exe" : "rari"
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function getBinaryPath() {
|
|
50
|
+
const { packageName, binaryName } = getPlatformInfo();
|
|
51
|
+
try {
|
|
52
|
+
let currentDir = process.cwd();
|
|
53
|
+
let workspaceRoot = null;
|
|
54
|
+
while (currentDir !== "/" && currentDir !== "") {
|
|
55
|
+
if (existsSync(join(currentDir, "packages"))) {
|
|
56
|
+
workspaceRoot = currentDir;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
currentDir = join(currentDir, "..");
|
|
60
|
+
}
|
|
61
|
+
if (workspaceRoot) {
|
|
62
|
+
const binaryPath = join(join(workspaceRoot, "packages", packageName), "bin", binaryName);
|
|
63
|
+
if (existsSync(binaryPath)) return binaryPath;
|
|
64
|
+
}
|
|
65
|
+
} catch {}
|
|
66
|
+
try {
|
|
67
|
+
const binaryPath = join(__require.resolve(`${packageName}/package.json`).replace("/package.json", ""), "bin", binaryName);
|
|
68
|
+
if (existsSync(binaryPath)) return binaryPath;
|
|
69
|
+
throw new Error(`Binary not found at ${binaryPath}`);
|
|
70
|
+
} catch {
|
|
71
|
+
throw new Error(`Failed to locate Rari binary for ${packageName}. Please ensure the platform package is installed: npm install ${packageName}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function getInstallationInstructions() {
|
|
75
|
+
const { packageName } = getPlatformInfo();
|
|
76
|
+
return `
|
|
77
|
+
To install Rari for your platform, run:
|
|
78
|
+
|
|
79
|
+
npm install ${packageName}
|
|
80
|
+
|
|
81
|
+
Or if you're using pnpm:
|
|
82
|
+
|
|
83
|
+
pnpm add ${packageName}
|
|
84
|
+
|
|
85
|
+
Or if you're using yarn:
|
|
86
|
+
|
|
87
|
+
yarn add ${packageName}
|
|
88
|
+
|
|
89
|
+
If you continue to have issues, you can also install from source:
|
|
90
|
+
|
|
91
|
+
cargo install --git https://github.com/rari-build/rari
|
|
92
|
+
`;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { getInstallationInstructions as n, getBinaryPath as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as __require } from "./chunk-
|
|
2
|
-
import { n as createServerBuildPlugin } from "./server-build-
|
|
1
|
+
import { t as __require } from "./chunk-DLSkYcPk.mjs";
|
|
2
|
+
import { n as createServerBuildPlugin } from "./server-build-BVvKXTME.mjs";
|
|
3
3
|
import fs, { promises } from "node:fs";
|
|
4
4
|
import path, { join, relative, resolve, sep } from "node:path";
|
|
5
5
|
import process$1 from "node:process";
|
|
@@ -986,7 +986,6 @@ var NodeFsHandler = class {
|
|
|
986
986
|
|
|
987
987
|
//#endregion
|
|
988
988
|
//#region ../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js
|
|
989
|
-
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
990
989
|
const SLASH = "/";
|
|
991
990
|
const SLASH_SLASH = "//";
|
|
992
991
|
const ONE_DOT = ".";
|
|
@@ -1745,13 +1744,13 @@ function rariRouter(options = {}) {
|
|
|
1745
1744
|
console.warn("[Manifest] Route structure unchanged, using cached manifest");
|
|
1746
1745
|
return cachedManifestContent;
|
|
1747
1746
|
}
|
|
1748
|
-
const { generateAppRouteManifest: generateAppRouteManifest$1 } = await import("./app-routes-
|
|
1747
|
+
const { generateAppRouteManifest: generateAppRouteManifest$1 } = await import("./app-routes-CwvIlCCV.mjs");
|
|
1749
1748
|
const manifest = await generateAppRouteManifest$1(appDir, { extensions: opts.extensions });
|
|
1750
1749
|
const manifestContent = JSON.stringify(manifest, null, 2);
|
|
1751
1750
|
const outDir = path.resolve(root, opts.outDir);
|
|
1752
1751
|
await promises.mkdir(outDir, { recursive: true });
|
|
1753
1752
|
await promises.writeFile(path.join(outDir, "app-routes.json"), manifestContent, "utf-8");
|
|
1754
|
-
const { generateLoadingComponentMap, getLoadingComponentMapPath } = await import("./loading-component-map-
|
|
1753
|
+
const { generateLoadingComponentMap, getLoadingComponentMapPath } = await import("./loading-component-map-Db2B5rLX.mjs");
|
|
1755
1754
|
const loadingMapCode = generateLoadingComponentMap({
|
|
1756
1755
|
appDir: opts.appDir,
|
|
1757
1756
|
loadingComponents: manifest.loading
|
|
@@ -1882,7 +1881,7 @@ function rariRouter(options = {}) {
|
|
|
1882
1881
|
});
|
|
1883
1882
|
try {
|
|
1884
1883
|
const manifest = JSON.parse(cachedManifestContent);
|
|
1885
|
-
const { generateLoadingComponentMap } = await import("./loading-component-map-
|
|
1884
|
+
const { generateLoadingComponentMap } = await import("./loading-component-map-Db2B5rLX.mjs");
|
|
1886
1885
|
const loadingMapCode = generateLoadingComponentMap({
|
|
1887
1886
|
appDir: opts.appDir,
|
|
1888
1887
|
loadingComponents: manifest.loading
|
|
@@ -2667,7 +2666,7 @@ const ${componentName$1} = registerClientReference(
|
|
|
2667
2666
|
let serverComponentBuilder = null;
|
|
2668
2667
|
const discoverAndRegisterComponents = async () => {
|
|
2669
2668
|
try {
|
|
2670
|
-
const { ServerComponentBuilder, scanDirectory } = await import("./server-build-
|
|
2669
|
+
const { ServerComponentBuilder, scanDirectory } = await import("./server-build-C5LYunyo.mjs");
|
|
2671
2670
|
const builder = new ServerComponentBuilder(projectRoot, {
|
|
2672
2671
|
outDir: "dist",
|
|
2673
2672
|
serverDir: "server",
|
|
@@ -2752,7 +2751,7 @@ const ${componentName$1} = registerClientReference(
|
|
|
2752
2751
|
};
|
|
2753
2752
|
const startRustServer = async () => {
|
|
2754
2753
|
if (rustServerProcess) return;
|
|
2755
|
-
const { getBinaryPath, getInstallationInstructions } = await import("./platform-
|
|
2754
|
+
const { getBinaryPath, getInstallationInstructions } = await import("./platform-Bkxq5JBQ.mjs");
|
|
2756
2755
|
let binaryPath;
|
|
2757
2756
|
try {
|
|
2758
2757
|
binaryPath = getBinaryPath();
|
|
@@ -2828,7 +2827,7 @@ const ${componentName$1} = registerClientReference(
|
|
|
2828
2827
|
const handleServerComponentHMR = async (filePath) => {
|
|
2829
2828
|
try {
|
|
2830
2829
|
if (!isServerComponent(filePath)) return;
|
|
2831
|
-
const { ServerComponentBuilder } = await import("./server-build-
|
|
2830
|
+
const { ServerComponentBuilder } = await import("./server-build-C5LYunyo.mjs");
|
|
2832
2831
|
const builder = new ServerComponentBuilder(projectRoot, {
|
|
2833
2832
|
outDir: "dist",
|
|
2834
2833
|
serverDir: "server",
|
package/dist/vite.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as RouteSegment, B as AppRouteManifest, C as extractStaticParams, G as GenerateStaticParams, H as ErrorEntry, J as LoadingEntry, K as LayoutEntry, Q as PageProps, S as extractServerPropsWithCache, U as ErrorProps, V as AppRouteMatch, W as GenerateMetadata, X as NotFoundEntry, Y as LoadingProps, Z as NotFoundProps, _ as StaticParamsResult, b as extractMetadata, et as RouteSegmentType, g as ServerPropsResult, h as MetadataResult, i as HttpRuntimeClient, l as createHttpRuntimeClient, q as LayoutProps, s as RuntimeClient, v as clearPropsCache, w as hasServerSideDataFetching, x as extractServerProps, y as clearPropsCacheForComponent, z as AppRouteEntry } from "./runtime-client-
|
|
2
|
-
import { a as rari, c as generateAppRouteManifest, d as headers, f as ApiRouteHandlers, h as RouteHandler, i as defineRariOptions, l as loadManifest, m as RouteContext, n as Response, o as rariRouter, p as RariResponse, r as defineRariConfig, s as AppRouteGenerator, t as Request, u as writeManifest } from "./vite-
|
|
1
|
+
import { $ as RouteSegment, B as AppRouteManifest, C as extractStaticParams, G as GenerateStaticParams, H as ErrorEntry, J as LoadingEntry, K as LayoutEntry, Q as PageProps, S as extractServerPropsWithCache, U as ErrorProps, V as AppRouteMatch, W as GenerateMetadata, X as NotFoundEntry, Y as LoadingProps, Z as NotFoundProps, _ as StaticParamsResult, b as extractMetadata, et as RouteSegmentType, g as ServerPropsResult, h as MetadataResult, i as HttpRuntimeClient, l as createHttpRuntimeClient, q as LayoutProps, s as RuntimeClient, v as clearPropsCache, w as hasServerSideDataFetching, x as extractServerProps, y as clearPropsCacheForComponent, z as AppRouteEntry } from "./runtime-client-BwT0A6kC.mjs";
|
|
2
|
+
import { a as rari, c as generateAppRouteManifest, d as headers, f as ApiRouteHandlers, h as RouteHandler, i as defineRariOptions, l as loadManifest, m as RouteContext, n as Response, o as rariRouter, p as RariResponse, r as defineRariConfig, s as AppRouteGenerator, t as Request, u as writeManifest } from "./vite-qZf0Yyd1.mjs";
|
|
3
3
|
export { ApiRouteHandlers, AppRouteEntry, AppRouteGenerator, AppRouteManifest, AppRouteMatch, ErrorEntry, ErrorProps, GenerateMetadata, GenerateStaticParams, HttpRuntimeClient, LayoutEntry, LayoutProps, LoadingEntry, LoadingProps, MetadataResult, NotFoundEntry, NotFoundProps, PageProps, RariResponse, Request, Response, RouteContext, RouteHandler, RouteSegment, RouteSegmentType, RuntimeClient, ServerPropsResult, StaticParamsResult, clearPropsCache, clearPropsCacheForComponent, createHttpRuntimeClient, defineRariConfig, defineRariOptions, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, generateAppRouteManifest, hasServerSideDataFetching, headers, loadManifest, rari, rariRouter, writeManifest };
|
package/dist/vite.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as headers, i as rariRouter, n as defineRariOptions, o as RariResponse, r as rari, t as defineRariConfig } from "./vite-
|
|
2
|
-
import { i as writeManifest, n as generateAppRouteManifest, r as loadManifest, t as AppRouteGenerator } from "./app-routes-
|
|
3
|
-
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-
|
|
4
|
-
import "./loading-component-map-
|
|
5
|
-
import "./server-build-
|
|
1
|
+
import { a as headers, i as rariRouter, n as defineRariOptions, o as RariResponse, r as rari, t as defineRariConfig } from "./vite-CNKYWQs-.mjs";
|
|
2
|
+
import { i as writeManifest, n as generateAppRouteManifest, r as loadManifest, t as AppRouteGenerator } from "./app-routes-BjA_L5R4.mjs";
|
|
3
|
+
import { c as createHttpRuntimeClient, d as clearPropsCacheForComponent, f as extractMetadata, g as hasServerSideDataFetching, h as extractStaticParams, i as HttpRuntimeClient, m as extractServerPropsWithCache, p as extractServerProps, u as clearPropsCache } from "./runtime-client-B3FN-k1i.mjs";
|
|
4
|
+
import "./loading-component-map-UZ-MQYv0.mjs";
|
|
5
|
+
import "./server-build-BVvKXTME.mjs";
|
|
6
6
|
|
|
7
7
|
export { AppRouteGenerator, HttpRuntimeClient, RariResponse, clearPropsCache, clearPropsCacheForComponent, createHttpRuntimeClient, defineRariConfig, defineRariOptions, extractMetadata, extractServerProps, extractServerPropsWithCache, extractStaticParams, generateAppRouteManifest, hasServerSideDataFetching, headers, loadManifest, rari, rariRouter, writeManifest };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rari",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.5",
|
|
5
5
|
"description": "Runtime Accelerated Rendering Infrastructure (Rari)",
|
|
6
6
|
"author": "Ryan Skinner",
|
|
7
7
|
"license": "MIT",
|
|
@@ -89,11 +89,11 @@
|
|
|
89
89
|
"picocolors": "^1.1.1"
|
|
90
90
|
},
|
|
91
91
|
"optionalDependencies": {
|
|
92
|
-
"rari-darwin-arm64": "0.5.
|
|
93
|
-
"rari-darwin-x64": "0.5.
|
|
94
|
-
"rari-linux-arm64": "0.5.
|
|
95
|
-
"rari-linux-x64": "0.5.
|
|
96
|
-
"rari-win32-x64": "0.5.
|
|
92
|
+
"rari-darwin-arm64": "0.5.1",
|
|
93
|
+
"rari-darwin-x64": "0.5.1",
|
|
94
|
+
"rari-linux-arm64": "0.5.1",
|
|
95
|
+
"rari-linux-x64": "0.5.1",
|
|
96
|
+
"rari-win32-x64": "0.5.1"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@types/node": "^24.10.1",
|
package/src/cli.ts
CHANGED
|
@@ -150,71 +150,55 @@ async function deployToRender() {
|
|
|
150
150
|
|
|
151
151
|
async function main() {
|
|
152
152
|
switch (command) {
|
|
153
|
-
case
|
|
154
|
-
await startRustServer()
|
|
155
|
-
break
|
|
156
|
-
|
|
157
|
-
case 'deploy':
|
|
158
|
-
if (args[0] === 'railway') {
|
|
159
|
-
await deployToRailway()
|
|
160
|
-
}
|
|
161
|
-
else if (args[0] === 'render') {
|
|
162
|
-
await deployToRender()
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
logError('Unknown deployment target. Available: railway, render')
|
|
166
|
-
process.exit(1)
|
|
167
|
-
}
|
|
168
|
-
break
|
|
169
|
-
|
|
153
|
+
case undefined:
|
|
170
154
|
case 'help':
|
|
171
155
|
case '--help':
|
|
172
156
|
case '-h':
|
|
173
|
-
console.warn(`${colors.bold
|
|
157
|
+
console.warn(`${colors.bold('Rari CLI')}
|
|
174
158
|
|
|
175
|
-
${colors.bold
|
|
176
|
-
${colors.cyan
|
|
177
|
-
${colors.cyan
|
|
178
|
-
${colors.cyan
|
|
179
|
-
${colors.cyan
|
|
159
|
+
${colors.bold('Usage:')}
|
|
160
|
+
${colors.cyan('rari start')} Start the Rari server
|
|
161
|
+
${colors.cyan('rari deploy railway')} Setup Railway deployment
|
|
162
|
+
${colors.cyan('rari deploy render')} Setup Render deployment
|
|
163
|
+
${colors.cyan('rari help')} Show this help message
|
|
180
164
|
|
|
181
|
-
${colors.bold
|
|
182
|
-
${colors.yellow
|
|
183
|
-
${colors.yellow
|
|
184
|
-
${colors.yellow
|
|
185
|
-
${colors.yellow
|
|
165
|
+
${colors.bold('Environment Variables:')}
|
|
166
|
+
${colors.yellow('PORT')} Server port (default: 3000)
|
|
167
|
+
${colors.yellow('RSC_PORT')} Alternative server port
|
|
168
|
+
${colors.yellow('NODE_ENV')} Environment (development/production)
|
|
169
|
+
${colors.yellow('RUST_LOG')} Rust logging level (default: info)
|
|
186
170
|
|
|
187
|
-
${colors.bold
|
|
188
|
-
${colors.gray
|
|
189
|
-
${colors.cyan
|
|
171
|
+
${colors.bold('Examples:')}
|
|
172
|
+
${colors.gray('# Start development server on port 3000')}
|
|
173
|
+
${colors.cyan('rari start')}
|
|
190
174
|
|
|
191
|
-
${colors.gray
|
|
192
|
-
${colors.cyan
|
|
175
|
+
${colors.gray('# Start production server on port 8080')}
|
|
176
|
+
${colors.cyan('PORT=8080 NODE_ENV=production rari start')}
|
|
193
177
|
|
|
194
|
-
${colors.gray
|
|
195
|
-
${colors.cyan
|
|
178
|
+
${colors.gray('# Setup Railway deployment')}
|
|
179
|
+
${colors.cyan('rari deploy railway')}
|
|
196
180
|
|
|
197
|
-
${colors.gray
|
|
198
|
-
${colors.cyan
|
|
181
|
+
${colors.gray('# Setup Render deployment')}
|
|
182
|
+
${colors.cyan('rari deploy render')}
|
|
199
183
|
|
|
200
|
-
${colors.gray
|
|
201
|
-
${colors.cyan
|
|
184
|
+
${colors.gray('# Start with debug logging')}
|
|
185
|
+
${colors.cyan('RUST_LOG=debug rari start')}
|
|
202
186
|
|
|
203
|
-
${colors.bold
|
|
204
|
-
${colors.cyan
|
|
205
|
-
${colors.cyan
|
|
187
|
+
${colors.bold('Deployment:')}
|
|
188
|
+
${colors.cyan('rari deploy railway')} Creates Railway deployment files
|
|
189
|
+
${colors.cyan('rari deploy render')} Creates Render deployment files
|
|
206
190
|
|
|
207
191
|
Platform deployment automatically detects the environment and configures:
|
|
208
192
|
- Host binding (0.0.0.0 for platforms, 127.0.0.1 for local)
|
|
209
193
|
- Port from platform's PORT environment variable
|
|
210
194
|
- Production mode optimization
|
|
211
195
|
|
|
212
|
-
${colors.bold
|
|
196
|
+
${colors.bold('Binary Resolution:')}
|
|
213
197
|
1. Platform-specific package (rari-{platform}-{arch})
|
|
214
198
|
2. Global binary in PATH
|
|
215
199
|
3. Install from source with Cargo
|
|
216
200
|
|
|
217
|
-
${colors.bold
|
|
201
|
+
${colors.bold('Notes:')}
|
|
218
202
|
- Platform binary is automatically detected and used
|
|
219
203
|
- Platform deployment is automatically detected and configured
|
|
220
204
|
- Use Ctrl+C to stop the server gracefully
|
|
@@ -222,9 +206,26 @@ ${colors.bold}Notes:${colors.reset}
|
|
|
222
206
|
`)
|
|
223
207
|
break
|
|
224
208
|
|
|
209
|
+
case 'start':
|
|
210
|
+
await startRustServer()
|
|
211
|
+
break
|
|
212
|
+
|
|
213
|
+
case 'deploy':
|
|
214
|
+
if (args[0] === 'railway') {
|
|
215
|
+
await deployToRailway()
|
|
216
|
+
}
|
|
217
|
+
else if (args[0] === 'render') {
|
|
218
|
+
await deployToRender()
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
logError('Unknown deployment target. Available: railway, render')
|
|
222
|
+
process.exit(1)
|
|
223
|
+
}
|
|
224
|
+
break
|
|
225
|
+
|
|
225
226
|
default:
|
|
226
|
-
console.error(`${colors.bold
|
|
227
|
-
console.warn(`Run "${colors.cyan
|
|
227
|
+
console.error(`${colors.bold('Unknown command:')} ${command}`)
|
|
228
|
+
console.warn(`Run "${colors.cyan('rari help')}" for available commands`)
|
|
228
229
|
process.exit(1)
|
|
229
230
|
}
|
|
230
231
|
}
|
|
@@ -53,7 +53,6 @@ export function AppRouterProvider({ children, initialPayload, onNavigate }: AppR
|
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
const loadingRegistryRef = useRef<LoadingComponentRegistry>(new LoadingComponentRegistry())
|
|
56
|
-
const layoutInstancesRef = useRef<Map<string, React.ReactElement>>(new Map())
|
|
57
56
|
const pendingFetchesRef = useRef<Map<string, Promise<any>>>(new Map())
|
|
58
57
|
const failureHistoryRef = useRef<HMRFailure[]>([])
|
|
59
58
|
const lastSuccessfulPayloadRef = useRef<string | null>(null)
|
|
@@ -183,35 +182,37 @@ export function AppRouterProvider({ children, initialPayload, onNavigate }: AppR
|
|
|
183
182
|
|
|
184
183
|
if (Array.isArray(rsc)) {
|
|
185
184
|
if (rsc.length >= 4 && rsc[0] === '$') {
|
|
186
|
-
const [, type,
|
|
185
|
+
const [, type, serverKey, props] = rsc
|
|
187
186
|
|
|
188
187
|
if (typeof type === 'string' && type.startsWith('$L')) {
|
|
189
188
|
const moduleInfo = modules.get(type)
|
|
190
|
-
if (moduleInfo) {
|
|
191
|
-
const Component = (globalThis as any).__clientComponents?.[moduleInfo.id]?.component
|
|
192
|
-
if (Component) {
|
|
193
|
-
const isLayout = moduleInfo.id.includes('layout')
|
|
194
|
-
const stableKey = isLayout ? `layout-${moduleInfo.id}` : key
|
|
195
|
-
|
|
196
|
-
const childProps = {
|
|
197
|
-
...props,
|
|
198
|
-
children: props.children ? rscToReact(props.children, modules, isLayout ? moduleInfo.id : layoutPath) : undefined,
|
|
199
|
-
}
|
|
200
189
|
|
|
201
|
-
|
|
190
|
+
if (!moduleInfo) {
|
|
191
|
+
console.warn('[AppRouterProvider] Module info not found for type:', type, '- skipping component')
|
|
192
|
+
return null
|
|
193
|
+
}
|
|
202
194
|
|
|
203
|
-
|
|
204
|
-
layoutInstancesRef.current.set(stableKey, true as any)
|
|
205
|
-
}
|
|
195
|
+
const Component = (globalThis as any).__clientComponents?.[moduleInfo.id]?.component
|
|
206
196
|
|
|
207
|
-
|
|
208
|
-
|
|
197
|
+
if (!Component) {
|
|
198
|
+
console.warn('[AppRouterProvider] Component not loaded for module:', moduleInfo.id, '- skipping component')
|
|
199
|
+
return null
|
|
209
200
|
}
|
|
210
|
-
|
|
201
|
+
|
|
202
|
+
const effectiveKey = serverKey || `fallback-${Math.random()}`
|
|
203
|
+
|
|
204
|
+
const childProps = {
|
|
205
|
+
...props,
|
|
206
|
+
children: props.children ? rscToReact(props.children, modules, layoutPath) : undefined,
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const element = React.createElement(Component, { key: effectiveKey, ...childProps })
|
|
210
|
+
|
|
211
|
+
return element
|
|
211
212
|
}
|
|
212
213
|
|
|
213
214
|
const processedProps = processProps(props, modules, layoutPath)
|
|
214
|
-
return React.createElement(type,
|
|
215
|
+
return React.createElement(type, serverKey ? { ...processedProps, key: serverKey } : processedProps)
|
|
215
216
|
}
|
|
216
217
|
return rsc.map(child => rscToReact(child, modules, layoutPath))
|
|
217
218
|
}
|
|
@@ -420,20 +421,6 @@ export function AppRouterProvider({ children, initialPayload, onNavigate }: AppR
|
|
|
420
421
|
throw error
|
|
421
422
|
}
|
|
422
423
|
|
|
423
|
-
if (layoutDiff && layoutDiff.unmountLayouts.length > 0) {
|
|
424
|
-
layoutDiff.unmountLayouts.forEach((layout) => {
|
|
425
|
-
const keysToRemove: string[] = []
|
|
426
|
-
layoutInstancesRef.current.forEach((_, key) => {
|
|
427
|
-
if (key.includes(layout.path)) {
|
|
428
|
-
keysToRemove.push(key)
|
|
429
|
-
}
|
|
430
|
-
})
|
|
431
|
-
keysToRemove.forEach((key) => {
|
|
432
|
-
layoutInstancesRef.current.delete(key)
|
|
433
|
-
})
|
|
434
|
-
})
|
|
435
|
-
}
|
|
436
|
-
|
|
437
424
|
setRscPayload(parsedPayload)
|
|
438
425
|
|
|
439
426
|
lastSuccessfulPayloadRef.current = rscWireFormat
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|