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/*, /api/*\/download
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/*, /api/*\/download
230
+ * - Wildcards: /files/\*, /api/\*\/download
231
231
  *
232
232
  * @example
233
233
  * // Static route
@@ -1,9 +1,4 @@
1
- import { FC, ReactElement } from "react";
2
- import { DocumentProps } from "../lib/types.js";
3
- import { type PartialRequestInfo } from "../requestInfo/types";
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 { glob } from "glob";
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
- const cssFiles = await glob("*.css", { cwd: sourceDir });
13
- if (cssFiles.length > 0) {
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 cssFiles) {
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 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rwsdk",
3
- "version": "1.0.0-beta.31",
3
+ "version": "1.0.0-beta.33",
4
4
  "description": "Build fast, server-driven webapps on Cloudflare with SSR, RSC, and realtime",
5
5
  "type": "module",
6
6
  "bin": {