chore(frontend+infra): re-enable browser environment for Kotlin JS with NodeJs workaround

- Applied Root NodeJs plugin initialization to resolve Gradle 9/KMP race condition.
- Restored `browser {}` configuration in multiple frontend modules, with JS test tasks disabled to prevent redundant execution.
This commit is contained in:
2026-02-02 20:50:08 +01:00
parent 25f40567c7
commit 92cdd22f1f
10 changed files with 61 additions and 11 deletions
+7 -1
View File
@@ -2,6 +2,7 @@ import groovy.json.JsonSlurper
import io.gitlab.arturbosch.detekt.Detekt import io.gitlab.arturbosch.detekt.Detekt
import io.gitlab.arturbosch.detekt.extensions.DetektExtension import io.gitlab.arturbosch.detekt.extensions.DetektExtension
import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jlleitschuh.gradle.ktlint.KtlintExtension import org.jlleitschuh.gradle.ktlint.KtlintExtension
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
@@ -33,6 +34,10 @@ plugins {
alias(libs.plugins.ktlint) alias(libs.plugins.ktlint)
} }
// Workaround for Gradle 9 / KMP Race Condition:
// Wir erzwingen die Initialisierung des NodeJsRootPlugins im Root-Projekt
apply<NodeJsRootPlugin>()
// ################################################################## // ##################################################################
// ### ALLPROJECTS CONFIGURATION ### // ### ALLPROJECTS CONFIGURATION ###
// ################################################################## // ##################################################################
@@ -252,7 +257,8 @@ tasks.register("checkBundleBudget") {
} }
// Collect JS files under distributions (avoid .map and .txt) // Collect JS files under distributions (avoid .map and .txt)
val jsFiles = distDir.walkTopDown().filter { it.isFile && it.extension == "js" && !it.name.endsWith(".map") }.toList() val jsFiles =
distDir.walkTopDown().filter { it.isFile && it.extension == "js" && !it.name.endsWith(".map") }.toList()
if (jsFiles.isEmpty()) { if (jsFiles.isEmpty()) {
report.appendLine("- ${shell.path}: no JS artifacts found in ${distDir.path}") report.appendLine("- ${shell.path}: no JS artifacts found in ${distDir.path}")
return@forEach return@forEach
+6 -1
View File
@@ -12,7 +12,12 @@ kotlin {
js(IR) { js(IR) {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) @OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class)
+6 -2
View File
@@ -15,8 +15,12 @@ kotlin {
js { js {
binaries.library() binaries.library()
// browser {} block is intentionally removed to prevent "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
// The warning "JS Environment Not Selected" is acceptable for now. browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {
+6 -1
View File
@@ -9,7 +9,12 @@ kotlin {
jvm() jvm()
js(IR) { js(IR) {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {
+6 -1
View File
@@ -12,7 +12,12 @@ kotlin {
jvm() jvm()
js { js {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {
+6 -1
View File
@@ -12,7 +12,12 @@ kotlin {
jvm() jvm()
js { js {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {
+6 -1
View File
@@ -13,7 +13,12 @@ kotlin {
jvm() jvm()
js { js {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {
+6 -1
View File
@@ -12,7 +12,12 @@ kotlin {
jvm() jvm()
js { js {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {
+6 -1
View File
@@ -7,7 +7,12 @@ kotlin {
jvm() jvm()
js(IR) { js(IR) {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {
@@ -17,7 +17,12 @@ kotlin {
jvm() jvm()
js { js {
binaries.library() binaries.library()
// browser {} block removed to fix "Plugin loaded multiple times" error. // Re-enabled browser environment after Root NodeJs fix
browser {
testTask {
enabled = false
}
}
} }
sourceSets { sourceSets {