Skip to content

Commit

Permalink
Integrated "Module graph" plugin to visualise dependencies (#32)
Browse files Browse the repository at this point in the history
* Added plugin config

* Change the theme

* Focus on "navigation" module

* Focus on navigation and people

* Focus on chat list

* Changed theme

* Changed theme

* Changed theme

* Changed theme

* Focus on module Home
  • Loading branch information
dmitriy-chernysh authored Jan 23, 2025
1 parent 612590a commit bbca83c
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 3 deletions.
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,60 @@ subprojects {
* [Sample config](maestro/people-profile-flow.yaml)

##
## Modularization
## Module Graph

```mermaid
%%{
init: {
'theme': 'base',
'themeVariables': {"primaryTextColor":"#fff","primaryColor":"#5a4f7c","primaryBorderColor":"#5a4f7c","lineColor":"#f5a623","tertiaryColor":"#40375c","fontSize":"12px"}
}
}%%
graph LR
subgraph :core
:core:navigation["navigation"]
:core:ui["ui"]
:core:di["di"]
:core:domain["domain"]
:core:coroutines["coroutines"]
:core:util["util"]
:core:analytics["analytics"]
end
subgraph :feature
:feature:home["home"]
:feature:onboarding["onboarding"]
:feature:subscription["subscription"]
:feature:chat_list["chat_list"]
:feature:people["people"]
:feature:user_profile["user_profile"]
end
:core:navigation --> :core:ui
:core:navigation --> :core:di
:core:navigation --> :core:domain
:core:navigation --> :feature:home
:core:navigation --> :feature:onboarding
:core:navigation --> :feature:subscription
:core:navigation --> :feature:chat_list
:core:navigation --> :feature:people
:core:navigation --> :feature:user_profile
:app --> :core:navigation
:feature:home --> :core:ui
:feature:home --> :core:di
:feature:home --> :core:domain
:feature:home --> :core:coroutines
:feature:home --> :core:util
:feature:home --> :core:analytics
classDef focus fill:#FA8140,stroke:#fff,stroke-width:2px,color:#fff;
class :core:navigation focus
class :feature:home focus
```
### How to create the module graph

![modularization](doc/modularization.png)
```kotlin
./gradlew createModuleGraph
```

##
## Author:
Expand Down Expand Up @@ -111,4 +162,4 @@ limitations under the License.

**Forkers**

[![Forkers repo roster for @mobiledevpro/closetalk.app](http://reporoster.com/forks/dark/mobiledevpro/closetalk.app)](https://github.com/mobiledevpro/closetalk.app/network/members)
[![Forkers repo roster for @mobiledevpro/closetalk.app](http://reporoster.com/forks/dark/mobiledevpro/closetalk.app)](https://github.com/mobiledevpro/closetalk.app/network/members)
29 changes: 29 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import dev.iurysouza.modulegraph.Orientation
import dev.iurysouza.modulegraph.Theme

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.compose.compiler) apply false

// To generate a module graph
alias(libs.plugins.module.graph)
}

tasks.register("clean", Delete::class){
Expand All @@ -28,4 +34,27 @@ subprojects {
project.buildDir.absolutePath + "/compose_metrics"
)
}
}

moduleGraphConfig {
readmePath.set("${rootDir}/README.md")
heading = "## Module Graph"
orientation.set(Orientation.LEFT_TO_RIGHT) //optional
setStyleByModuleType.set(false)

focusedModulesRegex.set(".*(navigation|home).*")

theme.set(
Theme.BASE(
mapOf(
"primaryTextColor" to "#fff",
"primaryColor" to "#5a4f7c",
"primaryBorderColor" to "#5a4f7c",
"lineColor" to "#f5a623",
"tertiaryColor" to "#40375c",
"fontSize" to "12px",
),
focusColor = "#FA8140"
),
)
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ google-services = "4.4.2"
plugin-crashlytics = "3.0.2"
plugin-performance = "1.4.2"
plugin-protobuf = "0.9.4"
module-graph = "0.10.1"


# Libs
Expand Down Expand Up @@ -66,6 +67,7 @@ crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "plugin-cr
performance-monitor = { id = "com.google.firebase.firebase-perf", version.ref = "plugin-performance" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } # Compose Compiler plugin was added in Kotlin 2.0
google-protobuf = { id = "com.google.protobuf", version.ref = "plugin-protobuf" }
module-graph = { id = "dev.iurysouza.modulegraph", version.ref = "module-graph" }

[libraries]

Expand Down

0 comments on commit bbca83c

Please sign in to comment.