cli/schema/schema.json
jolheiser 6a036b2148
feat: add hooks to schema
Signed-off-by: jolheiser <john.olheiser@gmail.com>
2022-11-15 09:00:25 -06:00

164 lines
4.0 KiB
JSON

{
"$schema": "https://json-schema.org/draft-07/schema",
"$id": "https://github.com/catppuccin/cli/raw/main/schema/schema.json",
"title": "Catppuccin config",
"description": "JSON schema for Catppuccin port configuration file",
"type": "object",
"additionalProperties": true,
"required": [
"app_name",
"binary_name",
"installation"
],
"properties": {
"app_name": {
"description": "Name of the application",
"type": "string"
},
"binary_name": {
"description": "Name of the executable",
"type": "string"
},
"installation": {
"description": "Installation location",
"type": "object",
"additionalProperties": false,
"properties": {
"location": {
"description": "Location for each OS",
"type": "object",
"additionalProperties": false,
"properties": {
"macos": {
"type": "string"
},
"linux": {
"type": "string"
},
"windows": {
"type": "string"
}
}
},
"flavours": {
"description": "Flavours for this theme",
"type": "object",
"additionalProperties": false,
"properties": {
"all": {
"$ref": "#/$defs/flavour"
},
"latte": {
"$ref": "#/$defs/flavour"
},
"frappe": {
"$ref": "#/$defs/flavour"
},
"macchiato": {
"$ref": "#/$defs/flavour"
},
"mocha": {
"$ref": "#/$defs/flavour"
}
}
},
"to": {
"description": "Where to install theme files to",
"type": "string"
},
"one_flavour": {
"description": "Whether there is only a single flavour or not",
"type": "boolean"
},
"comments": {
"description": "Post-install comments",
"type": "string"
},
"modes": {
"description": "Additional modes for this theme",
"type": "array",
"items": {
"type": "string"
}
},
"hooks": {
"description": "(Un)Installation hooks",
"type": "object",
"additionalProperties": false,
"properties": {
"install": {
"description": "Install hooks",
"type": "array",
"items": {
"$ref": "#/$defs/hook"
}
},
"uninstall": {
"description": "Uninstall hooks",
"type": "array",
"items": {
"$ref": "#/$defs/hook"
}
}
}
}
}
}
},
"$defs": {
"flavour": {
"description": "Catppuccin flavour entry",
"type": "object",
"additionalProperties": false,
"properties": {
"default": {
"description": "Default flavour entry",
"type": "array",
"items": {
"type": "string"
}
},
"additional": {
"description": "Additional flavour entries",
"type": "object",
"patternProperties": {
".*": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"hook": {
"description": "(Un)Installation hook",
"type": "object",
"additionalProperties": false,
"required": [
"type",
"args"
],
"properties": {
"type": {
"description": "Hook type",
"type": "string",
"enum": [
"shell",
"browser"
]
},
"args": {
"description": "Hook arguments",
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
}
}
}
}