@vercel/build-utils 10.6.7 → 11.0.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
+ ## 11.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Add support for vlt as a package manager ([#13591](https://github.com/vercel/vercel/pull/13591))
8
+
3
9
  ## 10.6.7
4
10
 
5
11
  ### Patch Changes
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { SpawnOptions } from 'child_process';
3
3
  import { Meta, PackageJson, NodeVersion, Config } from '../types';
4
- export type CliType = 'yarn' | 'npm' | 'pnpm' | 'bun';
4
+ export type CliType = 'yarn' | 'npm' | 'pnpm' | 'bun' | 'vlt';
5
5
  export interface ScanParentDirsResult {
6
6
  /**
7
7
  * "yarn", "npm", or "pnpm" depending on the presence of lockfiles.
@@ -255,7 +255,8 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
255
255
  npmLockPath,
256
256
  pnpmLockPath,
257
257
  bunLockTextPath,
258
- bunLockBinPath
258
+ bunLockBinPath,
259
+ vltLockPath
259
260
  ],
260
261
  packageJsonPackageManager
261
262
  } = await walkParentDirsMulti({
@@ -266,18 +267,20 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
266
267
  "package-lock.json",
267
268
  "pnpm-lock.yaml",
268
269
  "bun.lock",
269
- "bun.lockb"
270
+ "bun.lockb",
271
+ "vlt-lock.json"
270
272
  ]
271
273
  });
272
274
  let lockfilePath;
273
275
  let lockfileVersion;
274
276
  let cliType;
275
277
  const bunLockPath = bunLockTextPath ?? bunLockBinPath;
276
- const [packageLockJson, pnpmLockYaml, bunLock, yarnLock] = await Promise.all([
278
+ const [packageLockJson, pnpmLockYaml, bunLock, yarnLock, vltLock] = await Promise.all([
277
279
  npmLockPath ? (0, import_read_config_file.readConfigFile)(npmLockPath) : null,
278
280
  pnpmLockPath ? (0, import_read_config_file.readConfigFile)(pnpmLockPath) : null,
279
281
  bunLockPath ? import_fs_extra.default.readFile(bunLockPath) : null,
280
- yarnLockPath ? import_fs_extra.default.readFile(yarnLockPath, "utf8") : null
282
+ yarnLockPath ? import_fs_extra.default.readFile(yarnLockPath, "utf8") : null,
283
+ vltLockPath ? (0, import_read_config_file.readConfigFile)(vltLockPath) : null
281
284
  ]);
282
285
  const rootProjectInfo = readPackageJson ? await readProjectRootInfo({
283
286
  base,
@@ -308,6 +311,9 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
308
311
  cliType = "bun";
309
312
  lockfilePath = bunLockPath;
310
313
  lockfileVersion = bunLockTextPath ? 1 : 0;
314
+ } else if (vltLock) {
315
+ cliType = "vlt";
316
+ lockfilePath = vltLockPath;
311
317
  } else {
312
318
  cliType = detectPackageManagerNameWithoutLockfile(
313
319
  packageJsonPackageManager,
@@ -470,6 +476,11 @@ function getInstallCommandForPackageManager(packageManager, args) {
470
476
  prettyCommand: "yarn install",
471
477
  commandArguments: ["install", ...args]
472
478
  };
479
+ case "vlt":
480
+ return {
481
+ prettyCommand: "vlt install",
482
+ commandArguments: ["install", ...args]
483
+ };
473
484
  }
474
485
  }
475
486
  async function runInstallCommand({
@@ -694,6 +705,7 @@ function validLockfileForPackageManager(cliType, lockfileVersion, packageManager
694
705
  case "npm":
695
706
  case "bun":
696
707
  case "yarn":
708
+ case "vlt":
697
709
  return true;
698
710
  case "pnpm":
699
711
  switch (packageManagerMajorVersion) {
@@ -878,6 +890,12 @@ function detectPackageManager(cliType, lockfileVersion, projectCreatedAt) {
878
890
  detectedLockfile: "yarn.lock",
879
891
  detectedPackageManager: detectYarnVersion(lockfileVersion)
880
892
  };
893
+ case "vlt":
894
+ return {
895
+ path: void 0,
896
+ detectedLockfile: "vlt-lock.json",
897
+ detectedPackageManager: "vlt@0.x"
898
+ };
881
899
  }
882
900
  }
883
901
  function getPathForPackageManager({
@@ -983,6 +1001,8 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts, projectCre
983
1001
  opts.prettyCommand = `pnpm run ${scriptName}`;
984
1002
  } else if (cliType === "bun") {
985
1003
  opts.prettyCommand = `bun run ${scriptName}`;
1004
+ } else if (cliType === "vlt") {
1005
+ opts.prettyCommand = `vlt run ${scriptName}`;
986
1006
  } else {
987
1007
  opts.prettyCommand = `yarn run ${scriptName}`;
988
1008
  }
package/dist/index.js CHANGED
@@ -23320,7 +23320,8 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
23320
23320
  npmLockPath,
23321
23321
  pnpmLockPath,
23322
23322
  bunLockTextPath,
23323
- bunLockBinPath
23323
+ bunLockBinPath,
23324
+ vltLockPath
23324
23325
  ],
23325
23326
  packageJsonPackageManager
23326
23327
  } = await walkParentDirsMulti({
@@ -23331,18 +23332,20 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
23331
23332
  "package-lock.json",
23332
23333
  "pnpm-lock.yaml",
23333
23334
  "bun.lock",
23334
- "bun.lockb"
23335
+ "bun.lockb",
23336
+ "vlt-lock.json"
23335
23337
  ]
23336
23338
  });
23337
23339
  let lockfilePath;
23338
23340
  let lockfileVersion;
23339
23341
  let cliType;
23340
23342
  const bunLockPath = bunLockTextPath ?? bunLockBinPath;
23341
- const [packageLockJson, pnpmLockYaml, bunLock, yarnLock] = await Promise.all([
23343
+ const [packageLockJson, pnpmLockYaml, bunLock, yarnLock, vltLock] = await Promise.all([
23342
23344
  npmLockPath ? readConfigFile(npmLockPath) : null,
23343
23345
  pnpmLockPath ? readConfigFile(pnpmLockPath) : null,
23344
23346
  bunLockPath ? import_fs_extra7.default.readFile(bunLockPath) : null,
23345
- yarnLockPath ? import_fs_extra7.default.readFile(yarnLockPath, "utf8") : null
23347
+ yarnLockPath ? import_fs_extra7.default.readFile(yarnLockPath, "utf8") : null,
23348
+ vltLockPath ? readConfigFile(vltLockPath) : null
23346
23349
  ]);
23347
23350
  const rootProjectInfo = readPackageJson ? await readProjectRootInfo({
23348
23351
  base,
@@ -23373,6 +23376,9 @@ async function scanParentDirs(destPath, readPackageJson = false, base = "/") {
23373
23376
  cliType = "bun";
23374
23377
  lockfilePath = bunLockPath;
23375
23378
  lockfileVersion = bunLockTextPath ? 1 : 0;
23379
+ } else if (vltLock) {
23380
+ cliType = "vlt";
23381
+ lockfilePath = vltLockPath;
23376
23382
  } else {
23377
23383
  cliType = detectPackageManagerNameWithoutLockfile(
23378
23384
  packageJsonPackageManager,
@@ -23535,6 +23541,11 @@ function getInstallCommandForPackageManager(packageManager, args) {
23535
23541
  prettyCommand: "yarn install",
23536
23542
  commandArguments: ["install", ...args]
23537
23543
  };
23544
+ case "vlt":
23545
+ return {
23546
+ prettyCommand: "vlt install",
23547
+ commandArguments: ["install", ...args]
23548
+ };
23538
23549
  }
23539
23550
  }
23540
23551
  async function runInstallCommand({
@@ -23759,6 +23770,7 @@ function validLockfileForPackageManager(cliType, lockfileVersion, packageManager
23759
23770
  case "npm":
23760
23771
  case "bun":
23761
23772
  case "yarn":
23773
+ case "vlt":
23762
23774
  return true;
23763
23775
  case "pnpm":
23764
23776
  switch (packageManagerMajorVersion) {
@@ -23943,6 +23955,12 @@ function detectPackageManager(cliType, lockfileVersion, projectCreatedAt) {
23943
23955
  detectedLockfile: "yarn.lock",
23944
23956
  detectedPackageManager: detectYarnVersion(lockfileVersion)
23945
23957
  };
23958
+ case "vlt":
23959
+ return {
23960
+ path: void 0,
23961
+ detectedLockfile: "vlt-lock.json",
23962
+ detectedPackageManager: "vlt@0.x"
23963
+ };
23946
23964
  }
23947
23965
  }
23948
23966
  function getPathForPackageManager({
@@ -24048,6 +24066,8 @@ async function runPackageJsonScript(destPath, scriptNames, spawnOpts, projectCre
24048
24066
  opts.prettyCommand = `pnpm run ${scriptName}`;
24049
24067
  } else if (cliType === "bun") {
24050
24068
  opts.prettyCommand = `bun run ${scriptName}`;
24069
+ } else if (cliType === "vlt") {
24070
+ opts.prettyCommand = `vlt run ${scriptName}`;
24051
24071
  } else {
24052
24072
  opts.prettyCommand = `yarn run ${scriptName}`;
24053
24073
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "10.6.7",
3
+ "version": "11.0.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",