chore(frontend): integrate SQLite Web Worker and improve debug initialization

- Added `sqlite.worker.js` for custom SQLite Web Worker setup compatible with SQLDelight.
- Enhanced Webpack configuration in `sqlite-config.js` for SQLite-related assets and dynamic path resolution.
- Updated Koin `apiClient` setup to dynamically inject Authorization headers using the `HttpSend` plugin.
- Fixed Keycloak realm configuration to include new local URLs (`http://localhost:8080`).
- Removed redundant Web Worker copy tasks from Gradle and adjusted Kotlin code for streamlined worker creation.
This commit is contained in:
2026-01-26 22:02:13 +01:00
parent 3e587381ed
commit bddeba81be
7 changed files with 346 additions and 184 deletions
@@ -109,34 +109,6 @@ kotlin {
}
}
// ---------------------------------------------------------------------------
// SQLDelight WebWorker (OPFS) resource
// ---------------------------------------------------------------------------
// `:frontend:core:local-db` ships `sqlite.worker.js` as a JS resource.
// We need to ensure this worker file is available in the output directory so the browser can load it.
// The WASM file itself is handled by Webpack (via CopyWebpackPlugin in webpack.config.d/sqlite-config.js).
val copySqliteWorkerToWebpackSource by tasks.registering(Copy::class) {
val localDb = project(":frontend:core:local-db")
dependsOn(localDb.tasks.named("jsProcessResources"))
from(localDb.layout.buildDirectory.file("processedResources/js/main/sqlite.worker.js"))
// Root build directory where Kotlin JS packages are assembled.
// This is one of the directories served by webpack-dev-server for static content.
into(rootProject.layout.buildDirectory.dir("js/packages/${rootProject.name}-frontend-shells-meldestelle-portal/kotlin"))
}
// Ensure the worker is present for the development bundle.
tasks.named("jsBrowserDevelopmentWebpack") {
dependsOn(copySqliteWorkerToWebpackSource)
}
// Ensure the worker is present for the production bundle.
tasks.named("jsBrowserProductionWebpack") {
dependsOn(copySqliteWorkerToWebpackSource)
}
// KMP Compile-Optionen
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
compilerOptions {