User Tools

Site Tools


documentation:fabric_mod_json_spec

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
documentation:fabric_mod_json_spec [2020/02/07 22:35] – created juuzdocumentation:fabric_mod_json_spec [2023/12/27 12:54] (current) mineblock11
Line 1: Line 1:
-====== fabric.mod.json ======+====== fabric.mod.json Specification ======
  
 In all cases, the mod JSON, ''fabric.mod.json'', is defined as either: In all cases, the mod JSON, ''fabric.mod.json'', is defined as either:
Line 65: Line 65:
 === VersionRange === === VersionRange ===
  
-A string or array of string declaring supported version ranges. In the case of an array, an "OR" relationship is assumed - that is, only one range has to match for the collective range to be satisfied.+A string or array of string declaring supported version ranges in the form ''<operator1><range1>[ <operator2><range2>]...''. Multiple space separated ranges within the same string follow an "AND" relationship - they must all be satisfied. In the case of an array, an "OR" relationship is assumed between the array elements - that is, only one element has to match for the collective declaration to be satisfied.
  
-In the case of all versions, ''*'' is a special string declaring that any version is matched by the range. In addition, exact string matches must be possible regardless of the version type.+In the case of all versions, ''*'' is a special string declaring that any version is matched by the range. Fabric Loader supports a [[https://semver.org/ semver 2.0.0]] superset that allows an arbitrary amount of version components, empty pre-release and arbitrary build metadata. Version strings that are incompatible with this format are still accepted, but comparison support is limited to equality operators.
  
-For semantic versions, the specification follows a rough subset of the [[https://docs.npmjs.com/misc/semver|NPM semver]] specification, in particular the following features are supported:+Versions compatible with the extended semver format are compared as defined by [[https://semver.org/ semver 2.0.0]] with arbitrary version component comparisons beign done left to right for all componentstreating absent components as ''0''. The empty pre-release is the earliest possible pre-release, making ''1.2-'' the earliest possible version in the ''1.2'' series, intended for comparison operand declarations. Build metadata is ignored for comparison as usual.
  
-  * ''='' as a leading character, or the lack of one, denoting an exact match, +The following declarations are supported for version strings compatible with this semver superset:
-  * Version ranges - a set of space-delimited comparators of the ''>='', ''>'', ''<='', ''<'', ''='' or no prefix, following NPM behaviour and declaring an intersection of supported versions within the scope of the string, +
-  * X-Ranges, +
-  * Tilde Ranges, +
-  * Caret Ranges.+
  
 +  * standalone ''<version>'', denoting an exact version match
 +  * standard operators ''<operator><version>'' comparing to the declared version
 +    * ''='', ''>='', ''>'', ''<''''='', ''<'' for equal, greater or equal, greater, less or equal, less
 +    * ''^'' for same version and up within the same major version: ''^a.b.c'' is equivalent to ''>=a.b.c <(a+1).0.0-''
 +    * ''~'' for same version and up within the same minor version: ''~a.b.c'' is equivalent to ''>=a.b.c <a.(b+1).0-''
 +  * X-Ranges: ''<vcp>.x'', ''<vcp>.X'' or ''<vcp>.*'' for same ''<vcp>'' where ''<vcp>'' is ''<major>'' or ''<major>.<minor>'', e.g. ''1.x'' for ''>=1- <2-'' or ''1.2.x'' for ''>=1.2- <1.3-''. Additional trailing ''.x''/''.X''/''.*'' are allowed but have no effect
 +
 +All operators always work the same regardless of the version they are matching against, there is no special casing for ''0.x''.
 ==== Mandatory fields ==== ==== Mandatory fields ====
  
Line 94: Line 98:
     * string values,     * string values,
     * objects containing a "config" key (filename), as well as optional keys of the following types: "environment".     * objects containing a "config" key (filename), as well as optional keys of the following types: "environment".
 +  * **accessWidener**: A file path to an [[tutorial:accesswideners|access widener]] relative to the mod root. If not present, assume the mod has no access widener.
  
 ==== Optional fields (dependency resolution) ==== ==== Optional fields (dependency resolution) ====
documentation/fabric_mod_json_spec.1581114926.txt.gz · Last modified: 2020/02/07 22:35 by juuz