Alan Agius a7f977f05d feat(@schematics/angular): remove @angular/pwa from depedencies
`@angular/pwa` is not needed as a dependency. This is because the pwa package is a schematic and is only used once when adding pwa capabilities to your application. After that, this package is not used anymore.

Closes #15764
2019-10-14 13:40:31 -07:00

40 lines
1.3 KiB
TypeScript

/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { Tree } from '@angular-devkit/schematics';
import { addPackageJsonDependency, getPackageJsonDependency } from '../../utility/dependencies';
import { latestVersions } from '../../utility/latest-versions';
export function updateDependencies() {
return (host: Tree) => {
const dependenciesToUpdate: Record<string, string> = {
'@angular/pwa': '^0.803.9',
'@angular-devkit/build-angular': latestVersions.DevkitBuildAngular,
'@angular-devkit/build-ng-packagr': latestVersions.DevkitBuildNgPackagr,
'@angular-devkit/build-webpack': latestVersions.DevkitBuildWebpack,
'zone.js': latestVersions.ZoneJs,
tsickle: '^0.37.0',
'ng-packagr': latestVersions.ngPackagr,
'web-animations-js': '^2.3.2',
};
for (const [name, version] of Object.entries(dependenciesToUpdate)) {
const current = getPackageJsonDependency(host, name);
if (!current || current.version === version) {
continue;
}
addPackageJsonDependency(host, {
type: current.type,
name,
version,
overwrite: true,
});
}
};
}