diff --git a/app/utils/local.js b/app/utils/local.js index 700fd64b..ce34bfc0 100644 --- a/app/utils/local.js +++ b/app/utils/local.js @@ -5,8 +5,6 @@ import child_process from "child_process" import WebSocket from "ws" // Third party imports -import pkg from "electron" -const { app, dialog } = pkg import { getPort } from "get-port-please" import isElectron from "is-electron" import pTimeout from "p-timeout" @@ -24,12 +22,13 @@ function venv_script_path(root_path, microservice_path) { return script_path } -function executable_path(microservice_path) { +async function executable_path(microservice_path) { if (isElectron()) { - if (app.isPackaged) { + const electron = await import("electron") + if (electron.app.isPackaged) { return process.resourcesPath } else { - return venv_script_path(app.getAppPath(), microservice_path) + return venv_script_path(electron.app.getAppPath(), microservice_path) } } else { return venv_script_path(process.cwd(), microservice_path) @@ -89,8 +88,9 @@ async function run_script( // You can also use a variable to save the output for when the script closes later child.stderr.setEncoding("utf8") - child.on("error", (error) => { - dialog.showMessageBox({ + child.on("error", async (error) => { + const electron = await import("electron") + electron.dialog.showMessageBox({ title: "Title", type: "warning", message: "Error occured.\r\n" + error, diff --git a/package.json b/package.json index 8dc7a4cc..931ecad3 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "uuid": "11.1.0", "vue3-carousel": "0.3.4", "vuetify": "3.10.11", + "vuetify-nuxt-module": "0.18.7", "ws": "8.18.3", "wslink": "1.12.4" }, @@ -61,6 +62,9 @@ "vitest": "4.0.15", "vitest-environment-nuxt": "1.0.1" }, + "peerDependencies": { + "electron": "36.4.0" + }, "overrides": { "vue": "latest" }, diff --git a/tests/integration/microservices/back/requirements.txt b/tests/integration/microservices/back/requirements.txt index c8f45967..bd3a3ef5 100644 --- a/tests/integration/microservices/back/requirements.txt +++ b/tests/integration/microservices/back/requirements.txt @@ -5,4 +5,3 @@ # pip-compile --output-file=tests/integration/microservices/back/requirements.txt tests/integration/microservices/back/requirements.in # -opengeodeweb-back==5.*,>=5.14.3 diff --git a/tests/integration/microservices/viewer/requirements.txt b/tests/integration/microservices/viewer/requirements.txt index 147e1750..4d097394 100644 --- a/tests/integration/microservices/viewer/requirements.txt +++ b/tests/integration/microservices/viewer/requirements.txt @@ -5,4 +5,3 @@ # pip-compile --output-file=tests/integration/microservices/viewer/requirements.txt tests/integration/microservices/viewer/requirements.in # -opengeodeweb-viewer==1.*,>=1.13.2 diff --git a/tests/integration/setup.js b/tests/integration/setup.js index 073203b7..480d9784 100644 --- a/tests/integration/setup.js +++ b/tests/integration/setup.js @@ -40,9 +40,11 @@ async function setupIntegrationTests(file_name, geode_object) { const microservices_path = path.join("tests", "integration", "microservices") const project_folder_path = path.join(data_folder, uuidv4()) const upload_folder_path = path.join(__dirname, "data", "uploads") - const back_path = executable_path(path.join(microservices_path, "back")) + const back_path = await executable_path(path.join(microservices_path, "back")) const back_name = executable_name("opengeodeweb-back") - const viewer_path = executable_path(path.join(microservices_path, "viewer")) + const viewer_path = await executable_path( + path.join(microservices_path, "viewer"), + ) const viewer_name = executable_name("opengeodeweb-viewer") const [back_port, viewer_port] = await Promise.all([ run_back(back_name, back_path, {