Skip to content

Commit 838fde0

Browse files
authored
Merge pull request #454 from joreilly/dep_updates
dependency updates
2 parents b9191ff + 8825100 commit 838fde0

File tree

7 files changed

+127
-94
lines changed

7 files changed

+127
-94
lines changed

build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,13 @@ plugins {
1010
alias(libs.plugins.compose.compiler) apply false
1111
alias(libs.plugins.jetbrainsCompose) apply false
1212
}
13+
14+
allprojects {
15+
configurations.all {
16+
resolutionStrategy {
17+
force("org.jetbrains.kotlin:kotlin-test:2.2.21")
18+
force("org.jetbrains.kotlin:kotlin-test-common:2.2.21")
19+
force("org.jetbrains.kotlin:kotlin-test-annotations-common:2.2.21")
20+
}
21+
}
22+
}

compose-web/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ kotlin {
4040
}
4141

4242

43+

compose-web/src/wasmJsMain/kotlin/Main.kt

Lines changed: 75 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import androidx.compose.ui.text.style.TextAlign
4040
import androidx.compose.ui.unit.dp
4141
import androidx.compose.ui.unit.sp
4242
import androidx.compose.ui.window.CanvasBasedWindow
43+
import androidx.compose.ui.window.ComposeViewport
4344
import coil3.compose.AsyncImage
4445
import dev.johnoreilly.common.di.initKoin
4546
import dev.johnoreilly.common.remote.Assignment
@@ -59,96 +60,96 @@ fun main() {
5960

6061
val peopleInSpaceRepository = koin.get<PeopleInSpaceRepository>()
6162

62-
CanvasBasedWindow("PeopleInSpace", canvasElementId = "peopleInSpaceCanvas") {
63+
ComposeViewport(content = {
6364

64-
val people by peopleInSpaceRepository.fetchPeopleAsFlow().collectAsState(emptyList())
65-
var selectedPerson by remember { mutableStateOf<Assignment?>(null) }
65+
val people by peopleInSpaceRepository.fetchPeopleAsFlow().collectAsState(emptyList())
66+
var selectedPerson by remember { mutableStateOf<Assignment?>(null) }
6667

67-
Surface(
68-
modifier = Modifier.fillMaxSize(),
69-
color = backgroundColor
70-
) {
71-
Column(Modifier.fillMaxSize()) {
72-
// Header
73-
Box(
74-
modifier = Modifier
75-
.fillMaxWidth()
76-
.background(primaryColor)
77-
.padding(16.dp),
78-
contentAlignment = Alignment.Center
79-
) {
80-
Text(
81-
"People In Space",
82-
color = Color.White,
83-
fontSize = 24.sp,
84-
fontWeight = FontWeight.Bold
85-
)
86-
}
87-
88-
// Content
89-
Row(Modifier.fillMaxSize().padding(16.dp)) {
90-
// Left panel with list of people
91-
Card(
92-
modifier = Modifier.width(280.dp).fillMaxHeight(),
93-
colors = CardDefaults.cardColors(containerColor = cardColor),
94-
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp),
95-
shape = RoundedCornerShape(8.dp)
68+
Surface(
69+
modifier = Modifier.fillMaxSize(),
70+
color = backgroundColor
71+
) {
72+
Column(Modifier.fillMaxSize()) {
73+
// Header
74+
Box(
75+
modifier = Modifier
76+
.fillMaxWidth()
77+
.background(primaryColor)
78+
.padding(16.dp),
79+
contentAlignment = Alignment.Center
9680
) {
97-
Column(Modifier.fillMaxSize()) {
98-
Box(
99-
modifier = Modifier
100-
.fillMaxWidth()
101-
.background(primaryColor.copy(alpha = 0.8f))
102-
.padding(12.dp),
103-
contentAlignment = Alignment.Center
104-
) {
105-
Text(
106-
"Astronauts",
107-
color = Color.White,
108-
fontSize = 18.sp,
109-
fontWeight = FontWeight.Medium
110-
)
111-
}
112-
PersonList(people, selectedPerson) {
113-
selectedPerson = it
114-
}
115-
}
81+
Text(
82+
"People In Space",
83+
color = Color.White,
84+
fontSize = 24.sp,
85+
fontWeight = FontWeight.Bold
86+
)
11687
}
11788

118-
Spacer(modifier = Modifier.width(16.dp))
119-
120-
// Right panel with person details
121-
Card(
122-
modifier = Modifier.fillMaxSize(),
123-
colors = CardDefaults.cardColors(containerColor = cardColor),
124-
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp),
125-
shape = RoundedCornerShape(8.dp)
126-
) {
127-
Box(Modifier.fillMaxSize()) {
128-
selectedPerson?.let {
129-
PersonDetailsView(it)
130-
} ?: run {
131-
// Show a message when no person is selected
89+
// Content
90+
Row(Modifier.fillMaxSize().padding(16.dp)) {
91+
// Left panel with list of people
92+
Card(
93+
modifier = Modifier.width(280.dp).fillMaxHeight(),
94+
colors = CardDefaults.cardColors(containerColor = cardColor),
95+
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp),
96+
shape = RoundedCornerShape(8.dp)
97+
) {
98+
Column(Modifier.fillMaxSize()) {
13299
Box(
133-
modifier = Modifier.fillMaxSize(),
100+
modifier = Modifier
101+
.fillMaxWidth()
102+
.background(primaryColor.copy(alpha = 0.8f))
103+
.padding(12.dp),
134104
contentAlignment = Alignment.Center
135105
) {
136106
Text(
137-
"Select an astronaut to view details",
138-
style = TextStyle(
139-
color = Color.Gray,
140-
fontSize = 18.sp,
141-
textAlign = TextAlign.Center
142-
)
107+
"Astronauts",
108+
color = Color.White,
109+
fontSize = 18.sp,
110+
fontWeight = FontWeight.Medium
143111
)
144112
}
113+
PersonList(people, selectedPerson) {
114+
selectedPerson = it
115+
}
116+
}
117+
}
118+
119+
Spacer(modifier = Modifier.width(16.dp))
120+
121+
// Right panel with person details
122+
Card(
123+
modifier = Modifier.fillMaxSize(),
124+
colors = CardDefaults.cardColors(containerColor = cardColor),
125+
elevation = CardDefaults.cardElevation(defaultElevation = 4.dp),
126+
shape = RoundedCornerShape(8.dp)
127+
) {
128+
Box(Modifier.fillMaxSize()) {
129+
selectedPerson?.let {
130+
PersonDetailsView(it)
131+
} ?: run {
132+
// Show a message when no person is selected
133+
Box(
134+
modifier = Modifier.fillMaxSize(),
135+
contentAlignment = Alignment.Center
136+
) {
137+
Text(
138+
"Select an astronaut to view details",
139+
style = TextStyle(
140+
color = Color.Gray,
141+
fontSize = 18.sp,
142+
textAlign = TextAlign.Center
143+
)
144+
)
145+
}
146+
}
145147
}
146148
}
147149
}
148150
}
149151
}
150-
}
151-
}
152+
})
152153
}
153154

154155
@Composable

compose-web/src/wasmJsMain/resources/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,20 @@
44
<meta charset="UTF-8">
55

66
<title>PeopleInSpace with Kotlin/Wasm</title>
7+
<style>
8+
html, body {
9+
margin: 0;
10+
padding: 0;
11+
width: 100%;
12+
height: 100%;
13+
overflow: hidden;
14+
}
15+
#peopleInSpaceCanvas {
16+
width: 100%;
17+
height: 100%;
18+
display: block;
19+
}
20+
</style>
721
<script type="application/javascript" src="skiko.js"></script>
822
<script type="application/javascript" src="peopleinspace.js"></script>
923
</head>

gradle/libs.versions.toml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[versions]
2-
kotlin = "2.2.10"
3-
ksp = "2.2.10-2.0.2"
2+
kotlin = "2.2.21"
3+
ksp = "2.3.0"
44

5-
compose-multiplatform = "1.8.2"
5+
compose-multiplatform = "1.9.3"
66
composeUiTooling = "1.5.4"
77
coroutines = "1.10.2"
88
kotlinxSerialization = "1.9.0"
9-
androidGradlePlugin = "8.12.2"
9+
androidGradlePlugin = "8.13.1"
1010
koin = "4.1.1"
11-
koin-annotations = "2.2.0"
11+
koin-annotations = "2.3.1"
1212
ktor = "3.2.3"
1313
osmdroidAndroid = "6.1.20"
1414
osmAndroidCompose = "0.0.5"
@@ -21,29 +21,29 @@ webPackPlugin = "9.1.0"
2121
remoteCompose = "1.0.0-SNAPSHOT"
2222

2323

24-
androidxActivity = "1.10.1"
25-
androidxComposeBom = "2025.10.01"
26-
material3-adaptive = "1.2.0"
27-
material3-adaptive-navigation-suite = "1.4.0"
28-
androidxNavigationCompose = "2.9.5"
29-
uiToolingPreview = "1.9.4"
24+
androidxActivity = "1.12.0-rc01"
25+
androidxComposeBom = "2025.11.00"
26+
material3-adaptive = "1.3.0-alpha03"
27+
material3-adaptive-navigation-suite = "1.5.0-alpha08"
28+
androidxNavigationCompose = "2.9.6"
29+
uiToolingPreview = "1.10.0-beta02"
3030
wearCompose = "1.5.4"
31-
androidxLifecycle = "2.9.4"
31+
androidxLifecycle = "2.10.0-rc01"
3232
androidxLifecycleKMP = "2.9.5"
3333

3434
coilCompose = "2.7.0"
3535
coilCompose3 = "3.3.0"
3636

3737
horologist = "0.8.2-alpha"
38-
glanceAppWidget = "1.1.1"
39-
okhttp = "5.2.1"
38+
glanceAppWidget = "1.2.0-beta01"
39+
okhttp = "5.3.0"
4040
kermit = "2.0.8"
4141

42-
gradleVersionsPlugin = "0.52.0"
43-
shadowPlugin = "9.1.0"
44-
skie = "0.10.6"
42+
gradleVersionsPlugin = "0.53.0"
43+
shadowPlugin = "9.2.2"
44+
skie = "0.10.8"
4545

46-
mcp = "0.6.0"
46+
mcp = "0.7.7"
4747

4848
minSdk = "24"
4949
compileSdk = "36"
@@ -92,7 +92,7 @@ androidx-lifecycle-compose-kmp = { module = "org.jetbrains.androidx.lifecycle:li
9292

9393
androidx-tracing = "androidx.tracing:tracing:1.3.0"
9494

95-
splash-screen = "androidx.core:core-splashscreen:1.0.1"
95+
splash-screen = "androidx.core:core-splashscreen:1.2.0"
9696
metrics = "androidx.metrics:metrics-performance:1.0.0-beta02"
9797

9898
osmdroidAndroid = { module = "org.osmdroid:osmdroid-android", version.ref = "osmdroidAndroid" }

mcp-server/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ plugins {
66
}
77

88
dependencies {
9+
implementation(platform("io.ktor:ktor-bom:3.2.3"))
910
implementation(libs.mcp.kotlin)
1011
implementation(projects.common)
12+
implementation(libs.ktor.client.core)
13+
implementation(libs.ktor.client.java)
14+
implementation("io.ktor:ktor-server-core")
15+
implementation("io.ktor:ktor-server-cio")
16+
implementation("io.ktor:ktor-server-sse")
1117
}
1218

1319
java {

mcp-server/src/main/kotlin/server.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import io.modelcontextprotocol.kotlin.sdk.server.StdioServerTransport
1010
import io.modelcontextprotocol.kotlin.sdk.server.mcp
1111
import kotlinx.coroutines.Job
1212
import kotlinx.coroutines.runBlocking
13+
import kotlinx.coroutines.flow.first
1314
import kotlinx.io.asSink
1415
import kotlinx.io.buffered
1516

@@ -38,7 +39,7 @@ fun configureServer(): Server {
3839
name = "get-people-in-space",
3940
description = "The list of people in space endpoint returns the list of people in space right now"
4041
) {
41-
val people = peopleInSpaceRepository.fetchPeople()
42+
val people = peopleInSpaceRepository.fetchPeopleAsFlow().first()
4243
CallToolResult(
4344
content =
4445
people.map { TextContent(it.name) }

0 commit comments

Comments
 (0)