diff --git a/bin/deploy_all b/bin/deploy_all index d877752..376aa3e 100755 --- a/bin/deploy_all +++ b/bin/deploy_all @@ -17,15 +17,55 @@ # # -set -e -echo "publishing all artifacts" -echo -./gradlew publishToMavenLocal site:jsBrowserDistribution publish buildInstallablePlugin :lyng:linkReleaseExecutableLinuxX64 :lyng:installJvmDist --parallel --no-configuration-cache +set -euo pipefail -#echo -#echo "Creating plugin" -#echo -#./gradlew buildInstallablePlugin +GRADLE_ARGS=(--no-configuration-cache --console=plain) + +echo "actualizing Kotlin JS/Wasm lock files" +echo +./gradlew kotlinUpgradeYarnLock kotlinWasmUpgradeYarnLock "${GRADLE_ARGS[@]}" + +echo "building all artifacts" +echo +./gradlew publishToMavenLocal site:jsBrowserDistribution buildInstallablePlugin :lyng:linkReleaseExecutableLinuxX64 :lyng:installJvmDist --parallel "${GRADLE_ARGS[@]}" + +echo +echo "publishing remote Maven artifacts" +echo +tasks_log="$(mktemp)" +./gradlew tasks --all "${GRADLE_ARGS[@]}" >"$tasks_log" +mapfile -t publish_tasks < <( + sed -n 's/^\([^[:space:]]*publish.*PublicationToMavenRepository\) - .*$/:\1/p' "$tasks_log" | + sort -u +) +rm -f "$tasks_log" + +if [ "${#publish_tasks[@]}" -eq 0 ]; then + echo "No remote Maven publication tasks found." + exit 1 +fi + +for task in "${publish_tasks[@]}"; do + echo + echo "Publishing $task" + publish_log="$(mktemp)" + if ./gradlew "$task" "${GRADLE_ARGS[@]}" >"$publish_log" 2>&1; then + cat "$publish_log" + rm -f "$publish_log" + continue + fi + + if grep -Eiq '(^|[^0-9])409([^0-9]|$)|already exists|already been published|cannot be updated|Package file already exists|Repository does not allow updating assets' "$publish_log"; then + cat "$publish_log" + echo "Skipping $task: artifact already exists in the Maven repository." + rm -f "$publish_log" + continue + fi + + cat "$publish_log" + rm -f "$publish_log" + exit 1 +done echo echo "building CLI tools" diff --git a/docs/whats_new.md b/docs/whats_new.md index 881e8dd..b3210f7 100644 --- a/docs/whats_new.md +++ b/docs/whats_new.md @@ -1,17 +1,17 @@ # What's New in Lyng -This document highlights the current Lyng release, **1.5.6**, and the broader additions from the 1.5 cycle. +This document highlights the current Lyng release, **1.5.9**, and the broader additions from the 1.5 cycle. It is intentionally user-facing: new language features, new modules, new tools, and the practical things you can build with them. For a programmer-focused migration summary across 1.5.x, see `docs/whats_new_1_5.md`. -## Release 1.5.6 Highlights +## Release 1.5.9 Highlights -- `1.5.6` extends the 1.5 line with process execution helpers, a lightweight HTTP server, HTML rendering helpers, and better DSL support. +- `1.5.9` extends the 1.5 line with process execution helpers, a lightweight HTTP server, HTML rendering helpers, and better DSL support. - The 1.5 line now brings together richer ranges and loops, interpolation, math modules, immutable and observable collections, richer `lyngio`, and much better CLI/IDE support. -- `1.5.6` adds `lyng.io.process` with `sh(...)`, `exec(...)`, and `CommandRun` for shell scripting and external process control. -- `1.5.6` adds the `lyng.io.http.server` module for exact, regex, and path-template routing, JSON helpers, WebSocket routes, and `respondHtml { ... }`. -- `1.5.6` adds the pure Lyng `lyng.io.html` builder DSL and language support for receiver-stack function types and context receiver extensions. -- `1.5.6` expands serialization with canonical `Json.encode(...)` / `Json.decode(...)` and typed `Json.encodeAs(...)` / `Json.decodeAs(...)`. +- `1.5.9` adds `lyng.io.process` with `sh(...)`, `exec(...)`, and `CommandRun` for shell scripting and external process control. +- `1.5.9` adds the `lyng.io.http.server` module for exact, regex, and path-template routing, JSON helpers, WebSocket routes, and `respondHtml { ... }`. +- `1.5.9` adds the pure Lyng `lyng.io.html` builder DSL and language support for receiver-stack function types and context receiver extensions. +- `1.5.9` expands serialization with canonical `Json.encode(...)` / `Json.decode(...)` and typed `Json.encodeAs(...)` / `Json.decodeAs(...)`. - The docs, homepage samples, and release metadata now point at the current stable version. ## User Highlights Across 1.5.x @@ -28,7 +28,7 @@ For a programmer-focused migration summary across 1.5.x, see `docs/whats_new_1_5 - CLI improvements including the built-in formatter `lyng fmt` - Better IDE support and stronger docs around the released feature set -## New in 1.5.6 +## New in 1.5.9 ### Process Execution (`lyng.io.process`) Lyng scripts can now run external commands through a coroutine-friendly process API. @@ -435,7 +435,7 @@ Singleton objects are declared using the `object` keyword. They provide a conven ```lyng object Config { - val version = "1.5.6" + val version = "1.5.9" fun show() = println("Config version: " + version) } diff --git a/lynglib/build.gradle.kts b/lynglib/build.gradle.kts index c391bba..2ce1c4e 100644 --- a/lynglib/build.gradle.kts +++ b/lynglib/build.gradle.kts @@ -21,7 +21,7 @@ import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl import org.jetbrains.kotlin.gradle.dsl.JvmTarget group = "net.sergeych" -version = "1.5.7-SNAPSHOT" +version = "1.5.9" // Removed legacy buildscript classpath declarations; plugins are applied via the plugins DSL below diff --git a/site/src/jsMain/kotlin/HomePage.kt b/site/src/jsMain/kotlin/HomePage.kt index 18ffa97..12303e7 100644 --- a/site/src/jsMain/kotlin/HomePage.kt +++ b/site/src/jsMain/kotlin/HomePage.kt @@ -25,6 +25,11 @@ import org.jetbrains.compose.web.dom.* @Composable fun HomePage() { + val currentVersion = remember { + (window.asDynamic().LYNG_VERSION as? String) + ?.takeIf { it.isNotBlank() } + ?: "current" + } val samples = remember { listOf( """ @@ -159,7 +164,7 @@ fun HomePage() { val id = 101 val name = "Lyng" val base = { id:, name: } - val full = { ...base, version: "1.5.6", status: "stable", tags: ["typed", "portable"] } + val full = { ...base, version: "$currentVersion", status: "stable", tags: ["typed", "portable"] } println(full) """.trimIndent()