rari 0.2.7 → 0.2.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/dist/index.js +2 -2
- package/dist/{server-_LR44Mbg.js → server-DeSCwqZZ.js} +3 -3
- package/dist/server-build-Cp6_RdeA.js +3 -0
- package/dist/{server-build-DyMLcQhk.js → server-build-DaBgiV55.js} +3 -6
- package/dist/server.js +2 -2
- package/package.json +5 -1
- package/src/client-dev.ts +59 -0
- package/src/client.ts +3 -10
- package/src/server.ts +4 -13
- package/dist/server-build-CLt2Us53.js +0 -3
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-CC4YQweh.js";
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-
|
|
3
|
-
import "./server-build-
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-DeSCwqZZ.js";
|
|
3
|
+
import "./server-build-DaBgiV55.js";
|
|
4
4
|
|
|
5
5
|
export { FileRouteGenerator, HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, router_default as RouterProvider, Routes, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __commonJS, __require, __toESM } from "./chunk-BLXvPPr8.js";
|
|
2
2
|
import { analyzeFilePath } from "./runtime-client-CC4YQweh.js";
|
|
3
|
-
import { createServerBuildPlugin } from "./server-build-
|
|
3
|
+
import { createServerBuildPlugin } from "./server-build-DaBgiV55.js";
|
|
4
4
|
import fs, { promises } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process$1 from "node:process";
|
|
@@ -6028,7 +6028,7 @@ const ${componentName$1} = registerClientReference(
|
|
|
6028
6028
|
const srcDir = path.join(projectRoot, "src");
|
|
6029
6029
|
const discoverAndRegisterComponents = async () => {
|
|
6030
6030
|
try {
|
|
6031
|
-
const { ServerComponentBuilder, scanDirectory } = await import("./server-build-
|
|
6031
|
+
const { ServerComponentBuilder, scanDirectory } = await import("./server-build-Cp6_RdeA.js");
|
|
6032
6032
|
const builder = new ServerComponentBuilder(projectRoot, {
|
|
6033
6033
|
outDir: "temp",
|
|
6034
6034
|
serverDir: "server",
|
|
@@ -6162,7 +6162,7 @@ const ${componentName$1} = registerClientReference(
|
|
|
6162
6162
|
};
|
|
6163
6163
|
const handleServerComponentHMR = async (filePath) => {
|
|
6164
6164
|
try {
|
|
6165
|
-
const { ServerComponentBuilder } = await import("./server-build-
|
|
6165
|
+
const { ServerComponentBuilder } = await import("./server-build-Cp6_RdeA.js");
|
|
6166
6166
|
const builder = new ServerComponentBuilder(projectRoot, {
|
|
6167
6167
|
outDir: "temp",
|
|
6168
6168
|
serverDir: "server",
|
|
@@ -339,12 +339,11 @@ var ServerComponentBuilder = class {
|
|
|
339
339
|
banner: { js: `// Rari Server Component Bundle
|
|
340
340
|
// Generated at: ${(/* @__PURE__ */ new Date()).toISOString()}
|
|
341
341
|
// Original file: ${path.relative(this.projectRoot, inputPath)}
|
|
342
|
-
import React from 'react';
|
|
343
342
|
` }
|
|
344
343
|
});
|
|
345
344
|
if (result.outputFiles && result.outputFiles.length > 0) {
|
|
346
345
|
const outputFile = result.outputFiles[0];
|
|
347
|
-
const finalTransformedCode = this.createSelfRegisteringModule(outputFile.text, componentId
|
|
346
|
+
const finalTransformedCode = this.createSelfRegisteringModule(outputFile.text, componentId);
|
|
348
347
|
await fs.promises.writeFile(outputPath, finalTransformedCode, "utf-8");
|
|
349
348
|
}
|
|
350
349
|
if (result.errors.length > 0) {
|
|
@@ -357,11 +356,9 @@ import React from 'react';
|
|
|
357
356
|
throw error;
|
|
358
357
|
}
|
|
359
358
|
}
|
|
360
|
-
createSelfRegisteringModule(code, componentId
|
|
359
|
+
createSelfRegisteringModule(code, componentId) {
|
|
361
360
|
if (code.includes("Self-registering Production Component")) return code;
|
|
362
|
-
let
|
|
363
|
-
if (code.includes("React.createElement") && !code.includes("import React")) finalCode = `import React from 'react';\n\n${code}`;
|
|
364
|
-
let transformedCode = finalCode;
|
|
361
|
+
let transformedCode = code;
|
|
365
362
|
let defaultExportName = null;
|
|
366
363
|
const namedExports = [];
|
|
367
364
|
transformedCode = transformedCode.replace(/^export\s+default\s+function\s+(\w+)/gm, (match, name) => {
|
package/dist/server.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent, Routes, buildSearchString, buildUrl, createHttpRuntimeClient, extractParamNames, findMatchingRoute, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, normalizePathname, parseSearchParams, parseUrl, router_default, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, withRouter } from "./runtime-client-CC4YQweh.js";
|
|
2
|
-
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-
|
|
3
|
-
import "./server-build-
|
|
2
|
+
import { FileRouteGenerator, convertFilePatternToRoutePattern, createRouteManifest, defineRariConfig, generateFileRoutes, loadRouteManifest, rari, rariRouter, validateRoutes, watchFileRoutes } from "./server-DeSCwqZZ.js";
|
|
3
|
+
import "./server-build-DaBgiV55.js";
|
|
4
4
|
|
|
5
5
|
export { FileRouteGenerator, HttpRuntimeClient, Link, Navigate, Outlet, RouteComponent as Route, router_default as RouterProvider, Routes, buildSearchString, buildUrl, convertFilePatternToRoutePattern, createHttpRuntimeClient, createRouteManifest, defineRariConfig, extractParamNames, findMatchingRoute, generateFileRoutes, getRoutePriority, isDynamicRoute, isPathActive, joinPaths, loadRouteManifest, normalizePathname, parseSearchParams, parseUrl, rari, rariRouter, useNavigation, useParams, usePathname, useRoute, useRouter, useSearchParams, validateRoutes, watchFileRoutes, withRouter };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rari",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.8",
|
|
5
5
|
"description": "Runtime Accelerated Rendering Infrastructure (Rari)",
|
|
6
6
|
"author": "Ryan Skinner",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,6 +43,10 @@
|
|
|
43
43
|
"types": "./dist/client.d.ts",
|
|
44
44
|
"default": "./dist/client.js"
|
|
45
45
|
},
|
|
46
|
+
"./client-dev": {
|
|
47
|
+
"types": "./dist/client-dev.d.ts",
|
|
48
|
+
"default": "./dist/client-dev.js"
|
|
49
|
+
},
|
|
46
50
|
"./server": {
|
|
47
51
|
"types": "./dist/server.d.ts",
|
|
48
52
|
"default": "./dist/server.js"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export { Link } from './router'
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
buildSearchString,
|
|
5
|
+
buildUrl,
|
|
6
|
+
extractParamNames,
|
|
7
|
+
findMatchingRoute,
|
|
8
|
+
isDynamicRoute,
|
|
9
|
+
isPathActive,
|
|
10
|
+
joinPaths,
|
|
11
|
+
normalizePathname,
|
|
12
|
+
parseSearchParams,
|
|
13
|
+
parseUrl,
|
|
14
|
+
} from './router'
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
Navigate,
|
|
18
|
+
Outlet,
|
|
19
|
+
RouteComponent as Route,
|
|
20
|
+
RouterProvider,
|
|
21
|
+
Routes,
|
|
22
|
+
useNavigation,
|
|
23
|
+
useParams,
|
|
24
|
+
usePathname,
|
|
25
|
+
useRoute,
|
|
26
|
+
useRouter,
|
|
27
|
+
useSearchParams,
|
|
28
|
+
withRouter,
|
|
29
|
+
} from './router'
|
|
30
|
+
|
|
31
|
+
export type {
|
|
32
|
+
ErrorBoundaryProps,
|
|
33
|
+
FileRouteInfo,
|
|
34
|
+
LayoutProps,
|
|
35
|
+
LinkProps,
|
|
36
|
+
LoadingProps,
|
|
37
|
+
NavigationOptions,
|
|
38
|
+
NavigationState,
|
|
39
|
+
PageComponent,
|
|
40
|
+
PageProps,
|
|
41
|
+
RouteGenerationOptions,
|
|
42
|
+
RouteMatch,
|
|
43
|
+
RouteMeta,
|
|
44
|
+
RouteParams,
|
|
45
|
+
RouterConfig,
|
|
46
|
+
RouterContext,
|
|
47
|
+
RouterProviderProps,
|
|
48
|
+
Route as RouteType,
|
|
49
|
+
SearchParams,
|
|
50
|
+
} from './router'
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
createHttpRuntimeClient,
|
|
54
|
+
HttpRuntimeClient,
|
|
55
|
+
} from './runtime-client'
|
|
56
|
+
|
|
57
|
+
export type {
|
|
58
|
+
RuntimeClient,
|
|
59
|
+
} from './runtime-client'
|
package/src/client.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Link,
|
|
3
|
-
} from './router'
|
|
1
|
+
export { Link } from './router'
|
|
4
2
|
|
|
5
3
|
export {
|
|
6
4
|
buildSearchString,
|
|
@@ -51,11 +49,6 @@ export type {
|
|
|
51
49
|
SearchParams,
|
|
52
50
|
} from './router'
|
|
53
51
|
|
|
54
|
-
export {
|
|
55
|
-
createHttpRuntimeClient,
|
|
56
|
-
HttpRuntimeClient,
|
|
57
|
-
} from './runtime-client'
|
|
52
|
+
export { createHttpRuntimeClient, HttpRuntimeClient } from './runtime-client'
|
|
58
53
|
|
|
59
|
-
export type {
|
|
60
|
-
RuntimeClient,
|
|
61
|
-
} from './runtime-client'
|
|
54
|
+
export type { RuntimeClient } from './runtime-client'
|
package/src/server.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export {
|
|
2
|
-
Link,
|
|
3
|
-
} from './router'
|
|
1
|
+
export { Link } from './router'
|
|
4
2
|
|
|
5
3
|
export {
|
|
6
4
|
buildSearchString,
|
|
@@ -61,19 +59,12 @@ export {
|
|
|
61
59
|
watchFileRoutes,
|
|
62
60
|
} from './router/file-routes'
|
|
63
61
|
|
|
64
|
-
export {
|
|
65
|
-
getRoutePriority,
|
|
66
|
-
} from './router/utils'
|
|
62
|
+
export { getRoutePriority } from './router/utils'
|
|
67
63
|
|
|
68
64
|
export { rariRouter } from './router/vite-plugin'
|
|
69
65
|
|
|
70
|
-
export {
|
|
71
|
-
createHttpRuntimeClient,
|
|
72
|
-
HttpRuntimeClient,
|
|
73
|
-
} from './runtime-client'
|
|
66
|
+
export { createHttpRuntimeClient, HttpRuntimeClient } from './runtime-client'
|
|
74
67
|
|
|
75
|
-
export type {
|
|
76
|
-
RuntimeClient,
|
|
77
|
-
} from './runtime-client'
|
|
68
|
+
export type { RuntimeClient } from './runtime-client'
|
|
78
69
|
|
|
79
70
|
export { defineRariConfig, rari } from './vite'
|