Skip to content

Commit 458a76e

Browse files
chimuraiMark Bruning
andauthored
feat: 🎸 upgrade to Angular 15 (ngneat#594)
* feat: 🎸 upgrade to Angular 15 BREAKING CHANGE: 🧨 Angular 15 BREAKING CHANGE: 🧨 The library now required a min version of Angular 15.0.3 * feat: update karma test runner config for ng 15 - update @angular-builders/jest to 15 - update devkit karma settings to follow ng15 standards - run 14 to 15 migration for cli - add test file inclusion to angular.json - remove webpack code from test.ts Co-authored-by: Mark Bruning <[email protected]>
1 parent a0235c4 commit 458a76e

File tree

8 files changed

+1696
-2085
lines changed

8 files changed

+1696
-2085
lines changed

angular.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,17 @@
2424
"test": {
2525
"builder": "@angular-devkit/build-angular:karma",
2626
"options": {
27-
"main": "projects/spectator/test/test.ts",
2827
"tsConfig": "projects/spectator/tsconfig.spec.json",
29-
"karmaConfig": "projects/spectator/karma.conf.js"
28+
"karmaConfig": "projects/spectator/karma.conf.js",
29+
"polyfills": [
30+
"core-js/es/reflect",
31+
"zone.js",
32+
"zone.js/testing"
33+
],
34+
"include": [
35+
"../test/test.ts",
36+
"../test/**/*.spec.ts"
37+
]
3038
}
3139
},
3240
"test-jest": {
@@ -50,5 +58,13 @@
5058
"@angular-eslint/schematics"
5159
],
5260
"analytics": "7ba6b8e6-99c8-4300-b84d-21162a96a924"
61+
},
62+
"schematics": {
63+
"@angular-eslint/schematics:application": {
64+
"setParserOptionsProject": true
65+
},
66+
"@angular-eslint/schematics:library": {
67+
"setParserOptionsProject": true
68+
}
5369
}
5470
}

package.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,58 +32,58 @@
3232
"release:dry": "cd projects/spectator && standard-version --infile ../../CHANGELOG.md --dry-run"
3333
},
3434
"devDependencies": {
35-
"@angular-builders/jest": "13.0.0",
36-
"@angular-devkit/build-angular": "^14.2.4",
37-
"@angular-devkit/schematics": "^14.2.4",
38-
"@angular-eslint/builder": "14.1.2",
39-
"@angular-eslint/eslint-plugin": "14.1.2",
40-
"@angular-eslint/eslint-plugin-template": "14.1.2",
41-
"@angular-eslint/schematics": "14.1.2",
42-
"@angular-eslint/template-parser": "14.1.2",
43-
"@angular/animations": "^14.2.4",
44-
"@angular/cdk": "^14.0.0",
45-
"@angular/cli": "^14.2.4",
46-
"@angular/common": "^14.2.4",
47-
"@angular/compiler": "^14.2.4",
48-
"@angular/compiler-cli": "^14.2.4",
49-
"@angular/core": "^14.2.4",
50-
"@angular/forms": "^14.2.4",
51-
"@angular/language-service": "^14.2.4",
52-
"@angular/platform-browser": "^14.2.4",
53-
"@angular/platform-browser-dynamic": "^14.2.4",
54-
"@angular/router": "14.2.4",
35+
"@angular-builders/jest": "^15.0.0",
36+
"@angular-devkit/build-angular": "^15.0.3",
37+
"@angular-devkit/schematics": "^15.0.3",
38+
"@angular-eslint/builder": "15.1.0",
39+
"@angular-eslint/eslint-plugin": "15.1.0",
40+
"@angular-eslint/eslint-plugin-template": "15.1.0",
41+
"@angular-eslint/schematics": "15.1.0",
42+
"@angular-eslint/template-parser": "15.1.0",
43+
"@angular/animations": "^15.0.3",
44+
"@angular/cdk": "^15.0.2",
45+
"@angular/cli": "^15.0.3",
46+
"@angular/common": "^15.0.3",
47+
"@angular/compiler": "^15.0.3",
48+
"@angular/compiler-cli": "^15.0.3",
49+
"@angular/core": "^15.0.3",
50+
"@angular/forms": "^15.0.3",
51+
"@angular/language-service": "^15.0.3",
52+
"@angular/platform-browser": "^15.0.3",
53+
"@angular/platform-browser-dynamic": "^15.0.3",
54+
"@angular/router": "15.0.3",
5555
"@commitlint/cli": "12.0.1",
5656
"@commitlint/config-angular": "12.0.1",
5757
"@commitlint/config-conventional": "12.0.1",
5858
"@types/jasmine": "3.8.1",
5959
"@types/jest": "26.0.24",
6060
"@types/node": "16.3.1",
61-
"@typescript-eslint/eslint-plugin": "^5.36.2",
62-
"@typescript-eslint/parser": "^5.36.2",
61+
"@typescript-eslint/eslint-plugin": "^5.43.0",
62+
"@typescript-eslint/parser": "^5.43.0",
6363
"all-contributors-cli": "^6.19.0",
6464
"core-js": "^3.9.1",
6565
"cross-env": "^5.1.4",
6666
"cz-conventional-changelog": "^3.3.0",
67-
"eslint": "^8.23.0",
67+
"eslint": "^8.28.0",
6868
"git-cz": "^4.7.6",
6969
"helpful-decorators": "^2.1.0",
7070
"husky": "^4.3.8",
7171
"jasmine-core": "3.8.0",
7272
"jasmine-spec-reporter": "7.0.0",
7373
"jest": "28.0.0",
74-
"jest-preset-angular": "12.1.0",
74+
"jest-preset-angular": "12.2.3",
7575
"karma": "6.3.4",
7676
"karma-chrome-launcher": "3.1.0",
7777
"karma-coverage-istanbul-reporter": "3.0.3",
7878
"karma-jasmine": "4.0.1",
7979
"karma-jasmine-html-reporter": "1.7.0",
8080
"lint-staged": "^10.5.3",
81-
"ng-packagr": "14.0.0",
81+
"ng-packagr": "15.0.2",
8282
"prettier": "2.3.2",
8383
"rxjs": "6.6.3",
8484
"standard-version": "^9.1.0",
8585
"ts-node": "10.1.0",
86-
"typescript": "4.7.3",
86+
"typescript": "4.8.4",
8787
"zone.js": "0.11.4"
8888
},
8989
"config": {
@@ -97,4 +97,4 @@
9797
"git add"
9898
]
9999
}
100-
}
100+
}

projects/spectator/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
"tslib": "^2.1.0"
3030
},
3131
"peerDependencies": {
32-
"@angular/common": ">= 14.2.0",
33-
"@angular/router": ">= 14.2.0",
34-
"@angular/animations": ">= 14.2.0"
32+
"@angular/common": ">= 15.0.3",
33+
"@angular/router": ">= 15.0.3",
34+
"@angular/animations": ">= 15.0.3"
3535
},
3636
"schematics": "./schematics/collection.json"
3737
}

projects/spectator/test/test.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,9 @@
1-
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2-
3-
import 'core-js/es/reflect';
4-
import 'zone.js';
5-
import 'zone.js/testing';
6-
import { getTestBed } from '@angular/core/testing';
7-
import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
8-
91
import { defineGlobalsInjections } from '../src/lib/globals-injections';
102

113
import { TranslatePipe } from './translate.pipe';
124
import { TranslateService } from './translate.service';
135

14-
declare const require: any;
15-
166
defineGlobalsInjections({
177
providers: [TranslateService],
188
declarations: [TranslatePipe],
199
});
20-
21-
// First, initialize the Angular testing environment.
22-
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
23-
teardown: { destroyAfterEach: true },
24-
});
25-
// Then we find all the tests.
26-
const context = require.context('./', true, /\.spec\.ts$/);
27-
// And load the modules.
28-
context.keys().map(context);

projects/spectator/tsconfig.lib.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"outDir": "../../out-tsc/lib",
55
"declarationMap": true,
6-
"target": "es2020",
76
"declaration": true,
87
"inlineSources": true,
98
"typeRoots": [
@@ -29,4 +28,4 @@
2928
"exclude": [
3029
"test/**/*.ts"
3130
]
32-
}
31+
}

projects/spectator/tsconfig.spec.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
44
"outDir": "../../out-tsc/spec",
5-
"target": "es2020",
65
"types": [
76
"jasmine",
87
"node"

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"importHelpers": true,
1313
"strict": true,
1414
"noImplicitAny": false,
15-
"target": "es2020",
15+
"target": "ES2022",
1616
"esModuleInterop": true,
1717
"typeRoots": [
1818
"node_modules/@types"
@@ -31,6 +31,7 @@
3131
"@ngneat/spectator/internals": [
3232
"projects/spectator/internals/src/public_api.ts"
3333
]
34-
}
34+
},
35+
"useDefineForClassFields": false
3536
}
3637
}

0 commit comments

Comments
 (0)