Skip to content

Commit

Permalink
feat(@schematics/angular): remove @angular/pwa from depedencies
Browse files Browse the repository at this point in the history
`@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
  • Loading branch information
alan-agius4 authored and vikerman committed Oct 14, 2019
1 parent d133ba6 commit a7f977f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { latestVersions } from '../../utility/latest-versions';
export function updateDependencies() {
return (host: Tree) => {
const dependenciesToUpdate: Record<string, string> = {
'@angular/pwa': latestVersions.AngularPWA,
'@angular/pwa': '^0.803.9',
'@angular-devkit/build-angular': latestVersions.DevkitBuildAngular,
'@angular-devkit/build-ng-packagr': latestVersions.DevkitBuildNgPackagr,
'@angular-devkit/build-webpack': latestVersions.DevkitBuildWebpack,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
* found in the LICENSE file at https://angular.io/license
*/
import { Rule } from '@angular-devkit/schematics';
import { addPackageJsonDependency, getPackageJsonDependency } from '../../utility/dependencies';
import {
addPackageJsonDependency,
getPackageJsonDependency,
removePackageJsonDependency,
} from '../../utility/dependencies';
import { latestVersions } from '../../utility/latest-versions';

export function updateDependencies(): Rule {
return host => {
const dependenciesToUpdate: Record<string, string> = {
'@angular/pwa': latestVersions.AngularPWA,
'@angular-devkit/build-angular': latestVersions.DevkitBuildAngular,
'@angular-devkit/build-ng-packagr': latestVersions.DevkitBuildNgPackagr,
'@angular-devkit/build-webpack': latestVersions.DevkitBuildWebpack,
Expand All @@ -35,5 +38,8 @@ export function updateDependencies(): Rule {
overwrite: true,
});
}

// `@angular/pwa` package is only needed when running `ng-add`.
removePackageJsonDependency(host, '@angular/pwa');
};
}
1 change: 0 additions & 1 deletion packages/schematics/angular/utility/latest-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const latestVersions = {
DevkitBuildAngular: '~0.900.0-next.9',
DevkitBuildNgPackagr: '~0.900.0-next.9',
DevkitBuildWebpack: '~0.900.0-next.9',
AngularPWA: '~0.900.0-next.9',

ngPackagr: '^5.5.1',
};

0 comments on commit a7f977f

Please sign in to comment.