Use semver to expand version ranges for game-versions#115
Conversation
Wolf2323
left a comment
There was a problem hiding this comment.
The code looks good to me.
But while using it in my workflow I get this error:
Error: {
"error": "invalid_input",
"description": "Error with multipart data: Provided value '>=1.18' is not a valid variant for game_versions"
}Workflow run: https://github.com/BetonQuest/BetonQuest/actions/runs/25989476104/job/76393518447
From my understanding it should work fine however.
|
Thanks. The PR branch was targeted in your workflow, however, the Line 135 in d0035a7 I haven’t yet tested this PR, but I will do that in the coming days, make any modifications if needed, I’ll also of course update the docs, then undraft and look into merging this. |
|
Tested and works OK. Added docs, but I’m not 100% sure I’m happy with them |
semver to expand version ranges for gameVersionssemver to expand version ranges for game-versions
|
Hey, is there now a way to already use this? If I am right, I need to wait for a release? |
|
Yeah, need to make a release. Will do #116 now and make a release |
Adds interpretation for more complex version ranges using
>=,||,<,-, etc., usingsemver’s functionality for interpreting ranges.Since Mojang versions are not SemVer but still similar to it, some additional checks are done:
.0).gameVersions, which means you can manually specify snapshots/pre-releases, but crucially, anything that's not a range, also falls under this category, such as exact versions like1.21.11,26.1.2, etc. However, thesemverlibrary is happy to treat1.21.11as a range (of a single version), so an additional check (coerced === v) discriminates them as non-ranges.Backwards-compatible with the
1.21.xformat used previously, as thesemverlibrary interprets it correctly.