0.5.2 release

This commit is contained in:
Alexander Nozik 2021-11-30 11:58:23 +03:00
parent 532e0c253b
commit 64e0c554cc
6 changed files with 48 additions and 26 deletions

View File

@ -3,6 +3,22 @@
## [Unreleased] ## [Unreleased]
### Added ### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
## [0.5.2]
### Added
- Yaml plugin
- Partial fix to #53
### Changed ### Changed
### Deprecated ### Deprecated
@ -14,11 +30,14 @@
- Listeners in observable meta are replaced by lists - Listeners in observable meta are replaced by lists
- JS number comparison bug. - JS number comparison bug.
### Security ### Security
## [0.5.0] ## [0.5.0]
### Added ### Added
- Experimental `listOfSpec` delegate. - Experimental `listOfSpec` delegate.
### Changed ### Changed
- **API breaking** Config is deprecated, use `ObservableMeta` instead. - **API breaking** Config is deprecated, use `ObservableMeta` instead.
- **API breaking** Descriptor no has a member property `defaultValue` instead of `defaultItem()` extension. It caches default value state on the first call. It is done because computing default on each call is too expensive. - **API breaking** Descriptor no has a member property `defaultValue` instead of `defaultItem()` extension. It caches default value state on the first call. It is done because computing default on each call is too expensive.
@ -29,17 +48,18 @@
- **API breaking** `String.toName()` is replaced by `Name.parse()` - **API breaking** `String.toName()` is replaced by `Name.parse()`
- **API breaking** Configurable`config` changed to `meta` - **API breaking** Configurable`config` changed to `meta`
### Removed ### Removed
- `Config` - `Config`
- Public PluginManager mutability - Public PluginManager mutability
- Tables and tables-exposed moved to the separate project `tables.kt` - Tables and tables-exposed moved to the separate project `tables.kt`
- BinaryMetaFormat. Use CBOR encoding instead - BinaryMetaFormat. Use CBOR encoding instead
### Fixed ### Fixed
- Proper json array index treatment. - Proper json array index treatment.
- Proper json index for single-value array. - Proper json index for single-value array.
### Security
## [0.4.0] ## [0.4.0]
### Added ### Added
- LogManager plugin - LogManager plugin
@ -47,6 +67,7 @@
- Context `withEnv` and `fetch` methods to manipulate plugins without changing plugins after creation. - Context `withEnv` and `fetch` methods to manipulate plugins without changing plugins after creation.
- Split `ItemDescriptor` into builder and read-only part - Split `ItemDescriptor` into builder and read-only part
### Changed ### Changed
- Kotlin-logging moved from common to JVM and JS. Replaced by console for native. - Kotlin-logging moved from common to JVM and JS. Replaced by console for native.
- Package changed to `space.kscience` - Package changed to `space.kscience`
@ -56,18 +77,19 @@
- Added blank builders for children context. - Added blank builders for children context.
- Refactor loggers - Refactor loggers
### Deprecated ### Deprecated
- Direct use of PluginManager - Direct use of PluginManager
### Removed ### Removed
- Common dependency on Kotlin-logging - Common dependency on Kotlin-logging
- Kotlinx-io fork dependency. Replaced by Ktor-io. - Kotlinx-io fork dependency. Replaced by Ktor-io.
### Fixed ### Fixed
- Scheme properties properly handle children property change. - Scheme properties properly handle children property change.
### Security
## [0.3.0] ## [0.3.0]
### Added ### Added
- Yaml meta format based on yaml.kt - Yaml meta format based on yaml.kt
@ -76,6 +98,7 @@
- `copy` method to descriptors - `copy` method to descriptors
- Multiplatform yaml meta - Multiplatform yaml meta
### Changed ### Changed
- `ListValue` and `DoubleArrayValue` implement `Iterable`. - `ListValue` and `DoubleArrayValue` implement `Iterable`.
- Changed the logic of `Value::isList` to check for type instead of size - Changed the logic of `Value::isList` to check for type instead of size
@ -90,17 +113,7 @@
- \[Major breaking change\] Full refactor of DataTree/DataSource - \[Major breaking change\] Full refactor of DataTree/DataSource
- \[Major Breaking change\] Replace KClass with KType in data. Remove direct access to constructors with types. - \[Major Breaking change\] Replace KClass with KType in data. Remove direct access to constructors with types.
### Deprecated
### Removed
### Fixed
### Security
## [0.2.0] ## [0.2.0]
### Added
### Changed ### Changed
- Context content resolution refactor - Context content resolution refactor
- Kotlin 1.4.10 (build tools 0.6.0) - Kotlin 1.4.10 (build tools 0.6.0)
@ -110,16 +123,17 @@
- Removed io depdendency from `dataforge-output`. Replaced Output by Appendable. - Removed io depdendency from `dataforge-output`. Replaced Output by Appendable.
- Configurable is no longer MutableItemProvider. All functionality moved to Scheme. - Configurable is no longer MutableItemProvider. All functionality moved to Scheme.
### Deprecated ### Deprecated
- Context activation API - Context activation API
- TextRenderer - TextRenderer
### Removed ### Removed
- Functional server prototype - Functional server prototype
- `dataforge-output` module - `dataforge-output` module
### Fixed ### Fixed
- Global context CoroutineScope resolution - Global context CoroutineScope resolution
- Library mode compliance - Library mode compliance
### Security

View File

@ -4,7 +4,7 @@ plugins {
allprojects { allprojects {
group = "space.kscience" group = "space.kscience"
version = "0.5.2-dev-4" version = "0.5.2"
repositories{ repositories{
mavenCentral() mavenCentral()
} }

View File

@ -33,8 +33,8 @@ public final class space/kscience/dataforge/context/ClassLoaderPluginKt {
public class space/kscience/dataforge/context/Context : kotlinx/coroutines/CoroutineScope, space/kscience/dataforge/meta/MetaRepr, space/kscience/dataforge/misc/Named, space/kscience/dataforge/provider/Provider { public class space/kscience/dataforge/context/Context : kotlinx/coroutines/CoroutineScope, space/kscience/dataforge/meta/MetaRepr, space/kscience/dataforge/misc/Named, space/kscience/dataforge/provider/Provider {
public static final field Companion Lspace/kscience/dataforge/context/Context$Companion; public static final field Companion Lspace/kscience/dataforge/context/Context$Companion;
public static final field PROPERTY_TARGET Ljava/lang/String; public static final field PROPERTY_TARGET Ljava/lang/String;
public final fun buildContext (Ljava/lang/String;Lkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/context/Context; public final fun buildContext (Lspace/kscience/dataforge/names/Name;Lkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/context/Context;
public static synthetic fun buildContext$default (Lspace/kscience/dataforge/context/Context;Ljava/lang/String;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/dataforge/context/Context; public static synthetic fun buildContext$default (Lspace/kscience/dataforge/context/Context;Lspace/kscience/dataforge/names/Name;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/dataforge/context/Context;
public fun close ()V public fun close ()V
public fun content (Ljava/lang/String;)Ljava/util/Map; public fun content (Ljava/lang/String;)Ljava/util/Map;
public final fun content (Ljava/lang/String;Z)Ljava/util/Map; public final fun content (Ljava/lang/String;Z)Ljava/util/Map;
@ -57,7 +57,6 @@ public abstract interface class space/kscience/dataforge/context/ContextAware {
public final class space/kscience/dataforge/context/ContextBuilder { public final class space/kscience/dataforge/context/ContextBuilder {
public final fun build ()Lspace/kscience/dataforge/context/Context; public final fun build ()Lspace/kscience/dataforge/context/Context;
public final fun getName ()Lspace/kscience/dataforge/names/Name; public final fun getName ()Lspace/kscience/dataforge/names/Name;
public final fun name (Ljava/lang/String;)V
public final fun plugin (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V public final fun plugin (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;)V
public final fun plugin (Lspace/kscience/dataforge/context/Plugin;)V public final fun plugin (Lspace/kscience/dataforge/context/Plugin;)V
public final fun plugin (Lspace/kscience/dataforge/context/PluginFactory;Lkotlin/jvm/functions/Function1;)V public final fun plugin (Lspace/kscience/dataforge/context/PluginFactory;Lkotlin/jvm/functions/Function1;)V
@ -67,11 +66,9 @@ public final class space/kscience/dataforge/context/ContextBuilder {
public static synthetic fun plugin$default (Lspace/kscience/dataforge/context/ContextBuilder;Lspace/kscience/dataforge/context/PluginFactory;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public static synthetic fun plugin$default (Lspace/kscience/dataforge/context/ContextBuilder;Lspace/kscience/dataforge/context/PluginFactory;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public static synthetic fun plugin$default (Lspace/kscience/dataforge/context/ContextBuilder;Lspace/kscience/dataforge/context/PluginTag;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V public static synthetic fun plugin$default (Lspace/kscience/dataforge/context/ContextBuilder;Lspace/kscience/dataforge/context/PluginTag;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public final fun properties (Lkotlin/jvm/functions/Function1;)V public final fun properties (Lkotlin/jvm/functions/Function1;)V
public final fun setName (Lspace/kscience/dataforge/names/Name;)V
} }
public final class space/kscience/dataforge/context/ContextBuilderKt { public final class space/kscience/dataforge/context/ContextBuilderKt {
public static final fun withEnv (Lspace/kscience/dataforge/context/Context;Lkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/context/Context;
} }
public final class space/kscience/dataforge/context/DefaultLogManager : space/kscience/dataforge/context/AbstractPlugin, space/kscience/dataforge/context/LogManager { public final class space/kscience/dataforge/context/DefaultLogManager : space/kscience/dataforge/context/AbstractPlugin, space/kscience/dataforge/context/LogManager {

View File

@ -365,6 +365,8 @@ public class space/kscience/dataforge/meta/Scheme : space/kscience/dataforge/met
} }
public final class space/kscience/dataforge/meta/SchemeKt { public final class space/kscience/dataforge/meta/SchemeKt {
public static final fun copy (Lspace/kscience/dataforge/meta/Scheme;Lspace/kscience/dataforge/meta/SchemeSpec;Lkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/meta/Scheme;
public static synthetic fun copy$default (Lspace/kscience/dataforge/meta/Scheme;Lspace/kscience/dataforge/meta/SchemeSpec;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lspace/kscience/dataforge/meta/Scheme;
public static final fun invoke (Lspace/kscience/dataforge/meta/Scheme;Lkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/meta/Scheme; public static final fun invoke (Lspace/kscience/dataforge/meta/Scheme;Lkotlin/jvm/functions/Function1;)Lspace/kscience/dataforge/meta/Scheme;
public static final fun retarget (Lspace/kscience/dataforge/meta/Scheme;Lspace/kscience/dataforge/meta/MutableMeta;)Lspace/kscience/dataforge/meta/Scheme; public static final fun retarget (Lspace/kscience/dataforge/meta/Scheme;Lspace/kscience/dataforge/meta/MutableMeta;)Lspace/kscience/dataforge/meta/Scheme;
} }
@ -726,6 +728,7 @@ public final class space/kscience/dataforge/names/NameKt {
public static final fun getLength (Lspace/kscience/dataforge/names/Name;)I public static final fun getLength (Lspace/kscience/dataforge/names/Name;)I
public static final fun isEmpty (Lspace/kscience/dataforge/names/Name;)Z public static final fun isEmpty (Lspace/kscience/dataforge/names/Name;)Z
public static final fun lastOrNull (Lspace/kscience/dataforge/names/Name;)Lspace/kscience/dataforge/names/NameToken; public static final fun lastOrNull (Lspace/kscience/dataforge/names/Name;)Lspace/kscience/dataforge/names/NameToken;
public static final fun parseAsName (Ljava/lang/String;)Lspace/kscience/dataforge/names/Name;
public static final fun plus (Lspace/kscience/dataforge/names/Name;Ljava/lang/String;)Lspace/kscience/dataforge/names/Name; public static final fun plus (Lspace/kscience/dataforge/names/Name;Ljava/lang/String;)Lspace/kscience/dataforge/names/Name;
public static final fun plus (Lspace/kscience/dataforge/names/Name;Lspace/kscience/dataforge/names/Name;)Lspace/kscience/dataforge/names/Name; public static final fun plus (Lspace/kscience/dataforge/names/Name;Lspace/kscience/dataforge/names/Name;)Lspace/kscience/dataforge/names/Name;
public static final fun plus (Lspace/kscience/dataforge/names/Name;Lspace/kscience/dataforge/names/NameToken;)Lspace/kscience/dataforge/names/Name; public static final fun plus (Lspace/kscience/dataforge/names/Name;Lspace/kscience/dataforge/names/NameToken;)Lspace/kscience/dataforge/names/Name;

View File

@ -296,9 +296,7 @@ private class MutableMetaImpl(
override fun attach(name: Name, node: ObservableMutableMeta) { override fun attach(name: Name, node: ObservableMutableMeta) {
when (name.length) { when (name.length) {
0 -> error("Can't set a meta with empty name") 0 -> error("Can't set a meta with empty name")
1 -> { 1 -> replaceItem(name.first(), get(name), node)
replaceItem(name.first(), get(name), node)
}
else -> get(name.cutLast())?.attach(name.lastOrNull()!!.asName(), node) else -> get(name.cutLast())?.attach(name.lastOrNull()!!.asName(), node)
} }
} }

View File

@ -2,10 +2,11 @@ package space.kscience.dataforge.meta
import kotlin.test.Test import kotlin.test.Test
import kotlin.test.assertEquals import kotlin.test.assertEquals
import kotlin.test.assertFails
class MutableMetaTest{ class MutableMetaTest{
@Test @Test
fun testRemove(){ fun remove(){
val meta = MutableMeta { val meta = MutableMeta {
"aNode" put { "aNode" put {
"innerNode" put { "innerNode" put {
@ -19,4 +20,13 @@ class MutableMetaTest{
meta.remove("aNode.c") meta.remove("aNode.c")
assertEquals(meta["aNode.c"], null) assertEquals(meta["aNode.c"], null)
} }
@Test
fun recursiveMeta(){
val meta = MutableMeta {
"a" put 2
}
assertFails { meta["child.a"] = meta}
}
} }