Skip to content

Commit 8a805fe

Browse files
clydinalan-agius4
authored andcommitted
fix(@angular/cli): exclude deprecated packages with removal migrations from update
Deprecated packages that may have been included in a project by the tooling are now ignored when validating an update. This change removes the need to use the `--force` option in a situation where the later migrations will remove and cleanup the deprecated packages.
1 parent e84fa72 commit 8a805fe

File tree

2 files changed

+10
-5
lines changed
  • packages/angular/cli/src/commands/update/schematic
  • tests/legacy-cli/e2e/tests/update

2 files changed

+10
-5
lines changed

packages/angular/cli/src/commands/update/schematic/index.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,14 @@ function _validateReversePeerDependencies(
172172
continue;
173173
}
174174

175-
if (installed === '@angular-devkit/build-ng-packagr') {
176-
// Ignore peerDependencies mismatches for `@angular-devkit/build-ng-packagr`.
177-
// This package is deprecated and is removed via a migration.
175+
// Ignore peerDependency mismatches for these packages.
176+
// They are deprecated and removed via a migration.
177+
const ignoredPackages = [
178+
'codelyzer',
179+
'@schematics/update',
180+
'@angular-devkit/build-ng-packagr',
181+
];
182+
if (ignoredPackages.includes(installed)) {
178183
continue;
179184
}
180185

tests/legacy-cli/e2e/tests/update/update-8.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export default async function () {
2525
// Update Angular to 10
2626
await ng('update', '@angular/cli@10', '@angular/core@10');
2727

28-
// Update Angular to 11 (force needed due to codelyzer)
29-
await ng('update', '@angular/cli@11', '@angular/core@11', '--force');
28+
// Update Angular to 11
29+
await ng('update', '@angular/cli@11', '@angular/core@11');
3030
} finally {
3131
await setRegistry(true);
3232
}

0 commit comments

Comments
 (0)