-
-
Notifications
You must be signed in to change notification settings - Fork 645
Expand file tree
/
Copy pathforge.config.js
More file actions
216 lines (214 loc) · 6.03 KB
/
forge.config.js
File metadata and controls
216 lines (214 loc) · 6.03 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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
const fs = require("fs");
const sharedDebRpmOptions = {
name: "jspaint",
productName: "JS Paint",
productDescription: "MS Paint clone with extra features",
genericName: "Image Editor",
homepage: "https://jspaint.app/about",
icon: "images/icons/512x512.png",
categories: [
"Graphics",
],
mimeType: [
// Affects whether the app shows as a recommended app in the "Open With" menu/dialog
"image/*", // wildcard doesn't seem to work
"image/bmp",
"image/gif",
"image/jpeg",
"image/png",
"image/tiff",
"image/webp",
"image/avif",
"image/x-icon",
"image/vnd.microsoft.icon",
"image/x-win-bitmap",
"image/x-icns",
"application/x-gimp-palette",
],
};
/** @type {import('@electron-forge/shared-types').ForgeConfig} */
module.exports = {
packagerConfig: {
icon: "./images/icons/jspaint",
name: "JS Paint",
executableName: "jspaint",
appBundleId: "io.isaiahodhner.jspaint",
appCategoryType: "public.app-category.graphics-design",
appCopyright: "© 2024 Isaiah Odhner",
extendInfo: {
// Based on https://gist.github.com/sonnypgs/de2b6a4a4936d5b8e0fe43946002964a
// This extends Info.plist to allow dropping files onto the macOS dock icon.
// (all files, not just images, since it's much simpler and I support loading palettes from arbitrary text files)
CFBundleDocumentTypes: [
{
CFBundleTypeName: "All Files",
CFBundleTypeRole: "Editor", // *
LSHandlerRank: "Alternate",
LSItemContentTypes: [
"public.data",
"public.content",
],
},
],
// *Added, but... I'm not sure what CFBundleTypeRole exactly affects in practice.
// The app is an editor, of both images and palettes, but it's not an editor of all file types,
// so it's unclear if this is appropriate.
// TODO: granular image types?
// like https://github.com/electron/forge/issues/492#issuecomment-385956851
},
junk: true,
// TODO: assess filtering of files; I see eslint in node_modules, why? prune is true by default
ignore: [
".history", // VS Code "Local History" extension
"cypress", // Cypress tests
"cypress.json", // Cypress config
"browserconfig.xml", // Windows 8/10 start menu tile
"about.html", // homepage
"parse-rc-file.js", // localization
"preprocess.js", // localization
/\.rc$/, // localization
/\.sh$/, // localization
/\.psd$/, // theming source files
"images/meta", // images used on README, OpenGraph, etc. (arguably README images could be included)
// TODO: "lib/pdf.js/web", // PDF.js UI? (PDF.js is only used as a library, but does it use data from this folder?)
// TODO: Bubblegum theme has some files that are embedded in an SVG, so they're not used directly
// I'd want to move them to a folder or give them a suffix or something, rather than just ignoring them as they are,
// since I may want to use them in the future.
],
// TODO: maybe
// https://electron.github.io/packager/main/interfaces/Options.html#darwinDarkModeSupport
},
hooks: {
// eslint-disable-next-line require-await
packageAfterCopy: async (_forgeConfig, buildPath) => {
// Add marker file for official releases built in CI
if (process.env.JSPAINT_OFFICIAL_RELEASE) {
const markerPath = require("path").join(buildPath, "official-release.txt");
fs.writeFileSync(markerPath, "This file marks this build as an official release.");
console.log("Created official release marker:", markerPath);
} else {
console.log("Not creating official release marker since JSPAINT_OFFICIAL_RELEASE is not set.");
}
},
},
makers: [
{
name: "@electron-forge/maker-squirrel",
config: {
name: "jspaint",
exe: "jspaint.exe",
title: "JS Paint",
description: "MS Paint clone with extra features",
iconUrl: "https://raw.githubusercontent.com/1j01/jspaint/5af996478e28a32627794526ec9d25a799187119/images/icons/192x192.png",
setupIcon: "./images/icons/jspaint.ico",
loadingGif: "images/about/flagani.gif",
},
},
{
name: "@electron-forge/maker-msix",
config: {
appManifest: "./Package.appxmanifest",
logLevel: "debug",
// Windows Store supposedly allows certificates but they cause problems and won't be used anyway
sign: false,
},
},
{
name: "@electron-forge/maker-zip",
platforms: [
"darwin", // macOS uses a .zip, which may be automatically extracted when opened
],
},
{
name: "@electron-forge/maker-deb",
config: {
options: {
...sharedDebRpmOptions,
section: "graphics",
maintainer: "Isaiah Odhner <isaiahodhner@gmail.com>",
},
},
},
{
name: "@electron-forge/maker-rpm",
config: {
options: {
...sharedDebRpmOptions,
license: "MIT",
},
},
},
{
name: "@reforged/maker-appimage",
config: {
options: {
// No productDescription field?
// There is an option to specify a desktopFile...
// Note: For maker-deb, "bin" has to match "name" from the package.json of the electron app
bin: "jspaint",
name: "jspaint",
productName: "JS Paint",
genericName: "Image Editor",
homepage: "https://jspaint.app/about",
icon: "images/icons/512x512.png",
categories: [
"Graphics",
],
// TODO: specify mime types?
keywords: [
"paint",
"jspaint",
"mspaint",
"MS Paint",
"Microsoft Paint",
"Paintbrush",
"drawing tool",
"draw",
"art tool",
"image",
"image editor",
"picture",
"editor",
"edit",
"canvas",
"remake",
"recreation",
"clone",
"image editing",
"image editor",
"image manipulation",
"raster",
"graphics",
"graphics editing",
"graphics editor",
"retro",
"vaporwave",
"aesthetic",
"nostalgia",
"90s",
"1990s",
"electron app",
"png",
"tiff",
"jpeg",
"bmp",
"bitmap",
],
},
},
},
],
publishers: [
{
name: "@electron-forge/publisher-github",
config: {
repository: {
owner: "1j01",
name: "jspaint",
},
prerelease: false,
draft: true,
},
},
],
};