Bump angular 17 -> 18, upgrade dependencies and lint fixes

This commit is contained in:
argenius 2024-11-10 16:30:14 +01:00
parent f2c67073a8
commit f793945a5b
14 changed files with 3084 additions and 2929 deletions

View file

@ -139,7 +139,7 @@
} }
}, },
"extract-i18n": { "extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n", "builder": "@angular/build:extract-i18n",
"options": { "options": {
"buildTarget": "monerod-gui:build" "buildTarget": "monerod-gui:build"
} }

5832
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -77,14 +77,14 @@
"lint": "ng lint" "lint": "ng lint"
}, },
"dependencies": { "dependencies": {
"@angular/common": "17.3.12", "@angular/common": "18.2.11",
"@angular/compiler": "17.3.12", "@angular/compiler": "18.2.11",
"@angular/core": "17.3.12", "@angular/core": "18.2.11",
"@angular/forms": "17.3.12", "@angular/forms": "18.2.11",
"@angular/language-service": "17.3.12", "@angular/language-service": "18.2.11",
"@angular/platform-browser": "17.3.12", "@angular/platform-browser": "18.2.11",
"@angular/platform-browser-dynamic": "17.3.12", "@angular/platform-browser-dynamic": "18.2.11",
"@angular/router": "17.3.12", "@angular/router": "18.2.11",
"bootstrap": "5.3.3", "bootstrap": "5.3.3",
"bootstrap-icons": "1.11.3", "bootstrap-icons": "1.11.3",
"bootstrap-table": "1.23.5", "bootstrap-table": "1.23.5",
@ -94,52 +94,52 @@
"jquery": "3.7.1", "jquery": "3.7.1",
"os": "0.1.2", "os": "0.1.2",
"rxjs": "7.8.1", "rxjs": "7.8.1",
"tslib": "2.6.2", "tslib": "2.8.1",
"unbzip2-stream": "1.4.3", "unbzip2-stream": "1.4.3",
"zone.js": "0.14.4" "zone.js": "0.14.10"
}, },
"devDependencies": { "devDependencies": {
"@angular-builders/custom-webpack": "17.0.2", "@angular-builders/custom-webpack": "18.0.0",
"@angular-builders/jest": "17.0.3", "@angular-builders/jest": "18.0.0",
"@angular-devkit/build-angular": "17.3.10", "@angular-eslint/builder": "18.4.0",
"@angular-eslint/builder": "17.3.0", "@angular-eslint/eslint-plugin": "18.4.0",
"@angular-eslint/eslint-plugin": "17.3.0", "@angular-eslint/eslint-plugin-template": "18.4.0",
"@angular-eslint/eslint-plugin-template": "17.3.0", "@angular-eslint/schematics": "18.4.0",
"@angular-eslint/schematics": "17.3.0", "@angular-eslint/template-parser": "18.4.0",
"@angular-eslint/template-parser": "17.3.0", "@angular/build": "^18.2.11",
"@angular/cli": "17.3.10", "@angular/cli": "18.2.11",
"@angular/compiler-cli": "17.3.12", "@angular/compiler-cli": "18.2.11",
"@electron/packager": "18.3.5", "@electron/packager": "18.3.5",
"@ngx-translate/core": "15.0.0", "@ngx-translate/core": "16.0.3",
"@ngx-translate/http-loader": "8.0.0", "@ngx-translate/http-loader": "16.0.0",
"@playwright/test": "1.48.2", "@playwright/test": "1.48.2",
"@types/auto-launch": "5.0.5", "@types/auto-launch": "5.0.5",
"@types/bootstrap": "5.2.10", "@types/bootstrap": "5.2.10",
"@types/chart.js": "2.9.41", "@types/chart.js": "2.9.41",
"@types/jest": "29.5.14", "@types/jest": "29.5.14",
"@types/jquery": "3.5.32", "@types/jquery": "3.5.32",
"@types/node": "20.12.7", "@types/node": "22.9.0",
"@types/pidusage": "2.0.5", "@types/pidusage": "2.0.5",
"@types/unbzip2-stream": "1.4.3", "@types/unbzip2-stream": "1.4.3",
"@typescript-eslint/eslint-plugin": "7.7.1", "@typescript-eslint/eslint-plugin": "8.13.0",
"@typescript-eslint/parser": "7.7.1", "@typescript-eslint/parser": "8.13.0",
"conventional-changelog-cli": "5.0.0", "conventional-changelog-cli": "5.0.0",
"electron": "33.2.0", "electron": "33.2.0",
"electron-builder": "25.1.8", "electron-builder": "25.1.8",
"electron-debug": "4.1.0", "electron-debug": "4.1.0",
"electron-installer-dmg": "5.0.1", "electron-installer-dmg": "5.0.1",
"electron-reloader": "1.2.3", "electron-reloader": "1.2.3",
"eslint": "8.57.0", "eslint": "9.14.0",
"eslint-plugin-import": "2.29.1", "eslint-plugin-import": "2.31.0",
"eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-jsdoc": "50.4.3",
"eslint-plugin-prefer-arrow": "1.2.3", "eslint-plugin-prefer-arrow": "1.2.3",
"jest": "29.7.0", "jest": "29.7.0",
"node-polyfill-webpack-plugin": "2.0.1", "node-polyfill-webpack-plugin": "4.0.0",
"npm-run-all": "4.1.5", "npm-run-all": "4.1.5",
"playwright": "1.48.2", "playwright": "1.48.2",
"ts-node": "10.9.2", "ts-node": "10.9.2",
"typescript": "5.4.5", "typescript": "5.5.4",
"wait-on": "7.2.0", "wait-on": "8.0.1",
"webdriver-manager": "12.1.9" "webdriver-manager": "12.1.9"
}, },
"optionalDependencies": { "optionalDependencies": {

View file

@ -1,7 +1,7 @@
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms'; import { FormsModule } from '@angular/forms';
import { HttpClientModule, HttpClient } from '@angular/common/http'; import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { CoreModule } from './core/core.module'; import { CoreModule } from './core/core.module';
import { SharedModule } from './shared/shared.module'; import { SharedModule } from './shared/shared.module';
@ -32,12 +32,9 @@ import { AboutModule } from './pages/about/about.module';
// AoT requires an exported function for factories // AoT requires an exported function for factories
const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json'); const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new TranslateHttpLoader(http, './assets/i18n/', '.json');
@NgModule({ @NgModule({ declarations: [AppComponent],
declarations: [AppComponent], bootstrap: [AppComponent], imports: [BrowserModule,
imports: [
BrowserModule,
FormsModule, FormsModule,
HttpClientModule,
CoreModule, CoreModule,
SharedModule, SharedModule,
HomeModule, HomeModule,
@ -63,9 +60,5 @@ const httpLoaderFactory = (http: HttpClient): TranslateHttpLoader => new Transl
deps: [HttpClient] deps: [HttpClient]
} }
}), }),
LoadComponent LoadComponent], providers: [provideHttpClient(withInterceptorsFromDi())] })
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {} export class AppModule {}

View file

@ -416,7 +416,7 @@ export class DaemonService {
this.onDaemonStatusChanged.emit(false); this.onDaemonStatusChanged.emit(false);
this.startedAt = undefined; this.startedAt = undefined;
this.starting = false; this.starting = false;
reject(error); reject(new Error(`${error}`));
}); });
}).catch((error: any) => { }).catch((error: any) => {
this.startedAt = undefined; this.startedAt = undefined;
@ -432,7 +432,7 @@ export class DaemonService {
this.onDaemonStatusChanged.emit(false); this.onDaemonStatusChanged.emit(false);
this.startedAt = undefined; this.startedAt = undefined;
this.starting = false; this.starting = false;
reject('Could not start daemon'); reject(new Error('Could not start daemon'));
} }
}) })
}); });
@ -757,7 +757,7 @@ export class DaemonService {
window.electronAPI.onMoneroVersionError((event: any, error: string) => { window.electronAPI.onMoneroVersionError((event: any, error: string) => {
window.electronAPI.unregisterOnMoneroVersion(); window.electronAPI.unregisterOnMoneroVersion();
window.electronAPI.unregisterOnMoneroVersionError(); window.electronAPI.unregisterOnMoneroVersionError();
reject(error); reject(new Error(error));
}); });
}); });
@ -1193,7 +1193,7 @@ export class DaemonService {
window.electronAPI.onMonitorMonerodError((event: any, error: string) => { window.electronAPI.onMonitorMonerodError((event: any, error: string) => {
window.electronAPI.unregisterOnMonitorMonerod(); window.electronAPI.unregisterOnMonitorMonerod();
window.electronAPI.unregisterOnMonitorMonerodError(); window.electronAPI.unregisterOnMonitorMonerodError();
reject(error); reject(new Error(error));
}); });
window.electronAPI.onMonitorMonerod((event: any, stats: ProcessStats) => { window.electronAPI.onMonitorMonerod((event: any, stats: ProcessStats) => {

View file

@ -76,7 +76,7 @@ export class ElectronService {
}); });
} }
catch(error: any) { catch(error: any) {
reject(error); reject(new Error(`${error}`));
} }
}); });
@ -160,7 +160,7 @@ export class ElectronService {
console.debug(event); console.debug(event);
window.electronAPI.unregisterOnEnableAutoLaunchError(); window.electronAPI.unregisterOnEnableAutoLaunchError();
window.electronAPI.unregisterOnEnableAutoLaunchSuccess(); window.electronAPI.unregisterOnEnableAutoLaunchSuccess();
reject(error); reject(new Error(error));
}); });
window.electronAPI.onEnableAutoLaunchSuccess((event: any) => { window.electronAPI.onEnableAutoLaunchSuccess((event: any) => {
@ -193,7 +193,7 @@ export class ElectronService {
console.debug(event); console.debug(event);
window.electronAPI.unregisterOnDisableAutoLaunchError(); window.electronAPI.unregisterOnDisableAutoLaunchError();
window.electronAPI.unregisterOnDisableAutoLaunchSuccess(); window.electronAPI.unregisterOnDisableAutoLaunchSuccess();
reject(error); reject(new Error(error));
}); });
window.electronAPI.onDisableAutoLaunchSuccess((event: any) => { window.electronAPI.onDisableAutoLaunchSuccess((event: any) => {
@ -244,7 +244,7 @@ export class ElectronService {
const promise = new Promise<string>((resolve, reject) => { const promise = new Promise<string>((resolve, reject) => {
window.electronAPI.onReadFileError((event: any, error: string) => { window.electronAPI.onReadFileError((event: any, error: string) => {
window.electronAPI.unregisterOnReadFile(); window.electronAPI.unregisterOnReadFile();
reject(error); reject(new Error(error));
}); });
window.electronAPI.onReadFile((event: any, data: string) => { window.electronAPI.onReadFile((event: any, data: string) => {
@ -262,7 +262,7 @@ export class ElectronService {
const promise = new Promise<string>((resolve, reject) => { const promise = new Promise<string>((resolve, reject) => {
window.electronAPI.onSaveFileError((event: any, error: string) => { window.electronAPI.onSaveFileError((event: any, error: string) => {
window.electronAPI.unregisterOnSaveFile(); window.electronAPI.unregisterOnSaveFile();
reject(error); reject(new Error(error));
}); });
window.electronAPI.onSaveFile((event: any, filePath: string) => { window.electronAPI.onSaveFile((event: any, filePath: string) => {

View file

@ -52,7 +52,7 @@ export class MoneroInstallerService {
}); });
if (progress.status.includes('Error')) { if (progress.status.includes('Error')) {
reject(progress.status); reject(new Error(progress.status));
} }
if (progress.progress == 200) { if (progress.progress == 200) {

View file

@ -44,7 +44,8 @@ export class BansComponent extends BasePageComponent implements AfterViewInit {
return true; return true;
} }
catch(error) { catch(error: any) {
console.error(error);
return false; return false;
} }
} }

View file

@ -327,7 +327,8 @@ export class MiningComponent extends BasePageComponent implements AfterViewInit,
return true; return true;
} catch (error) { } catch (error: any) {
console.debug(error);
return false; return false;
} }
} }

View file

@ -51,7 +51,7 @@ export class OutputsComponent extends BasePageComponent {
}); });
return true; return true;
} catch(error) { } catch {
return false; return false;
} }
} }
@ -117,7 +117,7 @@ export class OutputsComponent extends BasePageComponent {
return outs; return outs;
} }
catch(error) { catch {
return [] return []
} }
} }
@ -137,7 +137,7 @@ export class OutputsComponent extends BasePageComponent {
_outs.forEach((_out) => Output.parse(_out)); _outs.forEach((_out) => Output.parse(_out));
return true; return true;
} catch(error) { } catch {
return false; return false;
} }
} }
@ -178,7 +178,7 @@ export class OutputsComponent extends BasePageComponent {
return true; return true;
} }
catch(error) { catch {
return false; return false;
} }
} }
@ -197,7 +197,7 @@ export class OutputsComponent extends BasePageComponent {
return true; return true;
} }
catch(error) { catch {
return false; return false;
} }
} }

View file

@ -85,8 +85,8 @@ export class PeersComponent extends BasePageComponent implements AfterViewInit {
this.loadPeerListTable(); this.loadPeerListTable();
resolve(); resolve();
} }
catch(error) { catch(error: any) {
reject(error); reject(new Error(`${error}`));
} }
}); });
}, 1000); }, 1000);

View file

@ -165,7 +165,7 @@ export class TransactionsComponent extends BasePageComponent implements AfterVie
return true; return true;
} }
catch(error) { catch {
return false; return false;
} }
} }

View file

@ -97,7 +97,7 @@ export class DaemonNotRunningComponent implements OnDestroy {
this.daemonService.startDaemon().then(() => { this.daemonService.startDaemon().then(() => {
resolve(); resolve();
}).catch((error: any) => { }).catch((error: any) => {
reject(error); reject(new Error(`${error}`));
}); });
}, 500)}); }, 500)});
} }
@ -108,7 +108,7 @@ export class DaemonNotRunningComponent implements OnDestroy {
this.daemonService.restartDaemon().then(() => { this.daemonService.restartDaemon().then(() => {
resolve(); resolve();
}).catch((error: any) => { }).catch((error: any) => {
reject(error); reject(new Error(`${error}`));
}); });
}, 500)}); }, 500)});
} }

View file

@ -5,9 +5,9 @@
"outDir": "./dist/out-tsc", "outDir": "./dist/out-tsc",
"module": "es2022", "module": "es2022",
"sourceMap": true, "sourceMap": true,
"esModuleInterop": true,
"declaration": false, "declaration": false,
"moduleResolution": "node", "moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
"allowJs": true, "allowJs": true,