Skip to content

Commit

Permalink
Split electron-main into smaller chunks (#377)
Browse files Browse the repository at this point in the history
* Split electron-main into smaller chunks

* Affix @types/node version and upgrade electron-store

* Iterate PR

* tidy up

* Actually run the split out code
  • Loading branch information
t3chguy committed Jul 1, 2022
1 parent b7a0402 commit 389f6f4
Show file tree
Hide file tree
Showing 10 changed files with 794 additions and 691 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"dependencies": {
"auto-launch": "^5.0.5",
"counterpart": "^0.18.6",
"electron-store": "^6.0.1",
"electron-store": "^8.0.2",
"electron-window-state": "^5.0.3",
"minimist": "^1.2.6",
"png-to-ico": "^2.1.1",
Expand Down Expand Up @@ -88,6 +88,9 @@
"matrix-seshat": "^2.3.3",
"keytar": "^7.9.0"
},
"resolutions": {
"@types/node": "16.11.38"
},
"build": {
"appId": "im.riot.app",
"asarUnpack": "**/*.node",
Expand Down
22 changes: 21 additions & 1 deletion src/@types/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 New Vector Ltd
Copyright 2021 - 2022 New Vector Ltd
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,12 +15,32 @@ limitations under the License.
*/

import { BrowserWindow } from "electron";
import Store from "electron-store";
import AutoLaunch from "auto-launch";

import { AppLocalization } from "../language-helper";

declare global {
namespace NodeJS {
interface Global {
mainWindow: BrowserWindow;
appQuitting: boolean;
appLocalization: AppLocalization;
launcher: AutoLaunch;
vectorConfig: Record<string, any>;
trayConfig: {
// eslint-disable-next-line camelcase
icon_path: string;
brand: string;
};
store: Store<{
warnBeforeExit?: boolean;
minimizeToTray?: boolean;
spellCheckerEnabled?: boolean;
autoHideMenuBar?: boolean;
locale?: string | string[];
disableHardwareAcceleration?: boolean;
}>;
}
}
}
Loading

0 comments on commit 389f6f4

Please sign in to comment.