66 * found in the LICENSE file at https://angular.io/license
77 */
88
9- import { ComponentMigrator , MIGRATORS } from './rules' ;
9+ import { ComponentMigrator , MIGRATORS , PERMANENT_MIGRATORS } from './rules' ;
1010import {
1111 DevkitFileSystem ,
1212 UpdateProject ,
@@ -21,8 +21,6 @@ import {RuntimeCodeMigration} from './rules/ts-migration/runtime-migration';
2121import { Schema } from './schema' ;
2222import { TemplateMigration } from './rules/template-migration' ;
2323import { ThemingStylesMigration } from './rules/theming-styles' ;
24- import { TypographyHierarchyTemplateMigrator } from './rules/components/typography-hierarchy/typography-hierarchy-template' ;
25- import { TypographyHierarchyStylesMigrator } from './rules/components/typography-hierarchy/typography-hierarchy-styles' ;
2624
2725/** Groups of components that must be migrated together. */
2826const migrationGroups = [
@@ -46,12 +44,6 @@ const migrationGroups = [
4644 [ 'tooltip' ] ,
4745] ;
4846
49- const TYPOGRAPHY_HIERARCHY_MIGRATOR : ComponentMigrator = {
50- component : 'typography-hierarchy' ,
51- template : new TypographyHierarchyTemplateMigrator ( ) ,
52- styles : new TypographyHierarchyStylesMigrator ( ) ,
53- } ;
54-
5547function getComponentsToMigrate ( requested : string [ ] ) : Set < string > {
5648 const componentsToMigrate = new Set < string > ( requested ) ;
5749 if ( componentsToMigrate . has ( 'all' ) ) {
@@ -102,10 +94,10 @@ export default function (options: Schema): Rule {
10294 const fileSystem = new DevkitFileSystem ( tree ) ;
10395 const analyzedFiles = new Set < WorkspacePath > ( ) ;
10496 const componentsToMigrate = getComponentsToMigrate ( options . components ) ;
105- const migrators = MIGRATORS . filter ( m => componentsToMigrate . has ( m . component ) ) . concat (
106- // The typography hierarchy should always be migrated.
107- TYPOGRAPHY_HIERARCHY_MIGRATOR ,
108- ) ;
97+ const migrators = [
98+ ... MIGRATORS . filter ( m => componentsToMigrate . has ( m . component ) ) ,
99+ ... PERMANENT_MIGRATORS ,
100+ ] ;
109101 let success = true ;
110102
111103 if ( options . directory ) {
0 commit comments