@vercel/build-utils
Advanced tools
Comparing version 8.8.0 to 9.0.0
# @vercel/build-utils | ||
## 9.0.0 | ||
### Major Changes | ||
- Change getPathOverrideForPackageManager() to use detectedLockfile argument ([#12813](https://github.com/vercel/vercel/pull/12813)) | ||
### Patch Changes | ||
- Refactor build-util usage to reuse detected lockfile ([#12813](https://github.com/vercel/vercel/pull/12813)) | ||
- add support for `images.qualities` ([#12813](https://github.com/vercel/vercel/pull/12813)) | ||
## 8.8.0 | ||
@@ -4,0 +16,0 @@ |
@@ -40,2 +40,7 @@ /// <reference types="node" /> | ||
turboSupportsCorepackHome?: boolean; | ||
/** | ||
* Name of the lockfile (`yarn.lock`, `package-lock.json`, ...) detected | ||
* or `undefined` if no lockfile was detected. | ||
*/ | ||
detectedLockfile?: string; | ||
} | ||
@@ -101,3 +106,3 @@ export interface TraverseUpDirectoriesProps { | ||
*/ | ||
export declare function getEnvForPackageManager({ cliType, lockfileVersion, packageJsonPackageManager, nodeVersion, env, packageJsonEngines, turboSupportsCorepackHome, }: { | ||
export declare function getEnvForPackageManager({ cliType, lockfileVersion, packageJsonPackageManager, nodeVersion, env, packageJsonEngines, turboSupportsCorepackHome, detectedLockfile, }: { | ||
cliType: CliType; | ||
@@ -112,2 +117,3 @@ lockfileVersion: number | undefined; | ||
turboSupportsCorepackHome?: boolean | undefined; | ||
detectedLockfile: string | undefined; | ||
}): { | ||
@@ -120,3 +126,3 @@ [x: string]: string | undefined; | ||
*/ | ||
export declare function getPathOverrideForPackageManager({ cliType, lockfileVersion, corepackPackageManager, corepackEnabled, packageJsonEngines, }: { | ||
export declare function getPathOverrideForPackageManager({ cliType, lockfileVersion, corepackPackageManager, corepackEnabled, packageJsonEngines, detectedLockfile, }: { | ||
cliType: CliType; | ||
@@ -128,2 +134,3 @@ lockfileVersion: number | undefined; | ||
packageJsonEngines?: PackageJson.Engines; | ||
detectedLockfile?: string; | ||
}): { | ||
@@ -144,5 +151,5 @@ /** | ||
}; | ||
export declare function detectPackageManager(cliType: CliType, lockfileVersion: number | undefined): { | ||
export declare function detectPackageManager(cliType: CliType, lockfileVersion: number | undefined, detectedLockfile: string | undefined): { | ||
path: string; | ||
detectedLockfile: string; | ||
detectedLockfile: string | undefined; | ||
detectedPackageManager: string; | ||
@@ -152,3 +159,3 @@ pnpmVersionRange: string; | ||
path: undefined; | ||
detectedLockfile: string; | ||
detectedLockfile: string | undefined; | ||
detectedPackageManager: string; | ||
@@ -158,3 +165,3 @@ pnpmVersionRange: string; | ||
path: string; | ||
detectedLockfile: string; | ||
detectedLockfile: string | undefined; | ||
detectedPackageManager: string; | ||
@@ -164,3 +171,3 @@ pnpmVersionRange?: undefined; | ||
path: undefined; | ||
detectedLockfile: string; | ||
detectedLockfile: string | undefined; | ||
detectedPackageManager: string; | ||
@@ -174,3 +181,3 @@ pnpmVersionRange?: undefined; | ||
*/ | ||
export declare function getPathForPackageManager({ cliType, lockfileVersion, nodeVersion, env, }: { | ||
export declare function getPathForPackageManager({ cliType, lockfileVersion, nodeVersion, env, detectedLockfile, }: { | ||
cliType: CliType; | ||
@@ -182,2 +189,3 @@ lockfileVersion: number | undefined; | ||
}; | ||
detectedLockfile: string; | ||
}): { | ||
@@ -184,0 +192,0 @@ /** |
@@ -283,3 +283,2 @@ "use strict"; | ||
lockfilePath = bunLockPath; | ||
lockfileVersion = bunLockTextPath ? 1 : 0; | ||
} else if (hasYarnLock) { | ||
@@ -299,3 +298,2 @@ cliType = "yarn"; | ||
lockfilePath = bunLockPath; | ||
lockfileVersion = bunLockTextPath ? 1 : 0; | ||
} else { | ||
@@ -315,3 +313,4 @@ cliType = detectPackageManagerNameWithoutLockfile( | ||
packageJsonPath, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile: lockfilePath ? import_path.default.basename(lockfilePath) : void 0 | ||
}; | ||
@@ -442,3 +441,4 @@ } | ||
packageJsonPackageManager, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile | ||
} = await scanParentDirs(destPath, true); | ||
@@ -477,3 +477,4 @@ if (!packageJsonPath) { | ||
packageJsonEngines: packageJson?.engines, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile | ||
}); | ||
@@ -532,3 +533,4 @@ let commandArgs; | ||
packageJsonEngines, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile | ||
}) { | ||
@@ -540,7 +542,3 @@ const corepackEnabled = usingCorepack( | ||
); | ||
const { | ||
detectedLockfile, | ||
detectedPackageManager, | ||
path: newPath | ||
} = getPathOverrideForPackageManager({ | ||
const { detectedPackageManager, path: newPath } = getPathOverrideForPackageManager({ | ||
cliType, | ||
@@ -551,3 +549,4 @@ lockfileVersion, | ||
corepackEnabled, | ||
packageJsonEngines | ||
packageJsonEngines, | ||
detectedLockfile | ||
}); | ||
@@ -636,5 +635,10 @@ if (corepackEnabled) { | ||
corepackEnabled = true, | ||
packageJsonEngines | ||
packageJsonEngines, | ||
detectedLockfile | ||
}) { | ||
const detectedPackageManger = detectPackageManager(cliType, lockfileVersion); | ||
const detectedPackageManger = detectPackageManager( | ||
cliType, | ||
lockfileVersion, | ||
detectedLockfile | ||
); | ||
if (!corepackPackageManager || !corepackEnabled) { | ||
@@ -730,3 +734,3 @@ if (cliType === "pnpm" && packageJsonEngines?.pnpm) { | ||
} | ||
function detectPackageManager(cliType, lockfileVersion) { | ||
function detectPackageManager(cliType, lockfileVersion, detectedLockfile) { | ||
switch (cliType) { | ||
@@ -740,3 +744,3 @@ case "npm": | ||
path: "/pnpm7/node_modules/.bin", | ||
detectedLockfile: "pnpm-lock.yaml", | ||
detectedLockfile, | ||
detectedPackageManager: "pnpm@7.x", | ||
@@ -748,3 +752,3 @@ pnpmVersionRange: "7.x" | ||
path: "/pnpm8/node_modules/.bin", | ||
detectedLockfile: "pnpm-lock.yaml", | ||
detectedLockfile, | ||
detectedPackageManager: "pnpm@8.x", | ||
@@ -756,3 +760,3 @@ pnpmVersionRange: "8.x" | ||
path: "/pnpm9/node_modules/.bin", | ||
detectedLockfile: "pnpm-lock.yaml", | ||
detectedLockfile, | ||
detectedPackageManager: "pnpm@9.x", | ||
@@ -765,3 +769,3 @@ pnpmVersionRange: "9.x" | ||
path: void 0, | ||
detectedLockfile: "pnpm-lock.yaml", | ||
detectedLockfile, | ||
detectedPackageManager: "pnpm@6.x", | ||
@@ -776,3 +780,3 @@ pnpmVersionRange: "6.x" | ||
path: "/bun1", | ||
detectedLockfile: lockfileVersion === 0 ? "bun.lockb" : "bun.lock", | ||
detectedLockfile, | ||
detectedPackageManager: "bun@1.x" | ||
@@ -783,3 +787,3 @@ }; | ||
path: void 0, | ||
detectedLockfile: "yarn.lock", | ||
detectedLockfile, | ||
detectedPackageManager: "yarn" | ||
@@ -793,3 +797,4 @@ }; | ||
nodeVersion, | ||
env | ||
env, | ||
detectedLockfile | ||
}) { | ||
@@ -801,3 +806,4 @@ const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === "1"; | ||
corepackPackageManager: void 0, | ||
nodeVersion | ||
nodeVersion, | ||
detectedLockfile | ||
}); | ||
@@ -837,3 +843,4 @@ if (corepackEnabled) { | ||
packageJsonPackageManager, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile | ||
} = await scanParentDirs(destPath, true); | ||
@@ -847,3 +854,4 @@ const env = getEnvForPackageManager({ | ||
packageJsonEngines: packageJson?.engines, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile | ||
}); | ||
@@ -864,3 +872,4 @@ (0, import_debug.default)(`Running with $PATH:`, env?.PATH || ""); | ||
packageJsonPackageManager, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile | ||
} = await scanParentDirs(destPath, true); | ||
@@ -885,3 +894,4 @@ const scriptName = getScriptName( | ||
packageJsonEngines: packageJson?.engines, | ||
turboSupportsCorepackHome | ||
turboSupportsCorepackHome, | ||
detectedLockfile | ||
}) | ||
@@ -888,0 +898,0 @@ }; |
@@ -387,2 +387,3 @@ /// <reference types="node" /> | ||
localPatterns?: LocalPattern[]; | ||
qualities?: number[]; | ||
sizes: number[]; | ||
@@ -389,0 +390,0 @@ minimumCacheTTL?: number; |
{ | ||
"name": "@vercel/build-utils", | ||
"version": "8.8.0", | ||
"version": "9.0.0", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is too big to display
6
47
1300652
29554