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 8
8
9
9
import { Rule , chain } from '@angular-devkit/schematics' ;
10
10
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks' ;
11
+ import { addTsLib } from './add-tslib' ;
11
12
import { updateLibraries } from './ivy-libraries' ;
12
13
import { updateNGSWConfig } from './ngsw-config' ;
13
14
import { removeTsickle } from './remove-tsickle' ;
@@ -26,6 +27,7 @@ export default function(): Rule {
26
27
updateDependencies ( ) ,
27
28
updateServerMainFile ( ) ,
28
29
removeTsickle ( ) ,
30
+ addTsLib ( ) ,
29
31
( tree , context ) => {
30
32
const packageChanges = tree . actions . some ( a => a . path . endsWith ( '/package.json' ) ) ;
31
33
if ( packageChanges ) {
Original file line number Diff line number Diff line change 5
5
* Use of this source code is governed by an MIT-style license that can be
6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
- import { Tree } from '@angular-devkit/schematics' ;
8
+ import { Rule } from '@angular-devkit/schematics' ;
9
9
import { addPackageJsonDependency , getPackageJsonDependency } from '../../utility/dependencies' ;
10
10
import { latestVersions } from '../../utility/latest-versions' ;
11
11
12
- export function updateDependencies ( ) {
13
- return ( host : Tree ) => {
12
+ export function updateDependencies ( ) : Rule {
13
+ return host => {
14
14
const dependenciesToUpdate : Record < string , string > = {
15
15
'@angular/pwa' : latestVersions . AngularPWA ,
16
16
'@angular-devkit/build-angular' : latestVersions . DevkitBuildAngular ,
You can’t perform that action at this time.
0 commit comments