Fix emain package error

This commit is contained in:
Evan Simkowitz 2024-09-18 12:06:34 -07:00
parent 1cb4254ce3
commit adcc564d35
No known key found for this signature in database
5 changed files with 18 additions and 18 deletions

View File

@ -1,8 +1,8 @@
// Copyright 2024, Command Line Inc. // Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { getWebServerEndpoint, getWSServerEndpoint } from "@/util/endpoints";
import { ipcMain } from "electron"; import { ipcMain } from "electron";
import { getWebServerEndpoint, getWSServerEndpoint } from "../frontend/util/endpoints";
const AuthKeyHeader = "X-AuthKey"; const AuthKeyHeader = "X-AuthKey";
export const AuthKeyEnv = "AUTH_KEY"; export const AuthKeyEnv = "AUTH_KEY";

View File

@ -1,9 +1,9 @@
// Copyright 2024, Command Line Inc. // Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { RpcResponseHelper, WshClient } from "@/app/store/wshclient";
import electron from "electron"; import electron from "electron";
import { getWebContentsByBlockId, webGetSelector } from "emain/emain-web"; import { RpcResponseHelper, WshClient } from "../frontend/app/store/wshclient";
import { getWebContentsByBlockId, webGetSelector } from "./emain-web";
type WaveBrowserWindow = Electron.BrowserWindow & { waveWindowId: string; readyPromise: Promise<void> }; type WaveBrowserWindow = Electron.BrowserWindow & { waveWindowId: string; readyPromise: Promise<void> };

View File

@ -1,9 +1,7 @@
// Copyright 2024, Command Line Inc. // Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { initElectronWshrpc } from "@/app/store/wshrpcutil";
import * as electron from "electron"; import * as electron from "electron";
import { ElectronWshClientType } from "emain/emain-wsh";
import { FastAverageColor } from "fast-average-color"; import { FastAverageColor } from "fast-average-color";
import fs from "fs"; import fs from "fs";
import * as child_process from "node:child_process"; import * as child_process from "node:child_process";
@ -16,11 +14,13 @@ import * as util from "util";
import winston from "winston"; import winston from "winston";
import { initGlobal } from "../frontend/app/store/global"; import { initGlobal } from "../frontend/app/store/global";
import * as services from "../frontend/app/store/services"; import * as services from "../frontend/app/store/services";
import { initElectronWshrpc } from "../frontend/app/store/wshrpcutil";
import { WSServerEndpointVarName, WebServerEndpointVarName, getWebServerEndpoint } from "../frontend/util/endpoints"; import { WSServerEndpointVarName, WebServerEndpointVarName, getWebServerEndpoint } from "../frontend/util/endpoints";
import { fetch } from "../frontend/util/fetchutil"; import { fetch } from "../frontend/util/fetchutil";
import * as keyutil from "../frontend/util/keyutil"; import * as keyutil from "../frontend/util/keyutil";
import { fireAndForget } from "../frontend/util/util"; import { fireAndForget } from "../frontend/util/util";
import { AuthKey, AuthKeyEnv, configureAuthKeyRequestInjection } from "./authkey"; import { AuthKey, AuthKeyEnv, configureAuthKeyRequestInjection } from "./authkey";
import { ElectronWshClientType } from "./emain-wsh";
import { getAppMenu } from "./menu"; import { getAppMenu } from "./menu";
import { import {
getElectronAppBasePath, getElectronAppBasePath,

View File

@ -1,10 +1,10 @@
// Copyright 2024, Command Line Inc. // Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { WaveDevVarName, WaveDevViteVarName } from "@/util/isdev";
import { app, ipcMain } from "electron"; import { app, ipcMain } from "electron";
import os from "os"; import os from "os";
import path from "path"; import path from "path";
import { WaveDevVarName, WaveDevViteVarName } from "../frontend/util/isdev";
import * as keyutil from "../frontend/util/keyutil"; import * as keyutil from "../frontend/util/keyutil";
const isDev = !app.isPackaged; const isDev = !app.isPackaged;

View File

@ -1,10 +1,10 @@
// Copyright 2024, Command Line Inc. // Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
import { isDev } from "@/util/isdev"; import { BrowserWindow, dialog, ipcMain, Notification } from "electron";
import * as electron from "electron";
import { autoUpdater } from "electron-updater"; import { autoUpdater } from "electron-updater";
import * as services from "../frontend/app/store/services"; import { FileService } from "../frontend/app/store/services";
import { isDev } from "../frontend/util/isdev";
import { fireAndForget } from "../frontend/util/util"; import { fireAndForget } from "../frontend/util/util";
export let updater: Updater; export let updater: Updater;
@ -63,7 +63,7 @@ export class Updater {
// Display the update banner and create a system notification // Display the update banner and create a system notification
this.status = "ready"; this.status = "ready";
const updateNotification = new electron.Notification({ const updateNotification = new Notification({
title: "Wave Terminal", title: "Wave Terminal",
body: "A new version of Wave Terminal is ready to install.", body: "A new version of Wave Terminal is ready to install.",
}); });
@ -83,7 +83,7 @@ export class Updater {
private set status(value: UpdaterStatus) { private set status(value: UpdaterStatus) {
this._status = value; this._status = value;
electron.BrowserWindow.getAllWindows().forEach((window) => { BrowserWindow.getAllWindows().forEach((window) => {
window.webContents.send("app-update-status", value); window.webContents.send("app-update-status", value);
}); });
} }
@ -133,7 +133,7 @@ export class Updater {
type: "info", type: "info",
message: "There are currently no updates available.", message: "There are currently no updates available.",
}; };
electron.dialog.showMessageBox(electron.BrowserWindow.getFocusedWindow(), dialogOpts); dialog.showMessageBox(BrowserWindow.getFocusedWindow(), dialogOpts);
} }
// Only update the last check time if this is an automatic check. This ensures the interval remains consistent. // Only update the last check time if this is an automatic check. This ensures the interval remains consistent.
@ -153,10 +153,10 @@ export class Updater {
detail: "A new version has been downloaded. Restart the application to apply the updates.", detail: "A new version has been downloaded. Restart the application to apply the updates.",
}; };
const allWindows = electron.BrowserWindow.getAllWindows(); const allWindows = BrowserWindow.getAllWindows();
if (allWindows.length > 0) { if (allWindows.length > 0) {
await electron.dialog await dialog
.showMessageBox(electron.BrowserWindow.getFocusedWindow() ?? allWindows[0], dialogOpts) .showMessageBox(BrowserWindow.getFocusedWindow() ?? allWindows[0], dialogOpts)
.then(({ response }) => { .then(({ response }) => {
if (response === 0) { if (response === 0) {
this.installUpdate(); this.installUpdate();
@ -176,8 +176,8 @@ export class Updater {
} }
} }
electron.ipcMain.on("install-app-update", () => fireAndForget(() => updater?.promptToInstallUpdate())); ipcMain.on("install-app-update", () => fireAndForget(() => updater?.promptToInstallUpdate()));
electron.ipcMain.on("get-app-update-status", (event) => { ipcMain.on("get-app-update-status", (event) => {
event.returnValue = updater?.status; event.returnValue = updater?.status;
}); });
@ -201,7 +201,7 @@ export async function configureAutoUpdater() {
try { try {
console.log("Configuring updater"); console.log("Configuring updater");
const settings = (await services.FileService.GetFullConfig()).settings; const settings = (await FileService.GetFullConfig()).settings;
updater = new Updater(settings); updater = new Updater(settings);
await updater.start(); await updater.start();
} catch (e) { } catch (e) {