import { Rule , SchematicContext , Tree } from '@angular-devkit/schematics' ; import { UpdateChanges } from '../common/UpdateChanges' ; const version = '10.2.0' ; export default ( ) : Rule => async ( host , context ) => { context . logger . info ( `Applying migration for Ignite UI for Angular to version ${ version }` ) ; const update = new UpdateChanges ( __dirname , host , context ) ; update . addCondition ( 'type_is_invalid' , ( matchedOwner ) : boolean => { if ( ! matchedOwner ) { return true ; } const attrMatch = matchedOwner . match ( new RegExp ( `type=(["'])(.+?)${ '\\1' }` ) ) ; if ( attrMatch ?. length > 0 ) { const attr = attrMatch [ 0 ] ; return ( attr . includes ( 'bootstrap' ) || attr . includes ( 'fluent' ) || attr . includes ( 'indigo' ) ) ; } return true ; } ) ; update . applyChanges ( ) ; } ;