Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion packages/cli/lib/commands/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface PositionalArgs {
/** The name of the project */
name?: string;

/** The type of the project. (eg. igx-ts, igx-ts-legacy) */
/** The type of the project. (eg. igx-ts) */
type?: string;

/** Which theme to use when creating a new project. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as path from "path";
import { EmptyTree } from "@angular-devkit/schematics";
import { SchematicTestRunner, UnitTestTree } from "@angular-devkit/schematics/testing";

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

Expand All @@ -22,7 +22,7 @@ describe("Update 13.1.0", () => {
"project": {
"defaultPort": 4200,
"framework": "angular",
"projectType": "igx-ts",
"projectType": "igx-ts-legacy",
"projectTemplate": "side-nav",
"theme": "Default",
"themePath": "node_modules/igniteui-angular/styles/igniteui-angular.css",
Expand All @@ -38,7 +38,7 @@ describe("Update 13.1.0", () => {
}`
);

const tree = await schematicRunner.runSchematic("migration-07", { applyMigrations: true }, appTree);
const tree = await schematicRunner.runSchematic("legacy-type", { applyMigrations: true }, appTree);
expect(tree.readContent("./ignite-ui-cli.json"))
.toEqual(
`{
Expand All @@ -50,7 +50,7 @@ describe("Update 13.1.0", () => {
"project": {
"defaultPort": 4200,
"framework": "angular",
"projectType": "igx-ts-legacy",
"projectType": "igx-ts",
"projectTemplate": "side-nav",
"theme": "Default",
"themePath": "node_modules/igniteui-angular/styles/igniteui-angular.css",
Expand Down
19 changes: 19 additions & 0 deletions packages/cli/migrations/legacy-type/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Rule, SchematicContext, Tree } from "@angular-devkit/schematics";

export default function(options: any): Rule {
return (host: Tree, context: SchematicContext) => {
if (!options.applyMigrations) { return; }
Comment thread
damyanpetev marked this conversation as resolved.
Outdated

const igConfig = "./ignite-ui-cli.json";

if (host.exists(igConfig)) {
const content = JSON.parse(host.read(igConfig)!.toString());
if (content?.project?.projectType === "igx-ts-legacy") {
content.project.projectType = "igx-ts";
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.");
context.logger.info("We recommend using Angular's Standalone migration https://angular.dev/reference/migrations/standalone");
Comment thread
damyanpetev marked this conversation as resolved.
Outdated
host.overwrite(igConfig, JSON.stringify(content, null, 2));
}
}
};
}
47 changes: 8 additions & 39 deletions packages/cli/migrations/migration-collection.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,11 @@
{
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
"encapsulation": "true",
"schematics": {
"migration-01": {
"version": "2.0.0",
"description": "Updates Ignite UI for Angular project from 1.3",
"factory": "./update-2"
},
"migration-02": {
"version": "3.0.0",
"description": "Updates Ignite UI for Angular project from 2.1.x",
"factory": "./update-3"
},
"migration-03": {
"version": "3.2.0",
"description": "Updates Ignite UI for Angular project from 3.1.x",
"factory": "./update-3_2"
},
"migration-04": {
"version": "4.2.3",
"description": "Updates Ignite UI for Angular project from 4.2.x",
"factory": "./update-4_2_3"
},
"migration-05": {
"version": "5.0.0",
"description": "Updates Ignite UI for Angular project from CLI 4.4.x to 5.0.0",
"factory": "./update-5_0_0"
},
"migration-06": {
"version": "5.0.3",
"description": "Updates Ignite UI for Angular project from CLI 5.0.x to 5.0.3",
"factory": "./update-5_0_3"
},
"migration-07": {
"version": "13.1.0",
"description": "Updates Ignite UI for Angular Schematics project from 13.0.x to 13.1.x",
"factory": "./update-13_1_0",
"schema": "./schema.json"
}
"$schema": "../node_modules/@angular-devkit/schematics/collection-schema.json",
"encapsulation": "true",
"schematics": {
"legacy-type": {
"version": "15.0.0",
"description": "Updates Ignite UI for Angular Schematics legacy project type to igx-ts",
"factory": "./legacy-type"
}
}
}
Comment thread
damyanpetev marked this conversation as resolved.
14 changes: 0 additions & 14 deletions packages/cli/migrations/schema.json

This file was deleted.

19 changes: 0 additions & 19 deletions packages/cli/migrations/update-13_1_0/index.ts

This file was deleted.

81 changes: 0 additions & 81 deletions packages/cli/migrations/update-2/index.spec.ts

This file was deleted.

24 changes: 0 additions & 24 deletions packages/cli/migrations/update-2/index.ts

This file was deleted.

123 changes: 0 additions & 123 deletions packages/cli/migrations/update-3/index.spec.ts

This file was deleted.

Loading
Loading