From 98441bf98c378780035e2523335eeb26a198d825 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Tue, 24 Sep 2024 11:24:57 -0400 Subject: [PATCH] Refactor theme --- .vscodeignore | 2 +- src/core/webviews/ClaudeDevProvider.ts | 2 +- .../theme}/default-themes/dark_modern.json | 0 .../theme}/default-themes/dark_plus.json | 0 src/{utils => integrations/theme}/default-themes/dark_vs.json | 0 .../theme}/default-themes/hc_black.json | 0 .../theme}/default-themes/hc_light.json | 0 .../theme}/default-themes/light_modern.json | 0 .../theme}/default-themes/light_plus.json | 0 .../theme}/default-themes/light_vs.json | 0 src/{utils => integrations/theme}/getTheme.ts | 4 ++-- 11 files changed, 4 insertions(+), 4 deletions(-) rename src/{utils => integrations/theme}/default-themes/dark_modern.json (100%) rename src/{utils => integrations/theme}/default-themes/dark_plus.json (100%) rename src/{utils => integrations/theme}/default-themes/dark_vs.json (100%) rename src/{utils => integrations/theme}/default-themes/hc_black.json (100%) rename src/{utils => integrations/theme}/default-themes/hc_light.json (100%) rename src/{utils => integrations/theme}/default-themes/light_modern.json (100%) rename src/{utils => integrations/theme}/default-themes/light_plus.json (100%) rename src/{utils => integrations/theme}/default-themes/light_vs.json (100%) rename src/{utils => integrations/theme}/getTheme.ts (95%) diff --git a/.vscodeignore b/.vscodeignore index 279d1bc..b58330a 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -36,7 +36,7 @@ webview-ui/node_modules/** !node_modules/@vscode/codicons/dist/codicon.ttf # Include default themes JSON files used in getTheme -!src/utils/default-themes/** +!src/integrations/theme/default-themes/** # Include icons !icons/** \ No newline at end of file diff --git a/src/core/webviews/ClaudeDevProvider.ts b/src/core/webviews/ClaudeDevProvider.ts index d89ba53..6f19aed 100644 --- a/src/core/webviews/ClaudeDevProvider.ts +++ b/src/core/webviews/ClaudeDevProvider.ts @@ -9,7 +9,7 @@ import * as path from "path" import fs from "fs/promises" import { HistoryItem } from "../../shared/HistoryItem" import axios from "axios" -import { getTheme } from "../../utils/getTheme" +import { getTheme } from "../../integrations/theme/getTheme" import { openFile, openImage } from "../../utils/open-file" import WorkspaceTracker from "../../integrations/WorkspaceTracker" import { openMention } from "../../utils/context-mentions" diff --git a/src/utils/default-themes/dark_modern.json b/src/integrations/theme/default-themes/dark_modern.json similarity index 100% rename from src/utils/default-themes/dark_modern.json rename to src/integrations/theme/default-themes/dark_modern.json diff --git a/src/utils/default-themes/dark_plus.json b/src/integrations/theme/default-themes/dark_plus.json similarity index 100% rename from src/utils/default-themes/dark_plus.json rename to src/integrations/theme/default-themes/dark_plus.json diff --git a/src/utils/default-themes/dark_vs.json b/src/integrations/theme/default-themes/dark_vs.json similarity index 100% rename from src/utils/default-themes/dark_vs.json rename to src/integrations/theme/default-themes/dark_vs.json diff --git a/src/utils/default-themes/hc_black.json b/src/integrations/theme/default-themes/hc_black.json similarity index 100% rename from src/utils/default-themes/hc_black.json rename to src/integrations/theme/default-themes/hc_black.json diff --git a/src/utils/default-themes/hc_light.json b/src/integrations/theme/default-themes/hc_light.json similarity index 100% rename from src/utils/default-themes/hc_light.json rename to src/integrations/theme/default-themes/hc_light.json diff --git a/src/utils/default-themes/light_modern.json b/src/integrations/theme/default-themes/light_modern.json similarity index 100% rename from src/utils/default-themes/light_modern.json rename to src/integrations/theme/default-themes/light_modern.json diff --git a/src/utils/default-themes/light_plus.json b/src/integrations/theme/default-themes/light_plus.json similarity index 100% rename from src/utils/default-themes/light_plus.json rename to src/integrations/theme/default-themes/light_plus.json diff --git a/src/utils/default-themes/light_vs.json b/src/integrations/theme/default-themes/light_vs.json similarity index 100% rename from src/utils/default-themes/light_vs.json rename to src/integrations/theme/default-themes/light_vs.json diff --git a/src/utils/getTheme.ts b/src/integrations/theme/getTheme.ts similarity index 95% rename from src/utils/getTheme.ts rename to src/integrations/theme/getTheme.ts index 8a99b1b..b582999 100644 --- a/src/utils/getTheme.ts +++ b/src/integrations/theme/getTheme.ts @@ -54,7 +54,7 @@ export async function getTheme() { if (currentTheme === undefined && defaultThemes[colorTheme]) { const filename = `${defaultThemes[colorTheme]}.json` currentTheme = await fs.readFile( - path.join(getExtensionUri().fsPath, "src", "utils", "default-themes", filename), + path.join(getExtensionUri().fsPath, "src", "integrations", "theme", "default-themes", filename), "utf-8" ) } @@ -64,7 +64,7 @@ export async function getTheme() { if (parsed.include) { const includeThemeString = await fs.readFile( - path.join(getExtensionUri().fsPath, "src", "utils", "default-themes", parsed.include), + path.join(getExtensionUri().fsPath, "src", "integrations", "theme", "default-themes", parsed.include), "utf-8" ) const includeTheme = parseThemeString(includeThemeString)