Allow manifest versions to be defined as SemVer strings (#274)

This commit is contained in:
QuazChick
2024-04-03 19:10:44 +01:00
committed by GitHub
parent 2449b73eab
commit a571926b70
3 changed files with 26 additions and 32 deletions

View File

@@ -28,9 +28,9 @@
"title": "UUID" "title": "UUID"
}, },
"version": { "version": {
"$ref": "../Version.json", "title": "Version",
"description": "This is the version of your pack in the format [majorVersion, minorVersion, revision].", "description": "This is the version of your pack in the format [majorVersion, minorVersion, revision].",
"title": "Version" "oneOf": [{ "$ref": "../Version.json" }, { "$ref": "../semver.json" }]
}, },
"min_engine_version": { "min_engine_version": {
"type": "string", "type": "string",
@@ -72,9 +72,9 @@
"title": "UUID" "title": "UUID"
}, },
"version": { "version": {
"$ref": "../Version.json", "title": "Version",
"description": "This is the version of the module in the same format as the pack's version in the header. This can be used to further identify changes in your pack", "description": "This is the version of the module in the same format as the pack's version in the header. This can be used to further identify changes in your pack",
"title": "Version" "oneOf": [{ "$ref": "../Version.json" }, { "$ref": "../semver.json" }]
} }
} }
}, },
@@ -94,9 +94,9 @@
"title": "UUID" "title": "UUID"
}, },
"version": { "version": {
"$ref": "../Version.json", "title": "Version",
"description": "This is the specific version of the pack that your pack depends on. Should match the version the other pack has in its manifest file", "description": "This is the specific version of the pack that your pack depends on. Should match the version the other pack has in its manifest file",
"title": "Version" "oneOf": [{ "$ref": "../Version.json" }, { "$ref": "../semver.json" }]
} }
}, },
"description": "UNDOCUMENTED: dependencies.", "description": "UNDOCUMENTED: dependencies.",

View File

@@ -94,25 +94,11 @@
] ]
}, },
"version": { "version": {
"type": "string",
"description": "This is the specific version of the module that your pack depends on.",
"title": "Version", "title": "Version",
"description": "This is the specific version of the module that your pack depends on.",
"$ref": "../semver.json",
"default": "1.9.0", "default": "1.9.0",
"examples": [ "examples": ["1.10.0-beta", "1.10.0", "1.9.0", "1.8.0", "1.7.0", "1.6.0", "1.5.0", "1.4.0", "1.3.0", "1.2.0", "1.2.0-beta", "1.1.0", "1.0.0"]
"1.10.0-beta",
"1.10.0",
"1.9.0",
"1.8.0",
"1.7.0",
"1.6.0",
"1.5.0",
"1.4.0",
"1.3.0",
"1.2.0",
"1.2.0-beta",
"1.1.0",
"1.0.0"
]
} }
} }
} }
@@ -168,8 +154,8 @@
}, },
"version": { "version": {
"title": "Version", "title": "Version",
"$ref": "../Version.json", "description": "This is the version of your pack in the format [majorVersion, minorVersion, revision].",
"description": "This is the version of your pack in the format [majorVersion, minorVersion, revision]." "oneOf": [{ "$ref": "../Version.json" }, { "$ref": "../semver.json" }]
} }
} }
}, },
@@ -207,9 +193,9 @@
"title": "Uuid" "title": "Uuid"
}, },
"version": { "version": {
"$ref": "../Version.json", "title": "Version",
"description": "This is the version of your pack in the format [majorVersion, minorVersion, revision]. The version number is used when importing a pack that has been imported before. The new pack will replace the old one if the version is higher, and ignored if it's the same or lower", "description": "This is the version of your pack in the format [majorVersion, minorVersion, revision]. The version number is used when importing a pack that has been imported before. The new pack will replace the old one if the version is higher, and ignored if it's the same or lower",
"title": "Version" "oneOf": [{ "$ref": "../Version.json" }, { "$ref": "../semver.json" }]
}, },
"entry": { "entry": {
"type": "string", "type": "string",
@@ -237,8 +223,7 @@
"type": "object", "type": "object",
"propertyNames": { "propertyNames": {
"pattern": "^[a-zA-Z0-9\\_\\-]+$", "pattern": "^[a-zA-Z0-9\\_\\-]+$",
"maxLength": 32, "maxLength": 32
"maximum": 32
}, },
"additionalProperties": { "additionalProperties": {
"type": "array", "type": "array",
@@ -246,10 +231,8 @@
"title": "Tool", "title": "Tool",
"description": "The tool and the version used to modified this pack.", "description": "The tool and the version used to modified this pack.",
"items": { "items": {
"type": "string",
"title": "Version", "title": "Version",
"examples": ["1.0.0"], "$ref": "../semver.json"
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
} }
} }
}, },

View File

@@ -0,0 +1,11 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "semver",
"title": "Semantic Version",
"description": "A semver.org compliant version number.",
"type": "string",
"pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$",
"minLength": 5,
"maxLength": 256,
"examples": ["1.0.0", "1.1.0-beta"]
}