configuration of daesang is added

This commit is contained in:
병준 박 2019-12-13 13:45:08 +09:00
parent 3f8b68efff
commit 0271d86add
34 changed files with 488 additions and 36 deletions

View File

@ -98,6 +98,7 @@
} }
] ]
}, },
"renderer-development": { "renderer-development": {
"fileReplacements": [ "fileReplacements": [
{ {
@ -157,6 +158,66 @@
"maximumError": "10kb" "maximumError": "10kb"
} }
] ]
},
"renderer-daesang-development": {
"fileReplacements": [
{
"replace": "projects/ucap-webmessenger-app/src/environments/environment.ts",
"with": "projects/ucap-webmessenger-app/src/environments/environment-renderer.daesang.dev.ts"
}
],
"tsConfig": "projects/ucap-webmessenger-app/tsconfig-es5.app.json",
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
},
"renderer-daesang-production": {
"fileReplacements": [
{
"replace": "projects/ucap-webmessenger-app/src/environments/environment.ts",
"with": "projects/ucap-webmessenger-app/src/environments/environment-renderer.daesang.prod.ts"
}
],
"tsConfig": "projects/ucap-webmessenger-app/tsconfig-es5.app.json",
"optimization": false,
"outputHashing": "all",
"sourceMap": true,
"extractCss": true,
"namedChunks": false,
"aot": false,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": false,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
},
{
"type": "anyComponentStyle",
"maximumWarning": "6kb",
"maximumError": "10kb"
}
]
} }
} }
}, },
@ -178,6 +239,12 @@
}, },
"renderer-production": { "renderer-production": {
"browserTarget": "ucap-webmessenger-app:build:renderer-production" "browserTarget": "ucap-webmessenger-app:build:renderer-production"
},
"renderer-daesang-development": {
"browserTarget": "ucap-webmessenger-app:build:renderer-daesang-development"
},
"renderer-daesang-production": {
"browserTarget": "ucap-webmessenger-app:build:renderer-daesang-production"
} }
} }
}, },

View File

@ -20,18 +20,18 @@ const mainConfig: webpack.Configuration = {
__dirname, __dirname,
'..', '..',
'electron-projects/ucap-webmessenger-electron/src/index' 'electron-projects/ucap-webmessenger-electron/src/index'
), )
}, },
target: 'electron-main', target: 'electron-main',
mode: enviroments.__DEV__ ? 'development' : 'production', mode: enviroments.__DEV__ ? 'development' : 'production',
devtool: 'source-map', devtool: 'source-map',
optimization: { optimization: {
noEmitOnErrors: true, noEmitOnErrors: true
}, },
externals, externals,
output: { output: {
filename: '[name].js', filename: '[name].js',
path: path.resolve(__dirname, '..', outputDir), path: path.resolve(__dirname, '..', outputDir)
}, },
module: { module: {
rules: [ rules: [
@ -44,7 +44,7 @@ const mainConfig: webpack.Configuration = {
'electron-projects/ucap-webmessenger-electron/src' 'electron-projects/ucap-webmessenger-electron/src'
), ),
path.resolve(__dirname, '..', 'electron-projects'), path.resolve(__dirname, '..', 'electron-projects'),
path.resolve(__dirname, '..', 'projects'), path.resolve(__dirname, '..', 'projects')
], ],
use: [ use: [
{ {
@ -55,20 +55,20 @@ const mainConfig: webpack.Configuration = {
__dirname, __dirname,
'..', '..',
'electron-projects/ucap-webmessenger-electron/tsconfig.electron.json' 'electron-projects/ucap-webmessenger-electron/tsconfig.electron.json'
), )
}, }
}, }
], ],
exclude: /node_modules/, exclude: /node_modules/
}, },
{ {
test: /\.node$/, test: /\.node$/,
loader: 'awesome-node-loader', loader: 'awesome-node-loader',
options: { options: {
name: '[name].[ext]', name: '[name].[ext]'
}, }
}, }
], ]
}, },
plugins: [ plugins: [
new CleanWebpackPlugin({ verbose: false }), new CleanWebpackPlugin({ verbose: false }),
@ -77,16 +77,16 @@ const mainConfig: webpack.Configuration = {
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
new webpack.DefinePlugin( new webpack.DefinePlugin(
Object.assign({}, enviroments, { Object.assign({}, enviroments, {
__PROCESS_KIND__: JSON.stringify('main'), __PROCESS_KIND__: JSON.stringify('main')
}) })
), ),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ {
from: 'ucap-webmessenger-electron/resources/**/*', from: 'ucap-webmessenger-electron/resources/**/*',
to: path.resolve(__dirname, '..', 'dist'), to: path.resolve(__dirname, '..', 'dist'),
context: 'electron-projects', context: 'electron-projects'
}, }
]), ])
], ],
resolve: { resolve: {
extensions: ['.js', '.ts'], extensions: ['.js', '.ts'],
@ -101,6 +101,11 @@ const mainConfig: webpack.Configuration = {
'..', '..',
'electron-projects/ucap-webmessenger-electron-notification/src/public-api' 'electron-projects/ucap-webmessenger-electron-notification/src/public-api'
), ),
'@ucap-webmessenger/electron-update-window': path.resolve(
__dirname,
'..',
'electron-projects/ucap-webmessenger-electron-update-window/src/public-api'
),
'@ucap-webmessenger/core': path.resolve( '@ucap-webmessenger/core': path.resolve(
__dirname, __dirname,
'..', '..',
@ -120,14 +125,14 @@ const mainConfig: webpack.Configuration = {
__dirname, __dirname,
'..', '..',
'electron-projects/ucap-webmessenger-electron/src/public-api' 'electron-projects/ucap-webmessenger-electron/src/public-api'
), )
}, },
modules: [path.resolve(__dirname, '..', 'node_modules/')], modules: [path.resolve(__dirname, '..', 'node_modules/')]
}, },
node: { node: {
__dirname: false, __dirname: false,
__filename: false, __filename: false
}, }
}; };
export default [mainConfig]; export default [mainConfig];

View File

@ -0,0 +1,25 @@
# UcapWebmessengerElectronUpdateWindow
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 8.2.11.
## Code scaffolding
Run `ng generate component component-name --project ucap-webmessenger-electron-update-window` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ucap-webmessenger-electron-update-window`.
> Note: Don't forget to add `--project ucap-webmessenger-electron-update-window` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build ucap-webmessenger-electron-update-window` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build ucap-webmessenger-electron-update-window`, go to the dist folder `cd dist/ucap-webmessenger-electron-update-window` and run `npm publish`.
## Running unit tests
Run `ng test ucap-webmessenger-electron-update-window` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

View File

@ -0,0 +1,34 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['jasmine'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(
__dirname,
'../../coverage/ucap-webmessenger-electron-update-window'
),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

View File

@ -0,0 +1,5 @@
{
"name": "@ucap-webmessenger/electron-update-window",
"version": "0.0.1",
"peerDependencies": {}
}

View File

@ -0,0 +1 @@
export class ElectronUpdateWindowService {}

View File

@ -0,0 +1,3 @@
/*
* Public API Surface of ucap-webmessenger-electron-update-window
*/

View File

@ -0,0 +1,21 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

View File

@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
]
}

View File

@ -0,0 +1,17 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"ucapElectronUpdateWindow",
"camelCase"
],
"component-selector": [
true,
"element",
"ucap-electron-update-window",
"kebab-case"
]
}
}

View File

@ -63,7 +63,7 @@ a:active {
top: 6px; top: 6px;
width: 20px; width: 20px;
height: 20px; height: 20px;
background: url(../image/btn_close_gray.png) no-repeat 50% 50%; background: url(../images/btn_close_gray.png) no-repeat 50% 50%;
} }
.btn_close:hover { .btn_close:hover {
opacity: 0.7; opacity: 0.7;
@ -78,7 +78,7 @@ a:active {
width: 54px; width: 54px;
height: 54px; height: 54px;
border-radius: 50%; border-radius: 50%;
background: #5bc1ff url(../image/img_nophoto_50.png) no-repeat 50% 50%; background: #5bc1ff url(../images/img_nophoto_50.png) no-repeat 50% 50%;
border: 2px solid #ddd; border: 2px solid #ddd;
} }
.info .profile { .info .profile {

View File

@ -1,16 +1,12 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML> <html>
<HEAD> <head>
<title>[개발]M Messenger - 메시지 알림</title> <title>[개발]M Messenger - 메시지 알림</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link <link type="text/css" rel="stylesheet" href="styles/noti_messege.css" />
type="text/css" </head>
rel="stylesheet"
href="styles/noti_messege.css"
/>
</HEAD>
<style> <style>
html, html,
body { body {
@ -18,7 +14,7 @@
overflow-x: hidden; overflow-x: hidden;
} }
</style> </style>
<BODY> <body>
<div class="noti_messege" id="container"> <div class="noti_messege" id="container">
<div class="info"> <div class="info">
<a class="btn_close" id="close"></a> <a class="btn_close" id="close"></a>
@ -28,7 +24,7 @@
<img <img
src="" src=""
id="image" id="image"
onerror="this.src='image/img_nophoto_50.png';" onerror="this.src='images/img_nophoto_50.png';"
/> />
</div> </div>
</div> </div>
@ -46,5 +42,5 @@
</div> </div>
</div> </div>
</div> </div>
</BODY> </body>
</HTML> </html>

View File

@ -26,6 +26,10 @@ import {
UpdateCheckConfig UpdateCheckConfig
} from '@ucap-webmessenger/native'; } from '@ucap-webmessenger/native';
import { ElectronAppChannel } from '@ucap-webmessenger/electron-core'; import { ElectronAppChannel } from '@ucap-webmessenger/electron-core';
import { autoUpdater, CancellationToken } from 'electron-updater';
import log from 'electron-log';
import { RendererUpdater } from './lib/renderer-updater'; import { RendererUpdater } from './lib/renderer-updater';
const appIconPath = __LINUX__ const appIconPath = __LINUX__
@ -80,6 +84,12 @@ isDuplicateInstance = !gotSingleInstanceLock;
let idle: IdleChecker | null; let idle: IdleChecker | null;
let rendererUpdater: RendererUpdater | undefined; let rendererUpdater: RendererUpdater | undefined;
log.transports.file.level = 'debug';
let autoUpdaterCancellationToken: CancellationToken;
autoUpdater.autoDownload = false;
autoUpdater.logger = log;
app.on(ElectronAppChannel.SecondInstance, (event, args, workingDirectory) => { app.on(ElectronAppChannel.SecondInstance, (event, args, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window. // Someone tried to run a second instance, we should focus our window.
if (appWindow) { if (appWindow) {
@ -400,12 +410,15 @@ ipcMain.on(
text: noti.contents, text: noti.contents,
image: image:
noti.image || noti.image ||
path.join(__dirname, 'resources/notification/image/img_nophoto_50.png'), path.join(
__dirname,
'resources/notification/images/img_nophoto_50.png'
),
sound: noti.useSound sound: noti.useSound
? path.join( ? path.join(
'file://', 'file://',
__dirname, __dirname,
'resources/notification/sound/messageAlarm.mp3' 'resources/notification/sounds/messageAlarm.mp3'
) )
: '', : '',
onClick: e => { onClick: e => {

View File

@ -19,6 +19,9 @@
"@ucap-webmessenger/electron-notification": [ "@ucap-webmessenger/electron-notification": [
"../ucap-webmessenger-electron-notification/src/public-api" "../ucap-webmessenger-electron-notification/src/public-api"
], ],
"@ucap-webmessenger/electron-update-window": [
"../ucap-webmessenger-electron-update-window/src/public-api"
],
"@ucap-webmessenger/core": [ "@ucap-webmessenger/core": [
"../../projects/ucap-webmessenger-core/src/public-api" "../../projects/ucap-webmessenger-core/src/public-api"
], ],

View File

@ -7,12 +7,22 @@
"start": "npm-run-all -p start:renderer start:main", "start": "npm-run-all -p start:renderer start:main",
"start:main": "wait-on http-get://localhost:4200/ && npm run build:main:development && electron --nolazy --inspect-brk=9229 .", "start:main": "wait-on http-get://localhost:4200/ && npm run build:main:development && electron --nolazy --inspect-brk=9229 .",
"start:renderer": "cross-env UCAP_ENV_RUNTIME=ELECTRON ng serve -c renderer-development", "start:renderer": "cross-env UCAP_ENV_RUNTIME=ELECTRON ng serve -c renderer-development",
"start:daesang": "npm-run-all -p start:daesang:renderer start:daesang:main",
"start:daesang:main": "wait-on http-get://localhost:4200/ && npm run build:daesang:main:development && electron --nolazy --inspect-brk=9229 .",
"start:daesang:renderer": "cross-env UCAP_ENV_RUNTIME=ELECTRON ng serve -c renderer-daesang-development",
"start:browser": "cross-env UCAP_ENV_RUNTIME=BROWSER ng serve -c browser-development -o", "start:browser": "cross-env UCAP_ENV_RUNTIME=BROWSER ng serve -c browser-development -o",
"build": "npm-run-all -p build:renderer build:main:production", "build": "npm-run-all -p build:renderer build:main:production",
"build:daesang": "npm-run-all -p build:daesang:renderer build:daesang:main:production",
"build:renderer": "cross-env NODE_ENV=production ng build -c renderer-development --base-href ./", "build:renderer": "cross-env NODE_ENV=production ng build -c renderer-development --base-href ./",
"build:daesang:renderer": "cross-env NODE_ENV=production ng build -c renderer-daesang-development --base-href ./",
"build:browser": "cross-env UCAP_ENV_RUNTIME=BROWSER ng build -c browser-development --base-href ./NextMessenger_POC", "build:browser": "cross-env UCAP_ENV_RUNTIME=BROWSER ng build -c browser-development --base-href ./NextMessenger_POC",
"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: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: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: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",
"run:daesang:main": "wait-on http-get://localhost:4200/ && npm run build:daesang:main:development && electron --nolazy --inspect-brk=9229 .",
"run:daesang:renderer": "cross-env UCAP_ENV_RUNTIME=ELECTRON ng serve -c renderer-daesang-production",
"electron:local": "electron .", "electron:local": "electron .",
"electron:windows": "npm run build && electron-builder build --windows", "electron:windows": "npm run build && electron-builder build --windows",
"electron:mac": "npm run build && electron-builder build --mac", "electron:mac": "npm run build && electron-builder build --mac",

View File

@ -0,0 +1,7 @@
import { Environment } from './environment.type';
import { environment as devEnvironment } from './environment.daesang.dev';
export const environment: Environment = {
...devEnvironment,
runtime: 'browser'
};

View File

@ -0,0 +1,7 @@
import { Environment } from './environment.type';
import { environment as prodEnvironment } from './environment.daesang.prod';
export const environment: Environment = {
...prodEnvironment,
runtime: 'browser'
};

View File

@ -0,0 +1,7 @@
import { Environment } from './environment.type';
import { environment as devEnvironment } from './environment.daesang.dev';
export const environment: Environment = {
...devEnvironment,
runtime: 'electron'
};

View File

@ -0,0 +1,7 @@
import { Environment } from './environment.type';
import { environment as prodEnvironment } from './environment.daesang.prod';
export const environment: Environment = {
...prodEnvironment,
runtime: 'electron'
};

View File

@ -0,0 +1,96 @@
import {
Environment,
commonApiUrls,
commonApiacceptableFileExtensions,
publicApiUrls,
externalApiUrls,
piUrls,
protocolUrls,
messageApiUrls
} from './environment.type';
import { DeviceType } from '@ucap-webmessenger/core';
export const environment: Environment = {
production: false,
title: `[개발] DS Talk`,
companyConfig: {
companyGroupCode: 'LG'
},
productConfig: {
productId: 'PRO_000482',
productName: 'EZMessenger',
authentication: {
usePrivateInformationAgree: false
},
updateCheckConfig: {
deviceType: DeviceType.Renderer,
intervalHour: 1
}
},
commonApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: '15.164.139.105',
port: 8011
},
urls: commonApiUrls,
acceptableFileExtensions: commonApiacceptableFileExtensions
},
publicApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: '15.164.139.105',
port: 8011
},
urls: publicApiUrls
},
externalApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: '15.164.139.105',
port: 8011
},
urls: externalApiUrls
},
messageApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: '15.164.139.105',
port: 9098
},
urls: messageApiUrls
},
piModuleConfig: {
hostConfig: {
protocol: 'http',
domain: '15.164.139.105',
port: 9097
},
urls: piUrls
},
protocolModuleConfig: {
hostConfig: {
protocol: 'ws',
domain: '15.164.139.105',
port: 8080
},
urls: protocolUrls,
reconnect: {
delay: 1000
},
requestId: {
min: 1,
max: 59999
}
},
nativeModuleConfig: {}
};

View File

@ -0,0 +1,96 @@
import {
Environment,
commonApiUrls,
commonApiacceptableFileExtensions,
publicApiUrls,
externalApiUrls,
piUrls,
protocolUrls,
messageApiUrls
} from './environment.type';
import { DeviceType } from '@ucap-webmessenger/core';
export const environment: Environment = {
production: false,
title: `DS Talk`,
companyConfig: {
companyGroupCode: 'LG'
},
productConfig: {
productId: 'PRO_000482',
productName: 'EZMessenger',
authentication: {
usePrivateInformationAgree: false
},
updateCheckConfig: {
deviceType: DeviceType.Renderer,
intervalHour: 1
}
},
commonApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: 'messenger.daesang.com',
port: 8011
},
urls: commonApiUrls,
acceptableFileExtensions: commonApiacceptableFileExtensions
},
publicApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: 'messenger.daesang.com',
port: 8011
},
urls: publicApiUrls
},
externalApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: 'messenger.daesang.com',
port: 8011
},
urls: externalApiUrls
},
messageApiModuleConfig: {
hostConfig: {
protocol: 'http',
domain: 'messenger.daesang.com',
port: 9098
},
urls: messageApiUrls
},
piModuleConfig: {
hostConfig: {
protocol: 'http',
domain: 'messenger.daesang.com',
port: 9097
},
urls: piUrls
},
protocolModuleConfig: {
hostConfig: {
protocol: 'ws',
domain: 'messenger.daesang.com',
port: 8080
},
urls: protocolUrls,
reconnect: {
delay: 1000
},
requestId: {
min: 1,
max: 59999
}
},
nativeModuleConfig: {}
};

View File

@ -141,6 +141,9 @@
"@ucap-webmessenger/electron-notification": [ "@ucap-webmessenger/electron-notification": [
"electron-projects/ucap-webmessenger-electron-notification/src/public-api" "electron-projects/ucap-webmessenger-electron-notification/src/public-api"
], ],
"@ucap-webmessenger/electron-update-window": [
"electron-projects/ucap-webmessenger-electron-update-window/src/public-api"
],
"@ucap-webmessenger/electron": [ "@ucap-webmessenger/electron": [
"electron-projects/ucap-webmessenger-electron/src/public-api" "electron-projects/ucap-webmessenger-electron/src/public-api"
] ]