forked from aaif-goose/goose
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforge.config.ts
More file actions
183 lines (181 loc) · 5.34 KB
/
forge.config.ts
File metadata and controls
183 lines (181 loc) · 5.34 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
172
173
174
175
176
177
178
179
180
181
182
183
const { FusesPlugin } = require('@electron-forge/plugin-fuses');
const { FuseV1Options, FuseVersion } = require('@electron/fuses');
const { resolve } = require('path');
let cfg = {
asar: true,
extraResource: ['src/bin', 'src/images'],
icon: 'src/images/icon',
// Windows specific configuration
win32: {
icon: 'src/images/icon.ico',
certificateFile: process.env.WINDOWS_CERTIFICATE_FILE,
signingRole: process.env.WINDOW_SIGNING_ROLE,
rfc3161TimeStampServer: 'http://timestamp.digicert.com',
signWithParams: '/fd sha256 /tr http://timestamp.digicert.com /td sha256',
},
// Protocol registration
protocols: [
{
name: 'GooseProtocol',
schemes: ['goose'],
},
],
// macOS Info.plist extensions for drag-and-drop support
extendInfo: {
CFBundleURLTypes: [
{
CFBundleURLName: 'Goose',
CFBundleURLSchemes: ['goose'],
},
],
// Document types for drag-and-drop support onto dock icon
CFBundleDocumentTypes: [
{
CFBundleTypeName: 'Folders',
CFBundleTypeRole: 'Viewer',
LSHandlerRank: 'Alternate',
LSItemContentTypes: ['public.directory', 'public.folder'],
},
],
// Usage descriptions for macOS TCC (Transparency, Consent, and Control)
NSCalendarsUsageDescription: 'Goose needs access to your calendars to help manage and query calendar events.',
NSRemindersUsageDescription: 'Goose needs access to your reminders to help manage and query reminders.',
},
};
module.exports = {
packagerConfig: cfg,
rebuildConfig: {},
publishers: [
{
name: '@electron-forge/publisher-github',
config: {
repository: {
owner: process.env.GITHUB_OWNER || 'block',
name: process.env.GITHUB_REPO || 'goose',
},
prerelease: false,
draft: true,
},
},
],
makers: [
{
name: '@electron-forge/maker-zip',
platforms: ['darwin', 'win32', 'linux'],
config: {
arch: process.env.ELECTRON_ARCH === 'x64' ? ['x64'] : ['arm64'],
options: {
icon: 'src/images/icon.ico',
},
},
},
{
name: '@electron-forge/maker-deb',
config: {
name: 'Goose',
bin: 'Goose',
maintainer: 'Block, Inc.',
homepage: 'https://block.github.io/goose/',
categories: ['Development'],
desktopTemplate: './forge.deb.desktop',
options: {
icon: 'src/images/icon.png',
prefix: '/opt',
},
},
},
{
name: '@electron-forge/maker-rpm',
config: {
name: 'Goose',
bin: 'Goose',
maintainer: 'Block, Inc.',
homepage: 'https://block.github.io/goose/',
categories: ['Development'],
desktopTemplate: './forge.rpm.desktop',
options: {
icon: 'src/images/icon.png',
prefix: '/opt',
fpm: ['--rpm-rpmbuild-define', '_build_id_links none'],
},
},
},
{
name: '@electron-forge/maker-flatpak',
config: {
options: {
id: 'io.github.block.Goose',
categories: ['Development'],
icon: {
'scalable': 'src/images/icon.svg',
'512x512': 'src/images/icon-512.png',
},
homepage: 'https://block.github.io/goose/',
runtimeVersion: '25.08',
baseVersion: '25.08',
bin: 'Goose',
modules: [
{
name: 'libbz2-shim',
buildsystem: 'simple',
'build-commands': [
// Create the lib directory in the app bundle
'mkdir -p /app/lib',
// Point to the actual library in the 25.08 runtime
// We use a wildcard to handle multi-arch paths (x86_64-linux-gnu, etc)
'ln -s $(find /usr/lib -name "libbz2.so.1" | head -n 1) /app/lib/libbz2.so.1.0'
]
}
],
finishArgs: [
'--share=ipc',
'--socket=x11',
'--socket=wayland',
'--device=dri',
'--share=network',
'--filesystem=home',
'--talk-name=org.freedesktop.Notifications',
'--socket=session-bus',
'--socket=system-bus',
// This ensures the app looks in our shim folder first
'--env=LD_LIBRARY_PATH=/app/lib'
],
},
},
},
],
plugins: [
{
name: '@electron-forge/plugin-vite',
config: {
build: [
{
entry: 'src/main.ts',
config: 'vite.main.config.mts',
},
{
entry: 'src/preload.ts',
config: 'vite.preload.config.mts',
},
],
renderer: [
{
name: 'main_window',
config: 'vite.renderer.config.mts',
},
],
},
},
// Fuses are used to enable/disable various Electron functionality
// at package time, before code signing the application
new FusesPlugin({
version: FuseVersion.V1,
[FuseV1Options.RunAsNode]: false,
[FuseV1Options.EnableCookieEncryption]: true,
[FuseV1Options.EnableNodeOptionsEnvironmentVariable]: false,
[FuseV1Options.EnableNodeCliInspectArguments]: false,
[FuseV1Options.EnableEmbeddedAsarIntegrityValidation]: true,
[FuseV1Options.OnlyLoadAppFromAsar]: true,
}),
],
};