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.
// SPDX-License-Identifier: Apache-2.0
import { getWebServerEndpoint, getWSServerEndpoint } from "@/util/endpoints";
import { ipcMain } from "electron";
import { getWebServerEndpoint, getWSServerEndpoint } from "../frontend/util/endpoints";
const AuthKeyHeader = "X-AuthKey";
export const AuthKeyEnv = "AUTH_KEY";

View File

@ -1,9 +1,9 @@
// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import { RpcResponseHelper, WshClient } from "@/app/store/wshclient";
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> };

View File

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

View File

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

View File

@ -1,10 +1,10 @@
// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import { isDev } from "@/util/isdev";
import * as electron from "electron";
import { BrowserWindow, dialog, ipcMain, Notification } from "electron";
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";
export let updater: Updater;
@ -63,7 +63,7 @@ export class Updater {
// Display the update banner and create a system notification
this.status = "ready";
const updateNotification = new electron.Notification({
const updateNotification = new Notification({
title: "Wave Terminal",
body: "A new version of Wave Terminal is ready to install.",
});
@ -83,7 +83,7 @@ export class Updater {
private set status(value: UpdaterStatus) {
this._status = value;
electron.BrowserWindow.getAllWindows().forEach((window) => {
BrowserWindow.getAllWindows().forEach((window) => {
window.webContents.send("app-update-status", value);
});
}
@ -133,7 +133,7 @@ export class Updater {
type: "info",
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.
@ -153,10 +153,10 @@ export class Updater {
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) {
await electron.dialog
.showMessageBox(electron.BrowserWindow.getFocusedWindow() ?? allWindows[0], dialogOpts)
await dialog
.showMessageBox(BrowserWindow.getFocusedWindow() ?? allWindows[0], dialogOpts)
.then(({ response }) => {
if (response === 0) {
this.installUpdate();
@ -176,8 +176,8 @@ export class Updater {
}
}
electron.ipcMain.on("install-app-update", () => fireAndForget(() => updater?.promptToInstallUpdate()));
electron.ipcMain.on("get-app-update-status", (event) => {
ipcMain.on("install-app-update", () => fireAndForget(() => updater?.promptToInstallUpdate()));
ipcMain.on("get-app-update-status", (event) => {
event.returnValue = updater?.status;
});
@ -201,7 +201,7 @@ export async function configureAutoUpdater() {
try {
console.log("Configuring updater");
const settings = (await services.FileService.GetFullConfig()).settings;
const settings = (await FileService.GetFullConfig()).settings;
updater = new Updater(settings);
await updater.start();
} catch (e) {