Skip to content

Commit ebbb20b

Browse files
authored
Merge pull request #7 from olzzon/develop
fix: typesafety and fix of electron force update
2 parents 6ce75a4 + f5364ff commit ebbb20b

File tree

6 files changed

+369
-12
lines changed

6 files changed

+369
-12
lines changed

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
}
4646
],
4747
"plugins": [
48-
[
49-
"@electron-forge/plugin-webpack",
50-
{
48+
{
49+
"name": "@electron-forge/plugin-webpack",
50+
"config": {
5151
"mainConfig": "./webpack.main.config.js",
5252
"renderer": {
5353
"config": "./webpack.renderer.config.js",
@@ -63,7 +63,7 @@
6363
]
6464
}
6565
}
66-
]
66+
}
6767
]
6868
}
6969
},
@@ -80,6 +80,7 @@
8080
"@typescript-eslint/eslint-plugin": "^7.0.1",
8181
"@typescript-eslint/parser": "^7.0.1",
8282
"@vercel/webpack-asset-relocator-loader": "1.7.3",
83+
"cross-env": "^7.0.3",
8384
"css-loader": "^6.10.0",
8485
"electron": "28.2.3",
8586
"eslint": "^8.56.0",
@@ -90,7 +91,8 @@
9091
"react-dom": "^18.2.0",
9192
"style-loader": "^3.3.4",
9293
"ts-loader": "^9.5.1",
93-
"typescript": "~5.3.3"
94+
"typescript": "~5.3.3",
95+
"webpack-cli": "^5.1.4"
9496
},
9597
"dependencies": {
9698
"electron-squirrel-startup": "^1.0.0",

src/server/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ export const restartApp = () => {
2222
console.log("Restarting Ninja-player");
2323
setTimeout(() => {
2424
app.relaunch();
25-
mainWindow.destroy();
25+
mainWindow?.destroy();
2626
app.exit(0);
2727
}, 1000);
2828
};
2929

3030
export const quitApp = () => {
3131
console.log("Quiting Ninja-player");
3232
setTimeout(() => {
33-
mainWindow.destroy();
33+
mainWindow?.destroy();
3434
app.exit(0);
3535
}, 1000);
3636
};

src/server/preload.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// See the Electron documentation for details on how to use preload scripts:
22
// https://www.electronjs.org/docs/latest/tutorial/process-model#preload-scripts
33

4-
const { contextBridge, ipcRenderer } = require("electron");
4+
import { contextBridge, ipcRenderer } from "electron"
55

66
// As an example, here we use the exposeInMainWorld API to expose the IPC renderer
77
// to the main window. They'll be accessible at "window.ipcRenderer".

src/server/utils/restApiPostToPortal.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ import { post } from "request";
44

55
export const restApiPostToPortal = (settings: ISettings) => {
66
const options = {
7-
url: settings.portalUrl,
87
json: true,
98
body: {
109
id: settings.id,
1110
link: createAllURLs(settings),
1211
},
1312
};
14-
post(options, (error, response) => {
13+
post(settings.portalUrl || "", options, (error, response) => {
1514
if (error) {
1615
console.error(error);
1716
return;

tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"compilerOptions": {
3+
"forceConsistentCasingInFileNames": true,
4+
"strict": true,
35
"allowJs": true,
6+
"declaration": true,
7+
"emitDeclarationOnly": true,
8+
"allowImportingTsExtensions": true,
49
"module": "commonjs",
510
"skipLibCheck": true,
611
"esModuleInterop": true,

0 commit comments

Comments
 (0)