Skip to content

Commit

Permalink
chore(schematics): enable possibility to manually run migration for `…
Browse files Browse the repository at this point in the history
…4.0.0` (#6985)
  • Loading branch information
nsbarsukov authored Mar 12, 2024
1 parent d37afd8 commit b2f3e28
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 30 deletions.
6 changes: 6 additions & 0 deletions projects/cdk/schematics/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"description": "Manually run migration to update Taiga to v3.x.x",
"factory": "./ng-update/v3/index#updateToV3",
"schema": "./ng-update/v3/schema.json"
},
"updateToV4": {
"private": true,
"description": "Manually run migration to update Taiga to v4.x.x",
"factory": "./ng-update/v4/index#updateToV4",
"schema": "./ng-update/v4/schema.json"
}
}
}
7 changes: 7 additions & 0 deletions projects/cdk/schematics/ng-update/v4/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "taiga-ui-ng-update-v4",
"title": "Taiga UI ng-update v4",
"type": "object",
"properties": {}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {Node} from 'ng-morph';
import type {CallExpression} from 'ts-morph';

import type {TuiSchema} from '../../../ng-add/schema';
import {addUniqueImport} from '../../../utils/add-unique-import';
import {
addUniqueImport,
FINISH_SYMBOL,
getNamedImportReferences,
infoLog,
removeImport,
REPLACE_SYMBOL,
SMALL_TAB_SYMBOL,
titleLog,
} from '@taiga-ui/cdk/schematics';
import {Node} from 'ng-morph';
import type {CallExpression} from 'ts-morph';

import type {TuiSchema} from '../../../ng-add/schema';
} from '../../../utils/colored-log';
import {getNamedImportReferences} from '../../../utils/get-named-import-references';
import {removeImport} from '../../../utils/import-manipulations';

export function migrateDestroyService(options: TuiSchema): void {
!options['skip-logs'] &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import {Node} from 'ng-morph';

import type {TuiSchema} from '../../../ng-add/schema';
import {addUniqueImport} from '../../../utils/add-unique-import';
import {
addUniqueImport,
FINISH_SYMBOL,
getNamedImportReferences,
infoLog,
removeImport,
REPLACE_SYMBOL,
SMALL_TAB_SYMBOL,
titleLog,
} from '@taiga-ui/cdk/schematics';
import {Node} from 'ng-morph';

import type {TuiSchema} from '../../../ng-add/schema';
} from '../../../utils/colored-log';
import {getNamedImportReferences} from '../../../utils/get-named-import-references';
import {removeImport} from '../../../utils/import-manipulations';

export function migrateLegacyMask(options: TuiSchema): void {
!options['skip-logs'] &&
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {UpdateRecorder} from '@angular-devkit/schematics';
import {findAttr} from '@taiga-ui/cdk/schematics/utils/templates/inputs';
import type {DevkitFileSystem} from 'ng-morph';
import type {Attribute, ElementLocation} from 'parse5';

import {findElementsByTagName} from '../../../../utils/templates/elements';
import {findAttr} from '../../../../utils/templates/inputs';
import {
getTemplateFromTemplateResource,
getTemplateOffset,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import type {UpdateRecorder} from '@angular-devkit/schematics';
import {tuiCleanObject} from '@taiga-ui/cdk';
import {addImportToClosestModule} from '@taiga-ui/cdk/schematics';
import type {TemplateResource} from '@taiga-ui/cdk/schematics/ng-update/interfaces';
import {removeAttrs} from '@taiga-ui/cdk/schematics/ng-update/v4/steps/utils/remove-attrs';
import {findElementsByTagName} from '@taiga-ui/cdk/schematics/utils/templates/elements';
import {findAttr, isBinding} from '@taiga-ui/cdk/schematics/utils/templates/inputs';
import type {DevkitFileSystem} from 'ng-morph';
import type {Attribute} from 'parse5';

import {tuiCleanObject} from '../../../../../utils/miscellaneous/clean-object';
import type {TemplateResource} from '../../../../ng-update/interfaces';
import {removeAttrs} from '../../../../ng-update/v4/steps/utils/remove-attrs';
import {addImportToClosestModule} from '../../../../utils/add-import-to-closest-module';
import {findElementsByTagName} from '../../../../utils/templates/elements';
import {findAttr, isBinding} from '../../../../utils/templates/inputs';
import {
getTemplateFromTemplateResource,
getTemplateOffset,
} from '@taiga-ui/cdk/schematics/utils/templates/template-resource';
import type {DevkitFileSystem} from 'ng-morph';
import type {Attribute} from 'parse5';
} from '../../../../utils/templates/template-resource';

export function migrateMoney({
resource,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type {UpdateRecorder} from '@angular-devkit/schematics';
import type {TemplateResource} from '@taiga-ui/cdk/schematics/ng-update/interfaces';
import {findElementsWithAttribute} from '@taiga-ui/cdk/schematics/utils/templates/elements';
import {findAttr} from '@taiga-ui/cdk/schematics/utils/templates/inputs';
import type {DevkitFileSystem} from 'ng-morph';

import type {TemplateResource} from '../../../../ng-update/interfaces';
import {findElementsWithAttribute} from '../../../../utils/templates/elements';
import {findAttr} from '../../../../utils/templates/inputs';
import {
getTemplateFromTemplateResource,
getTemplateOffset,
} from '@taiga-ui/cdk/schematics/utils/templates/template-resource';
import type {DevkitFileSystem} from 'ng-morph';
} from '../../../../utils/templates/template-resource';

export function migratePreventDefault({
resource,
Expand Down

0 comments on commit b2f3e28

Please sign in to comment.