User Tools

Site Tools


format:modjson

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
format:modjson [2019/02/20 09:22] – rework contact/person, add dependency resolution info asieformat:modjson [2019/05/21 17:06] (current) – removed falseresync
Line 1: Line 1:
-====== fabric.mod.json format ====== 
  
-In all cases, the mod JSON, ''fabric.mod.json'', is defined as either: 
- 
-  * an object containing a "schemaVersion" key with an integer value, denoting the version of the format, 
-  * or an array containing such objects (this is not supported by Loader as of 0.4.0, but is a part of the specification). 
- 
-If a "schemaVersion" key is missing, assume version "0". 
- 
-It is important to remember that the Fabric mod JSON is **authoritative**. This means that Loader relies on it specifically to gather the necessary information - from the perspective of an external tool, its contents can be trusted and relied upon. 
- 
-===== Version 1 (current) ===== 
- 
-//TODO: Work in progress!// 
- 
-==== Types ==== 
- 
-=== ContactInformation 
- 
-A string->string dictionary containing contact information. 
- 
-The following keys are officially defined: 
-  
-  * **email**: Contact e-mail pertaining to the mod. Must be a valid e-mail address. 
-  * **irc**: IRC channel pertaining to the mod. Must be of a valid URL format - for example: ''%%irc://irc.esper.net:6667/charset%%'' for #charset at EsperNet - the port is optional, and assumed to be 6667 if not present. 
-  * **homepage**: Project or user homepage. Must be a valid HTTP/HTTPS address. 
-  * **issues**: Project issue tracker. Must be a valid HTTP/HTTPS address. 
-  * **sources**: Project source code repository. Must be a valid URL - it can, however, be a specialized URL for a given VCS (such as Git or Mercurial). 
- 
-There are no mandatory keys. 
- 
-The list is not exhaustive - mods may provide additional, non-standard keys (such as **discord**, **slack**, **twitter**) - if possible, they should be valid URLs.  
- 
-=== Person === 
- 
-Can be in one of two forms: 
- 
-  * a string (assumed to resolve to a "name" key in the object), 
-  * an object. 
- 
-In the case of an object, the following keys are defined: 
- 
-  * **name**: The real name, or username, of the person. Mandatory. 
-  * **contact** An optional ContactInformation object containing contact information pertaining to the person. 
- 
-=== 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. 
- 
-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. 
- 
-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: 
- 
-  * ''='' as a leading character, or the lack of one, denoting an exact match, 
-  * 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. 
- 
-==== Mandatory fields ==== 
- 
-  * **id**: Contains the mod identifier - a string value matching the ''%%^[a-z][a-z0-9-_]{1,63}$%%'' pattern. 
-  * **version**: Contains the mod version - a string value, optionally matching the [[https://semver.org/|Semantic Versioning 2.0.0]] specification. 
- 
-==== Optional fields (mod loading) ==== 
- 
-  * **envType**: For games with multiple environments - is a string value or an array of string values providing types the mod should be considered to load on. Supported values are: 
-    * "", "*" - all environments (default), 
-    * "client" - the game client, 
-    * "server" - the game dedicated server (integrated servers are not included here). 
-  * **initializers**: Contains a list of "initializer" classes - an array of strings in ''%%package.subpackage.class%%'' format. If not present, assume empty array. 
-  * **mixins**: Contains a list of mixin configuration files for the Mixin library as filenames relative to the mod root - an array of (can be mixed): 
-    * string values, 
-    * objects containing a "config" key (filename), as well as optional keys of the following types: "envType" 
- 
-==== Optional fields (dependency resolution) ==== 
- 
-All of the following keys follow the format of a string->VersionRange dictionary, where the string key matches the desired ID. 
- 
-    * **depends**: for these dependencies, a failure to match causes a hard failure, 
-    * **recommends**: for these dependencies, a failure to match causes a soft failure (warning), 
-    * **suggests**: these dependencies are not matched and are primarily used as metadata, 
-    * **conflicts**: for these dependencies, a successful match causes a soft failure (warning), 
-    * **breaks**: for these dependencies, a successful match causes a hard failure. 
- 
-==== Optional fields (metadata) ==== 
- 
-  * **name**: Contains the user-facing mod name - a string value. If not present, assume it matches **id**. 
-  * **description**: Contains the user-facing mod description - a string value. If not present, assume empty string. 
-  * **authors**: Contains the direct authorship information - an array of Person values. 
-  * **contributors**: Contains the contributor information - an array of Person values. 
-  * **contact**: Contains the contact information for the project - a ContactInformation object. 
-  * **license**: Contains the licensing information - a string value, or an array of string values. 
-    * This should provide the complete set of preferred licenses conveying the entire mod package. In other words, compliance with all listed licenses should be sufficient for usage, redistribution, etc. of the mod package as a whole. 
-    * For cases where a part of code is dual-licensed, choose the preferred license. The list is not exhaustive, serves primarily as a kind of hint, and does not prevent you from granting additional rights/licenses on a case-by-case basis. 
-    * To aid automated tools, it is recommended to use [[https://spdx.org/licenses/|SPDX License Identifiers]] for "open source" licenses. 
- 
-===== Version 0 ===== 
- 
-This version is utilized if the "schemaVersion" field is missing - where it is assumed to be 0. It was used by all Fabric Loader versions prior to 0.4.0. It was inspired by the [[https://github.com/craftson/spec|craftson/spec]] specification. 
- 
-//TODO: Document me!// 
format/modjson.1550654524.txt.gz · Last modified: 2019/02/20 09:22 by asie