Skip to content

Conversation

@iTrooz
Copy link
Owner

@iTrooz iTrooz commented Jul 4, 2025

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

iTrooz added 2 commits July 4, 2025 18:12
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
Copilot AI review requested due to automatic review settings July 4, 2025 16:15
@iTrooz iTrooz changed the title refactor: replace ModSearchService with ModQueryService refactor: replace ModSearchService with ModQueryService + remove UnresolvedMod from ModpackCreator Jul 4, 2025
Copy link
Contributor

Copilot AI left a 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 ModQueryService and remove ModSearchService/MinecraftVersions
  • Update ModpackCreator, Svelte components, and CLI to use ModQueryService
  • 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 ModQueryService methods (getMinecraftVersions and searchMods) are not covered by existing tests; consider adding unit tests to validate their behavior.
export class ModQueryService {

@iTrooz iTrooz requested a review from ZeKap July 4, 2025 16:47
@iTrooz iTrooz changed the title refactor: replace ModSearchService with ModQueryService + remove UnresolvedMod from ModpackCreator refactor: replace ModSearchService with ModQueryService + make ModpackCreator into stateless SolutionFinder Jul 4, 2025
Copy link
Collaborator

@ZeKap ZeKap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@iTrooz iTrooz merged commit 6591e57 into main Jul 15, 2025
2 checks passed
@iTrooz iTrooz deleted the api_cleanup branch July 15, 2025 20:39
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.

3 participants