-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelectron-builder.ts
More file actions
59 lines (49 loc) · 1.44 KB
/
electron-builder.ts
File metadata and controls
59 lines (49 loc) · 1.44 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
/** biome-ignore-all lint/suspicious/noTemplateCurlyInString: <> */
import type { Configuration } from 'electron-builder'
import {
main,
name,
version,
resources,
description,
displayName,
author as _author,
} from './package.json'
import { getDevFolder } from './src/lib/electron-app/release/utils/path'
const author = _author?.name ?? _author
const currentYear = new Date().getFullYear()
const authorInKebabCase = author.replace(/\s+/g, '-')
// Tier-based configuration
const appTier = (process.env.APP_TIER || 'free') as 'free' | 'pro'
const appIdSuffix = process.env.APP_ID_SUFFIX || appTier
const appName = process.env.APP_NAME || displayName
const appId = `com.${authorInKebabCase}.${name}.${appIdSuffix}`.toLowerCase()
const artifactName = [`${name}-${appTier}-v${version}`, '-${os}.${ext}'].join(
''
)
export default {
appId,
productName: appName,
copyright: `Copyright © ${currentYear} — ${author}`,
directories: {
app: getDevFolder(main),
output: `dist/v${version}`,
},
mac: {
artifactName,
icon: `${resources}/build/icons/icon.icns`,
category: 'public.app-category.utilities',
target: ['zip', 'dmg', 'dir'],
},
linux: {
artifactName,
category: 'Utilities',
synopsis: description,
target: ['AppImage', 'deb', 'pacman', 'freebsd', 'rpm'],
},
win: {
artifactName,
icon: `${resources}/build/icons/icon.ico`,
target: ['zip', 'portable'],
},
} satisfies Configuration