@react-router/serve 7.10.1-pre.0 → 7.11.0-pre.0

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +15 -4
  2. package/dist/cli.js +10 -7
  3. package/package.json +10 -9
package/CHANGELOG.md CHANGED
@@ -1,13 +1,24 @@
1
1
  # `@react-router/serve`
2
2
 
3
- ## 7.10.1-pre.0
3
+ ## 7.11.0-pre.0
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - support custom entrypoints for RSC framework mode ([#14643](https://github.com/remix-run/react-router/pull/14643))
8
+ - Update `compression` and `morgan` dependencies to address `on-headers` CVE: [GHSA-76c9-3jph-rj3q](https://github.com/advisories/GHSA-76c9-3jph-rj3q) ([#14652](https://github.com/remix-run/react-router/pull/14652))
7
9
  - Updated dependencies:
8
- - `react-router@7.10.1-pre.0`
9
- - `@react-router/node@7.10.1-pre.0`
10
- - `@react-router/express@7.10.1-pre.0`
10
+ - `react-router@7.11.0-pre.0`
11
+ - `@react-router/node@7.11.0-pre.0`
12
+ - `@react-router/express@7.11.0-pre.0`
13
+
14
+ ## 7.10.1
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies:
19
+ - `react-router@7.10.1`
20
+ - `@react-router/node@7.10.1`
21
+ - `@react-router/express@7.10.1`
11
22
 
12
23
  ## 7.10.0
13
24
 
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * @react-router/serve v7.10.1-pre.0
3
+ * @react-router/serve v7.11.0-pre.0
4
4
  *
5
5
  * Copyright (c) Remix Software Inc.
6
6
  *
@@ -64,7 +64,9 @@ import_source_map_support.default.install({
64
64
  });
65
65
  run();
66
66
  function isRSCServerBuild(build) {
67
- return "fetch" in build && typeof build.fetch === "function";
67
+ return Boolean(
68
+ typeof build === "object" && build && "default" in build && typeof build.default === "object" && build.default && "fetch" in build.default && typeof build.default.fetch === "function"
69
+ );
68
70
  }
69
71
  function parseNumber(raw) {
70
72
  if (raw === void 0) return void 0;
@@ -83,14 +85,15 @@ async function run() {
83
85
  let buildPath = import_node_path.default.resolve(buildPathArg);
84
86
  let buildModule = await import(import_node_url.default.pathToFileURL(buildPath).href);
85
87
  let build;
86
- if (buildModule.default && typeof buildModule.default === "function") {
88
+ let isRSCBuild = false;
89
+ if (isRSCBuild = isRSCServerBuild(buildModule)) {
87
90
  const config = {
88
91
  publicPath: "/",
89
92
  assetsBuildDirectory: "../client",
90
93
  ...buildModule.unstable_reactRouterServeConfig || {}
91
94
  };
92
95
  build = {
93
- fetch: buildModule.default,
96
+ fetch: buildModule.default.fetch,
94
97
  publicPath: config.publicPath,
95
98
  assetsBuildDirectory: import_node_path.default.resolve(
96
99
  import_node_path.default.dirname(buildPath),
@@ -112,7 +115,7 @@ async function run() {
112
115
  };
113
116
  let app = (0, import_express2.default)();
114
117
  app.disable("x-powered-by");
115
- if (!isRSCServerBuild(build)) {
118
+ if (!isRSCBuild) {
116
119
  app.use((0, import_compression.default)());
117
120
  }
118
121
  app.use(
@@ -125,13 +128,13 @@ async function run() {
125
128
  app.use(build.publicPath, import_express2.default.static(build.assetsBuildDirectory));
126
129
  app.use(import_express2.default.static("public", { maxAge: "1h" }));
127
130
  app.use((0, import_morgan.default)("tiny"));
128
- if (isRSCServerBuild(build)) {
131
+ if (build.fetch) {
129
132
  app.all("*", (0, import_node_fetch_server.createRequestListener)(build.fetch));
130
133
  } else {
131
134
  app.all(
132
135
  "*",
133
136
  (0, import_express.createRequestHandler)({
134
- build,
137
+ build: buildModule,
135
138
  mode: process.env.NODE_ENV
136
139
  })
137
140
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/serve",
3
- "version": "7.10.1-pre.0",
3
+ "version": "7.11.0-pre.0",
4
4
  "description": "Production application server for React Router",
5
5
  "bugs": {
6
6
  "url": "https://github.com/remix-run/react-router/issues"
@@ -21,6 +21,7 @@
21
21
  "build": {
22
22
  "command": "tsup",
23
23
  "files": [
24
+ "../../pnpm-workspace.yaml",
24
25
  "*.ts",
25
26
  "bin.js",
26
27
  "tsconfig.json",
@@ -33,24 +34,24 @@
33
34
  },
34
35
  "dependencies": {
35
36
  "@mjackson/node-fetch-server": "^0.2.0",
36
- "compression": "^1.7.4",
37
+ "compression": "^1.8.1",
37
38
  "express": "^4.19.2",
38
39
  "get-port": "5.1.1",
39
- "morgan": "^1.10.0",
40
+ "morgan": "^1.10.1",
40
41
  "source-map-support": "^0.5.21",
41
- "@react-router/express": "7.10.1-pre.0",
42
- "@react-router/node": "7.10.1-pre.0"
42
+ "@react-router/express": "7.11.0-pre.0",
43
+ "@react-router/node": "7.11.0-pre.0"
43
44
  },
44
45
  "peerDependencies": {
45
- "react-router": "7.10.1-pre.0"
46
+ "react-router": "7.11.0-pre.0"
46
47
  },
47
48
  "devDependencies": {
48
- "@types/compression": "^1.7.0",
49
+ "@types/compression": "^1.8.1",
49
50
  "@types/express": "^4.17.9",
50
- "@types/morgan": "^1.9.2",
51
+ "@types/morgan": "^1.9.10",
51
52
  "@types/source-map-support": "^0.5.6",
52
53
  "tsup": "^8.3.0",
53
- "typescript": "^5.1.6",
54
+ "typescript": "^5.4.5",
54
55
  "wireit": "0.14.9"
55
56
  },
56
57
  "engines": {