Add JSON schemas for DistroMeta and ServerMeta.
JSON schemas are used by editors to validate data and provide useful insights. The JSON schemas will be generated by the init root command. They can also be generated using the generate schemas command. The JSON files will reference the schemas on the user's local disk rather than hosted versions. This allows offline editing and ensures that the schema is exactly one-to-one with the local version of Nebula. Existing servers will have to manually add the schema property. To see how to do this, generate a new server and copy the $\schema value. The schema property will need to be added to any existing distrometa files. This is the same format as the server meta, just replace ServerMeta with DistroMeta. More information, including sample files with json schemas, is provided on the README.
This commit is contained in:
@@ -2,6 +2,9 @@ import { Distribution } from 'helios-distribution-types'
|
||||
|
||||
export interface DistroMeta {
|
||||
|
||||
/**
|
||||
* Distribution metadata to be forwarded to the distribution file.
|
||||
*/
|
||||
meta: {
|
||||
rss: Distribution['rss']
|
||||
discord?: Distribution['discord']
|
||||
|
||||
@@ -2,8 +2,8 @@ import { Server } from 'helios-distribution-types'
|
||||
|
||||
export interface UntrackedFilesOption {
|
||||
/**
|
||||
* The subdirectory this applies to. Ex.
|
||||
* [ 'files', 'forgemods' ]
|
||||
* The subdirectory these patterns will be applied to. Ex.
|
||||
* [ "files", "forgegemods" ]
|
||||
*/
|
||||
appliesTo: string[]
|
||||
/**
|
||||
@@ -57,6 +57,9 @@ export function getDefaultServerMeta(id: string, version: string, options?: Serv
|
||||
|
||||
export interface ServerMeta {
|
||||
|
||||
/**
|
||||
* Server metadata to be forwarded to the distribution file.
|
||||
*/
|
||||
meta: {
|
||||
version: Server['version']
|
||||
name: Server['name']
|
||||
@@ -67,14 +70,30 @@ export interface ServerMeta {
|
||||
autoconnect: Server['autoconnect']
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties related to Forge.
|
||||
*/
|
||||
forge?: {
|
||||
/**
|
||||
* The forge version. This does NOT include the minecraft version.
|
||||
* Ex. 14.23.5.2854
|
||||
*/
|
||||
version: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Properties related to liteloader.
|
||||
*/
|
||||
liteloader?: {
|
||||
/**
|
||||
* The liteloader version.
|
||||
*/
|
||||
version: string
|
||||
}
|
||||
|
||||
/**
|
||||
* A list of option objects defining patterns for untracked files.
|
||||
*/
|
||||
untrackedFiles?: UntrackedFilesOption[]
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user