Skip to content

Commit

Permalink
fix(@angular/cli): exclude @angular/material@7.x from ng add packag…
Browse files Browse the repository at this point in the history
…e discovery

`@angular/material@7.x` uses unbounded ranges for its framework peer dependencies.
This can cause `ng add` to pick these versions of the package if the newer versions
are not compatible since the peer dependency ranges would match any newer stable
framework version.

(cherry picked from commit 9260087)
  • Loading branch information
clydin authored and dgp1130 committed Oct 25, 2022
1 parent 92145c4 commit 1a58436
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/angular/cli/src/commands/add/cli.ts
Expand Up @@ -50,6 +50,8 @@ interface AddCommandArgs extends SchematicsCommandArgs {
const packageVersionExclusions: Record<string, string | undefined> = {
// @angular/localize@9.x versions do not have peer dependencies setup
'@angular/localize': '9.x',
// @angular/material@7.x versions have unbounded peer dependency ranges (>=7.0.0)
'@angular/material': '7.x',
};

export class AddCommandModule
Expand Down

0 comments on commit 1a58436

Please sign in to comment.