Skip to content

[Feature] Modularisation #23

Closed
Closed

Description

@scholzfuni

What would you like?
I would love to see a modularisation for certain "parts" of the code.
In almost all of the Projects linked to previous WWDCs, Apple split their code into separate and local packages.

Creating modules for UI, Services, etc? Might be a good option.

Why is this useful?
Modularisation declutters code and makes it more accessible for testing, debugging and further development. The code is very clean and has a distinct purpose.

Alternatives considered
Leave the code as is. I'd be happy to split the code into modules. Feel free to drop further suggestions!

Activity

  1. momenbasel commented on Apr 14, 2026

    @momenbasel
    Owner

    The codebase is already well-organized into Models/, Views/, ViewModels/, Services/, Core/, Extensions/. For the current project size (~15 source files), splitting into SPM packages would add build complexity without meaningful benefit.

    When it makes sense: If PureMac grows to include a CLI target (#17), a menu bar agent, or a privileged helper — then extracting ScanEngine, CleaningEngine, and the model layer into a shared PureMacCore package would prevent duplication.

    Not prioritizing this now, but open to revisiting if the project grows. If you want to prototype the package structure, feel free to submit a draft PR.

  2. momenbasel commented on Apr 14, 2026

    @momenbasel
    Owner

    Appreciate the offer to help @scholzfuni! The Apple WWDC package pattern is a solid reference. If the CLI target (#17) moves forward, your help splitting out a shared core package would be really valuable.

  3. momenbasel commented on Apr 14, 2026

    @momenbasel
    Owner

    Hey @scholzfuni! v2.0 expanded the project structure significantly:

    Logic/Scanning/ (AppPathFinder, Locations, Conditions, AppInfoFetcher, StringNormalization)
    Logic/Utilities/ (Logger)
    Models/ (Models, ScanError)
    Views/Apps/, Views/Cleaning/, Views/Orphans/, Views/Settings/, Views/Components/
    Services/ (ScanEngine, CleaningEngine, FullDiskAccessManager, SchedulerService)

    Now at 25 source files with clear separation. Still not SPM packages, but the folder structure follows the pattern you suggested. When the CLI target is added, extracting a shared PureMacCore package will make more sense.

    Thanks for the suggestion - it influenced how we organized v2!

  4. momenbasel commented on Apr 14, 2026

    @momenbasel
    Owner

    Hey @scholzfuni! Just wanted to let you know - you're credited in the v2.0 README under the Acknowledgments section for your modularization proposal. The v2 folder structure was influenced by your thinking. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions