@geode/opengeodeweb-front 10.0.5 → 10.0.6-rc.2
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/utils/local.js +75 -58
- package/package.json +32 -27
- package/tests/integration/setup.js +4 -2
package/app/utils/local.js
CHANGED
|
@@ -5,10 +5,9 @@ import child_process from "child_process"
|
|
|
5
5
|
import WebSocket from "ws"
|
|
6
6
|
|
|
7
7
|
// Third party imports
|
|
8
|
-
import pkg from "electron"
|
|
9
|
-
const { app, dialog } = pkg
|
|
10
8
|
import { getPort } from "get-port-please"
|
|
11
9
|
import isElectron from "is-electron"
|
|
10
|
+
import pTimeout from "p-timeout"
|
|
12
11
|
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" with { type: "json" }
|
|
13
12
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" }
|
|
14
13
|
|
|
@@ -23,12 +22,13 @@ function venv_script_path(root_path, microservice_path) {
|
|
|
23
22
|
return script_path
|
|
24
23
|
}
|
|
25
24
|
|
|
26
|
-
function executable_path(microservice_path) {
|
|
25
|
+
async function executable_path(microservice_path) {
|
|
27
26
|
if (isElectron()) {
|
|
28
|
-
|
|
27
|
+
const electron = await import("electron")
|
|
28
|
+
if (electron.app.isPackaged) {
|
|
29
29
|
return process.resourcesPath
|
|
30
30
|
} else {
|
|
31
|
-
return venv_script_path(app.getAppPath(), microservice_path)
|
|
31
|
+
return venv_script_path(electron.app.getAppPath(), microservice_path)
|
|
32
32
|
}
|
|
33
33
|
} else {
|
|
34
34
|
return venv_script_path(process.cwd(), microservice_path)
|
|
@@ -88,8 +88,9 @@ async function run_script(
|
|
|
88
88
|
|
|
89
89
|
// You can also use a variable to save the output for when the script closes later
|
|
90
90
|
child.stderr.setEncoding("utf8")
|
|
91
|
-
child.on("error", (error) => {
|
|
92
|
-
|
|
91
|
+
child.on("error", async (error) => {
|
|
92
|
+
const electron = await import("electron")
|
|
93
|
+
electron.dialog.showMessageBox({
|
|
93
94
|
title: "Title",
|
|
94
95
|
type: "warning",
|
|
95
96
|
message: "Error occured.\r\n" + error,
|
|
@@ -185,71 +186,87 @@ function delete_folder_recursive(data_folder_path) {
|
|
|
185
186
|
return
|
|
186
187
|
}
|
|
187
188
|
try {
|
|
188
|
-
|
|
189
|
-
|
|
189
|
+
for (const i = 0; i <= 5; i++) {
|
|
190
|
+
console.log(`Deleting folder: ${data_folder_path}`)
|
|
191
|
+
fs.rmSync(data_folder_path, { recursive: true, force: true })
|
|
192
|
+
console.log(`Deleted folder: ${data_folder_path}`)
|
|
193
|
+
return
|
|
194
|
+
}
|
|
190
195
|
} catch (err) {
|
|
191
196
|
console.error(`Error deleting folder ${data_folder_path}:`, err)
|
|
192
197
|
}
|
|
193
198
|
}
|
|
194
199
|
|
|
195
200
|
function kill_back(back_port) {
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
201
|
+
return pTimeout(
|
|
202
|
+
new Promise((resolve, reject) => {
|
|
203
|
+
fetch(
|
|
204
|
+
"http://localhost:" +
|
|
205
|
+
back_port +
|
|
206
|
+
"/" +
|
|
207
|
+
back_schemas.opengeodeweb_back.kill.$id,
|
|
208
|
+
{
|
|
209
|
+
method: back_schemas.opengeodeweb_back.kill.methods[0],
|
|
210
|
+
},
|
|
211
|
+
)
|
|
212
|
+
.then(() => {
|
|
213
|
+
console.log("Failed to kill back")
|
|
214
|
+
reject()
|
|
215
|
+
})
|
|
216
|
+
.catch(() => {
|
|
217
|
+
console.log("Back closed")
|
|
218
|
+
resolve()
|
|
219
|
+
})
|
|
220
|
+
}),
|
|
221
|
+
{
|
|
222
|
+
milliseconds: 500,
|
|
223
|
+
message: "Failed to kill back",
|
|
224
|
+
},
|
|
225
|
+
)
|
|
215
226
|
}
|
|
216
227
|
|
|
217
228
|
function kill_viewer(viewer_port) {
|
|
218
|
-
return
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
JSON.stringify({
|
|
224
|
-
id: "system:hello",
|
|
225
|
-
method: "wslink.hello",
|
|
226
|
-
args: [{ secret: "wslink-secret" }],
|
|
227
|
-
}),
|
|
228
|
-
)
|
|
229
|
-
})
|
|
230
|
-
socket.on("message", (data) => {
|
|
231
|
-
const message = data.toString()
|
|
232
|
-
console.log("Received from server:", message)
|
|
233
|
-
|
|
234
|
-
if (message.includes("hello")) {
|
|
229
|
+
return pTimeout(
|
|
230
|
+
new Promise((resolve) => {
|
|
231
|
+
const socket = new WebSocket("ws://localhost:" + viewer_port + "/ws")
|
|
232
|
+
socket.on("open", () => {
|
|
233
|
+
console.log("Connected to WebSocket server")
|
|
235
234
|
socket.send(
|
|
236
235
|
JSON.stringify({
|
|
237
|
-
id:
|
|
238
|
-
method:
|
|
236
|
+
id: "system:hello",
|
|
237
|
+
method: "wslink.hello",
|
|
238
|
+
args: [{ secret: "wslink-secret" }],
|
|
239
239
|
}),
|
|
240
240
|
)
|
|
241
|
+
})
|
|
242
|
+
socket.on("message", (data) => {
|
|
243
|
+
const message = data.toString()
|
|
244
|
+
console.log("Received from server:", message)
|
|
245
|
+
|
|
246
|
+
if (message.includes("hello")) {
|
|
247
|
+
socket.send(
|
|
248
|
+
JSON.stringify({
|
|
249
|
+
id: viewer_schemas.opengeodeweb_viewer.kill.$id,
|
|
250
|
+
method: viewer_schemas.opengeodeweb_viewer.kill.$id,
|
|
251
|
+
}),
|
|
252
|
+
)
|
|
253
|
+
resolve()
|
|
254
|
+
}
|
|
255
|
+
})
|
|
256
|
+
socket.on("close", () => {
|
|
257
|
+
console.log("Disconnected from WebSocket server")
|
|
241
258
|
resolve()
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
})
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}
|
|
252
|
-
|
|
259
|
+
})
|
|
260
|
+
socket.on("error", (error) => {
|
|
261
|
+
console.error("WebSocket error:", error)
|
|
262
|
+
resolve()
|
|
263
|
+
})
|
|
264
|
+
}),
|
|
265
|
+
{
|
|
266
|
+
milliseconds: 500,
|
|
267
|
+
message: "Failed to kill viewer",
|
|
268
|
+
},
|
|
269
|
+
)
|
|
253
270
|
}
|
|
254
271
|
|
|
255
272
|
async function run_browser(
|
package/package.json
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geode/opengeodeweb-front",
|
|
3
|
+
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "10.0.6-rc.2",
|
|
6
|
+
"main": "./nuxt.config.js",
|
|
3
7
|
"scripts": {
|
|
4
8
|
"lint": "eslint --fix --ext .js,.vue --ignore-path .gitignore .",
|
|
5
9
|
"test": "npm run test:unit",
|
|
@@ -9,6 +13,31 @@
|
|
|
9
13
|
"geode_objects": "node scripts/generate_geode_objects.js && prettier ./assets/geode_objects.js --write",
|
|
10
14
|
"build": ""
|
|
11
15
|
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@geode/opengeodeweb-back": "next",
|
|
18
|
+
"@geode/opengeodeweb-viewer": "next",
|
|
19
|
+
"@kitware/vtk.js": "33.3.0",
|
|
20
|
+
"@mdi/font": "7.4.47",
|
|
21
|
+
"@pinia/nuxt": "0.11.3",
|
|
22
|
+
"@types/node": "22.15.3",
|
|
23
|
+
"@vueuse/components": "13.1.0",
|
|
24
|
+
"@vueuse/nuxt": "13.1.0",
|
|
25
|
+
"ajv": "8.17.1",
|
|
26
|
+
"get-port-please": "3.2.0",
|
|
27
|
+
"is-electron": "2.2.2",
|
|
28
|
+
"js-file-download": "0.4.12",
|
|
29
|
+
"nuxt": "4.2.2",
|
|
30
|
+
"p-timeout": "7.0.1",
|
|
31
|
+
"pinia": "3.0.4",
|
|
32
|
+
"sass": "1.87.0",
|
|
33
|
+
"semver": "7.7.1",
|
|
34
|
+
"uuid": "11.1.0",
|
|
35
|
+
"vue3-carousel": "0.3.4",
|
|
36
|
+
"vuetify": "3.10.11",
|
|
37
|
+
"vuetify-nuxt-module": "0.18.7",
|
|
38
|
+
"ws": "8.18.3",
|
|
39
|
+
"wslink": "1.12.4"
|
|
40
|
+
},
|
|
12
41
|
"devDependencies": {
|
|
13
42
|
"@nuxt/test-utils": "3.21.0",
|
|
14
43
|
"@pinia/testing": "1.0.3",
|
|
@@ -33,36 +62,12 @@
|
|
|
33
62
|
"vitest": "4.0.15",
|
|
34
63
|
"vitest-environment-nuxt": "1.0.1"
|
|
35
64
|
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"electron": "36.4.0"
|
|
67
|
+
},
|
|
36
68
|
"overrides": {
|
|
37
69
|
"vue": "latest"
|
|
38
70
|
},
|
|
39
|
-
"description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
|
|
40
|
-
"type": "module",
|
|
41
|
-
"version": "10.0.5",
|
|
42
|
-
"main": "./nuxt.config.js",
|
|
43
|
-
"dependencies": {
|
|
44
|
-
"@geode/opengeodeweb-back": "latest",
|
|
45
|
-
"@geode/opengeodeweb-viewer": "latest",
|
|
46
|
-
"@kitware/vtk.js": "33.3.0",
|
|
47
|
-
"@mdi/font": "7.4.47",
|
|
48
|
-
"@pinia/nuxt": "0.11.3",
|
|
49
|
-
"@types/node": "22.15.3",
|
|
50
|
-
"@vueuse/components": "13.1.0",
|
|
51
|
-
"@vueuse/nuxt": "13.1.0",
|
|
52
|
-
"ajv": "8.17.1",
|
|
53
|
-
"get-port-please": "3.2.0",
|
|
54
|
-
"is-electron": "2.2.2",
|
|
55
|
-
"js-file-download": "0.4.12",
|
|
56
|
-
"nuxt": "4.2.2",
|
|
57
|
-
"pinia": "3.0.4",
|
|
58
|
-
"sass": "1.87.0",
|
|
59
|
-
"semver": "7.7.1",
|
|
60
|
-
"uuid": "11.1.0",
|
|
61
|
-
"vue3-carousel": "0.3.4",
|
|
62
|
-
"vuetify": "3.10.11",
|
|
63
|
-
"ws": "8.18.3",
|
|
64
|
-
"wslink": "1.12.4"
|
|
65
|
-
},
|
|
66
71
|
"repository": {
|
|
67
72
|
"type": "git",
|
|
68
73
|
"url": "git+https://github.com/Geode-solutions/OpenGeodeWeb-Front.git"
|
|
@@ -40,9 +40,11 @@ async function setupIntegrationTests(file_name, geode_object) {
|
|
|
40
40
|
const microservices_path = path.join("tests", "integration", "microservices")
|
|
41
41
|
const project_folder_path = path.join(data_folder, uuidv4())
|
|
42
42
|
const upload_folder_path = path.join(__dirname, "data", "uploads")
|
|
43
|
-
const back_path = executable_path(path.join(microservices_path, "back"))
|
|
43
|
+
const back_path = await executable_path(path.join(microservices_path, "back"))
|
|
44
44
|
const back_name = executable_name("opengeodeweb-back")
|
|
45
|
-
const viewer_path = executable_path(
|
|
45
|
+
const viewer_path = await executable_path(
|
|
46
|
+
path.join(microservices_path, "viewer"),
|
|
47
|
+
)
|
|
46
48
|
const viewer_name = executable_name("opengeodeweb-viewer")
|
|
47
49
|
const [back_port, viewer_port] = await Promise.all([
|
|
48
50
|
run_back(back_name, back_path, {
|