-
Notifications
You must be signed in to change notification settings - Fork 7
/
forge.config.js
128 lines (118 loc) · 3.06 KB
/
forge.config.js
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
const osxNotarize =
process.env.APPLE_ID &&
process.env.APPLE_PASSWORD &&
process.env.APPLE_TEAM_ID
? {
tool: 'notarytool',
appleId: process.env.APPLE_ID,
appleIdPassword: process.env.APPLE_PASSWORD,
teamId: process.env.APPLE_TEAM_ID,
}
: undefined;
const osxSign = osxNotarize ? {} : undefined;
if (!osxNotarize) {
// eslint-disable-next-line no-console
console.log(
'Notarytool credentials not passed, skipping sign and notarize step for OSX.',
);
}
module.exports = {
packagerConfig: {
icon: './assets/logo',
executableName: 'Replit',
osxSign,
osxNotarize,
asar: true,
// ignore development files like README, typescript sources, etc.
ignore: (path) => {
if (path === '') {
return false;
}
// dist folder is necessary for the app to run
if (path.startsWith('/dist')) {
return false;
}
// package.json is necessary for the app to run
if (path === '/package.json') {
return false;
}
// node_modules are necessary, but we have to strip binaries
if (path.includes('node_modules')) {
const ignoreNodeBinaries = '/node_modules/\\.bin($|/)';
return path.match(ignoreNodeBinaries);
}
// otherwise, ignore the file
return true;
},
protocols: [
{
name: 'Replit',
schemes: ['replit'],
},
],
},
rebuildConfig: {},
hooks: {
generateAssets: async () => {
const cpy = (await import('cpy')).default;
await cpy('assets', 'dist');
},
},
makers: [
{
name: '@electron-forge/maker-squirrel',
config: {
setupIcon: './assets/logo.ico',
iconUrl: 'https://replit.com/public/images/logo.ico',
certificateFile: process.env.WINDOWS_CERTIFICATE_FILE,
certificatePassword: process.env.WINDOWS_CERTIFICATE_PASSWORD,
},
},
{
name: '@electron-forge/maker-dmg',
config: {
name: 'Replit',
icon: './assets/logo.icns',
overwrite: false,
// Set a different path for each architecture to avoid conflicts when uploading
dmgPath: process.arch === 'arm64' ? 'Replit.dmg' : 'Replit-Intel.dmg',
additionalDMGOptions: {
'background-color': '#0E1525',
},
},
},
{
name: '@electron-forge/maker-deb',
config: {
options: {
name: 'replit',
bin: 'Replit',
productName: 'Replit',
maintainer: 'Replit',
mimeType: ['x-scheme-handler/replit'],
homepage: 'https://replit.com',
description: 'Replit desktop app',
icon: './assets/logo.png',
categories: ['Development'],
section: 'devel',
},
},
},
{
name: '@electron-forge/maker-zip',
config: {},
},
],
publishers: [
{
name: '@electron-forge/publisher-github',
authToken: process.env.GH_TOKEN,
config: {
repository: {
owner: 'replit',
name: 'desktop',
},
},
},
],
};