Skip to content

Commit 7e8c982

Browse files
committed
[chore] move build config to electron-builder.ts for better typing
1 parent 74c2d17 commit 7e8c982

File tree

2 files changed

+84
-75
lines changed

2 files changed

+84
-75
lines changed

electron-builder.ts

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
import { Configuration } from "electron-builder";
2+
3+
const config: Configuration = {
4+
extraResources: [
5+
"./assets/jsons/bs-versions.json",
6+
"./assets/jsons/patreons.json",
7+
"./assets/proto/song_details_cache_v1.proto"
8+
],
9+
productName: "BSManager",
10+
appId: "org.erb.BSManager",
11+
asarUnpack: "**\\*.{node,dll}",
12+
files: [
13+
"dist/**/*",
14+
"node_modules",
15+
"package.json"
16+
],
17+
afterSign: ".erb/scripts/notarize.js",
18+
afterPack: ".erb/scripts/after-pack.js",
19+
win: {
20+
signingHashAlgorithms: ["sha256"],
21+
certificateSha1: "2164d6a7d641ecf6ad57852f665a518ca2bf960f",
22+
target: [
23+
"nsis",
24+
"nsis-web"
25+
],
26+
icon: "./build/icons/win/favicon.ico",
27+
extraResources: [
28+
"./build/icons/win",
29+
"./assets/scripts/*.exe"
30+
],
31+
},
32+
linux: {
33+
target: [
34+
"deb",
35+
"rpm",
36+
"pacman"
37+
],
38+
icon: "./build/icons/png",
39+
category: "Utility;Game;",
40+
extraResources: [
41+
"./build/icons/png",
42+
"./assets/scripts/DepotDownloader"
43+
],
44+
protocols: {
45+
name: "BSManager",
46+
schemes: [
47+
"bsmanager",
48+
"beatsaver",
49+
"bsplaylist",
50+
"modelsaber",
51+
"web+bsmap",
52+
],
53+
},
54+
},
55+
deb: {
56+
fpm: ["--after-install=build/after-install.sh"],
57+
},
58+
rpm: {
59+
fpm: ["--after-install=build/after-install.sh"],
60+
},
61+
pacman: {
62+
fpm: ["--after-install=build/after-install.sh"],
63+
},
64+
directories: {
65+
app: "release/app",
66+
buildResources: "assets",
67+
output: "release/build",
68+
},
69+
publish: {
70+
provider: "github",
71+
owner: "Zagrios",
72+
},
73+
fileAssociations: [
74+
{
75+
ext: "bplist",
76+
description: "Beat Saber Playlist (BSManager)",
77+
icon: "./assets/bsm_file.ico",
78+
role: "Viewer",
79+
},
80+
],
81+
};
82+
83+
export default config;

package.json

+1-75
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"start:preload": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack --config ./.erb/configs/webpack.config.preload.dev.ts",
2020
"start:renderer": "cross-env NODE_ENV=development TS_NODE_TRANSPILE_ONLY=true webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts",
2121
"test": "jest",
22-
"publish": "npm run build && electron-builder -c.win.certificateSha1=2164d6a7d641ecf6ad57852f665a518ca2bf960f --publish always --win --x64",
22+
"publish": "npm run build && electron-builder --publish always --win --x64",
2323
"publish:linux": "npm run build && electron-builder --publish always --linux --x64"
2424
},
2525
"lint-staged": {
@@ -36,80 +36,6 @@
3636
"prettier --ignore-path .eslintignore --single-quote --write"
3737
]
3838
},
39-
"build": {
40-
"extraResources": [
41-
"./assets/jsons/bs-versions.json",
42-
"./assets/jsons/patreons.json",
43-
"./assets/proto/song_details_cache_v1.proto"
44-
],
45-
"productName": "BSManager",
46-
"appId": "org.erb.BSManager",
47-
"asarUnpack": "**\\*.{node,dll}",
48-
"files": [
49-
"dist/**/*",
50-
"node_modules",
51-
"package.json"
52-
],
53-
"afterSign": ".erb/scripts/notarize.js",
54-
"afterPack": ".erb/scripts/after-pack.js",
55-
"win": {
56-
"signingHashAlgorithms": ["sha256"],
57-
"target": [
58-
"nsis",
59-
"nsis-web"
60-
],
61-
"icon": "./build/icons/win/favicon.ico",
62-
"extraResources": [
63-
"./build/icons/win",
64-
"./assets/scripts/*.exe"
65-
]
66-
},
67-
"linux": {
68-
"target": [
69-
"deb",
70-
"rpm",
71-
"pacman"
72-
],
73-
"icon": "./build/icons/png",
74-
"category": "Utility;Game;",
75-
"extraResources": [
76-
"./build/icons/png",
77-
"./assets/scripts/DepotDownloader"
78-
],
79-
"protocols": {
80-
"name": "BSManager",
81-
"schemes": [
82-
"bsmanager"
83-
]
84-
}
85-
},
86-
"deb": {
87-
"fpm": ["--after-install=build/after-install.sh"]
88-
},
89-
"rpm": {
90-
"fpm": ["--after-install=build/after-install.sh"]
91-
},
92-
"pacman": {
93-
"fpm": ["--after-install=build/after-install.sh"]
94-
},
95-
"directories": {
96-
"app": "release/app",
97-
"buildResources": "assets",
98-
"output": "release/build"
99-
},
100-
"publish": {
101-
"provider": "github",
102-
"owner": "Zagrios"
103-
},
104-
"fileAssociations": [
105-
{
106-
"ext": "bplist",
107-
"description": "Beat Saber Playlist (BSManager)",
108-
"icon": "./assets/bsm_file.ico",
109-
"role": "Viewer"
110-
}
111-
]
112-
},
11339
"repository": {
11440
"type": "git",
11541
"url": "git+https://github.com/Zagrios/bs-manager.git"

0 commit comments

Comments
 (0)