From d07e90b928f9b80276abe4c48447d1e60126d5aa Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 17:31:44 +1000 Subject: [PATCH 1/8] feat(schema): intellisence for themes --- .vscode/settings.json | 8 ++ schemas/theme.json | 179 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 187 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 schemas/theme.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..ad844bd --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,8 @@ +{ + "yaml.schemas": { + "schemas/theme.json": [ + "base16/*.yaml", + "holiday/*.yaml" + ] + } +} \ No newline at end of file diff --git a/schemas/theme.json b/schemas/theme.json new file mode 100644 index 0000000..356a413 --- /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", + "$ref": "#/definitions/color" + }, + "blue": { + "title": "blue", + "description": "A blue color", + "$ref": "#/definitions/color" + }, + "cyan": { + "title": "cyan", + "description": "A cyan color", + "$ref": "#/definitions/color" + }, + "green": { + "title": "green", + "description": "A green color", + "$ref": "#/definitions/color" + }, + "magenta": { + "title": "magenta", + "description": "A magenta color", + "$ref": "#/definitions/color" + }, + "red": { + "title": "red", + "description": "A red color", + "$ref": "#/definitions/color" + }, + "white": { + "title": "white", + "description": "A white color", + "$ref": "#/definitions/color" + }, + "yellow": { + "title": "yellow", + "description": "A yellow color", + "$ref": "#/definitions/color" + } + }, + "additionalProperties": false + }, + "color-or-gradient": { + "oneOf": [ + { + "$ref": "#/definitions/color" + }, + { + "type": "object", + "oneOf": [ + { + "properties": { + "left": { + "title": "left", + "description": "A left color", + "$ref": "#/definitions/color" + }, + "right": { + "title": "right", + "description": "A right color", + "$ref": "#/definitions/color" + } + }, + "additionalProperties": false + }, + { + "properties": { + "up": { + "title": "up", + "description": "A up color", + "$ref": "#/definitions/color" + }, + "bottom": { + "title": "bottom", + "description": "A bottom color", + "$ref": "#/definitions/color" + } + }, + "additionalProperties": false + } + ] + } + ] + } + }, + "title": "theme", + "description": "A theme", + "type": "object", + "properties": { + "accent": { + "title": "accent", + "description": "An accent color", + "$ref": "#/definitions/color-or-gradient" + }, + "background": { + "title": "background", + "description": "A background color", + "$ref": "#/definitions/color-or-gradient" + }, + "details": { + "title": "details", + "description": "Whether lighter or darker colors are used", + "type": "string", + "enum": [ + "lighter", + "darker" + ] + }, + "foreground": { + "title": "foreground", + "description": "A foreground color", + "$ref": "#/definitions/color" + }, + "terminal_colors": { + "title": "terminal colors", + "description": "Terminal colors", + "type": "object", + "properties": { + "bright": { + "title": "bright", + "description": "Bright colors", + "$ref": "#/definitions/colors" + }, + "normal": { + "title": "normal", + "description": "Normal colors", + "$ref": "#/definitions/colors" + } + }, + "additionalProperties": false + }, + "background_image": { + "title": "background image", + "description": "A background image", + "type": "object", + "properties": { + "path": { + "title": "path", + "description": "A path of the current image", + "type": "string", + "minLength": 1, + "examples": [ + "warp.jpg" + ] + }, + "opacity": { + "title": "opacity", + "description": "An opacity of the current image", + "type": "integer", + "minimum": 0, + "maximum": 100 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file From ad8f3c380ee22ff743d2d1d2f6bc64523d9ffacb Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 17:36:06 +1000 Subject: [PATCH 2/8] feat(schema): validate standard/*.yaml themes --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ad844bd..703bef7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,8 @@ "yaml.schemas": { "schemas/theme.json": [ "base16/*.yaml", - "holiday/*.yaml" + "holiday/*.yaml", + "standard/*.yaml" ] } } \ No newline at end of file From c7505e03350252998d696a6746991c76ef232af9 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 17:37:26 +1000 Subject: [PATCH 3/8] feat(ci): theme validation --- .github/workflows/ci.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..c8fcaba --- /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; do + env -C "$directory" jsonschema-cli validate "../schemas/theme.json" *.yaml + done From 10db3613550921604815d643cc130f4c2cbcecc5 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 17:51:26 +1000 Subject: [PATCH 4/8] fix(theme): up -> top --- schemas/theme.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schemas/theme.json b/schemas/theme.json index 356a413..f81a712 100644 --- a/schemas/theme.json +++ b/schemas/theme.json @@ -86,9 +86,9 @@ }, { "properties": { - "up": { - "title": "up", - "description": "A up color", + "top": { + "title": "top", + "description": "A top color", "$ref": "#/definitions/color" }, "bottom": { From 6e595e5234736d7506529f38512fe68dfab309fb Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 17:51:48 +1000 Subject: [PATCH 5/8] feat(theme): validate warp_bundled/*.yaml themes --- .vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 703bef7..8abad2c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,8 @@ "schemas/theme.json": [ "base16/*.yaml", "holiday/*.yaml", - "standard/*.yaml" + "standard/*.yaml", + "warp_bundled/*.yaml" ] } } \ No newline at end of file From 4e0213f56e21e7a6f3c6879b5b888d88b4d99118 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 17:52:30 +1000 Subject: [PATCH 6/8] feat(ci): validate warp_bundled/*.yaml themes --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index c8fcaba..c529f1f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -12,6 +12,6 @@ jobs: - uses: actions/checkout@v3 - run: pip3 install jsonschema-cli - run: | - for directory in base16 holiday standard; do + for directory in base16 holiday standard warp_bundled; do env -C "$directory" jsonschema-cli validate "../schemas/theme.json" *.yaml done From 63f55495ad12222df14759b1ea63f739b28f5b88 Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 18:00:48 +1000 Subject: [PATCH 7/8] feat(schema): more descriptive key explanations --- schemas/theme.json | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/schemas/theme.json b/schemas/theme.json index f81a712..764dc2b 100644 --- a/schemas/theme.json +++ b/schemas/theme.json @@ -20,42 +20,42 @@ "properties": { "black": { "title": "black", - "description": "A black color", + "description": "A black color of the current theme", "$ref": "#/definitions/color" }, "blue": { "title": "blue", - "description": "A blue color", + "description": "A blue color of the current theme", "$ref": "#/definitions/color" }, "cyan": { "title": "cyan", - "description": "A cyan color", + "description": "A cyan color of the current theme", "$ref": "#/definitions/color" }, "green": { "title": "green", - "description": "A green color", + "description": "A green color of the current theme", "$ref": "#/definitions/color" }, "magenta": { "title": "magenta", - "description": "A magenta color", + "description": "A magenta color of the current theme", "$ref": "#/definitions/color" }, "red": { "title": "red", - "description": "A red color", + "description": "A red color of the current theme", "$ref": "#/definitions/color" }, "white": { "title": "white", - "description": "A white color", + "description": "A white color of the current theme", "$ref": "#/definitions/color" }, "yellow": { "title": "yellow", - "description": "A yellow color", + "description": "A yellow color of the current theme", "$ref": "#/definitions/color" } }, @@ -73,12 +73,12 @@ "properties": { "left": { "title": "left", - "description": "A left color", + "description": "A left color of the current theme", "$ref": "#/definitions/color" }, "right": { "title": "right", - "description": "A right color", + "description": "A right color of the current theme", "$ref": "#/definitions/color" } }, @@ -88,12 +88,12 @@ "properties": { "top": { "title": "top", - "description": "A top color", + "description": "A top color of the current theme", "$ref": "#/definitions/color" }, "bottom": { "title": "bottom", - "description": "A bottom color", + "description": "A bottom color of the current theme", "$ref": "#/definitions/color" } }, @@ -110,17 +110,17 @@ "properties": { "accent": { "title": "accent", - "description": "An accent color", + "description": "An accent color of the current theme", "$ref": "#/definitions/color-or-gradient" }, "background": { "title": "background", - "description": "A background color", + "description": "A background color of the current theme", "$ref": "#/definitions/color-or-gradient" }, "details": { "title": "details", - "description": "Whether lighter or darker colors are used", + "description": "Whether lighter or darker colors are used in the current theme", "type": "string", "enum": [ "lighter", @@ -129,22 +129,22 @@ }, "foreground": { "title": "foreground", - "description": "A foreground color", + "description": "A foreground color of the current theme", "$ref": "#/definitions/color" }, "terminal_colors": { "title": "terminal colors", - "description": "Terminal colors", + "description": "Terminal colors of the current theme", "type": "object", "properties": { "bright": { "title": "bright", - "description": "Bright colors", + "description": "Bright colors of the current theme", "$ref": "#/definitions/colors" }, "normal": { "title": "normal", - "description": "Normal colors", + "description": "Normal colors of the current theme", "$ref": "#/definitions/colors" } }, @@ -152,12 +152,12 @@ }, "background_image": { "title": "background image", - "description": "A background image", + "description": "A background image of the current theme", "type": "object", "properties": { "path": { "title": "path", - "description": "A path of the current image", + "description": "A path of the current image of the current theme", "type": "string", "minLength": 1, "examples": [ @@ -166,7 +166,7 @@ }, "opacity": { "title": "opacity", - "description": "An opacity of the current image", + "description": "An opacity of the current image of the current theme", "type": "integer", "minimum": 0, "maximum": 100 From 1d7db8c8a7e3387ab1e03a7f6d43a6134e249cbd Mon Sep 17 00:00:00 2001 From: EmilySeville7cfg Date: Sun, 21 May 2023 18:22:43 +1000 Subject: [PATCH 8/8] feat(schema): add links to docs --- schemas/theme.json | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/schemas/theme.json b/schemas/theme.json index 764dc2b..ddbc000 100644 --- a/schemas/theme.json +++ b/schemas/theme.json @@ -20,42 +20,42 @@ "properties": { "black": { "title": "black", - "description": "A black color of the current theme", + "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", + "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", + "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", + "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", + "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", + "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", + "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", + "description": "A yellow color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", "$ref": "#/definitions/color" } }, @@ -73,12 +73,12 @@ "properties": { "left": { "title": "left", - "description": "A left color of the current theme", + "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", + "description": "A right color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", "$ref": "#/definitions/color" } }, @@ -88,12 +88,12 @@ "properties": { "top": { "title": "top", - "description": "A top color of the current theme", + "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", + "description": "A bottom color of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#background-images-and-gradients", "$ref": "#/definitions/color" } }, @@ -110,17 +110,17 @@ "properties": { "accent": { "title": "accent", - "description": "An accent color of the current theme", + "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", + "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", + "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", @@ -129,22 +129,22 @@ }, "foreground": { "title": "foreground", - "description": "A foreground color of the current theme", + "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", + "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", + "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", + "description": "Normal colors of the current theme\nhttps://docs.warp.dev/appearance/custom-themes#create-your-own-custom-theme-manually", "$ref": "#/definitions/colors" } }, @@ -157,7 +157,7 @@ "properties": { "path": { "title": "path", - "description": "A path of the current image of the current theme", + "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": [ @@ -166,7 +166,7 @@ }, "opacity": { "title": "opacity", - "description": "An opacity of the current image of the current theme", + "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