raamcosta / compose-destinations

Annotation processing library for type-safe Jetpack Compose navigation with no boilerplate.
https://composedestinations.rafaelcosta.xyz
Apache License 2.0
3.14k stars 129 forks source link

[Improvement] moduleName could be automatically raname to "main" #648

Closed GuilhE closed 1 month ago

GuilhE commented 1 month ago

Like we discussed in slack @raamcosta , with 2.1.0-beta08, for this configuration example:

ksp {
    arg("compose-destinations.moduleName", "authentication")
    arg("compose-destinations.codeGenPackageName", "com.feature.authentication")
}

the output is:

internal object AuthenticationNavGraphs {
    val authenticationAuthentication = AuthenticationNavGraph
}

which I believe it could be improved to something like:

internal object AuthenticationNavGraphs {
    val main = AuthenticationNavGraph
}

When the graph has the same name as the module.

What are your thoughts on this? 🤔

raamcosta commented 1 month ago

Totally agree! Done!

Will be available on beta09 versions, which are cooking atm! Also fixed the issue with the module name being prefixed on NavGraphs object fields.