Skip to content

Commit

Permalink
add opportunity to add module with mermaid graph building
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanusMokrassar committed Sep 30, 2024
1 parent 4abb31d commit 5c983e5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
18 changes: 18 additions & 0 deletions mermaid/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.android.library"
id "org.jetbrains.dokka"
}

apply from: "$mppProjectWithSerialization"

kotlin {
sourceSets {
commonMain {
dependencies {
api project(":navigation.core")
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package dev.inmo.navigation.sample
package dev.inmo.navigation.mermaid

import dev.inmo.micro_utils.common.Either
import dev.inmo.micro_utils.common.either
Expand All @@ -11,10 +11,10 @@ object NavigationMermaidBuilder {
internal const val startedClassName = "navigation_mermaid_started"
internal val NavigationNodeState.className
get() = when (this) {
NavigationNodeState.NEW -> newClassName
NavigationNodeState.CREATED -> createdClassName
NavigationNodeState.STARTED -> startedClassName
NavigationNodeState.RESUMED -> resumedClassName
NavigationNodeState.NEW -> NavigationMermaidBuilder.newClassName
NavigationNodeState.CREATED -> NavigationMermaidBuilder.createdClassName
NavigationNodeState.STARTED -> NavigationMermaidBuilder.startedClassName
NavigationNodeState.RESUMED -> NavigationMermaidBuilder.resumedClassName
}

fun className(state: NavigationNodeState) = state.className
Expand Down
1 change: 1 addition & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ kotlin {
commonMain {
dependencies {
api project(":navigation.core")
api project(":navigation.mermaid")
api project(":navigation.mvvm")
api libs.microutils.startup.launcher
implementation compose.runtime
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package dev.inmo.navigation.sample.ui.tree

import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
import dev.inmo.kslog.common.i
import dev.inmo.kslog.common.logger
import dev.inmo.micro_utils.common.applyDiff
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
import dev.inmo.navigation.core.NavigationNode
import dev.inmo.navigation.core.configs.NavigationNodeDefaultConfig
import dev.inmo.navigation.core.extensions.onChangesInSubTree
import dev.inmo.navigation.core.extensions.rootChain
import dev.inmo.navigation.core.visiter.walk
import dev.inmo.navigation.core.visiter.walkOnNodes
import dev.inmo.navigation.mermaid.buildMermaidLines
import dev.inmo.navigation.mvvm.ViewModel
import dev.inmo.navigation.sample.buildMermaidLines
import kotlinx.coroutines.Job
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flowOf
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ String[] includes = [
":core",
":compose",
":mvvm",
":mermaid",
":sample",
":sample:android_client",
]
Expand Down

0 comments on commit 5c983e5

Please sign in to comment.