fix(@angular/cli): migrate and inform users about @angular-devkit/[schematics, core] packages

This commit is contained in:
Charles Lyding 2019-12-19 13:58:01 -05:00 committed by vikerman
parent 7e899a111f
commit 3dd706700e
2 changed files with 16 additions and 2 deletions

View File

@ -52,7 +52,9 @@
"@angular/cli": "0.0.0",
"@angular-devkit/build-angular": "0.0.0",
"@angular-devkit/build-ng-packagr": "0.0.0",
"@angular-devkit/build-webpack": "0.0.0"
"@angular-devkit/build-webpack": "0.0.0",
"@angular-devkit/core": "0.0.0",
"@angular-devkit/schematics": "0.0.0"
}
}
}

View File

@ -14,7 +14,7 @@ import {
import { latestVersions } from '../../utility/latest-versions';
export function updateDependencies(): Rule {
return host => {
return (host, context) => {
const dependenciesToUpdate: Record<string, string> = {
'@angular-devkit/build-angular': latestVersions.DevkitBuildAngular,
'@angular-devkit/build-ng-packagr': latestVersions.DevkitBuildNgPackagr,
@ -42,5 +42,17 @@ export function updateDependencies(): Rule {
// `@angular/pwa` package is only needed when running `ng-add`.
removePackageJsonDependency(host, '@angular/pwa');
// Check for @angular-devkit/schematics and @angular-devkit/core
for (const name of ['@angular-devkit/schematics', '@angular-devkit/core']) {
const current = getPackageJsonDependency(host, name);
if (current) {
context.logger.info(
`Package "${name}" found in the workspace package.json. ` +
'This package typically does not need to be installed manually. ' +
'If it is not being used by project code, it can be removed from the package.json.',
);
}
}
};
}