package script of daesang real is modified

This commit is contained in:
병준 박 2019-12-18 15:57:02 +09:00
parent 76dd6883d3
commit 70e17b4a3d
11 changed files with 53 additions and 26 deletions

View File

@ -36,5 +36,22 @@
"buildResources": "./dist/ucap-webmessenger-electron/resources/installer/",
"output": "./dist/electron/",
"app": "."
}
},
"files": [
"**/*",
"!**/*.ts",
"!LICENSE.md",
"!package.json",
"!package-lock.json",
"!electron-projects/",
"!projects/",
"!.prettierrc",
"!angular.json",
"!**/.awcache",
"!**/.vscode",
"!config/",
"!docker/",
"!tsconfig.json",
"!tslint.json"
]
}

View File

@ -1,6 +1,9 @@
import path from 'path';
import url from 'url';
import fse from 'fs-extra';
import log from 'electron-log';
import { ElectronWebContentsChannel } from '@ucap-webmessenger/electron-core';
import { AnimationQueue } from '../utils/animation-queue';
import {
@ -11,7 +14,6 @@ import { screen, BrowserWindow, ipcMain, IpcMainEvent, shell } from 'electron';
import { ElectronNotification } from '../models/electron-notification';
import { ElectronNotificationEventType } from '../types/event.type';
import { Channel } from '../types/channel.type';
import { ElectronWebContentsChannel } from '@ucap-webmessenger/electron-core';
const onClickElectronNotification = 'onClickElectronNotification';
const onCloseElectronNotification = 'onCloseElectronNotification';
@ -220,12 +222,12 @@ export class ElectronNotificationService {
slashes: true
});
} catch (e) {
console.log(
log.error(
'electron-notify: Could not find template ("' +
this.customOptions.templatePath +
'").'
);
console.log(
log.error(
'electron-notify: To use a different template you need to correct the config.templatePath or simply adapt config.htmlTemplate'
);
}

View File

@ -1,3 +1,5 @@
import log from 'electron-log';
export interface AnimationQueueObject {
context: any;
func: (...args: any[]) => Promise<any>;
@ -29,10 +31,10 @@ export class AnimationQueue {
}
})
.catch(reason => {
console.log(reason);
log.error(reason);
});
} catch (e) {
console.log(e);
log.error(e);
}
}

View File

@ -1,6 +1,7 @@
import { BrowserWindow, ipcMain } from 'electron';
import url from 'url';
import fse from 'fs-extra';
import log from 'electron-log';
import {
ElectronUpdateWindowOptions,
DefaultElectronUpdateWindowOptions
@ -112,7 +113,7 @@ export class ElectronUpdateWindowService {
slashes: true
});
} catch (e) {
console.log(
log.error(
'electron-update-window: Could not find template ("' +
this.customOptions.templatePath +
'").'

View File

@ -145,7 +145,7 @@ function createWindow() {
try {
edi.default(extension);
} catch (e) {
console.log(e);
log.error(e);
}
}
});
@ -357,7 +357,7 @@ ipcMain.on(
.enable()
.then(() => {
event.returnValue = true;
console.log('AutoLaunch is enabled');
log.info('AutoLaunch is enabled');
})
.catch(reason => {
event.returnValue = false;
@ -367,7 +367,7 @@ ipcMain.on(
.disable()
.then(() => {
event.returnValue = true;
console.log('AutoLaunch is disabled');
log.info('AutoLaunch is disabled');
})
.catch(reason => {
event.returnValue = false;
@ -409,15 +409,18 @@ ipcMain.on(
);
ipcMain.on(FileChannel.ReadFile, (event: IpcMainEvent, ...args: any[]) => {
const filePath = root(args[0]);
try {
fse.readFile(root(args[0]), (err, data) => {
fse.readFile(filePath, (err, data) => {
if (!!err) {
event.returnValue = err;
log.error(`File read failed path[${filePath}] err:`, err);
} else {
event.returnValue = data;
}
});
} catch (error) {
log.error(`File read failed path[${filePath}] err:`, error);
event.returnValue = null;
}
});
@ -539,7 +542,6 @@ ipcMain.on(
NotificationChannel.CloseAllNotify,
(event: IpcMainEvent, ...args: any[]) => {
appWindow.browserWindow.flashFrame(false);
console.log('Channel.closeAllNotify', args);
}
);

View File

@ -12,6 +12,7 @@ import zlib from 'zlib';
import { BrowserWindow, app } from 'electron';
import { UpdaterChannel } from '@ucap-webmessenger/native-electron';
import { startWith } from 'rxjs/operators';
import log from 'electron-log';
export class RendererUpdater {
private checkSubscription: Subscription | undefined;
@ -35,7 +36,7 @@ export class RendererUpdater {
startCheck() {
if (!semver.valid(this.config.currentVersion)) {
console.log(
log.error(
`RendererUpdater::error currentVersion[${this.config.currentVersion}] is not valid`
);
return;
@ -49,7 +50,7 @@ export class RendererUpdater {
.then(res => {
const appVersion = res.data.appVersion;
if (!semver.valid(appVersion)) {
console.log(
log.error(
`RendererUpdater::error appVersion[${appVersion}] is not valid`
);
return;
@ -60,7 +61,7 @@ export class RendererUpdater {
}
})
.catch(reason => {
console.log('RendererUpdater', reason);
log.error('RendererUpdater', reason);
});
});
}
@ -83,14 +84,14 @@ export class RendererUpdater {
try {
fse.unlinkSync(this.appPath.slice(0, -1));
} catch (error) {
console.log('RendererUpdater::apply', error);
log.error('RendererUpdater::apply', error);
return;
}
try {
fse.renameSync(this.unzipPath, this.appPath.slice(0, -1));
} catch (error) {
console.log('RendererUpdater::apply', error);
log.error('RendererUpdater::apply', error);
return;
}
@ -104,7 +105,7 @@ export class RendererUpdater {
.then(res => {
fse.writeFile(this.downloadPath, res.data, err => {
if (!!err) {
console.log('RendererUpdater::download failed', err);
log.error('RendererUpdater::download failed', err);
return;
}
const updateInfo: UpdateInfo = {
@ -116,7 +117,7 @@ export class RendererUpdater {
});
})
.catch(reason => {
console.log('RendererUpdater::download failed', reason);
log.error('RendererUpdater::download failed', reason);
});
}
}

View File

@ -3,7 +3,7 @@ import * as path from 'path';
// tslint:disable-next-line: variable-name
const _root = __DEV__
? path.resolve(__dirname, '..', '..')
: path.resolve(__dirname);
: path.resolve(__dirname, '..', '..');
export function root(...paths: string[]) {
const args = Array.prototype.slice.call(paths, 0);

View File

@ -17,7 +17,7 @@
"build:main:development": "cross-env NODE_ENV=development TS_NODE_PROJECT='./config/tsconfig.webpack.json' parallel-webpack --config=config/main.webpack.config.ts",
"build:main:production": "cross-env NODE_ENV=production TS_NODE_PROJECT='./config/tsconfig.webpack.json' NODE_OPTIONS='--max_old_space_size=4096' parallel-webpack --config=config/main.webpack.config.ts",
"build:daesang": "npm-run-all -p build:daesang:renderer build:daesang:main:production",
"build:daesang:renderer": "cross-env NODE_ENV=production ng build -c renderer-daesang-development --base-href ./",
"build:daesang:renderer": "cross-env NODE_ENV=production ng build -c renderer-daesang-production --base-href ./",
"build:daesang:main:development": "cross-env NODE_ENV=development TS_NODE_PROJECT='./config/tsconfig.webpack.json' parallel-webpack --config=config/main.webpack.config.ts",
"build:daesang:main:production": "cross-env NODE_ENV=production TS_NODE_PROJECT='./config/tsconfig.webpack.json' NODE_OPTIONS='--max_old_space_size=4096' parallel-webpack --config=config/main.webpack.config.ts",
"run:daesang": "npm-run-all -p run:daesang:renderer run:daesang:main",

View File

@ -9,7 +9,7 @@ import { environment } from '../environments/environment';
export function createTranslateLoader(nativeService: NativeService) {
const translateLoader = nativeService.getTranslateLoader(
environment.production
? './assets/i18n/'
? '/dist/ucap-webmessenger-app/assets/i18n/'
: '/projects/ucap-webmessenger-app/src/assets/i18n/',
'.json'
);

View File

@ -34,6 +34,7 @@ import {
import { AppUserInfo, KEY_APP_USER_INFO } from '@app/types/app-user-info.type';
import { environment } from '../../../../environments/environment';
import { DaesangApiService } from '@ucap-webmessenger/daesang';
import { NGXLogger } from 'ngx-logger';
@Component({
selector: 'app-layout-native-top-bar',
@ -60,7 +61,8 @@ export class TopBarComponent implements OnInit, OnDestroy {
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
private localStorageService: LocalStorageService,
private sessionStorageService: SessionStorageService,
private daesangApiService: DaesangApiService
private daesangApiService: DaesangApiService,
private logger: NGXLogger
) {}
ngOnInit() {
@ -144,7 +146,7 @@ export class TopBarComponent implements OnInit, OnDestroy {
.pipe(
take(1),
map(res => (this.webLinkBadgeMail = res.count)),
catchError(error => of(console.log(error)))
catchError(error => of(this.logger.log(error)))
)
.subscribe();
}
@ -179,7 +181,7 @@ export class TopBarComponent implements OnInit, OnDestroy {
map(res => {
this.webLinkBadgePayment = res.count;
}),
catchError(error => of(console.log(error)))
catchError(error => of(this.logger.log(error)))
)
.subscribe();
}

View File

@ -12,7 +12,7 @@ import {
import { DeviceType } from '@ucap-webmessenger/core';
export const environment: Environment = {
production: false,
production: true,
title: `DS Talk`,
companyConfig: {