feat: Implemented AppImage building
This commit is contained in:
parent
d8f471dadc
commit
6a288f765e
38 changed files with 1036 additions and 147 deletions
|
|
@ -1,8 +1,7 @@
|
|||
import { SERVER_URL } from "@/shared/constants";
|
||||
import Webview from "@rcompat/webview";
|
||||
import { host } from "../utils/host";
|
||||
|
||||
export default function (webview: Webview)
|
||||
export default function (webview: { navigate: (url: string) => void; run: () => void; destroy: () => void; })
|
||||
{
|
||||
self.addEventListener('message', (e) =>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue