Skip to content

Commit

Permalink
Add json schema for liara config (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
hesam-init authored Jun 8, 2024
1 parent bb97c5e commit e5255a5
Show file tree
Hide file tree
Showing 3 changed files with 189 additions and 9 deletions.
62 changes: 55 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"pretty-quick": "^4.0.0",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
"typescript": "^5.4.5",
"typescript-json-schema": "^0.63.0"
},
"engines": {
"node": ">=18.0.0"
Expand Down Expand Up @@ -170,7 +171,8 @@
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"version": "oclif readme && git add README.md",
"readme": "oclif readme",
"prepare": "husky install"
"prepare": "husky install",
"schema": "typescript-json-schema ./src/types/liara-json.ts ILiaraJSON -o ./schemas/json/liara.json"
},
"husky": {
"hooks": {
Expand Down
130 changes: 130 additions & 0 deletions schemas/json/liara.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"default_1": {
"properties": {
"mountTo": {
"type": "string"
},
"name": {
"type": "string"
}
},
"type": "object"
},
"default_2": {
"properties": {
"args": {
"items": {
"type": "string"
},
"type": "array"
},
"cache": {
"type": "boolean"
},
"dockerfile": {
"type": "string"
},
"location": {
"type": "string"
}
},
"type": "object"
},
"default_3": {
"properties": {
"version": {
"type": "number"
}
},
"type": "object"
},
"default_4": {
"properties": {
"command": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "string"
}
]
},
"interval": {
"type": "number"
},
"retries": {
"type": "number"
},
"startPeriod": {
"type": "number"
},
"timeout": {
"type": "number"
}
},
"type": "object"
},
"default_5": {
"properties": {
"buildAssets": {
"type": "boolean"
},
"configCache": {
"type": "boolean"
},
"routeCache": {
"type": "boolean"
}
},
"type": "object"
}
},
"properties": {
"app": {
"type": "string"
},
"args": {
"items": {
"type": "string"
},
"type": "array"
},
"build": {
"$ref": "#/definitions/default_2"
},
"cron": {
"items": {
"type": "string"
},
"type": "array"
},
"disks": {
"items": {
"$ref": "#/definitions/default_1"
},
"type": "array"
},
"healthCheck": {
"$ref": "#/definitions/default_4"
},
"laravel": {
"$ref": "#/definitions/default_5"
},
"node": {
"$ref": "#/definitions/default_3"
},
"platform": {
"type": "string"
},
"port": {
"type": "number"
}
},
"type": "object"
}

0 comments on commit e5255a5

Please sign in to comment.