Version dropdowns, mod version switching, and never sending mods that would stop the game #5

Merged
Bewerkt merged 3 commits from claude/minecraft-mod-manager-h5capw into main 2026-10-12 16:43:54 +00:00
Bewerkt commented 2026-10-12 15:56:13 +00:00 (Migrated from github.com)

What changes

Version dropdowns

  • The new-pack, import and pack-settings forms use dropdowns for the Minecraft version and loader version.
    • The lists come from Fabric meta and the NeoForge Maven (cached).
    • "Other…" still allows typing a version, and the forms fall back to text fields when offline.
  • New GET /api/admin/versions. LoaderVersionResolver became VersionCatalog.

Change or remove mods from the search results

  • A result that is already in the pack shows "In pack · " with Change version and Remove.
  • The version dialog (also "Versions" in the mods table) lists every version for the pack's target, betas marked, the current one highlighted, and a manual-download link when the author disabled third-party downloads.
  • New endpoints GET …/mods/:id/versions and POST …/mods/:id/version. Only versions of the mod's own project are accepted.

Never send mods that would stop the game from starting (found while testing the NeoForge→Fabric switch)

  • Problem: Fabric and NeoForge check every mod before any mod runs, ManageMC included. A mod for the other loader, or one whose dependency is missing, crashes the game at start, and ManageMC can then never deliver a fix. The usual case is Fabric API: Fabric builds of mods need it, and Modrinth often doesn't list it as a dependency.

  • Jar inspector: reads required dependencies and provided ids per loader, size- and depth-capped:

    • fabric.mod.json depends / provides;
    • neoforge.mods.toml required dependencies (type="required" or mandatory=true);
    • the ids of bundled jars (META-INF/jars, META-INF/jarjar), so Fabric API's modules count as provided.

    The result is stored per mod (migration 5), and existing mods are read on startup.

  • Pack health: mods for another loader, and mods with missing dependencies (repeated until stable), are withheld from the manifest, so the pack always starts.

  • Mods tab: a problems panel with "Choose version", "Add from Modrinth" (Fabric API modules map to Fabric API) and Fix automatically. Fix automatically switches linked mods to the pack's loader and adds missing dependencies from Modrinth. Withheld mods are marked "Not sent".

  • Adding from Modrinth: also adds dependencies the jar requires but the platform does not list.

  • Limitation: version ranges are not evaluated, only presence.

Tests

  • Server: 54 tests. New:
    • NeoForge required/optional/mandatory dependency parsing;
    • withholding for wrong loader and transitive missing dependencies, with suggestions;
    • end to end: Sable/Veil without Fabric API are withheld, then appear once a Fabric-API-like jar with bundled modules is uploaded;
    • the versions endpoint and version switching validation.
  • Browser:
    • the problems panel with Not sent badges, and the panel disappearing after adding Fabric API;
    • the dropdowns and the version dialog (with stubbed platform data, as this sandbox cannot reach Modrinth, Fabric or NeoForge).
  • Manual: startup backfill read the dependencies of 19 existing mods.

🤖 Generated with Claude Code

https://claude.ai/code/session_016zdMyacgAzBQEBSiHc6aZJ

## What changes **Version dropdowns** - The new-pack, import and pack-settings forms use dropdowns for the Minecraft version and loader version. - The lists come from Fabric meta and the NeoForge Maven (cached). - "Other…" still allows typing a version, and the forms fall back to text fields when offline. - New `GET /api/admin/versions`. `LoaderVersionResolver` became `VersionCatalog`. **Change or remove mods from the search results** - A result that is already in the pack shows "In pack · <version>" with **Change version** and **Remove**. - The version dialog (also "Versions" in the mods table) lists every version for the pack's target, betas marked, the current one highlighted, and a manual-download link when the author disabled third-party downloads. - New endpoints `GET …/mods/:id/versions` and `POST …/mods/:id/version`. Only versions of the mod's own project are accepted. **Never send mods that would stop the game from starting** (found while testing the NeoForge→Fabric switch) - *Problem:* Fabric and NeoForge check every mod before any mod runs, ManageMC included. A mod for the other loader, or one whose dependency is missing, crashes the game at start, and ManageMC can then never deliver a fix. The usual case is Fabric API: Fabric builds of mods need it, and Modrinth often doesn't list it as a dependency. - *Jar inspector:* reads required dependencies and provided ids per loader, size- and depth-capped: - `fabric.mod.json` `depends` / `provides`; - `neoforge.mods.toml` required dependencies (`type="required"` or `mandatory=true`); - the ids of bundled jars (`META-INF/jars`, `META-INF/jarjar`), so Fabric API's modules count as provided. The result is stored per mod (migration 5), and existing mods are read on startup. - *Pack health:* mods for another loader, and mods with missing dependencies (repeated until stable), are **withheld from the manifest**, so the pack always starts. - *Mods tab:* a problems panel with "Choose <loader> version", "Add from Modrinth" (Fabric API modules map to Fabric API) and **Fix automatically**. Fix automatically switches linked mods to the pack's loader and adds missing dependencies from Modrinth. Withheld mods are marked "Not sent". - *Adding from Modrinth:* also adds dependencies the jar requires but the platform does not list. - *Limitation:* version ranges are not evaluated, only presence. ## Tests - Server: 54 tests. New: - NeoForge required/optional/mandatory dependency parsing; - withholding for wrong loader and transitive missing dependencies, with suggestions; - end to end: Sable/Veil without Fabric API are withheld, then appear once a Fabric-API-like jar with bundled modules is uploaded; - the versions endpoint and version switching validation. - Browser: - the problems panel with Not sent badges, and the panel disappearing after adding Fabric API; - the dropdowns and the version dialog (with stubbed platform data, as this sandbox cannot reach Modrinth, Fabric or NeoForge). - Manual: startup backfill read the dependencies of 19 existing mods. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016zdMyacgAzBQEBSiHc6aZJ
Sign in to join this conversation.
No description provided.