From b3ecc0846811941e2f76445d6e26c5f48fb7aa67 Mon Sep 17 00:00:00 2001 From: landaiqing Date: Fri, 25 Apr 2025 17:44:40 +0800 Subject: [PATCH] :art: Refactor code structure --- frontend/bindings/voidraft/greetservice.ts | 11 --- frontend/bindings/voidraft/index.ts | 7 -- frontend/components.d.ts | 2 +- frontend/package-lock.json | 81 ++++++++++++------- frontend/package.json | 14 ++-- frontend/src/App.vue | 4 +- frontend/src/assets/styles/font.css | 1 - .../toolbar/{index.vue => Toolbar.vue} | 0 frontend/src/editor/{index.vue => Editor.vue} | 0 frontend/vite.config.ts | 59 ++++++++++---- greetservice.go | 7 -- main.go | 10 +-- 12 files changed, 109 insertions(+), 87 deletions(-) delete mode 100644 frontend/bindings/voidraft/greetservice.ts delete mode 100644 frontend/bindings/voidraft/index.ts delete mode 100644 frontend/src/assets/styles/font.css rename frontend/src/components/toolbar/{index.vue => Toolbar.vue} (100%) rename frontend/src/editor/{index.vue => Editor.vue} (100%) delete mode 100644 greetservice.go diff --git a/frontend/bindings/voidraft/greetservice.ts b/frontend/bindings/voidraft/greetservice.ts deleted file mode 100644 index 27eef2b..0000000 --- a/frontend/bindings/voidraft/greetservice.ts +++ /dev/null @@ -1,11 +0,0 @@ -// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL -// This file is automatically generated. DO NOT EDIT - -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore: Unused imports -import {Call as $Call, Create as $Create} from "@wailsio/runtime"; - -export function Greet(name: string): Promise & { cancel(): void } { - let $resultPromise = $Call.ByID(1411160069, name) as any; - return $resultPromise; -} diff --git a/frontend/bindings/voidraft/index.ts b/frontend/bindings/voidraft/index.ts deleted file mode 100644 index 50e3f04..0000000 --- a/frontend/bindings/voidraft/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL -// This file is automatically generated. DO NOT EDIT - -import * as GreetService from "./greetservice.js"; -export { - GreetService -}; diff --git a/frontend/components.d.ts b/frontend/components.d.ts index ea05d44..a690547 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -10,6 +10,6 @@ declare module 'vue' { export interface GlobalComponents { RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] - Toolbar: typeof import('./src/components/toolbar/index.vue')['default'] + Toolbar: typeof import('./src/components/toolbar/Toolbar.vue')['default'] } } diff --git a/frontend/package-lock.json b/frontend/package-lock.json index aa758f7..658393f 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -10,7 +10,7 @@ "dependencies": { "@codemirror/autocomplete": "^6.18.6", "@codemirror/commands": "^6.8.1", - "@codemirror/lang-angular": "^0.1.3", + "@codemirror/lang-angular": "^0.1.4", "@codemirror/lang-cpp": "^6.0.2", "@codemirror/lang-css": "^6.3.1", "@codemirror/lang-go": "^6.0.1", @@ -22,7 +22,7 @@ "@codemirror/lang-liquid": "^6.2.3", "@codemirror/lang-markdown": "^6.3.2", "@codemirror/lang-php": "^6.0.1", - "@codemirror/lang-python": "^6.1.7", + "@codemirror/lang-python": "^6.2.0", "@codemirror/lang-rust": "^6.0.1", "@codemirror/lang-sass": "^6.0.2", "@codemirror/lang-sql": "^6.8.0", @@ -36,14 +36,16 @@ "@codemirror/lint": "^6.8.5", "@codemirror/search": "^6.5.10", "@codemirror/state": "^6.5.2", - "@codemirror/view": "^6.36.5", + "@codemirror/view": "^6.36.6", "@lezer/highlight": "^1.2.1", "@primeuix/themes": "^1.0.3", + "@types/uuid": "^10.0.0", "codemirror": "^6.0.1", "pinia": "^3.0.2", "pinia-plugin-persistedstate": "^4.2.0", "primevue": "^4.3.3", "sass": "^1.87.0", + "uuid": "^11.1.0", "vue": "^3.5.13", "vue-i18n": "^11.1.3", "vue-router": "^4.5.0" @@ -51,7 +53,7 @@ "devDependencies": { "@eslint/js": "^9.25.1", "@primevue/auto-import-resolver": "^4.3.3", - "@types/node": "^22.14.1", + "@types/node": "^22.15.2", "@vitejs/plugin-vue": "^5.2.3", "@wailsio/runtime": "latest", "eslint": "^9.25.1", @@ -60,9 +62,9 @@ "typescript": "^5.8.3", "typescript-eslint": "^8.31.0", "unplugin-vue-components": "^28.5.0", - "vite": "^6.3.2", + "vite": "^6.3.3", "vue-eslint-parser": "^10.1.3", - "vue-tsc": "^2.2.8" + "vue-tsc": "^2.2.10" } }, "node_modules/@babel/helper-string-parser": { @@ -136,9 +138,9 @@ } }, "node_modules/@codemirror/lang-angular": { - "version": "0.1.3", - "resolved": "https://registry.npmmirror.com/@codemirror/lang-angular/-/lang-angular-0.1.3.tgz", - "integrity": "sha512-xgeWGJQQl1LyStvndWtruUvb4SnBZDAu/gvFH/ZU+c0W25tQR8e5hq7WTwiIY2dNxnf+49mRiGI/9yxIwB6f5w==", + "version": "0.1.4", + "resolved": "https://registry.npmmirror.com/@codemirror/lang-angular/-/lang-angular-0.1.4.tgz", + "integrity": "sha512-oap+gsltb/fzdlTQWD6BFF4bSLKcDnlxDsLdePiJpCVNKWXSTAbiiQeYI3UmES+BLAdkmIC1WjyztC1pi/bX4g==", "license": "MIT", "dependencies": { "@codemirror/lang-html": "^6.0.0", @@ -295,9 +297,9 @@ } }, "node_modules/@codemirror/lang-python": { - "version": "6.1.7", - "resolved": "https://registry.npmmirror.com/@codemirror/lang-python/-/lang-python-6.1.7.tgz", - "integrity": "sha512-mZnFTsL4lW5p9ch8uKNKeRU3xGGxr1QpESLilfON2E3fQzOa/OygEMkaDvERvXDJWJA9U9oN/D4w0ZuUzNO4+g==", + "version": "6.2.0", + "resolved": "https://registry.npmmirror.com/@codemirror/lang-python/-/lang-python-6.2.0.tgz", + "integrity": "sha512-+oLTR88uLib84tvb4XmOBBq/dgrctvPXueP3Wjotu4zmHLM2KW2wfswJ6r1BKlfJNcGgdWX1AgUeGEf3E2H5LA==", "license": "MIT", "dependencies": { "@codemirror/autocomplete": "^6.3.2", @@ -484,9 +486,9 @@ } }, "node_modules/@codemirror/view": { - "version": "6.36.5", - "resolved": "https://registry.npmmirror.com/@codemirror/view/-/view-6.36.5.tgz", - "integrity": "sha512-cd+FZEUlu3GQCYnguYm3EkhJ8KJVisqqUsCOKedBoAt/d9c76JUUap6U0UrpElln5k6VyrEOYliMuDAKIeDQLg==", + "version": "6.36.6", + "resolved": "https://registry.npmmirror.com/@codemirror/view/-/view-6.36.6.tgz", + "integrity": "sha512-uxugGLet+Nzp0Jcit8Hn3LypM8ioMLKTsdf8FRoT3HWvZtb9GhaWMe0Cc15rz90Ljab4YFJiAulmIVB74OY0IQ==", "license": "MIT", "dependencies": { "@codemirror/state": "^6.5.0", @@ -2139,15 +2141,21 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "22.14.1", - "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.14.1.tgz", - "integrity": "sha512-u0HuPQwe/dHrItgHHpmw3N2fYCR6x4ivMNbPHRkBVP4CvN+kiRrKHWk3i8tXiO/joPwXLMYvF9TTF0eqgHIuOw==", + "version": "22.15.2", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.15.2.tgz", + "integrity": "sha512-uKXqKN9beGoMdBfcaTY1ecwz6ctxuJAcUlwE55938g0ZJ8lRxwAZqRz2AJ4pzpt5dHdTPMB863UZ0ESiFUcP7A==", "dev": true, "license": "MIT", "dependencies": { "undici-types": "~6.21.0" } }, + "node_modules/@types/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmmirror.com/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "license": "MIT" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "8.31.0", "resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.31.0.tgz", @@ -2492,9 +2500,9 @@ } }, "node_modules/@vue/language-core": { - "version": "2.2.8", - "resolved": "https://registry.npmmirror.com/@vue/language-core/-/language-core-2.2.8.tgz", - "integrity": "sha512-rrzB0wPGBvcwaSNRriVWdNAbHQWSf0NlGqgKHK5mEkXpefjUlVRP62u03KvwZpvKVjRnBIQ/Lwre+Mx9N6juUQ==", + "version": "2.2.10", + "resolved": "https://registry.npmmirror.com/@vue/language-core/-/language-core-2.2.10.tgz", + "integrity": "sha512-+yNoYx6XIKuAO8Mqh1vGytu8jkFEOH5C8iOv3i8Z/65A7x9iAOXA97Q+PqZ3nlm2lxf5rOJuIGI/wDtx/riNYw==", "dev": true, "license": "MIT", "dependencies": { @@ -4896,19 +4904,32 @@ "dev": true, "license": "MIT" }, + "node_modules/uuid": { + "version": "11.1.0", + "resolved": "https://registry.npmmirror.com/uuid/-/uuid-11.1.0.tgz", + "integrity": "sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/vite": { - "version": "6.3.2", - "resolved": "https://registry.npmmirror.com/vite/-/vite-6.3.2.tgz", - "integrity": "sha512-ZSvGOXKGceizRQIZSz7TGJ0pS3QLlVY/9hwxVh17W3re67je1RKYzFHivZ/t0tubU78Vkyb9WnHPENSBCzbckg==", + "version": "6.3.3", + "resolved": "https://registry.npmmirror.com/vite/-/vite-6.3.3.tgz", + "integrity": "sha512-5nXH+QsELbFKhsEfWLkHrvgRpTdGJzqOZ+utSdmPTvwHmvU6ITTm3xx+mRusihkcI8GeC7lCDyn3kDtiki9scw==", "dev": true, "license": "MIT", "dependencies": { "esbuild": "^0.25.0", - "fdir": "^6.4.3", + "fdir": "^6.4.4", "picomatch": "^4.0.2", "postcss": "^8.5.3", "rollup": "^4.34.9", - "tinyglobby": "^0.2.12" + "tinyglobby": "^0.2.13" }, "bin": { "vite": "bin/vite.js" @@ -5100,14 +5121,14 @@ "license": "MIT" }, "node_modules/vue-tsc": { - "version": "2.2.8", - "resolved": "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-2.2.8.tgz", - "integrity": "sha512-jBYKBNFADTN+L+MdesNX/TB3XuDSyaWynKMDgR+yCSln0GQ9Tfb7JS2lr46s2LiFUT1WsmfWsSvIElyxzOPqcQ==", + "version": "2.2.10", + "resolved": "https://registry.npmmirror.com/vue-tsc/-/vue-tsc-2.2.10.tgz", + "integrity": "sha512-jWZ1xSaNbabEV3whpIDMbjVSVawjAyW+x1n3JeGQo7S0uv2n9F/JMgWW90tGWNFRKya4YwKMZgCtr0vRAM7DeQ==", "dev": true, "license": "MIT", "dependencies": { "@volar/typescript": "~2.4.11", - "@vue/language-core": "2.2.8" + "@vue/language-core": "2.2.10" }, "bin": { "vue-tsc": "bin/vue-tsc.js" diff --git a/frontend/package.json b/frontend/package.json index b5c8658..52a010a 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,7 +14,7 @@ "dependencies": { "@codemirror/autocomplete": "^6.18.6", "@codemirror/commands": "^6.8.1", - "@codemirror/lang-angular": "^0.1.3", + "@codemirror/lang-angular": "^0.1.4", "@codemirror/lang-cpp": "^6.0.2", "@codemirror/lang-css": "^6.3.1", "@codemirror/lang-go": "^6.0.1", @@ -26,7 +26,7 @@ "@codemirror/lang-liquid": "^6.2.3", "@codemirror/lang-markdown": "^6.3.2", "@codemirror/lang-php": "^6.0.1", - "@codemirror/lang-python": "^6.1.7", + "@codemirror/lang-python": "^6.2.0", "@codemirror/lang-rust": "^6.0.1", "@codemirror/lang-sass": "^6.0.2", "@codemirror/lang-sql": "^6.8.0", @@ -40,14 +40,16 @@ "@codemirror/lint": "^6.8.5", "@codemirror/search": "^6.5.10", "@codemirror/state": "^6.5.2", - "@codemirror/view": "^6.36.5", + "@codemirror/view": "^6.36.6", "@lezer/highlight": "^1.2.1", "@primeuix/themes": "^1.0.3", + "@types/uuid": "^10.0.0", "codemirror": "^6.0.1", "pinia": "^3.0.2", "pinia-plugin-persistedstate": "^4.2.0", "primevue": "^4.3.3", "sass": "^1.87.0", + "uuid": "^11.1.0", "vue": "^3.5.13", "vue-i18n": "^11.1.3", "vue-router": "^4.5.0" @@ -55,7 +57,7 @@ "devDependencies": { "@eslint/js": "^9.25.1", "@primevue/auto-import-resolver": "^4.3.3", - "@types/node": "^22.14.1", + "@types/node": "^22.15.2", "@vitejs/plugin-vue": "^5.2.3", "@wailsio/runtime": "latest", "eslint": "^9.25.1", @@ -64,8 +66,8 @@ "typescript": "^5.8.3", "typescript-eslint": "^8.31.0", "unplugin-vue-components": "^28.5.0", - "vite": "^6.3.2", + "vite": "^6.3.3", "vue-eslint-parser": "^10.1.3", - "vue-tsc": "^2.2.8" + "vue-tsc": "^2.2.10" } } diff --git a/frontend/src/App.vue b/frontend/src/App.vue index acc9e2e..b689af8 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,6 +1,6 @@