From f65c4e1d099c7080ea837eacba9764d351c9c6ec Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 14:54:41 +0300 Subject: [PATCH] Update Kotlin core dependencies (#2844) - removed deprecated api - fixed test for JS - @OptIn(ExperimentalNativeApi::class) - fixed import @JsModule("@react-sigma/*") --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Nariman Abdullin --- gradle/libs.versions.toml | 8 ++++---- .../kotlin/com/saveourtool/save/utils/PlatformUtils.kt | 2 +- .../com/saveoourtool/save/demo/agent/ServerTest.kt | 2 ++ save-frontend-common/karma.config.d/custom-config.js | 10 +++++----- save-frontend/karma.config.d/custom-config.js | 8 ++++---- .../externals/graph/sigma/layouts/LayoutCircular.kt | 7 ++----- .../externals/graph/sigma/layouts/LayoutForceAtlas2.kt | 8 +++----- .../externals/graph/sigma/layouts/LayoutRandom.kt | 7 ++----- 8 files changed, 23 insertions(+), 29 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8c3b1d6d20..1228d24b4a 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] -kotlin = "1.9.10" +kotlin = "1.9.22" jetbrains-annotations = "24.0.1" save-cli = "0.3.10" ktor = "2.3.6" okio = "3.3.0" -serialization = "1.6.0" -kotlinx-datetime = "0.4.1" -kotlinx-coroutines = "1.7.3" +serialization = "1.6.3" +kotlinx-datetime = "0.5.0" +kotlinx-coroutines = "1.8.0" kotlin-wrappers = "1.0.0-pre.634" spring-boot = "2.7.17" spring-cloud = "3.1.9" diff --git a/save-cloud-common/src/nativeMain/kotlin/com/saveourtool/save/utils/PlatformUtils.kt b/save-cloud-common/src/nativeMain/kotlin/com/saveourtool/save/utils/PlatformUtils.kt index 0d5ff19117..a85fc06e7f 100644 --- a/save-cloud-common/src/nativeMain/kotlin/com/saveourtool/save/utils/PlatformUtils.kt +++ b/save-cloud-common/src/nativeMain/kotlin/com/saveourtool/save/utils/PlatformUtils.kt @@ -8,7 +8,7 @@ import kotlinx.cinterop.ExperimentalForeignApi import kotlinx.cinterop.toKString actual class AtomicLong actual constructor(value: Long) { - private val kotlinAtomicLong = kotlin.native.concurrent.AtomicLong(value) + private val kotlinAtomicLong = kotlin.concurrent.AtomicLong(value) actual fun get(): Long = kotlinAtomicLong.value diff --git a/save-demo-agent/src/nativeTest/kotlin/com/saveoourtool/save/demo/agent/ServerTest.kt b/save-demo-agent/src/nativeTest/kotlin/com/saveoourtool/save/demo/agent/ServerTest.kt index cf82d3c44f..63dfb52d8d 100644 --- a/save-demo-agent/src/nativeTest/kotlin/com/saveoourtool/save/demo/agent/ServerTest.kt +++ b/save-demo-agent/src/nativeTest/kotlin/com/saveoourtool/save/demo/agent/ServerTest.kt @@ -10,6 +10,7 @@ import io.ktor.utils.io.core.* import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch +import kotlin.experimental.ExperimentalNativeApi import kotlin.test.* class ServerTest { @@ -27,6 +28,7 @@ class ServerTest { server.stop() } + @OptIn(ExperimentalNativeApi::class) @Test fun testServerStartup() { httpClient().use { client -> diff --git a/save-frontend-common/karma.config.d/custom-config.js b/save-frontend-common/karma.config.d/custom-config.js index 0c88d3dc9c..25274c721d 100644 --- a/save-frontend-common/karma.config.d/custom-config.js +++ b/save-frontend-common/karma.config.d/custom-config.js @@ -8,7 +8,7 @@ test: /\.js$/, use: {loader: 'istanbul-instrumenter-loader'}, // fixme: need to exclude Kotlin dependencies - include: [path.resolve(__dirname, '../save-cloud-save-frontend-common/kotlin/')] + include: [path.resolve(__dirname, '../save-cloud-frontend-common/kotlin/')] } ) config.coverageIstanbulReporter = { @@ -24,12 +24,12 @@ config.set({ } }, proxies: { - // serving mockServiceWorker.js.js from location relative to base url + // serving mockServiceWorker.js from location relative to base url // the file should be included into Karma's `files` to be served by server at all - '/mockServiceWorker.js': '/base/mockServiceWorker.js', + '/mockServiceWorker.js': '/base/node_modules/mockServiceWorker.js', }, }) // http://karma-runner.github.io/6.3/config/files.html -// 'All of the relative patterns will get resolved using the basePath first.', where basePath is set by KGP to `node_modules` -config.files.push('./mockServiceWorker.js') +// 'All of the relative patterns will get resolved using the basePath first.', where basePath is NOT set by KGP to `node_modules` after migration to 1.9 +config.files.push('./node_modules/mockServiceWorker.js') diff --git a/save-frontend/karma.config.d/custom-config.js b/save-frontend/karma.config.d/custom-config.js index 89c1081706..f84f21137a 100644 --- a/save-frontend/karma.config.d/custom-config.js +++ b/save-frontend/karma.config.d/custom-config.js @@ -24,12 +24,12 @@ config.set({ } }, proxies: { - // serving mockServiceWorker.js.js from location relative to base url + // serving mockServiceWorker.js from location relative to base url // the file should be included into Karma's `files` to be served by server at all - '/mockServiceWorker.js': '/base/mockServiceWorker.js', + '/mockServiceWorker.js': '/base/node_modules/mockServiceWorker.js', }, }) // http://karma-runner.github.io/6.3/config/files.html -// 'All of the relative patterns will get resolved using the basePath first.', where basePath is set by KGP to `node_modules` -config.files.push('./mockServiceWorker.js') +// 'All of the relative patterns will get resolved using the basePath first.', where basePath is NOT set by KGP to `node_modules` after migration to 1.9 +config.files.push('./node_modules/mockServiceWorker.js') diff --git a/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutCircular.kt b/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutCircular.kt index e032f7ee0b..e02f3ffa18 100644 --- a/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutCircular.kt +++ b/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutCircular.kt @@ -1,15 +1,12 @@ @file:Suppress("FILE_NAME_MATCH_CLASS", "HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE") -@file:JsModule("@react-sigma/layout-circular") -@file:JsNonModule package com.saveourtool.save.frontend.externals.graph.sigma.layouts -import react.* - /** * @param settings * @return [LayoutInstance] with positions and assign functions */ -@JsName("useLayoutCircular") +@JsModule("@react-sigma/layout-circular") +@JsNonModule @JsExport external fun useLayoutCircular(settings: dynamic = definedExternally): LayoutInstance diff --git a/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutForceAtlas2.kt b/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutForceAtlas2.kt index 2a1b490b77..76008bc9c1 100644 --- a/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutForceAtlas2.kt +++ b/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutForceAtlas2.kt @@ -1,14 +1,12 @@ @file:Suppress("FILE_NAME_MATCH_CLASS", "HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE") -@file:JsModule("@react-sigma/layout-forceatlas2") -@file:JsNonModule package com.saveourtool.save.frontend.externals.graph.sigma.layouts -import react.* - /** * @param settings * @return [LayoutInstance] with positions and assign functions */ -@JsName("useLayoutForceAtlas2") +@JsModule("@react-sigma/layout-forceatlas2") +@JsNonModule +@JsExport external fun useLayoutForceAtlas2(settings: dynamic = definedExternally): LayoutInstance diff --git a/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutRandom.kt b/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutRandom.kt index 8b229d530a..305b38a7da 100644 --- a/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutRandom.kt +++ b/save-frontend/src/main/kotlin/com/saveourtool/save/frontend/externals/graph/sigma/layouts/LayoutRandom.kt @@ -1,15 +1,12 @@ @file:Suppress("FILE_NAME_MATCH_CLASS", "HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE") -@file:JsModule("@react-sigma/layout-random") -@file:JsNonModule package com.saveourtool.save.frontend.externals.graph.sigma.layouts -import react.* - /** * @param settings * @return [LayoutInstance] with positions and assign functions */ -@JsName("useLayoutRandom") +@JsModule("@react-sigma/layout-random") +@JsNonModule @JsExport external fun useLayoutRandom(settings: dynamic = definedExternally): LayoutInstance