Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
use typescript for electron-builder-config
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunarequest committed Dec 5, 2023
1 parent a7e0a19 commit d78400e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 31 deletions.
Binary file not shown.
Binary file not shown.
38 changes: 12 additions & 26 deletions electron-builder-config.js → electron-builder-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const config = {
import { Configuration } from "electron-builder";

const config: Configuration = {
appId: "io.github.lunarequest.NightPDF",
productName: "NightPDF",
files: [
Expand Down Expand Up @@ -61,18 +63,9 @@ const config = {
synopsis: "Dark Mode PDF reader",
publish: ["github"],
target: [
{
target: "AppImage",
arch: ["x64", "arm64"],
},
{
target: "deb",
arch: ["x64", "arm64"],
},
{
target: "rpm",
arch: ["x64", "arm64"],
},
{ target: "AppImage", arch: ["x64", "arm64"] },
{ target: "deb", arch: ["x64", "arm64"] },
{ target: "rpm", arch: ["x64", "arm64"] },
],
mimeTypes: [
"application/pdf",
Expand All @@ -88,16 +81,7 @@ const config = {
},
win: {
publish: ["github"],
target: [
{
target: "nsis",
arch: ["x64", "arm64"],
},
{
target: "portable",
arch: ["x64", "arm64"],
},
],
target: ["nsis", "portable"],
icon: "build/icon.ico",
},
nsis: {
Expand Down Expand Up @@ -130,9 +114,11 @@ const config = {
sign: false,
},
};

if (process.env.OUTPUTDIR === "1") {
config.linux.target = ["dir"];
if (config.linux && config.target) {
//@ts-ignore
config.linux.target = ["dir"];
}
}

module.exports = config;
export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"typecheck": "tsc --noEmit",
"build": "rimraf out && tsx ./build.mts",
"dev": "yarn typecheck && yarn build && DEBUG=1 electron .",
"dist": "NODE_ENV='production' NODE_OPTIONS='--max-old-space-size=4096' yarn build && NODE_ENV='production' NODE_OPTIONS='--max-old-space-size=4096' electron-builder --config electron-builder-config.js",
"dist": "NODE_ENV='production' NODE_OPTIONS='--max-old-space-size=4096' yarn build && NODE_ENV='production' NODE_OPTIONS='--max-old-space-size=4096' electron-builder --config electron-builder-config.ts",
"lint": "biome check .",
"format": "biome format . --write",
"ci": "biome ci .",
Expand Down
1 change: 0 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
},
"exclude": [
"app/libs",
"electron-builder-config.json"
]
}
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1277,9 +1277,9 @@ __metadata:
linkType: hard

"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001464, caniuse-lite@npm:^1.0.30001489":
version: 1.0.30001502
resolution: "caniuse-lite@npm:1.0.30001502"
checksum: 40dc63c6408c76d4cc54e75864dd843cdef0a58646fccba9e06bceb4c6ec0363568715d9224d850af5cebe5bd623a9059123d76d93a12ab71be40e5d714ef659
version: 1.0.30001566
resolution: "caniuse-lite@npm:1.0.30001566"
checksum: fdff43ed498201bf4f6074bd1112bd853e91973b6ccb016049b030948a7d197cba235ac4d93e712d1862b33a3c947bf4e62bad7011ccdac78e5179501b28d04a
languageName: node
linkType: hard

Expand Down

0 comments on commit d78400e

Please sign in to comment.