Skip to content

Commit a7f977f

Browse files
alan-agius4vikerman
authored andcommitted
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
1 parent d133ba6 commit a7f977f

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { latestVersions } from '../../utility/latest-versions';
1212
export function updateDependencies() {
1313
return (host: Tree) => {
1414
const dependenciesToUpdate: Record<string, string> = {
15-
'@angular/pwa': latestVersions.AngularPWA,
15+
'@angular/pwa': '^0.803.9',
1616
'@angular-devkit/build-angular': latestVersions.DevkitBuildAngular,
1717
'@angular-devkit/build-ng-packagr': latestVersions.DevkitBuildNgPackagr,
1818
'@angular-devkit/build-webpack': latestVersions.DevkitBuildWebpack,

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,16 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import { Rule } from '@angular-devkit/schematics';
9-
import { addPackageJsonDependency, getPackageJsonDependency } from '../../utility/dependencies';
9+
import {
10+
addPackageJsonDependency,
11+
getPackageJsonDependency,
12+
removePackageJsonDependency,
13+
} from '../../utility/dependencies';
1014
import { latestVersions } from '../../utility/latest-versions';
1115

1216
export function updateDependencies(): Rule {
1317
return host => {
1418
const dependenciesToUpdate: Record<string, string> = {
15-
'@angular/pwa': latestVersions.AngularPWA,
1619
'@angular-devkit/build-angular': latestVersions.DevkitBuildAngular,
1720
'@angular-devkit/build-ng-packagr': latestVersions.DevkitBuildNgPackagr,
1821
'@angular-devkit/build-webpack': latestVersions.DevkitBuildWebpack,
@@ -35,5 +38,8 @@ export function updateDependencies(): Rule {
3538
overwrite: true,
3639
});
3740
}
41+
42+
// `@angular/pwa` package is only needed when running `ng-add`.
43+
removePackageJsonDependency(host, '@angular/pwa');
3844
};
3945
}

packages/schematics/angular/utility/latest-versions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const latestVersions = {
1818
DevkitBuildAngular: '~0.900.0-next.9',
1919
DevkitBuildNgPackagr: '~0.900.0-next.9',
2020
DevkitBuildWebpack: '~0.900.0-next.9',
21-
AngularPWA: '~0.900.0-next.9',
2221

2322
ngPackagr: '^5.5.1',
2423
};

0 commit comments

Comments
 (0)