-
-
Notifications
You must be signed in to change notification settings - Fork 199
Suggestion: Improved JSON format for mod info #637
Comments
By all means, I totally agree and think this is a great specification. Big Problems
Suggested Improvements
Edit |
Overall 👍 to the idea |
|
Semver is definitely a long term goal for versioning.. |
Why is semantic versioning a requirement for automatic update checking? Surely as long as versions are dotted-numeric, it's easy to compare them. |
semver is an easy way to specify dotted numeric, and it also provides a relationship between the various numbers separated by the dots, allowing for lessthan and greaterthan relationships to be asserted.. |
I'm just confused about that, because you can already compare dotted-numeric version numbers, even if they don't follow semver. What would Forge do with enforced semver anyway? I guess you could have an option for "only show major updates" or something like that - but "major" means something different to players than to developers, and it doesn't exactly correspond to the first part of a semver number. |
Problem is when people start include reviews or alphabetic characters. Semver just says how to compare them but more importantly when increase which version number. |
We will NEVER get people to agree on specifically semver. But hopefully getting people to agree on psudo-semver is the idea. |
Here's an idea for the version arguments: How about we have two version fields? One would be an integer for machines, which would be incremented every version, and one would be a string for users, which would not have to follow any format whatsoever. |
Give it up, I tried this year's ago, most modders, programmers, etc are too stupid to follow decent versioning, proper api handling, or anything that make a modicum of sense at all. |
Any progress here? |
Write me a regex (or two) that detects semver compatible version strings, and also supports x.x.x.x.x.x.x with infinite separated numbers, and also accounts for a preceding MC version. Then I can put that in ForgeGradle as a warning and hopefully start nudging everyone over. |
@AbrarSyed https://regex101.com/r/tT1dX7/3 though, if you also want it to be a minimum of x.y.z as the version string, I would use |
Though if you want a more... Advanced one that is lenient to (x.y.z-)a.b.c...(-ANYTHING) kashike and I ended up with this which has named capture groups for Minecraft and full version (which contains version and extra). The examples in the link should help explain it. |
@Cazzar |
@ST-DDT that's as simple as prefixing the regex with: |
Remember that semver allows for prerelease |
@Cazzar We need one regex to verify the format. |
Introduction
After having spent quite a bit of time working with NodeJS and NPM, I've become quite impressed with the power and simplicity of the package.json file format. I've noticed that FML internally uses a somewhat similar format in the form of the mcmod.info file, but I've found that there are a few drawbacks to the format:
mcmod.info
in the JAR, there doesn't seem to be a public repository of these files. As a result, each mod needs to write its own update checking logic (or rely on a shared library).mcmod.info
is arbitrary. As a result, update checking logic must be unique to the version format used by the mod author.mcmod.info
do not specify version information.The
package.json
format used by nodejs shares similar characteristics withmcmod.info
, but provides some additional capabilities:Proposal
I propose that a new JSON format be introduced for FML mods. This format would use the following structure:
Dependencies
A dependency can specify the version range required (useful both for version testing when loading the mod, and to allow loaders or mod management tools to check for updates and version mismatches. For an example of version ranges, see https://docs.npmjs.com/misc/semver.
Example
Here is an example from converting the mcmod.info for Thermal Foundation:
And here is an example for Forge:
Benefits
By adopting this format, and assuming a central repository to which mod authors could publish these files, in addition to embedding them in the JAR, there would be a number of benefits:
The text was updated successfully, but these errors were encountered: