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)
(cherry picked from commit 1a58436)
  • Loading branch information
clydin authored and dgp1130 committed Nov 17, 2022
1 parent f1fe0ea commit 6446091
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 6446091

Please sign in to comment.