From bab8db42cddafcf87e3441d248badb45cc734961 Mon Sep 17 00:00:00 2001 From: RAHUL RATHORE Date: Thu, 9 Dec 2021 12:05:21 +0530 Subject: [PATCH] feat: angular upgrade v12 to v13 for carrier mobile ionic #1427 --- packages/admin-web-angular/package.json | 8 ++-- packages/carrier-mobile-ionic/.gitignore | 1 + packages/carrier-mobile-ionic/angular.json | 17 ------- packages/carrier-mobile-ionic/package.json | 44 +++++++++---------- .../carrier-mobile-ionic/src/polyfills.ts | 9 ---- packages/carrier-mobile-ionic/src/test.ts | 4 +- yarn.lock | 30 +++++++++++-- 7 files changed, 56 insertions(+), 57 deletions(-) diff --git a/packages/admin-web-angular/package.json b/packages/admin-web-angular/package.json index 3687a06cf..407eba46c 100644 --- a/packages/admin-web-angular/package.json +++ b/packages/admin-web-angular/package.json @@ -51,7 +51,7 @@ "dependencies": { "@agm/core": "^1.1.0", "@angular/animations": "^13.0.3", - "@angular/cdk": "^12.2.10", + "@angular/cdk": "^13.1.0", "@angular/common": "^13.0.3", "@angular/compiler": "^13.0.3", "@angular/core": "^13.0.3", @@ -61,6 +61,7 @@ "@angular/platform-browser": "^13.0.3", "@angular/platform-browser-dynamic": "^13.0.3", "@angular/router": "^13.0.3", + "@apollo/client": "^3.5.5", "@asymmetrik/ngx-leaflet": "^8.1.0", "@ever-co/angular2-wizard": "^0.6.2", "@ever-platform/common": "^0.4.3", @@ -83,7 +84,6 @@ "angular2-toaster": "^11.0.1", "angular2-uuid": "^1.1.1", "apollo-angular": "^2.6.0", - "@apollo/client": "^3.5.5", "apollo-upload-client": "^16.0.0", "bootstrap": "^4.6.0", "buffer": "^6.0.3", @@ -98,7 +98,6 @@ "global": "^4.4.0", "graphql": "15.7.2", "graphql-tag": "^2.12.6", - "subscriptions-transport-ws": "^0.11.0", "highlight.js": "^11.2.0", "intl": "^1.2.5", "ionicons": "^5.5.3", @@ -133,6 +132,7 @@ "socicon": "^3.0.5", "socket.io-client": "^4.3.0", "stripe": "^8.183.0", + "subscriptions-transport-ws": "^0.11.0", "tinymce": "^5.10.0", "tslib": "^2.3.1", "typeface-exo": "^1.1.13", @@ -181,4 +181,4 @@ "yarn": ">=1.13.0" }, "snyk": false -} \ No newline at end of file +} diff --git a/packages/carrier-mobile-ionic/.gitignore b/packages/carrier-mobile-ionic/.gitignore index a38a17bb6..7878ead78 100644 --- a/packages/carrier-mobile-ionic/.gitignore +++ b/packages/carrier-mobile-ionic/.gitignore @@ -1,3 +1,4 @@ +/.angular/cache *~ *.sw[mnpcod] *.log diff --git a/packages/carrier-mobile-ionic/angular.json b/packages/carrier-mobile-ionic/angular.json index 0f1653560..ef8ead6bf 100644 --- a/packages/carrier-mobile-ionic/angular.json +++ b/packages/carrier-mobile-ionic/angular.json @@ -118,16 +118,6 @@ ] } }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": ["**/node_modules/**"] - } - }, "ionic-cordova-build": { "builder": "@ionic/angular-toolkit:cordova-build", "options": { @@ -165,13 +155,6 @@ "protractorConfig": "e2e/protractor.conf.js", "devServerTarget": "app:serve" } - }, - "lint": { - "builder": "@angular-devkit/build-angular:tslint", - "options": { - "tsConfig": "e2e/tsconfig.e2e.json", - "exclude": ["**/node_modules/**"] - } } } } diff --git a/packages/carrier-mobile-ionic/package.json b/packages/carrier-mobile-ionic/package.json index b7735fb67..98728389e 100644 --- a/packages/carrier-mobile-ionic/package.json +++ b/packages/carrier-mobile-ionic/package.json @@ -44,16 +44,17 @@ "cordova:run:prod:device": "cross-env NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 yarn run config:prod && yarn ionic cordova run android --prod --release --device" }, "dependencies": { - "@angular/animations": "^12.2.10", - "@angular/common": "^12.2.10", - "@angular/compiler": "^12.2.10", - "@angular/core": "^12.2.10", - "@angular/forms": "^12.2.10", - "@angular/language-service": "^12.2.10", - "@angular/platform-browser": "^12.2.10", - "@angular/platform-browser-dynamic": "^12.2.10", - "@angular/router": "^12.2.10", - "@angular/service-worker": "^12.2.10", + "@angular/animations": "^13.0.3", + "@angular/common": "^13.0.3", + "@angular/compiler": "^13.0.3", + "@angular/core": "^13.0.3", + "@angular/forms": "^13.0.3", + "@angular/language-service": "^13.0.3", + "@angular/platform-browser": "^13.0.3", + "@angular/platform-browser-dynamic": "^13.0.3", + "@angular/router": "^13.0.3", + "@angular/service-worker": "^13.0.3", + "@apollo/client": "^3.5.5", "@ever-platform/common": "^0.4.3", "@ever-platform/common-angular": "^0.4.3", "@ionic-native/barcode-scanner": "^5.36.0", @@ -78,11 +79,9 @@ "@ionic/angular": "^5.8.4", "@ionic/pro": "^2.0.4", "@ionic/storage": "^3.0.6", - "ngx-progressbar": "^6.1.1", "@ngx-translate/core": "^13.0.0", "@ngx-translate/http-loader": "^6.0.0", "apollo-angular": "^2.6.0", - "@apollo/client": "^3.5.5", "call-number": "^1.0.1", "connect": "^3.7.0", "cordova-android": "^10.1.1", @@ -131,6 +130,7 @@ "mquery": "^4.0.0", "mx.ferreyra.callnumber": "0.0.2", "neo-async": "^2.6.2", + "ngx-progressbar": "^6.1.1", "phonegap-plugin-barcodescanner": "^8.0.1", "pm2": "^5.1.2", "qrcode": "^1.4.4", @@ -150,15 +150,15 @@ "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-builders/custom-webpack": "^12.1.3", - "@angular-devkit/architect": "^0.1202.10", - "@angular-devkit/build-angular": "^12.2.10", - "@angular-devkit/build-optimizer": "^0.1202.10", - "@angular-devkit/build-webpack": "^0.1202.10", - "@angular-devkit/core": "^12.2.10", - "@angular-devkit/schematics": "^12.2.10", - "@angular/cli": "^12.2.10", - "@angular/compiler-cli": "^12.2.10", + "@angular-builders/custom-webpack": "^13.0.0", + "@angular-devkit/architect": "^0.1300.4", + "@angular-devkit/build-angular": "^13.0.4", + "@angular-devkit/build-optimizer": "^0.1300.4", + "@angular-devkit/build-webpack": "^0.1300.4", + "@angular-devkit/core": "^13.0.4", + "@angular-devkit/schematics": "^13.0.4", + "@angular/cli": "^13.0.4", + "@angular/compiler-cli": "^13.0.3", "@ionic/angular-toolkit": "^4.0.0", "@ionic/lab": "^3.2.10", "@types/jasmine": "~3.9.1", @@ -176,7 +176,7 @@ "protractor": "~7.0.0", "ts-node": "~10.3.0", "tslint": "~5.20.1", - "typescript": "~4.2.4" + "typescript": "~4.4.4" }, "config": { "ionic_webpack": "./config/webpack.config.js" diff --git a/packages/carrier-mobile-ionic/src/polyfills.ts b/packages/carrier-mobile-ionic/src/polyfills.ts index 3135a03e6..d9c48d99c 100644 --- a/packages/carrier-mobile-ionic/src/polyfills.ts +++ b/packages/carrier-mobile-ionic/src/polyfills.ts @@ -40,9 +40,6 @@ import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js'; // import 'core-js/es6/weak-map'; // import 'core-js/es6/set'; -/** IE10 and IE11 requires the following for NgClass support on SVG elements */ -// import 'classlist.js'; // Run `npm install --save classlist.js`. - /** IE10 and IE11 requires the following for the Reflect API. */ // import 'core-js/es6/reflect'; @@ -50,12 +47,6 @@ import '@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js'; // Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove. import 'core-js/es7/reflect'; -/** - * Required to support Web Animations `@angular/platform-browser/animations`. - * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation - **/ -// import 'web-animations-js'; // Run `npm install --save web-animations-js`. - /*************************************************************************************************** * Zone JS is required by Angular itself. */ diff --git a/packages/carrier-mobile-ionic/src/test.ts b/packages/carrier-mobile-ionic/src/test.ts index fd00b5c2e..fc741695f 100644 --- a/packages/carrier-mobile-ionic/src/test.ts +++ b/packages/carrier-mobile-ionic/src/test.ts @@ -12,7 +12,9 @@ declare const require: any; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), { + teardown: { destroyAfterEach: false } +} ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); diff --git a/yarn.lock b/yarn.lock index 6bb678421..735221d2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,7 +35,20 @@ tsconfig-paths "^3.9.0" webpack-merge "^5.7.3" -"@angular-devkit/architect@0.1202.13", "@angular-devkit/architect@0.1300.4", "@angular-devkit/architect@>=0.1200.0 < 0.1300.0", "@angular-devkit/architect@^0.1202.10", "@angular-devkit/architect@^0.1202.7", "@angular-devkit/architect@^0.1300.4": +"@angular-builders/custom-webpack@^13.0.0": + version "13.0.0" + resolved "https://registry.yarnpkg.com/@angular-builders/custom-webpack/-/custom-webpack-13.0.0.tgz#d44fc216a4f1e9893eb09d2940d5df0ffda38ea8" + integrity sha512-b+xcbPKu7vwKBLwO/dQQsfKB6IsLwo0KWA9ifilf0RGCuLF3a8RcLEedHa6JKUCrDcHg/mcojjQ2Nh3+jncSJA== + dependencies: + "@angular-devkit/architect" ">=0.1300.0 < 0.1400.0" + "@angular-devkit/build-angular" "^13.0.0" + "@angular-devkit/core" "^13.0.0" + lodash "^4.17.15" + ts-node "^10.0.0" + tsconfig-paths "^3.9.0" + webpack-merge "^5.7.3" + +"@angular-devkit/architect@0.1202.13", "@angular-devkit/architect@0.1300.4", "@angular-devkit/architect@>=0.1200.0 < 0.1300.0", "@angular-devkit/architect@>=0.1300.0 < 0.1400.0", "@angular-devkit/architect@^0.1202.10", "@angular-devkit/architect@^0.1202.7", "@angular-devkit/architect@^0.1300.4": version "0.1202.13" resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1202.13.tgz#b9b883d62f628a6b31ce071da91e268f61da00ef" integrity sha512-LXgiidXwBgyWPqqWK4xR1/kCPQTMTzG5w+s7+LvENUZwbcdl6CKrOMjfgjo6WPr6yeq+WWQvPCD4pZ6nXRTm7A== @@ -43,7 +56,7 @@ "@angular-devkit/core" "12.2.13" rxjs "6.6.7" -"@angular-devkit/build-angular@^12.0.0", "@angular-devkit/build-angular@^12.2.10", "@angular-devkit/build-angular@^13.0.4", "@angular-devkit/build-angular@~12.2.10", "@angular-devkit/build-angular@~12.2.7": +"@angular-devkit/build-angular@^12.0.0", "@angular-devkit/build-angular@^13.0.0", "@angular-devkit/build-angular@^13.0.4", "@angular-devkit/build-angular@~12.2.10", "@angular-devkit/build-angular@~12.2.7": version "12.2.13" resolved "https://registry.yarnpkg.com/@angular-devkit/build-angular/-/build-angular-12.2.13.tgz#f5564d3ec9db132956473bb904bb3590482f5b36" integrity sha512-iJ1P/RZ1hk2n/HtEqB5ohXvHa+Hf0BXShYskSGrn6/klcTb0eJTCREsFxHk7mNEmRIGPWkjbLAslqpPgwiagXg== @@ -154,7 +167,7 @@ "@angular-devkit/architect" "0.1300.4" rxjs "6.6.7" -"@angular-devkit/core@11.2.4", "@angular-devkit/core@12.2.13", "@angular-devkit/core@13.0.4", "@angular-devkit/core@^12.0.0", "@angular-devkit/core@^12.2.10", "@angular-devkit/core@^12.2.7", "@angular-devkit/core@^13.0.4": +"@angular-devkit/core@11.2.4", "@angular-devkit/core@12.2.13", "@angular-devkit/core@13.0.4", "@angular-devkit/core@^12.0.0", "@angular-devkit/core@^12.2.10", "@angular-devkit/core@^12.2.7", "@angular-devkit/core@^13.0.0", "@angular-devkit/core@^13.0.4": version "12.2.13" resolved "https://registry.yarnpkg.com/@angular-devkit/core/-/core-12.2.13.tgz#db3929d1bfce71010b37fb7c4e6c33ef80a4f35f" integrity sha512-9csMF0p+lTvlWnutxxTZ/+pDRMIbXk/TV4MGLbcqUPPfeG3dCRwErns73xLuMTwp9qO/KCLkFqNaM6cGOoqsDA== @@ -243,6 +256,15 @@ optionalDependencies: parse5 "^5.0.0" +"@angular/cdk@^13.1.0": + version "13.1.0" + resolved "https://registry.yarnpkg.com/@angular/cdk/-/cdk-13.1.0.tgz#e594a3131d8334112a42447ec30e862b8d410323" + integrity sha512-OOMDmXnCpodYMEbRro8FUcXqQ8UN3lU/OXnuuDhHOJIrb7loizSGKkJdaVLZtM9ygH7qbOxRhkC2efjmtIn48g== + dependencies: + tslib "^2.3.0" + optionalDependencies: + parse5 "^5.0.0" + "@angular/cli@^12.2.10": version "12.2.13" resolved "https://registry.yarnpkg.com/@angular/cli/-/cli-12.2.13.tgz#ca586c14a6f83bb4390875be0a0fa709b9a2ae29" @@ -327,7 +349,7 @@ tslib "^2.2.0" yargs "^17.0.0" -"@angular/compiler-cli@~13.0.0", "@angular/compiler-cli@~13.0.3": +"@angular/compiler-cli@^13.0.3", "@angular/compiler-cli@~13.0.0", "@angular/compiler-cli@~13.0.3": version "13.0.3" resolved "https://registry.yarnpkg.com/@angular/compiler-cli/-/compiler-cli-13.0.3.tgz#a1f32058741a38db3c9963aee6d0849f206e3d1a" integrity sha512-j3uCk46BwyuRmYLwB39LoUEjARMdhGSI6kSDsQWPop+iHGJkP4ThUUQCrCGClqhXdyGdhkTrq8jqZ/GfXmUkPA==