@vercel/redwood 2.4.6 → 2.4.8

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 +55 -15
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -918,6 +918,9 @@ var require_superstatic = __commonJS({
918
918
  headers: { Location: loc },
919
919
  status
920
920
  };
921
+ if (typeof r.env !== "undefined") {
922
+ route.env = r.env;
923
+ }
921
924
  if (r.has) {
922
925
  route.has = r.has;
923
926
  }
@@ -945,6 +948,9 @@ var require_superstatic = __commonJS({
945
948
  internalParamNames
946
949
  );
947
950
  const route = { src, dest, check: true };
951
+ if (typeof r.env !== "undefined") {
952
+ route.env = r.env;
953
+ }
948
954
  if (r.has) {
949
955
  route.has = r.has;
950
956
  }
@@ -1863,7 +1869,21 @@ var require_schemas = __commonJS({
1863
1869
  has: hasSchema,
1864
1870
  missing: hasSchema,
1865
1871
  mitigate: mitigateSchema,
1866
- transforms: transformsSchema
1872
+ transforms: transformsSchema,
1873
+ env: {
1874
+ description: "An array of environment variable names that should be replaced at runtime in the destination or headers",
1875
+ type: "array",
1876
+ minItems: 1,
1877
+ maxItems: 64,
1878
+ items: {
1879
+ type: "string",
1880
+ maxLength: 256
1881
+ }
1882
+ },
1883
+ respectOriginCacheControl: {
1884
+ description: "When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.",
1885
+ type: "boolean"
1886
+ }
1867
1887
  }
1868
1888
  },
1869
1889
  {
@@ -1907,6 +1927,20 @@ var require_schemas = __commonJS({
1907
1927
  type: "integer",
1908
1928
  minimum: 100,
1909
1929
  maximum: 999
1930
+ },
1931
+ env: {
1932
+ description: "An array of environment variable names that should be replaced at runtime in the destination",
1933
+ type: "array",
1934
+ minItems: 1,
1935
+ maxItems: 64,
1936
+ items: {
1937
+ type: "string",
1938
+ maxLength: 256
1939
+ }
1940
+ },
1941
+ respectOriginCacheControl: {
1942
+ description: "When set to true (default), external rewrites will respect the Cache-Control header from the origin. When false, caching is disabled for this rewrite.",
1943
+ type: "boolean"
1910
1944
  }
1911
1945
  }
1912
1946
  }
@@ -1943,7 +1977,17 @@ var require_schemas = __commonJS({
1943
1977
  maximum: 999
1944
1978
  },
1945
1979
  has: hasSchema,
1946
- missing: hasSchema
1980
+ missing: hasSchema,
1981
+ env: {
1982
+ description: "An array of environment variable names that should be replaced at runtime in the destination",
1983
+ type: "array",
1984
+ minItems: 1,
1985
+ maxItems: 64,
1986
+ items: {
1987
+ type: "string",
1988
+ maxLength: 256
1989
+ }
1990
+ }
1947
1991
  }
1948
1992
  }
1949
1993
  };
@@ -2462,27 +2506,23 @@ var build = async ({
2462
2506
  const { installCommand, buildCommand } = config;
2463
2507
  const mountpoint = (0, import_path.dirname)(entrypoint);
2464
2508
  const entrypointFsDirname = (0, import_path.join)(workPath, mountpoint);
2465
- const nodeVersion = await (0, import_build_utils.getNodeVersion)(
2509
+ const nodeVersion = await (0, import_build_utils.getRuntimeNodeVersion)(
2466
2510
  entrypointFsDirname,
2467
2511
  void 0,
2468
2512
  config,
2469
2513
  meta
2470
2514
  );
2471
- const spawnOpts = (0, import_build_utils.getSpawnOptions)(meta, nodeVersion);
2472
- if (!spawnOpts.env) {
2473
- spawnOpts.env = {};
2474
- }
2475
2515
  const {
2476
2516
  cliType,
2477
2517
  lockfileVersion,
2478
2518
  packageJsonPackageManager,
2479
2519
  turboSupportsCorepackHome
2480
2520
  } = await (0, import_build_utils.scanParentDirs)(entrypointFsDirname, true);
2481
- spawnOpts.env = (0, import_build_utils.getEnvForPackageManager)({
2521
+ const spawnEnv = (0, import_build_utils.getEnvForPackageManager)({
2482
2522
  cliType,
2483
2523
  lockfileVersion,
2484
2524
  packageJsonPackageManager,
2485
- env: spawnOpts.env || {},
2525
+ env: process.env,
2486
2526
  turboSupportsCorepackHome,
2487
2527
  projectCreatedAt: config.projectSettings?.createdAt
2488
2528
  });
@@ -2490,7 +2530,7 @@ var build = async ({
2490
2530
  if (installCommand.trim()) {
2491
2531
  console.log(`Running "install" command: \`${installCommand}\`...`);
2492
2532
  await (0, import_build_utils.execCommand)(installCommand, {
2493
- ...spawnOpts,
2533
+ env: spawnEnv,
2494
2534
  cwd: entrypointFsDirname
2495
2535
  });
2496
2536
  } else {
@@ -2500,7 +2540,7 @@ var build = async ({
2500
2540
  await (0, import_build_utils.runNpmInstall)(
2501
2541
  entrypointFsDirname,
2502
2542
  [],
2503
- spawnOpts,
2543
+ { env: spawnEnv },
2504
2544
  meta,
2505
2545
  config.projectSettings?.createdAt
2506
2546
  );
@@ -2515,7 +2555,7 @@ var build = async ({
2515
2555
  if (buildCommand) {
2516
2556
  (0, import_build_utils.debug)(`Executing build command "${buildCommand}"`);
2517
2557
  await (0, import_build_utils.execCommand)(buildCommand, {
2518
- ...spawnOpts,
2558
+ env: spawnEnv,
2519
2559
  cwd: workPath
2520
2560
  });
2521
2561
  } else if (hasScript("vercel-build", pkg)) {
@@ -2523,7 +2563,7 @@ var build = async ({
2523
2563
  await (0, import_build_utils.runPackageJsonScript)(
2524
2564
  workPath,
2525
2565
  "vercel-build",
2526
- spawnOpts,
2566
+ { env: spawnEnv },
2527
2567
  config.projectSettings?.createdAt
2528
2568
  );
2529
2569
  } else if (hasScript("build", pkg)) {
@@ -2531,7 +2571,7 @@ var build = async ({
2531
2571
  await (0, import_build_utils.runPackageJsonScript)(
2532
2572
  workPath,
2533
2573
  "build",
2534
- spawnOpts,
2574
+ { env: spawnEnv },
2535
2575
  config.projectSettings?.createdAt
2536
2576
  );
2537
2577
  } else {
@@ -2549,7 +2589,7 @@ var build = async ({
2549
2589
  cmd = "yarn rw deploy vercel";
2550
2590
  }
2551
2591
  await (0, import_build_utils.execCommand)(cmd, {
2552
- ...spawnOpts,
2592
+ env: spawnEnv,
2553
2593
  cwd: workPath
2554
2594
  });
2555
2595
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/redwood",
3
- "version": "2.4.6",
3
+ "version": "2.4.8",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs",
@@ -25,8 +25,8 @@
25
25
  "execa": "3.2.0",
26
26
  "fs-extra": "11.1.0",
27
27
  "jest-junit": "16.0.0",
28
- "@vercel/routing-utils": "5.3.0",
29
- "@vercel/build-utils": "13.2.3"
28
+ "@vercel/build-utils": "13.2.8",
29
+ "@vercel/routing-utils": "5.3.2"
30
30
  },
31
31
  "scripts": {
32
32
  "build": "node ../../utils/build-builder.mjs",