@geode/opengeodeweb-front 10.24.0-rc.1 → 10.24.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/app/stores/app.js
CHANGED
|
@@ -88,7 +88,7 @@ export const useAppStore = defineStore("app", () => {
|
|
|
88
88
|
return loadedExtensions.value.get(id);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
async function loadExtension(path, backendPath = undefined) {
|
|
91
|
+
async function loadExtension(path, port, backendPath = undefined) {
|
|
92
92
|
try {
|
|
93
93
|
let finalURL = path;
|
|
94
94
|
|
|
@@ -104,6 +104,8 @@ export const useAppStore = defineStore("app", () => {
|
|
|
104
104
|
}
|
|
105
105
|
// oxlint-disable-next-line no-inline-comments
|
|
106
106
|
const extensionModule = await import(/* @vite-ignore */ finalURL);
|
|
107
|
+
const store = extensionModule.metadata.store();
|
|
108
|
+
store.$patch({ default_local_port: port });
|
|
107
109
|
|
|
108
110
|
if (finalURL !== path && finalURL.startsWith("blob:")) {
|
|
109
111
|
URL.revokeObjectURL(finalURL);
|
package/app/stores/infra.js
CHANGED
|
@@ -77,6 +77,7 @@ export const useInfraStore = defineStore("infra", {
|
|
|
77
77
|
|
|
78
78
|
await Promise.all(
|
|
79
79
|
this.microservices.map(async (store) => {
|
|
80
|
+
console.log("[INFRA] Connecting to microservice:", store.$id);
|
|
80
81
|
await store.connect();
|
|
81
82
|
console.log("[INFRA] Microservice connected:", store.$id);
|
|
82
83
|
}),
|
package/app/utils/extension.js
CHANGED
|
@@ -24,19 +24,15 @@ async function registerRunningExtensions() {
|
|
|
24
24
|
type: "application/javascript",
|
|
25
25
|
});
|
|
26
26
|
const blobUrl = URL.createObjectURL(blob);
|
|
27
|
-
const extensionModule = await appStore.loadExtension(blobUrl);
|
|
27
|
+
const extensionModule = await appStore.loadExtension(blobUrl, port);
|
|
28
28
|
console.log("[ExtensionManager] Extension loaded:", id);
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
appStore.registerStore(store);
|
|
37
|
-
console.log("[ExtensionManager] Store registered:", store.$id);
|
|
38
|
-
infraStore.register_microservice(store);
|
|
39
|
-
}
|
|
30
|
+
const storeFactory = extensionModule.metadata.store;
|
|
31
|
+
const store = storeFactory();
|
|
32
|
+
appStore.registerStore(store);
|
|
33
|
+
console.log("[ExtensionManager] Store registered:", store.$id);
|
|
34
|
+
infraStore.register_microservice(store);
|
|
35
|
+
|
|
40
36
|
return {
|
|
41
37
|
name,
|
|
42
38
|
version,
|
package/app/utils/local/path.js
CHANGED
|
@@ -76,8 +76,6 @@ async function lookForLocalExtensionDistPath(rootPath, extentionRepoName, fronte
|
|
|
76
76
|
// oxlint-disable-next-line no-await-in-loop
|
|
77
77
|
await setTimeout(MILLISECONDS_PER_RETRY);
|
|
78
78
|
}
|
|
79
|
-
|
|
80
|
-
throw new Error(`Failed to find local extension dist path: ${rebuiltFilePath}`);
|
|
81
79
|
}
|
|
82
80
|
async function extensionFrontendPath(unzippedExtensionPath, frontendFile, rootPath, extensionId) {
|
|
83
81
|
console.log("[extensionFrontendPath]", {
|
package/package.json
CHANGED
|
@@ -10,7 +10,10 @@ import {
|
|
|
10
10
|
addMicroserviceMetadatas,
|
|
11
11
|
runBack,
|
|
12
12
|
} from "@geode/opengeodeweb-front/app/utils/local/microservices.js";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
executableName,
|
|
15
|
+
extensionFrontendPath,
|
|
16
|
+
} from "@geode/opengeodeweb-front/app/utils/local/path.js";
|
|
14
17
|
import { extensionsConf } from "@geode/opengeodeweb-front/app/utils/config.js";
|
|
15
18
|
import { unzipFile } from "@geode/opengeodeweb-front/app/utils/server.js";
|
|
16
19
|
|
|
@@ -67,9 +70,13 @@ export default defineEventHandler(async (event) => {
|
|
|
67
70
|
console.log("runExtensions", { frontendFilePath });
|
|
68
71
|
const frontendContent = await fs.promises.readFile(frontendFilePath, "utf8");
|
|
69
72
|
|
|
70
|
-
const backendExecutablePath = path.join(
|
|
73
|
+
const backendExecutablePath = path.join(
|
|
74
|
+
unzippedExtensionPath,
|
|
75
|
+
executableName(backendExecutable),
|
|
76
|
+
);
|
|
77
|
+
console.log("runExtensions", { backendExecutablePath });
|
|
71
78
|
fs.chmodSync(backendExecutablePath, "755");
|
|
72
|
-
const port = await runBack(backendExecutable,
|
|
79
|
+
const port = await runBack(backendExecutable, unzippedExtensionPath, {
|
|
73
80
|
projectFolderPath,
|
|
74
81
|
});
|
|
75
82
|
await addMicroserviceMetadatas(projectFolderPath, {
|