mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-09-17 07:41:53 -04:00
Isolated the exact trigger of the previously-blocking "IllegalStateException:
:core:common is not configured for JS usage" error empirically: it's
webApp's binaries.executable() specifically, not wasmJs { browser() } in
general. Once any module in a multi-project build declares an executable
Kotlin/Wasm binary, KGP's root npm resolver (kotlinWasmNpmInstall)
requires EVERY module reachable from that binary's dependency graph to
also declare browser()/nodejs() -- bare wasmJs() no longer satisfies it.
Retrofitted wasmJs { browser() } onto all 18 wasmJs-enabled modules
(every core:* and feature:* module that previously stayed at bare
wasmJs()). An earlier attempt at this exact retrofit was reverted after
finding it arms wasmJsBrowserTest repo-wide with no karma/headless-Chrome
runner configured -- this time paired with a central disable in
KotlinAndroid.kt's configureKotlinMultiplatform() instead of reverting
the fix that actually solves the resolver conflict.
Two further, adjacent bugs surfaced once wasmJsBrowserTest's runtime
classpath actually existed for the first time (bare wasmJs() never
created one, so neither bug had ever fired before):
- ProjectExtensions.kt's configureTestOptions() was unconditionally
injecting the JVM-only junit-platform-launcher into every
"*TestRuntimeClasspath" configuration, including wasmJs's -- excluded
wasmJs* configurations from that injection.
- Compose Multiplatform's plugin registers
checkComposeUiTestConfigurationForWasmJs unconditionally on every
Compose-enabled module with wasmJs { browser() }, regardless of
whether it has real Compose UI tests (none of ours do) -- disabled
centrally alongside wasmJsBrowserTest.
:webApp:wasmJsBrowserDistribution -- previously never even attempted in
the live build -- now succeeds and produces a real, loadable browser
bundle (webApp/build/dist/wasmJs/productionExecutable/). Getting there
also required relaxing settings.gradle.kts's repositoriesMode from
FAIL_ON_PROJECT_REPOS to PREFER_SETTINGS (a deliberate supply-chain
policy change, not incidental config) plus three settings-level,
content-filtered ivy repos for Kotlin/Wasm's NodeJs/Yarn/Binaryen setup
tasks (nodejs.org/dist, yarnpkg releases, WebAssembly/binaryen releases)
-- those setup tasks register their own project-level ivy repos, which
PREFER_SETTINGS ignores in favor of a settings-declared equivalent
rather than erroring outright the way FAIL_ON_PROJECT_REPOS does. The
content filters on each repo (includeModule) are what preserve
FAIL_ON_PROJECT_REPOS's original centralization intent: every repository
a build can pull from is still declared in exactly one place.
kotlin-js-store/wasm/yarn.lock is KGP's own generated lockfile for the
resolved npm/yarn dependency versions, committed per upstream convention
for reproducible builds.
Full repo baseline gate (spotlessCheck detekt assembleDebug test
allTests) passes clean with :webApp present in the build graph.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
:core:model (Meshtastic Domain Models)
Overview
The :core:model module is a Kotlin Multiplatform (KMP) library containing the domain models and data classes used throughout the application and its API. These models are platform-agnostic and designed to be shared across Android, JVM, and future supported platforms.
Multiplatform Support
Models are plain commonMain Kotlin types — @Serializable (kotlinx.serialization) data classes and
@JvmInline value classes — with no Android Parcelable dependency, so they are shared verbatim
across Android, JVM, and iOS.
Key Models
DataPacket: Represents a mesh packet (text, telemetry, etc.).Node: Contains detailed information about a node (position, SNR, battery, etc.).NodeAddress/ContactKey: Type-safe node addressing (Broadcast/Local/ByNum/ById) and contact-key parsing, replacing stringly-typed"^all"/"!hex"handling.DeviceHardware: Represents supported Meshtastic hardware devices and their capabilities.Channel: Represents a mesh channel configuration.
Usage
This module is a core dependency of most feature modules.
// In commonMain
implementation(projects.core.model)
Structure
commonMain: Contains the majority of domain models and logic.androidMain: Contains Android-specific utilities and implementations forexpectdeclarations.androidUnitTest: Contains unit tests that require Android-specific features (likeParceltesting via Robolectric).
Dependency Graph
graph TB
:core:model[model]:::kmp-library
:core:model --> :core:common
:core:model --> :core:resources
:core:model -.-> :core:testing
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;