From e34a444373c5312c2ce45cd1f59676435c6f628f Mon Sep 17 00:00:00 2001 From: MoCoAt Date: Wed, 8 Oct 2025 16:00:51 +0200 Subject: [PATCH] fixing Frontend Problem --- clients/shared/build.gradle.kts | 15 ++- clients/shared/common-ui/build.gradle.kts | 12 ++- core/core-domain/build.gradle.kts | 4 +- .../mocode/core/domain/BaseDomainEventTest.kt | 12 +-- .../at/mocode/core/domain/SerializersTest.kt | 4 +- core/core-utils/build.gradle.kts | 10 +- kotlin-js-store/yarn.lock | 93 ++++++++++++++++++- 7 files changed, 129 insertions(+), 21 deletions(-) diff --git a/clients/shared/build.gradle.kts b/clients/shared/build.gradle.kts index 7843a925..52761a9c 100644 --- a/clients/shared/build.gradle.kts +++ b/clients/shared/build.gradle.kts @@ -1,6 +1,7 @@ -@file:OptIn(ExperimentalKotlinGradlePluginApi::class) +@file:OptIn(ExperimentalKotlinGradlePluginApi::class, ExperimentalWasmDsl::class) import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi +import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.JvmTarget /** @@ -35,6 +36,10 @@ kotlin { sourceSets { commonMain.dependencies { + + api(projects.core.coreUtils) + api(projects.core.coreDomain) + // Kotlinx core dependencies (coroutines, serialization, datetime) implementation(libs.bundles.kotlinx.core) @@ -52,8 +57,8 @@ kotlin { implementation(libs.kotlinx.coroutines.test) } - jsMain.dependencies { - implementation(libs.ktor.client.js) + jvmMain.dependencies { + implementation(libs.ktor.client.cio) // Compose für shared UI components implementation(compose.runtime) @@ -61,8 +66,8 @@ kotlin { implementation(compose.material3) } - jvmMain.dependencies { - implementation(libs.ktor.client.cio) + jsMain.dependencies { + implementation(libs.ktor.client.js) // Compose für shared UI components implementation(compose.runtime) diff --git a/clients/shared/common-ui/build.gradle.kts b/clients/shared/common-ui/build.gradle.kts index bc9e494f..0b71a20b 100644 --- a/clients/shared/common-ui/build.gradle.kts +++ b/clients/shared/common-ui/build.gradle.kts @@ -6,6 +6,8 @@ plugins { } kotlin { + val enableWasm = providers.gradleProperty("enableWasm").orNull == "true" + jvmToolchain(21) jvm() @@ -13,9 +15,13 @@ kotlin { browser() nodejs() } - @OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) - wasmJs { - browser() + + // WASM, nur wenn explizit aktiviert + if (enableWasm) { + @OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) + wasmJs { + browser() + } } sourceSets { diff --git a/core/core-domain/build.gradle.kts b/core/core-domain/build.gradle.kts index 2439d896..8cf8dcb4 100644 --- a/core/core-domain/build.gradle.kts +++ b/core/core-domain/build.gradle.kts @@ -28,8 +28,8 @@ kotlin { commonMain.dependencies { // Core dependencies (that aren't included in platform-dependencies) - api(projects.core.coreUtils) - api(projects.core.coreDomain) + // Note: core-domain should NOT depend on core-utils to avoid circular dependencies + // core-utils depends on core-domain, not the other way around // Serialization and date-time for commonMain api(libs.kotlinx.serialization.json) diff --git a/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/BaseDomainEventTest.kt b/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/BaseDomainEventTest.kt index 7bcb3e24..ca1b0523 100644 --- a/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/BaseDomainEventTest.kt +++ b/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/BaseDomainEventTest.kt @@ -2,10 +2,10 @@ package at.mocode.core.domain import at.mocode.core.domain.event.BaseDomainEvent import at.mocode.core.domain.model.* -import com.benasher44.uuid.uuid4 import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull +import kotlin.uuid.Uuid @OptIn(kotlin.time.ExperimentalTime::class) class BaseDomainEventTest { @@ -27,7 +27,7 @@ class BaseDomainEventTest { @Test fun `secondary constructor generates id and timestamp`() { - val aggId = AggregateId(uuid4()) + val aggId = AggregateId(Uuid.random()) val ev = object : BaseDomainEvent( aggregateId = aggId, eventType = EventType("TestEvent"), @@ -43,8 +43,8 @@ class BaseDomainEventTest { @Test fun `primary constructor uses provided id and timestamp`() { - val aggId = AggregateId(uuid4()) - val eid = EventId(uuid4()) + val aggId = AggregateId(Uuid.random()) + val eid = EventId(Uuid.random()) val ts = kotlin.time.Instant.parse("2025-01-01T00:00:00Z") val base = object : BaseDomainEvent( aggregateId = aggId, @@ -52,8 +52,8 @@ class BaseDomainEventTest { version = EventVersion(2), eventId = eid, timestamp = ts, - correlationId = CorrelationId(uuid4()), - causationId = CausationId(uuid4()) + correlationId = CorrelationId(Uuid.random()), + causationId = CausationId(Uuid.random()) ) {} assertEquals(eid, base.eventId) diff --git a/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/SerializersTest.kt b/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/SerializersTest.kt index 53040938..fa40de62 100644 --- a/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/SerializersTest.kt +++ b/core/core-domain/src/commonTest/kotlin/at/mocode/core/domain/SerializersTest.kt @@ -1,13 +1,13 @@ package at.mocode.core.domain import at.mocode.core.domain.serialization.* -import com.benasher44.uuid.uuid4 import kotlinx.datetime.LocalDate import kotlinx.datetime.LocalDateTime import kotlinx.datetime.LocalTime import kotlinx.serialization.json.Json import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.uuid.Uuid @OptIn(kotlin.time.ExperimentalTime::class) class SerializersTest { @@ -22,7 +22,7 @@ class SerializersTest { @Test fun `UUID roundtrip`() { - val uuid = uuid4() + val uuid = Uuid.random() val json = Json.encodeToString(UuidSerializer, uuid) val decoded = Json.decodeFromString(UuidSerializer, json) assertEquals(uuid, decoded) diff --git a/core/core-utils/build.gradle.kts b/core/core-utils/build.gradle.kts index 0d48f8dd..f093dbfa 100644 --- a/core/core-utils/build.gradle.kts +++ b/core/core-utils/build.gradle.kts @@ -2,6 +2,7 @@ // wie z.B. Konfigurations-Management, Datenbank-Verbindungen und Service Discovery. plugins { alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.kotlinSerialization) } kotlin { @@ -23,9 +24,16 @@ kotlin { } sourceSets { + all { + languageSettings.optIn("kotlin.uuid.ExperimentalUuidApi") + } + commonMain.dependencies { - // Dependency on core-domain module to use its types + // Domain models and types (core-utils depends on core-domain, not vice versa) api(projects.core.coreDomain) + + api(libs.kotlinx.serialization.json) + api(libs.kotlinx.datetime) // Async support (available for all platforms) api(libs.kotlinx.coroutines.core) // Utilities (multiplatform compatible) diff --git a/kotlin-js-store/yarn.lock b/kotlin-js-store/yarn.lock index 9646727e..df6871aa 100644 --- a/kotlin-js-store/yarn.lock +++ b/kotlin-js-store/yarn.lock @@ -845,6 +845,25 @@ cross-spawn@^7.0.3, cross-spawn@^7.0.6: shebang-command "^2.0.0" which "^2.0.1" +css-loader@7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/css-loader/-/css-loader-7.1.2.tgz#64671541c6efe06b0e22e750503106bdd86880f8" + integrity sha512-6WvYYn7l/XEGN8Xu2vWFt9nVzrCn39vKyTEFf/ExEyoksJjjSZV/0/35XPlMbpnr6VGhZIUg5yJrL8tGfes/FA== + dependencies: + icss-utils "^5.1.0" + postcss "^8.4.33" + postcss-modules-extract-imports "^3.1.0" + postcss-modules-local-by-default "^4.0.5" + postcss-modules-scope "^3.2.0" + postcss-modules-values "^4.0.0" + postcss-value-parser "^4.2.0" + semver "^7.5.4" + +cssesc@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" + integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== + custom-event@~1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/custom-event/-/custom-event-1.0.1.tgz#5d02a46850adf1b4a317946a3928fccb5bfd0425" @@ -1486,6 +1505,11 @@ iconv-lite@^0.6.3: dependencies: safer-buffer ">= 2.1.2 < 3.0.0" +icss-utils@^5.0.0, icss-utils@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" + integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== + import-local@^3.0.2: version "3.2.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260" @@ -1968,6 +1992,11 @@ multicast-dns@^7.2.5: dns-packet "^5.2.2" thunky "^1.0.2" +nanoid@^3.3.11: + version "3.3.11" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.11.tgz#4f4f112cefbe303202f2199838128936266d185b" + integrity sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w== + negotiator@0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" @@ -2151,6 +2180,56 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +postcss-modules-extract-imports@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz#b4497cb85a9c0c4b5aabeb759bb25e8d89f15002" + integrity sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q== + +postcss-modules-local-by-default@^4.0.5: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz#d150f43837831dae25e4085596e84f6f5d6ec368" + integrity sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw== + dependencies: + icss-utils "^5.0.0" + postcss-selector-parser "^7.0.0" + postcss-value-parser "^4.1.0" + +postcss-modules-scope@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz#1bbccddcb398f1d7a511e0a2d1d047718af4078c" + integrity sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA== + dependencies: + postcss-selector-parser "^7.0.0" + +postcss-modules-values@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz#d7c5e7e68c3bb3c9b27cbf48ca0bb3ffb4602c9c" + integrity sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ== + dependencies: + icss-utils "^5.0.0" + +postcss-selector-parser@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-7.1.0.tgz#4d6af97eba65d73bc4d84bcb343e865d7dd16262" + integrity sha512-8sLjZwK0R+JlxlYcTuVnyT2v+htpdrjDOKuMcOVdYjt52Lh8hWRYpxBPoKx/Zg+bcjc3wx6fmQevMmUztS/ccA== + dependencies: + cssesc "^3.0.0" + util-deprecate "^1.0.2" + +postcss-value-parser@^4.1.0, postcss-value-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz#723c09920836ba6d3e5af019f92bc0971c02e514" + integrity sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ== + +postcss@^8.4.33: + version "8.5.6" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.5.6.tgz#2825006615a619b4f62a9e7426cc120b349a8f3c" + integrity sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg== + dependencies: + nanoid "^3.3.11" + picocolors "^1.1.1" + source-map-js "^1.2.1" + process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -2349,6 +2428,11 @@ selfsigned@^2.4.1: "@types/node-forge" "^1.3.0" node-forge "^1" +semver@^7.5.4: + version "7.7.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" + integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== + send@0.19.0: version "0.19.0" resolved "https://registry.yarnpkg.com/send/-/send-0.19.0.tgz#bbc5a388c8ea6c048967049dbeac0e4a3f09d7f8" @@ -2515,7 +2599,7 @@ sockjs@^0.3.24: uuid "^8.3.2" websocket-driver "^0.7.4" -source-map-js@^1.0.2: +source-map-js@^1.0.2, source-map-js@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.1.tgz#1ce5650fddd87abc099eda37dcff024c2667ae46" integrity sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA== @@ -2634,6 +2718,11 @@ strip-json-comments@^3.1.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +style-loader@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/style-loader/-/style-loader-4.0.0.tgz#0ea96e468f43c69600011e0589cb05c44f3b17a5" + integrity sha512-1V4WqhhZZgjVAVJyt7TdDPZoPBPNHbekX4fWnCJL1yQukhCeZhJySUL+gL9y6sNdN95uEOS83Y55SqHcP7MzLA== + supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -2752,7 +2841,7 @@ update-browserslist-db@^1.1.3: escalade "^3.2.0" picocolors "^1.1.1" -util-deprecate@^1.0.1, util-deprecate@~1.0.1: +util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==