Skip to content

Commit cc67807

Browse files
committed
fix: windows issues
1 parent af500b6 commit cc67807

File tree

9 files changed

+53
-17
lines changed

9 files changed

+53
-17
lines changed

.github/workflows/executable-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,6 @@ jobs:
3434
with:
3535
files: |
3636
desktop-app/out/make/**/*.dmg
37+
desktop-app/out/make/**/*.exe
38+
desktop-app/out/make/**/*.msi
3739
desktop-app/out/make/zip/**/*.zip

desktop-app/forge.config.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ForgeConfig } from "@electron-forge/shared-types";
22
import { MakerZIP } from "@electron-forge/maker-zip";
33
import { MakerDMG } from "@electron-forge/maker-dmg";
4+
import { MakerSquirrel } from "@electron-forge/maker-squirrel";
45
import { AutoUnpackNativesPlugin } from "@electron-forge/plugin-auto-unpack-natives";
56
import { WebpackPlugin } from "@electron-forge/plugin-webpack";
67
import { FusesPlugin } from "@electron-forge/plugin-fuses";
@@ -18,13 +19,24 @@ const config: ForgeConfig = {
1819
},
1920
rebuildConfig: {},
2021
makers: [
21-
new MakerZIP({}, ["darwin"]),
22-
new MakerDMG({
23-
name: "Drew Localhost",
24-
icon: "./assets/drew-icon.icns",
25-
appPath: ".drew-localhost",
26-
title: "Drew Localhost",
27-
}),
22+
new MakerZIP({}, ["darwin", "win32", "win64"]),
23+
new MakerSquirrel(
24+
{
25+
iconUrl: "./assets/drew-icon.icns",
26+
title: "Drew Localhost",
27+
name: "Drew Localhost",
28+
},
29+
["win32", "win64"]
30+
),
31+
new MakerDMG(
32+
{
33+
name: "Drew Localhost",
34+
icon: "./assets/drew-icon.icns",
35+
appPath: ".drew-localhost",
36+
title: "Drew Localhost",
37+
},
38+
["darwin"]
39+
),
2840
],
2941
plugins: [
3042
new AutoUnpackNativesPlugin({}),

desktop-app/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"@electron-forge/plugin-auto-unpack-natives": "^7.5.0",
2222
"@electron-forge/plugin-fuses": "^7.5.0",
2323
"@electron-forge/plugin-webpack": "^7.5.0",
24+
"@electron-forge/shared-types": "^7.5.0",
2425
"@electron/fuses": "^1.8.0",
2526
"@types/dockerode": "^3.3.31",
2627
"@types/fs-extra": "^11.0.4",
@@ -33,11 +34,12 @@
3334
"eslint": "^8.0.1",
3435
"eslint-plugin-import": "^2.25.0",
3536
"fork-ts-checker-webpack-plugin": "^7.2.13",
37+
"json-loader": "^0.5.7",
3638
"node-loader": "^2.0.0",
3739
"style-loader": "^3.0.0",
3840
"ts-loader": "^9.2.2",
39-
"ts-node": "^10.0.0",
40-
"typescript": "~4.5.4"
41+
"ts-node": "^10.9.2",
42+
"typescript": "^5.6.3"
4143
},
4244
"keywords": [],
4345
"author": {
@@ -46,7 +48,7 @@
4648
},
4749
"license": "MIT",
4850
"dependencies": {
49-
"@drewpackages/host-common": "^1.0.4",
51+
"@drewpackages/host-common": "^1.1.0",
5052
"dockerode": "^4.0.2",
5153
"electron-squirrel-startup": "^1.0.1",
5254
"fs-extra": "^11.2.0"

desktop-app/src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import isDev from "electron-is-dev";
99
declare const MAIN_WINDOW_WEBPACK_ENTRY: string;
1010
declare const MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY: string;
1111

12+
if (require("electron-squirrel-startup")) {
13+
app.quit();
14+
}
15+
1216
const createWindow = () => {
1317
// Create the browser window.
1418
const mainWindow = new BrowserWindow({
@@ -17,6 +21,7 @@ const createWindow = () => {
1721
webPreferences: {
1822
preload: MAIN_WINDOW_PRELOAD_WEBPACK_ENTRY,
1923
},
24+
autoHideMenuBar: true,
2025
});
2126

2227
const docker = new DockerService();

desktop-app/src/services/deployments/service.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { FormulaExecutionDump } from "@drewpackages/host-common";
22
import { DumpDeployerService } from "../dump-deployer/service";
33
import { DeployedDappsStore, DeploymentStatus } from "./type";
4-
import { normalize, join } from "node:path";
5-
import { readFile, exists, writeFile } from "fs-extra";
4+
import { normalize, join, dirname } from "node:path";
5+
import { readFile, exists, writeFile, mkdir, pathExists } from "fs-extra";
66
import { app } from "electron";
77
import { DockerService } from "../docker/service";
88
import { DappMarketplaceService } from "../marketplace/service";
@@ -31,6 +31,12 @@ export class DeploymentsService {
3131
private async persistDeployedDappsStote(
3232
store: DeployedDappsStore
3333
): Promise<void> {
34+
const dappsFileDir = dirname(DEPLOYED_DAPPS_STORE_PATH);
35+
36+
if (!(await pathExists(dappsFileDir))) {
37+
await mkdir(dappsFileDir, { recursive: true });
38+
}
39+
3440
await writeFile(DEPLOYED_DAPPS_STORE_PATH, JSON.stringify(store, null, 2));
3541
}
3642

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import { normalize, join } from "node:path";
22
import { app } from "electron";
3+
import { existsSync, mkdirSync } from "fs-extra";
34

45
export const FORMULAS_DIR = normalize(
56
join(app.getPath("appData"), `/.drew-localhost/formulas`)
67
);
78

9+
if (!existsSync(FORMULAS_DIR)) {
10+
mkdirSync(FORMULAS_DIR, { recursive: true });
11+
}
12+
813
export function getFormulaPath(formulaName: string): string {
914
return normalize(join(FORMULAS_DIR, formulaName));
1015
}

desktop-app/src/services/marketplace/service.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ export class DappMarketplaceService {
1515
dappId: string
1616
): Promise<FormulaExecutionDump | "not-provided"> {
1717
try {
18-
const { default: dump }: { default: FormulaExecutionDump } = await import(
19-
`../../dapps/dumps/${dappId}.json`
20-
);
18+
const dump = await require(`../../dapps/dumps/${dappId}.json`);
2119
return dump;
2220
} catch {
2321
return "not-provided";

desktop-app/webpack.rules.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const rules: Required<ModuleOptions>["rules"] = [
1919
},
2020
},
2121
{
22-
test: /\.tsx?$/,
22+
test: [/\.tsx?$/, /\.json$/],
2323
exclude: /(node_modules|\.webpack)/,
2424
use: {
2525
loader: "ts-loader",

ui/src/index.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@
44
@tailwind base;
55
}
66
@tailwind components;
7-
@tailwind utilities;
7+
@tailwind utilities;
8+
9+
html,
10+
body {
11+
max-width: 100%;
12+
overflow-x: hidden;
13+
}

0 commit comments

Comments
 (0)