ever-co / ever-demand

Ever® Demand™ - Open Commerce Platform - https://everdemand.co
https://everdemand.co
GNU Affero General Public License v3.0
1.71k stars 458 forks source link

Chore: update Angular, NestJs, RxJS and others to latest versions #1427

Open evereq opened 2 years ago

evereq commented 2 years ago

Before merging new features, we have to upgrade everything to the latest versions:

NOTE: all merged already to develop branch!

evereq commented 2 years ago

During yarn build:admin we have following warnings:

1) regarding browser compatibility (think it just tiny edit required in one file to fix that)

Warning: Support was requested for IE 10 in the project's browserslist configuration. This browser is no longer officially supported with Angular v11 and higher.
For more information, see https://v10.angular.io/guide/deprecations#ie-9-10-and-mobile
Warning: Support was requested for IE 11 in the project's browserslist configuration. IE 11 support is deprecated since Angular v12.
For more information, see https://angular.io/guide/browser-support

2) node-sass - I tried to remove it before, but at that time some package had dependency on it... Maybe we can try to remove again?

 'node-sass' usage is deprecated and will be removed in a future major version. To opt-out of the deprecated behaviour and start using 'sass' uninstall 'node-sass'.

3) something with ngx-swiper-wrapper, but no idea what is it honestly

Warning: Entry point 'ngx-swiper-wrapper' contains deep imports into 'E:/Coding/Ever/ever/packages/admin-web-angular/node_modules/swiper/types/swiper-events'. This is probably not a problem, but may cause the compilation of entry points to be out of order.

4) Tons of warnings like below

Warning: E:/Coding/Ever/ever/packages/common/src/notifications.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.
rahul-rocket commented 2 years ago

We need to enabled CORS in the code for socket polling connection. Because we should assume that user who run code does not have that CORS extension installed.

rahul-rocket commented 2 years ago

During yarn build:shopweb we have following issue:

../../node_modules/sass-extract-loader/index.js!./src/styles/_variables.scss - Error: Module build failed: Error: Cannot find module 'node-sass'
Require stack:
- D:\ever\ever-demand\node_modules\sass-extract\lib\render.js
- D:\ever\ever-demand\node_modules\sass-extract\lib\index.js
- D:\ever\ever-demand\node_modules\sass-extract-loader\index.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\webpack\lib\ProgressPlugin.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\webpack\lib\index.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular-devkit\build-webpack\src\webpack\index.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular-devkit\build-webpack\src\index.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular-devkit\build-angular\src\browser\index.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular-devkit\architect\node\index.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular\cli\models\architect-command.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular\cli\commands\build-impl.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular-devkit\schematics\tools\export-ref.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular-devkit\schematics\tools\index.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular\cli\utilities\json-schema.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular\cli\models\command-runner.js
- D:\ever\ever-demand\packages\shop-web-angular\node_modules\@angular\cli\lib\cli\index.js
- D:\ever\ever-demand\node_modules\@angular\cli\lib\init.js
- D:\ever\ever-demand\node_modules\@angular\cli\bin\ng
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\ever\ever-demand\node_modules\sass-extract\lib\render.js:13:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (D:\ever\ever-demand\node_modules\sass-extract\lib\index.js:7:15)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
rahul-rocket commented 2 years ago

During onload window for admin yarn run:admin we have following issue.

ERROR TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable. at e (main.js:1) at P (main.js:1) at main.js:1 at s.<anonymous> (main.js:1) at main.js:1 at Q (main.js:1) at Ae.subscribe (main.js:1) at u (main.js:1) at main.js:1 at ne.<anonymous> (main.js:1)

rahul-rocket commented 2 years ago

During yarn run:shopweb, we have following issues/warnings.

1) TypeScript compilation related warnings

Warning: D:/ever/ever-demand/packages/common-angular/src/components/ngx-barcode/ngx-barcode.component.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common-angular/src/components/ngx-barcode/ngx-barcode.module.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common-angular/src/index.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common-angular/src/locale/image-locales.service.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common-angular/src/pipes/index.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common-angular/src/routers/products-category-router.service.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common-angular/src/routers/warehouse-users.service.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common/src/routers/IProductsCategoryRouter.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/common/src/routers/IWarehouseUsersRouter.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/app.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/pm2bootstrap.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/scripts/env.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/src/app/+products/product-details/buy-product/buy-product.component.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/src/app/+products/product-details/buy-product/index.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/src/app/about/index.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/src/app/app.e2e.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/src/app/authentication/authentication.service.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:/ever/ever-demand/packages/shop-web-angular/src/environments/environment.prod.ts is part of the TypeScript compilation but it's unused.
Add only entry points to the 'files' or 'include' properties in your tsconfig.

Warning: D:\ever\ever-demand\packages\common-angular\src\lib\router\ObservableRequest.ts depends on 'uuid'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies

2) Webpack compilation issues

URIError: Failed to decode param '/%3C%=%20htmlWebpackPlugin.options.metadata.baseUrl%20%%3E'
    at decodeURIComponent (<anonymous>)
    at decode_param (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\layer.js:172:12)
    at Layer.match (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\layer.js:123:27)
    at matchLayer (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:574:18)
    at next (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:220:15)
    at expressInit (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\middleware\init.js:40:5)
    at Layer.handle [as handle_request] (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:317:13)
    at D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:335:12)
    at next (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:275:10)
    at query (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\middleware\query.js:45:5)
    at Layer.handle [as handle_request] (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\layer.js:95:5)
    at trim_prefix (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:317:13)
    at D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:284:7
    at Function.process_params (D:\ever\ever-demand\packages\shop-web-angular\node_modules\express\lib\router\index.js:335:12)
URIError: Failed to decode param '/%3C%=%20htmlWebpackPlugin.options.metadata.baseUrl%20%%3E'
rahul-rocket commented 2 years ago

@evereq

Ever Server - Building & Running Successfully.
    - yarn run:server
    - yarn run build:server

Ever Admin - Building & Running Successfully.
    - yarn run:admin
    - yarn run build:admin

Ever Merchant Ionic - Its building & running successfully.
    https://www.loom.com/share/1b892a23212841a6a48f12ac1c8ee8ff
    - yarn run:merchant
    - yarn run build:merchant

Ever Carrier Ionic - Its building & running successfully.
    https://www.loom.com/share/568a3aad710d4af49574a1b5499479ce
    - yarn run:carrier
    - yarn run build:carrier

Ever Mobile Shop - Its building & running UI loading successfully.
    https://www.loom.com/share/01b67dbadb5c4e1fa9996d82d870031f
    - yarn run:shopmobile
    - yarn run build:shopmobile
evereq commented 2 years ago

@rahul-rathore-576 we need to fix below warnings

@ever-platform/merchant-tablet-ionic: Warning: e:/Coding/Ever/ever/packages/merchant-tablet-ionic/app.ts is part of the TypeScript compilation but it's unused.
@ever-platform/merchant-tablet-ionic: Add only entry points to the 'files' or 'include' properties in your tsconfig.
@ever-platform/merchant-tablet-ionic: Warning: e:/Coding/Ever/ever/packages/merchant-tablet-ionic/pm2bootstrap.ts is part of the TypeScript compilation but it's unused.
@ever-platform/merchant-tablet-ionic: Add only entry points to the 'files' or 'include' properties in your tsconfig.
@ever-platform/merchant-tablet-ionic: Warning: e:/Coding/Ever/ever/packages/merchant-tablet-ionic/scripts/env.ts is part of the TypeScript compilation but it's unused.
@ever-platform/merchant-tablet-ionic: Add only entry points to the 'files' or 'include' properties in your tsconfig.
@ever-platform/merchant-tablet-ionic: Warning: e:/Coding/Ever/ever/packages/merchant-tablet-ionic/src/environments/environment.prod.ts is part of the TypeScript compilation but it's unused.
@ever-platform/merchant-tablet-ionic: Add only entry points to the 'files' or 'include' properties in your tsconfig.
evereq commented 2 years ago

Few more updates to be done:

0) DONE - Update apollo-client and many other related packages to @apollo/client, see https://apollo-angular.com/docs/migration in all our projects (WIP by @evereq)

1) Angular 13 everywhere :)

2) Web Shop should be switched off from Angular Starter https://github.com/PatrickJS/angular-starter, e.g. like it's done in https://github.com/xmlking/ngx-starter-kit/tree/develop/apps/webapp (basically it's "Standard" Angular app now)

3) In Gasby Shop we should get rid of package apollo-boost (already removed from package.json) as it's not updated anymore and just use "@apollo/client": and possibly other dependencies manually (if they are needed). Most changes are to be done in the src/apollo/client.tsx file I think...

evereq commented 2 years ago

@rahul-rathore-576 please work on 2 and 1 next from https://github.com/ever-co/ever-demand/issues/1427#issuecomment-986059957. I.e. first let's fix Web Shop and next upgrade everywhere Angular 13.