@vercel/build-utils 12.0.0 → 12.1.0

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,11 @@
1
1
  # @vercel/build-utils
2
2
 
3
+ ## 12.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Support turbo.jsonc ([#13792](https://github.com/vercel/vercel/pull/13792))
8
+
3
9
  ## 12.0.0
4
10
 
5
11
  ### 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");
package/dist/index.js CHANGED
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",