Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/flat-elephants-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pnpm/resolve-dependencies": major
---

Remove `allowBuild` from options.
2 changes: 0 additions & 2 deletions pkg-manager/core/src/install/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 0 additions & 3 deletions pkg-manager/resolve-dependencies/src/resolveDependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1586,7 +1584,6 @@ function pkgIsLeaf (pkg: PackageManifest): boolean {

function getResolvedPackage (
options: {
allowBuild?: (pkgName: string) => boolean
dependencyLockfile?: PackageSnapshot
pkgIdWithPatchHash: PkgIdWithPatchHash
force: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
Loading