-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: replace ModSearchService with ModQueryService + make ModpackCreator into stateless SolutionFinder #41
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
Conversation
This new service handles everything related to querying APIs. This change is made to later introduce a backend mode where another ModQueryService implementation could ask our backend instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Refactors the codebase to replace the old ModSearchService and MinecraftVersions classes with a single ModQueryService, centralizing all API queries under one service and updating dependent modules.
- Introduce
ModQueryServiceand removeModSearchService/MinecraftVersions - Update
ModpackCreator, Svelte components, and CLI to useModQueryService - Remove unused exports and streamline configuration
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/routes/+page.svelte | Switch from MinecraftVersions to config.modQueryService and update ModpackCreator usage |
| web/src/config.ts | Replace MinecraftVersions with modQueryService and keep repositories |
| web/src/components/ModSearch.svelte | Remove ModSearchService, use modQueryService.searchMods |
| mclib/src/index.ts | Alias exports: ModQueryService as ModSearchService and expose it directly |
| mclib/src/ModpackCreator.ts | Inject ModQueryService, remove old resolveMod logic and update addMod |
| mclib/src/ModSearchService.ts | Deleted legacy ModSearchService |
| mclib/src/ModQueryService.ts | New unified query service for versions, mod search, and releases |
| mclib/src/MinecraftVersions.ts | Deleted legacy version-fetching class |
| cli/src/index.ts | Update CLI commands to instantiate ModpackCreator with ModQueryService |
Comments suppressed due to low confidence (1)
mclib/src/ModQueryService.ts:4
- The new
ModQueryServicemethods (getMinecraftVersionsandsearchMods) are not covered by existing tests; consider adding unit tests to validate their behavior.
export class ModQueryService {
ZeKap
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This new service handles everything related to querying APIs.
This change is made to later introduce a backend mode where another ModQueryService implementation could ask our backend instead