Skip to content

Commit

Permalink
fix(@angular/cli): exclude deprecated packages with removal migration…
Browse files Browse the repository at this point in the history
…s 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.
  • Loading branch information
clydin authored and alan-agius4 committed Apr 2, 2021
1 parent e84fa72 commit 8a805fe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions packages/angular/cli/src/commands/update/schematic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,14 @@ function _validateReversePeerDependencies(
continue;
}

if (installed === '@angular-devkit/build-ng-packagr') {
// Ignore peerDependencies mismatches for `@angular-devkit/build-ng-packagr`.
// This package is deprecated and is removed via a migration.
// Ignore peerDependency mismatches for these packages.
// They are deprecated and removed via a migration.
const ignoredPackages = [
'codelyzer',
'@schematics/update',
'@angular-devkit/build-ng-packagr',
];
if (ignoredPackages.includes(installed)) {
continue;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/legacy-cli/e2e/tests/update/update-8.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default async function () {
// Update Angular to 10
await ng('update', '@angular/cli@10', '@angular/core@10');

// Update Angular to 11 (force needed due to codelyzer)
await ng('update', '@angular/cli@11', '@angular/core@11', '--force');
// Update Angular to 11
await ng('update', '@angular/cli@11', '@angular/core@11');
} finally {
await setRegistry(true);
}
Expand Down

0 comments on commit 8a805fe

Please sign in to comment.