Keystone
net.zagart.keystone — module: core
Module
| Module | Artifact | Targets |
:core | net.zagart.keystone:core | Android, JVM, iOS |
Installation
commonMain.dependencies {
implementation("net.zagart.keystone:core:X.Y.Z")
}
Basic Usage
val storage = Keystone.Storage.create(name = "my_app")
storage.putString("user", "name", "Alice")
storage.putBoolean("user", "notifications", true)
val name = storage.getString("user", "name", default = "Guest")
storage.observe("user") {
string("name")
boolean("notifications")
}.collect { snapshot ->
updateUI(snapshot)
}
Features
| Feature | Details |
| Scope-based storage | Organize data into named scopes (e.g. "settings", "user_profile") |
| Reactive observation | Observe changes via Flow<Snapshot> using the DSL builder |
| Entity persistence | @Entity-annotated classes persisted via SQLDelight with @Embedded flattening |
| Type-safe keys | Define keys and defaults using ObservationBuilder DSL |
| Compose-agnostic | Pure Kotlin — no Compose dependency |
Platform Notes
| Platform | create() context |
| Android | Requires Context as platformContext |
| iOS | platformContext = null |
| JVM | platformContext = null |
Versioning & Releases
Follows Semantic Versioning.
- Update
version in core/build.gradle.kts
- Run
./gradlew :core:publish
- Release from the Sonatype staging UI
- Tag and push:
git tag vX.Y.Z && git push origin vX.Y.Z