@vercel/remix-builder 5.9.3 → 5.9.5

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 +43 -0
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2655,6 +2655,20 @@ function shouldRegisterSsrForPrerenderedRoute(path) {
2655
2655
  function getReactRouterCatchAllDest() {
2656
2656
  return "index";
2657
2657
  }
2658
+ function getSkewProtectionRoute(env = process.env) {
2659
+ const deploymentId = env.VERCEL_DEPLOYMENT_ID;
2660
+ if (env.VERCEL_SKEW_PROTECTION_ENABLED !== "1" || !deploymentId) {
2661
+ return void 0;
2662
+ }
2663
+ return {
2664
+ src: "/(.*)",
2665
+ has: [{ type: "header", key: "Sec-Fetch-Dest", value: "document" }],
2666
+ headers: {
2667
+ "Set-Cookie": `__vdpl=${deploymentId}; Path=/; SameSite=Strict; Secure; HttpOnly`
2668
+ },
2669
+ continue: true
2670
+ };
2671
+ }
2658
2672
  async function chdirAndReadConfig(remixRunDevPath, dir, packageJsonPath) {
2659
2673
  const { readConfig } = await import((0, import_path.join)(remixRunDevPath, "dist/config.js"));
2660
2674
  const originalCwd = process.cwd();
@@ -3015,6 +3029,7 @@ var build = async ({
3015
3029
  cliType,
3016
3030
  lockfileVersion,
3017
3031
  packageJsonPackageManager,
3032
+ nodeVersion,
3018
3033
  env: process.env,
3019
3034
  turboSupportsCorepackHome,
3020
3035
  projectCreatedAt: config.projectSettings?.createdAt
@@ -3249,6 +3264,12 @@ var build = async ({
3249
3264
  }
3250
3265
  }
3251
3266
  routes.unshift(...prerenderRewrites, { handle: "filesystem" });
3267
+ if (isReactRouter) {
3268
+ const skewProtectionRoute = getSkewProtectionRoute();
3269
+ if (skewProtectionRoute) {
3270
+ routes.unshift(skewProtectionRoute);
3271
+ }
3272
+ }
3252
3273
  routes.push({
3253
3274
  src: "/(.*)",
3254
3275
  dest: isReactRouter && hasReactRouterIndexFunction ? getReactRouterCatchAllDest() : "/"
@@ -3545,6 +3566,7 @@ var build2 = async ({
3545
3566
  cliType,
3546
3567
  lockfileVersion,
3547
3568
  packageJsonPackageManager,
3569
+ nodeVersion,
3548
3570
  env: process.env,
3549
3571
  turboSupportsCorepackHome,
3550
3572
  projectCreatedAt: config.projectSettings?.createdAt
@@ -4115,10 +4137,31 @@ var prepareCache = async ({
4115
4137
  const entrypointFsDirname = (0, import_path5.join)(workPath, mountpoint);
4116
4138
  let cacheDirFiles;
4117
4139
  if (!isVite(workPath)) {
4140
+ const nodeVersion = await (0, import_build_utils5.getNodeVersion)(
4141
+ entrypointFsDirname,
4142
+ void 0,
4143
+ config
4144
+ );
4145
+ const {
4146
+ cliType,
4147
+ lockfileVersion,
4148
+ packageJsonPackageManager,
4149
+ turboSupportsCorepackHome
4150
+ } = await (0, import_build_utils5.scanParentDirs)(entrypointFsDirname, true);
4151
+ const spawnEnv = (0, import_build_utils5.getEnvForPackageManager)({
4152
+ cliType,
4153
+ lockfileVersion,
4154
+ packageJsonPackageManager,
4155
+ nodeVersion,
4156
+ env: process.env,
4157
+ turboSupportsCorepackHome,
4158
+ projectCreatedAt: config.projectSettings?.createdAt
4159
+ });
4118
4160
  await (0, import_build_utils5.runNpmInstall)(
4119
4161
  entrypointFsDirname,
4120
4162
  [],
4121
4163
  {
4164
+ env: spawnEnv,
4122
4165
  stdio: "ignore"
4123
4166
  },
4124
4167
  void 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/remix-builder",
3
- "version": "5.9.3",
3
+ "version": "5.9.5",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "homepage": "https://vercel.com/docs",
@@ -28,7 +28,7 @@
28
28
  "glob": "10.3.16",
29
29
  "semver": "7.5.2",
30
30
  "vitest": "4.1.10",
31
- "@vercel/build-utils": "14.0.5"
31
+ "@vercel/build-utils": "14.1.1"
32
32
  },
33
33
  "VERCEL_REMIX_RUN_DEV_MAX_VERSION": "2.16.6",
34
34
  "scripts": {