Home Report an Issue

Polymod

Atomic modding framework for Haxe

Download with haxelib install polymod

WIP: Dependencies

THIS PROPOSAL IS WIP

A mod may have dependencies on other mods. Through proper configuration, Polymod can sure that any dependencies are loaded before the mod is loaded, and that the proper versions are used.

Configuring Mod Dependencies

Mod dependencies are configured in the mod’s _polymod_metadata.json file, like so:

{
	"title":"Dragon",
	"description":"Replaces Bees with Dragons",
	"api_version":"0.1.0",
	"mod_version":"1.0.0-alpha",
  "dependencies": {
    "mod1": "1.0.0",
    "mod2": ">=1.3.0"
  }
}

Mod IDs are provided as keys, and the value is a version range which includes one or more comparators. Polymod’s version comparator format fully conforms to the specification used by node-semver. A quick summary:

Optional Dependencies

You can also define optionalDependencies to specify dependencies that are not required, like so:

{
  // ...
  "optionalDependencies": {
    "mod1": "1.0.0",
    "mod2": ">=1.3.0"
  }
}

Mods listed as optional dependencies are not required to be enabled, but if they are enabled, Polymod will ensure they are loaded before the mod is loaded.

Dependency Behavior