Skip to content

Commit

Permalink
chore: add some name migrations (#7927)
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirpotekhin authored Jun 25, 2024
1 parent c64beba commit 95d487d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const ATTRS_TO_DIRECTIVE_REPLACE: ReplacementAttributeToDirective[] = [
inputProperty: 'showLoader',
directive: 'loading',
directiveModule: {
name: 'TuiButtonLoadingComponent',
name: 'TuiButtonLoading',
moduleSpecifier: '@taiga-ui/kit',
},
filterFn: el => hasElementAttribute(el, 'tuiButton'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,10 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
},
{
from: {name: 'TuiSwipeActionsModule', moduleSpecifier: '@taiga-ui/experimental'},
to: {name: 'TuiSwipeActionsComponent', moduleSpecifier: '@taiga-ui/addon-mobile'},
to: [
{name: 'TuiSwipeActions', moduleSpecifier: '@taiga-ui/addon-mobile'},
{name: 'TuiSwipeActionsAutoClose', moduleSpecifier: '@taiga-ui/addon-mobile'},
],
},
{
from: {name: 'TuiRadioModule', moduleSpecifier: '@taiga-ui/experimental'},
Expand All @@ -382,6 +385,10 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
from: {name: 'TuiToggleModule', moduleSpecifier: '@taiga-ui/experimental'},
to: {name: 'TuiSwitch', moduleSpecifier: '@taiga-ui/kit'},
},
{
from: {name: 'TuiToggleModule', moduleSpecifier: '@taiga-ui/kit'},
to: {name: 'TuiSwitch', moduleSpecifier: '@taiga-ui/kit'},
},
{
from: {name: 'TuiTextAreaModule', moduleSpecifier: '@taiga-ui/kit'},
to: {name: 'TuiTextareaModule', moduleSpecifier: '@taiga-ui/kit'},
Expand Down Expand Up @@ -451,6 +458,10 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
from: {name: 'TUI_SCROLL_REF', moduleSpecifier: '@taiga-ui/cdk'},
to: {name: 'TUI_SCROLL_REF', moduleSpecifier: '@taiga-ui/core'},
},
{
from: {name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/cdk'},
to: {name: 'TUI_SANITIZER', moduleSpecifier: '@taiga-ui/legacy'},
},
{
from: {name: 'TuiScrollbarModule', moduleSpecifier: '@taiga-ui/core'},
to: {name: 'TuiScrollbarComponent', moduleSpecifier: '@taiga-ui/core'},
Expand Down Expand Up @@ -589,6 +600,10 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
from: {name: 'TuiHeaderModule', moduleSpecifier: '@taiga-ui/experimental'},
to: {name: 'TuiHeader', moduleSpecifier: '@taiga-ui/layout'},
},
{
from: {name: 'TuiBlockDetailsModule', moduleSpecifier: '@taiga-ui/layout'},
to: {name: 'TuiBlockDetails', moduleSpecifier: '@taiga-ui/layout'},
},
{
from: {name: 'TuiPinModule', moduleSpecifier: '@taiga-ui/experimental'},
to: {name: 'TuiPinComponent', moduleSpecifier: '@taiga-ui/kit'},
Expand Down Expand Up @@ -670,17 +685,31 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
to: {name: 'TuiInteractiveState', moduleSpecifier: '@taiga-ui/core'},
},
{
from: {name: 'TuiButtonModule', moduleSpecifier: '@taiga-ui/kit'},
from: {name: 'TuiButtonModule', moduleSpecifier: '@taiga-ui/core'},
to: {
name: 'TuiButton',
moduleSpecifier: '@taiga-ui/kit',
moduleSpecifier: '@taiga-ui/core',
},
},
{
from: {name: 'TuiDialogModule', moduleSpecifier: '@taiga-ui/core'},
to: {
name: 'TuiDialog',
moduleSpecifier: '@taiga-ui/core',
},
},
{
from: {name: 'TuiAlertModule', moduleSpecifier: '@taiga-ui/core'},
to: {
name: 'TuiAlert',
moduleSpecifier: '@taiga-ui/core',
},
},
{
from: {name: 'TuiButtonModule', moduleSpecifier: '@taiga-ui/experimental'},
to: {
name: 'TuiButton',
moduleSpecifier: '@taiga-ui/kit',
moduleSpecifier: '@taiga-ui/core',
},
},
{
Expand Down Expand Up @@ -1135,6 +1164,26 @@ export const IDENTIFIERS_TO_REPLACE: ReplacementIdentifierMulti[] = [
moduleSpecifier: '@taiga-ui/layout',
},
},
{
from: {
name: 'TuiAppearanceModule',
moduleSpecifier: '@taiga-ui/experimental',
},
to: {
name: 'TuiAppearance',
moduleSpecifier: '@taiga-ui/core',
},
},
{
from: {
name: 'TuiButtonCloseModule',
moduleSpecifier: '@taiga-ui/experimental',
},
to: {
name: 'TuiButtonClose',
moduleSpecifier: '@taiga-ui/kit',
},
},
{
from: {
name: 'TuiPreviewModule',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
const collectionPath = join(__dirname, '../../../migration.json');

const COMPONENT_BEFORE = `
import { TuiButtonModule } from "@taiga-ui/kit";
import { TuiButtonModule } from "@taiga-ui/core";
@Component({
standalone: true,
Expand All @@ -24,12 +24,13 @@ import { TuiButtonModule } from "@taiga-ui/kit";
export class Test {
}`;

const COMPONENT_AFTER = `import { TuiButton, TuiButtonLoadingComponent } from "@taiga-ui/kit";
const COMPONENT_AFTER = `import { TuiButtonLoading } from "@taiga-ui/kit";
import { TuiButton } from "@taiga-ui/core";
@Component({
standalone: true,
templateUrl: './test.template.html',
imports: [TuiButton, TuiButtonLoadingComponent]
imports: [TuiButton, TuiButtonLoading]
})
export class Test {
}`;
Expand Down

0 comments on commit 95d487d

Please sign in to comment.