Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .schema/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Editor schemas for module YAML

JSON Schemas that give editors (VS Code's `redhat.vscode-yaml`, and any
`yaml-language-server` client) validation and autocomplete for the two YAML
files in every module — and stop the extension from guessing an unrelated
schema from its schema store (it used to mis-match `template.yaml` against the
AWS SAM schema and flag valid fields).

Each module file opts in with a first-line modeline:

```yaml
# yaml-language-server: $schema=../.schema/gametemplate.schema.json # template.yaml
# yaml-language-server: $schema=../.schema/module.schema.json # module.yaml
```

The relative path resolves whether this repo is opened on its own or as the
`modules/` submodule of the Gameplane repo.

| File | Schema | Source |
| --- | --- | --- |
| `template.yaml` | `gametemplate.schema.json` | **Generated** from the GameTemplate CRD in the Gameplane repo. Do not hand-edit. |
| `module.yaml` | `module.schema.json` | Hand-maintained; mirrors `docs/module-authoring.md`. |

## Regenerating `gametemplate.schema.json`

`template.yaml` is a `GameTemplate` custom resource, so its schema is the CRD's
`openAPIV3Schema`. When the CRD changes (new spec fields), regenerate from the
**Gameplane** repo — the submodule doesn't carry the CRD:

```sh
make module-schema # runs hack/gen-module-schema.py, writes modules/.schema/gametemplate.schema.json
```

Then commit the updated file here (and bump the submodule pointer in the
Gameplane repo).
2,115 changes: 2,115 additions & 0 deletions .schema/gametemplate.schema.json

Large diffs are not rendered by default.

62 changes: 62 additions & 0 deletions .schema/module.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Gameplane module manifest (module.yaml)",
"description": "The bundle metadata layer of a Gameplane module. See docs/module-authoring.md in the Gameplane repo for the authoritative format.",
"type": "object",
"additionalProperties": false,
"required": ["apiVersion", "name", "displayName", "version", "game", "summary"],
"properties": {
"apiVersion": {
"const": "gameplane.local/module/v1"
},
"name": {
"type": "string",
"pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
"maxLength": 63,
"description": "DNS-1123 label; must match the module directory name."
},
"displayName": {
"type": "string",
"minLength": 1,
"description": "Human-readable name shown on the catalog card."
},
"version": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$",
"description": "Semver; must match the OCI tag the bundle is pushed under."
},
"game": {
"type": "string",
"minLength": 1,
"description": "Free-form game family identifier (e.g. minecraft-java)."
},
"categories": {
"type": "array",
"items": { "type": "string" },
"description": "Catalog groupings; a module may belong to several."
},
"summary": {
"type": "string",
"minLength": 1,
"description": "One-line description for the catalog card."
},
"homepage": {
"type": "string",
"format": "uri",
"description": "Optional project/game homepage URL."
},
"license": {
"type": "string",
"description": "Optional SPDX license identifier."
},
"gameplaneMinVersion": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?$",
"description": "Optional minimum operator version; install is refused on older operators."
},
"icon": {
"type": "string",
"description": "Optional filename of the icon layer (e.g. icon.png)."
}
}
}
1 change: 1 addition & 0 deletions 7-days-to-die/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: 7-days-to-die
displayName: 7 Days to Die
Expand Down
1 change: 1 addition & 0 deletions 7-days-to-die/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for 7 Days to Die (dedicated server).
#
# Backed by vinanrra/7dtd-server (https://github.com/vinanrra/Docker-7DaysToDie),
Expand Down
1 change: 1 addition & 0 deletions ark-survival-ascended/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: ark-survival-ascended
displayName: "ARK: Survival Ascended"
Expand Down
1 change: 1 addition & 0 deletions ark-survival-ascended/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for ARK: Survival Ascended (dedicated server).
#
# Backed by mschnitzer/asa-linux-server
Expand Down
1 change: 1 addition & 0 deletions cs2/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: cs2
displayName: Counter-Strike 2
Expand Down
1 change: 1 addition & 0 deletions cs2/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Counter-Strike 2 (dedicated server).
#
# Backed by joedwards32/CS2 (cm2network/cs2 is a downstream mirror of the
Expand Down
1 change: 1 addition & 0 deletions dayz/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: dayz
displayName: DayZ
Expand Down
1 change: 1 addition & 0 deletions dayz/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for DayZ (dedicated server).
#
# Backed by GodBleak/ServerZ (https://github.com/GodBleak/ServerZ), pulled
Expand Down
1 change: 1 addition & 0 deletions dont-starve-together/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: dont-starve-together
displayName: Don't Starve Together
Expand Down
1 change: 1 addition & 0 deletions dont-starve-together/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
apiVersion: gameplane.local/v1alpha1
kind: GameTemplate
metadata:
Expand Down
1 change: 1 addition & 0 deletions enshrouded/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: enshrouded
displayName: Enshrouded
Expand Down
1 change: 1 addition & 0 deletions enshrouded/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
apiVersion: gameplane.local/v1alpha1
kind: GameTemplate
metadata:
Expand Down
1 change: 1 addition & 0 deletions factorio/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: factorio
displayName: Factorio (Headless)
Expand Down
1 change: 1 addition & 0 deletions factorio/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Factorio (headless server).
#
# Backed by the official-community factoriotools/factorio image. The game
Expand Down
1 change: 1 addition & 0 deletions garrys-mod/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: garrys-mod
displayName: Garry's Mod
Expand Down
1 change: 1 addition & 0 deletions garrys-mod/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Garry's Mod (dedicated server).
#
# Backed by ceifa/garrysmod (https://github.com/ceifa/garrysmod-docker). The
Expand Down
1 change: 1 addition & 0 deletions minecraft-java/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: minecraft-java
displayName: Minecraft (Java Edition)
Expand Down
1 change: 1 addition & 0 deletions minecraft-java/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Minecraft: Java Edition.
#
# Backed by the community itzg/minecraft-server image, which downloads the
Expand Down
1 change: 1 addition & 0 deletions palworld/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: palworld
displayName: Palworld (Dedicated)
Expand Down
1 change: 1 addition & 0 deletions palworld/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Palworld (dedicated server).
#
# Backed by the community thijsvanloef/palworld-server-docker image. The
Expand Down
1 change: 1 addition & 0 deletions project-zomboid/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: project-zomboid
displayName: Project Zomboid
Expand Down
1 change: 1 addition & 0 deletions project-zomboid/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Project Zomboid (dedicated server).
#
# Backed by sknnr/zomboid-dedicated-server (https://github.com/jsknnr/project-
Expand Down
1 change: 1 addition & 0 deletions rust/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: rust
displayName: Rust
Expand Down
1 change: 1 addition & 0 deletions rust/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Rust (dedicated server).
#
# Backed by didstopia/rust-server. Rust's RCON is WebSocket-only — Facepunch's
Expand Down
1 change: 1 addition & 0 deletions satisfactory/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: satisfactory
displayName: Satisfactory (Dedicated)
Expand Down
1 change: 1 addition & 0 deletions satisfactory/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Satisfactory (dedicated server).
#
# Backed by the community wolveix/satisfactory-server image, which installs
Expand Down
1 change: 1 addition & 0 deletions terraria/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: terraria
displayName: Terraria
Expand Down
1 change: 1 addition & 0 deletions terraria/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Terraria (vanilla + tModLoader).
#
# Backed by passivelemon/terraria-docker. Vanilla vs tModLoader (and the
Expand Down
1 change: 1 addition & 0 deletions v-rising/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: v-rising
displayName: V Rising
Expand Down
1 change: 1 addition & 0 deletions v-rising/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for V Rising (dedicated server).
#
# Backed by trueosiris/vrising (Ubuntu + Wine). The image documents two
Expand Down
1 change: 1 addition & 0 deletions valheim/module.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/module.schema.json
apiVersion: gameplane.local/module/v1
name: valheim
displayName: Valheim (Dedicated)
Expand Down
1 change: 1 addition & 0 deletions valheim/template.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=../.schema/gametemplate.schema.json
# Gameplane GameTemplate for Valheim (dedicated server).
#
# Backed by lloesche/valheim-server, which installs the game via SteamCMD on
Expand Down
Loading