feat!: remove deprecated patch options (#10505)

* refactor: remove allowNonAppliedPatches

* refactor: remove ignorePatchFailures

* refactor: remove `strict` field in groupPatchedDependencies

* test: update test failure in package patching

* test: fix

* docs: update changesets

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
Johan Quan Vo
2026-01-27 23:07:43 +07:00
committed by Zoltan Kochan
parent f8b4895e0a
commit 7b1c189f2e
21 changed files with 52 additions and 756 deletions

View File

@@ -1,9 +1,7 @@
import { PnpmError } from '@pnpm/error'
import { applyPatch } from '@pnpm/patch-package/dist/applyPatches.js'
import { globalWarn } from '@pnpm/logger'
export interface ApplyPatchToDirOpts {
allowFailure?: boolean
patchedDir: string
patchFilePath: string
}
@@ -27,12 +25,7 @@ export function applyPatchToDir (opts: ApplyPatchToDirOpts): boolean {
process.chdir(cwd)
}
if (!success) {
const message = `Could not apply patch ${opts.patchFilePath} to ${opts.patchedDir}`
if (opts.allowFailure) {
globalWarn(message)
} else {
throw new PnpmError('PATCH_FAILED', message)
}
throw new PnpmError('PATCH_FAILED', `Could not apply patch ${opts.patchFilePath} to ${opts.patchedDir}`)
}
return success
}