refactor: remove allowBuild from options of resolveDependencies() (#8902)

This commit is contained in:
Zoltan Kochan
2024-12-23 01:24:50 +01:00
committed by GitHub
parent 516c4b301b
commit 512465c4ce
4 changed files with 5 additions and 7 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/resolve-dependencies": major
---
Remove `allowBuild` from options.

View File

@@ -932,8 +932,6 @@ const _installInContext: InstallFunction = async (projects, ctx, opts) => {
} = await resolveDependencies(
projects,
{
// In the next major allow build should be just () => true here always
allowBuild: opts.onlyBuiltDependenciesFile ? () => true : createAllowBuildFunction({ onlyBuiltDependencies: opts.onlyBuiltDependencies, neverBuiltDependencies: opts.neverBuiltDependencies }),
allowedDeprecatedVersions: opts.allowedDeprecatedVersions,
allowNonAppliedPatches: opts.allowNonAppliedPatches,
autoInstallPeers: opts.autoInstallPeers,

View File

@@ -136,7 +136,6 @@ export interface ResolutionContext {
allPeerDepNames: Set<string>
autoInstallPeers: boolean
autoInstallPeersFromHighestMatch: boolean
allowBuild?: (pkgName: string) => boolean
allowedDeprecatedVersions: AllowedDeprecatedVersions
allPreferredVersions?: PreferredVersions
appliedPatches: Set<string>
@@ -1468,7 +1467,6 @@ async function resolveDependency (
// WARN: It is very important to keep this sync
// Otherwise, deprecation messages for the same package might get written several times
ctx.resolvedPkgsById[pkgResponse.body.id] = getResolvedPackage({
allowBuild: ctx.allowBuild,
dependencyLockfile: currentPkg.dependencyLockfile,
pkgIdWithPatchHash,
force: ctx.force,
@@ -1586,7 +1584,6 @@ function pkgIsLeaf (pkg: PackageManifest): boolean {
function getResolvedPackage (
options: {
allowBuild?: (pkgName: string) => boolean
dependencyLockfile?: PackageSnapshot
pkgIdWithPatchHash: PkgIdWithPatchHash
force: boolean

View File

@@ -96,7 +96,6 @@ export interface ImporterToResolveGeneric<WantedDepExtraProps> extends Importer<
export interface ResolveDependenciesOptions {
autoInstallPeers?: boolean
autoInstallPeersFromHighestMatch?: boolean
allowBuild?: (pkgName: string) => boolean
allowedDeprecatedVersions: AllowedDeprecatedVersions
allowNonAppliedPatches: boolean
catalogs?: Catalogs
@@ -154,7 +153,6 @@ export async function resolveDependencyTree<T> (
const ctx: ResolutionContext = {
autoInstallPeers,
autoInstallPeersFromHighestMatch: opts.autoInstallPeersFromHighestMatch === true,
allowBuild: opts.allowBuild,
allowedDeprecatedVersions: opts.allowedDeprecatedVersions,
catalogResolver: resolveFromCatalog.bind(null, opts.catalogs ?? {}),
childrenByParentId: {} as ChildrenByParentId,