Skip to content

Commit 97a6df1

Browse files
committed
chore: update configs and tests, cleanups
1 parent a8297d3 commit 97a6df1

15 files changed

+78
-114
lines changed

angular.json

+19-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
6-
"coreui": {
6+
"coreui-demo": {
77
"projectType": "application",
88
"schematics": {
99
"@schematics/angular:component": {
@@ -20,10 +20,14 @@
2020
"build": {
2121
"builder": "@angular-devkit/build-angular:browser",
2222
"options": {
23-
"outputPath": "dist/coreui/demo",
23+
"outputPath": "dist/coreui-demo",
2424
"index": "src/index.html",
2525
"main": "src/main.ts",
26-
"polyfills": "src/polyfills.ts",
26+
"polyfills": [
27+
"@angular/localize/init",
28+
"zone.js",
29+
"zone.js/testing"
30+
],
2731
"tsConfig": "src/tsconfig.app.json",
2832
"inlineStyleLanguage": "scss",
2933
"assets": [
@@ -73,25 +77,29 @@
7377
"builder": "@angular-devkit/build-angular:dev-server",
7478
"configurations": {
7579
"production": {
76-
"buildTarget": "coreui:build:production"
80+
"buildTarget": "coreui-demo:build:production"
7781
},
7882
"development": {
79-
"buildTarget": "coreui:build:development"
83+
"buildTarget": "coreui-demo:build:development"
8084
}
8185
},
8286
"defaultConfiguration": "development"
8387
},
8488
"extract-i18n": {
8589
"builder": "@angular-devkit/build-angular:extract-i18n",
8690
"options": {
87-
"buildTarget": "coreui:build"
91+
"buildTarget": "coreui-demo:build"
8892
}
8993
},
9094
"test": {
9195
"builder": "@angular-devkit/build-angular:karma",
9296
"options": {
9397
"main": "src/test.ts",
94-
"polyfills": "src/polyfills.ts",
98+
"polyfills": [
99+
"@angular/localize/init",
100+
"zone.js",
101+
"zone.js/testing"
102+
],
95103
"tsConfig": "src/tsconfig.spec.json",
96104
"karmaConfig": "src/karma.conf.js",
97105
"inlineStyleLanguage": "scss",
@@ -108,11 +116,11 @@
108116
"cypress-run": {
109117
"builder": "@cypress/schematic:cypress",
110118
"options": {
111-
"devServerTarget": "coreui:serve"
119+
"devServerTarget": "coreui-demo:serve"
112120
},
113121
"configurations": {
114122
"production": {
115-
"devServerTarget": "coreui:serve:production"
123+
"devServerTarget": "coreui-demo:serve:production"
116124
}
117125
}
118126
},
@@ -126,13 +134,13 @@
126134
"e2e": {
127135
"builder": "@cypress/schematic:cypress",
128136
"options": {
129-
"devServerTarget": "coreui:serve",
137+
"devServerTarget": "coreui-demo:serve",
130138
"watch": false,
131139
"headless": true
132140
},
133141
"configurations": {
134142
"production": {
135-
"devServerTarget": "coreui:serve:production"
143+
"devServerTarget": "coreui-demo:serve:production"
136144
}
137145
}
138146
}

cypress/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"compilerOptions": {
55
"sourceMap": false,
66
"types": ["cypress"],
7-
}
7+
},
8+
"exclude": [],
89
}

projects/coreui-angular/src/lib/breadcrumb/cui-breadcrumb.component.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { RouterTestingModule } from '@angular/router/testing';
2+
import { RouterModule } from '@angular/router';
33

44
import { CuiBreadcrumbComponent } from './cui-breadcrumb.component';
55

@@ -9,7 +9,7 @@ describe('CuiBreadcrumbComponent', () => {
99

1010
beforeEach(waitForAsync(() => {
1111
TestBed.configureTestingModule({
12-
imports: [RouterTestingModule.withRoutes([]), CuiBreadcrumbComponent],
12+
imports: [RouterModule.forRoot([]), CuiBreadcrumbComponent],
1313
})
1414
.compileComponents();
1515
}));

src/app/app.component.spec.ts

+17-11
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
import { RouterTestingModule } from '@angular/router/testing';
2-
import { TestBed, waitForAsync } from '@angular/core/testing';
3-
import { AppComponent } from './app.component';
1+
import {TestBed, waitForAsync} from '@angular/core/testing';
2+
import {RouterModule} from "@angular/router";
3+
import {AppComponent} from './app.component';
4+
45
describe('AppComponent', () => {
5-
beforeEach(waitForAsync(() => {
6-
TestBed.configureTestingModule({
7-
declarations: [
8-
AppComponent
9-
],
10-
imports: [ RouterTestingModule ]
6+
beforeEach(async () => {
7+
await TestBed.configureTestingModule({
8+
declarations: [AppComponent],
9+
imports: [RouterModule]
1110
}).compileComponents();
12-
}));
11+
});
12+
1313
it('should create the app', waitForAsync(() => {
1414
const fixture = TestBed.createComponent(AppComponent);
15-
const app = fixture.debugElement.componentInstance;
15+
const app = fixture.componentInstance;
1616
expect(app).toBeTruthy();
1717
}));
18+
19+
it(`should have as title 'CoreUI Angular Admin Template'`, () => {
20+
const fixture = TestBed.createComponent(AppComponent);
21+
const app = fixture.componentInstance;
22+
expect(app.title).toEqual('CoreUI 2 for Angular 18');
23+
});
1824
});

src/app/app.component.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { Component, OnInit } from '@angular/core';
2-
import { Router, NavigationEnd } from '@angular/router';
1+
import {Component, OnInit} from '@angular/core';
2+
import {NavigationEnd, Router} from '@angular/router';
33

44
@Component({
5-
// tslint:disable-next-line
6-
selector: 'body',
7-
template: '<router-outlet></router-outlet>'
5+
selector: 'app-root',
6+
template: '<router-outlet />',
7+
standalone: false
88
})
99
export class AppComponent implements OnInit {
10-
title = 'CoreUI 2 for Angular 15';
11-
constructor(private router: Router) { }
10+
title = 'CoreUI 2 for Angular 18';
11+
12+
constructor(private router: Router) {}
1213

1314
ngOnInit() {
1415
this.router.events.subscribe((evt) => {

src/app/app.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { BrowserModule } from '@angular/platform-browser';
21
import { NgModule } from '@angular/core';
32
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
3+
import { BrowserModule } from '@angular/platform-browser';
44
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
55

66
import { AppComponent } from './app.component';

src/app/app.routing.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const routes: Routes = [
3131
];
3232

3333
@NgModule({
34-
imports: [ RouterModule.forRoot(routes, {}) ],
34+
imports: [ RouterModule.forRoot(routes) ],
3535
exports: [ RouterModule ]
3636
})
3737
export class AppRoutingModule {}

src/app/containers/default-layout/default-layout.component.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
</app-aside>
2828
</div>
2929
<app-footer>
30-
<span><a href="https://coreui.io">CoreUI</a> &copy; 2024 creativeLabs.</span>
30+
<span><a href="https://coreui.io">CoreUI</a> &copy; 2025 creativeLabs.</span>
3131
<span class="ml-auto">Powered by <a href="https://coreui.io/angular">CoreUI 2 for Angular</a></span>
3232
</app-footer>

src/main.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="@angular/localize" />
2+
13
import { enableProdMode } from '@angular/core';
24
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35

src/polyfills.ts

-59
This file was deleted.

src/scss/vendors/_variables.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// Override Boostrap variables
22
@import "../variables";
3-
@import "~bootstrap/scss/mixins";
4-
@import "~@coreui/coreui/scss/variables";
3+
@import "bootstrap/scss/mixins";
4+
@import "@coreui/coreui/scss/variables";

src/test.ts

+4-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
22

33
import 'zone.js/testing';
4-
import { getTestBed } from '@angular/core/testing';
5-
import {
6-
BrowserDynamicTestingModule,
7-
platformBrowserDynamicTesting
8-
} from '@angular/platform-browser-dynamic/testing';
4+
import {getTestBed} from '@angular/core/testing';
5+
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
96

107
// First, initialize the Angular testing environment.
118
getTestBed().initTestEnvironment(
129
BrowserDynamicTestingModule,
1310
platformBrowserDynamicTesting(), {
14-
teardown: { destroyAfterEach: false }
15-
}
11+
teardown: {destroyAfterEach: false}
12+
}
1613
);

src/tsconfig.app.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"compilerOptions": {
55
"outDir": "../out-tsc/app",
66
"baseUrl": "./",
7-
"types": [],
7+
"types": ["node"],
88
"paths": {
99
"@angular/*": [
1010
"../node_modules/@angular/*"
@@ -13,9 +13,12 @@
1313
},
1414
"files": [
1515
"main.ts",
16-
"polyfills.ts"
1716
],
1817
"include": [
1918
"**/*.d.ts"
19+
],
20+
"exclude": [
21+
"test.ts",
22+
"**/*.spec.ts"
2023
]
2124
}

src/tsconfig.spec.json

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44
"compilerOptions": {
55
"outDir": "../out-tsc/spec",
66
"baseUrl": "./",
7-
"types": [
8-
"jasmine"
9-
]
7+
"types": ["jasmine"]
108
},
119
"files": [
12-
"test.ts",
13-
"polyfills.ts"
10+
"test.ts"
1411
],
1512
"include": [
1613
"**/*.spec.ts",

tsconfig.json

+12-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,16 @@
33
"compileOnSave": false,
44
"compilerOptions": {
55
"baseUrl": "./",
6+
"types": [
7+
"@angular/localize"
8+
],
69
"paths": {
710
"coreui-angular": [
811
"dist/coreui-angular"
912
]
1013
},
1114
"outDir": "./dist/out-tsc",
15+
"esModuleInterop": true,
1216
"forceConsistentCasingInFileNames": true,
1317
"strict": true,
1418
"noImplicitOverride": true,
@@ -17,17 +21,16 @@
1721
"noFallthroughCasesInSwitch": true,
1822
"sourceMap": true,
1923
"declaration": false,
20-
"downlevelIteration": true,
2124
"experimentalDecorators": true,
2225
"moduleResolution": "node",
2326
"importHelpers": true,
2427
"target": "ES2022",
25-
"module": "es2022",
28+
"module": "ES2022",
2629
"typeRoots": [
2730
"node_modules/@types"
2831
],
2932
"lib": [
30-
"es2022",
33+
"ES2022",
3134
"dom"
3235
],
3336
"useDefineForClassFields": false
@@ -37,5 +40,10 @@
3740
"strictInjectionParameters": true,
3841
"strictInputAccessModifiers": true,
3942
"strictTemplates": true
40-
}
43+
},
44+
"exclude": [
45+
"./cypress/**/*.ts",
46+
"./cypress/tsconfig.json",
47+
"cypress-angular/**/*.ts",
48+
],
4149
}

0 commit comments

Comments
 (0)