File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed
packages/schematics/angular/migrations/update-9 Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * @license
3+ * Copyright Google Inc. All Rights Reserved.
4+ *
5+ * Use of this source code is governed by an MIT-style license that can be
6+ * found in the LICENSE file at https://angular.io/license
7+ */
8+ import { Rule } from '@angular-devkit/schematics' ;
9+ import { NodeDependencyType , addPackageJsonDependency , removePackageJsonDependency } from '../../utility/dependencies' ;
10+ import { latestVersions } from '../../utility/latest-versions' ;
11+
12+ export function addTsLib ( ) : Rule {
13+ return host => {
14+ removePackageJsonDependency ( host , 'tslib' ) ;
15+ addPackageJsonDependency ( host , {
16+ name : 'tslib' ,
17+ version : latestVersions . TsLib ,
18+ type : NodeDependencyType . Default ,
19+ } ) ;
20+ } ;
21+ }
Original file line number Diff line number Diff line change 88
99import { Rule , chain } from '@angular-devkit/schematics' ;
1010import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks' ;
11+ import { addTsLib } from './add-tslib' ;
1112import { updateLibraries } from './ivy-libraries' ;
1213import { updateNGSWConfig } from './ngsw-config' ;
1314import { removeTsickle } from './remove-tsickle' ;
@@ -26,6 +27,7 @@ export default function(): Rule {
2627 updateDependencies ( ) ,
2728 updateServerMainFile ( ) ,
2829 removeTsickle ( ) ,
30+ addTsLib ( ) ,
2931 ( tree , context ) => {
3032 const packageChanges = tree . actions . some ( a => a . path . endsWith ( '/package.json' ) ) ;
3133 if ( packageChanges ) {
Original file line number Diff line number Diff line change 55 * Use of this source code is governed by an MIT-style license that can be
66 * found in the LICENSE file at https://angular.io/license
77 */
8- import { Tree } from '@angular-devkit/schematics' ;
8+ import { Rule } from '@angular-devkit/schematics' ;
99import { addPackageJsonDependency , getPackageJsonDependency } from '../../utility/dependencies' ;
1010import { latestVersions } from '../../utility/latest-versions' ;
1111
12- export function updateDependencies ( ) {
13- return ( host : Tree ) => {
12+ export function updateDependencies ( ) : Rule {
13+ return host => {
1414 const dependenciesToUpdate : Record < string , string > = {
1515 '@angular/pwa' : latestVersions . AngularPWA ,
1616 '@angular-devkit/build-angular' : latestVersions . DevkitBuildAngular ,
You can’t perform that action at this time.
0 commit comments