rwsdk 1.0.0-beta.31 → 1.0.0-beta.33
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.
|
@@ -56,7 +56,7 @@ export declare function defineRoutes<T extends RequestInfo = RequestInfo>(routes
|
|
|
56
56
|
* Supports three types of path patterns:
|
|
57
57
|
* - Static: /about, /contact
|
|
58
58
|
* - Parameters: /users/:id, /posts/:postId/edit
|
|
59
|
-
* - Wildcards: /files
|
|
59
|
+
* - Wildcards: /files/\*, /api/\*\/download
|
|
60
60
|
*
|
|
61
61
|
* @example
|
|
62
62
|
* // Static route
|
|
@@ -227,7 +227,7 @@ export function defineRoutes(routes) {
|
|
|
227
227
|
* Supports three types of path patterns:
|
|
228
228
|
* - Static: /about, /contact
|
|
229
229
|
* - Parameters: /users/:id, /posts/:postId/edit
|
|
230
|
-
* - Wildcards: /files
|
|
230
|
+
* - Wildcards: /files/\*, /api/\*\/download
|
|
231
231
|
*
|
|
232
232
|
* @example
|
|
233
233
|
* // Static route
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export interface RenderToStringOptions {
|
|
5
|
-
Document?: FC<DocumentProps>;
|
|
6
|
-
injectRSCPayload?: boolean;
|
|
7
|
-
requestInfo?: PartialRequestInfo;
|
|
8
|
-
}
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { type RenderToStreamOptions } from "./renderToStream";
|
|
3
|
+
export type RenderToStringOptions = Omit<RenderToStreamOptions, "onError">;
|
|
9
4
|
export declare const renderToString: (element: ReactElement, options?: RenderToStringOptions) => Promise<string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
1
|
import fs from "fs-extra";
|
|
3
|
-
import
|
|
2
|
+
import path from "node:path";
|
|
4
3
|
export const moveStaticAssetsPlugin = ({ rootDir, }) => ({
|
|
5
4
|
name: "rwsdk:move-static-assets",
|
|
6
5
|
apply: "build",
|
|
@@ -9,10 +8,14 @@ export const moveStaticAssetsPlugin = ({ rootDir, }) => ({
|
|
|
9
8
|
process.env.RWSDK_BUILD_PASS === "linker") {
|
|
10
9
|
const sourceDir = path.join(rootDir, "dist", "worker", "assets");
|
|
11
10
|
const destDir = path.join(rootDir, "dist", "client", "assets");
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
if (!(await fs.pathExists(sourceDir))) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const allFiles = await fs.readdir(sourceDir);
|
|
15
|
+
const filesToMove = allFiles.filter((file) => !file.endsWith(".js") && !file.endsWith(".map"));
|
|
16
|
+
if (filesToMove.length > 0) {
|
|
14
17
|
await fs.ensureDir(destDir);
|
|
15
|
-
for (const file of
|
|
18
|
+
for (const file of filesToMove) {
|
|
16
19
|
const sourceFile = path.join(sourceDir, file);
|
|
17
20
|
const destFile = path.join(destDir, file);
|
|
18
21
|
await fs.move(sourceFile, destFile, { overwrite: true });
|