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