diff --git a/projects/cdk/schematics/index.ts b/projects/cdk/schematics/index.ts index caac2f58b6c3..1d8596466663 100644 --- a/projects/cdk/schematics/index.ts +++ b/projects/cdk/schematics/index.ts @@ -7,7 +7,6 @@ export * from './ng-add/schema'; export * from './utils/add-import-to-closest-module'; export * from './utils/add-unique-import'; export * from './utils/angular-json-manipulations'; -export * from './utils/colored-log'; export * from './utils/create-angular-json'; export * from './utils/get-component-from-identifier'; export * from './utils/get-execution-time'; diff --git a/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts b/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts index 4fcb0089fb02..d8f77ad2cdff 100644 --- a/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts +++ b/projects/cdk/schematics/ng-update/steps/icons/replace-imports.ts @@ -1,9 +1,8 @@ -import {getImports, Node} from 'ng-morph'; +import {getImports, Node, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog} from 'ng-morph'; import {ALL_TS_FILES} from '../../../constants'; import type {TuiSchema} from '../../../ng-add/schema'; import {addUniqueImport} from '../../../utils/add-unique-import'; -import {SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog} from '../../../utils/colored-log'; import {removeImport} from '../../../utils/import-manipulations'; import {setupProgressLogger} from '../../../utils/progress'; import type {ReplacementIdentifier} from '../../interfaces/replacement-identifier'; diff --git a/projects/cdk/schematics/ng-update/steps/remove-module.ts b/projects/cdk/schematics/ng-update/steps/remove-module.ts index a6055839af3d..2c9bcf400818 100644 --- a/projects/cdk/schematics/ng-update/steps/remove-module.ts +++ b/projects/cdk/schematics/ng-update/steps/remove-module.ts @@ -1,13 +1,13 @@ -import {Node} from 'ng-morph'; - -import type {TuiSchema} from '../../ng-add/schema'; import { infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../ng-add/schema'; import {getNamedImportReferences} from '../../utils/get-named-import-references'; import {removeImport} from '../../utils/import-manipulations'; import type {RemovedModule} from '../interfaces/removed-module'; diff --git a/projects/cdk/schematics/ng-update/steps/rename-types.ts b/projects/cdk/schematics/ng-update/steps/rename-types.ts index ff931ce5ecf7..d409ba1d0e49 100644 --- a/projects/cdk/schematics/ng-update/steps/rename-types.ts +++ b/projects/cdk/schematics/ng-update/steps/rename-types.ts @@ -1,16 +1,17 @@ import type {ImportSpecifier} from 'ng-morph'; -import {getImports, Node} from 'ng-morph'; -import type {TypeNode} from 'ts-morph'; - -import type {TuiSchema} from '../../ng-add/schema'; -import {addUniqueImport} from '../../utils/add-unique-import'; import { + getImports, infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../utils/colored-log'; +} from 'ng-morph'; +import type {TypeNode} from 'ts-morph'; + +import type {TuiSchema} from '../../ng-add/schema'; +import {addUniqueImport} from '../../utils/add-unique-import'; import {getNamedImportReferences} from '../../utils/get-named-import-references'; import {removeImport, renameImport} from '../../utils/import-manipulations'; import type {ReplacementType} from '../interfaces/replacement-type'; diff --git a/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts b/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts index bf5ac563433e..373cbd21a3cd 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-deep-import.ts @@ -1,14 +1,15 @@ -import {editImports, getImports} from 'ng-morph'; - -import {ALL_TS_FILES} from '../../constants'; -import type {TuiSchema} from '../../ng-add/schema'; import { + editImports, + getImports, infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../utils/colored-log'; +} from 'ng-morph'; + +import {ALL_TS_FILES} from '../../constants'; +import type {TuiSchema} from '../../ng-add/schema'; const DEEP_REGEX = /(@taiga-ui\/\w+)\/.*/; diff --git a/projects/cdk/schematics/ng-update/steps/replace-enums.ts b/projects/cdk/schematics/ng-update/steps/replace-enums.ts index 28a5a688d29a..e9dd39c71509 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-enums.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-enums.ts @@ -1,14 +1,14 @@ import type {ImportSpecifier, VariableDeclaration} from 'ng-morph'; -import {Node} from 'ng-morph'; - -import type {TuiSchema} from '../../ng-add/schema'; import { infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../ng-add/schema'; import {getNamedImportReferences} from '../../utils/get-named-import-references'; import {removeImport} from '../../utils/import-manipulations'; import type {ReplacementEnum} from '../interfaces/replacement-enum'; diff --git a/projects/cdk/schematics/ng-update/steps/replace-identifier.ts b/projects/cdk/schematics/ng-update/steps/replace-identifier.ts index 6adfc5ed9c15..fefee3eb4ba5 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-identifier.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-identifier.ts @@ -1,14 +1,15 @@ -import {Node, ts} from 'ng-morph'; - -import type {TuiSchema} from '../../ng-add/schema'; -import {addUniqueImport} from '../../utils/add-unique-import'; import { infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../utils/colored-log'; + ts, +} from 'ng-morph'; + +import type {TuiSchema} from '../../ng-add/schema'; +import {addUniqueImport} from '../../utils/add-unique-import'; import {getNamedImportReferences} from '../../utils/get-named-import-references'; import {removeImport} from '../../utils/import-manipulations'; import {setupProgressLogger} from '../../utils/progress'; diff --git a/projects/cdk/schematics/ng-update/steps/replace-services.ts b/projects/cdk/schematics/ng-update/steps/replace-services.ts index 369597aab872..6990232ff2ed 100644 --- a/projects/cdk/schematics/ng-update/steps/replace-services.ts +++ b/projects/cdk/schematics/ng-update/steps/replace-services.ts @@ -1,17 +1,18 @@ import type {PropertyAccessExpression, TypeReferenceNode} from 'ng-morph'; -import {Node, SyntaxKind} from 'ng-morph'; - -import type {TuiSchema} from '../../ng-add/schema'; -import {addUniqueImport} from '../../utils/add-unique-import'; import { infoLog, + Node, PROCESSING_SYMBOL, processLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../utils/colored-log'; + SyntaxKind, +} from 'ng-morph'; + +import type {TuiSchema} from '../../ng-add/schema'; +import {addUniqueImport} from '../../utils/add-unique-import'; import {getNamedImportReferences} from '../../utils/get-named-import-references'; import {removeImport} from '../../utils/import-manipulations'; import type {ReplacementService} from '../interfaces/replacement-service'; diff --git a/projects/cdk/schematics/ng-update/v4/index.ts b/projects/cdk/schematics/ng-update/v4/index.ts index 5a848a06f141..bdc5b8c9c624 100644 --- a/projects/cdk/schematics/ng-update/v4/index.ts +++ b/projects/cdk/schematics/ng-update/v4/index.ts @@ -3,11 +3,10 @@ import {performance} from 'node:perf_hooks'; import type {Rule, SchematicContext, Tree} from '@angular-devkit/schematics'; import {chain} from '@angular-devkit/schematics'; import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks'; -import {saveActiveProject} from 'ng-morph'; +import {FINISH_SYMBOL, saveActiveProject, START_SYMBOL, titleLog} from 'ng-morph'; import {TAIGA_VERSION} from '../../ng-add/constants/versions'; import type {TuiSchema} from '../../ng-add/schema'; -import {FINISH_SYMBOL, START_SYMBOL, titleLog} from '../../utils/colored-log'; import {getExecutionTime} from '../../utils/get-execution-time'; import { removeModules, diff --git a/projects/cdk/schematics/ng-update/v4/migrate-addon-doc/index.ts b/projects/cdk/schematics/ng-update/v4/migrate-addon-doc/index.ts index 7e6c756cdf1d..313515bfa037 100644 --- a/projects/cdk/schematics/ng-update/v4/migrate-addon-doc/index.ts +++ b/projects/cdk/schematics/ng-update/v4/migrate-addon-doc/index.ts @@ -1,16 +1,18 @@ import type {Rule, SchematicContext, Tree} from '@angular-devkit/schematics'; import {chain} from '@angular-devkit/schematics'; -import {getPackageJsonDependency, getSourceFiles, saveActiveProject} from 'ng-morph'; - -import {ALL_TS_FILES} from '../../../constants/file-globs'; -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, + getPackageJsonDependency, + getSourceFiles, infoLog, REPLACE_SYMBOL, + saveActiveProject, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import {ALL_TS_FILES} from '../../../constants/file-globs'; +import type {TuiSchema} from '../../../ng-add/schema'; import {renameTypes, replaceIdentifiers} from '../../steps'; import {removeModules} from '../../steps/remove-module'; import {getFileSystem} from '../../utils/get-file-system'; diff --git a/projects/cdk/schematics/ng-update/v4/migrate-css-vars/index.ts b/projects/cdk/schematics/ng-update/v4/migrate-css-vars/index.ts index bf9b640ad610..8148d64503a4 100644 --- a/projects/cdk/schematics/ng-update/v4/migrate-css-vars/index.ts +++ b/projects/cdk/schematics/ng-update/v4/migrate-css-vars/index.ts @@ -1,15 +1,15 @@ import type {Rule, SchematicContext, Tree} from '@angular-devkit/schematics'; import {chain} from '@angular-devkit/schematics'; -import {saveActiveProject} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, infoLog, REPLACE_SYMBOL, + saveActiveProject, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; import {getFileSystem} from '../../utils/get-file-system'; import {renameCssVars} from './rename-css-vars'; 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 beba74904024..3c91a5bb0882 100644 --- a/projects/cdk/schematics/ng-update/v4/migrate-icons/index.ts +++ b/projects/cdk/schematics/ng-update/v4/migrate-icons/index.ts @@ -1,15 +1,16 @@ import type {Rule, SchematicContext, Tree} from '@angular-devkit/schematics'; import {chain} from '@angular-devkit/schematics'; -import {getPackageJsonDependency, saveActiveProject} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, + getPackageJsonDependency, infoLog, REPLACE_SYMBOL, + saveActiveProject, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; import {getFileSystem} from '../../utils/get-file-system'; import {renameIcons} from './rename-icons'; import {renameProprietaryIcons} from './rename-proprietary-icons'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/drop-universal-mock.ts b/projects/cdk/schematics/ng-update/v4/steps/drop-universal-mock.ts index e2a9d3863ced..e1d4ed25a7ad 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/drop-universal-mock.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/drop-universal-mock.ts @@ -1,14 +1,14 @@ -import {getImports} from 'ng-morph'; - -import {ALL_TS_FILES} from '../../../constants/file-globs'; -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, + getImports, infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import {ALL_TS_FILES} from '../../../constants/file-globs'; +import type {TuiSchema} from '../../../ng-add/schema'; export function dropUniversalMock(options: TuiSchema): void { const moduleSpecifier = '@ng-web-apis/universal/mocks'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-alert-service.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-alert-service.ts index a89e694dccc2..2561b93b1786 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-alert-service.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-alert-service.ts @@ -1,15 +1,16 @@ import type {ObjectLiteralExpression, PropertyAccessExpression} from 'ng-morph'; -import {Node, SyntaxKind} from 'ng-morph'; -import type {CallExpression, ObjectLiteralElementLike} from 'ts-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; import { infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../../utils/colored-log'; + SyntaxKind, +} from 'ng-morph'; +import type {CallExpression, ObjectLiteralElementLike} from 'ts-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; const OPTIONS_MIGRATIONS: Record< diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts index 17e1fe7bdf3a..7a823998862f 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-all-country-iso-codes.ts @@ -1,14 +1,14 @@ -import {SyntaxKind} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; -import {addUniqueImport} from '../../../utils/add-unique-import'; import { FINISH_SYMBOL, infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, + SyntaxKind, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; +import {addUniqueImport} from '../../../utils/add-unique-import'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; export function migrateAllCountryIsoCodes(options: TuiSchema): void { diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts index a9f272c0ac3a..afaad1ec2af2 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-destroy-service.ts @@ -1,15 +1,16 @@ -import {Node, SyntaxKind} from 'ng-morph'; -import type {CallExpression} from 'ts-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; -import {addUniqueImport} from '../../../utils/add-unique-import'; import { FINISH_SYMBOL, infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, + SyntaxKind, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; +import type {CallExpression} from 'ts-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; +import {addUniqueImport} from '../../../utils/add-unique-import'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; import {removeImport} from '../../../utils/import-manipulations'; import {insertTodo} from '../../../utils/insert-todo'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts index e81cbecee883..b04864227a86 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-editor.ts @@ -1,16 +1,18 @@ /// import type {DevkitFileSystem} from 'ng-morph'; -import {getPackageJsonDependency, getSourceFiles, saveActiveProject} from 'ng-morph'; - -import {ALL_TS_FILES} from '../../../constants/file-globs'; -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, + getPackageJsonDependency, + getSourceFiles, infoLog, REPLACE_SYMBOL, + saveActiveProject, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import {ALL_TS_FILES} from '../../../constants/file-globs'; +import type {TuiSchema} from '../../../ng-add/schema'; import {replaceIdentifiers} from '../../steps/replace-identifier'; import {replacePackageName} from '../../steps/replace-package-name'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts index b8d81e168719..9f579064a36b 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-legacy-mask.ts @@ -1,14 +1,14 @@ -import {Node} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; -import {addUniqueImport} from '../../../utils/add-unique-import'; import { FINISH_SYMBOL, infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; +import {addUniqueImport} from '../../../utils/add-unique-import'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; import {removeImport} from '../../../utils/import-manipulations'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-month-context.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-month-context.ts index 041be92bdaf3..e01695350d12 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-month-context.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-month-context.ts @@ -1,15 +1,15 @@ import type {ImportSpecifier} from 'ng-morph'; -import {SyntaxKind} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; -import {addUniqueImport} from '../../../utils/add-unique-import'; import { FINISH_SYMBOL, infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, + SyntaxKind, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; +import {addUniqueImport} from '../../../utils/add-unique-import'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; import {removeImport} from '../../../utils/import-manipulations'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-number-format-settings.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-number-format-settings.ts index 87c19f3753f8..ee3397b044b6 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-number-format-settings.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-number-format-settings.ts @@ -1,14 +1,15 @@ -import {Node, SyntaxKind} from 'ng-morph'; -import type {ObjectLiteralElementLike} from 'ts-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; import { infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../../utils/colored-log'; + SyntaxKind, +} from 'ng-morph'; +import type {ObjectLiteralElementLike} from 'ts-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; const OPTIONS_MIGRATIONS: Record< diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts index 32c7ef1b7793..2ce3a4250dc5 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-option-providers.ts @@ -1,14 +1,14 @@ import type {ObjectLiteralElementLike} from 'ng-morph'; -import {Node} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; import {insertTodo} from '../../../utils/insert-todo'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts index 8d27e4a0b413..18bab6b21f3b 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-proprietary.ts @@ -4,13 +4,15 @@ import { addPackageJsonDependency, getActiveProject, getPackageJsonDependency, + infoLog, removePackageJsonDependency, + REPLACE_SYMBOL, saveActiveProject, + SMALL_TAB_SYMBOL, } from 'ng-morph'; import {TUI_VERSION} from '../../../../constants/version'; import type {TuiSchema} from '../../../ng-add/schema'; -import {infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL} from '../../../utils/colored-log'; export function migrateProprietary( fileSystem: DevkitFileSystem, diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-providers-from.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-providers-from.ts index b7dacaa62925..434d8d0852af 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-providers-from.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-providers-from.ts @@ -1,7 +1,6 @@ -import {Node} from 'ng-morph'; +import {infoLog, Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL} from 'ng-morph'; import type {TuiSchema} from '../../../ng-add/schema'; -import {infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL} from '../../../utils/colored-log'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; export function migrateImportProvidersFrom(options: TuiSchema): void { diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-root.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-root.ts index 4abe495ba974..50ec0a7a6fd5 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-root.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-root.ts @@ -4,12 +4,14 @@ import { getActiveProject, getNgModules, getPackageJsonDependency, + infoLog, Node, + REPLACE_SYMBOL, + SMALL_TAB_SYMBOL, } from 'ng-morph'; import type {TuiSchema} from '../../../ng-add/schema'; import {addUniqueImport} from '../../../utils/add-unique-import'; -import {infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL} from '../../../utils/colored-log'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; import {removeImport} from '../../../utils/import-manipulations'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts b/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts index 06e7d6857420..cfea70ee7f46 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/migrate-templates.ts @@ -1,15 +1,15 @@ import type {DevkitFileSystem, UpdateRecorder} from 'ng-morph'; - -import {ALL_TS_FILES} from '../../../constants'; -import type {TuiSchema} from '../../../ng-add/schema'; -import {saveAddedImports} from '../../../utils/add-import-to-closest-module'; import { infoLog, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import {ALL_TS_FILES} from '../../../constants'; +import type {TuiSchema} from '../../../ng-add/schema'; +import {saveAddedImports} from '../../../utils/add-import-to-closest-module'; import {setupProgressLogger} from '../../../utils/progress'; import {getComponentTemplates} from '../../../utils/templates/get-component-templates'; import {getPathFromTemplateResource} from '../../../utils/templates/template-resource'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/remove-duplicates.ts b/projects/cdk/schematics/ng-update/v4/steps/remove-duplicates.ts index 00cb97e5772d..4225365c13c9 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/remove-duplicates.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/remove-duplicates.ts @@ -1,14 +1,16 @@ -import {getClasses, getDecorators, Node} from 'ng-morph'; - -import {ALL_TS_FILES} from '../../../constants'; -import type {TuiSchema} from '../../../ng-add/schema'; import { + getClasses, + getDecorators, infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import {ALL_TS_FILES} from '../../../constants'; +import type {TuiSchema} from '../../../ng-add/schema'; export function removeDuplicates(options: TuiSchema): void { !options['skip-logs'] && diff --git a/projects/cdk/schematics/ng-update/v4/steps/restore-tui-mapper.ts b/projects/cdk/schematics/ng-update/v4/steps/restore-tui-mapper.ts index 955757dd95d1..b6989b7aa2b3 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/restore-tui-mapper.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/restore-tui-mapper.ts @@ -1,13 +1,13 @@ -import {Node} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; import {replaceIdentifier} from '../../steps/replace-identifier'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/restore-tui-matcher.ts b/projects/cdk/schematics/ng-update/v4/steps/restore-tui-matcher.ts index 13eb7f525ffa..945a1075545d 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/restore-tui-matcher.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/restore-tui-matcher.ts @@ -1,13 +1,13 @@ -import {Node} from 'ng-morph'; - -import type {TuiSchema} from '../../../ng-add/schema'; import { FINISH_SYMBOL, infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, titleLog, -} from '../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../ng-add/schema'; import {getNamedImportReferences} from '../../../utils/get-named-import-references'; import {replaceIdentifier} from '../../steps/replace-identifier'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts b/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts index 15c8332ee3df..be21ae42a5b2 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/update-packages.ts @@ -2,6 +2,7 @@ import type {DevkitFileSystem} from 'ng-morph'; import { addPackageJsonDependency, + errorLog, getImports, getPackageJsonDependency, removePackageJsonDependency, @@ -9,7 +10,6 @@ import { import {TUI_VERSION} from '../../../../constants/version'; import {ALL_TS_FILES} from '../../../constants'; -import {errorLog} from '../../../utils/colored-log'; import {replacePackageName} from '../../steps'; export const TUI_POLYMORPHEUS_VERSION = '^4.7.3'; diff --git a/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts b/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts index 44fb83a08967..f870f06560a7 100644 --- a/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts +++ b/projects/cdk/schematics/ng-update/v4/steps/utils/replace-modules-with-providers.ts @@ -3,18 +3,16 @@ import { addProviderToNgModule, getNgComponents, getNgModules, - Node, -} from 'ng-morph'; - -import type {TuiSchema} from '../../../../ng-add/schema'; -import {addUniqueImport} from '../../../../utils/add-unique-import'; -import { infoLog, + Node, REPLACE_SYMBOL, SMALL_TAB_SYMBOL, SUCCESS_SYMBOL, successLog, -} from '../../../../utils/colored-log'; +} from 'ng-morph'; + +import type {TuiSchema} from '../../../../ng-add/schema'; +import {addUniqueImport} from '../../../../utils/add-unique-import'; import {getNamedImportReferences} from '../../../../utils/get-named-import-references'; import {removeImport} from '../../../../utils/import-manipulations'; import type {ModuleToReplace, ProviderToReplace} from '../constants/modules-to-replace'; diff --git a/projects/cdk/schematics/utils/colored-log.ts b/projects/cdk/schematics/utils/colored-log.ts deleted file mode 100644 index bc91e989797a..000000000000 --- a/projects/cdk/schematics/utils/colored-log.ts +++ /dev/null @@ -1,26 +0,0 @@ -export function processLog(message: string): void { - console.info('\x1B[36m%s\x1B[0m', message); -} - -export function errorLog(message: string): void { - console.info('\x1B[31m%s\x1B[0m', message); -} - -export function successLog(message: string): void { - console.info('\x1B[32m%s\x1B[0m', message); -} - -export function infoLog(message: string): void { - console.info('\x1B[34m%s\x1B[0m', message); -} - -export function titleLog(message: string): void { - console.info('\x1B[35m', message); -} - -export const SMALL_TAB_SYMBOL = ' '; // @note: if you use \t then we have big gaps -export const START_SYMBOL = '🚀'; -export const FINISH_SYMBOL = '🏆'; -export const REPLACE_SYMBOL = '⚡️'; -export const PROCESSING_SYMBOL = '> '; -export const SUCCESS_SYMBOL = '✅ '; diff --git a/projects/cdk/schematics/utils/progress.ts b/projects/cdk/schematics/utils/progress.ts index aa6ddabee641..8a91a448de90 100644 --- a/projects/cdk/schematics/utils/progress.ts +++ b/projects/cdk/schematics/utils/progress.ts @@ -1,7 +1,8 @@ /// import {clearLine, cursorTo} from 'node:readline'; -import {SMALL_TAB_SYMBOL, SUCCESS_SYMBOL} from './colored-log'; +import {SMALL_TAB_SYMBOL, SUCCESS_SYMBOL} from 'ng-morph'; + import {tuiIsCI} from './is-ci'; export function setupProgressLogger({ diff --git a/projects/demo/src/modules/app/server-error-handler.ts b/projects/demo/src/modules/app/server-error-handler.ts index 14492aacbdd8..fbcd8bc1ee79 100644 --- a/projects/demo/src/modules/app/server-error-handler.ts +++ b/projects/demo/src/modules/app/server-error-handler.ts @@ -1,8 +1,7 @@ import {Location} from '@angular/common'; import type {ErrorHandler} from '@angular/core'; import {inject, Injectable} from '@angular/core'; -// eslint-disable-next-line @taiga-ui/experience/no-deep-imports -import {errorLog} from '@taiga-ui/cdk/schematics/utils/colored-log'; +import {errorLog} from 'ng-morph'; // TODO const KNOWN_ISSUES: string[] = [ diff --git a/scripts/generate-demo-routes-file.ts b/scripts/generate-demo-routes-file.ts index ff67e1305cc8..7d3c9a414c70 100644 --- a/scripts/generate-demo-routes-file.ts +++ b/scripts/generate-demo-routes-file.ts @@ -2,11 +2,8 @@ import {readFileSync, writeFileSync} from 'node:fs'; import {join} from 'node:path'; -import { - infoLog, - SMALL_TAB_SYMBOL, - titleLog, -} from '../projects/cdk/schematics/utils/colored-log'; +import {infoLog, SMALL_TAB_SYMBOL, titleLog} from 'ng-morph'; + import {DemoRoute} from '../projects/demo/src/modules/app/demo-routes'; const EXCEPTIONS = [ diff --git a/scripts/publish-canary.ts b/scripts/publish-canary.ts index ac49a1f8c69a..03e314497555 100644 --- a/scripts/publish-canary.ts +++ b/scripts/publish-canary.ts @@ -1,7 +1,8 @@ import {resolve} from 'node:path'; +import {infoLog} from 'ng-morph'; + import {version} from '../package.json'; -import {infoLog} from '../projects/cdk/schematics/utils/colored-log'; import {execute} from './shared/execute'; import {IGNORABLE_TAIGA_PACKAGES} from './shared/ignorable-packages'; import {overwriteVersion} from './shared/overwrite-version'; diff --git a/scripts/publish.ts b/scripts/publish.ts index 02545d5c2c6f..d85cca356b39 100644 --- a/scripts/publish.ts +++ b/scripts/publish.ts @@ -1,10 +1,7 @@ import {resolve} from 'node:path'; -import { - errorLog, - infoLog, - successLog, -} from '../projects/cdk/schematics/utils/colored-log'; +import {errorLog, infoLog, successLog} from 'ng-morph'; + import {getValueByFlag} from './shared/argv.utils'; import {execute} from './shared/execute'; import {getAllTags} from './shared/get-all-tags'; diff --git a/scripts/release.ts b/scripts/release.ts index 2534c6fbca41..a442c00c9a69 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -1,5 +1,6 @@ +import {infoLog} from 'ng-morph'; + import {version} from '../package.json'; -import {infoLog} from '../projects/cdk/schematics/utils/colored-log'; import {getValueByFlag, hasFlag} from './shared/argv.utils'; import {bumpVersion} from './shared/bump-version'; import {checkChangelogBeforePush} from './shared/check-changelog-before-push'; diff --git a/scripts/shared/argv.utils.ts b/scripts/shared/argv.utils.ts index ed58914d08b0..17748fd8a1bd 100644 --- a/scripts/shared/argv.utils.ts +++ b/scripts/shared/argv.utils.ts @@ -1,6 +1,6 @@ import process from 'node:process'; -import {processLog} from '../../projects/cdk/schematics/utils/colored-log'; +import {processLog} from 'ng-morph'; export function getValueByFlag(flag: string, fallback: T): T { const index = findIndexFlag(flag); diff --git a/scripts/shared/execute.ts b/scripts/shared/execute.ts index cb414c8a1189..f09af4e47c03 100644 --- a/scripts/shared/execute.ts +++ b/scripts/shared/execute.ts @@ -1,7 +1,7 @@ import type {CommonExecOptions} from 'node:child_process'; import {execSync} from 'node:child_process'; -import {infoLog} from '../../projects/cdk/schematics/utils/colored-log'; +import {infoLog} from 'ng-morph'; export function execute(shell: string, options?: Partial): string { infoLog(`ᐅ ${shell}`); diff --git a/scripts/shared/sync-versions.ts b/scripts/shared/sync-versions.ts index b08efe7c9359..77b572d09dba 100644 --- a/scripts/shared/sync-versions.ts +++ b/scripts/shared/sync-versions.ts @@ -1,8 +1,8 @@ import {readFileSync, writeFileSync} from 'node:fs'; import {glob} from 'glob'; +import {processLog, successLog} from 'ng-morph'; -import {processLog, successLog} from '../../projects/cdk/schematics/utils/colored-log'; import {updatePackageJsonStructure} from './update-package-json-structure'; const INDENTATION = 4;