-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathelectron-builder-config.js
More file actions
171 lines (145 loc) · 4.62 KB
/
electron-builder-config.js
File metadata and controls
171 lines (145 loc) · 4.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
module.exports = {
appId: "com.ghosttypes.flashforgeui",
productName: "FlashForgeUI",
copyright: `Copyright © ${new Date().getFullYear()} GhostTypes`,
// Shared configurations
directories: {
output: "dist",
buildResources: "assets",
},
asar: true,
// Optimize web UI assets - only include essential files
extraResources: [
{
from: "dist/renderer",
to: "renderer",
filter: ["index.html", "renderer.bundle.js", "vendors.bundle.js", "**/*.{png,jpg,jpeg,gif,svg,ico,woff,woff2,ttf,eot}"]
},
{
from: "dist/webui",
to: "webui",
filter: ["**/*.{html,js,css,png,jpg,jpeg,gif,svg,ico,woff,woff2,ttf,eot}"]
}
],
files: [
"lib/**/*.js", // Main process files
"dist/renderer/**/*", // Renderer bundle and assets - CRITICAL for web UI
// Include icons for platform builds
"src/icons/**/*",
// Include UI files (HTML, CSS) for dialogs
"src/ui/**/*",
"package.json",
// Exclude (same as JS project)
"!**/elevate.exe",
"!**/.git/**",
"!**/.vscode/**",
"!**/.idea/**",
"!**/node_modules/**/{README,CHANGELOG,AUTHORS,CONTRIBUTING}*",
"!**/node_modules/**/{test,__tests__,tests,powered-test,example,examples}/**",
"!**/node_modules/**/*.{ts,tsx,d.ts,map}",
"!**/node_modules/**/.*",
"!**/node_modules/**/.bin/**",
"!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}",
"!**/.*", // Exclude all dot files/folders
"!**/*.md",
"!**/docs/**",
"!**/samples/**",
"!**/demo/**",
"!**/*.yml",
"!**/*.yaml",
"!**/*.blockmap",
// Exclude source TypeScript files from the bundle (keep compiled JS)
"!**/*.ts",
"!**/tsconfig.json",
// Exclude test files
"!**/__tests__/**",
"!**/*.test.*",
"!**/*.spec.*"
],
publish: [
{
provider: "github",
owner: "Parallel-7",
repo: "FlashForgeUI-Electron",
}
],
// Native module handling
npmRebuild: false,
nodeGypRebuild: false,
// Windows configuration
win: {
icon: "src/icons/icon.ico",
signAndEditExecutable: true,
target: [
{
target: "nsis",
arch: ["x64"],
},
{
target: "portable",
arch: ["x64"],
},
],
},
portable: {
// This ensures the portable executable gets the proper treatment
requestExecutionLevel: "user",
},
// macOS configuration
mac: {
icon: "src/icons/icon.icns",
category: "public.app-category.utilities",
target: [
{
target: "dmg",
arch: ["universal"],
},
{
target: "zip",
arch: ["universal"],
},
],
// Ensure macOS prompts for local network permission (required for Sequoia 15.0+)
// This triggers the system permission dialog when the app attempts to discover/connect to printers
extendInfo: {
NSLocalNetworkUsageDescription: "FlashForgeUI requires access to your local network to discover and communicate with FlashForge 3D printers on your network."
}
},
// Linux configuration
linux: {
icon: "src/icons/icon.png",
category: "Utility",
target: ["AppImage", "deb", "rpm"],
maintainer: "GhostTypes",
vendor: "GhostTypes",
},
// NSIS Windows installer configuration (EXACT same as JS project)
nsis: {
oneClick: false,
perMachine: false,
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: true,
// Ensure shortcuts are created for Windows notification support
createDesktopShortcut: true,
createStartMenuShortcut: true,
// Force standard hyphen-based naming for electron-updater compatibility
artifactName: "${productName}-Setup-${version}.${ext}",
},
// DMG configuration
dmg: {
contents: [
{ x: 130, y: 220 },
{ x: 410, y: 220, type: "link", path: "/Applications" },
],
},
// DEB configuration
deb: {
afterInstall: "assets/linux/afterInstall.sh",
afterRemove: "assets/linux/afterRemove.sh",
},
// RPM configuration
rpm: {
afterInstall: "assets/linux/afterInstall.sh",
afterRemove: "assets/linux/afterRemove.sh",
},
};