From cfa20eedba49bd39270ff285a7c1f51ce7105244 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 9 Jul 2023 21:38:33 +0300 Subject: [PATCH 1/6] Update version to 1.9 --- .github/workflows/pages.yml | 27 +++++----- .github/workflows/publish.yml | 51 +++++++++---------- build.gradle.kts | 2 +- .../dataforge/actions/ReduceAction.kt | 1 - .../kscience/dataforge/actions/SplitAction.kt | 1 - gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 7 files changed, 41 insertions(+), 45 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 23ed5435..5c1c3bac 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -1,28 +1,31 @@ name: Dokka publication on: - push: - branches: [ master ] + workflow_dispatch: + release: + types: [ created ] jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest timeout-minutes: 40 steps: - - uses: actions/checkout@v2 - - uses: DeLaGuardo/setup-graalvm@4.0 + - uses: actions/checkout@v3.0.0 + - uses: actions/setup-java@v3.0.0 with: - graalvm: 21.2.0 - java: java11 - arch: amd64 - - uses: actions/cache@v2 + java-version: 11 + distribution: liberica + - name: Cache konan + uses: actions/cache@v3.0.1 with: - path: ~/.gradle/caches + path: ~/.konan key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} restore-keys: | ${{ runner.os }}-gradle- - - run: ./gradlew dokkaHtmlMultiModule --build-cache --no-daemon --no-parallel --stacktrace - - uses: JamesIves/github-pages-deploy-action@4.1.0 + - uses: gradle/gradle-build-action@v2.1.5 + with: + arguments: dokkaHtmlMultiModule --no-parallel + - uses: JamesIves/github-pages-deploy-action@v4.3.0 with: branch: gh-pages folder: build/dokka/htmlMultiModule diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e607e4b7..ab9243f1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,32 +9,18 @@ jobs: publish: environment: name: publish - env: - publishing.github: false strategy: matrix: os: [ macOS-latest, windows-latest ] runs-on: ${{matrix.os}} steps: - - name: Checkout the repo - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: DeLaGuardo/setup-graalvm@4.0 + - uses: actions/checkout@v3.0.0 + - uses: actions/setup-java@v3.10.0 with: - graalvm: 21.2.0 - java: java11 - arch: amd64 - - name: Cache gradle - uses: actions/cache@v2 - with: - path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} - restore-keys: | - ${{ runner.os }}-gradle- + java-version: 11 + distribution: liberica - name: Cache konan - uses: actions/cache@v2 + uses: actions/cache@v3.0.1 with: path: ~/.konan key: ${{ runner.os }}-gradle-${{ hashFiles('*.gradle.kts') }} @@ -42,14 +28,23 @@ jobs: ${{ runner.os }}-gradle- - name: Publish Windows Artifacts if: matrix.os == 'windows-latest' - shell: cmd - run: > - ./gradlew release --no-daemon --build-cache -Ppublishing.enabled=true - -Ppublishing.space.user=${{ secrets.SPACE_APP_ID }} - -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }} + uses: gradle/gradle-build-action@v2.4.0 + with: + arguments: | + publishAllPublicationsToSpaceRepository + -Ppublishing.targets=all + -Ppublishing.space.user=${{ secrets.SPACE_APP_ID }} + -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }} - name: Publish Mac Artifacts if: matrix.os == 'macOS-latest' - run: > - ./gradlew release --no-daemon --build-cache -Ppublishing.enabled=true - -Ppublishing.space.user=${{ secrets.SPACE_APP_ID }} - -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }} + uses: gradle/gradle-build-action@v2.4.0 + with: + arguments: | + publishMacosX64PublicationToSpaceRepository + publishMacosArm64PublicationToSpaceRepository + publishIosX64PublicationToSpaceRepository + publishIosArm64PublicationToSpaceRepository + publishIosSimulatorArm64PublicationToSpaceRepository + -Ppublishing.targets=all + -Ppublishing.space.user=${{ secrets.SPACE_APP_ID }} + -Ppublishing.space.token=${{ secrets.SPACE_APP_SECRET }} diff --git a/build.gradle.kts b/build.gradle.kts index bc123f49..5b886e58 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { allprojects { group = "space.kscience" - version = "0.6.1" + version = "0.6.2-dev-kotlin-1.9.0" } subprojects { diff --git a/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/ReduceAction.kt b/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/ReduceAction.kt index c14152f8..fe823bd7 100644 --- a/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/ReduceAction.kt +++ b/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/ReduceAction.kt @@ -112,7 +112,6 @@ internal class ReduceAction( * A one-to-one mapping action */ @DFExperimental -@Suppress("FunctionName") public inline fun Action.Companion.reduce( noinline builder: ReduceGroupBuilder.() -> Unit, ): Action = ReduceAction(typeOf(), builder) diff --git a/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/SplitAction.kt b/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/SplitAction.kt index 88e6061b..24745929 100644 --- a/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/SplitAction.kt +++ b/dataforge-data/src/commonMain/kotlin/space/kscience/dataforge/actions/SplitAction.kt @@ -87,7 +87,6 @@ internal class SplitAction( * Action that splits each incoming element into a number of fragments defined in builder */ @DFExperimental -@Suppress("FunctionName") public inline fun Action.Companion.split( noinline builder: SplitBuilder.() -> Unit, ): Action = SplitAction(typeOf(), builder) \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 813d5d08..df992b2c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.mpp.stability.nowarn=true kotlin.incremental.js.ir=true kotlin.native.ignoreDisabledTargets=true -toolsVersion=0.14.5-kotlin-1.8.20-RC +toolsVersion=0.14.9-kotlin-1.9.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e1bef7e8..15de9024 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From de476fb273eff3eb5944fe8f782872d6e1e849c8 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 26 Jul 2023 16:47:12 +0300 Subject: [PATCH 2/6] Fix json serialization. --- CHANGELOG.md | 1 + README.md | 49 ------------------- build.gradle.kts | 2 +- dataforge-io/build.gradle.kts | 6 +-- .../dataforge-io-yaml/build.gradle.kts | 8 --- dataforge-meta/build.gradle.kts | 2 +- .../space/kscience/dataforge/meta/JsonMeta.kt | 11 +++-- docs/templates/ARTIFACT-TEMPLATE.md | 29 ----------- docs/templates/README-TEMPLATE.md | 2 +- gradle.properties | 2 +- 10 files changed, 15 insertions(+), 97 deletions(-) delete mode 100644 README.md delete mode 100644 docs/templates/ARTIFACT-TEMPLATE.md diff --git a/CHANGELOG.md b/CHANGELOG.md index ac4a5574..36105b78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Added ### Changed +- Meta to Json serializer now serializes a single item with index as an array. It is important for plotly integration. ### Deprecated diff --git a/README.md b/README.md deleted file mode 100644 index b6a8a566..00000000 --- a/README.md +++ /dev/null @@ -1,49 +0,0 @@ -[![JetBrains Research](https://jb.gg/badges/research.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) -[![DOI](https://zenodo.org/badge/148831678.svg)](https://zenodo.org/badge/latestdoi/148831678) - -![Gradle build](https://github.com/mipt-npm/dataforge-core/workflows/Gradle%20build/badge.svg) - -
- -* ### [dataforge-context](dataforge-context) -> -> -> **Maturity**: DEVELOPMENT -
- -* ### [dataforge-data](dataforge-data) -> -> -> **Maturity**: EXPERIMENTAL -
- -* ### [dataforge-io](dataforge-io) -> -> -> **Maturity**: PROTOTYPE -
- -* ### [dataforge-meta](dataforge-meta) -> -> -> **Maturity**: DEVELOPMENT -
- -* ### [dataforge-scripting](dataforge-scripting) -> -> -> **Maturity**: PROTOTYPE -
- -* ### [dataforge-workspace](dataforge-workspace) -> -> -> **Maturity**: EXPERIMENTAL -
- -* ### [dataforge-io-yaml](dataforge-io/dataforge-io-yaml) -> YAML meta converters and Front Matter envelope format -> -> **Maturity**: PROTOTYPE -
- diff --git a/build.gradle.kts b/build.gradle.kts index 5b886e58..883306ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { allprojects { group = "space.kscience" - version = "0.6.2-dev-kotlin-1.9.0" + version = "0.6.2-dev-2" } subprojects { diff --git a/dataforge-io/build.gradle.kts b/dataforge-io/build.gradle.kts index 91319d4d..9f2030c7 100644 --- a/dataforge-io/build.gradle.kts +++ b/dataforge-io/build.gradle.kts @@ -10,8 +10,8 @@ kscience { jvm() js() native() - useSerialization("1.4.1") - useSerialization("1.4.1", sourceSet = space.kscience.gradle.DependencySourceSet.TEST) { + useSerialization() + useSerialization(sourceSet = space.kscience.gradle.DependencySourceSet.TEST) { cbor() } dependencies { @@ -20,6 +20,6 @@ kscience { } } -readme{ +readme { maturity = space.kscience.gradle.Maturity.PROTOTYPE } \ No newline at end of file diff --git a/dataforge-io/dataforge-io-yaml/build.gradle.kts b/dataforge-io/dataforge-io-yaml/build.gradle.kts index b33e1b9a..505ce360 100644 --- a/dataforge-io/dataforge-io-yaml/build.gradle.kts +++ b/dataforge-io/dataforge-io-yaml/build.gradle.kts @@ -4,10 +4,6 @@ plugins { description = "YAML meta IO" -repositories { - mavenCentral() -} - kscience { jvm() js() @@ -20,10 +16,6 @@ kscience { } } -repositories{ - maven("https://dl.bintray.com/mamoe/yamlkt") -} - readme{ maturity = space.kscience.gradle.Maturity.PROTOTYPE description =""" diff --git a/dataforge-meta/build.gradle.kts b/dataforge-meta/build.gradle.kts index decf0760..51b07113 100644 --- a/dataforge-meta/build.gradle.kts +++ b/dataforge-meta/build.gradle.kts @@ -6,7 +6,7 @@ kscience { jvm() js() native() - useSerialization("1.4.1"){ + useSerialization{ json() } } diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt index e36f0e55..98f0c3e4 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt @@ -23,7 +23,6 @@ public fun Value.toJson(descriptor: MetaDescriptor? = null): JsonElement = when } //Use these methods to customize JSON key mapping -@Suppress("NULLABLE_EXTENSION_OPERATOR_WITH_SAFE_CALL_RECEIVER") private fun String.toJsonKey(descriptor: MetaDescriptor?) = descriptor?.attributes?.get("jsonName").string ?: toString() private fun Meta.toJsonWithIndex(descriptor: MetaDescriptor?, index: String?): JsonElement = if (items.isEmpty()) { @@ -35,9 +34,13 @@ private fun Meta.toJsonWithIndex(descriptor: MetaDescriptor?, index: String?): J val childDescriptor = descriptor?.children?.get(body) if (list.size == 1) { val (token, element) = list.first() - //do not add empty element - val child: JsonElement = element.toJsonWithIndex(childDescriptor, token.index) - body to child + //do not add an empty element + val child: JsonElement = element.toJsonWithIndex(childDescriptor, token.index) + if(token.index == null) { + body to child + } else { + body to JsonArray(listOf(child)) + } } else { val elements: List = list.sortedBy { it.key.index }.mapIndexed { index, entry -> //Use index if it is not equal to the item order diff --git a/docs/templates/ARTIFACT-TEMPLATE.md b/docs/templates/ARTIFACT-TEMPLATE.md deleted file mode 100644 index 6b921b05..00000000 --- a/docs/templates/ARTIFACT-TEMPLATE.md +++ /dev/null @@ -1,29 +0,0 @@ -> #### Artifact: -> -> This module artifact: `${group}:${name}:${version}`. -> -> -> [![Maven Central](https://img.shields.io/maven-central/v/space.kscience/${name}.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22space.kscience%22%20AND%20a:%22${name}%22) -> -> **Gradle:** -> -> ```gradle -> repositories { -> maven { url 'https://repo.kotlin.link' } -> } -> -> dependencies { -> implementation '${group}:${name}:${version}' -> } -> ``` -> **Gradle Kotlin DSL:** -> -> ```kotlin -> repositories { -> maven("https://https://repo.kotlin.link") -> } -> -> dependencies { -> implementation("${group}:${name}:${version}") -> } -> ``` \ No newline at end of file diff --git a/docs/templates/README-TEMPLATE.md b/docs/templates/README-TEMPLATE.md index a28f0db3..762e5d7e 100644 --- a/docs/templates/README-TEMPLATE.md +++ b/docs/templates/README-TEMPLATE.md @@ -3,4 +3,4 @@ ![Gradle build](https://github.com/mipt-npm/dataforge-core/workflows/Gradle%20build/badge.svg) -$modules +${modules} diff --git a/gradle.properties b/gradle.properties index df992b2c..27743a30 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.mpp.stability.nowarn=true kotlin.incremental.js.ir=true kotlin.native.ignoreDisabledTargets=true -toolsVersion=0.14.9-kotlin-1.9.0 +toolsVersion=0.14.9-kotlin-1.8.20 From ee5afcdafead87023e3478bfd745bf11c7299206 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sat, 29 Jul 2023 12:42:14 +0300 Subject: [PATCH 3/6] Update meta serialization rules --- CHANGELOG.md | 1 + build.gradle.kts | 2 +- .../kscience/dataforge/io/JsonMetaFormat.kt | 6 +-- .../space/kscience/dataforge/meta/JsonMeta.kt | 37 +++++++++---------- .../space/kscience/dataforge/meta/Value.kt | 2 +- .../dataforge/meta/MetaSerializationTest.kt | 32 +++++++++++++++- 6 files changed, 55 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36105b78..710f8569 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ ### Changed - Meta to Json serializer now serializes a single item with index as an array. It is important for plotly integration. +- Meta to Json serializes Meta without children a value as literal or array instead of an object with `@value` field. ### Deprecated diff --git a/build.gradle.kts b/build.gradle.kts index 883306ea..dc9880bd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { allprojects { group = "space.kscience" - version = "0.6.2-dev-2" + version = "0.6.2-dev-3" } subprojects { diff --git a/dataforge-io/src/commonMain/kotlin/space/kscience/dataforge/io/JsonMetaFormat.kt b/dataforge-io/src/commonMain/kotlin/space/kscience/dataforge/io/JsonMetaFormat.kt index 4bb3c82d..f3d9e02a 100644 --- a/dataforge-io/src/commonMain/kotlin/space/kscience/dataforge/io/JsonMetaFormat.kt +++ b/dataforge-io/src/commonMain/kotlin/space/kscience/dataforge/io/JsonMetaFormat.kt @@ -6,7 +6,7 @@ package space.kscience.dataforge.io import io.ktor.utils.io.core.Input import io.ktor.utils.io.core.Output import kotlinx.serialization.json.Json -import kotlinx.serialization.json.JsonObject +import kotlinx.serialization.json.JsonElement import space.kscience.dataforge.context.Context import space.kscience.dataforge.meta.Meta import space.kscience.dataforge.meta.descriptors.MetaDescriptor @@ -19,8 +19,8 @@ import space.kscience.dataforge.meta.toMeta public class JsonMetaFormat(private val json: Json = DEFAULT_JSON) : MetaFormat { override fun writeMeta(output: Output, meta: Meta, descriptor: MetaDescriptor?) { - val jsonObject = meta.toJson(descriptor) - output.writeUtf8String(json.encodeToString(JsonObject.serializer(), jsonObject)) + val jsonElement = meta.toJson(descriptor) + output.writeUtf8String(json.encodeToString(JsonElement.serializer(), jsonElement)) } override fun readMeta(input: Input, descriptor: MetaDescriptor?): Meta { diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt index 98f0c3e4..7b21fad2 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt @@ -64,30 +64,29 @@ private fun Meta.toJsonWithIndex(descriptor: MetaDescriptor?, index: String?): J JsonObject(pairs.toMap()) } -public fun Meta.toJson(descriptor: MetaDescriptor? = null): JsonObject { - val element = toJsonWithIndex(descriptor, null) - return if (element is JsonObject) { - element - } else { - buildJsonObject { - put("@value", element) - } - } +public fun Meta.toJson(descriptor: MetaDescriptor? = null): JsonElement { + return toJsonWithIndex(descriptor, null) +// val element = toJsonWithIndex(descriptor, null) +// return if (element is JsonObject) { +// element +// } else { +// buildJsonObject { +// put("@value", element) +// } +// } } /** * Convert a Json primitive to a [Value] */ -public fun JsonPrimitive.toValue(descriptor: MetaDescriptor?): Value { - return when (this) { - JsonNull -> Null - else -> { - if (isString) { - StringValue(content) - } else { - //consider using LazyParse - content.parseValue() - } +public fun JsonPrimitive.toValue(descriptor: MetaDescriptor?): Value = when (this) { + JsonNull -> Null + else -> { + if (isString) { + content.asValue() + } else { + //consider using LazyParse + content.parseValue() } } } diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Value.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Value.kt index e051c10c..73950f53 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Value.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/Value.kt @@ -226,7 +226,7 @@ public fun > E.asValue(): Value = EnumValue(this) /** - * Create Value from String using closest match conversion + * Create Value from String using the closest match conversion */ public fun String.parseValue(): Value { diff --git a/dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt b/dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt index de660e10..0f270bc6 100644 --- a/dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt +++ b/dataforge-meta/src/commonTest/kotlin/space/kscience/dataforge/meta/MetaSerializationTest.kt @@ -1,15 +1,45 @@ package space.kscience.dataforge.meta import kotlinx.serialization.json.Json +import space.kscience.dataforge.names.asName import kotlin.test.Test import kotlin.test.assertEquals class MetaSerializationTest { @Test - fun singleValueDeserialization(){ + fun singleValueDeserialization() { val string = "ddd" val meta = Json.decodeFromString(MetaSerializer, string) assertEquals(string, meta.value?.string) } + + @Test + fun complexMeta() { + val meta = Meta { + "a" put 28.3 + "b" put doubleArrayOf(1.0, 2.0, 3.2) + "child" put Meta { + "a" put "aString" + "sns[0]" put Meta { + "d" put 0 + } + "sns[1]" put Meta { + "d" put 1 + } + setIndexed( + "sns2".asName(), + listOf( + Meta { "d" put "first" }, + Meta("53") + ) + ) + } + } + + val string = Json.encodeToString(MetaSerializer, meta) + println(string) + val reconstructed = Json.decodeFromString(MetaSerializer, string) + assertEquals(meta, reconstructed) + } } \ No newline at end of file From 3644533043453238529aa77fe23b904d5edb9be5 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sat, 29 Jul 2023 12:56:35 +0300 Subject: [PATCH 4/6] update documentation --- .../space/kscience/dataforge/meta/JsonMeta.kt | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt index 7b21fad2..7dc44785 100644 --- a/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt +++ b/dataforge-meta/src/commonMain/kotlin/space/kscience/dataforge/meta/JsonMeta.kt @@ -64,17 +64,12 @@ private fun Meta.toJsonWithIndex(descriptor: MetaDescriptor?, index: String?): J JsonObject(pairs.toMap()) } -public fun Meta.toJson(descriptor: MetaDescriptor? = null): JsonElement { - return toJsonWithIndex(descriptor, null) -// val element = toJsonWithIndex(descriptor, null) -// return if (element is JsonObject) { -// element -// } else { -// buildJsonObject { -// put("@value", element) -// } -// } -} +/** + * Convert Meta to [JsonElement]. Meta with children is converted to [JsonObject]. + * Meta without children is converted to either [JsonPrimitive] or [JsonArray] depending on the value type. + * An empty Meta is converted to an empty JsonObject. + */ +public fun Meta.toJson(descriptor: MetaDescriptor? = null): JsonElement = toJsonWithIndex(descriptor, null) /** * Convert a Json primitive to a [Value] From d5ebef404f8cac83ec2eaf6b18146415dae10860 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sat, 29 Jul 2023 12:59:55 +0300 Subject: [PATCH 5/6] update documentation --- CHANGELOG.md | 8 ++++++-- build.gradle.kts | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 710f8569..ee7190af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,6 @@ ### Added ### Changed -- Meta to Json serializer now serializes a single item with index as an array. It is important for plotly integration. -- Meta to Json serializes Meta without children a value as literal or array instead of an object with `@value` field. ### Deprecated @@ -16,6 +14,12 @@ ### Security +## 0.6.2 - 2023-07-29 + +### Changed +- Meta to Json serializer now serializes a single item with index as an array. It is important for plotly integration. +- Meta to Json serializes Meta without children a value as literal or array instead of an object with `@value` field. + ## 0.6.1 - 2023-03-31 ### Added diff --git a/build.gradle.kts b/build.gradle.kts index dc9880bd..bbab94eb 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -9,7 +9,7 @@ plugins { allprojects { group = "space.kscience" - version = "0.6.2-dev-3" + version = "0.6.2" } subprojects { From 3806f97c77e4c41ffe11f0228015388cb87ba21f Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sat, 29 Jul 2023 13:00:17 +0300 Subject: [PATCH 6/6] update documentation --- README.md | 41 ++++++++++++++++++++++++ dataforge-context/README.md | 32 ++++++++++++++++++ dataforge-data/README.md | 32 ++++++++++++++++++ dataforge-io/README.md | 32 ++++++++++++++++++ dataforge-io/dataforge-io-yaml/README.md | 32 ++++++++++++++++++ dataforge-meta/README.md | 32 ++++++++++++++++++ dataforge-scripting/README.md | 32 ++++++++++++++++++ dataforge-workspace/README.md | 32 ++++++++++++++++++ 8 files changed, 265 insertions(+) create mode 100644 README.md create mode 100644 dataforge-context/README.md create mode 100644 dataforge-data/README.md create mode 100644 dataforge-io/README.md create mode 100644 dataforge-io/dataforge-io-yaml/README.md create mode 100644 dataforge-meta/README.md create mode 100644 dataforge-scripting/README.md create mode 100644 dataforge-workspace/README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..a973a25f --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +[![JetBrains Research](https://jb.gg/badges/research.svg)](https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub) +[![DOI](https://zenodo.org/badge/148831678.svg)](https://zenodo.org/badge/latestdoi/148831678) + +![Gradle build](https://github.com/mipt-npm/dataforge-core/workflows/Gradle%20build/badge.svg) + + +### [dataforge-context](dataforge-context) +> +> +> **Maturity**: DEVELOPMENT + +### [dataforge-data](dataforge-data) +> +> +> **Maturity**: EXPERIMENTAL + +### [dataforge-io](dataforge-io) +> +> +> **Maturity**: PROTOTYPE + +### [dataforge-meta](dataforge-meta) +> +> +> **Maturity**: DEVELOPMENT + +### [dataforge-scripting](dataforge-scripting) +> +> +> **Maturity**: PROTOTYPE + +### [dataforge-workspace](dataforge-workspace) +> +> +> **Maturity**: EXPERIMENTAL + +### [dataforge-io/dataforge-io-yaml](dataforge-io/dataforge-io-yaml) +> YAML meta converters and Front Matter envelope format +> +> **Maturity**: PROTOTYPE + diff --git a/dataforge-context/README.md b/dataforge-context/README.md new file mode 100644 index 00000000..06e06f3a --- /dev/null +++ b/dataforge-context/README.md @@ -0,0 +1,32 @@ +# Module dataforge-context + +Context and provider definitions + +## Usage + +## Artifact: + +The Maven coordinates of this project are `space.kscience:dataforge-context:0.6.2-dev-2`. + +**Gradle Groovy:** +```groovy +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation 'space.kscience:dataforge-context:0.6.2-dev-2' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("space.kscience:dataforge-context:0.6.2-dev-2") +} +``` diff --git a/dataforge-data/README.md b/dataforge-data/README.md new file mode 100644 index 00000000..3b74b2de --- /dev/null +++ b/dataforge-data/README.md @@ -0,0 +1,32 @@ +# Module dataforge-data + + + +## Usage + +## Artifact: + +The Maven coordinates of this project are `space.kscience:dataforge-data:0.6.2-dev-2`. + +**Gradle Groovy:** +```groovy +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation 'space.kscience:dataforge-data:0.6.2-dev-2' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("space.kscience:dataforge-data:0.6.2-dev-2") +} +``` diff --git a/dataforge-io/README.md b/dataforge-io/README.md new file mode 100644 index 00000000..6ce35db3 --- /dev/null +++ b/dataforge-io/README.md @@ -0,0 +1,32 @@ +# Module dataforge-io + +IO module + +## Usage + +## Artifact: + +The Maven coordinates of this project are `space.kscience:dataforge-io:0.6.2-dev-2`. + +**Gradle Groovy:** +```groovy +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation 'space.kscience:dataforge-io:0.6.2-dev-2' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("space.kscience:dataforge-io:0.6.2-dev-2") +} +``` diff --git a/dataforge-io/dataforge-io-yaml/README.md b/dataforge-io/dataforge-io-yaml/README.md new file mode 100644 index 00000000..452ba504 --- /dev/null +++ b/dataforge-io/dataforge-io-yaml/README.md @@ -0,0 +1,32 @@ +# Module dataforge-io-yaml + +YAML meta IO + +## Usage + +## Artifact: + +The Maven coordinates of this project are `space.kscience:dataforge-io-yaml:0.6.2-dev-2`. + +**Gradle Groovy:** +```groovy +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation 'space.kscience:dataforge-io-yaml:0.6.2-dev-2' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("space.kscience:dataforge-io-yaml:0.6.2-dev-2") +} +``` diff --git a/dataforge-meta/README.md b/dataforge-meta/README.md new file mode 100644 index 00000000..0088dcf7 --- /dev/null +++ b/dataforge-meta/README.md @@ -0,0 +1,32 @@ +# Module dataforge-meta + +Meta definition and basic operations on meta + +## Usage + +## Artifact: + +The Maven coordinates of this project are `space.kscience:dataforge-meta:0.6.2-dev-2`. + +**Gradle Groovy:** +```groovy +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation 'space.kscience:dataforge-meta:0.6.2-dev-2' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("space.kscience:dataforge-meta:0.6.2-dev-2") +} +``` diff --git a/dataforge-scripting/README.md b/dataforge-scripting/README.md new file mode 100644 index 00000000..c4d2caad --- /dev/null +++ b/dataforge-scripting/README.md @@ -0,0 +1,32 @@ +# Module dataforge-scripting + + + +## Usage + +## Artifact: + +The Maven coordinates of this project are `space.kscience:dataforge-scripting:0.6.2-dev-2`. + +**Gradle Groovy:** +```groovy +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation 'space.kscience:dataforge-scripting:0.6.2-dev-2' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("space.kscience:dataforge-scripting:0.6.2-dev-2") +} +``` diff --git a/dataforge-workspace/README.md b/dataforge-workspace/README.md new file mode 100644 index 00000000..2aafb8df --- /dev/null +++ b/dataforge-workspace/README.md @@ -0,0 +1,32 @@ +# Module dataforge-workspace + + + +## Usage + +## Artifact: + +The Maven coordinates of this project are `space.kscience:dataforge-workspace:0.6.2-dev-2`. + +**Gradle Groovy:** +```groovy +repositories { + maven { url 'https://repo.kotlin.link' } + mavenCentral() +} + +dependencies { + implementation 'space.kscience:dataforge-workspace:0.6.2-dev-2' +} +``` +**Gradle Kotlin DSL:** +```kotlin +repositories { + maven("https://repo.kotlin.link") + mavenCentral() +} + +dependencies { + implementation("space.kscience:dataforge-workspace:0.6.2-dev-2") +} +```