Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Nov 18, 2024
1 parent f66c001 commit 499cb9a
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 48 deletions.
29 changes: 29 additions & 0 deletions feature/main-impl-web/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
@file:OptIn(ExperimentalKotlinGradlePluginApi::class, ExperimentalWasmDsl::class)

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.kotlin.multiplatform)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.compose)
}

kotlin {
js() {
browser {}
}
wasmJs()

sourceSets {
commonMain.dependencies {
api(libs.bundles.jetbrains.androidx.navigation.compose.common)
api(libs.bundles.koin.common)
implementation(compose.material3)
}
}

compilerOptions {
jvmToolchain(libs.versions.jdk.get().toInt())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.michaelbel.movies.main

import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.navigation.NavHostController
import androidx.navigation.compose.rememberNavController

@Composable
fun MainContent(
navHostController: NavHostController = rememberNavController()
) {
MaterialTheme {
Text(
"Content"
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.michaelbel.movies.main.di

import org.koin.core.module.Module

expect val mainKoinModule: Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.michaelbel.movies.main.di

import org.koin.dsl.module

actual val mainKoinModule = module {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.michaelbel.movies.main.di

import org.koin.dsl.module

actual val mainKoinModule = module {}
4 changes: 3 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ include(
":feature:settings-impl",

":feature:debug",
":feature:debug-impl"
":feature:debug-impl",

":feature:main-impl-web",
)
12 changes: 1 addition & 11 deletions webApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ kotlin {
sourceSets {
commonMain.dependencies {
implementation(project(":core:platform-services:inject-web"))
//implementation(project(":feature:main-impl"))
implementation(project(":feature:main-impl-web"))

implementation(compose.runtime)
implementation(compose.foundation)
Expand All @@ -51,16 +51,6 @@ kotlin {
}
}

/*compose {
resources {
publicResClass = true
generateResClass = always
}
experimental {
web.application {}
}
}*/

compose.resources {
publicResClass = true
generateResClass = always
Expand Down
12 changes: 0 additions & 12 deletions webApp/src/commonMain/kotlin/org/michaelbel/movies/MainContent.kt

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,26 +1,5 @@
package org.michaelbel.movies.di

/*import org.koin.dsl.module
import org.michaelbel.movies.account.di.accountKoinModule
import org.michaelbel.movies.auth.di.authKoinModule
import org.michaelbel.movies.details.di.detailsKoinModule
import org.michaelbel.movies.feed.di.feedKoinModule
import org.michaelbel.movies.gallery.di.galleryKoinModule
import org.michaelbel.movies.main.di.mainKoinModule
import org.michaelbel.movies.platform.inject.flavorServiceKtorModule
import org.michaelbel.movies.search.di.searchKoinModule
import org.michaelbel.movies.settings.di.settingsKoinModule
import org.koin.dsl.module

internal val appKoinModule = module {
includes(
flavorServiceKtorModule,
mainKoinModule,
accountKoinModule,
authKoinModule,
detailsKoinModule,
feedKoinModule,
galleryKoinModule,
searchKoinModule,
settingsKoinModule
)
}*/
val appKoinModule = module {}
11 changes: 10 additions & 1 deletion webApp/src/jsMain/kotlin/org/michaelbel/movies/Main.js.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,23 @@ package org.michaelbel.movies
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.CanvasBasedWindow
import org.jetbrains.skiko.wasm.onWasmReady
import org.koin.compose.KoinApplication
import org.michaelbel.movies.di.appKoinModule
import org.michaelbel.movies.main.MainContent

fun main() {
onWasmReady {
CanvasBasedWindow(
title = "Movies",
canvasElementId = "ComposeTarget"
) {
MainContent()
KoinApplication(
application = {
modules(appKoinModule)
}
) {
MainContent()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package org.michaelbel.movies

import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.CanvasBasedWindow
import org.michaelbel.movies.main.MainContent

fun main() {
CanvasBasedWindow(
Expand Down

0 comments on commit 499cb9a

Please sign in to comment.