@vercel/build-utils 12.0.0 → 12.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 12.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Change archive split from 100MB -> 20MB ([#14046](https://github.com/vercel/vercel/pull/14046))
8
+
9
+ ## 12.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - Support turbo.jsonc ([#13792](https://github.com/vercel/vercel/pull/13792))
14
+
3
15
  ## 12.0.0
4
16
 
5
17
  ### Major Changes
@@ -347,13 +347,25 @@ async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
347
347
  return true;
348
348
  }
349
349
  const turboJsonPath = import_path.default.join(rootDir, "turbo.json");
350
- const turboJsonExists = await import_fs_extra.default.pathExists(turboJsonPath);
350
+ const turboJsoncPath = import_path.default.join(rootDir, "turbo.jsonc");
351
+ const [turboJsonExists, turboJsoncExists] = await Promise.all([
352
+ import_fs_extra.default.pathExists(turboJsonPath),
353
+ import_fs_extra.default.pathExists(turboJsoncPath)
354
+ ]);
351
355
  let turboJson = null;
356
+ let turboConfigPath = null;
352
357
  if (turboJsonExists) {
358
+ turboConfigPath = turboJsonPath;
359
+ } else if (turboJsoncExists) {
360
+ turboConfigPath = turboJsoncPath;
361
+ }
362
+ if (turboConfigPath) {
353
363
  try {
354
- turboJson = import_json5.default.parse(await import_fs_extra.default.readFile(turboJsonPath, "utf8"));
364
+ turboJson = import_json5.default.parse(await import_fs_extra.default.readFile(turboConfigPath, "utf8"));
355
365
  } catch (err) {
356
- console.warn(`WARNING: Failed to parse turbo.json`);
366
+ console.warn(
367
+ `WARNING: Failed to parse ${import_path.default.basename(turboConfigPath)}`
368
+ );
357
369
  }
358
370
  }
359
371
  const turboJsonIncludesCorepackHome = turboJson !== null && typeof turboJson === "object" && "globalPassThroughEnv" in turboJson && Array.isArray(turboJson.globalPassThroughEnv) && turboJson.globalPassThroughEnv.includes("COREPACK_HOME");
@@ -56,7 +56,7 @@ function streamToBuffer(stream) {
56
56
  });
57
57
  }
58
58
  const MB = 1024 * 1024;
59
- async function streamToBufferChunks(stream, chunkSize = 100 * MB) {
59
+ async function streamToBufferChunks(stream, chunkSize = 20 * MB) {
60
60
  const chunks = [];
61
61
  let currentChunk = [];
62
62
  let currentSize = 0;
package/dist/index.js CHANGED
@@ -22254,7 +22254,7 @@ function streamToBuffer(stream) {
22254
22254
  });
22255
22255
  }
22256
22256
  var MB = 1024 * 1024;
22257
- async function streamToBufferChunks(stream, chunkSize = 100 * MB) {
22257
+ async function streamToBufferChunks(stream, chunkSize = 20 * MB) {
22258
22258
  const chunks = [];
22259
22259
  let currentChunk = [];
22260
22260
  let currentSize = 0;
@@ -23421,13 +23421,25 @@ async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
23421
23421
  return true;
23422
23422
  }
23423
23423
  const turboJsonPath = import_path5.default.join(rootDir, "turbo.json");
23424
- const turboJsonExists = await import_fs_extra7.default.pathExists(turboJsonPath);
23424
+ const turboJsoncPath = import_path5.default.join(rootDir, "turbo.jsonc");
23425
+ const [turboJsonExists, turboJsoncExists] = await Promise.all([
23426
+ import_fs_extra7.default.pathExists(turboJsonPath),
23427
+ import_fs_extra7.default.pathExists(turboJsoncPath)
23428
+ ]);
23425
23429
  let turboJson = null;
23430
+ let turboConfigPath = null;
23426
23431
  if (turboJsonExists) {
23432
+ turboConfigPath = turboJsonPath;
23433
+ } else if (turboJsoncExists) {
23434
+ turboConfigPath = turboJsoncPath;
23435
+ }
23436
+ if (turboConfigPath) {
23427
23437
  try {
23428
- turboJson = import_json5.default.parse(await import_fs_extra7.default.readFile(turboJsonPath, "utf8"));
23438
+ turboJson = import_json5.default.parse(await import_fs_extra7.default.readFile(turboConfigPath, "utf8"));
23429
23439
  } catch (err) {
23430
- console.warn(`WARNING: Failed to parse turbo.json`);
23440
+ console.warn(
23441
+ `WARNING: Failed to parse ${import_path5.default.basename(turboConfigPath)}`
23442
+ );
23431
23443
  }
23432
23444
  }
23433
23445
  const turboJsonIncludesCorepackHome = turboJson !== null && typeof turboJson === "object" && "globalPassThroughEnv" in turboJson && Array.isArray(turboJson.globalPassThroughEnv) && turboJson.globalPassThroughEnv.includes("COREPACK_HOME");
package/dist/types.d.ts CHANGED
@@ -167,7 +167,12 @@ export interface ShouldServeOptions {
167
167
  /**
168
168
  * `startDevServer()` is given the same parameters as `build()`.
169
169
  */
170
- export type StartDevServerOptions = BuildOptions;
170
+ export type StartDevServerOptions = BuildOptions & {
171
+ /**
172
+ * Directory to serve static files from in dev mode
173
+ */
174
+ publicDir?: string;
175
+ };
171
176
  export interface StartDevServerSuccess {
172
177
  /**
173
178
  * Port number where the dev server can be connected to, assumed to be running
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "12.0.0",
3
+ "version": "12.1.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -27,7 +27,7 @@
27
27
  "@types/semver": "6.0.0",
28
28
  "@types/yazl": "2.4.2",
29
29
  "@vercel/error-utils": "2.0.3",
30
- "@vercel/routing-utils": "5.1.1",
30
+ "@vercel/routing-utils": "5.2.0",
31
31
  "aggregate-error": "3.0.1",
32
32
  "async-retry": "1.2.3",
33
33
  "async-sema": "2.1.4",