Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4117bc0
install config
JulienChampagnol Jan 18, 2026
448cca4
test dynamic imports [skip ci]
JulienChampagnol Jan 19, 2026
5c92839
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Jan 19, 2026
06ac061
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Jan 20, 2026
69d3058
save [skip ci]
JulienChampagnol Jan 20, 2026
7947bee
save wip
JulienChampagnol Jan 30, 2026
af2cd8c
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Feb 9, 2026
5cacd6f
cleanup imports
JulienChampagnol Feb 11, 2026
2c62ee4
wip unzip extension [skip ci]
JulienChampagnol Feb 11, 2026
814eaba
wip js transform archive [skip ci]
JulienChampagnol Feb 12, 2026
7f2d293
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Feb 16, 2026
eef8c26
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Feb 16, 2026
d675a7c
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Feb 17, 2026
5cdbcf5
unzip in projectFolderPath
JulienChampagnol Feb 17, 2026
41c37e5
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Feb 18, 2026
debd97b
uploadExtension
JulienChampagnol Feb 19, 2026
ab0d9d4
cleanup [skip ci]
JulienChampagnol Feb 19, 2026
d05084d
fixed dependency
JulienChampagnol Feb 19, 2026
ebf2d62
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Feb 19, 2026
510a950
test separate conf
JulienChampagnol Feb 20, 2026
45693d3
save wip [skip ci]
JulienChampagnol Feb 25, 2026
93a6850
wip launch microservices [skip ci]
JulienChampagnol Feb 26, 2026
1cd4306
wip launch microservices [skip ci]
JulienChampagnol Feb 26, 2026
dc9f5c9
microservices running [skip ci]
JulienChampagnol Feb 27, 2026
dcbbc23
save wip [skip ci]
JulienChampagnol Feb 27, 2026
a3b2356
Merge branch 'next' of https://github.com/Geode-solutions/OpenGeodeWe…
JulienChampagnol Feb 27, 2026
ed071d1
Apply prepare changes
JulienChampagnol Feb 27, 2026
c03b69b
save wip [skip ci]
JulienChampagnol Mar 2, 2026
19cc202
Merge branch 'feat/extensions_config' of https://github.com/Geode-sol…
JulienChampagnol Mar 2, 2026
d21b2dd
integration tests okay
JulienChampagnol Mar 3, 2026
4b02640
Apply prepare changes
JulienChampagnol Mar 3, 2026
a7fd4df
tests integration okay
JulienChampagnol Mar 3, 2026
db5e128
Merge branch 'feat/extensions_config' of https://github.com/Geode-sol…
JulienChampagnol Mar 3, 2026
577d697
test revert deps
JulienChampagnol Mar 3, 2026
65d16ca
cleanup, tests okay
JulienChampagnol Mar 3, 2026
461f15a
Apply prepare changes
JulienChampagnol Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 69 additions & 7 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,96 @@
"style": "error",
"restriction": "error"
},
"plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest"],
"plugins": ["import", "node", "oxc", "promise", "unicorn", "vitest", "vue"],
"rules": {
"unicorn/filename-case": [
"error",
{
"case": "snakeCase"
}
],
"eslint/func-style": [
"eslint/func-style": ["error", "declaration"],
"eslint/sort-keys": "off",
"eslint/no-ternary": "off", // A utiliser pour des opérations simples
"oxc/no-async-await": "off",
"oxc/no-rest-spread-properties": "off", // Enable if older browser support is needed
"eslint/max-statements": ["warn", 20],
"eslint/id-length": [
"error",
{
"style:": "declaration"
"exceptions": [
"x",
"y",
"z",
"i",
"j",
"k",
"r",
"g",
"b",
"id",
"ID",
"fs",
"os"
],
"min": 3
}
],
"eslint/sort-keys": "off",
"eslint/no-ternary": "off"
"eslint/no-console": "warn", // Disable for debugging. Disable later to not have browser logs
"sort-imports": ["error", { "allowSeparatedGroups": true }],
"eslint/no-undefined": "off", // Conflict with unicorn/no-typeof-undefined which prefers direct undefined comparison
"import/prefer-default-export": "off",
"import/no-named-export": "off",
"import/no-namespace": ["error", { "ignore": ["vuetify/*"] }],
"vue/max-props": ["error", { "maxProps": 8 }],
"oxc/no-optional-chaining": "off",
"node/no-process-env": "off",
"no-continue": "off",
"import/unambiguous": "off",
"max-params": ["warn", { "max": 4 }],
"eslint/no-magic-numbers": [
"error",
{
"ignore": [-1, 0, 1, 2, 3, 4],
"ignoreArrayIndexes": true
}
]
},
"overrides": [
{
"files": ["**/components/*"],
"files": ["**/components/**"],
"rules": {
"unicorn/filename-case": [
"error",
{
"case": "PascalCase"
"case": "pascalCase"
}
]
}
},
{
"files": [
"app/plugins/**",
"node_scripts/**",
"server/**",
"*.config.js"
],
"rules": {
"import/no-default-export": "off"
}
},
{
"files": ["tests/**"],
"rules": {
"vitest/require-hook": "off",
"vitest/no-hooks": "off"
}
},
{
"files": ["**/preload.js"],
"rules": {
"import/no-commonjs": "off"
}
}
]
}
9 changes: 4 additions & 5 deletions app/components/FileUploader.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
<script setup>
import DragAndDrop from "@ogw_front/components/DragAndDrop"
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
import { upload_file } from "@ogw_front/utils/upload_file"

const schema = schemas.opengeodeweb_back.upload_file
import { useGeodeStore } from "@ogw_front/stores/geode"

const emit = defineEmits(["files_uploaded", "decrement_step", "reset_values"])

Expand All @@ -15,6 +12,8 @@
mini: { type: Boolean, required: false, default: false },
})

const geodeStore = useGeodeStore()

const internal_files = ref(files)
const loading = ref(false)
const files_uploaded = ref(false)
Expand All @@ -40,7 +39,7 @@
async function upload_files() {
toggle_loading()
const promise_array = internal_files.value.map((file) =>
upload_file({ route: schema.$id, file }),
geodeStore.upload(file),
)
await Promise.all(promise_array)
files_uploaded.value = true
Expand Down
94 changes: 91 additions & 3 deletions app/stores/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
import { upload_file } from "../../internal/utils/upload_file.js"
import { api_fetch } from "../../internal/utils/api_fetch.js"
import { appMode } from "@ogw_front/utils/app_mode"
import { useInfraStore } from "@ogw_front/stores/infra"

// import { initMicroservicesMetadatas } from "@ogw_front/utils/local/microservices.js"

export const useAppStore = defineStore("app", () => {
const stores = []

Expand Down Expand Up @@ -108,8 +115,7 @@ export const useAppStore = defineStore("app", () => {
})
finalURL = URL.createObjectURL(newBlob)
}

const extensionModule = await import(finalURL)
const extensionModule = await import(/* @vite-ignore */ finalURL)

if (finalURL !== path && finalURL.startsWith("blob:")) {
URL.revokeObjectURL(finalURL)
Expand Down Expand Up @@ -145,7 +151,6 @@ export const useAppStore = defineStore("app", () => {
loadedExtensions.value.set(extensionId, extensionData)

console.log(`[AppStore] Extension loaded successfully: ${extensionId}`)

return extensionModule
} else {
throw new Error("Extension must export an install function")
Expand Down Expand Up @@ -217,6 +222,83 @@ export const useAppStore = defineStore("app", () => {
return getExtension(id)?.enabled ?? false
}

function upload(file, callbacks = {}) {
const route = "/api/extensions"
const store = useAppStore()
return upload_file(
store,
{ route, file },
{
...callbacks,
response_function: async (response) => {
console.log("[APP] Request completed:", route)
if (callbacks.response_function) {
await callbacks.response_function(response)
}
},
},
)
}

function request(schema, params, callbacks = {}) {
console.log("[APP] Request:", schema.$id)

const store = useAppStore()
return api_fetch(
store,
{ schema, params },
{
...callbacks,
response_function: async (response) => {
console.log("[APP] Request completed:", schema.$id)
if (callbacks.response_function) {
await callbacks.response_function(response)
}
},
},
)
}

const request_counter = ref(0)
function start_request() {
request_counter.value += 1
}
function stop_request() {
request_counter.value -= 1
}

const projectFolderPath = ref("")
function createProjectFolder() {
const { PROJECT } = useRuntimeConfig().public
const schema = {
$id: "/api/app/project_folder_path",
methods: ["POST"],
type: "object",
properties: {
PROJECT: { type: "string" },
},
required: ["PROJECT"],
additionalProperties: true,
}
const params = { PROJECT }

console.log(createProjectFolder.name, { PROJECT })

return request(schema, params, {
response_function: async (response) => {
console.log("[GEODE] Request completed:", { response })
projectFolderPath.value = response.projectFolderPath

if (useInfraStore().app_mode !== appMode.CLOUD) {
// await initMicroservicesMetadatas(
// path.join(projectFolderPath.value, "microservices.json"),
// )
}
console.log("[GEODE] Back launched")
},
})
}

return {
stores,
registerStore,
Expand All @@ -233,5 +315,11 @@ export const useAppStore = defineStore("app", () => {
toggleExtension,
setExtensionEnabled,
getExtensionEnabled,
request,
upload,
projectFolderPath,
createProjectFolder,
start_request,
stop_request,
}
})
68 changes: 61 additions & 7 deletions app/stores/geode.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { appMode } from "@ogw_front/utils/app_mode"
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json"
import { useFeedbackStore } from "@ogw_front/stores/feedback"
import { useInfraStore } from "@ogw_front/stores/infra"
import { useAppStore } from "@ogw_front/stores/app"
import { upload_file } from "../../internal/utils/upload_file.js"

const MILLISECONDS_IN_SECOND = 1000
const DEFAULT_PING_INTERVAL_SECONDS = 10
Expand All @@ -25,10 +27,6 @@ export const useGeodeStore = defineStore("geode", {
if (useInfraStore().app_mode === appMode.CLOUD) {
return "443"
}
const { GEODE_PORT } = useRuntimeConfig().public
if (GEODE_PORT !== null && GEODE_PORT !== "") {
return GEODE_PORT
}
return this.default_local_port
},
base_url() {
Expand All @@ -42,6 +40,12 @@ export const useGeodeStore = defineStore("geode", {
}
return geode_url
},
kill_metadatas() {
return {
url: `${this.base_url}/${back_schemas.opengeodeweb_back.kill.$id}`,
method: back_schemas.opengeodeweb_back.kill.methods[0],
}
},
is_busy() {
return this.request_counter > 0
},
Expand Down Expand Up @@ -81,9 +85,40 @@ export const useGeodeStore = defineStore("geode", {
stop_request() {
this.request_counter -= 1
},
launch() {
console.log("[GEODE] Launching geode microservice...")
return globalThis.electronAPI.run_back()
launch(args) {
console.log("[GEODE] Launching back microservice...", { args })
const appStore = useAppStore()

const { BACK_PATH, BACK_COMMAND } = useRuntimeConfig().public

console.log("[GEODE] BACK_PATH", BACK_PATH)
console.log("[GEODE] BACK_COMMAND", BACK_COMMAND)
const schema = {
$id: "/api/app/run_back",
methods: ["POST"],
type: "object",
properties: {
BACK_PATH: { type: "string" },
BACK_COMMAND: { type: "string" },
},
required: ["BACK_PATH", "BACK_COMMAND"],
additionalProperties: true,
}

const params = {
BACK_PATH,
BACK_COMMAND,
args,
}

console.log("[GEODE] params", params)
return appStore.request(schema, params, {
response_function: (response) => {
console.log("[GEODE] Back launched", { response })
this.default_local_port = response.port
console.log("[GEODE] Back launched", this.default_local_port)
},
})
},
connect() {
console.log("[GEODE] Connecting to geode microservice...")
Expand All @@ -107,6 +142,25 @@ export const useGeodeStore = defineStore("geode", {
},
)
},
upload(file, callbacks = {}) {
const route = back_schemas.opengeodeweb_back.upload_file.$id
return upload_file(
this,
{
route,
file,
},
{
...callbacks,
response_function: async (response) => {
console.log("[GEODE] Request completed:", route)
if (callbacks.response_function) {
await callbacks.response_function(response)
}
},
},
)
},
},
share: {
omit: ["status"],
Expand Down
Loading
Loading