1
1
import { Rule , SchematicContext , Tree } from '@angular-devkit/schematics' ;
2
- import { findMatches , replaceMatch } from '../common/tsUtils' ;
3
2
import { UpdateChanges } from '../common/UpdateChanges' ;
4
3
5
4
const version = '11.1.0' ;
@@ -8,28 +7,5 @@ export default (): Rule => (host: Tree, context: SchematicContext) => {
8
7
context . logger . info ( `Applying migration for Ignite UI for Angular to version ${ version } ` ) ;
9
8
10
9
const update = new UpdateChanges ( __dirname , host , context ) ;
11
- const tsFiles = update . tsFiles ;
12
- const targetEnum = 'GridPagingMode' ;
13
- const changes = [
14
- { member : 'remote' , replaceWith : 'Remote' , definedIn : [ targetEnum ] } ,
15
- { member : 'local' , replaceWith : 'Local' , definedIn : [ targetEnum ] }
16
- ] ;
17
10
update . applyChanges ( ) ;
18
- for ( const entryPath of tsFiles ) {
19
- const ls = update . getDefaultLanguageService ( entryPath ) ;
20
- let content = host . read ( entryPath ) . toString ( ) ;
21
- for ( const change of changes ) {
22
- const matches = findMatches ( content , change . member ) ;
23
- for ( const position of matches ) {
24
- const definition = ls . getDefinitionAndBoundSpan ( entryPath , position - 1 ) ?. definitions [ 0 ] ;
25
- if ( definition
26
- && definition . kind === 'enum'
27
- && definition . name === targetEnum
28
- && definition . fileName . includes ( 'igniteui-angular' ) ) {
29
- content = replaceMatch ( content , change . member , change . replaceWith , position ) ;
30
- host . overwrite ( entryPath , content ) ;
31
- }
32
- }
33
- }
34
- }
35
11
} ;
0 commit comments