Skip to content

Commit

Permalink
Dependency updates iteration 3 - upgrade jasmine and schematics (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hristo313 authored Oct 10, 2024
1 parent e121a9b commit ee2782e
Show file tree
Hide file tree
Showing 58 changed files with 1,567 additions and 945 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"handlebars": "4.7.8"
},
"devDependencies": {
"@types/jasmine": "3.3.9",
"@types/minimatch": "^5.1.2",
"@types/node": "^20.12.3",
"@inquirer/prompts": "^5.4.0",
"@types/jasmine": "^5.1.4",
"@types/minimatch": "^5.1.2",
"@types/node": "^22.5.5",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"browser-sync": "^3.0.2",
Expand All @@ -73,8 +73,8 @@
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-unicorn": "^52.0.0",
"glob": "^11.0.0",
"jasmine": "3.5.0",
"jasmine-spec-reporter": "^4.2.1",
"jasmine": "^5.3.0",
"jasmine-spec-reporter": "^7.0.0",
"lerna": "^3.16.4",
"lerna-changelog": "^0.8.2",
"lite-server": "^2.6.1",
Expand All @@ -83,7 +83,7 @@
"source-map-support": "^0.5.21",
"ts-node": "^10.9.2",
"tslint": "^5.11.0",
"typescript": "~5.4.3",
"typescript": "~5.5.4",
"typescript-json-schema": "^0.65.1"
},
"workspaces": [
Expand Down
5 changes: 2 additions & 3 deletions packages/cli/migrations/update-13_1_0/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("Update 13.1.0", () => {
appTree = new UnitTestTree(new EmptyTree());
});

it("change projectType to legacy", async done => {
it("change projectType to legacy", async () => {
appTree.create(
"./ignite-ui-cli.json",
`{
Expand Down Expand Up @@ -40,7 +40,7 @@ describe("Update 13.1.0", () => {
}`
);

const tree = await schematicRunner.runSchematicAsync("migration-07", { applyMigrations: true }, appTree).toPromise();
const tree = await schematicRunner.runSchematic("migration-07", { applyMigrations: true }, appTree);
expect(tree.readContent("./ignite-ui-cli.json"))
.toEqual(
`{
Expand All @@ -67,7 +67,6 @@ describe("Update 13.1.0", () => {
"build": {}
}`
);
done();
});

});
5 changes: 2 additions & 3 deletions packages/cli/migrations/update-2/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("Update 2.0.0", () => {
appTree = new UnitTestTree(new EmptyTree());
});

it("should update router event rxjs subscription", async done => {
it("should update router event rxjs subscription", async () => {
appTree.create(
"/src/app/app.component.ts",
`import { Component, OnInit, ViewChild } from '@angular/core';
Expand Down Expand Up @@ -46,7 +46,7 @@ export class AppComponent implements OnInit {
`
);

const tree = await schematicRunner.runSchematicAsync("migration-01", {}, appTree).toPromise();
const tree = await schematicRunner.runSchematic("migration-01", {}, appTree);
expect(tree.readContent("/src/app/app.component.ts"))
.toEqual(
`import { Component, OnInit, ViewChild } from '@angular/core';
Expand Down Expand Up @@ -78,7 +78,6 @@ export class AppComponent implements OnInit {
}
`
);
done();
});

});
26 changes: 11 additions & 15 deletions packages/cli/migrations/update-3/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,35 @@ describe("Update 3.0.0", () => {
appTree = new UnitTestTree(new EmptyTree());
});

it("should add ig-typography class to body if needed", async done => {
it("should add ig-typography class to body if needed", async () => {
const indexFile = "/src/index.html";
appTree.create(indexFile,
`<body>
<app-root></app-root>
</body>`
);

await schematicRunner.runSchematicAsync("migration-02", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-02", {}, appTree);
expect(appTree.readContent(indexFile))
.toEqual(
`<body class="ig-typography">
<app-root></app-root>
</body>`
);
appTree.overwrite(indexFile, `<body class="">`);
await schematicRunner.runSchematicAsync("migration-02", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-02", {}, appTree);
expect(appTree.readContent(indexFile)).toEqual(`<body class="ig-typography">`);

appTree.overwrite(indexFile, `<body class="test class">`);
await schematicRunner.runSchematicAsync("migration-02", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-02", {}, appTree);
expect(appTree.readContent(indexFile)).toEqual(`<body class="test class ig-typography">`);

appTree.overwrite(indexFile, `<body class="test ig-typography">`);
await schematicRunner.runSchematicAsync("migration-02", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-02", {}, appTree);
expect(appTree.readContent(indexFile)).toEqual(`<body class="test ig-typography">`);
done();
});

it("should add additional header styles to home css", async done => {
it("should add additional header styles to home css", async () => {
const cssFile = "/src/app/home/home.component.css";
appTree.create(cssFile,
`body {
Expand All @@ -51,7 +50,7 @@ describe("Update 3.0.0", () => {
`
);

await schematicRunner.runSchematicAsync("migration-02", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-02", {}, appTree);
expect(appTree.readContent(cssFile))
.toEqual(
`body {
Expand All @@ -70,10 +69,9 @@ h3 {
}
`
);
done();
});

it("should remove forRoot() from IgxGridModule", async done => {
it("should remove forRoot() from IgxGridModule", async () => {
const indexFile = "/src/app/app.module.ts";
appTree.create(indexFile,
`@NgModule({
Expand All @@ -84,7 +82,7 @@ h3 {
})`
);

await schematicRunner.runSchematicAsync("migration-02", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-02", {}, appTree);
expect(appTree.readContent(indexFile))
.toEqual(
`@NgModule({
Expand All @@ -94,10 +92,9 @@ h3 {
]
})`
);
done();
});

it("should update config", async done => {
it("should update config", async () => {
const indexFile = "ignite-ui-cli.json";
appTree.create(indexFile,
`{
Expand All @@ -111,7 +108,7 @@ h3 {
}`
);

await schematicRunner.runSchematicAsync("migration-02", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-02", {}, appTree);
expect(appTree.readContent(indexFile))
.toEqual(
`{
Expand All @@ -125,6 +122,5 @@ h3 {
}
`
);
done();
});
});
6 changes: 3 additions & 3 deletions packages/cli/migrations/update-3_2/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe("Update 3.2.0", () => {
defaultProject: "testProj",
projects: {
testProj: {
root: "",
sourceRoot: "/src"
}
},
Expand All @@ -23,7 +24,7 @@ describe("Update 3.2.0", () => {
appTree.create("/angular.json", JSON.stringify(configJson));
});

it("should update CustomDateSummary summaryResult assignment", async done => {
it("should update CustomDateSummary summaryResult assignment", async () => {
const summaryFile = "/src/app/grid-summaries/grid-summaries.component.ts";
appTree.create(summaryFile,
`class CustomDateSummary extends IgxDateSummaryOperand {
Expand All @@ -47,7 +48,7 @@ describe("Update 3.2.0", () => {
}`
);

await schematicRunner.runSchematicAsync("migration-03", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-03", {}, appTree);
expect(appTree.readContent(summaryFile))
.toEqual(
`class CustomDateSummary extends IgxDateSummaryOperand {
Expand All @@ -70,6 +71,5 @@ describe("Update 3.2.0", () => {
}
}`
);
done();
});
});
6 changes: 3 additions & 3 deletions packages/cli/migrations/update-4_2_3/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe("Update 4.2.3", () => {
defaultProject: "testProj",
projects: {
testProj: {
root: "",
sourceRoot: "/src"
}
},
Expand All @@ -23,7 +24,7 @@ describe("Update 4.2.3", () => {
appTree.create("/angular.json", JSON.stringify(configJson));
});

it("should add Awesome Grid extra paginator style", async done => {
it("should add Awesome Grid extra paginator style", async () => {
const stylesFile = "/src/app/awesome-grid/awesome-grid.component.scss";
appTree.create(stylesFile,
`@use 'igniteui-angular/theming' as *;
Expand All @@ -43,7 +44,7 @@ describe("Update 4.2.3", () => {
`
);

await schematicRunner.runSchematicAsync("migration-04", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-04", {}, appTree);
expect(appTree.readContent(stylesFile).replace(/\r\n/g, "\n"))
.toEqual(
`@use 'igniteui-angular/theming' as *;
Expand All @@ -69,6 +70,5 @@ describe("Update 4.2.3", () => {
}
`.replace(/\r\n/g, "\n")
);
done();
});
});
6 changes: 3 additions & 3 deletions packages/cli/migrations/update-5_0_0/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe("Update 5.0.0", () => {
defaultProject: "testProj",
projects: {
testProj: {
root: "",
prefix: "app",
sourceRoot: "src"
}
Expand All @@ -30,7 +31,7 @@ indent_size = 2
`);
});

it("should add HammerModule", async done => {
it("should add HammerModule", async () => {
const indexFile = "/src/app/app.module.ts";
appTree.create(indexFile,
`import { BrowserModule } from '@angular/platform-browser';
Expand All @@ -45,7 +46,7 @@ export class AppModule {
`
);

await schematicRunner.runSchematicAsync("migration-05", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-05", {}, appTree);
expect(appTree.readContent(indexFile).replace(/\r\n/g, "\n"))
.toEqual(
`import { BrowserModule, HammerModule } from '@angular/platform-browser';
Expand All @@ -60,6 +61,5 @@ export class AppModule {
}
`.replace(/\r\n/g, "\n")
);
done();
});
});
6 changes: 3 additions & 3 deletions packages/cli/migrations/update-5_0_3/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe("Update 5.0.0", () => {
defaultProject: "testProj",
projects: {
testProj: {
root: "",
prefix: "app",
sourceRoot: "src"
}
Expand All @@ -24,7 +25,7 @@ describe("Update 5.0.0", () => {
appTree.create("/angular.json", JSON.stringify(configJson));
});

it("should update error handler service if found", async done => {
it("should update error handler service if found", async () => {
const errorService = "src/app/error-routing/error/global-error-handler.service.ts";
appTree.create(errorService,
`import { ErrorHandler, Injectable, isDevMode } from '@angular/core';
Expand All @@ -40,7 +41,7 @@ export class GlobalErrorHandlerService implements ErrorHandler {
`
);

await schematicRunner.runSchematicAsync("migration-06", {}, appTree).toPromise();
await schematicRunner.runSchematic("migration-06", {}, appTree);
expect(appTree.readContent(errorService).replace(/\r\n/g, "\n"))
.toEqual(
`import { ErrorHandler, Injectable, isDevMode } from '@angular/core';
Expand All @@ -55,6 +56,5 @@ export class GlobalErrorHandlerService implements ErrorHandler {
}
`.replace(/\r\n/g, "\n")
);
done();
});
});
22 changes: 11 additions & 11 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "igniteui-cli",
"version": "14.0.2",
"version": "14.1.0-beta.1",
"description": "CLI tool for creating Ignite UI projects",
"keywords": [
"CLI",
Expand Down Expand Up @@ -78,28 +78,28 @@
"all": true
},
"dependencies": {
"@igniteui/angular-templates": "~18.1.1402",
"@igniteui/cli-core": "~14.0.2",
"@igniteui/angular-templates": "~18.1.1410-beta.1",
"@igniteui/cli-core": "~14.1.0-beta.1",
"@inquirer/prompts": "^5.4.0",
"@types/yargs": "^17.0.33",
"chalk": "^5.3.0",
"glob": "^11.0.0",
"@inquirer/prompts": "^5.4.0",
"open": "^10.1.0",
"resolve": "^1.22.8",
"through2": "^4.0.2",
"typescript": "~5.4.3",
"typescript": "~5.5.4",
"yargs": "^17.7.2"
},
"devDependencies": {
"@angular-devkit/core": "~14.0.0",
"@angular-devkit/schematics": "~14.0.0",
"@angular-devkit/core": "^18.2.4",
"@angular-devkit/schematics": "^18.2.4",
"@schematics/angular": "~14.0.0",
"@types/jasmine": "~3.5.0",
"@types/node": "^20.12.3",
"@types/jasmine": "^5.1.4",
"@types/node": "^22.5.5",
"browser-sync": "^3.0.2",
"coveralls": "^3.1.1",
"jasmine": "3.5.0",
"jasmine-spec-reporter": "~5.0.0",
"jasmine": "^5.3.0",
"jasmine-spec-reporter": "^7.0.0",
"lite-server": "^2.6.1",
"nyc": "^17.0.0",
"rxjs": "^7.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.3.2"
"typescript": "~5.5.4"
}
}
2 changes: 1 addition & 1 deletion packages/cli/templates/quickstart/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"devDependencies": {
"concurrently": "^3.1.0",
"lite-server": "^2.5.4",
"typescript": "~4.7.2",
"typescript": "~5.5.4",
"canonical-path": "0.0.2",
"http-server": "^0.12.1",
"tslint": "~6.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"jsdom": "^22.1.0",
"typescript": "^5.0.2",
"typescript": "~5.5.4",
"vite": "^4.4.9",
"vitest-canvas-mock": "^0.3.3",
"igniteui-cli": "~$(cliVersion)"
Expand Down
Loading

0 comments on commit ee2782e

Please sign in to comment.