diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c529f1f --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,17 @@ +name: CI +on: + pull_request: + branches: + - main + +jobs: + lint: + name: Lint + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v3 + - run: pip3 install jsonschema-cli + - run: | + for directory in base16 holiday standard warp_bundled; do + env -C "$directory" jsonschema-cli validate "../schemas/theme.json" *.yaml + done diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..8abad2c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,10 @@ +{ + "yaml.schemas": { + "schemas/theme.json": [ + "base16/*.yaml", + "holiday/*.yaml", + "standard/*.yaml", + "warp_bundled/*.yaml" + ] + } +} \ No newline at end of file diff --git a/schemas/theme.json b/schemas/theme.json new file mode 100644 index 0000000..ddbc000 --- /dev/null +++ b/schemas/theme.json @@ -0,0 +1,179 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "definitions": { + "color": { + "type": "string", + "pattern": "^#[0-9a-fA-F]{6}$", + "examples": [ + "#000000", + "#ff0000", + "#00ff00", + "#0000ff", + "#ffff00", + "#ff00ff", + "#00ffff", + "#ffffff" + ] + }, + "colors": { + "type": "object", + "properties": { + "black": { + "title": "black", + "description": "A black color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "blue": { + "title": "blue", + "description": "A blue color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "cyan": { + "title": "cyan", + "description": "A cyan color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "green": { + "title": "green", + "description": "A green color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "magenta": { + "title": "magenta", + "description": "A magenta color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "red": { + "title": "red", + "description": "A red color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "white": { + "title": "white", + "description": "A white color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "yellow": { + "title": "yellow", + "description": "A yellow color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + } + }, + "additionalProperties": false + }, + "color-or-gradient": { + "oneOf": [ + { + "$ref": "#/definitions/color" + }, + { + "type": "object", + "oneOf": [ + { + "properties": { + "left": { + "title": "left", + "description": "A left color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", + "$ref": "#/definitions/color" + }, + "right": { + "title": "right", + "description": "A right color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", + "$ref": "#/definitions/color" + } + }, + "additionalProperties": false + }, + { + "properties": { + "top": { + "title": "top", + "description": "A top color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", + "$ref": "#/definitions/color" + }, + "bottom": { + "title": "bottom", + "description": "A bottom color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", + "$ref": "#/definitions/color" + } + }, + "additionalProperties": false + } + ] + } + ] + } + }, + "title": "theme", + "description": "A theme", + "type": "object", + "properties": { + "accent": { + "title": "accent", + "description": "An accent color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color-or-gradient" + }, + "background": { + "title": "background", + "description": "A background color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color-or-gradient" + }, + "details": { + "title": "details", + "description": "Whether lighter or darker colors are used in the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "type": "string", + "enum": [ + "lighter", + "darker" + ] + }, + "foreground": { + "title": "foreground", + "description": "A foreground color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/color" + }, + "terminal_colors": { + "title": "terminal colors", + "description": "Terminal colors of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "type": "object", + "properties": { + "bright": { + "title": "bright", + "description": "Bright colors of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/colors" + }, + "normal": { + "title": "normal", + "description": "Normal colors of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", + "$ref": "#/definitions/colors" + } + }, + "additionalProperties": false + }, + "background_image": { + "title": "background image", + "description": "A background image of the current theme", + "type": "object", + "properties": { + "path": { + "title": "path", + "description": "A path of the current image of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", + "type": "string", + "minLength": 1, + "examples": [ + "warp.jpg" + ] + }, + "opacity": { + "title": "opacity", + "description": "An opacity of the current image of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", + "type": "integer", + "minimum": 0, + "maximum": 100 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file