Add Electron builder jazz

This commit is contained in:
Vendicated 2023-04-03 05:44:17 +02:00
parent 36d4e90113
commit 307051141d
No known key found for this signature in database
GPG key ID: A1DC0CFB5615D905
7 changed files with 1186 additions and 27 deletions

1
.npmrc Normal file
View file

@ -0,0 +1 @@
node-linker=hoisted

8
.prettierrc.yaml Normal file
View file

@ -0,0 +1,8 @@
tabWidth: 4
semi: true
printWidth: 120
trailingComma: none
bracketSpacing: true
arrowParens: avoid
useTabs: false
endOfLine: auto

BIN
build/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

8
build/installer.nsh Normal file
View file

@ -0,0 +1,8 @@
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\VencordDesktop"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\VencordDesktop"
SetRegView 32
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\VencordDesktop"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\VencordDesktop"
!macroend

View file

@ -1,24 +1,54 @@
{ {
"name": "vencorddesktop", "name": "vencorddesktop",
"private": true, "private": true,
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "dist/main.js", "main": "dist/js/main.js",
"scripts": { "scripts": {
"build": "tsx scripts/build.mts", "build": "tsx scripts/build.mts",
"watch": "pnpm build --watch", "watch": "pnpm build --watch",
"start": "pnpm build && electron .", "package": "pnpm build && electron-builder",
"start:watch": "tsx scripts/startWatch.mts", "package:dir": "pnpm build && electron-builder --dir",
"test": "echo \"Error: no test specified\" && exit 1" "start": "pnpm build && electron .",
}, "start:watch": "tsx scripts/startWatch.mts",
"keywords": [ ], "test": "echo \"Error: no test specified\" && exit 1"
"author": "Vendicated <vendicated@riseup.net>", },
"license": "GPL-3.0", "keywords": [],
"devDependencies": { "author": "Vendicated <vendicated@riseup.net>",
"@types/node": "^18.15.11", "license": "GPL-3.0",
"electron": "^23.2.0", "devDependencies": {
"esbuild": "^0.17.14", "@types/node": "^18.15.11",
"tsx": "^3.12.6", "electron": "^23.2.0",
"typescript": "^5.0.2" "electron-builder": "^23.6.0",
} "esbuild": "^0.17.14",
"tsx": "^3.12.6",
"typescript": "^5.0.2"
},
"build": {
"appId": "dev.vencord.desktop",
"productName": "Vencord Desktop",
"mac": {
"category": "Network"
},
"nsis": {
"include": "build/installer.nsh"
},
"linux": {
"category": "Network",
"maintainer": "vendicated+vencord-desktop@riseup.net",
"target": [
"deb",
"tar.gz",
"rpm",
"AppImage"
]
},
"files": [
"!*",
"dist/js",
"static",
"package.json",
"LICENSE"
]
}
} }

File diff suppressed because it is too large Load diff

View file

@ -19,12 +19,12 @@ await Promise.all([
createContext({ createContext({
...NodeCommonOpts, ...NodeCommonOpts,
entryPoints: ["src/main/index.ts"], entryPoints: ["src/main/index.ts"],
outfile: "dist/main.js" outfile: "dist/js/main.js"
}), }),
createContext({ createContext({
...NodeCommonOpts, ...NodeCommonOpts,
entryPoints: ["src/preload/index.ts"], entryPoints: ["src/preload/index.ts"],
outfile: "dist/preload.js" outfile: "dist/js/preload.js"
}) })
]); ]);