Skip to content

refactor: decouple commands from god-module lib.rs#1

Open
vibemasshq-dev wants to merge 1 commit into
bluebleed:mainfrom
vibemasshq-dev:fix-architecture-and-errors
Open

refactor: decouple commands from god-module lib.rs#1
vibemasshq-dev wants to merge 1 commit into
bluebleed:mainfrom
vibemasshq-dev:fix-architecture-and-errors

Conversation

@vibemasshq-dev

Copy link
Copy Markdown

Hi there! 👋 I've been really enjoying the Downpour application and wanted to contribute to the codebase by helping organize the core architecture.

What does this PR do?
I actually ran your codebase through an AI CTO tool I'm building called VibeMass, and its Architecture Agent flagged src-tauri/src/lib.rs as a "God-module" bottleneck because it handles the registration of 19 different Tauri commands along with extensive state wiring.

I took a look, and the AI was spot on! It was definitely getting a bit crowded in there, so I rolled up my sleeves and refactored that structure to make the codebase much easier for you to maintain and scale.

Specifically, I have:

  • Created a dedicated src-tauri/src/commands/ module directory.
  • Extracted and grouped related command logic into dedicated sub-modules (download.rs, queue.rs, media.rs, settings.rs, and system.rs).
  • Streamlined lib.rs so its primary responsibility is now just importing and exposing these granular modules.

Validation:
I've strictly followed the CONTRIBUTING.md guidelines to ensure this doesn't break anything:

  • cargo fmt applied
  • cargo clippy -- -D warnings passes perfectly
  • cargo test passes (197 unit tests, 10 integration tests)
  • node extension/filter.property.test.js passes
  • ✅ Full production native build tested successfully

Thank you for building such an awesome project! I hope this architectural improvement (and my AI's catch) makes future development even smoother.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant