project version bump to 0.6.0, and bump kotest, tstl, typescript

This commit is contained in:
Adam 2022-06-19 10:54:37 +02:00
parent a225b65901
commit 0398e2026d
11 changed files with 74 additions and 88 deletions

View file

@ -12,7 +12,7 @@ plugins {
} }
group = "dev.adamko.kafkatorio" group = "dev.adamko.kafkatorio"
version = "0.5.1" version = "0.6.0"
val licenseFile: RegularFile by extra(layout.projectDirectory.file("LICENSE")) val licenseFile: RegularFile by extra(layout.projectDirectory.file("LICENSE"))

View file

@ -39,7 +39,7 @@ kotkaStreams = "dev-SNAPSHOT"
## test ## ## test ##
junit = "5.8.2" junit = "5.8.2"
kotest = "5.3.0" kotest = "5.3.1"
mockk = "1.12.4" mockk = "1.12.4"
## infra ## ## infra ##

View file

@ -19,8 +19,6 @@ description = "Sends in-game information to a server over the internet (requires
// Factorio required format is: // Factorio required format is:
// - filename: `mod-name_version.zip` // - filename: `mod-name_version.zip`
// - zip contains one directory, `mod-name` // - zip contains one directory, `mod-name`
//val modName: String by extra { "${rootProject.name}-events" } //val modName: String by extra { "${rootProject.name}-events" }
extra.set("modName", "kafkatorio-events") extra.set("modName", "kafkatorio-events")
val modName = extra.get("modName") as String val modName = extra.get("modName") as String
@ -161,34 +159,6 @@ tasks.withType<Zip>().configureEach {
} }
//val downloadFactorioApiDocs by tasks.registering {
// group = project.name
//
// val target = uri("https://lua-api.factorio.com/latest/runtime-api.json")
// val apiFilename = File(target.path).name
// val downloadedFile = file("$temporaryDir/$apiFilename")
//
// val apiFile = layout.buildDirectory.file(apiFilename)
// outputs.file(apiFile)
//
// doLast {
//
// ant.invokeMethod(
// "get", mapOf(
// "src" to target,
// "dest" to downloadedFile,
// "verbose" to true,
// )
// )
//
// val json = downloadedFile.readText()
// val prettyJson = JsonOutput.prettyPrint(json)
//
// apiFile.get().asFile.writeText(prettyJson)
//
// logger.lifecycle("Downloaded Factorio API json: $apiFile")
// }
//}
val factorioModProvider by configurations.registering { val factorioModProvider by configurations.registering {
asProvider() asProvider()
@ -212,6 +182,24 @@ tasks.updatePackageJson {
tasks.assemble { dependsOn(installEventsTsSchema, tasks.updatePackageJson) } tasks.assemble { dependsOn(installEventsTsSchema, tasks.updatePackageJson) }
idea {
module {
sourceDirs = sourceDirs + file("src/main/typescript")
resourceDirs = resourceDirs + file("src/main/resources")
testSourceDirs = testSourceDirs + file("src/test/typescript")
iml {
whenMerged {
require(this is org.gradle.plugins.ide.idea.model.Module)
sourceDirs = sourceDirs + file("src/main/typescript")
resourceDirs = resourceDirs + file("src/main/resources")
testSourceDirs = testSourceDirs + file("src/test/typescript")
}
}
}
}
// trying to get Gradle+idea to recognise the ts-src... // trying to get Gradle+idea to recognise the ts-src...
//val typescriptSrcSet = project.objects.sourceDirectorySet("typescript", "TypeScript").apply { //val typescriptSrcSet = project.objects.sourceDirectorySet("typescript", "TypeScript").apply {
@ -242,20 +230,31 @@ tasks.assemble { dependsOn(installEventsTsSchema, tasks.updatePackageJson) }
// } // }
// } // }
//} //}
//val downloadFactorioApiDocs by tasks.registering {
idea { // group = project.name
module { //
sourceDirs = sourceDirs + file("src/main/typescript") // val target = uri("https://lua-api.factorio.com/latest/runtime-api.json")
resourceDirs = resourceDirs + file("src/main/resources") // val apiFilename = File(target.path).name
testSourceDirs = testSourceDirs + file("src/test/typescript") // val downloadedFile = file("$temporaryDir/$apiFilename")
iml { //
whenMerged { // val apiFile = layout.buildDirectory.file(apiFilename)
require(this is org.gradle.plugins.ide.idea.model.Module) // outputs.file(apiFile)
//
sourceDirs = sourceDirs + file("src/main/typescript") // doLast {
resourceDirs = resourceDirs + file("src/main/resources") //
testSourceDirs = testSourceDirs + file("src/test/typescript") // ant.invokeMethod(
} // "get", mapOf(
} // "src" to target,
} // "dest" to downloadedFile,
} // "verbose" to true,
// )
// )
//
// val json = downloadedFile.readText()
// val prettyJson = JsonOutput.prettyPrint(json)
//
// apiFile.get().asFile.writeText(prettyJson)
//
// logger.lifecycle("Downloaded Factorio API json: $apiFile")
// }
//}

View file

@ -1,6 +1,6 @@
{ {
"name": "kafkatorio-events-mod", "name": "kafkatorio-events-mod",
"version": "0.5.1", "version": "0.6.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -50,19 +50,19 @@
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
}, },
"resolve": { "resolve": {
"version": "1.22.0", "version": "1.22.1",
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz",
"integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==",
"requires": { "requires": {
"is-core-module": "^2.8.1", "is-core-module": "^2.9.0",
"path-parse": "^1.0.7", "path-parse": "^1.0.7",
"supports-preserve-symlinks-flag": "^1.0.0" "supports-preserve-symlinks-flag": "^1.0.0"
} }
}, },
"source-map": { "source-map": {
"version": "0.7.3", "version": "0.7.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz",
"integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==" "integrity": "sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA=="
}, },
"supports-preserve-symlinks-flag": { "supports-preserve-symlinks-flag": {
"version": "1.0.0", "version": "1.0.0",
@ -75,19 +75,19 @@
"integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==" "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ=="
}, },
"typed-factorio": { "typed-factorio": {
"version": "1.1.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/typed-factorio/-/typed-factorio-1.1.0.tgz", "resolved": "https://registry.npmjs.org/typed-factorio/-/typed-factorio-1.2.0.tgz",
"integrity": "sha512-SiUdkpEDblr0/Ntmj5uNaymC3HIdnw77iDzAsUScT0PZXsEZjDMeRguavhqHsjazYHOYCE/FS4oHoUHS8HMaWA==" "integrity": "sha512-6iC5YtJYbR2S12kFujIGzZNhBcQwbaSWIAC7iKbIxh8LhVuIDJoInZOg36DTny5GHDdwi0eSTX/wyCqFAbul0Q=="
}, },
"typescript": { "typescript": {
"version": "4.6.2", "version": "4.7.4",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
"integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==" "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ=="
}, },
"typescript-to-lua": { "typescript-to-lua": {
"version": "1.4.4", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/typescript-to-lua/-/typescript-to-lua-1.4.4.tgz", "resolved": "https://registry.npmjs.org/typescript-to-lua/-/typescript-to-lua-1.6.0.tgz",
"integrity": "sha512-HqXDi0rjYANvVeOJlYAyjwCvLtpXV+RRp9GiknCJrd8+0D9G/2yZ5rO+LsDlY1y09sZ4xmufwsiZ6iNFm+o1GQ==", "integrity": "sha512-s0MWAMnjl2h0qzf02/iULHCFdv3k4Qvj9gAA7nejjPbeHg+paYJZ/MwOrk7n2+gQkztGhJxCE15J9KIv6oIIIw==",
"requires": { "requires": {
"enhanced-resolve": "^5.8.2", "enhanced-resolve": "^5.8.2",
"resolve": "^1.15.1", "resolve": "^1.15.1",

View file

@ -1,6 +1,6 @@
{ {
"name": "kafkatorio-events-mod", "name": "kafkatorio-events-mod",
"version": "0.5.1", "version": "0.6.0",
"private": true, "private": true,
"scripts": { "scripts": {
"build": "tstl", "build": "tstl",
@ -12,9 +12,9 @@
"devDependencies": {}, "devDependencies": {},
"dependencies": { "dependencies": {
"lua-types": "^2.11.0", "lua-types": "^2.11.0",
"typescript-to-lua": "1.4.4", "typescript-to-lua": "1.6.0",
"typed-factorio": "1.1.0", "typed-factorio": "1.2.0",
"typescript": "4.6.2" "typescript": "4.7.4"
}, },
"license": "UNLICENSED", "license": "UNLICENSED",
"peerDependencies": {}, "peerDependencies": {},

View file

@ -50,9 +50,3 @@ suspend fun main() {
} }
} }
} }
// Runtime.getRuntime().addShutdownHook(Thread {
// webServer.stop()
// })
// launch {
// }
//}

View file

@ -6,7 +6,7 @@ import org.http4k.server.PolyHandler
import org.http4k.server.Undertow import org.http4k.server.Undertow
import org.http4k.server.asServer import org.http4k.server.asServer
internal suspend fun webServer( internal fun webServer(
tileServer: WebMapTileServer, tileServer: WebMapTileServer,
wsServer: WebsocketServer, wsServer: WebsocketServer,
appProps: ApplicationProperties, appProps: ApplicationProperties,

View file

@ -98,10 +98,7 @@ class WebsocketServer {
val clientJob = SupervisorJob(serverScope.coroutineContext.job) val clientJob = SupervisorJob(serverScope.coroutineContext.job)
serverScope.launch(CoroutineName("ws-client-$id") + clientJob) { serverScope.launch(CoroutineName("ws-client-$id") + clientJob) {
// return serverScope.launch(CoroutineName("ws-client-$id")) {
// supervisorScope {
launch { launch {
suspendCancellableCoroutine<WsStatus> { cont -> suspendCancellableCoroutine<WsStatus> { cont ->
println("[ws-client] entering suspendCancellableCoroutine") println("[ws-client] entering suspendCancellableCoroutine")
@ -138,11 +135,7 @@ class WebsocketServer {
.onEach { msg -> .onEach { msg ->
println("[ws-client] sending message to $id") println("[ws-client] sending message to $id")
ws.send(WsMessage(msg)) ws.send(WsMessage(msg))
} }.launchIn(this)
.launchIn(this)
} }
// }
} }
} }

View file

@ -1,4 +1,4 @@
# Do not edit manually. This file was created with task 'dockerEnv' # Do not edit manually. This file was created with task 'dockerEnv'
COMPOSE_PROJECT_NAME=kafkatorio COMPOSE_PROJECT_NAME=kafkatorio
FACTORIO_VERSION=1.1.59 FACTORIO_VERSION=1.1.59
KAFKATORIO_VERSION=0.5.1 KAFKATORIO_VERSION=0.6.0

View file

@ -1,7 +1,7 @@
# Do not edit manually. This file was created with task 'dockerEnv' # Do not edit manually. This file was created with task 'dockerEnv'
COMPOSE_PROJECT_NAME=kafkatorio COMPOSE_PROJECT_NAME=kafkatorio
GRAFANA_VERSION=8.5.0 GRAFANA_VERSION=8.5.0
KAFKATORIO_VERSION=0.5.1 KAFKATORIO_VERSION=0.6.0
KAFKA_DL_URL=https\://dlcdn.apache.org/kafka/3.2.0/kafka_2.13-3.2.0.tgz KAFKA_DL_URL=https\://dlcdn.apache.org/kafka/3.2.0/kafka_2.13-3.2.0.tgz
KAFKA_VERSION=3.2.0 KAFKA_VERSION=3.2.0
PROMETHEUS_VERSION=v2.34.0 PROMETHEUS_VERSION=v2.34.0

View file

@ -1,3 +1,3 @@
# Do not edit manually. This file was created with task 'dockerEnv' # Do not edit manually. This file was created with task 'dockerEnv'
COMPOSE_PROJECT_NAME=kafkatorio COMPOSE_PROJECT_NAME=kafkatorio
KAFKATORIO_VERSION=0.5.1 KAFKATORIO_VERSION=0.6.0