mirror of
https://github.com/AdrianKuta/Tree-Data-Structure.git
synced 2026-06-19 19:00:14 +02:00
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:
32
README.md
32
README.md
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user