Skip to content

Commit add21f7

Browse files
authored
feat(module:schematics): support NzTooltipModule migration (#9294)
1 parent 165b963 commit add21f7

3 files changed

Lines changed: 14 additions & 11 deletions

File tree

schematics/ng-add/setup-project/register-locale.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,10 @@ function registerLocaleInAppModule(mainFile: string, options: Schema): Rule {
118118
const localePrefix = locale.split('_')[0];
119119

120120
applyChangesToFile(host, appModulePath, [
121-
safeInsertImport(moduleSource, appModulePath, 'provideNzI18n',
122-
'ng-zorro-antd/i18n'),
123-
safeInsertImport(moduleSource, appModulePath, locale,
124-
'ng-zorro-antd/i18n'),
125-
safeInsertImport(moduleSource, appModulePath, 'registerLocaleData',
126-
'@angular/common'),
127-
safeInsertImport(moduleSource, appModulePath, localePrefix,
128-
`@angular/common/locales/${localePrefix}`, true),
121+
safeInsertImport(moduleSource, appModulePath, 'provideNzI18n', 'ng-zorro-antd/i18n'),
122+
safeInsertImport(moduleSource, appModulePath, locale, 'ng-zorro-antd/i18n'),
123+
safeInsertImport(moduleSource, appModulePath, 'registerLocaleData', '@angular/common'),
124+
safeInsertImport(moduleSource, appModulePath, localePrefix, `@angular/common/locales/${localePrefix}`, true),
129125
registerLocaleData(moduleSource, appModulePath, localePrefix),
130126
...insertI18nTokenProvide(moduleSource, appModulePath, locale)
131127
]);

schematics/ng-add/setup-project/theming.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ const defaultCustomThemeFilename = 'theme.less';
2121

2222
/** Object that maps a CLI target to its default builder name. */
2323
const defaultTargetBuilders = {
24-
build: [
25-
'@angular/build:application'
26-
],
24+
build: ['@angular/build:application'],
2725
test: ['@angular/build:karma']
2826
};
2927

schematics/ng-update/data/class-names.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,14 @@ export const classNames: VersionChanges<ClassNameUpgradeData> = {
2121
replace: 'NzTabsetComponent',
2222
replaceWith: 'NzTabsComponent'
2323
}]
24+
}, {
25+
pr: 'https://github.com/NG-ZORRO/ng-zorro-antd/pull/9285',
26+
changes: [{
27+
replace: 'NzToolTipComponent',
28+
replaceWith: 'NzTooltipComponent'
29+
}, {
30+
replace: 'NzToolTipModule',
31+
replaceWith: 'NzTooltipModule'
32+
}]
2433
}]
2534
};

0 commit comments

Comments
 (0)