Skip to content

Clean up obsolete installation logic code#2138

Open
anttimaki wants to merge 10 commits into
developfrom
IRPI-06
Open

Clean up obsolete installation logic code#2138
anttimaki wants to merge 10 commits into
developfrom
IRPI-06

Conversation

@anttimaki
Copy link
Copy Markdown
Collaborator

No description provided.

- Keeping installation rules separately in memory is redundant as the
  InstallRulePluginInstaller reads them for EcosystemSchema now
- The code in InstallationRules class are used by the same installer
  class, so placing them in the same file makes sense
- Ingnored the comment about a new implementation for
  InstallationRules.validate as type safety will give an error if each
  PackageLoader doesn't define mod loader and plugin installers in the
  registry file
Accessing the instance of ProfileInstallerProvider actually initiates a
new object on each call. While a small overhead, it's still unnecessary
as all mods being installed at one go can be assumed to use the same
PackageInstaller class.
Use Thunderstore's ecosystem schema as the source of truth.
Some of the usages checked that the package mapping is related to
correct PackageLoader, but after the changes the each PackageInstaller
should get called only with such packages anyhow, so it feels safe to
drop this check.
Checking that the package is a mod loader should suffice, as the
uninstall method should be called only if the package is associated
with the PackageLoader of the active game.
Ideally the data would be included in the Thunderstore API. Until that
day comes, keep the hardocoded values in the EcosystemSchema.
The responsibilities have been taken over by the EcosystemSchema and
the file is now unused.
EcosystemSchema now provides the data using the format used by the
schema. This differs a bit from the old interface, but current usage
only accesses rootFolder attribute so it doesn't matter.
- Add explicit return types to avoid accidental future changes
- Simplify "best fit rule" by dropping checks for impossible undefined
@anttimaki anttimaki requested a review from ebkr April 21, 2026 12:18
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.

2 participants