Skip to content

Commit

Permalink
chore: use Note instead of TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Jan 27, 2024
1 parent be28334 commit 572f055
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion projects/cdk/schematics/ng-update/steps/show-warnings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function showWarning(
*/
referencesMeta.forEach(({sourceFile, filePath, startLinePos}) => {
logger.warn(`[WARNING] in ${filePath}: ${message}`);
sourceFile.insertText(startLinePos, `// TODO: (Taiga UI migration) ${message}\n`);
sourceFile.insertText(startLinePos, `// Note: (Taiga UI migration) ${message}\n`);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export function migrateInputRange(
!options['skip-logs'] && progressLog(componentPath);
addMinMaxLabelMethod(componentPath, MIN_LABELS_MIGRATION_METHOD_NAME, [
'const currentValue = context.$implicit;',
'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input-range',
'const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label',
'const minValue = 0; // Note: (Taiga UI migration) replace with the MIN value of the input-range',
'const minLabelText = "Min"; // Note: (Taiga UI migration) replace with the required label',
'if (currentValue === minValue) return minLabelText;',
'return String(currentValue);',
]);
Expand All @@ -136,8 +136,8 @@ export function migrateInputRange(
!options['skip-logs'] && progressLog(componentPath);
addMinMaxLabelMethod(componentPath, MAX_LABELS_MIGRATION_METHOD_NAME, [
'const currentValue = context.$implicit;',
'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
'const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label',
'const maxValue = 100; // Note: (Taiga UI migration) replace with the MAX value of the input',
'const maxLabelText = "Max"; // Note: (Taiga UI migration) replace with the required label',
'if (currentValue === maxValue) return maxLabelText;',
'return String(currentValue);',
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ function addMinMaxLabelMethod(componentPath: string): void {
parameters: [{name: 'context', type: 'TuiContextWithImplicit<number>'}],
statements: [
'const currentValue = context.$implicit;',
'const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input',
'const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label',
'const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input',
'const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label',
'const maxValue = 100; // Note: (Taiga UI migration) replace with the MAX value of the input',
'const maxLabelText = "Max"; // Note: (Taiga UI migration) replace with the required label',
'const minValue = 0; // Note: (Taiga UI migration) replace with the MIN value of the input',
'const minLabelText = "Min"; // Note: (Taiga UI migration) replace with the required label',
'if (currentValue === maxValue) return maxLabelText;',
'if (currentValue === minValue) return minLabelText;',
'return String(currentValue);',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const TUI_WARNING_NORMALIZE = `
// If you're looking to use reset styles or you can write your own reset.css`;

export const TUI_WARNING_WRAPPER_MIXINS =
'// TODO: (Taiga UI migration): use mixins to customize tuiWrapper. See https://taiga-ui.dev/wrapper';
'// Note: (Taiga UI migration): use mixins to customize tuiWrapper. See https://taiga-ui.dev/wrapper';

export function replaceStyles(): void {
getActiveProject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ export class AppComponent {
this.other.getFormattedDay("DMY", ".");
// TODO: (Taiga UI migration) getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet
// Note: (Taiga UI migration) getDayFromMonthRowCol has been removed in 3.0. If you need this utils check out this pipe https://github.com/taiga-family/taiga-ui/tree/main/projects/core/pipes/calendar-sheet
this.other.getDayFromMonthRowCol(1, 2, 3);
// TODO: (Taiga UI migration) formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit
// Note: (Taiga UI migration) formattedMonth has been removed in 3.0. Please use TUI_MONTH_FORMATTER from @taiga-ui/kit
return this.value.formattedMonth;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,27 @@ const FILE_HTML_CHILD_COMPONENT_AFTER = `import { TuiContextWithImplicit } from
export class FileHtmlChildComponent {
tuiMigrationMinMaxLabel(context: TuiContextWithImplicit<number>): string {
const currentValue = context.$implicit;
const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input
const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label
const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input
const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label
const maxValue = 100; // Note: (Taiga UI migration) replace with the MAX value of the input
const maxLabelText = "Max"; // Note: (Taiga UI migration) replace with the required label
const minValue = 0; // Note: (Taiga UI migration) replace with the MIN value of the input
const minLabelText = "Min"; // Note: (Taiga UI migration) replace with the required label
if (currentValue === maxValue) return maxLabelText;
if (currentValue === minValue) return minLabelText;
return String(currentValue);
}
tuiMigrationInputRangeMinLabel(context: TuiContextWithImplicit<number>): string {
const currentValue = context.$implicit;
const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input-range
const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label
const minValue = 0; // Note: (Taiga UI migration) replace with the MIN value of the input-range
const minLabelText = "Min"; // Note: (Taiga UI migration) replace with the required label
if (currentValue === minValue) return minLabelText;
return String(currentValue);
}
tuiMigrationInputRangeMaxLabel(context: TuiContextWithImplicit<number>): string {
const currentValue = context.$implicit;
const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input
const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label
const maxValue = 100; // Note: (Taiga UI migration) replace with the MAX value of the input
const maxLabelText = "Max"; // Note: (Taiga UI migration) replace with the required label
if (currentValue === maxValue) return maxLabelText;
return String(currentValue);
}
Expand Down Expand Up @@ -142,8 +142,8 @@ const FILE_HTML_CHILD_TEMPLATE_BEFORE = `
`;

const FILE_HTML_CHILD_TEMPLATE_AFTER = `
<!-- TODO: (Taiga UI migration) [pluralize] => Use [postfix] instead. See https://taiga-ui.dev/components/input-slider/API?postfix=apples -->
<!-- TODO: (Taiga UI migration) See examples how create labels for ticks without this property (outside the component): https://taiga-ui.dev/components/input-slider#slider-segments -->
<!-- Note: (Taiga UI migration) [pluralize] => Use [postfix] instead. See https://taiga-ui.dev/components/input-slider/API?postfix=apples -->
<!-- Note: (Taiga UI migration) See examples how create labels for ticks without this property (outside the component): https://taiga-ui.dev/components/input-slider#slider-segments -->
<tui-input-slider
tuiHintContent="Select the answer to see how the right custom content changes"
[valueContent]="tuiMigrationMinMaxLabel"
Expand All @@ -159,7 +159,7 @@ const FILE_HTML_CHILD_TEMPLATE_AFTER = `
2+2=?
</tui-input-slider>
<!-- TODO: (Taiga UI migration) See examples how create labels for ticks without this property (outside the component): https://taiga-ui.dev/components/input-range#segments -->
<!-- Note: (Taiga UI migration) See examples how create labels for ticks without this property (outside the component): https://taiga-ui.dev/components/input-range#segments -->
<tui-input-range
${''}
[min]="0"
Expand Down Expand Up @@ -302,10 +302,10 @@ export class InlineHtmlChildComponent {
tuiMigrationMinMaxLabel(context: TuiContextWithImplicit<number>): string {
const currentValue = context.$implicit;
const maxValue = 100; // TODO: (Taiga UI migration) replace with the MAX value of the input
const maxLabelText = "Max"; // TODO: (Taiga UI migration) replace with the required label
const minValue = 0; // TODO: (Taiga UI migration) replace with the MIN value of the input
const minLabelText = "Min"; // TODO: (Taiga UI migration) replace with the required label
const maxValue = 100; // Note: (Taiga UI migration) replace with the MAX value of the input
const maxLabelText = "Max"; // Note: (Taiga UI migration) replace with the required label
const minValue = 0; // Note: (Taiga UI migration) replace with the MIN value of the input
const minLabelText = "Min"; // Note: (Taiga UI migration) replace with the required label
if (currentValue === maxValue) return maxLabelText;
if (currentValue === minValue) return minLabelText;
return String(currentValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class AppComponent {
}
method2() {
// TODO: (Taiga UI migration) addStyle method has been removed. Use components approach
// Note: (Taiga UI migration) addStyle method has been removed. Use components approach
this.directiveStyles.addStyle(styles, 'style');
}
}`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ const TEMPLATE_BEFORE = `
</tui-hosted-dropdown>
`;

const TEMPLATE_AFTER = `<!-- TODO: (Taiga UI migration) tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number -->
const TEMPLATE_AFTER = `<!-- Note: (Taiga UI migration) tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number -->
<tui-table-bars-host ngProjectAs="tuiOverAlerts"></tui-table-bars-host>
<tui-tooltip direction="top"></tui-tooltip>
<tui-svg
Expand Down Expand Up @@ -480,7 +480,7 @@ export class TestComponentInline {
`;

const COMPONENT_AFTER = `
@Component({template: '<!-- TODO: (Taiga UI migration) tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number --><div tuiGroup><div [data-value]="27.3333 | tuiFormatNumber: 2"></div></div>'})
@Component({template: '<!-- Note: (Taiga UI migration) tuiFormatNumber pipe has new API. See https://taiga-ui.dev/pipes/format-number --><div tuiGroup><div [data-value]="27.3333 | tuiFormatNumber: 2"></div></div>'})
export class TestComponentInline {
aware = TUI_MOBILE_AWARE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ export class AppComponent {
`;

const AFTER = `
// TODO: (Taiga UI migration) TUI_MOBILE_AWARE has been deleted in 3.0, please use TuiMobileTabsDirective from @taiga-ui/addon-mobile
// TODO: (Taiga UI migration) Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code
// Note: (Taiga UI migration) TUI_MOBILE_AWARE has been deleted in 3.0, please use TuiMobileTabsDirective from @taiga-ui/addon-mobile
// Note: (Taiga UI migration) Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code
import {TUI_MOBILE_AWARE, COUNTRIES_MASKS} from '@taiga-ui/kit';
import {
DumbEntity,
DUMB_CONSTANT,
awesomeFunction,
TUI_LAST_DAY,
// TODO: (Taiga UI migration) TUI_DATE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date
// Note: (Taiga UI migration) TUI_DATE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date
TUI_DATE_FILLER,
MEGA_CONSTANT,
anotherAwesomeFunction
MagicClass,
} from '@taiga-ui/cdk';
// TODO: (Taiga UI migration) TUI_DATE_RANGE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date-range
// Note: (Taiga UI migration) TUI_DATE_RANGE_FILLER has been deleted in 3.0, please use TUI_DATE_FORMAT + TUI_DATE_SEPARATOR from @taiga-ui/cdk. Read more: https://taiga-ui.dev/components/input-date-range
import {DumbEntity, TUI_DATE_RANGE_FILLER, MEGA_CONSTANT, MagicClass} from '@taiga-ui/cdk';
// TODO: (Taiga UI migration) Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code. Use DI-token TUI_COUNTRIES to get localized country name by its iso code
// Note: (Taiga UI migration) Use DI-token TUI_COUNTRIES_MASKS to get phone mask by country iso code. Use DI-token TUI_COUNTRIES to get localized country name by its iso code
import { COUNTRIES } from '@taiga-ui/kit';
const lol = TUI_DATE_FILLER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@ function addTodo(
): void {
recorder.insertRight(
templateOffset + (sourceCodeLocation?.startTag.startOffset || 0),
'<!-- Taiga migration TODO: use "<tui-icon>" with "tuiBadge" directive for icon-only badges instead -->\n',
'<!-- Taiga migration Note: use "<tui-icon>" with "tuiBadge" directive for icon-only badges instead -->\n',
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ function migrateContent({
} else if (Number.isNaN(Number(value))) {
recorder.insertRight(
templateOffset + (sourceCodeLocation?.startTag.startOffset || 0),
'<!-- Taiga migration TODO: contentTop and contentBottom inputs has been removed. Use ng-content, see taiga-ui.dev/components/badged-content -->\n',
'<!-- Taiga migration Note: contentTop and contentBottom inputs has been removed. Use ng-content, see taiga-ui.dev/components/badged-content -->\n',
);
} else {
recorder.insertRight(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function migrateExpandable({
if (expandableValue !== 'false' && expandableValue !== 'true') {
recorder.insertRight(
templateOffset + (sourceCodeLocation?.startTag.startOffset || 0),
'<!-- Taiga migration TODO: "expandable" property has been removed. Use "rows" property instead -->\n',
'<!-- Taiga migration Note: "expandable" property has been removed. Use "rows" property instead -->\n',
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const TEMPLATE_AFTER = `
iconLeft="tuiIconHelpCircle">
${''}
Taiga</tui-badge>
<!-- Taiga migration TODO: use "<tui-icon>" with "tuiBadge" directive for icon-only badges instead -->
<!-- Taiga migration Note: use "<tui-icon>" with "tuiBadge" directive for icon-only badges instead -->
<tui-badge
appearance="success"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const TEMPLATE_AFTER = `
></tui-avatar>
</tui-badged-content>
<!-- Taiga migration TODO: contentTop and contentBottom inputs has been removed. Use ng-content, see taiga-ui.dev/components/badged-content -->
<!-- Taiga migration Note: contentTop and contentBottom inputs has been removed. Use ng-content, see taiga-ui.dev/components/badged-content -->
<tui-badged-content
${''}
[style.--tui-radius.%]="50">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const TEMPLATE_AFTER = `
[formControl]="test"
></tui-input-tag>
<!-- Taiga migration TODO: "expandable" property has been removed. Use "rows" property instead -->
<!-- Taiga migration Note: "expandable" property has been removed. Use "rows" property instead -->
<tui-input-tag
${''}
[rows]="3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const TEMPLATE_AFTER = `
class="toggle"
[showIcons]="true"
/>
<!-- TODO: (Taiga UI migration) toggle [singleColor] and [showLoader] inputs have been removed due to design changes -->
<!-- Note: (Taiga UI migration) toggle [singleColor] and [showLoader] inputs have been removed due to design changes -->
<input
tuiToggle
type="checkbox"
Expand Down
2 changes: 1 addition & 1 deletion projects/cdk/schematics/utils/insert-todo.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Identifier} from 'ng-morph';

export const TODO_MARK = 'TODO: (Taiga UI migration)';
export const TODO_MARK = 'Note: (Taiga UI migration)';

export function insertTodo(identifier: Identifier, message: string): void {
const startLinePos = identifier.getStartLinePos();
Expand Down

0 comments on commit 572f055

Please sign in to comment.