@vercel/build-utils 8.4.8 → 8.4.9

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
+ ## 8.4.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix special version specifier handling for `turbo` ([#12249](https://github.com/vercel/vercel/pull/12249))
8
+
3
9
  ## 8.4.8
4
10
 
5
11
  ### Patch Changes
@@ -81,6 +81,7 @@ export declare function runShellScript(fsPath: string, args?: string[], spawnOpt
81
81
  export declare function getSpawnOptions(meta: Meta, nodeVersion: NodeVersion): SpawnOptions;
82
82
  export declare function getNodeVersion(destPath: string, fallbackVersion?: string | undefined, config?: Config, meta?: Meta, availableVersions?: number[]): Promise<NodeVersion>;
83
83
  export declare function scanParentDirs(destPath: string, readPackageJson?: boolean, base?: string): Promise<ScanParentDirsResult>;
84
+ export declare function turboVersionSpecifierSupportsCorepack(turboVersionSpecifier: string): boolean;
84
85
  export declare function usingCorepack(env: {
85
86
  [x: string]: string | undefined;
86
87
  }, packageJsonPackageManager: string | undefined, turboSupportsCorepackHome: boolean | undefined): boolean;
@@ -49,6 +49,7 @@ __export(run_user_scripts_exports, {
49
49
  spawnAsync: () => spawnAsync,
50
50
  spawnCommand: () => spawnCommand,
51
51
  traverseUpDirectories: () => traverseUpDirectories,
52
+ turboVersionSpecifierSupportsCorepack: () => turboVersionSpecifierSupportsCorepack,
52
53
  usingCorepack: () => usingCorepack,
53
54
  walkParentDirs: () => walkParentDirs
54
55
  });
@@ -300,7 +301,7 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
300
301
  };
301
302
  }
302
303
  async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
303
- if (turboRangeSupportsCorepack(turboVersionRange)) {
304
+ if (turboVersionSpecifierSupportsCorepack(turboVersionRange)) {
304
305
  return true;
305
306
  }
306
307
  const turboJsonPath = import_path.default.join(rootDir, "turbo.json");
@@ -308,9 +309,12 @@ async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
308
309
  const turboJson = turboJsonExists ? JSON.parse(await import_fs_extra.default.readFile(turboJsonPath, "utf8")) : void 0;
309
310
  return turboJson?.globalPassThroughEnv?.includes("COREPACK_HOME") || false;
310
311
  }
311
- function turboRangeSupportsCorepack(turboVersionRange) {
312
+ function turboVersionSpecifierSupportsCorepack(turboVersionSpecifier) {
313
+ if (!(0, import_semver.validRange)(turboVersionSpecifier)) {
314
+ return false;
315
+ }
312
316
  const versionSupportingCorepack = "2.1.3";
313
- const minTurboBeingUsed = (0, import_semver.minVersion)(turboVersionRange);
317
+ const minTurboBeingUsed = (0, import_semver.minVersion)(turboVersionSpecifier);
314
318
  if (!minTurboBeingUsed) {
315
319
  return false;
316
320
  }
@@ -891,6 +895,7 @@ const installDependencies = (0, import_util.deprecate)(
891
895
  spawnAsync,
892
896
  spawnCommand,
893
897
  traverseUpDirectories,
898
+ turboVersionSpecifierSupportsCorepack,
894
899
  usingCorepack,
895
900
  walkParentDirs
896
901
  });
package/dist/index.js CHANGED
@@ -23670,7 +23670,7 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
23670
23670
  };
23671
23671
  }
23672
23672
  async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
23673
- if (turboRangeSupportsCorepack(turboVersionRange)) {
23673
+ if (turboVersionSpecifierSupportsCorepack(turboVersionRange)) {
23674
23674
  return true;
23675
23675
  }
23676
23676
  const turboJsonPath = import_path5.default.join(rootDir, "turbo.json");
@@ -23678,9 +23678,12 @@ async function checkTurboSupportsCorepack(turboVersionRange, rootDir) {
23678
23678
  const turboJson = turboJsonExists ? JSON.parse(await import_fs_extra7.default.readFile(turboJsonPath, "utf8")) : void 0;
23679
23679
  return turboJson?.globalPassThroughEnv?.includes("COREPACK_HOME") || false;
23680
23680
  }
23681
- function turboRangeSupportsCorepack(turboVersionRange) {
23681
+ function turboVersionSpecifierSupportsCorepack(turboVersionSpecifier) {
23682
+ if (!(0, import_semver2.validRange)(turboVersionSpecifier)) {
23683
+ return false;
23684
+ }
23682
23685
  const versionSupportingCorepack = "2.1.3";
23683
- const minTurboBeingUsed = (0, import_semver2.minVersion)(turboVersionRange);
23686
+ const minTurboBeingUsed = (0, import_semver2.minVersion)(turboVersionSpecifier);
23684
23687
  if (!minTurboBeingUsed) {
23685
23688
  return false;
23686
23689
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "8.4.8",
3
+ "version": "8.4.9",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",