waveterm/forge.config.js

116 lines
3.2 KiB
JavaScript
Raw Normal View History

2024-02-29 21:23:44 +01:00
const pkg = require("./package.json");
2024-02-29 20:59:22 +01:00
let AllowedFirstParts = {
"package.json": true,
2023-08-22 06:37:04 +02:00
dist: true,
2023-10-13 18:09:09 +02:00
public: true,
2023-08-22 06:37:04 +02:00
node_modules: true,
bin: true,
};
2024-02-29 20:59:22 +01:00
let AllowedNodeModules = {
"monaco-editor": true,
};
2024-02-29 20:59:22 +01:00
let modCache = {};
function ignoreFn(path) {
let parts = path.split("/");
if (parts.length <= 1) {
return false;
}
let firstPart = parts[1];
if (!AllowedFirstParts[firstPart]) {
return true;
}
if (firstPart == "node_modules") {
if (parts.length <= 2) {
return false;
}
if (parts.length > 3) {
if (parts[3] == "build") {
return true;
}
}
let nodeModule = parts[2];
if (!modCache[nodeModule]) {
modCache[nodeModule] = true;
}
if (!AllowedNodeModules[nodeModule]) {
return true;
}
if (nodeModule == "monaco-editor" && parts.length >= 4 && parts[3] != "min") {
return true;
}
}
return false;
}
2022-11-01 00:41:44 +01:00
module.exports = {
packagerConfig: {
ignore: ignoreFn,
2024-03-01 21:24:07 +01:00
files: ["package.json", "dist/*", "public/*", "bin/*"],
2023-10-25 18:46:51 +02:00
icon: "public/waveterm.icns",
},
rebuildConfig: {},
makers: [
{
2023-08-22 06:37:04 +02:00
name: "@electron-forge/maker-zip",
2023-10-18 07:54:07 +02:00
platforms: ["darwin", "linux"],
},
2024-02-29 20:32:24 +01:00
{
name: "@electron-forge/maker-deb",
2024-02-29 21:02:03 +01:00
config: {
options: {
2024-02-29 21:23:44 +01:00
bin: pkg.productName,
2024-02-29 23:56:23 +01:00
name: pkg.name,
2024-02-29 22:49:08 +01:00
genericName: "Terminal Emulator",
productName: pkg.productName,
productDescription: pkg.description,
icon: "public/waveterm.icns",
categories: ["Utility", "Development"],
maintainer: pkg.author,
homepage: pkg.homepage,
2024-02-29 22:55:49 +01:00
license: pkg.license,
version: pkg.version,
2024-02-29 21:02:03 +01:00
},
},
2024-02-29 20:32:24 +01:00
},
{
name: "@electron-forge/maker-rpm",
2024-02-29 21:08:14 +01:00
config: {
options: {
2024-02-29 21:23:44 +01:00
bin: pkg.productName,
2024-02-29 22:55:49 +01:00
name: pkg.name,
genericName: "Terminal Emulator",
productName: pkg.productName,
description: pkg.description,
productDescription: pkg.description,
icon: "public/waveterm.icns",
categories: ["Utility", "Development"],
license: pkg.license,
version: pkg.version,
2024-02-29 21:23:44 +01:00
},
},
},
2024-02-29 21:42:56 +01:00
// {
// name: "@electron-forge/maker-flatpak",
// config: {
// options: {
// bin: pkg.productName,
// mimeType: ["text/plain"],
// },
// },
// },
2024-02-29 21:23:44 +01:00
// {
// name: "@electron-forge/maker-snap",
// config: {
// features: {
// audio: true,
// mpris: "com.commandline.waveterm",
// webgl: true,
// },
// },
// },
],
2022-11-01 00:41:44 +01:00
};