@vercel/remix-builder 5.7.2 → 5.8.1

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 (2) hide show
  1. package/dist/index.js +23 -1
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -2630,6 +2630,13 @@ function getRegExpFromPath(rePath) {
2630
2630
  const re = pathToRegexp("923", rePath, keys);
2631
2631
  return keys.length > 0 ? re : false;
2632
2632
  }
2633
+ function getReactRouterDataPaths(path) {
2634
+ const paths = [`${path}.data`];
2635
+ if (path === "index") {
2636
+ paths.push("_root.data");
2637
+ }
2638
+ return paths;
2639
+ }
2633
2640
  async function chdirAndReadConfig(remixRunDevPath, dir, packageJsonPath) {
2634
2641
  const { readConfig } = await import((0, import_path.join)(remixRunDevPath, "dist/config.js"));
2635
2642
  const originalCwd = process.cwd();
@@ -3157,6 +3164,7 @@ var build = async ({
3157
3164
  handle: "filesystem"
3158
3165
  }
3159
3166
  ];
3167
+ const isReactRouter = frameworkSettings.slug === "react-router";
3160
3168
  for (const [id, functionId] of Object.entries(
3161
3169
  buildManifest.routeIdToServerBundleId ?? {}
3162
3170
  )) {
@@ -3170,8 +3178,22 @@ var build = async ({
3170
3178
  throw new Error(`Could not determine server bundle for "${id}"`);
3171
3179
  }
3172
3180
  output[path] = func;
3181
+ if (isReactRouter) {
3182
+ for (const dataPath of getReactRouterDataPaths(path)) {
3183
+ output[dataPath] = func;
3184
+ }
3185
+ }
3173
3186
  const re = getRegExpFromPath(rePath);
3174
3187
  if (re) {
3188
+ if (isReactRouter) {
3189
+ const reData = getRegExpFromPath(`${rePath}.data`);
3190
+ if (reData) {
3191
+ routes.push({
3192
+ src: reData.source,
3193
+ dest: `${path}.data`
3194
+ });
3195
+ }
3196
+ }
3175
3197
  routes.push({
3176
3198
  src: re.source,
3177
3199
  dest: path
@@ -3730,7 +3752,7 @@ module.exports = config;`;
3730
3752
  );
3731
3753
  if (lockfilePath && lockfileRaw) {
3732
3754
  cleanupOps.push(
3733
- import_fs3.promises.writeFile(lockfilePath, lockfileRaw).then(() => (0, import_build_utils4.debug)(`Restored original "${lockfilePath}" file`))
3755
+ import_fs3.promises.writeFile(lockfilePath, Uint8Array.from(lockfileRaw)).then(() => (0, import_build_utils4.debug)(`Restored original "${lockfilePath}" file`))
3734
3756
  );
3735
3757
  }
3736
3758
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/remix-builder",
3
- "version": "5.7.2",
3
+ "version": "5.8.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "homepage": "https://vercel.com/docs",
@@ -19,8 +19,8 @@
19
19
  "path-to-regexp-updated": "npm:path-to-regexp@6.3.0",
20
20
  "path-to-regexp": "6.1.0",
21
21
  "ts-morph": "12.0.0",
22
- "@vercel/error-utils": "2.0.3",
23
- "@vercel/static-config": "3.2.0"
22
+ "@vercel/error-utils": "2.1.0",
23
+ "@vercel/static-config": "3.3.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/jest": "27.5.1",
@@ -30,7 +30,7 @@
30
30
  "jest-junit": "16.0.0",
31
31
  "semver": "7.5.2",
32
32
  "vitest": "2.0.1",
33
- "@vercel/build-utils": "13.10.0"
33
+ "@vercel/build-utils": "13.21.0"
34
34
  },
35
35
  "VERCEL_REMIX_RUN_DEV_MAX_VERSION": "2.16.6",
36
36
  "scripts": {