Skip to content

Commit 21752a4

Browse files
Update angular package to 15 (#613)
* Install node modules * Remove peer dependency causing failure to migration * Migrate angular from 14 to 15 * Add back the removed peer dependency package * Upgrade peer dependencies * Update package.lock json * Fix lint issues * Fix test.ts script * update angular/cdk verion and peer dependency for project
1 parent 164f05e commit 21752a4

File tree

10 files changed

+17695
-5884
lines changed

10 files changed

+17695
-5884
lines changed

package-lock.json

+17,656-5,806
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+15-15
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,22 @@
3939
"angular-datepicker"
4040
],
4141
"devDependencies": {
42-
"@angular-devkit/build-angular": "^14.1.0",
43-
"@angular-devkit/core": "^14.1.0",
42+
"@angular-devkit/build-angular": "^15.0.1",
43+
"@angular-devkit/core": "^15.0.1",
4444
"@angular-eslint/builder": "^14.0.2",
4545
"@angular-eslint/eslint-plugin": "^14.0.2",
4646
"@angular-eslint/eslint-plugin-template": "^14.0.2",
47-
"@angular-eslint/schematics": "^14.0.2",
47+
"@angular-eslint/schematics": "^15.1.0",
4848
"@angular-eslint/template-parser": "^14.0.2",
49-
"@angular/cli": "^14.1.0",
50-
"@angular/common": "14.1.0",
51-
"@angular/compiler": "14.1.0",
52-
"@angular/compiler-cli": "14.1.0",
53-
"@angular/core": "^14.1.0",
54-
"@angular/forms": "^14.1.0",
55-
"@angular/platform-browser": "14.1.0",
56-
"@angular/platform-browser-dynamic": "14.1.0",
57-
"@angular/router": "14.1.0",
49+
"@angular/cli": "^15.0.1",
50+
"@angular/common": "15.0.1",
51+
"@angular/compiler": "15.0.1",
52+
"@angular/compiler-cli": "15.0.1",
53+
"@angular/core": "^15.0.1",
54+
"@angular/forms": "^15.0.1",
55+
"@angular/platform-browser": "15.0.1",
56+
"@angular/platform-browser-dynamic": "15.0.1",
57+
"@angular/router": "15.0.1",
5858
"@types/google.analytics": "^0.0.42",
5959
"@types/jasmine": "^4.0.3",
6060
"@types/node": "^16.11.7",
@@ -71,20 +71,20 @@
7171
"karma-jasmine": "^5.1.0",
7272
"karma-jasmine-html-reporter": "^2.0.0",
7373
"less": "^4.1.3",
74-
"ng-packagr": "^14.1.0",
74+
"ng-packagr": "^15.0.1",
7575
"protractor": "^7.0.0",
7676
"rimraf": "^3.0.2",
7777
"rxjs": "^6.5.3",
7878
"ts-node": "^10.9.1",
79-
"typescript": "~4.7.4",
79+
"typescript": "~4.8.4",
8080
"zone.js": "~0.11.4"
8181
},
8282
"angularCompilerOptions": {
8383
"skipTemplateCodegen": true,
8484
"strictMetadataEmit": true
8585
},
8686
"dependencies": {
87-
"@angular/cdk": "^14.1.0",
87+
"@angular/cdk": "^15.0.0",
8888
"dayjs": "^1.11.4",
8989
"tslib": "^2.4.0"
9090
}

projects/ng2-date-picker/.browserslistrc

-16
This file was deleted.

projects/ng2-date-picker/.eslintrc.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
],
1111
"parserOptions": {
1212
"project": [
13-
"projects/ng2-datepicker/tsconfig.lib.json",
14-
"projects/ng2-datepicker/tsconfig.spec.json"
13+
"tsconfig.lib.json",
14+
"tsconfig.spec.json"
1515
],
16+
"tsconfigRootDir": "projects/ng2-date-picker",
1617
"createDefaultProgram": true
1718
},
1819
"rules": {

projects/ng2-date-picker/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
"angular-datepicker"
2020
],
2121
"peerDependencies": {
22-
"@angular/common": "^14.1.0",
23-
"@angular/core": "^14.1.0",
24-
"@angular/cdk": "^14.1.0",
22+
"@angular/common": "15.0.1",
23+
"@angular/core": "^15.0.1",
24+
"@angular/cdk": "^15.0.0",
2525
"dayjs": "^1.11.4"
2626
},
2727
"dependencies": {

projects/ng2-date-picker/src/test.ts

-12
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,8 @@ import {
88
platformBrowserDynamicTesting
99
} from '@angular/platform-browser-dynamic/testing';
1010

11-
declare const require: {
12-
context(path: string, deep?: boolean, filter?: RegExp): {
13-
<T>(id: string): T;
14-
keys(): string[];
15-
};
16-
};
17-
1811
// First, initialize the Angular testing environment.
1912
getTestBed().initTestEnvironment(
2013
BrowserDynamicTestingModule,
2114
platformBrowserDynamicTesting(),
2215
);
23-
24-
// Then we find all the tests.
25-
const context = require.context('./', true, /\.spec\.ts$/);
26-
// And load the modules.
27-
context.keys().map(context);

src/app/demo.module.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ import {TimeDirectiveDemoComponent} from './demo/date-pickers/time/time-directiv
9191
path: '**',
9292
redirectTo: ''
9393
}
94-
], {relativeLinkResolution: 'legacy'})
94+
], {})
9595
],
9696
declarations: [
9797
DemoRootComponent,

src/test.ts

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

3-
import 'zone.js/dist/long-stack-trace-zone';
4-
import 'zone.js/dist/proxy.js';
5-
import 'zone.js/dist/sync-test';
6-
import 'zone.js/dist/jasmine-patch';
7-
import 'zone.js/dist/async-test';
8-
import 'zone.js/dist/fake-async-test';
9-
import {getTestBed} from '@angular/core/testing';
10-
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';
11-
12-
// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
13-
declare var __karma__: any;
14-
declare var require: any;
15-
16-
// Prevent Karma from running prematurely.
17-
__karma__.loaded = function () {
18-
};
3+
import 'zone.js';
4+
import 'zone.js/testing';
5+
import { getTestBed } from '@angular/core/testing';
6+
import {
7+
BrowserDynamicTestingModule,
8+
platformBrowserDynamicTesting,
9+
} from '@angular/platform-browser-dynamic/testing';
1910

2011
// First, initialize the Angular testing environment.
2112
getTestBed().initTestEnvironment(
2213
BrowserDynamicTestingModule,
23-
platformBrowserDynamicTesting(), {
24-
teardown: { destroyAfterEach: false }
25-
}
14+
platformBrowserDynamicTesting(),
15+
{
16+
teardown: { destroyAfterEach: false },
17+
}
2618
);
27-
// Then we find all the tests.
28-
const context = require.context('./', true, /\.spec\.ts$/);
29-
// And load the modules.
30-
context.keys().map(context);
31-
// Finally, start Karma to run the tests.
32-
__karma__.start();

tsconfig.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
"experimentalDecorators": true,
2121
"moduleResolution": "node",
2222
"importHelpers": true,
23-
"target": "es2020",
23+
"target": "ES2022",
2424
"module": "es2020",
2525
"lib": [
2626
"es2020",
2727
"dom"
28-
]
28+
],
29+
"useDefineForClassFields": false
2930
},
3031
"angularCompilerOptions": {
3132
"enableI18nLegacyMessageIdFormat": false,

tsconfig.spec.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
],
1212
"outDir": "./out-tsc/spec",
1313
"module": "es2020",
14-
"target": "es2020",
14+
"target": "ES2022",
1515
"baseUrl": "tsconfig.spec",
1616
"types": [
1717
"jasmine",
1818
"node"
19-
]
19+
],
20+
"useDefineForClassFields": false
2021
},
2122
"files": [
2223
"src/test.ts",

0 commit comments

Comments
 (0)