-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathforge.config.js
More file actions
129 lines (115 loc) · 3.94 KB
/
Copy pathforge.config.js
File metadata and controls
129 lines (115 loc) · 3.94 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
const { resolve } = require('path');
const { readdirSync, existsSync } = require('fs');
const modulesConfig = readdirSync(resolve(__dirname, './packages/gui/editors'), { withFileTypes: true })
.filter((dirent) => dirent.isDirectory() && existsSync(resolve(dirent.parentPath, dirent.name, 'forge.config.js')))
.map((dirent) => require(resolve(dirent.parentPath, dirent.name, 'forge.config.js')));
module.exports = {
packagerConfig: {
name: 'BlockCode Playgrounds',
executableName: 'playgrounds-app',
icon: 'public/icon',
appCopyright: 'Copyright© BlockCode Lab, 2023-2026.',
// asar: true,
ignore: [
'/\\.zed($|/)',
'/arduino_cli($|/)',
'/docs($|/)',
'/examples($|/)',
'/node_modules($|/)',
'/packages($|/)',
'/public($|/)',
'/scripts($|/)',
'/src($|/)',
'/\\.editorconfig$',
'/\\.gitignore$',
'/\\.gitmodules$',
'/\\.oxfmtrc\\.json$',
'/build\\.config\\.js$',
'/bun\\.lock$',
'/forge.config\\.js$',
'/jsconfig\\.json$',
'/README\\.md$',
],
},
makers: [
{
name: '@electron-forge/maker-zip',
platforms: ['win32', 'darwin'],
},
{
name: '@electron-forge/maker-deb',
config: {
options: {
icon: 'public/icon.png',
maintainer: 'BlockCode Lab',
homepage: 'https://app.blockcode.fun',
},
},
},
],
hooks: {
async generateAssets(forgeConfig, platform, arch) {
await Promise.all(modulesConfig.map((config) => config.hooks?.generateAssets?.(forgeConfig)));
},
async preStart(forgeConfig) {
await Promise.all(modulesConfig.map((config) => config.hooks?.preStart?.(forgeConfig)));
},
async postStart(forgeConfig, appProcess) {
await Promise.all(modulesConfig.map((config) => config.hooks?.postStart?.(forgeConfig, appProcess)));
},
async prePackage(forgeConfig, platform, arch) {
await Promise.all(modulesConfig.map((config) => config.hooks?.prePackage?.(forgeConfig, platform, arch)));
},
async packageAfterCopy(forgeConfig, buildPath, electronVersion, platform, arch) {
await Promise.all(
modulesConfig.map((config) =>
config.hooks?.packageAfterCopy?.(forgeConfig, buildPath, electronVersion, platform, arch),
),
);
},
async packageAfterPrune(forgeConfig, buildPath, electronVersion, platform, arch) {
await Promise.all(
modulesConfig.map((config) =>
config.hooks?.packageAfterPrune?.(forgeConfig, buildPath, electronVersion, platform, arch),
),
);
},
async packageAfterExtract(forgeConfig, buildPath, electronVersion, platform, arch) {
await Promise.all(
modulesConfig.map((config) =>
config.hooks?.packageAfterExtract?.(forgeConfig, buildPath, electronVersion, platform, arch),
),
);
},
async postPackage(forgeConfig, packageResult) {
await Promise.all(modulesConfig.map((config) => config.hooks?.postPackage?.(forgeConfig, packageResult)));
},
async preMake(forgeConfig) {
await Promise.all(modulesConfig.map((config) => config.hooks?.preMake?.(forgeConfig)));
},
// mutating hooks
async postMake(forgeConfig, makeResults) {
makeResults = [].concat(
...(
await Promise.all(modulesConfig.map((config) => config.hooks?.postMake?.(forgeConfig, makeResults)))
).filter(Boolean),
);
return makeResults;
},
async readPackageJson(forgeConfig, packageJson) {
packageJson = Object.assign(
...(await Promise.all(
modulesConfig.map((config) => config.hooks?.readPackageJson?.(forgeConfig, packageJson)),
)),
);
delete packageJson.scripts;
delete packageJson.workspaces;
for (const dep in packageJson.devDependencies) {
if (dep !== 'electron') {
delete packageJson.devDependencies[dep];
}
}
return packageJson;
},
},
};