add prettier format script and format

This commit is contained in:
LordMZTE 2021-11-14 00:25:43 +01:00
parent 244442223b
commit 85362caf96
6 changed files with 43 additions and 26 deletions

View file

@ -3,22 +3,24 @@
- [AddonScript](README.md)
# Schema
- [Addon Object](schema/addon.md)
- [AddonScript Object](schema/addonscript.md)
- [File Object](schema/file.md)
- [Install Object](schema/install.md)
- [Relation Object](schema/relation.md)
- [Conditions Object](schema/conditions.md)
- [Repository Object](schema/repository.md)
- [Meta Object](schema/meta.md)
- [AddonScript Object](schema/addonscript.md)
- [File Object](schema/file.md)
- [Install Object](schema/install.md)
- [Relation Object](schema/relation.md)
- [Conditions Object](schema/conditions.md)
- [Repository Object](schema/repository.md)
- [Meta Object](schema/meta.md)
# Concepts
- [Installing](install.md)
- [Flags](flags.md)
- [URLs](url.md)
- [Namespaces](namespaces.md)
# Packaging
- [Packaging](packaging/README.md)
- [Zip-based Packaging](packaging/zip.md)
- [Packaging](packaging/README.md)
- [Zip-based Packaging](packaging/zip.md)

View file

@ -12,8 +12,8 @@ a [relation](schema/relation.md) was made.
These are flags, which can be set for [versions](schema/version.md).
- `instance` This flag specifies, that this is a version of an instance addon. Instance addons represent instances of
Minecraft itself, while non-instance addons have to be installed into an existing instance of Minecraft.
- `instance` This flag specifies, that this is a version of an instance addon. Instance addons represent instances of
Minecraft itself, while non-instance addons have to be installed into an existing instance of Minecraft.
## Relational flags
@ -21,18 +21,18 @@ These are flags, which describe the relation between the addon and [related addo
or [files](schema/file.md).
- `required` This flag specifies, that the related addon or file is required for the addon. If the addon gets installed,
than any relation or file, which has this flag set, also has to be installed.
than any relation or file, which has this flag set, also has to be installed.
- `optional` This flag specifies, that the related addon or file is optional for this addon. If the addon gets installed,
the user should be able to choose, whether he wants to install the relation or file with this flag, or not. This flag
can be used in combination with the [conditions](schema/conditions.md) property.
the user should be able to choose, whether he wants to install the relation or file with this flag, or not. This flag
can be used in combination with the [conditions](schema/conditions.md) property.
### Relation specific
These are relational flags, which can only be used for [relations](schema/relation.md).
- `included` This flag specifies, that the related addon is included in this one. This also means, that if some
addon requires the related addon, it can also be installed with this addon instead.
addon requires the related addon, it can also be installed with this addon instead.
- `incompatible` This flag specifies, that the related addon is incompatible to this one. This means, that they can't
be installed together in the same instance.
be installed together in the same instance.
- `launch` This flag specifies, that the related addon should take care of the Minecraft launch process. It can only
be used, if both this and the related addon are instance addons.
be used, if both this and the related addon are instance addons.

View file

@ -3,31 +3,39 @@
## Install commands
### move
args:
- `[location]`
`move` is simplest install step of all. It just moves the selected file to
`move` is simplest install step of all. It just moves the selected file to
the given location.
### extract
args:
- `[location]`
`extract` can be used with zip files, to extract the contents of the zip file
to the given location.
### rename
args:
- `[new name]`
`rename` renames the selected file to the new given filename.
### execute
args:
- `[location]`
- `[jar arguments]`
`execute` can be used with an executable jar file. The jar file will be executed with the given arguments and
`execute` can be used with an executable jar file. The jar file will be executed with the given arguments and
the given location as working directory. A client should inform the user before just executing the file and
ask them for permission to do so and/or it should execute the jar in a closed environment like a container
to prevent malicous code from running.
@ -40,11 +48,13 @@ has to be a [client JSON file](https://minecraft.fandom.com/wiki/Client.json) as
itself. If it is server-sided. it has to be a jar file, which is the file, that should be launched to start
the server. The jar file has to be moved to the root of the instance directory, before using `launch` on it.
Moreover, this install step may only be used with instance addons and there may be only one file for each
side, which has this install step, except all of them are marked as `optional`, in which case they are also
side, which has this install step, except all of them are marked as `optional`, in which case they are also
implicitly marked as incompatible.
### select
args:
- `[filename]`
`select` is used to select the file with the given file name for other installation steps.
@ -54,7 +64,7 @@ If no file name is given, the selection resets to the original file itself, also
## Locations
Locations are specified as a relative path from the Minecraft directory to which the file should be installed.
For example `./mods` would point to the mods directory of the Minecraft instance.
For example `./mods` would point to the mods directory of the Minecraft instance.
## Directories

View file

@ -1,2 +1 @@
# Addon IDs and Namespaces

View file

@ -4,21 +4,24 @@ AddonScript uses URLs to point to specific files. AddonScript specifies three UR
to point to files.
## http(s)
```https://example.com/file.jar```
`https://example.com/file.jar`
This URL scheme is mostly self-explaining. It is jsut a simple http or https URL, which points to
a file on a http server.
## mvn
```mvn://com.example/someartifact/1.0/core.jar```
`mvn://com.example/someartifact/1.0/core.jar`
This URL scheme is used, to point to a maven artifact. The URL consists of multiple parts.
In this example `com.example` it the namespace of the artifact, `someartifact` is the artifact ID,
`1.0` is the version, `core` is an optional specifier and `.jar` is the file ending.
`1.0` is the version, `core` is an optional specifier and `.jar` is the file ending.
`mvn://com.example/someartifact/1.0.jar` would also be a valid URL without an optional specifier.
## file
```./relative/path/to/file.jar```
`./relative/path/to/file.jar`
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.

3
format.sh Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
# Requires the prettier formatter. This should always be run before committing (looking at you, tilera!)
prettier --write ./**/*.md