Skip to content

Commit d882813

Browse files
committed
refactor(migrations): update legacy type, drop old migs
1 parent 46699ea commit d882813

22 files changed

Lines changed: 44 additions & 830 deletions

File tree

packages/cli/migrations/update-13_1_0/index.spec.ts renamed to packages/cli/migrations/legacy-type/index.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as path from "path";
22
import { EmptyTree } from "@angular-devkit/schematics";
33
import { SchematicTestRunner, UnitTestTree } from "@angular-devkit/schematics/testing";
44

5-
describe("Update 13.1.0", () => {
5+
describe("Legacy type", () => {
66
let appTree: UnitTestTree;
77
const schematicRunner = new SchematicTestRunner("ig-migrate", path.join(__dirname, "../migration-collection.json"));
88

@@ -22,7 +22,7 @@ describe("Update 13.1.0", () => {
2222
"project": {
2323
"defaultPort": 4200,
2424
"framework": "angular",
25-
"projectType": "igx-ts",
25+
"projectType": "igx-ts-legacy",
2626
"projectTemplate": "side-nav",
2727
"theme": "Default",
2828
"themePath": "node_modules/igniteui-angular/styles/igniteui-angular.css",
@@ -38,7 +38,7 @@ describe("Update 13.1.0", () => {
3838
}`
3939
);
4040

41-
const tree = await schematicRunner.runSchematic("migration-07", { applyMigrations: true }, appTree);
41+
const tree = await schematicRunner.runSchematic("legacy-type", { applyMigrations: true }, appTree);
4242
expect(tree.readContent("./ignite-ui-cli.json"))
4343
.toEqual(
4444
`{
@@ -50,7 +50,7 @@ describe("Update 13.1.0", () => {
5050
"project": {
5151
"defaultPort": 4200,
5252
"framework": "angular",
53-
"projectType": "igx-ts-legacy",
53+
"projectType": "igx-ts",
5454
"projectTemplate": "side-nav",
5555
"theme": "Default",
5656
"themePath": "node_modules/igniteui-angular/styles/igniteui-angular.css",
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { Rule, SchematicContext, Tree } from "@angular-devkit/schematics";
2+
3+
export default function(options: any): Rule {
4+
return (host: Tree, context: SchematicContext) => {
5+
if (!options.applyMigrations) { return; }
6+
7+
const igConfig = "./ignite-ui-cli.json";
8+
9+
if (host.exists(igConfig)) {
10+
const content = JSON.parse(host.read(igConfig)!.toString());
11+
if (content?.project?.projectType === "igx-ts-legacy") {
12+
content.project.projectType = "igx-ts";
13+
context.logger.info("We've updated your project type to `igx-ts` to continue using Ignite UI CLI. The `igx-ts-legacy` `NgModule`-s project is no longer supported, adding new components might not register correctly.");
14+
context.logger.info("We recommend using Angular's Standalone migration https://angular.dev/reference/migrations/standalone");
15+
host.overwrite(igConfig, JSON.stringify(content, null, 2));
16+
}
17+
}
18+
};
19+
}
Lines changed: 8 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,11 @@
11
{
2-
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3-
"encapsulation": "true",
4-
"schematics": {
5-
"migration-01": {
6-
"version": "2.0.0",
7-
"description": "Updates Ignite UI for Angular project from 1.3",
8-
"factory": "./update-2"
9-
},
10-
"migration-02": {
11-
"version": "3.0.0",
12-
"description": "Updates Ignite UI for Angular project from 2.1.x",
13-
"factory": "./update-3"
14-
},
15-
"migration-03": {
16-
"version": "3.2.0",
17-
"description": "Updates Ignite UI for Angular project from 3.1.x",
18-
"factory": "./update-3_2"
19-
},
20-
"migration-04": {
21-
"version": "4.2.3",
22-
"description": "Updates Ignite UI for Angular project from 4.2.x",
23-
"factory": "./update-4_2_3"
24-
},
25-
"migration-05": {
26-
"version": "5.0.0",
27-
"description": "Updates Ignite UI for Angular project from CLI 4.4.x to 5.0.0",
28-
"factory": "./update-5_0_0"
29-
},
30-
"migration-06": {
31-
"version": "5.0.3",
32-
"description": "Updates Ignite UI for Angular project from CLI 5.0.x to 5.0.3",
33-
"factory": "./update-5_0_3"
34-
},
35-
"migration-07": {
36-
"version": "13.1.0",
37-
"description": "Updates Ignite UI for Angular Schematics project from 13.0.x to 13.1.x",
38-
"factory": "./update-13_1_0",
39-
"schema": "./schema.json"
40-
}
2+
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
3+
"encapsulation": "true",
4+
"schematics": {
5+
"legacy-type": {
6+
"version": "15.0.0",
7+
"description": "Updates Ignite UI for Angular Schematics legacy project type to igx-ts",
8+
"factory": "./legacy-type"
419
}
10+
}
4211
}

packages/cli/migrations/schema.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

packages/cli/migrations/update-13_1_0/index.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

packages/cli/migrations/update-2/index.spec.ts

Lines changed: 0 additions & 81 deletions
This file was deleted.

packages/cli/migrations/update-2/index.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/cli/migrations/update-3/index.spec.ts

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)