Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#515] [KMM Support] Refactor package names #511

Conversation

luongvo
Copy link
Member

@luongvo luongvo commented Aug 28, 2023

Closes #515

What happened 👀

  • Use the plural for packages with homogeneous contents.
  • Use the singular for packages with heterogeneous contents.

Insight 📝

As we're mixing between singular and plural in our codebase. I see the benefit and purpose of using plurals to explicit that the package contains multiple classes of the same type. Checking out some sample projects around, we can see this point of plural naming usage:

After researching, I found this best practice that could be applied to our template:

For example,

  • di ✅
  • module 👉 modules
  • screens ✅
  • model 👉 models
  • extensions
  • repository 👉 repositories
  • data ✅
  • domain ✅
  • providers ✅
  • service 👉services
  • usecase 👉 usecases

Proof Of Work 📹

The app works properly after migrating.

@luongvo luongvo self-assigned this Aug 28, 2023
@luongvo luongvo temporarily deployed to template-compose August 28, 2023 15:37 — with GitHub Actions Inactive
@github-actions
Copy link

github-actions bot commented Aug 28, 2023

11 Warnings
⚠️ Uh oh! ApiServiceProvider.kt is under 95% coverage!
⚠️ Uh oh! BaseSharedPreferences.kt is under 95% coverage!
⚠️ Uh oh! ConverterFactoryProvider.kt is under 95% coverage!
⚠️ Uh oh! EncryptedSharedPreferences.kt is under 95% coverage!
⚠️ Uh oh! HomeViewModel.kt is under 95% coverage!
⚠️ Uh oh! ResponseMapping.kt is under 95% coverage!
⚠️ Uh oh! RetrofitProvider.kt is under 95% coverage!
⚠️ Uh oh! SharedPreferencesExt.kt is under 95% coverage!
⚠️ Uh oh! UiModel.kt is under 95% coverage!
⚠️ Uh oh! Your project is under 80% coverage!
⚠️ Uh oh! HomeScreen.kt is under 95% coverage!

Kover report for template-xml:

🧛 Template - XML Unit Tests Code Coverage: 34.25%

Coverage of Modified Files:

File Coverage
ApiServiceProvider.kt 0.00%
AppPreferencesRepositoryImpl.kt 100.00%
BaseSharedPreferences.kt 0.00%
ConverterFactoryProvider.kt 0.00%
EncryptedSharedPreferences.kt 0.00%
Error.kt 100.00%
ErrorResponse.kt 100.00%
Exceptions.kt 100.00%
HomeViewModel.kt 0.00%
Model.kt 100.00%
MoshiBuilderProvider.kt 100.00%
RepositoryImpl.kt 100.00%
Response.kt 100.00%
ResponseMapping.kt 89.68%
RetrofitProvider.kt 0.00%
SharedPreferencesExt.kt 0.00%
UiModel.kt 0.00%
UseCase.kt 100.00%

Modified Files Not Found In Coverage Report:

.keep
ApiService.kt
AppPreferencesRepository.kt
AppPreferencesRepositoryImplTest.kt
HomeScreen.kt
HomeScreenTest.kt
HomeViewModelTest.kt
MockUtil.kt
MockUtil.kt
MockUtil.kt
MoshiModule.kt
PreferencesModule.kt
Repository.kt
RepositoryModule.kt
RepositoryTest.kt
ResponseMappingTest.kt
RetrofitModule.kt
StorageModule.kt
UseCaseTest.kt
proguard-rules.pro

Codebase cunningly covered by count Shroud 🧛

Kover report for template-compose:

🧛 Template - Compose Unit Tests Code Coverage: 62.07%

Coverage of Modified Files:

File Coverage
ApiServiceProvider.kt 0.00%
AppPreferencesRepositoryImpl.kt 100.00%
BaseSharedPreferences.kt 0.00%
ConverterFactoryProvider.kt 0.00%
EncryptedSharedPreferences.kt 0.00%
Error.kt 100.00%
ErrorResponse.kt 100.00%
Exceptions.kt 100.00%
HomeScreen.kt 64.06%
HomeViewModel.kt 100.00%
Model.kt 100.00%
MoshiBuilderProvider.kt 100.00%
RepositoryImpl.kt 100.00%
Response.kt 100.00%
ResponseMapping.kt 90.85%
RetrofitProvider.kt 0.00%
SharedPreferencesExt.kt 0.00%
UiModel.kt 84.21%
UseCase.kt 100.00%

Modified Files Not Found In Coverage Report:

.keep
ApiService.kt
AppPreferencesRepository.kt
AppPreferencesRepositoryImplTest.kt
HomeScreenTest.kt
HomeViewModelTest.kt
MockUtil.kt
MockUtil.kt
MockUtil.kt
MoshiModule.kt
PreferencesModule.kt
Repository.kt
RepositoryModule.kt
RepositoryTest.kt
ResponseMappingTest.kt
RetrofitModule.kt
StorageModule.kt
UseCaseTest.kt
proguard-rules.pro

Codebase cunningly covered by count Shroud 🧛

Generated by 🚫 Danger

@luongvo luongvo force-pushed the feature/kmm-support-refactor-all-package-names branch from 0785455 to cb097ec Compare August 29, 2023 15:25
@luongvo luongvo temporarily deployed to template-compose August 29, 2023 15:25 — with GitHub Actions Inactive
@luongvo luongvo temporarily deployed to template-compose August 31, 2023 05:01 — with GitHub Actions Inactive
@luongvo luongvo added this to the 3.24.0 milestone Aug 31, 2023
@luongvo luongvo temporarily deployed to template-compose August 31, 2023 05:16 — with GitHub Actions Inactive
@luongvo luongvo changed the title [KMM Support] Refactor package names [#515] [KMM Support] Refactor package names Aug 31, 2023
@luongvo luongvo temporarily deployed to template-compose August 31, 2023 05:16 — with GitHub Actions Inactive
@luongvo luongvo linked an issue Aug 31, 2023 that may be closed by this pull request
@luongvo luongvo force-pushed the feature/kmm-support-upgrade-to-gradle-8 branch from ce085dd to 4def9ea Compare August 31, 2023 06:41
@luongvo luongvo force-pushed the feature/kmm-support-refactor-all-package-names branch from cb097ec to ee6bab7 Compare August 31, 2023 06:42
@luongvo luongvo temporarily deployed to template-compose August 31, 2023 06:42 — with GitHub Actions Inactive
@luongvo luongvo marked this pull request as ready for review August 31, 2023 06:43
@luongvo luongvo requested a review from ryan-conway September 19, 2023 02:18
@ryan-conway ryan-conway merged commit 3b98ce2 into feature/kmm-support-upgrade-to-gradle-8 Sep 22, 2023
@ryan-conway ryan-conway deleted the feature/kmm-support-refactor-all-package-names branch September 22, 2023 03:07
@luongvo luongvo restored the feature/kmm-support-refactor-all-package-names branch September 22, 2023 03:56
@luongvo luongvo temporarily deployed to template-compose September 22, 2023 03:57 — with GitHub Actions Inactive
@luongvo luongvo temporarily deployed to template-compose September 22, 2023 03:58 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor package names
6 participants