Skip to content

Commit f5a61f3

Browse files
committed
fix(igx-ts-legacy): update igx-legacy templates and empty template
1 parent bf6c26f commit f5a61f3

99 files changed

Lines changed: 246 additions & 257 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/cli/lib/templates/AngularTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class AngularTemplate implements Template {
4545
}
4646

4747
public registerInProject(projectPath: string, name: string, options?: AddTemplateArgs) {
48-
let modulePath = "app.module.ts";
48+
let modulePath = "app-module.ts";
4949
if (options && options.modulePath) {
5050
modulePath = options.modulePath;
5151
}
@@ -84,7 +84,7 @@ export class AngularTemplate implements Template {
8484
mainModule.addNgModuleMeta({
8585
declare: [className],
8686
from: relativePath,
87-
export: modulePath !== "app.module.ts" ? [className] : []
87+
export: modulePath !== "app-module.ts" ? [className] : []
8888
});
8989
mainModule.finalize();
9090

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe("Update 2.0.0", () => {
1515

1616
it("should update router event rxjs subscription", async () => {
1717
appTree.create(
18-
"/src/app/app.component.ts",
18+
"/src/app/app.ts",
1919
`import { Component, OnInit, ViewChild } from '@angular/core';
2020
import { NavigationStart, Router } from '@angular/router';
2121
import 'rxjs/add/operator/filter';
@@ -25,10 +25,10 @@ import { IgxNavigationDrawerComponent } from 'igniteui-angular';
2525
2626
@Component({
2727
selector: 'app-root',
28-
templateUrl: './app.component.html',
29-
styleUrls: ['./app.component.css']
28+
templateUrl: './app.html',
29+
styleUrl: './app.css'
3030
})
31-
export class AppComponent implements OnInit {
31+
export class App implements OnInit {
3232
@ViewChild(IgxNavigationDrawerComponent, { static: true }) public navdrawer: IgxNavigationDrawerComponent;
3333
3434
constructor(private router: Router) {}
@@ -47,7 +47,7 @@ export class AppComponent implements OnInit {
4747
);
4848

4949
const tree = await schematicRunner.runSchematic("migration-01", {}, appTree);
50-
expect(tree.readContent("/src/app/app.component.ts"))
50+
expect(tree.readContent("/src/app/app.ts"))
5151
.toEqual(
5252
`import { Component, OnInit, ViewChild } from '@angular/core';
5353
import { NavigationStart, Router } from '@angular/router';
@@ -58,10 +58,10 @@ import { IgxNavigationDrawerComponent } from 'igniteui-angular';
5858
5959
@Component({
6060
selector: 'app-root',
61-
templateUrl: './app.component.html',
62-
styleUrls: ['./app.component.css']
61+
templateUrl: './app.html',
62+
styleUrl: './app.css'
6363
})
64-
export class AppComponent implements OnInit {
64+
export class App implements OnInit {
6565
@ViewChild(IgxNavigationDrawerComponent, { static: true }) public navdrawer: IgxNavigationDrawerComponent;
6666
6767
constructor(private router: Router) {}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default function(): Rule {
55
return (host: Tree, context: SchematicContext) => {
66
context.logger.info("Updating project to Ignite UI CLI 2.0.0");
77

8-
const appComponentPath = "src/app/app.component.ts";
8+
const appComponentPath = "src/app/app.ts";
99

1010
if (host.exists(appComponentPath)) {
1111
let content = host.read(appComponentPath).toString();

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ h3 {
7272
});
7373

7474
it("should remove forRoot() from IgxGridModule", async () => {
75-
const indexFile = "/src/app/app.module.ts";
75+
const indexFile = "/src/app/app-module.ts";
7676
appTree.create(indexFile,
7777
`@NgModule({
7878
imports: [

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ h3 {
2424
}
2525

2626
function removeGridForRoot(host: Tree) {
27-
const appModulePath = "src/app/app.module.ts";
27+
const appModulePath = "src/app/app-module.ts";
2828
if (host.exists(appModulePath)) {
2929
let content = host.read(appModulePath).toString();
3030
if (content.indexOf("IgxGridModule.forRoot()") !== -1) {

packages/cli/migrations/update-5_0_0/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ indent_size = 2
3232
});
3333

3434
it("should add HammerModule", async () => {
35-
const indexFile = "/src/app/app.module.ts";
35+
const indexFile = "/src/app/app-module.ts";
3636
appTree.create(indexFile,
3737
`import { BrowserModule } from '@angular/platform-browser';
3838
@NgModule({

packages/cli/migrations/update-5_0_0/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function(): Rule {
4242
workspace.projects.get(workspace.extensions.defaultProject as string) :
4343
workspace.projects.values().next().value as workspaces.ProjectDefinition;
4444

45-
const moduleFile = `${project.sourceRoot}/${project.prefix}/app.module.ts`;
45+
const moduleFile = `${project.sourceRoot}/${project.prefix}/app-module.ts`;
4646

4747
context.logger.info(`Applying migration for Ignite UI CLI 5.0.0`);
4848

packages/cli/templates/angular/ig-ts/projects/empty/files/package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "~21.1.5",
14-
"@angular/common": "~21.1.5",
15-
"@angular/compiler": "~21.1.5",
16-
"@angular/core": "~21.1.5",
17-
"@angular/forms": "~21.1.5",
18-
"@angular/platform-browser": "~21.1.5",
19-
"@angular/platform-browser-dynamic": "~21.1.5",
20-
"@angular/router": "~21.1.5",
13+
"@angular/animations": "~21.2.0",
14+
"@angular/common": "~21.2.0",
15+
"@angular/compiler": "~21.2.0",
16+
"@angular/core": "~21.2.0",
17+
"@angular/forms": "~21.2.0",
18+
"@angular/platform-browser": "~21.2.0",
19+
"@angular/platform-browser-dynamic": "~21.2.0",
20+
"@angular/router": "~21.2.0",
2121
"jquery": "^3.7.1",
2222
"jquery-ui": "^1.13.3",
2323
"igniteui-angular-wrappers": "~21.0.1",
@@ -27,10 +27,10 @@
2727
"zone.js": "~0.15.0"
2828
},
2929
"devDependencies": {
30-
"@angular/build": "~21.1.5",
31-
"@angular-devkit/build-angular": "~21.1.5",
32-
"@angular/cli": "~21.1.5",
33-
"@angular/compiler-cli": "~21.1.5",
30+
"@angular/build": "~21.2.0",
31+
"@angular-devkit/build-angular": "~21.2.0",
32+
"@angular/cli": "~21.2.0",
33+
"@angular/compiler-cli": "~21.2.0",
3434
"@types/jasmine": "~5.1.4",
3535
"@types/node": "^18.16.0",
3636
"igniteui-cli": "^$(cliVersion)",

packages/cli/templates/angular/ig-ts/projects/empty/files/src/app/app.module.ts renamed to packages/cli/templates/angular/ig-ts/projects/empty/files/src/app/app-module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { BrowserModule } from '@angular/platform-browser';
33
import { FormsModule } from '@angular/forms';
44

55
import { AppRoutingModule } from './app-routing.module';
6-
import { AppComponent } from './app.component';
6+
import { App } from './app';
77
import { NavMenuComponent } from './shared/nav-menu.component';
88
import { HomeComponent } from './home.component';
99
import { IgniteUIModule } from 'igniteui-angular-wrappers';
@@ -12,11 +12,11 @@ import { IgniteUIModule } from 'igniteui-angular-wrappers';
1212
imports: [BrowserModule, AppRoutingModule, IgniteUIModule, FormsModule],
1313
declarations: [
1414
HomeComponent,
15-
AppComponent,
15+
App,
1616
NavMenuComponent
1717
],
1818
providers: [],
19-
bootstrap: [AppComponent]
19+
bootstrap: [App]
2020
})
2121
export class AppModule {
2222
}

packages/cli/templates/angular/ig-ts/projects/empty/files/src/app/app.component.ts

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

0 commit comments

Comments
 (0)