Skip to content

Commit

Permalink
Update angular package to 15 (#613)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
agrahari-himanshu authored Nov 25, 2022
1 parent 164f05e commit 21752a4
Show file tree
Hide file tree
Showing 10 changed files with 17,695 additions and 5,884 deletions.
23,462 changes: 17,656 additions & 5,806 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@
"angular-datepicker"
],
"devDependencies": {
"@angular-devkit/build-angular": "^14.1.0",
"@angular-devkit/core": "^14.1.0",
"@angular-devkit/build-angular": "^15.0.1",
"@angular-devkit/core": "^15.0.1",
"@angular-eslint/builder": "^14.0.2",
"@angular-eslint/eslint-plugin": "^14.0.2",
"@angular-eslint/eslint-plugin-template": "^14.0.2",
"@angular-eslint/schematics": "^14.0.2",
"@angular-eslint/schematics": "^15.1.0",
"@angular-eslint/template-parser": "^14.0.2",
"@angular/cli": "^14.1.0",
"@angular/common": "14.1.0",
"@angular/compiler": "14.1.0",
"@angular/compiler-cli": "14.1.0",
"@angular/core": "^14.1.0",
"@angular/forms": "^14.1.0",
"@angular/platform-browser": "14.1.0",
"@angular/platform-browser-dynamic": "14.1.0",
"@angular/router": "14.1.0",
"@angular/cli": "^15.0.1",
"@angular/common": "15.0.1",
"@angular/compiler": "15.0.1",
"@angular/compiler-cli": "15.0.1",
"@angular/core": "^15.0.1",
"@angular/forms": "^15.0.1",
"@angular/platform-browser": "15.0.1",
"@angular/platform-browser-dynamic": "15.0.1",
"@angular/router": "15.0.1",
"@types/google.analytics": "^0.0.42",
"@types/jasmine": "^4.0.3",
"@types/node": "^16.11.7",
Expand All @@ -71,20 +71,20 @@
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.0.0",
"less": "^4.1.3",
"ng-packagr": "^14.1.0",
"ng-packagr": "^15.0.1",
"protractor": "^7.0.0",
"rimraf": "^3.0.2",
"rxjs": "^6.5.3",
"ts-node": "^10.9.1",
"typescript": "~4.7.4",
"typescript": "~4.8.4",
"zone.js": "~0.11.4"
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true
},
"dependencies": {
"@angular/cdk": "^14.1.0",
"@angular/cdk": "^15.0.0",
"dayjs": "^1.11.4",
"tslib": "^2.4.0"
}
Expand Down
16 changes: 0 additions & 16 deletions projects/ng2-date-picker/.browserslistrc

This file was deleted.

5 changes: 3 additions & 2 deletions projects/ng2-date-picker/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
],
"parserOptions": {
"project": [
"projects/ng2-datepicker/tsconfig.lib.json",
"projects/ng2-datepicker/tsconfig.spec.json"
"tsconfig.lib.json",
"tsconfig.spec.json"
],
"tsconfigRootDir": "projects/ng2-date-picker",
"createDefaultProgram": true
},
"rules": {
Expand Down
6 changes: 3 additions & 3 deletions projects/ng2-date-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"angular-datepicker"
],
"peerDependencies": {
"@angular/common": "^14.1.0",
"@angular/core": "^14.1.0",
"@angular/cdk": "^14.1.0",
"@angular/common": "15.0.1",
"@angular/core": "^15.0.1",
"@angular/cdk": "^15.0.0",
"dayjs": "^1.11.4"
},
"dependencies": {
Expand Down
12 changes: 0 additions & 12 deletions projects/ng2-date-picker/src/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
<T>(id: string): T;
keys(): string[];
};
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(),
);

// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
2 changes: 1 addition & 1 deletion src/app/demo.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ import {TimeDirectiveDemoComponent} from './demo/date-pickers/time/time-directiv
path: '**',
redirectTo: ''
}
], {relativeLinkResolution: 'legacy'})
], {})
],
declarations: [
DemoRootComponent,
Expand Down
36 changes: 11 additions & 25 deletions src/test.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/long-stack-trace-zone';
import 'zone.js/dist/proxy.js';
import 'zone.js/dist/sync-test';
import 'zone.js/dist/jasmine-patch';
import 'zone.js/dist/async-test';
import 'zone.js/dist/fake-async-test';
import {getTestBed} from '@angular/core/testing';
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';

// Unfortunately there's no typing for the `__karma__` variable. Just declare it as any.
declare var __karma__: any;
declare var require: any;

// Prevent Karma from running prematurely.
__karma__.loaded = function () {
};
import 'zone.js';
import 'zone.js/testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting,
} from '@angular/platform-browser-dynamic/testing';

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting(), {
teardown: { destroyAfterEach: false }
}
platformBrowserDynamicTesting(),
{
teardown: { destroyAfterEach: false },
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
// Finally, start Karma to run the tests.
__karma__.start();
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2020",
"target": "ES2022",
"module": "es2020",
"lib": [
"es2020",
"dom"
]
],
"useDefineForClassFields": false
},
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@
],
"outDir": "./out-tsc/spec",
"module": "es2020",
"target": "es2020",
"target": "ES2022",
"baseUrl": "tsconfig.spec",
"types": [
"jasmine",
"node"
]
],
"useDefineForClassFields": false
},
"files": [
"src/test.ts",
Expand Down

0 comments on commit 21752a4

Please sign in to comment.