Skip to content

Commit

Permalink
chore: fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Jan 9, 2025
1 parent d5de61c commit 526aa65
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
} from 'ng-morph';

import {ALL_TS_FILES} from '../../constants';
import {swapNamedImports} from '../../utils/swap-named-imports';
import {getFileSystem} from '../utils/get-file-system';
import {replaceText} from '../utils/replace-text';

Expand All @@ -18,7 +17,6 @@ export function replacePackageName(
): void {
const fileSystem = getFileSystem(tree);

swapNamedImports(oldPackage, newPackage.name);
replaceText([{from: oldPackage, to: newPackage.name}], ALL_TS_FILES);

const old = getPackageJsonDependency(tree, oldPackage);
Expand Down
9 changes: 8 additions & 1 deletion projects/cdk/schematics/ng-update/v4/steps/migrate-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import type {DevkitFileSystem} from 'ng-morph';
import {
addProviderToNgModule,
getActiveProject,
getImports,
getNgModules,
getPackageJsonDependency,
infoLog,
Expand Down Expand Up @@ -98,7 +99,13 @@ function addProviders({
addProviderToNgModule(module, 'NG_EVENT_PLUGINS', {unique: true});
}

if (providersArray || module) {
const shouldAddImport =
(providersArray || module) &&
!getImports(path).find((name) =>
name.getText().includes('@tinkoff/ng-event-plugins'),
);

if (shouldAddImport) {
addUniqueImport(path, 'NG_EVENT_PLUGINS', '@taiga-ui/event-plugins');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ const MODULE_AFTER = `import { newProvider } from "@namespace/new";
import { tuiProvideMobileCalendar } from "@taiga-ui/addon-mobile";
import { TuiAvatar } from "@taiga-ui/kit";
import { TBANK_PROVIDERS } from "@taiga-ui/proprietary";
import { NG_EVENT_PLUGINS } from "@taiga-ui/event-plugins";
import { TuiRoot } from "@taiga-ui/core";
import { NG_EVENT_PLUGINS } from '@taiga-ui/event-plugins';
@NgModule({
imports: [TuiRoot, TuiAvatar],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,12 @@ export class Test {
}`;

const COMPONENT_AFTER = `import { TUI_SANITIZER } from "@taiga-ui/legacy";
import { TuiEditor, TuiEditorSocket, TUI_EDITOR_DEFAULT_EXTENSIONS, TUI_EDITOR_DEFAULT_TOOLS, TuiEditorTool, TUI_EDITOR_EXTENSIONS } from "@taiga-ui/editor";
import { TuiEditor, TuiEditorSocket, TUI_EDITOR_DEFAULT_EXTENSIONS, TUI_EDITOR_DEFAULT_TOOLS } from "@taiga-ui/editor";
import { TuiRoot, TuiAlert, TuiDialog } from '@taiga-ui/core';
import {NgDompurifySanitizer} from '@taiga-ui/dompurify';
import {TUI_EDITOR_EXTENSIONS} from '@taiga-ui/editor';
import {TuiEditorTool} from '@taiga-ui/editor';
@Component({
standalone: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ export class Test {
}`;

const COMPONENT_AFTER = `import { TUI_SANITIZER } from "@taiga-ui/legacy";
import { TuiEditor, TuiEditorSocket, TUI_EDITOR_DEFAULT_EXTENSIONS, TUI_EDITOR_EXTENSIONS } from "@taiga-ui/editor";
import { TuiEditor, TuiEditorSocket, TUI_EDITOR_DEFAULT_EXTENSIONS } from "@taiga-ui/editor";
import { TuiRoot, TuiAlert, TuiDialog } from '@taiga-ui/core';
import {NgDompurifySanitizer} from '@taiga-ui/dompurify';
import {TUI_EDITOR_EXTENSIONS} from '@taiga-ui/editor';
import {TuiEditorTool} from '@taiga-ui/editor';
@Component({
Expand Down
25 changes: 0 additions & 25 deletions projects/cdk/schematics/utils/swap-named-imports.ts

This file was deleted.

0 comments on commit 526aa65

Please sign in to comment.