Skip to content

Commit

Permalink
update example app dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimiry committed Sep 6, 2018
1 parent a5be2bd commit 217a92f
Show file tree
Hide file tree
Showing 7 changed files with 587 additions and 717 deletions.
2 changes: 1 addition & 1 deletion example/electron-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Electron.js app with [electron-rpc-api](https://github.com/vladimiry/electron-rp
## Getting started

1. Run `yarn` console command to install the dependencies.
2. Run `yarn start` console command to build and start the app.
2. Run `yarn start` console command to build and start the app. It's recommended to use the same Node.js version that is bundled with Electron. Electron v3 comes with bundled Node.js v10.
42 changes: 21 additions & 21 deletions example/electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,41 @@
"start:web": "cross-env NODE_ENV=development webpack-dev-server -c ./webpack.config.ts"
},
"dependencies": {
"electron-rpc-api": "^1.0.0",
"rxjs": "^6.2.2"
"electron-rpc-api": "^3.0.0",
"rxjs": "^6.3.2"
},
"devDependencies": {
"@types/html-webpack-plugin": "^2.30.4",
"@types/html-webpack-plugin": "^3.2.0",
"@types/mini-css-extract-plugin": "^0.2.0",
"@types/node": "^10.5.2",
"@types/webpack": "^4.4.7",
"@types/webpack-dev-server": "2.9.5",
"@types/node": "^10.9.4",
"@types/webpack": "^4.4.11",
"@types/webpack-dev-server": "3.1.0",
"@types/webpack-merge": "^4.1.3",
"@types/webpack-node-externals": "^1.6.3",
"awesome-typescript-loader": "^5.2.0",
"bootstrap": "^4.1.2",
"bootstrap": "^4.1.3",
"cross-env": "^5.2.0",
"css-loader": "^1.0.0",
"electron": "^3.0.0-beta.2",
"electron-builder": "^20.22.0",
"electron": "^electron v3.0.0-beta.9",
"electron-builder": "^20.28.4",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.4.1",
"node-sass": "^4.9.2",
"mini-css-extract-plugin": "^0.4.2",
"node-sass": "^4.9.3",
"npm-run-all": "^4.1.3",
"ping": "^0.2.2",
"rimraf": "^2.6.2",
"sass-loader": "^7.0.3",
"ts-node": "^7.0.0",
"sass-loader": "^7.1.0",
"ts-node": "^7.0.1",
"tsconfig-paths-webpack-plugin": "^3.2.0",
"tslint": "^5.11.0",
"tslint-microsoft-contrib": "^5.0.3",
"tslint-rules-bunch": "^0.0.4",
"typescript": "^2.9.2",
"wait-on": "^2.1.0",
"webpack": "^4.16.1",
"webpack-cli": "^3.0.8",
"webpack-dev-server": "^3.1.4",
"webpack-merge": "^4.1.3",
"tslint-microsoft-contrib": "^5.2.1",
"tslint-rules-bunch": "^0.0.5",
"typescript": "^3.0.3",
"wait-on": "^3.0.1",
"webpack": "^4.17.2",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.7",
"webpack-merge": "^4.1.4",
"webpack-node-externals": "^1.7.2",
"xss": "^1.0.3"
}
Expand Down
8 changes: 4 additions & 4 deletions example/electron-app/src/main/ipc-main-api.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import ping from "ping";
import {app} from "electron";
import {map, switchMap, take} from "rxjs/operators";
import {EMPTY, from, interval} from "rxjs";
import {from, interval, of} from "rxjs";

import {AnyType} from "src/shared/model";
import {TODO} from "src/shared/model";
import {IPC_MAIN_API_SERVICE, IpcMainApi} from "src/shared/ipc-main-api-definition";

export function register(): IpcMainApi {
const api: IpcMainApi = {
ping: ({domain, times}) => interval(1000).pipe(
take(times),
switchMap(() => from(ping.promise.probe(domain))),
map(({alive, avg}: AnyType) => {
map(({alive, avg}: TODO) => {
if (!alive) {
throw new Error(`Host "${domain}" is unreachable`);
}
Expand All @@ -20,7 +20,7 @@ export function register(): IpcMainApi {
),
quitApp: () => {
app.quit();
return EMPTY;
return of(null);
},
};

Expand Down
2 changes: 1 addition & 1 deletion example/electron-app/src/shared/ipc-main-api-definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ApiMethod, ApiMethodNoArgument, IpcMainApiService} from "electron-rpc-ap

export interface IpcMainApi {
ping: ApiMethod<{ domain: string, times: number }, { domain: string, value: number }>;
quitApp: ApiMethodNoArgument<never>;
quitApp: ApiMethodNoArgument<null>;
}

export const IPC_MAIN_API_SERVICE = new IpcMainApiService<IpcMainApi>({channel: "some-ipcMain-channel"});
2 changes: 1 addition & 1 deletion example/electron-app/src/shared/model.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// tslint:disable-next-line:no-any
export type AnyType = any;
export type TODO = any;
4 changes: 2 additions & 2 deletions example/electron-app/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {Options} from "tsconfig-paths-webpack-plugin/lib/options";
import {TsconfigPathsPlugin} from "tsconfig-paths-webpack-plugin";

import packageJson from "./package.json";
import {AnyType} from "src/shared/model";
import {TODO} from "src/shared/model";

const production = process.env.NODE_ENV !== "development";
const root = (value: string = "") => path.join(process.cwd(), value);
Expand Down Expand Up @@ -64,7 +64,7 @@ const configurations = [
modulesFromFile: {
exclude: ["devDependencies"],
include: ["dependencies"],
} as AnyType,
} as TODO,
}),
],
},
Expand Down
Loading

0 comments on commit 217a92f

Please sign in to comment.