Skip to content

Commit 2162fe2

Browse files
clydinvikerman
authored andcommitted
fix(@angular/cli): migrate and inform users about @angular-devkit/[schematics, core] packages
1 parent 4df2d11 commit 2162fe2

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

packages/angular/cli/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@
5252
"@angular/cli": "0.0.0",
5353
"@angular-devkit/build-angular": "0.0.0",
5454
"@angular-devkit/build-ng-packagr": "0.0.0",
55-
"@angular-devkit/build-webpack": "0.0.0"
55+
"@angular-devkit/build-webpack": "0.0.0",
56+
"@angular-devkit/core": "0.0.0",
57+
"@angular-devkit/schematics": "0.0.0"
5658
}
5759
}
5860
}

packages/schematics/angular/migrations/update-9/update-dependencies.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import { latestVersions } from '../../utility/latest-versions';
1515

1616
export function updateDependencies(): Rule {
17-
return host => {
17+
return (host, context) => {
1818
const dependenciesToUpdate: Record<string, string> = {
1919
'@angular-devkit/build-angular': latestVersions.DevkitBuildAngular,
2020
'@angular-devkit/build-ng-packagr': latestVersions.DevkitBuildNgPackagr,
@@ -42,5 +42,17 @@ export function updateDependencies(): Rule {
4242

4343
// `@angular/pwa` package is only needed when running `ng-add`.
4444
removePackageJsonDependency(host, '@angular/pwa');
45+
46+
// Check for @angular-devkit/schematics and @angular-devkit/core
47+
for (const name of ['@angular-devkit/schematics', '@angular-devkit/core']) {
48+
const current = getPackageJsonDependency(host, name);
49+
if (current) {
50+
context.logger.info(
51+
`Package "${name}" found in the workspace package.json. ` +
52+
'This package typically does not need to be installed manually. ' +
53+
'If it is not being used by project code, it can be removed from the package.json.',
54+
);
55+
}
56+
}
4557
};
4658
}

0 commit comments

Comments
 (0)