detekt's source set list never included src/wasmJsMain or src/nonWebMain,
so every prior "detekt clean" claim in this effort never actually scanned
wasmJs code. Found while adding :webApp (whose entire source lives in
wasmJsMain and reported NO-SOURCE forever) and fixed at the root: both
source sets are now scanned repo-wide. Real findings it surfaced are
suppressed with honest, specific justification (embedded js("...") string
interop that static analysis can't see into) or fixed outright — nothing
silenced to dodge a genuine issue.
core:ble's own compileTestKotlinWasmJs had never actually been exercised:
7 of its 9 commonTest files reference Kable directly, which has no wasmJs
target, so they silently never compiled for wasmJs until this pass tried.
Moved them to a new nonWebTest source set, matching this effort's existing
android/jvm/ios-only test pattern elsewhere.
core:repository had a latent iOS-hierarchy trap: a manual nonWebTest
dependsOn edge (needed once core:testing was pulled out of commonTest)
silently disabled Kotlin's default hierarchy template, which is what wires
iosMain to the leaf iOS compilations. Restored the explicit
applyHierarchyTemplate(default) call alongside the manual edge.
Also tried retrofitting every wasmJs-enabled module to wasmJs { browser() }
to satisfy KGP's root npm resolver ahead of the webApp module (see next
commit) — reverted repo-wide: browser() arms each module's
wasmJsBrowserTest task, which allTests then picks up with no
karma/headless-Chrome runner configured anywhere in this repo, a CI-gate
regression that outweighs the benefit. Every wasmJs-enabled module's
comment now explains this explicitly instead of the stale "that's for the
eventual webApp executable" text, which turned out to be wrong.
core:ui's MeshtasticNavigationSuite gained an optional visibleDestinations
parameter (default: today's full tab set) so a host can hide a tab it has
no entry provider for without a per-platform expect/actual — needed by
webApp, which omits Map.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
core:data ties together core:database, core:datastore, core:di,
core:model, core:network, core:prefs, core:repository (all already
wasmJs-enabled), core:takserver (out of scope, relocated below), and
Room -- the last of which turned out to be the real blocker.
core:takserver's dependency moves to nonWebMain-only: a grep pass
confirmed core:data's own commonMain never actually references
org.meshtastic.tak (the only "TAK" substring matches were the
unrelated PortNum.ATAK_PLUGIN protobuf constant and a code comment),
so this is a mechanical relocation, not a port -- core:takserver
itself stays out of scope (niche ATAK feature).
MqttManagerImpl.kt duplicated the exact TCP+WS transport composition
core:network's MqttTransportSelection.kt already solved for
MQTTRepositoryImpl. Rather than duplicate the platform-selection
logic (and its TCP-exclusion reasoning) a second time, core:network's
mqttTransportFactory drops its `internal` modifier and becomes public;
MqttManagerImpl.kt's one-off probe client now calls it directly.
The real, unpredicted blocker: core:database exposes Room only as
`implementation` in its own commonMain, so RoomDatabase -- the
supertype of MeshtasticDatabase that core:data's repositories reach
through DatabaseProvider -- isn't visible to external consumers on
wasmJs. This never surfaced on android/jvm/iOS because core:data's
own jvmAndroidMain already carries the identical redundant Room
redeclaration, for the same reason, pre-dating this session. Fixed
with a matching wasmJsMain dependency on
androidx.room.runtime/androidx.room.paging (both confirmed to publish
real wasmJs variants; sqlite-bundled stays excluded, native-only and
unrelated to RoomDatabase itself). core:database's own
implementation-vs-api Room exposure would be a cleaner long-term fix
but is out of this pass's scope since nothing else currently needs it.
14 of core:data's 33 commonTest files -- the ones that actually import
core:testing (core:testing itself has no wasmJs target, same gap
core:ble/core:database/core:network hit) -- move to a new nonWebTest
source set; confirmed empirically that core:data's own
compileTestKotlinWasmJs task genuinely needs every commonTest
dependency to resolve, even with no browser()/nodejs() test executor
configured -- this is a real compile-time constraint on every module,
not something a bare wasmJs() sidesteps by omission.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>