-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathelectron-builder.config.js
141 lines (129 loc) · 4.74 KB
/
electron-builder.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
129
130
131
132
133
134
135
136
137
138
139
140
141
// SPDX-FileCopyrightText: 20022 Patchfox Authors
//
// SPDX-FileCopyrightText: 2021-2022 The Manyverse Authors
//
// SPDX-License-Identifier: CC0-1.0
const path = require("path")
const rimraf = require("rimraf")
const PackageJSON = require("./package.json")
const firstCopyrightYear = 2018
const lastCopyrightYear = new Date().getFullYear()
const AUTHOR = "Andre Alves Garzia"
const NAME_HUMAN = "Patchfox"
const NAME_COMPUTER = "Patchfox"
module.exports = {
// Metadata ------------------------------------------------------------------
appId: "org.patchfox.desktop",
productName: NAME_HUMAN,
copyright: `${firstCopyrightYear}-${lastCopyrightYear} ${AUTHOR}`,
buildVersion: PackageJSON.version,
extraMetadata: {
name: NAME_COMPUTER,
version: PackageJSON.version,
description: "A Quirky Secure Scuttlebutt Client",
author: AUTHOR,
homepage: "https://patchfox.org",
license: "MIT",
repository: "https://github.com/soapdog/patchfox",
},
protocols: [{ name: "ssb", schemes: ["ssb"] }],
// Electron-builder options --------------------------------------------------
asar: true,
npmRebuild: true,
electronVersion: PackageJSON.devDependencies.electron,
// All things files and directories ------------------------------------------
directories: {
app: __dirname,
buildResources: path.join(__dirname, "build-resources"),
output: path.join(__dirname, "build"),
},
files: [
"node_modules/**/*",
"!**/node_modules/*/{CHANGELOG.md,README.md,README,readme.md,readme}",
"!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}",
"!**/node_modules/*.d.ts",
"!**/node_modules/.bin",
"!**/*.{iml,o,hprof,orig,pyc,pyo,rbc,swp,csproj,sln,xproj}",
"!.editorconfig",
"!**/._*",
"!**/.*",
"!**/{.DS_Store,.git,.hg,.svn,CVS,RCS,SCCS,.gitignore,.gitattributes}",
"!**/{__pycache__,thumbs.db,.flowconfig,.idea,.vs,.nyc_output}",
"!**/{appveyor.yml,.travis.yml,circle.yml}",
"!**/{npm-debug.log,yarn.lock,.yarn-integrity,.yarn-metadata.json}",
"node_modules/**/build/Release/*.node", // Node native modules
"node_modules/**/build/Release/*.so*", // Node native modules (Linux)
"node_modules/**/build/Release/*.dylib", // Node native modules (macOS)
"node_modules/**/build/Release/*.dll", // Node native modules (Windows)
"node_modules/electron-window-state", // needed in loader.js
"package.json",
"ui/**/*",
"server/**/*",
"docs/**/*",
"app.js",
"!build",
"!**/.github",
"!**/.idea",
"!.git",
"!node_modules/electron",
"!node_modules/*-nodejs-mobile",
],
beforeBuild: conf => {
// Remove prebuilds so to force recompilation for Electron
console.log(" • beforeBuild, remove native modules prebuilds")
const node_modules = path.join(__dirname, "node_modules")
rimraf.sync(node_modules + "/**/**/bufferutil/prebuilds")
rimraf.sync(node_modules + "/**/**/sodium-native/prebuilds")
rimraf.sync(node_modules + "/**/**/leveldown/prebuilds")
rimraf.sync(node_modules + "/**/**/utf-8-validate/prebuilds")
},
// Linux-specific configurations ---------------------------------------------
linux: {
icon: path.join(__dirname, "ui", "assets", "images", "patchfox_pixel_512.png"),
target: [
{ target: "tar.gz", arch: ["x64", "arm64"] },
],
desktop: {
StartupWMClass: NAME_COMPUTER,
},
category: "Network",
},
deb: {
packageCategory: "net",
priority: "optional",
maintainer: "Andre Alves Garzia <[email protected]>",
},
// Mac-specific configurations -----------------------------------------------
mac: {
icon: path.join(__dirname, "ui", "assets", "images", "patchfox_pixel_512.icns"),
category: "public.app-category.social-networking",
darkModeSupport: false,
mergeASARs: false,
target: [{ target: "dmg", arch: ["universal"] }],
identity: null,
},
dmg: {
icon: path.join(__dirname, "ui", "assets", "images", "patchfox_pixel_512.icns"),
background: path.join(__dirname, "ui", "assets", "images", "dmg-background.png"),
},
// Windows-specific configurations -------------------------------------------
win: {
icon: path.join(__dirname, "ui", "assets", "images", "patchfox_pixel_512.png"),
publisherName: AUTHOR,
target: [{target: "zip", arch: ["arm64", "x64", "ia32"]}]
},
// nsis: {
// artifactName: "${name}-${version}-windows-${arch}-nsis-installer.${ext}",
// oneClick: false,
// perMachine: false,
// include: path.join(__dirname, "scripts", "installer.nsh"),
// },
// Publish options -----------------------------------------------------------
publish: {
provider: "github",
protocol: "https",
owner: "soapdog",
repo: "patchfox",
releaseType: "prerelease",
},
}