Skip to content

Commit 198e6eb

Browse files
committed
feat: Added json schemas for new contrib plugins
1 parent 8143208 commit 198e6eb

File tree

6 files changed

+215
-43
lines changed

6 files changed

+215
-43
lines changed

res/schemas/beet_pipeline.json

Lines changed: 86 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -77,35 +77,82 @@
7777
"uniqueItems": true,
7878
"items": {
7979
"anyOf": [
80+
{
81+
"const": "beet.contrib.babelbox",
82+
"description": "Loads translations from csv files (minimal built-in implementation)"
83+
},
84+
{
85+
"const": "beet.contrib.dundervar",
86+
"description": "Jinja extension for turning '__foo__' into '{{ foo }}'"
87+
},
88+
{
89+
"const": "beet.contrib.format_json",
90+
"description": "Format json files"
91+
},
8092
{
8193
"const": "beet.contrib.function_header",
82-
"description": "Plugin that adds a header to functions automatically"
94+
"description": "Automatically adds a header to functions"
95+
},
96+
{
97+
"const": "beet.contrib.hangman",
98+
"description": "Indentation-based syntactic extensions for functions"
99+
},
100+
{
101+
"const": "beet.contrib.inline_function",
102+
"description": "Jinja extension for declaring functions inline"
103+
},
104+
{
105+
"const": "beet.contrib.inline_function_tag",
106+
"description": "Jinja extension for declaring function tags inline"
83107
},
84108
{
85109
"const": "beet.contrib.lantern_load",
86-
"description": "Plugin that implements Lantern Load runtime dependencies"
110+
"description": "Adds Lantern Load runtime dependencies"
111+
},
112+
{
113+
"const": "beet.contrib.minify_function",
114+
"description": "Minifies function files"
115+
},
116+
{
117+
"const": "beet.contrib.minify_json",
118+
"description": "Minifies json files"
119+
},
120+
{
121+
"const": "beet.contrib.relative_function_path",
122+
"description": "Resolves relative function paths within a namespace"
87123
},
88124
{
89125
"const": "beet.contrib.render",
90-
"description": "Plugin that invokes the built-in template renderer"
126+
"description": "Invokes the built-in template renderer"
91127
},
92128
{
93129
"const": "beet.contrib.sandstone",
94-
"description": "Plugin that builds a sandstone project"
130+
"description": "Builds a sandstone project"
95131
},
96132
{
97-
"const": "beet.contrib.babelbox",
98-
"description": "Plugin that loads translations from csv files. Uses a minimal custom implementation"
133+
"const": "beet.contrib.scoreboard",
134+
"description": "Adds generated scoreboards to the data pack"
135+
},
136+
{
137+
"const": "beet.contrib.template_context",
138+
"description": "Exposes the beet context in templates"
139+
},
140+
{
141+
"const": "beet.contrib.yellow_shulker_box",
142+
"description": "Includes the yellow shulker box loot table"
99143
},
100144
{
101145
"const": "babelbox.integration.beet",
102-
"description": "Plugin that loads translations from csv files. Uses https://pypi.org/project/babelbox/"
146+
"description": "Loads translations from csv files (Full-featured implementation, requires https://pypi.org/project/babelbox/)"
103147
},
104148
{
105149
"const": "mcanitexgen.integration.beet",
106-
"description": "Plugin that generates .mcmeta files for animated textures"
150+
"description": "Generates .mcmeta files for animated textures"
151+
},
152+
{
153+
"type": "string",
154+
"description": "Custom plugin"
107155
},
108-
{ "type": "string" },
109156
{
110157
"description": "Nested beet project configuration",
111158
"$ref": "#"
@@ -129,32 +176,50 @@
129176
"description": "Default prefix of generated files",
130177
"type": "string"
131178
},
179+
"generate_scoreboard": {
180+
"description": "Scoreboards objectives to generate",
181+
"type": "object",
182+
"patternProperties": {
183+
".*": {
184+
"description": "Objective name and its criteria",
185+
"$ref": "minecraft/scoreboard_criteria.json"
186+
}
187+
}
188+
},
189+
"babelbox": {
190+
"description": "babelbox plugin settings",
191+
"$ref": "plugins/babelbox.json"
192+
},
193+
"format_json": {
194+
"description": "format_json plugin settings",
195+
"$ref": "contrib/format_json.json"
196+
},
132197
"function_header": {
133-
"description": "Config for beet.contrib.function_header plugin",
198+
"description": "function_header plugin settings",
134199
"$ref": "contrib/function_header.json"
135200
},
201+
"hangman": {
202+
"description": "hangman plugin settings",
203+
"$ref": "contrib/hangman.json"
204+
},
136205
"lantern_load": {
137-
"description": "Config for beet.lantern_load plugin",
206+
"description": "lantern_load plugin settings",
138207
"$ref": "contrib/lantern_load.json"
139208
},
140209
"render": {
141-
"description": "Config for beet.contrib.render plugin",
210+
"description": "render plugin settings",
142211
"$ref": "contrib/render.json"
143212
},
144213
"sandstone": {
145-
"description": "Config for beet.contrib.sandstone plugin",
214+
"description": "sandstone plugin settings",
146215
"$ref": "contrib/sandstone.json"
147216
},
148-
"babelbox-contrib": {
149-
"description": "Config for beet.contrib.babelbox plugin",
150-
"$ref": "contrib/babelbox.json"
151-
},
152-
"babelbox": {
153-
"description": "Config for babelbox.integration.beet plugin",
154-
"$ref": "plugins/babelbox.json"
217+
"scoreboard": {
218+
"description": "scoreboard plugin settings",
219+
"$ref": "contrib/scoreboard.json"
155220
},
156221
"mcanitexgen": {
157-
"description": "Mcanitexgen plugin configuration",
222+
"description": "mcanitexgen plugin settings",
158223
"$ref": "plugins/mcanitexgen.json"
159224
}
160225
}

res/schemas/contrib/babelbox.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

res/schemas/contrib/format_json.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"properties": {
5+
"ensure_ascii": {
6+
"type": "boolean"
7+
},
8+
"allow_nan": {
9+
"type": "boolean"
10+
},
11+
"indent": {
12+
"type": "integer"
13+
},
14+
"separators": {
15+
"type": "array",
16+
"items": {
17+
"type": "string",
18+
"minLength": 1
19+
},
20+
"minItems": 2,
21+
"maxItems": 2,
22+
"uniqueItems": true
23+
},
24+
"sort_keys": {
25+
"type": "boolean"
26+
},
27+
"final_newline": {
28+
"type": "boolean"
29+
}
30+
}
31+
}

res/schemas/contrib/hangman.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"properties": {
5+
"match": {
6+
"description": "Apply on selected functions",
7+
"type": "array",
8+
"items": {
9+
"type": "string"
10+
}
11+
}
12+
}
13+
}

res/schemas/contrib/scoreboard.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "object",
4+
"properties": {
5+
"function": {
6+
"description": "Name of the generated function that creates the scoreboard objectives",
7+
"type": "string"
8+
},
9+
"tags": {
10+
"description": "Function tags of the generated function",
11+
"type": "array",
12+
"items": {
13+
"description": "Function tag",
14+
"type": "string",
15+
"pattern": "^.+:.+"
16+
}
17+
}
18+
}
19+
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"type": "string",
4+
"anyOf": [
5+
{
6+
"description": "Special criteria",
7+
"enum": [
8+
"air",
9+
"armor",
10+
"deathCount",
11+
"food",
12+
"health",
13+
"level",
14+
"playerKillCount",
15+
"trigger",
16+
"totalKillCount",
17+
"xp",
18+
"dummy"
19+
]
20+
},
21+
{
22+
"description": "Player killed member of team",
23+
"enum": [
24+
"teamkill.aqua",
25+
"teamkill.black",
26+
"teamkill.blue",
27+
"teamkill.dark_aqua",
28+
"teamkill.dark_gray",
29+
"teamkill.dark_green",
30+
"teamkill.dark_purple",
31+
"teamkill.dark_red",
32+
"teamkill.gold",
33+
"teamkill.gray",
34+
"teamkill.green",
35+
"teamkill.light_purple",
36+
"teamkill.red",
37+
"teamkill.white",
38+
"teamkill.yellow"
39+
]
40+
},
41+
{
42+
"description": "Player was killed by member of team",
43+
"enum": [
44+
"killedByTeam.aqua",
45+
"killedByTeam.black",
46+
"killedByTeam.blue",
47+
"killedByTeam.dark_aqua",
48+
"killedByTeam.dark_gray",
49+
"killedByTeam.dark_green",
50+
"killedByTeam.dark_purple",
51+
"killedByTeam.dark_red",
52+
"killedByTeam.gold",
53+
"killedByTeam.gray",
54+
"killedByTeam.green",
55+
"killedByTeam.light_purple",
56+
"killedByTeam.red",
57+
"killedByTeam.white",
58+
"killedByTeam.yellow"
59+
]
60+
},
61+
{
62+
"description": "Unknown criteria",
63+
"type": "string"
64+
}
65+
]
66+
}

0 commit comments

Comments
 (0)