@vercel/build-utils 13.6.1 → 13.6.3

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 13.6.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`d1c4d7052033aaf7b3f2044aa24484cb143b9348`](https://github.com/vercel/vercel/commit/d1c4d7052033aaf7b3f2044aa24484cb143b9348)]:
8
+ - @vercel/python-analysis@0.8.2
9
+
10
+ ## 13.6.2
11
+
12
+ ### Patch Changes
13
+
14
+ - add partialFallback flag to prerender output ([#14703](https://github.com/vercel/vercel/pull/14703))
15
+
3
16
  ## 13.6.1
4
17
 
5
18
  ### Patch Changes
package/dist/errors.js CHANGED
@@ -51,7 +51,7 @@ function getPrettyError(obj) {
51
51
  link: prop ? `${docsUrl}#${prop.toLowerCase()}` : docsUrl,
52
52
  action: "View Documentation"
53
53
  });
54
- } catch (e) {
54
+ } catch (_e) {
55
55
  return new NowBuildError({
56
56
  code: "INVALID_VERCEL_CONFIG",
57
57
  message: `Failed to validate configuration.`,
@@ -65,7 +65,7 @@ async function readConfigFile(files) {
65
65
  } else if (name.endsWith(".yaml") || name.endsWith(".yml")) {
66
66
  return import_js_yaml.default.safeLoad(str, { filename: name });
67
67
  }
68
- } catch (error) {
68
+ } catch (_error) {
69
69
  console.log(`Error while parsing config file: "${name}"`);
70
70
  }
71
71
  }
@@ -76,7 +76,7 @@ async function getPackageJson(dir) {
76
76
  const packagePath = (0, import_path.join)(dir, "package.json");
77
77
  try {
78
78
  return JSON.parse(await (0, import_fs_extra.readFile)(packagePath, "utf8"));
79
- } catch (err) {
79
+ } catch (_err) {
80
80
  return {};
81
81
  }
82
82
  }
@@ -394,7 +394,7 @@ async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
394
394
  if (turboConfigPath) {
395
395
  try {
396
396
  turboJson = import_json5.default.parse(await import_fs_extra.default.readFile(turboConfigPath, "utf8"));
397
- } catch (err) {
397
+ } catch (_err) {
398
398
  console.warn(
399
399
  `WARNING: Failed to parse ${import_path.default.basename(turboConfigPath)}`
400
400
  );
@@ -70,7 +70,7 @@ function generateNodeBuilderFunctions(frameworkName, regex, validFilenames, vali
70
70
  if (frameworkVersion) {
71
71
  version = frameworkVersion;
72
72
  }
73
- } catch (e) {
73
+ } catch (_e) {
74
74
  }
75
75
  res.output.framework = {
76
76
  slug: frameworkName,
package/dist/index.js CHANGED
@@ -22189,7 +22189,7 @@ function getPrettyError(obj) {
22189
22189
  link: prop ? `${docsUrl}#${prop.toLowerCase()}` : docsUrl,
22190
22190
  action: "View Documentation"
22191
22191
  });
22192
- } catch (e) {
22192
+ } catch (_e) {
22193
22193
  return new NowBuildError({
22194
22194
  code: "INVALID_VERCEL_CONFIG",
22195
22195
  message: `Failed to validate configuration.`,
@@ -22777,7 +22777,8 @@ var Prerender = class {
22777
22777
  experimentalBypassFor,
22778
22778
  experimentalStreamingLambdaPath,
22779
22779
  chain,
22780
- exposeErrBody
22780
+ exposeErrBody,
22781
+ partialFallback
22781
22782
  }) {
22782
22783
  this.type = "Prerender";
22783
22784
  this.expiration = expiration;
@@ -22909,6 +22910,13 @@ var Prerender = class {
22909
22910
  `The \`exposeErrBody\` argument for \`Prerender\` must be a boolean.`
22910
22911
  );
22911
22912
  }
22913
+ if (partialFallback === true) {
22914
+ this.partialFallback = true;
22915
+ } else if (typeof partialFallback !== "boolean" && typeof partialFallback !== "undefined") {
22916
+ throw new Error(
22917
+ `The \`partialFallback\` argument for \`Prerender\` must be a boolean.`
22918
+ );
22919
+ }
22912
22920
  }
22913
22921
  };
22914
22922
 
@@ -23254,7 +23262,7 @@ async function readConfigFile(files) {
23254
23262
  } else if (name.endsWith(".yaml") || name.endsWith(".yml")) {
23255
23263
  return import_js_yaml.default.safeLoad(str, { filename: name });
23256
23264
  }
23257
- } catch (error) {
23265
+ } catch (_error) {
23258
23266
  console.log(`Error while parsing config file: "${name}"`);
23259
23267
  }
23260
23268
  }
@@ -23265,7 +23273,7 @@ async function getPackageJson(dir) {
23265
23273
  const packagePath = (0, import_path5.join)(dir, "package.json");
23266
23274
  try {
23267
23275
  return JSON.parse(await (0, import_fs_extra6.readFile)(packagePath, "utf8"));
23268
- } catch (err) {
23276
+ } catch (_err) {
23269
23277
  return {};
23270
23278
  }
23271
23279
  }
@@ -23614,7 +23622,7 @@ async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
23614
23622
  if (turboConfigPath) {
23615
23623
  try {
23616
23624
  turboJson = import_json5.default.parse(await import_fs_extra7.default.readFile(turboConfigPath, "utf8"));
23617
- } catch (err) {
23625
+ } catch (_err) {
23618
23626
  console.warn(
23619
23627
  `WARNING: Failed to parse ${import_path6.default.basename(turboConfigPath)}`
23620
23628
  );
@@ -24934,7 +24942,7 @@ function generateNodeBuilderFunctions(frameworkName, regex, validFilenames, vali
24934
24942
  if (frameworkVersion) {
24935
24943
  version = frameworkVersion;
24936
24944
  }
24937
- } catch (e) {
24945
+ } catch (_e) {
24938
24946
  }
24939
24947
  res.output.framework = {
24940
24948
  slug: frameworkName,
@@ -17,6 +17,7 @@ interface PrerenderOptions {
17
17
  experimentalStreamingLambdaPath?: string;
18
18
  chain?: Chain;
19
19
  exposeErrBody?: boolean;
20
+ partialFallback?: boolean;
20
21
  }
21
22
  export declare class Prerender {
22
23
  type: 'Prerender';
@@ -45,6 +46,7 @@ export declare class Prerender {
45
46
  experimentalStreamingLambdaPath?: string;
46
47
  chain?: Chain;
47
48
  exposeErrBody?: boolean;
48
- constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, }: PrerenderOptions);
49
+ partialFallback?: boolean;
50
+ constructor({ expiration, staleExpiration, lambda, fallback, group, bypassToken, allowQuery, allowHeader, initialHeaders, initialStatus, passQuery, sourcePath, experimentalBypassFor, experimentalStreamingLambdaPath, chain, exposeErrBody, partialFallback, }: PrerenderOptions);
49
51
  }
50
52
  export {};
package/dist/prerender.js CHANGED
@@ -38,7 +38,8 @@ class Prerender {
38
38
  experimentalBypassFor,
39
39
  experimentalStreamingLambdaPath,
40
40
  chain,
41
- exposeErrBody
41
+ exposeErrBody,
42
+ partialFallback
42
43
  }) {
43
44
  this.type = "Prerender";
44
45
  this.expiration = expiration;
@@ -170,6 +171,13 @@ class Prerender {
170
171
  `The \`exposeErrBody\` argument for \`Prerender\` must be a boolean.`
171
172
  );
172
173
  }
174
+ if (partialFallback === true) {
175
+ this.partialFallback = true;
176
+ } else if (typeof partialFallback !== "boolean" && typeof partialFallback !== "undefined") {
177
+ throw new Error(
178
+ `The \`partialFallback\` argument for \`Prerender\` must be a boolean.`
179
+ );
180
+ }
173
181
  }
174
182
  }
175
183
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "13.6.1",
3
+ "version": "13.6.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -11,7 +11,7 @@
11
11
  "directory": "packages/now-build-utils"
12
12
  },
13
13
  "dependencies": {
14
- "@vercel/python-analysis": "0.8.1"
14
+ "@vercel/python-analysis": "0.8.2"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@iarna/toml": "2.2.3",
@@ -51,7 +51,7 @@
51
51
  "vitest": "2.0.1",
52
52
  "json5": "2.2.3",
53
53
  "@vercel/error-utils": "2.0.3",
54
- "@vercel/routing-utils": "6.0.0"
54
+ "@vercel/routing-utils": "6.0.2"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "node build.mjs",