-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathelectron-builder.ts
More file actions
134 lines (130 loc) · 3.35 KB
/
electron-builder.ts
File metadata and controls
134 lines (130 loc) · 3.35 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
import type { Configuration } from "electron-builder";
// Helper Functions //
/**
* Get the custom app version from environment variables.
* @returns The custom app version from environment variables, or undefined if not provided
*/
function getCustomAppVersion(): string | undefined {
return process.env.CUSTOM_APP_VERSION;
}
// Options //
const customAppVersion = getCustomAppVersion();
if (customAppVersion) {
console.log(`Using custom version: ${customAppVersion}`);
}
// Main Configuration //
const electronBuilderConfig: Configuration = {
appId: "dev.iamevan.flow",
productName: "Flow",
...(customAppVersion && { buildVersion: customAppVersion, extraMetadata: { version: customAppVersion } }),
directories: {
buildResources: "build"
},
files: [
"!**/.vscode/*",
"!build/**",
"!src/*",
"!electron.vite.config.{js,ts,mjs,cjs}",
"!{.eslintcache,eslint.config.mjs,.prettierignore,.prettierrc,dev-app-update.yml}",
"!{CHANGELOG.md,README.md,CONTRIBUTING.md,docs/**}",
"!{scripts/**}",
"!{.env,.env.*,.npmrc,bun.lock}",
"!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}"
],
protocols: [
{
name: "HyperText Transfer Protocol",
schemes: ["http", "https"]
}
],
fileAssociations: [
{
ext: "htm",
name: "HyperText Markup File",
role: "Viewer"
},
{
ext: "html",
description: "HTML Document",
role: "Viewer"
},
{
ext: "mhtml",
description: "MHTML Document",
role: "Viewer"
},
{
ext: "shtml",
name: "HyperText Markup File",
role: "Viewer"
},
{
ext: "xhtml",
name: "Extensible HyperText Markup File",
role: "Viewer"
},
{
ext: "xhtm",
name: "Extensible HyperText Markup File",
role: "Viewer"
},
{
ext: "pdf",
description: "PDF Document",
role: "Viewer"
}
],
asarUnpack: ["assets/**", "node_modules/@img/**"],
extraResources: [
{
from: "drizzle",
to: "drizzle"
}
],
win: {
executableName: "flow",
verifyUpdateCodeSignature: false
},
nsis: {
artifactName: "${name}-${version}-setup.${ext}",
shortcutName: "${productName}",
uninstallDisplayName: "${productName}",
createDesktopShortcut: "always"
},
mac: {
category: "public.app-category.productivity",
entitlements: "./build/entitlements.mac.plist",
notarize: true,
provisioningProfile: "build/profile.provisionprofile",
binaries: ["Contents/PlugIns/FlowDockTilePlugin.plugin"],
extendInfo: {
CFBundleIconName: "AppIcon",
NSUserActivityTypes: ["NSUserActivityTypeBrowsingWeb"],
NSDockTilePlugIn: "FlowDockTilePlugin.plugin"
}
},
dmg: {
artifactName: "${name}-${version}-${arch}.${ext}",
background: "./build/dmg-background.tiff",
icon: "./build/volume-icon.icns"
},
linux: {
target: ["AppImage", "deb"],
category: "Network;WebBrowser;",
executableArgs: ["--ozone-platform-hint=auto"],
icon: "icon.png"
},
appImage: {
artifactName: "${name}-${version}-${arch}.${ext}"
},
npmRebuild: false,
publish: {
provider: "github",
owner: "multiboxlabs",
releaseType: "prerelease"
},
electronDist: "node_modules/electron/dist",
afterPack: "./build/hooks/afterPack.js",
afterSign: "./build/hooks/afterSign.js"
};
export default electronBuilderConfig;