Skip to content

Commit

Permalink
feat(schema): support LinUtil configs
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyGraceSeville7cf committed Sep 17, 2024
1 parent c084075 commit dc96c84
Show file tree
Hide file tree
Showing 3 changed files with 160 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -6884,6 +6884,18 @@
"description": "Preset list for a WinUtil",
"fileMatch": ["**/*winutil*/config/preset.json"],
"url": "https://raw.githubusercontent.com/winutil-preset.json"
},
{
"name": "Tab list for a LinUtil",
"description": "Tab list for a LinUtil",
"fileMatch": ["**/*linutil*/**/tabs.toml"],
"url": "https://raw.githubusercontent.com/linutil-tabs.json"
},
{
"name": "Tab data for a LinUtil",
"description": "Tab data for a LinUtil",
"fileMatch": ["**/*linutil*/**/tab_data.toml"],
"url": "https://raw.githubusercontent.com/linutil-tab-data.json"
}
]
}
123 changes: 123 additions & 0 deletions src/schemas/json/linutil-tab-data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "https://raw.githubusercontent.com/linutil-tab-data.json",
"definitions": {
"string-property": {
"type": "string",
"minLength": 1,
"pattern": "[^ ]"
}
},
"title": "tab data",
"description": "Tab data",
"type": "object",
"required": ["name", "data"],
"properties": {
"name": {
"title": "name",
"description": "The name of a tab",
"$ref": "#/definitions/string-property"
},
"data": {
"title": "data",
"description": "The data of a tab",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"title": "data entry",
"description": "The data entry of a tab",
"type": "object",
"properties": {
"name": {
"title": "name",
"description": "The name of a tab entry",
"$ref": "#/definitions/string-property"
},
"script": {
"title": "script",
"description": "The script run of a tab entry",
"$ref": "#/definitions/string-property"
},
"preconditions": {
"title": "preconditions",
"description": "Preconditions of a tab entry",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"title": "precondition entry",
"description": "The precondition entry of a tab entry",
"type": "object",
"properties": {
"matches": {
"title": "matches",
"description": "Whether to require the condition to match or not for a precondition entry",
"type": "boolean"
},
"data": {
"title": "data",
"description": "The data of a tab precondition entry",
"type": "object",
"properties": {
"environment": {
"title": "environment",
"description": "The environment variable of a data",
"$ref": "#/definitions/string-property"
}
},
"additionalProperties": false
},
"values": {
"title": "values",
"description": "The values of a tab precondition entry",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"title": "entry",
"description": "The entry of values",
"type": "string"
}
}
},
"additionalProperties": false
}
},
"entries": {
"title": "entries",
"description": "The entries of a tab entry",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"title": "entry",
"description": "The entry",
"type": "object",
"properties": {
"name": {
"title": "name",
"description": "The name of a tab entry",
"$ref": "#/definitions/string-property"
},
"script": {
"title": "script",
"description": "The script run of a tab entry",
"$ref": "#/definitions/string-property"
},
"matches": {
"title": "matches",
"description": "Whether to require the condition to match or not for an entry",
"type": "boolean"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
25 changes: 25 additions & 0 deletions src/schemas/json/linutil-tabs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"$id": "https://raw.githubusercontent.com/linutil-tabs.json",
"title": "tab data",
"description": "Tab data",
"type": "object",
"required": ["directories"],
"properties": {
"directories": {
"title": "directories",
"description": "The directories of tabs",
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"title": "directory entry",
"description": "The directory entry of a tab",
"type": "string",
"minLength": 1,
"pattern": "[^ ]"
}
}
},
"additionalProperties": false
}

0 comments on commit dc96c84

Please sign in to comment.