Spec overhaul
This commit is contained in:
parent
eb1bccc998
commit
2e26c5ab95
8 changed files with 66 additions and 92 deletions
|
@ -5,17 +5,18 @@
|
||||||
# Schema
|
# Schema
|
||||||
- [Addon Object](schema/root.md)
|
- [Addon Object](schema/root.md)
|
||||||
- [AddonScript Object](schema/addonscript.md)
|
- [AddonScript Object](schema/addonscript.md)
|
||||||
- [Version Object](schema/version.md)
|
- [File Object](schema/file.md)
|
||||||
- [File Object](schema/file.md)
|
- [Install Object](schema/install.md)
|
||||||
- [Relation Object](schema/relation.md)
|
- [Relation Object](schema/relation.md)
|
||||||
|
- [Conditions Object](schema/conditions.md)
|
||||||
- [Repository Object](schema/repository.md)
|
- [Repository Object](schema/repository.md)
|
||||||
- [Index Object](schema/index.md)
|
|
||||||
- [Meta Object](schema/meta.md)
|
- [Meta Object](schema/meta.md)
|
||||||
|
|
||||||
# Concepts
|
# Concepts
|
||||||
- [Installing](install.md)
|
- [Installing](install.md)
|
||||||
- [Flags](flags.md)
|
- [Flags](flags.md)
|
||||||
- [URLs](url.md)
|
- [URLs](url.md)
|
||||||
|
- [Namespaces](namespaces.md)
|
||||||
|
|
||||||
# Packaging
|
# Packaging
|
||||||
- [Packaging](packaging/README.md)
|
- [Packaging](packaging/README.md)
|
||||||
|
|
|
@ -1,25 +0,0 @@
|
||||||
# Index Object
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"versions": {
|
|
||||||
"1.0": "https://example.json/mymod-1.0.json"
|
|
||||||
},
|
|
||||||
"addons": {
|
|
||||||
"othermod": "https://example.com/othermod.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Optional Properties
|
|
||||||
|
|
||||||
### versions
|
|
||||||
|
|
||||||
This is an object, with version numbers as keys and [URLs](../url.md) to AddonScript files as values. The AddonScript file which the URL
|
|
||||||
points to must include the version number, which is the key in the map, and its addon ID must match the addon ID of the AddonScript
|
|
||||||
file which includes the index object.
|
|
||||||
|
|
||||||
### addons
|
|
||||||
|
|
||||||
This is an object, with addon IDs as keys and [URLs](../url.md) to AddonScript files as values. The addon ID of the AddonScript file, to
|
|
||||||
which the URL points, must match the key in the map.
|
|
|
@ -1,7 +1,25 @@
|
||||||
# Meta Object
|
# Meta Object
|
||||||
|
|
||||||
Meta objects can be included in [addon](root.md) and [version](version.md) objects.
|
``` json
|
||||||
They should be used to give information about the addon or the version, like a **name**,
|
{
|
||||||
a **description** or a **changelog**. The specification does not require a specific format
|
"addon": {
|
||||||
for meta objects, therefore you can add any property to it.
|
"name": "My cool addon name",
|
||||||
It is however recommended to follow conventions for it.
|
"icon": "./icon.png",
|
||||||
|
"description":"./README.md",
|
||||||
|
"summary": "My Addon",
|
||||||
|
"website": "https://example.com",
|
||||||
|
"source": "https://gitea.com/user/myaddon",
|
||||||
|
"issues": "https://gitea.com/user/myaddon/issues",
|
||||||
|
"contributors": ["Alice", "Bob"]
|
||||||
|
},
|
||||||
|
"version": {
|
||||||
|
"changelog": "./CHANGELOG.md",
|
||||||
|
"timestamp": 1594753200
|
||||||
|
},
|
||||||
|
"additional": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Optional properties
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
{
|
{
|
||||||
"id": "namespace:othermod",
|
"id": "namespace:othermod",
|
||||||
"version": "[1.0,)",
|
"version": "[1.0,)",
|
||||||
|
"repositories": ["repo1"],
|
||||||
"flags": [],
|
"flags": [],
|
||||||
"conditions": {}
|
"conditions": {}
|
||||||
}
|
}
|
||||||
|
@ -17,10 +18,16 @@ This is the ID or namespaced ID of the addon this relation refers to.
|
||||||
|
|
||||||
### version
|
### version
|
||||||
|
|
||||||
This is a [maven version range](https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html) of supported versions of this relation.
|
This is a [semver version range](https://github.com/semver/semver/pull/584) of supported versions of this relation.
|
||||||
|
|
||||||
## Optional properties
|
## Optional properties
|
||||||
|
|
||||||
|
### repositories
|
||||||
|
|
||||||
|
This is an array of [repository](repository.md) IDs. This are the repositories, from where AddonScript should try to get this relation from,
|
||||||
|
in the order as they are ordered in the array. If this property is not set or the array is empty, AddonScript will try to resolve the relation by
|
||||||
|
the namespace from all defined repositories.
|
||||||
|
|
||||||
### flags
|
### flags
|
||||||
|
|
||||||
This is an array of [flags](../flags.md) for this relation. If this property is not present in a relation object, the relation
|
This is an array of [flags](../flags.md) for this relation. If this property is not present in a relation object, the relation
|
||||||
|
|
|
@ -16,10 +16,11 @@ This is the ID of the repository. It has to be unique to the AddonScript file.
|
||||||
|
|
||||||
### type
|
### type
|
||||||
|
|
||||||
This is the type of the repository. Possible values are [`api`](../repository/api/README.md) or [`maven`](../repository/maven.md).
|
This is the type of the repository. Possible values are [`api`](../repository/api/README.md), [`maven`](../repository/maven.md) or [`index`](../repository/index.md).
|
||||||
|
|
||||||
### url
|
### url
|
||||||
|
|
||||||
This is the base URL of the repository. While other URLs in AddonScript can have different schemes,
|
This is the base URL of the repository. While other URLs in AddonScript can have different schemes,
|
||||||
the base URL has to be a http(s) URL. If it is a maven repository the scheme can also be `file`, where
|
the base URL has to be a http(s) URL, except for `index` and `maven` repositories, where it can also be `file`.
|
||||||
|
If it is a maven repository the scheme can also be `file`, where
|
||||||
it points to a directory, which contains the maven repository.
|
it points to a directory, which contains the maven repository.
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
{
|
{
|
||||||
"addonscript": {},
|
"addonscript": {},
|
||||||
"id": "myaddon",
|
"id": "myaddon",
|
||||||
"versions": [],
|
"namespace": "com.example",
|
||||||
|
"version": "1.0",
|
||||||
|
"files": [],
|
||||||
|
"relations": [],
|
||||||
|
"flags": ["server", "client"],
|
||||||
"repositories": [],
|
"repositories": [],
|
||||||
"index": {},
|
|
||||||
"flags": {},
|
|
||||||
"meta": {}
|
"meta": {}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -20,29 +22,36 @@ This is an [AddonScript object](addonscript.md) containing information about the
|
||||||
|
|
||||||
### id
|
### id
|
||||||
|
|
||||||
This is the ID of your addon. It should only contain **lowercase letters, numbers and dashes**.
|
This is the ID of the addon. It should only contain **lowercase letters, numbers and dashes**.
|
||||||
|
|
||||||
|
### version
|
||||||
|
|
||||||
|
This is the version number of this version. It must follow [semver version naming conventions](https://semver.org/spec/v2.0.0.html),
|
||||||
|
as they are used to compare versions.
|
||||||
|
|
||||||
## Optional properties
|
## Optional properties
|
||||||
|
|
||||||
### versions
|
### namespace
|
||||||
|
|
||||||
This is an array of [version objects](version.md). It is possible to define multiple versions of the addon in one AddonScript file,
|
This is the namespace of the addon.
|
||||||
but in the most cases there should be just one version per file. Athough this property is optional, as you can define versions
|
|
||||||
in the [index](index.md), it can be used to define a list of versions, which can be found in the index.
|
### files
|
||||||
|
|
||||||
|
This is an array of [file objects](file.md) including the files belonging to this version.
|
||||||
|
|
||||||
|
### relations
|
||||||
|
|
||||||
|
This is an array of [relation objects](relation.md) which represents related addons.
|
||||||
|
|
||||||
|
### flags
|
||||||
|
|
||||||
|
This is an array of [flags](../flags.md) for this version.
|
||||||
|
|
||||||
### repositories
|
### repositories
|
||||||
|
|
||||||
This is an array of [repository objects](repository.md). Each repository object defines one repository from which files or
|
This is an array of [repository objects](repository.md). Each repository object defines one repository from which files or
|
||||||
addons can be retrieved.
|
addons can be retrieved.
|
||||||
|
|
||||||
### index
|
|
||||||
|
|
||||||
This is an [index object](index.md) which includes links to other versions of this addon, or to other related addons.
|
|
||||||
|
|
||||||
### flags
|
|
||||||
|
|
||||||
Not yet specified
|
|
||||||
|
|
||||||
### meta
|
### meta
|
||||||
|
|
||||||
This is a [meta object](meta.md).
|
This is a [meta object](meta.md).
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
# Version Object
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"version": "1.0",
|
|
||||||
"files": [],
|
|
||||||
"relations": [],
|
|
||||||
"flags": ["server", "client"],
|
|
||||||
"meta": {}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
## Required properties
|
|
||||||
|
|
||||||
### version
|
|
||||||
|
|
||||||
This is the version number of this version. It should follow [maven version naming conventions](https://docs.oracle.com/middleware/1212/core/MAVEN/maven_version.htm),
|
|
||||||
as they are used to comparing versions.
|
|
||||||
|
|
||||||
## Optional properties
|
|
||||||
|
|
||||||
### files
|
|
||||||
|
|
||||||
This is an array of [file objects](file.md) including the files belonging to this version.
|
|
||||||
|
|
||||||
### relations
|
|
||||||
|
|
||||||
This is an array of [relation objects](relation.md) which represents related addons.
|
|
||||||
|
|
||||||
### flags
|
|
||||||
|
|
||||||
This is an array of [flags](../flags.md) for this version. If this property is not present in a version object, the version
|
|
||||||
will have the flags which are set as default for versions.
|
|
||||||
|
|
||||||
### meta
|
|
||||||
|
|
||||||
This is a [meta object](meta.md).
|
|
|
@ -18,7 +18,7 @@ In this example `com.example` it the namespace of the artifact, `someartifact` i
|
||||||
`mvn://com.example/someartifact/1.0.jar` would also be a valid URL without an optional specifier.
|
`mvn://com.example/someartifact/1.0.jar` would also be a valid URL without an optional specifier.
|
||||||
|
|
||||||
## file
|
## file
|
||||||
```file://relative/path/to/file.jar```
|
```./relative/path/to/file.jar```
|
||||||
|
|
||||||
This URL scheme is a relative path to a file. It can only be used with [packaging](packaging/README.md)
|
This is a relative path to a file. It can only be used with [packaging](packaging/README.md)
|
||||||
or in some third-party environments, which are not covered by this specification.
|
or in some third-party environments, which are not covered by this specification.
|
||||||
|
|
Loading…
Reference in a new issue