ci: binary-compat API baselines, multiplatform matrix CI, module docs

- Commit binary-compatibility-validator .api baselines for core + both modules.
- Replace JVM-only CI with a matrix: Ubuntu runs JVM/JS(node)/Wasm(node)/Native
  + apiCheck; macOS runs the iOS simulator tests.
- README: install + usage for tree-structure-serialization and -coroutines.
- Update kotlin-js-store/yarn.lock for the new modules' JS test deps.

Verified locally: JVM, JS(node), Wasm(node) and iOS-simulator tests pass for
core + both modules; native compiles & links (exec runs on the Linux CI runner).
This commit is contained in:
2026-06-06 13:51:22 +02:00
parent e1f01c4e2d
commit c9bbea59b0
6 changed files with 483 additions and 283 deletions

View File

@@ -169,6 +169,38 @@ val copy = tree.deepCopy()
tree.structurallyEquals(copy) // true (same values, same shape, different nodes)
```
## Optional modules
The core `tree-structure` artifact has no third-party dependencies. Ecosystem integrations ship as
separate, opt-in artifacts that depend on the core.
### Serialization — `tree-structure-serialization`
`kotlinx.serialization` support. A `TreeNode` holds a parent back-reference (a cycle), so it cannot
be `@Serializable` directly — convert to/from the acyclic `TreeNodeDto` instead.
```kotlin
implementation("com.github.adriankuta:tree-structure-serialization:3.4.0")
```
```kotlin
val json = Json.encodeToString(tree.toDto())
val restored = Json.decodeFromString<TreeNodeDto<String>>(json).toTreeNode()
```
### Coroutines — `tree-structure-coroutines`
Traverse a tree as a cold `Flow` (handy in coroutine/`ViewModel` pipelines).
```kotlin
implementation("com.github.adriankuta:tree-structure-coroutines:3.4.0")
```
```kotlin
tree.preOrderFlow().collect { println(it.value) }
tree.asFlow(TreeNodeIterators.LevelOrder).map { it.value }
```
## Publishing to Maven Central (central.sonatype.com)
This project is configured to publish artifacts to Maven Central via the Sonatype Central Portal.