From a51958648a39a5495dc0528739bcdefc2005c08b Mon Sep 17 00:00:00 2001 From: kerms Date: Fri, 23 Jan 2026 14:52:47 +0100 Subject: [PATCH] refactor: remove vitepress dependency and rename project --- README.md | 8 ++++---- esp-flasher/EspFlasher.vue | 11 +++++------ esp-flasher/README.md | 11 +++++++---- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 88bb8ae..a60450c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Yunsi Toolbox +# Yunsi Toolbox Vue -A collection of web-based tools for hardware development and debugging. +A collection of web-based tools. ## Components @@ -9,8 +9,8 @@ A browser-based firmware flasher for ESP32 microcontrollers using Web Serial. ## Installation -This is intended to be used as a git submodule in Vue 3 projects (specifically optimized for VitePress). +This is intended to be used as a git submodule in Vue 3 projects. ```bash git submodule add src/components/yunsi-toolbox -``` +``` \ No newline at end of file diff --git a/esp-flasher/EspFlasher.vue b/esp-flasher/EspFlasher.vue index ebe1da6..167c747 100644 --- a/esp-flasher/EspFlasher.vue +++ b/esp-flasher/EspFlasher.vue @@ -17,16 +17,10 @@ import 'xterm/css/xterm.css'; import {onBeforeMount, onMounted, reactive, ref, watch} from "vue"; import {ESPLoader, type FlashOptions, type IEspLoaderTerminal, type LoaderOptions, Transport} from "./lib_esptools-js"; import CryptoJS from "crypto-js"; -import {useData} from 'vitepress'; const terminalContainer = ref(); let terminal: any; let fitAddon: any; -const isDarkMode = useData().isDark; - -watch(isDarkMode, value => { - -}); const terminalConfig = { theme: { @@ -99,8 +93,13 @@ type ImageOption = { const props = defineProps<{ imageOptions: ImageOption[]; + isDark?: boolean; }>(); +watch(() => props.isDark, (value) => { + // Handle dark mode change if needed for xterm +}); + const imageSelect = ref(props.imageOptions[0]); let transport: Transport | null; diff --git a/esp-flasher/README.md b/esp-flasher/README.md index 2b3cffa..0853214 100644 --- a/esp-flasher/README.md +++ b/esp-flasher/README.md @@ -7,7 +7,7 @@ A Vue 3 component for flashing ESP32 series microcontrollers directly from the b - Supports ESP32, ESP32-C3, ESP32-S3, and more. - Built-in Xterm.js terminal for progress and logging. - Support for multiple firmware image options. -- Dark mode support (compatible with VitePress). +- Dark mode support via prop. ## Usage @@ -16,6 +16,7 @@ A Vue 3 component for flashing ESP32 series microcontrollers directly from the b | Prop | Type | Description | | :--- | :--- | :--- | | `imageOptions` | `ImageOption[]` | An array of firmware images available for flashing. | +| `isDark` | `boolean` | (Optional) Toggle dark mode for the terminal. | #### ImageOption Object @@ -32,6 +33,9 @@ type ImageOption = { ```vue ``` @@ -58,8 +62,7 @@ const imageOptions = [ - `xterm` - `xterm-addon-fit` - `crypto-js` -- `vitepress` (for `useData` dark mode toggle) ## Credits -This tool uses a modified version of [esptools-js](https://github.com/espressif/esptools-js). +This tool uses a modified version of [esptools-js](https://github.com/espressif/esptools-js). \ No newline at end of file