Releases: xxfast/KStore
Releases · xxfast/KStore
0.9.1
What's Changed
- Fix .temp file not found issue while deleting. by @SultanArshad in #135
New Contributors
- @SultanArshad made their first contribution in #135
Full Changelog: 0.9.0...0.9.1
0.9.0
What's Changed
- Migrate to kotlinx-io by @mani1232 & @xxfast in #112 & #116
- Add transactions to file writes and restore files to previous state when transactions fail by @xxfast in #100
Add directories initialiser and tests by @xxfast in #132- Fix FileCodec by @forhad013 in #133
New Contributors
- @mani1232 made their first contribution in #112
- @forhad013 made their first contribution in #133
Full Changelog: 0.8.0...0.9.0
⚠️ Breaking Changes
- Bump kstore to
0.9.0
and removeokio
from your dependencies from yourlibs.version.toml
[versions]
- kstore = "0.8.0"
+ kstore = "0.9.0"
- okio = "3.6.0"
- If you are using
kstore-file
, migrate tokotlinx-io
'sPath
fromokio
's.toPath()
- import okio.Path.Companion.toPath
+ import kotlinx.io.files.Path
- val store: KStore<Pet> = storeOf(file = "saved.json".toPath())
+ val store: KStore<Pet> = storeOf(file = Path("saved.json"))
- On iOS - Remove the use of experimental
DocumentDirectory
API, and use NSFileManager directly
- val filesDir: String = NSFileManager.defaultManager.DocumentDirectory?.relativePath
+ val filesUrl: NSURL? = fileManager.URLForDirectory(
+ directory = NSDocumentDirectory,
+ appropriateForURL = null,
+ create = false,
+ inDomain = NSUserDomainMask,
+ error = null
+ )
+
+ val path: String = requireNotNull(filesUrl?.path) { "Documents directory not found" }
- val files = filesDirectory.toPath()
+ val files = Path(path)
- On Desktop - If you are using harawata/appdirs, make sure to create those directories if they don't already exist. The store won't create them for you
+ val filesDir: String = AppDirsFactory.getInstance()
+ .getUserDataDir("io.github.xxfast.nytimes", "1.0.0", "xxfast") // or whereever
+ val path = Path(filesDir)
+ with(SystemFileSystem) { if(!exists(path)) createDirectories(path) }
val store: KStore<Pet> = storeOf(file = path)
Example Migration
Full Documentation
0.8.0
0.7.2
What's Changed
- Lock initial read in onStart by @zacharee #77
- Bump kotlinx-serialization from 1.6.1 to 1.6.2 by @dependabot in #75
- enhance/fix_readme_code_sample by @ranger163 in #82
- Bump kotlin from 1.9.21 to 1.9.22 by @dependabot in #83
- Bump okio from 3.6.0 to 3.7.0 by @dependabot in #81
- Bump okio from 3.7.0 to 3.9.0 by @dependabot in #94
New Contributors
- @ranger163 made their first contribution in #82
- @zacharee made their first contribution in #77
Full Changelog: 0.7.1...0.7.2
0.7.1
0.7.0
What's Changed
- Bump kotlinx-coroutines from 1.7.0-RC to 1.7.0 by @dependabot in #45
- Bump com.android.tools.build:gradle from 8.0.0 to 8.0.1 by @dependabot in #46
- Refactor move collection extensions to kstore by @xxfast in #47
- Bump app.cash.turbine:turbine from 0.12.3 to 0.13.0 by @dependabot in #49
- Bump kotlinx-coroutines from 1.7.0 to 1.7.1 by @dependabot in #50
- Bump kotlinx-serialization from 1.5.0 to 1.5.1 by @dependabot in #48
- Bump com.android.tools.build:gradle from 8.0.1 to 8.0.2 by @dependabot in #52
- Bump org.jetbrains.kotlinx.binary-compatibility-validator from 0.13.1 to 0.13.2 by @dependabot in #53
- Bump app.cash.turbine:turbine from 0.13.0 to 1.0.0 by @dependabot in #57
- Bump okio from 3.3.0 to 3.4.0 by @dependabot in #60
- Bump kotlin, coroutines, serialization and okio by @xxfast in #68
- Refactor kstore-file api to remove string filePaths by @xxfast in #69
- Add documentation by @xxfast in #70
Full Changelog: 0.6.0...0.7.0
0.6.0
What's Changed
- Bump app.cash.turbine:turbine from 0.12.1 to 0.12.3 by @dependabot in #33
- Bump to kotlin 1.8.20 by @xxfast in #35
- Add gradle version catalog by @xxfast in #36
- Bump com.android.tools.build:gradle from 7.4.2 to 8.0.0 by @dependabot in #37
- Bump org.jetbrains.kotlinx.binary-compatibility-validator from 0.13.0 to 0.13.1 by @dependabot in #39
- Bump kotlin from 1.8.20 to 1.8.21 by @dependabot in #40
- Switch to new native IO dispatcher by @xxfast in #42
- Remove KFolder api and tests by @xxfast in #43
- Bump junit-jupiter from 5.9.2 to 5.9.3 by @dependabot in #41
Full Changelog: 0.5.0...0.6.0
⚠️ Breaking Changes
KFolder
removed!
0.5.0
What's Changed
- Add browser support 🌐
- Extract encoder and decoders into a codec by @xxfast in #30
- Add kstore-file and kstore-storage modules by @xxfast in #31
Full Changelog: 0.4.0...0.5.0
⚠️ Breaking Changes
encoder
anddecoder
that theKStore
constructor took in now encapsulated as aCodec
storeOf
factory method moved fromkstore
tokstore-file
/kstore-storage
- Removed
DefaultCodec
and replaced withFileCodec
inkstore-file
for file-based encoding/decodingStorageCodec
inkstore-storage
for key-value storage-based encoding/decoding
0.4.0
What's Changed
- Enable explicit api mode by @xxfast in #19
- Bump org.jetbrains.kotlinx.binary-compatibility-validator from 0.12.1 to 0.13.0 by @dependabot in #20
- Bump org.jetbrains.kotlinx:kotlinx-serialization-json-okio from 1.4.1 to 1.5.0 by @dependabot in #22
- Bump org.jetbrains.kotlinx:kotlinx-serialization-json from 1.4.1 to 1.5.0 by @dependabot in #23
- Fix store encoder to create a folder if it doesn't exist by @xxfast in #24
- Bump org.jetbrains.dokka from 1.7.20 to 1.8.10 by @dependabot in #26
- Bump com.android.tools.build:gradle from 7.4.1 to 7.4.2 by @dependabot in #25
- Add sample git submodule by @xxfast in #27
- Refactor move exception handling to the decoder by @xxfast in #28
⚠️ Breaking Changes
The store will now throw SerializationException
when decoding a malformed file.
- If you want to handle migrations, see migrations
- If you want the previous behavior, write your own decoder with safe handling behavior (example)
Full Changelog: 0.3.0...0.4.0
0.3.0
What's Changed
- Add documentation by @xxfast in #11
- Bump org.junit.jupiter:junit-jupiter-engine from 5.8.1 to 5.9.2 by @dependabot in #14
- Bump org.junit.jupiter:junit-jupiter-api from 5.8.1 to 5.9.2 by @dependabot in #15
- Bump app.cash.turbine:turbine from 0.12.0 to 0.12.1 by @dependabot in #17
- Bump org.jetbrains.kotlin:kotlin-gradle-plugin from 1.8.0 to 1.8.10 by @dependabot in #18
- Bump org.jetbrains.kotlin:kotlin-serialization from 1.8.0 to 1.8.10 by @dependabot in #16
- Add cached delegate to get cached value synchronously by @xxfast in #13
New Contributors
- @dependabot made their first contribution in #14 🤖
Full Changelog: 0.2.0...0.3.0