From b5b17a410ffa752bfc36c1d086be72b5ea1420f7 Mon Sep 17 00:00:00 2001 From: Francesco Bozzotta <39646929+silicia-apps@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:31:19 +0000 Subject: [PATCH] fix startup --- libs/core/src/lib/core.module.ts | 178 +++++++++++++++++-------------- package-lock.json | 67 +++++++----- package.json | 10 +- 3 files changed, 142 insertions(+), 113 deletions(-) diff --git a/libs/core/src/lib/core.module.ts b/libs/core/src/lib/core.module.ts index 0a2f326..aadce90 100644 --- a/libs/core/src/lib/core.module.ts +++ b/libs/core/src/lib/core.module.ts @@ -1,47 +1,51 @@ import { CUSTOM_ELEMENTS_SCHEMA, - ErrorHandler, + // ErrorHandler, ModuleWithProviders, NgModule, Optional, SkipSelf, -} from '@angular/core'; +} from "@angular/core"; -import { CommonModule } from '@angular/common'; -import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { CommonModule } from "@angular/common"; +import { + HttpClient, + provideHttpClient, + withInterceptorsFromDi, +} from "@angular/common/http"; -import { IonicModule } from '@ionic/angular'; -import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; -import { TranslateHttpLoader } from '@ngx-translate/http-loader'; -import { sioCoreStates } from './store'; +import { IonicModule } from "@ionic/angular"; +import { TranslateModule, TranslateLoader } from "@ngx-translate/core"; +import { TranslateHttpLoader } from "@ngx-translate/http-loader"; +import { sioCoreStates } from "./store"; /* ngxs */ -import { NgxsDataPluginModule } from '@angular-ru/ngxs'; -import { NgxsModule, NoopNgxsExecutionStrategy } from '@ngxs/store'; -import { NgxsReduxDevtoolsPluginModule } from '@ngxs/devtools-plugin'; -import { NgxsRouterPluginModule } from '@ngxs/router-plugin'; -import { NgxsFormPluginModule } from '@ngxs/form-plugin'; -import { NgxsLoggerPluginModule } from '@ngxs/logger-plugin'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MaskitoModule } from '@maskito/angular'; -import { ScrollingModule } from '@angular/cdk/scrolling'; +import { NgxsDataPluginModule } from "@angular-ru/ngxs"; +import { NgxsModule, NoopNgxsExecutionStrategy } from "@ngxs/store"; +import { NgxsReduxDevtoolsPluginModule } from "@ngxs/devtools-plugin"; +import { NgxsRouterPluginModule } from "@ngxs/router-plugin"; +import { NgxsFormPluginModule } from "@ngxs/form-plugin"; +import { NgxsLoggerPluginModule } from "@ngxs/logger-plugin"; +import { FormsModule, ReactiveFormsModule } from "@angular/forms"; +//import { MaskitoModule } from '@maskito/angular'; +import { ScrollingModule } from "@angular/cdk/scrolling"; -import { SioCoreComponents } from './components'; +import { SioCoreComponents } from "./components"; import { SioCoreEnvironmentConfig, SioCoreEnvironmentInterface, -} from './services'; +} from "./services"; -import { SioCoreErrorHandlerService } from './shared/error.handle'; -import { LoggerModule } from '@angular-ru/cdk/logger'; -import { RouterModule } from '@angular/router'; +//import { SioCoreErrorHandlerService } from "./shared/error.handle"; +import { LoggerModule } from "@angular-ru/cdk/logger"; +import { RouterModule } from "@angular/router"; export class EnsureModuleLoadedOnceGuard { constructor(targetModule: NgModule) { if (targetModule) { throw new Error( - `${targetModule.constructor.name} has already been loaded. Import this module in the AppModule only.`, + `${targetModule.constructor.name} has already been loaded. Import this module in the AppModule only.` ); } } @@ -51,76 +55,90 @@ export function createTranslateLoader(http: HttpClient) { return new TranslateHttpLoader(http); } -@NgModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [...SioCoreComponents], - exports: [...SioCoreComponents, IonicModule, TranslateModule], imports: [CommonModule, - FormsModule, - RouterModule, - MaskitoModule, - ReactiveFormsModule, - IonicModule, - ScrollingModule, - TranslateModule.forChild({ - extend: true, - loader: { - provide: TranslateLoader, - useFactory: createTranslateLoader, - deps: [HttpClient], - }, - }), - NgxsFormPluginModule], providers: [provideHttpClient(withInterceptorsFromDi())] }) -export class SioCommonModule { - -} +@NgModule({ + schemas: [CUSTOM_ELEMENTS_SCHEMA], + declarations: [...SioCoreComponents], + exports: [...SioCoreComponents, IonicModule, TranslateModule], + imports: [ + CommonModule, + FormsModule, + RouterModule, + //MaskitoModule, + ReactiveFormsModule, + IonicModule, + ScrollingModule, + TranslateModule.forChild({ + extend: true, + loader: { + provide: TranslateLoader, + useFactory: createTranslateLoader, + deps: [HttpClient], + }, + }), + NgxsFormPluginModule, + ], + providers: [provideHttpClient(withInterceptorsFromDi())], +}) +export class SioCommonModule {} -@NgModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA], - declarations: [], - exports: [IonicModule, TranslateModule], imports: [CommonModule, - FormsModule, - RouterModule, - ReactiveFormsModule, - IonicModule, - TranslateModule.forChild({ - extend: true, - loader: { - provide: TranslateLoader, - useFactory: createTranslateLoader, - deps: [HttpClient], - }, - }), - NgxsFormPluginModule], providers: [provideHttpClient(withInterceptorsFromDi())] }) -export class SioMinimalModule { - -} +@NgModule({ + schemas: [CUSTOM_ELEMENTS_SCHEMA], + declarations: [], + exports: [IonicModule, TranslateModule], + imports: [ + CommonModule, + FormsModule, + RouterModule, + ReactiveFormsModule, + IonicModule, + TranslateModule.forChild({ + extend: true, + loader: { + provide: TranslateLoader, + useFactory: createTranslateLoader, + deps: [HttpClient], + }, + }), + NgxsFormPluginModule, + ], + providers: [provideHttpClient(withInterceptorsFromDi())], +}) +export class SioMinimalModule {} -@NgModule({ exports: [TranslateModule], imports: [CommonModule, - TranslateModule.forRoot(), - LoggerModule.forRoot(), - FormsModule, - ReactiveFormsModule, - IonicModule.forRoot(), - NgxsModule.forRoot(sioCoreStates, { - developmentMode: true, - executionStrategy: NoopNgxsExecutionStrategy, - }), - NgxsLoggerPluginModule.forRoot(), - NgxsDataPluginModule.forRoot(), - NgxsReduxDevtoolsPluginModule.forRoot(), - NgxsRouterPluginModule.forRoot(), - NgxsFormPluginModule.forRoot()], providers: [provideHttpClient(withInterceptorsFromDi())] }) +@NgModule({ + exports: [TranslateModule], + imports: [ + CommonModule, + TranslateModule.forRoot(), + LoggerModule.forRoot(), + FormsModule, + ReactiveFormsModule, + IonicModule.forRoot(), + NgxsModule.forRoot(sioCoreStates, { + developmentMode: true, + executionStrategy: NoopNgxsExecutionStrategy, + }), + NgxsLoggerPluginModule.forRoot(), + NgxsDataPluginModule.forRoot(), + NgxsReduxDevtoolsPluginModule.forRoot(), + NgxsRouterPluginModule.forRoot(), + NgxsFormPluginModule.forRoot(), + ], + providers: [provideHttpClient(withInterceptorsFromDi())], +}) export class SioCoreModule extends EnsureModuleLoadedOnceGuard { constructor(@Optional() @SkipSelf() parentModule: SioCoreModule) { super(parentModule); } static forRoot( - config?: SioCoreEnvironmentInterface, + config?: SioCoreEnvironmentInterface ): ModuleWithProviders { return { ngModule: SioCoreModule, providers: [ { provide: SioCoreEnvironmentConfig, useValue: config }, - // { provide: ErrorHandler, useClass: SioCoreErrorHandlerService }, + // { provide: ErrorHandler, useClass: SioCoreErrorHandlerService }, ], }; } diff --git a/package-lock.json b/package-lock.json index 434e39d..cb0eedb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "@capacitor/app": "6.0.1", "@capacitor/core": "6.1.2", "@capawesome/capacitor-file-picker": "6.0.1", - "@ionic/angular": "8.3.0", + "@ionic/angular": "8.3.1", "@maskito/angular": "3.0.1", "@maskito/core": "3.0.1", "@ngx-translate/core": "^15.0.0", @@ -75,12 +75,12 @@ "@swc/core": "1.7.26", "@types/jest": "29.5.13", "@types/node": "22.5.5", - "@typescript-eslint/eslint-plugin": "^7.0.0", - "@typescript-eslint/parser": "^7.0.0", - "@typescript-eslint/utils": "^7.0.0", + "@typescript-eslint/eslint-plugin": "^7", + "@typescript-eslint/parser": "^7", + "@typescript-eslint/utils": "^7", "autoprefixer": "^10.4.0", "cypress": "13.14.2", - "eslint": "^8.0.0", + "eslint": "^8", "eslint-config-prettier": "9.1.0", "eslint-plugin-cypress": "3.5.0", "jest": "29.7.0", @@ -4797,11 +4797,11 @@ } }, "node_modules/@ionic/angular": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-8.3.0.tgz", - "integrity": "sha512-xC+BMG1nLn/J+p7VwH/B6cwTZ2+JAwxu4KVfCTzrABn+DH8Nw+8EoI6DMtGH9P2RrBGiMXvduLeLgEZTK0lIaA==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@ionic/angular/-/angular-8.3.1.tgz", + "integrity": "sha512-D/qP3R6xbaH/y7qNSQ1F6/hVediPq+F5a6KxfhOIZPXrD94r9haDTD9XpQh7LMoAzoem85h7icn2XfHzcDP1HA==", "dependencies": { - "@ionic/core": "8.3.0", + "@ionic/core": "8.3.1", "ionicons": "^7.0.0", "jsonc-parser": "^3.0.0", "tslib": "^2.3.0" @@ -4815,11 +4815,11 @@ } }, "node_modules/@ionic/core": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.3.0.tgz", - "integrity": "sha512-Yv/LA2OOsvdelhvVYKTNL+0AduKXO74DTdQ3lqS/NN512/wCNf2CVt8J62oCs25XOttLAy8RflDUN8joT3bO7A==", + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@ionic/core/-/core-8.3.1.tgz", + "integrity": "sha512-md4JFwKYLgN/YP+uzoTE5H7ah0W5SQQNZ1cJOQtxhv0ytCCHHaXJrfRVzefdy8iy8NdzL9s6EV5ZTKYH98E+ZQ==", "dependencies": { - "@stencil/core": "^4.19.2", + "@stencil/core": "4.20.0", "ionicons": "^7.2.2", "tslib": "^2.1.0" } @@ -6507,9 +6507,9 @@ } }, "node_modules/@npmcli/package-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.2.0.tgz", - "integrity": "sha512-qe/kiqqkW0AGtvBjL8TJKZk/eBBSpnJkUWvHdQ9jM2lKHXRYYJuyNpJPlJw3c8QjC2ow6NZYiLExhUaeJelbxQ==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/@npmcli/package-json/-/package-json-5.2.1.tgz", + "integrity": "sha512-f7zYC6kQautXHvNbLEWgD/uGu1+xCn9izgqBfgItWSx22U0ZDekxN08A1vM8cTxj/cRVe0Q94Ode+tdoYmIOOQ==", "dev": true, "dependencies": { "@npmcli/git": "^5.0.0", @@ -8416,6 +8416,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/@rollup/wasm-node/node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "devOptional": true + }, "node_modules/@schematics/angular": { "version": "18.2.4", "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-18.2.4.tgz", @@ -8561,9 +8567,9 @@ } }, "node_modules/@stencil/core": { - "version": "4.21.0", - "resolved": "https://registry.npmjs.org/@stencil/core/-/core-4.21.0.tgz", - "integrity": "sha512-v50lnVbzS8mpMSnEVxR+G75XpvxHKtkJaQrNPE8+/fF6Ppr5z4bcdcBhcP8LPfEW+4BZcic6VifMXRwTopc+kw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@stencil/core/-/core-4.20.0.tgz", + "integrity": "sha512-WPrTHFngvN081RY+dJPneKQLwnOFD60OMCOQGmmSHfCW0f4ujPMzzhwWU1gcSwXPWXz5O+8cBiiCaxAbJU7kAg==", "bin": { "stencil": "bin/stencil" }, @@ -10151,9 +10157,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==" }, "node_modules/@types/express": { "version": "4.17.21", @@ -15016,9 +15022,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.24", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.24.tgz", - "integrity": "sha512-0x0wLCmpdKFCi9ulhvYZebgcPmHTkFVUfU2wzDykadkslKwT4oAmDTHEKLnlrDsMGZe4B+ksn8quZfZjYsBetA==" + "version": "1.5.25", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.25.tgz", + "integrity": "sha512-kMb204zvK3PsSlgvvwzI3wBIcAw15tRkYk+NQdsjdDtcQWTp2RABbMQ9rUBy8KNEOM+/E6ep+XC3AykiWZld4g==" }, "node_modules/emitter-component": { "version": "1.1.2", @@ -26643,6 +26649,11 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup/node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" + }, "node_modules/run-applescript": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.0.0.tgz", @@ -30052,9 +30063,9 @@ } }, "node_modules/webpack-dev-middleware/node_modules/memfs": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.11.1.tgz", - "integrity": "sha512-LZcMTBAgqUUKNXZagcZxvXXfgF1bHX7Y7nQ0QyEiNbRJgE29GhgPd8Yna1VQcLlPiHt/5RFJMWYN9Uv/VPNvjQ==", + "version": "4.11.2", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.11.2.tgz", + "integrity": "sha512-VcR7lEtgQgv7AxGkrNNeUAimFLT+Ov8uGu1LuOfbe/iF/dKoh/QgpoaMZlhfejvLtMxtXYyeoT7Ar1jEbWdbPA==", "dependencies": { "@jsonjoy.com/json-pack": "^1.0.3", "@jsonjoy.com/util": "^1.3.0", diff --git a/package.json b/package.json index 69a5055..25ac4f7 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@capacitor/app": "6.0.1", "@capacitor/core": "6.1.2", "@capawesome/capacitor-file-picker": "6.0.1", - "@ionic/angular": "8.3.0", + "@ionic/angular": "8.3.1", "@maskito/angular": "3.0.1", "@maskito/core": "3.0.1", "@ngx-translate/core": "^15.0.0", @@ -71,12 +71,12 @@ "@swc/core": "1.7.26", "@types/jest": "29.5.13", "@types/node": "22.5.5", - "@typescript-eslint/eslint-plugin": "^7.0.0", - "@typescript-eslint/parser": "^7.0.0", - "@typescript-eslint/utils": "^7.0.0", + "@typescript-eslint/eslint-plugin": "^7", + "@typescript-eslint/parser": "^7", + "@typescript-eslint/utils": "^7", "autoprefixer": "^10.4.0", "cypress": "13.14.2", - "eslint": "^8.0.0", + "eslint": "^8", "eslint-config-prettier": "9.1.0", "eslint-plugin-cypress": "3.5.0", "jest": "29.7.0",