From 7a4c5c355cca557893adc30a2266706f2a8b73af Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 29 Jun 2026 13:27:45 +0200 Subject: [PATCH 01/12] fix(Microservices): refactor project/data_folder_path --- app/utils/local/microservices.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/utils/local/microservices.js b/app/utils/local/microservices.js index ba726b2c..c12a1e36 100644 --- a/app/utils/local/microservices.js +++ b/app/utils/local/microservices.js @@ -61,18 +61,12 @@ async function runBack(execName, execPath, args = {}) { if (!projectFolderPath) { throw new Error("projectFolderPath is required"); } - let { uploadFolderPath } = args; - if (!uploadFolderPath) { - uploadFolderPath = path.join(projectFolderPath, "uploads"); - } const port = await getAvailablePort(); const backArgs = [ "--port", String(port), - "--data_folder_path", + "--project_folder_path", projectFolderPath, - "--upload_folder_path", - uploadFolderPath, "--allowed_origin", "http://localhost:*", "--timeout", @@ -95,7 +89,7 @@ async function runViewer(execName, execPath, args = {}) { const viewerArgs = [ "--port", String(port), - "--data_folder_path", + "--project_folder_path", projectFolderPath, "--timeout", "0", From 33a4a2e7f4a7549b2dce4bc62de46aee15d6645d Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 29 Jun 2026 13:30:45 +0200 Subject: [PATCH 02/12] oxlint --- app/utils/local/microservices.js | 1 - 1 file changed, 1 deletion(-) diff --git a/app/utils/local/microservices.js b/app/utils/local/microservices.js index c12a1e36..d5d2a083 100644 --- a/app/utils/local/microservices.js +++ b/app/utils/local/microservices.js @@ -1,7 +1,6 @@ // Node imports import child_process from "node:child_process"; import fs from "node:fs"; -import path from "node:path"; // Third party imports import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" with { type: "json" }; From b8f88f92084386383fdfba4248da807897595b9f Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 29 Jun 2026 13:40:55 +0200 Subject: [PATCH 03/12] uploadFolderPath & projectFolderPath --- app/utils/local/microservices.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/utils/local/microservices.js b/app/utils/local/microservices.js index d5d2a083..98a2fd06 100644 --- a/app/utils/local/microservices.js +++ b/app/utils/local/microservices.js @@ -1,6 +1,7 @@ // Node imports import child_process from "node:child_process"; import fs from "node:fs"; +import path from "node:path"; // Third party imports import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" with { type: "json" }; @@ -60,12 +61,18 @@ async function runBack(execName, execPath, args = {}) { if (!projectFolderPath) { throw new Error("projectFolderPath is required"); } + let { uploadFolderPath } = args; + if (!uploadFolderPath) { + uploadFolderPath = path.join(projectFolderPath, "uploads"); + } const port = await getAvailablePort(); const backArgs = [ "--port", String(port), "--project_folder_path", projectFolderPath, + "--upload_folder_path", + uploadFolderPath, "--allowed_origin", "http://localhost:*", "--timeout", From ceb6002a5125fd19bccab36a8e00329ef295dd7e Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 29 Jun 2026 13:53:15 +0200 Subject: [PATCH 04/12] test From f20dc5e103b32692ec37b12808be3b0742910774 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Mon, 29 Jun 2026 14:45:27 +0200 Subject: [PATCH 05/12] test From 7ebd483801b40b8b074dff3a1f9c4ad451e3362e Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Tue, 30 Jun 2026 09:18:37 +0200 Subject: [PATCH 06/12] test From 0e823482d702fae9c74e060c0b8e1b21deff8628 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Tue, 30 Jun 2026 09:27:30 +0200 Subject: [PATCH 07/12] test fetch --- app/utils/local/cleanup.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/utils/local/cleanup.js b/app/utils/local/cleanup.js index a11dbfc0..a7430d0f 100644 --- a/app/utils/local/cleanup.js +++ b/app/utils/local/cleanup.js @@ -39,8 +39,7 @@ function killHttpMicroservice(microservice) { const failMessage = `Failed to kill ${microservice.name}`; async function do_kill() { try { - const fetchFunc = typeof $fetch === "undefined" ? fetch : $fetch; - await fetchFunc(microservice.url, { + await fetch(microservice.url, { method: microservice.method, }); } catch (error) { From bc5ceb82df8622fbb77afdaeb50a1c1c8a497c8c Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Tue, 30 Jun 2026 09:53:28 +0200 Subject: [PATCH 08/12] test From db7707f1d994a91ccd12cf9a46ca11a4bbc0f120 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Tue, 30 Jun 2026 10:43:08 +0200 Subject: [PATCH 09/12] test From 36f782a2302697a0bd80d3e8b325226885b33244 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Tue, 30 Jun 2026 11:10:03 +0200 Subject: [PATCH 10/12] test From 08e2b2659ab806065a1d43c7bab9e844519f7f07 Mon Sep 17 00:00:00 2001 From: JulienChampagnol Date: Tue, 30 Jun 2026 14:36:07 +0200 Subject: [PATCH 11/12] cleanup --- app/utils/local/microservices.js | 9 ++------- app/utils/local/path.js | 12 +++++++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/utils/local/microservices.js b/app/utils/local/microservices.js index 98a2fd06..7bddec7e 100644 --- a/app/utils/local/microservices.js +++ b/app/utils/local/microservices.js @@ -7,18 +7,13 @@ import path from "node:path"; import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" with { type: "json" }; // Local imports -import { commandExistsSync, getAvailablePort, waitForReady } from "./scripts.js"; +import { getAvailablePort, waitForReady } from "./scripts.js"; import { microservicesMetadatasPath, projectMicroservices } from "./cleanup.js"; import { executablePath } from "./path.js"; const MILLISECONDS_PER_SECOND = 1000; const DEFAULT_TIMEOUT_SECONDS = 30; -function resolveCommand(execPath, execName) { - const command = commandExistsSync(execName) ? execName : executablePath(execPath, execName); - return command; -} - async function runScript( execPath, execName, @@ -26,7 +21,7 @@ async function runScript( expectedResponse, timeoutSeconds = DEFAULT_TIMEOUT_SECONDS, ) { - const command = resolveCommand(execPath, execName); + const command = executablePath(execPath, execName); console.log("runScript", command, args); const child = child_process.spawn(command, args, { diff --git a/app/utils/local/path.js b/app/utils/local/path.js index dcf90343..10efee8d 100644 --- a/app/utils/local/path.js +++ b/app/utils/local/path.js @@ -9,25 +9,31 @@ import { v4 as uuidv4 } from "uuid"; // Local imports import { appMode } from "./app_mode.js"; +import { commandExistsSync } from "./scripts.js"; function executablePath(execPath, execName) { + const osExecutableName = executableName(execName) const resourcesPath = process.env.RESOURCES_PATH; const mode = process.env.MODE; const nodeEnv = process.env.NODE_ENV; console.log("[executablePath]", { execPath, execName, mode, nodeEnv, resourcesPath }); if (mode === appMode.DESKTOP && nodeEnv === "production") { - const execPathInResources = path.join(resourcesPath, executableName(execName)); + const execPathInResources = path.join(resourcesPath, osExecutableName); if (fs.existsSync(execPathInResources)) { console.log(`[executablePath] Found executable in resources path: ${execPathInResources}`); return execPathInResources; } } - const localExecPath = path.join(execPath, executableName(execName)); + const localExecPath = path.join(execPath, osExecutableName); if (fs.existsSync(localExecPath)) { console.log(`[executablePath] Found executable in local path: ${localExecPath}`); return localExecPath; } - throw new Error(`Executable not found: ${execName}`); + if (commandExistsSync(osExecutableName)) { + console.log(`[executablePath] Found executable in PATH: ${osExecutableName}`); + return osExecutableName; + } + throw new Error(`Executable not found: ${osExecutableName}`); } function executableName(execName) { From 70f03811eb2f73067180842934f0468c1b4bcca8 Mon Sep 17 00:00:00 2001 From: JulienChampagnol <91873154+JulienChampagnol@users.noreply.github.com> Date: Tue, 30 Jun 2026 14:36:58 +0000 Subject: [PATCH 12/12] Apply prepare changes --- app/utils/local/path.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/utils/local/path.js b/app/utils/local/path.js index 10efee8d..22c67984 100644 --- a/app/utils/local/path.js +++ b/app/utils/local/path.js @@ -12,7 +12,7 @@ import { appMode } from "./app_mode.js"; import { commandExistsSync } from "./scripts.js"; function executablePath(execPath, execName) { - const osExecutableName = executableName(execName) + const osExecutableName = executableName(execName); const resourcesPath = process.env.RESOURCES_PATH; const mode = process.env.MODE; const nodeEnv = process.env.NODE_ENV;