Skip to content

Commit

Permalink
fix: should add peerDependencyRules.allowedVersions to make peer depe…
Browse files Browse the repository at this point in the history
…ndency overrides work

See pnpm/pnpm#4214 (comment)
  • Loading branch information
sodatea committed May 11, 2023
1 parent 7142080 commit 4ed88c5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions utils.ts
Expand Up @@ -515,13 +515,16 @@ export async function applyPackageOverrides(
// ...pkg.devDependencies,
// ...overrides, // overrides must be present in devDependencies or dependencies otherwise they may not work
// }
if (!pkg.pnpm) {
pkg.pnpm = {}
}
pkg.pnpm ||= {}
pkg.pnpm.overrides = {
...pkg.pnpm.overrides,
...overrides,
}
pkg.pnpm.peerDependencyRules ||= {}
pkg.pnpm.peerDependencyRules.allowedVersions = {
...pkg.pnpm.peerDependencyRules.allowedVersions,
...overrides,
}
} else if (pm === 'yarn') {
pkg.resolutions = {
...pkg.resolutions,
Expand Down

0 comments on commit 4ed88c5

Please sign in to comment.