diff --git a/angular.json b/angular.json index b24b253d..fb6dca3f 100644 --- a/angular.json +++ b/angular.json @@ -98,6 +98,7 @@ } ] }, + "renderer-development": { "fileReplacements": [ { @@ -157,6 +158,66 @@ "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": { "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" } } }, diff --git a/config/main.webpack.config.ts b/config/main.webpack.config.ts index 5759bf65..0dfc5816 100644 --- a/config/main.webpack.config.ts +++ b/config/main.webpack.config.ts @@ -20,18 +20,18 @@ const mainConfig: webpack.Configuration = { __dirname, '..', 'electron-projects/ucap-webmessenger-electron/src/index' - ), + ) }, target: 'electron-main', mode: enviroments.__DEV__ ? 'development' : 'production', devtool: 'source-map', optimization: { - noEmitOnErrors: true, + noEmitOnErrors: true }, externals, output: { filename: '[name].js', - path: path.resolve(__dirname, '..', outputDir), + path: path.resolve(__dirname, '..', outputDir) }, module: { rules: [ @@ -44,7 +44,7 @@ const mainConfig: webpack.Configuration = { 'electron-projects/ucap-webmessenger-electron/src' ), path.resolve(__dirname, '..', 'electron-projects'), - path.resolve(__dirname, '..', 'projects'), + path.resolve(__dirname, '..', 'projects') ], use: [ { @@ -55,20 +55,20 @@ const mainConfig: webpack.Configuration = { __dirname, '..', 'electron-projects/ucap-webmessenger-electron/tsconfig.electron.json' - ), - }, - }, + ) + } + } ], - exclude: /node_modules/, + exclude: /node_modules/ }, { test: /\.node$/, loader: 'awesome-node-loader', options: { - name: '[name].[ext]', - }, - }, - ], + name: '[name].[ext]' + } + } + ] }, plugins: [ new CleanWebpackPlugin({ verbose: false }), @@ -77,16 +77,16 @@ const mainConfig: webpack.Configuration = { new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), new webpack.DefinePlugin( Object.assign({}, enviroments, { - __PROCESS_KIND__: JSON.stringify('main'), + __PROCESS_KIND__: JSON.stringify('main') }) ), new CopyWebpackPlugin([ { from: 'ucap-webmessenger-electron/resources/**/*', to: path.resolve(__dirname, '..', 'dist'), - context: 'electron-projects', - }, - ]), + context: 'electron-projects' + } + ]) ], resolve: { extensions: ['.js', '.ts'], @@ -101,6 +101,11 @@ const mainConfig: webpack.Configuration = { '..', '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( __dirname, '..', @@ -120,14 +125,14 @@ const mainConfig: webpack.Configuration = { __dirname, '..', 'electron-projects/ucap-webmessenger-electron/src/public-api' - ), + ) }, - modules: [path.resolve(__dirname, '..', 'node_modules/')], + modules: [path.resolve(__dirname, '..', 'node_modules/')] }, node: { __dirname: false, - __filename: false, - }, + __filename: false + } }; export default [mainConfig]; diff --git a/electron-projects/ucap-webmessenger-electron-update-window/README.md b/electron-projects/ucap-webmessenger-electron-update-window/README.md new file mode 100644 index 00000000..db69062e --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/README.md @@ -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). diff --git a/electron-projects/ucap-webmessenger-electron-update-window/karma.conf.js b/electron-projects/ucap-webmessenger-electron-update-window/karma.conf.js new file mode 100644 index 00000000..3859d39f --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/karma.conf.js @@ -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 + }); +}; diff --git a/electron-projects/ucap-webmessenger-electron-update-window/package.json b/electron-projects/ucap-webmessenger-electron-update-window/package.json new file mode 100644 index 00000000..e48fb351 --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/package.json @@ -0,0 +1,5 @@ +{ + "name": "@ucap-webmessenger/electron-update-window", + "version": "0.0.1", + "peerDependencies": {} +} diff --git a/electron-projects/ucap-webmessenger-electron-update-window/src/lib/services/electron-update-window.service.ts b/electron-projects/ucap-webmessenger-electron-update-window/src/lib/services/electron-update-window.service.ts new file mode 100644 index 00000000..886ec675 --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/src/lib/services/electron-update-window.service.ts @@ -0,0 +1 @@ +export class ElectronUpdateWindowService {} diff --git a/electron-projects/ucap-webmessenger-electron-update-window/src/public-api.ts b/electron-projects/ucap-webmessenger-electron-update-window/src/public-api.ts new file mode 100644 index 00000000..8efee9e2 --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/src/public-api.ts @@ -0,0 +1,3 @@ +/* + * Public API Surface of ucap-webmessenger-electron-update-window + */ diff --git a/electron-projects/ucap-webmessenger-electron-update-window/src/test.ts b/electron-projects/ucap-webmessenger-electron-update-window/src/test.ts new file mode 100644 index 00000000..978c64fb --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/src/test.ts @@ -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); diff --git a/electron-projects/ucap-webmessenger-electron-update-window/tsconfig.lib.json b/electron-projects/ucap-webmessenger-electron-update-window/tsconfig.lib.json new file mode 100644 index 00000000..33840d86 --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/tsconfig.lib.json @@ -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"] +} diff --git a/electron-projects/ucap-webmessenger-electron-update-window/tsconfig.spec.json b/electron-projects/ucap-webmessenger-electron-update-window/tsconfig.spec.json new file mode 100644 index 00000000..16da33db --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/tsconfig.spec.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "../../out-tsc/spec", + "types": [ + "jasmine", + "node" + ] + }, + "files": [ + "src/test.ts" + ], + "include": [ + "**/*.spec.ts", + "**/*.d.ts" + ] +} diff --git a/electron-projects/ucap-webmessenger-electron-update-window/tslint.json b/electron-projects/ucap-webmessenger-electron-update-window/tslint.json new file mode 100644 index 00000000..95437ac7 --- /dev/null +++ b/electron-projects/ucap-webmessenger-electron-update-window/tslint.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tslint.json", + "rules": { + "directive-selector": [ + true, + "attribute", + "ucapElectronUpdateWindow", + "camelCase" + ], + "component-selector": [ + true, + "element", + "ucap-electron-update-window", + "kebab-case" + ] + } +} diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_message.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_message.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_message.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_message.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_receive.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_receive.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_receive.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_receive.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_refuse.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_refuse.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_refuse.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_refuse.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_transfer.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_transfer.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_call_transfer.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_call_transfer.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_close.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_close.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_close_gray.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close_gray.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_close_gray.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_close_gray.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_noti_call.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_noti_call.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/btn_noti_call.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/btn_noti_call.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/image/img_nophoto_50.png b/electron-projects/ucap-webmessenger-electron/resources/notification/images/img_nophoto_50.png similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/image/img_nophoto_50.png rename to electron-projects/ucap-webmessenger-electron/resources/notification/images/img_nophoto_50.png diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/sound/messageAlarm.mp3 b/electron-projects/ucap-webmessenger-electron/resources/notification/sounds/messageAlarm.mp3 similarity index 100% rename from electron-projects/ucap-webmessenger-electron/resources/notification/sound/messageAlarm.mp3 rename to electron-projects/ucap-webmessenger-electron/resources/notification/sounds/messageAlarm.mp3 diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/styles/noti_messege.css b/electron-projects/ucap-webmessenger-electron/resources/notification/styles/noti_messege.css index 02cbf609..ce92d6c7 100644 --- a/electron-projects/ucap-webmessenger-electron/resources/notification/styles/noti_messege.css +++ b/electron-projects/ucap-webmessenger-electron/resources/notification/styles/noti_messege.css @@ -63,7 +63,7 @@ a:active { top: 6px; width: 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 { opacity: 0.7; @@ -78,7 +78,7 @@ a:active { width: 54px; height: 54px; 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; } .info .profile { diff --git a/electron-projects/ucap-webmessenger-electron/resources/notification/template.html b/electron-projects/ucap-webmessenger-electron/resources/notification/template.html index 5bec4a80..ef896e72 100644 --- a/electron-projects/ucap-webmessenger-electron/resources/notification/template.html +++ b/electron-projects/ucap-webmessenger-electron/resources/notification/template.html @@ -1,16 +1,12 @@ - -
+ +