feat: Implemented AppImage building

This commit is contained in:
Simeon Radivoev 2026-03-01 15:35:07 +02:00
parent d8f471dadc
commit 6a288f765e
38 changed files with 1036 additions and 147 deletions

View file

@ -2,6 +2,33 @@ import Webview from "@rcompat/webview";
import platform from "@rcompat/webview/linux-x64";
import webviewWorkerBase from "./base";
console.log("Launching Webview");
const webview = new Webview({ debug: import.meta.env.NODE_ENV === 'development', platform });
webviewWorkerBase(webview);
if (process.env.FLATPAK_BUILD === "true")
{
let webview: Bun.Subprocess | undefined = undefined;
let hostUrl: string | undefined = undefined;
webviewWorkerBase({
navigate: (url) =>
{
hostUrl = url;
}, destroy: () => webview?.kill(), run: () =>
{
webview = Bun.spawn(["webview", hostUrl ?? ''], {
stdout: "inherit",
stderr: "inherit",
env: {
...process.env,
},
onExit ()
{
postMessage({ data: 'destroyed' });
}
});
}
});
} else
{
console.log("Launching Webview");
const webview = new Webview({ debug: import.meta.env.NODE_ENV === 'development', platform });
webviewWorkerBase(webview);
}