diff --git a/projects/cdk/schematics/ng-update/v4/migrate-icons/index.ts b/projects/cdk/schematics/ng-update/v4/migrate-icons/index.ts
index 69dfa0986ea1..3f1756d7e389 100644
--- a/projects/cdk/schematics/ng-update/v4/migrate-icons/index.ts
+++ b/projects/cdk/schematics/ng-update/v4/migrate-icons/index.ts
@@ -12,21 +12,21 @@ import {
} from '../../../utils/colored-log';
import {getFileSystem} from '../../utils/get-file-system';
import {renameIcons} from './rename-icons';
+import {renameProprietaryIcons} from './rename-proprietary-icons';
export function migrateIcons(options: TuiSchema): Rule {
return chain([
(tree: Tree, _: SchematicContext) => {
- if (hasProprietaryIcons(tree)) {
- // TODO: add proprietary-icons migration
-
- return;
- }
-
const fileSystem = getFileSystem(tree);
!options['skip-logs'] &&
- infoLog(`${SMALL_TAB_SYMBOL}${REPLACE_SYMBOL} replacing strings...`);
- renameIcons();
+ infoLog(`${SMALL_TAB_SYMBOL}${REPLACE_SYMBOL} replacing icons...`);
+
+ if (hasProprietaryIcons(tree)) {
+ renameProprietaryIcons();
+ } else {
+ renameIcons();
+ }
fileSystem.commitEdits();
saveActiveProject();
diff --git a/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.ts b/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.ts
new file mode 100644
index 000000000000..a900bd654e2c
--- /dev/null
+++ b/projects/cdk/schematics/ng-update/v4/migrate-icons/rename-proprietary-icons.ts
@@ -0,0 +1,34 @@
+///
+import {getSourceFiles} from 'ng-morph';
+
+import {ALL_FILES} from '../../../constants';
+
+export function renameProprietaryIcons(pattern = ALL_FILES): void {
+ const sourceFiles = getSourceFiles(pattern);
+
+ sourceFiles.forEach(file => {
+ let text = file.getFullText();
+
+ const regex = /\btuiIcon(?!Button\b)[A-Z][a-zA-Z0-9]*\b/g;
+
+ text = text.replaceAll(regex, match => convertString(match));
+
+ file.replaceWithText(text);
+ });
+}
+
+function convertString(input: string): string {
+ const result = input
+ .replace(/^tuiIconTds/, '')
+ .replace(/SmallPragmatic$/, '')
+ .replace(/MediumPragmatic$/, '')
+ .replace(/Small$/, '')
+ .replace(/Medium$/, '')
+ .replaceAll(/([A-Z0-9])/g, '-$1')
+ .toLowerCase();
+
+ const pack = input.includes('Pragmatic') ? 'pragmatic' : 'fancy';
+ const size = input.includes('Medium') ? 'medium' : 'small';
+
+ return `@tui.${pack}.${size}.${result.startsWith('-') ? result.slice(1) : result}`;
+}
diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/identifiers-to-replace.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/identifiers-to-replace.ts
index 01cfc3e5bce6..e7ea3686c0ad 100644
--- a/projects/cdk/schematics/ng-update/v4/steps/constants/identifiers-to-replace.ts
+++ b/projects/cdk/schematics/ng-update/v4/steps/constants/identifiers-to-replace.ts
@@ -498,6 +498,10 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
from: {name: 'TuiPortalModule', moduleSpecifier: '@taiga-ui/cdk'},
to: {name: 'TuiDropdownPortal', moduleSpecifier: '@taiga-ui/core'},
},
+ {
+ from: {name: 'TuiDropdownModule', moduleSpecifier: '@taiga-ui/core'},
+ to: {name: 'TuiDropdown', moduleSpecifier: '@taiga-ui/core'},
+ },
{
from: {name: 'TuiDroppableModule', moduleSpecifier: '@taiga-ui/cdk'},
to: {name: 'TuiDroppable', moduleSpecifier: '@taiga-ui/cdk'},
@@ -696,6 +700,20 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
moduleSpecifier: '@taiga-ui/core',
},
},
+ {
+ from: {name: 'TUI_ARROW', moduleSpecifier: '@taiga-ui/kit'},
+ to: {
+ name: 'TUI_ARROW',
+ moduleSpecifier: '@taiga-ui/legacy',
+ },
+ },
+ {
+ from: {name: 'TuiArrowComponent', moduleSpecifier: '@taiga-ui/kit'},
+ to: {
+ name: 'TuiArrowComponent',
+ moduleSpecifier: '@taiga-ui/legacy',
+ },
+ },
{
from: {name: 'TuiDialogModule', moduleSpecifier: '@taiga-ui/core'},
to: {
diff --git a/projects/cdk/schematics/ng-update/v4/steps/constants/migration-warnings.ts b/projects/cdk/schematics/ng-update/v4/steps/constants/migration-warnings.ts
index a7976595ed4b..27ce962ab191 100644
--- a/projects/cdk/schematics/ng-update/v4/steps/constants/migration-warnings.ts
+++ b/projects/cdk/schematics/ng-update/v4/steps/constants/migration-warnings.ts
@@ -150,4 +150,10 @@ export const MIGRATION_WARNINGS: MigrationWarning[] = [
message:
'TUI_INPUT_NUMBER_OPTIONS "precision" and "decimal" have been moved to TUI_FORMAT_NUMBER_OPTIONS. See https://taiga-ui.dev/components/input-number#options ',
},
+ {
+ name: 'TUI_ARROW',
+ moduleSpecifier: '@taiga-ui/kit',
+ message:
+ 'TUI_ARROW is deprecated, Use tuiChevron directive instead. See example https://taiga-ui.dev/components/data-list#links',
+ },
];
diff --git a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-icons.spec.ts b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-icons.spec.ts
index cfa7b4e0f568..1242946c85fe 100644
--- a/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-icons.spec.ts
+++ b/projects/cdk/schematics/ng-update/v4/tests/schematic-migrate-icons.spec.ts
@@ -59,6 +59,32 @@ const TEMPLATE_AFTER = `
`;
+const PROPRIETARY_TEMPLATE_BEFORE = `
+
+
+
+
+`;
+
+const PROPRIETARY_TEMPLATE_AFTER = `
+
+
+
+
+`;
+
describe('ng-update', () => {
let host: UnitTestTree;
let runner: SchematicTestRunner;
@@ -94,6 +120,26 @@ describe('ng-update', () => {
expect(tree.readContent('test/app/test.component.ts')).toEqual(COMPONENT_AFTER);
});
+ it('should migrate proprietary icons in ts files', async () => {
+ createSourceFile(
+ 'package.json',
+ '{"dependencies": {"@angular/core": "~13.0.0", "@taiga-ui/proprietary-icons": "~3.42.0"}}',
+ {overwrite: true},
+ );
+
+ saveActiveProject();
+
+ const tree = await runner.runSchematic(
+ 'migrateIconsV4',
+ {'skip-logs': process.env['TUI_CI'] === 'true'} as Partial,
+ host,
+ );
+
+ expect(tree.readContent('test/app/proprietary-test.template.html')).toEqual(
+ PROPRIETARY_TEMPLATE_AFTER,
+ );
+ });
+
afterEach(() => {
resetActiveProject();
});
@@ -104,6 +150,11 @@ function createMainFiles(): void {
createSourceFile('test/app/test.template.html', TEMPLATE_BEFORE);
+ createSourceFile(
+ 'test/app/proprietary-test.template.html',
+ PROPRIETARY_TEMPLATE_BEFORE,
+ );
+
createSourceFile(
'package.json',
'{"dependencies": {"@angular/core": "~13.0.0", "@taiga-ui/addon-commerce": "~3.42.0"}}',