feat: angular upgrade - 13.3.2 => 14.2.3

This commit is contained in:
Amadou Ada DIENE
2022-09-22 23:26:39 +02:00
committed by DIENE
parent 573b91d224
commit fa6222a1a8
36 changed files with 12612 additions and 9188 deletions

View File

@@ -1,9 +1,9 @@
import * as remoteMain from '@electron/remote/main';
import { app, BrowserWindow, ipcMain, nativeImage } from 'electron';
import * as path from 'path';
import * as path from 'node:path';
import { AbstractService } from '../services/abstract-service';
import { MultiplesService } from '../services/multiples-service';
import { Logger } from '../utils/logger';
import * as remoteMain from '@electron/remote/main';
declare const global: Global;
declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string;
@@ -44,17 +44,17 @@ export class Window {
}
private loadIcon(): Electron.NativeImage | undefined {
let iconObj = undefined;
let iconObject;
if (global.appConfig.isIconAvailable) {
const iconPath = path.join(__dirname, 'icons/icon.png');
Logger.debug('Icon Path', iconPath);
iconObj = nativeImage.createFromPath(iconPath);
iconObject = nativeImage.createFromPath(iconPath);
// Change dock icon on MacOS
if (iconObj && process.platform === 'darwin') {
app.dock.setIcon(iconObj);
if (iconObject && process.platform === 'darwin') {
app.dock.setIcon(iconObject);
}
}
return iconObj;
return iconObject;
}
private loadRenderer(): void {
@@ -96,11 +96,11 @@ export class Window {
private registerService<In, Out>(service: AbstractService<In, Out>) {
ipcMain.on(
service.receptionChannel(),
async (event: Electron.IpcMainEvent, ...args: any[]) => {
async (event: Electron.IpcMainEvent, ...parameters: any[]) => {
// Handling input
const input = args[0];
const input = parameters[0];
Logger.debug(`[${service.receptionChannel()}] =====> `, input);
const output: Out = await service.process(input);
const output: Out = service.process(input);
// Handling output
if (service.sendingChannel()) {

View File

@@ -1,6 +1,6 @@
import * as fs from 'fs-extra';
import * as _ from 'lodash';
import * as path from 'path';
import _ from 'lodash';
import * as path from 'node:path';
import { AppConfig } from 'shared-lib';
import { App } from './components/app';
@@ -14,14 +14,14 @@ declare global {
}
// Load config
const currentEnv = process.env.X_NODE_ENV || process.env.NODE_ENV;
const currentEnvironment = process.env.X_NODE_ENV || process.env.NODE_ENV;
const appConfigs = fs.readJsonSync(path.join(__dirname, 'config.json'));
const defaultConf = appConfigs.development;
const currentConf = appConfigs[currentEnv];
const defaultConfig = appConfigs.development;
const currentConfig = appConfigs[currentEnvironment];
global.appConfig =
currentEnv === 'development'
? defaultConf
: _.merge(defaultConf, currentConf);
currentEnvironment === 'development'
? defaultConfig
: _.merge(defaultConfig, currentConfig);
// Launch app
App.launch();

View File

@@ -1,13 +1,14 @@
const NOT_IMPEMENTED_YET = 'Method not implemented yet.';
export class AbstractService<In, Out> {
receptionChannel(): string {
throw new Error('Method not implemented yet.');
throw new Error(NOT_IMPEMENTED_YET);
}
sendingChannel(): string {
throw new Error('Method not implemented yet.');
throw new Error(NOT_IMPEMENTED_YET);
}
process(_input: In): Out {
throw new Error('Method not implemented yet.');
throw new Error(NOT_IMPEMENTED_YET);
}
}

View File

@@ -1,6 +1,6 @@
import { app } from 'electron';
import * as os from 'os';
import * as path from 'path';
import * as os from 'node:os';
import * as path from 'node:path';
import * as winston from 'winston';
declare const global: Global;