Skip to content

Commit e5255a5

Browse files
authored
Add json schema for liara config (#175)
1 parent bb97c5e commit e5255a5

File tree

3 files changed

+189
-9
lines changed

3 files changed

+189
-9
lines changed

package-lock.json

Lines changed: 55 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@
6060
"pretty-quick": "^4.0.0",
6161
"ts-jest": "^29.1.2",
6262
"ts-node": "^10.9.2",
63-
"typescript": "^5.4.5"
63+
"typescript": "^5.4.5",
64+
"typescript-json-schema": "^0.63.0"
6465
},
6566
"engines": {
6667
"node": ">=18.0.0"
@@ -170,7 +171,8 @@
170171
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
171172
"version": "oclif readme && git add README.md",
172173
"readme": "oclif readme",
173-
"prepare": "husky install"
174+
"prepare": "husky install",
175+
"schema": "typescript-json-schema ./src/types/liara-json.ts ILiaraJSON -o ./schemas/json/liara.json"
174176
},
175177
"husky": {
176178
"hooks": {

schemas/json/liara.json

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"definitions": {
4+
"default_1": {
5+
"properties": {
6+
"mountTo": {
7+
"type": "string"
8+
},
9+
"name": {
10+
"type": "string"
11+
}
12+
},
13+
"type": "object"
14+
},
15+
"default_2": {
16+
"properties": {
17+
"args": {
18+
"items": {
19+
"type": "string"
20+
},
21+
"type": "array"
22+
},
23+
"cache": {
24+
"type": "boolean"
25+
},
26+
"dockerfile": {
27+
"type": "string"
28+
},
29+
"location": {
30+
"type": "string"
31+
}
32+
},
33+
"type": "object"
34+
},
35+
"default_3": {
36+
"properties": {
37+
"version": {
38+
"type": "number"
39+
}
40+
},
41+
"type": "object"
42+
},
43+
"default_4": {
44+
"properties": {
45+
"command": {
46+
"anyOf": [
47+
{
48+
"items": {
49+
"type": "string"
50+
},
51+
"type": "array"
52+
},
53+
{
54+
"type": "string"
55+
}
56+
]
57+
},
58+
"interval": {
59+
"type": "number"
60+
},
61+
"retries": {
62+
"type": "number"
63+
},
64+
"startPeriod": {
65+
"type": "number"
66+
},
67+
"timeout": {
68+
"type": "number"
69+
}
70+
},
71+
"type": "object"
72+
},
73+
"default_5": {
74+
"properties": {
75+
"buildAssets": {
76+
"type": "boolean"
77+
},
78+
"configCache": {
79+
"type": "boolean"
80+
},
81+
"routeCache": {
82+
"type": "boolean"
83+
}
84+
},
85+
"type": "object"
86+
}
87+
},
88+
"properties": {
89+
"app": {
90+
"type": "string"
91+
},
92+
"args": {
93+
"items": {
94+
"type": "string"
95+
},
96+
"type": "array"
97+
},
98+
"build": {
99+
"$ref": "#/definitions/default_2"
100+
},
101+
"cron": {
102+
"items": {
103+
"type": "string"
104+
},
105+
"type": "array"
106+
},
107+
"disks": {
108+
"items": {
109+
"$ref": "#/definitions/default_1"
110+
},
111+
"type": "array"
112+
},
113+
"healthCheck": {
114+
"$ref": "#/definitions/default_4"
115+
},
116+
"laravel": {
117+
"$ref": "#/definitions/default_5"
118+
},
119+
"node": {
120+
"$ref": "#/definitions/default_3"
121+
},
122+
"platform": {
123+
"type": "string"
124+
},
125+
"port": {
126+
"type": "number"
127+
}
128+
},
129+
"type": "object"
130+
}

0 commit comments

Comments
 (0)