@vercel/build-utils 2.16.0 → 2.16.1-canary.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.
@@ -186,15 +186,20 @@ async function scanParentDirs(destPath, readPackageJson = false) {
186
186
  fs_extra_1.default.pathExists(path_1.default.join(currentDestPath, 'yarn.lock')),
187
187
  read_config_file_1.readConfigFile(path_1.default.join(currentDestPath, 'pnpm-lock.yaml')),
188
188
  ]);
189
- if (packageLockJson && !hasYarnLock && !pnpmLockYaml) {
190
- cliType = 'npm';
191
- lockfileVersion = packageLockJson.lockfileVersion;
189
+ // Priority order is Yarn > pnpm > npm
190
+ // - find highest priority lock file and use that
191
+ if (hasYarnLock) {
192
+ cliType = 'yarn';
192
193
  }
193
- if (!packageLockJson && !hasYarnLock && pnpmLockYaml) {
194
+ else if (pnpmLockYaml) {
194
195
  cliType = 'pnpm';
195
196
  // just ensure that it is read as a number and not a string
196
197
  lockfileVersion = Number(pnpmLockYaml.lockfileVersion);
197
198
  }
199
+ else if (packageLockJson) {
200
+ cliType = 'npm';
201
+ lockfileVersion = packageLockJson.lockfileVersion;
202
+ }
198
203
  // Only stop iterating if a lockfile was found, because it's possible
199
204
  // that the lockfile is in a higher path than where the `package.json`
200
205
  // file was found.
package/dist/index.js CHANGED
@@ -35049,15 +35049,20 @@ async function scanParentDirs(destPath, readPackageJson = false) {
35049
35049
  fs_extra_1.default.pathExists(path_1.default.join(currentDestPath, 'yarn.lock')),
35050
35050
  read_config_file_1.readConfigFile(path_1.default.join(currentDestPath, 'pnpm-lock.yaml')),
35051
35051
  ]);
35052
- if (packageLockJson && !hasYarnLock && !pnpmLockYaml) {
35053
- cliType = 'npm';
35054
- lockfileVersion = packageLockJson.lockfileVersion;
35052
+ // Priority order is Yarn > pnpm > npm
35053
+ // - find highest priority lock file and use that
35054
+ if (hasYarnLock) {
35055
+ cliType = 'yarn';
35055
35056
  }
35056
- if (!packageLockJson && !hasYarnLock && pnpmLockYaml) {
35057
+ else if (pnpmLockYaml) {
35057
35058
  cliType = 'pnpm';
35058
35059
  // just ensure that it is read as a number and not a string
35059
35060
  lockfileVersion = Number(pnpmLockYaml.lockfileVersion);
35060
35061
  }
35062
+ else if (packageLockJson) {
35063
+ cliType = 'npm';
35064
+ lockfileVersion = packageLockJson.lockfileVersion;
35065
+ }
35061
35066
  // Only stop iterating if a lockfile was found, because it's possible
35062
35067
  // that the lockfile is in a higher path than where the `package.json`
35063
35068
  // file was found.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/build-utils",
3
- "version": "2.16.0",
3
+ "version": "2.16.1-canary.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.js",
@@ -49,5 +49,5 @@
49
49
  "typescript": "4.3.4",
50
50
  "yazl": "2.5.1"
51
51
  },
52
- "gitHead": "a400b9b29d171232f4649e67e1fdcf4fb8d6a4c8"
52
+ "gitHead": "8eabbfc6667399fce2a9060fd48a0d7c635a2a62"
53
53
  }