From d4c8d401bf20903814402e959c6a6b961e8e4f58 Mon Sep 17 00:00:00 2001 From: landaiqing Date: Tue, 22 Apr 2025 18:11:47 +0800 Subject: [PATCH] :wrench: Add configuration information and dependencies --- .gitignore | 2 +- frontend/.editorconfig | 17 + frontend/.env.development | 2 + frontend/.env.production | 2 + frontend/components.d.ts | 15 + frontend/eslint.config.js | 55 ++++ frontend/package.json | 26 +- frontend/src/App.vue | 3 +- frontend/src/assets/styles/normalize.css | 349 +++++++++++++++++++++ frontend/src/{ => assets/styles}/style.css | 2 +- frontend/src/components/HelloWorld.vue | 10 +- frontend/src/main.ts | 17 +- frontend/tsconfig.json | 11 +- frontend/vite.config.ts | 24 +- main.go | 21 +- wails.json | 6 +- 16 files changed, 531 insertions(+), 31 deletions(-) create mode 100644 frontend/.editorconfig create mode 100644 frontend/.env.development create mode 100644 frontend/.env.production create mode 100644 frontend/components.d.ts create mode 100644 frontend/eslint.config.js create mode 100644 frontend/src/assets/styles/normalize.css rename frontend/src/{ => assets/styles}/style.css (86%) diff --git a/.gitignore b/.gitignore index b6e0bd3..65680a0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,4 @@ node_modules frontend/dist .idea /frontend/package.json.md5 -/frontend/package-lock.json \ No newline at end of file +/frontend/yarn.lock \ No newline at end of file diff --git a/frontend/.editorconfig b/frontend/.editorconfig new file mode 100644 index 0000000..4162391 --- /dev/null +++ b/frontend/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +end_of_line = crlf +indent_size = 4 +indent_style = space +insert_final_newline = false +max_line_length = 120 +tab_width = 4 + +[*.vue] +indent_size = 2 +tab_width = 2 + +[{*.har,*.jsb2,*.jsb3,*.json,*.jsonc,*.postman_collection,*.postman_collection.json,*.postman_environment,*.postman_environment.json,.babelrc,.eslintrc,.stylelintrc,.ws-context,jest.config}] +indent_size = 2 diff --git a/frontend/.env.development b/frontend/.env.development new file mode 100644 index 0000000..fecfb36 --- /dev/null +++ b/frontend/.env.development @@ -0,0 +1,2 @@ +# 开发环境配置 +VITE_NODE_ENV='development' diff --git a/frontend/.env.production b/frontend/.env.production new file mode 100644 index 0000000..028935f --- /dev/null +++ b/frontend/.env.production @@ -0,0 +1,2 @@ +# 生产环境配置 +VITE_NODE_ENV='production' diff --git a/frontend/components.d.ts b/frontend/components.d.ts new file mode 100644 index 0000000..c9af4d8 --- /dev/null +++ b/frontend/components.d.ts @@ -0,0 +1,15 @@ +/* eslint-disable */ +// @ts-nocheck +// Generated by unplugin-vue-components +// Read more: https://github.com/vuejs/core/pull/3399 +// biome-ignore lint: disable +export {} + +/* prettier-ignore */ +declare module 'vue' { + export interface GlobalComponents { + HelloWorld: typeof import('./src/components/HelloWorld.vue')['default'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + } +} diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js new file mode 100644 index 0000000..fa3b688 --- /dev/null +++ b/frontend/eslint.config.js @@ -0,0 +1,55 @@ +import js from "@eslint/js"; +import globals from "globals"; +import tseslint from "typescript-eslint"; +import pluginVue from "eslint-plugin-vue"; +import {defineConfig} from "eslint/config"; + + +export default defineConfig([ + {files: ["**/*.{js,mjs,cjs,ts,vue}"], plugins: {js}, extends: ["js/recommended"]}, + {files: ["**/*.{js,mjs,cjs,ts,vue}"], languageOptions: {globals: {...globals.browser, ...globals.node}}}, + tseslint.configs.recommended, + pluginVue.configs["flat/essential"], + {files: ["**/*.vue"], languageOptions: {parserOptions: {parser: tseslint.parser}}}, + { + rules: { + semi: "error", + "@typescript-eslint/no-explicit-any": "off", + "vue/multi-word-component-names": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "args": "all", + "argsIgnorePattern": "^_", + "caughtErrors": "all", + "caughtErrorsIgnorePattern": "^_", + "destructuredArrayIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "ignoreRestSiblings": true + } + ], + } + }, { + ignores: [ + '**/dist', + './src/main.ts', + '.vscode', + '.idea', + '*.sh', + '**/node_modules', + '*.md', + '*.woff', + '*.woff', + '*.ttf', + 'yarn.lock', + 'package-lock.json', + '/public', + '/docs', + '**/output', + '.husky', + '.local', + '/bin', + 'Dockerfile', + ], + } +]); \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index e65d0ef..73f00cc 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -9,13 +9,27 @@ "preview": "vite preview" }, "dependencies": { - "vue": "^3.2.37" + "@primeuix/themes": "^1.0.3", + "pinia": "^3.0.2", + "primevue": "^4.3.3", + "sass": "^1.87.0", + "vue": "^3.2.37", + "vue-i18n": "^11.1.3", + "vue-router": "^4.5.0" }, "devDependencies": { - "@vitejs/plugin-vue": "^3.0.3", - "typescript": "^4.6.4", - "vite": "^3.0.7", - "vue-tsc": "^1.8.27", - "@babel/types": "^7.18.10" + "@babel/types": "^7.18.10", + "@eslint/js": "^9.25.1", + "@primevue/auto-import-resolver": "^4.3.3", + "@types/node": "^22.14.1", + "@vitejs/plugin-vue": "^5.2.3", + "eslint": "^9.25.1", + "eslint-plugin-vue": "^10.0.0", + "globals": "^16.0.0", + "typescript": "^5.8.3", + "typescript-eslint": "^8.31.0", + "unplugin-vue-components": "^28.5.0", + "vite": "^6.3.2", + "vue-tsc": "^2.2.8" } } diff --git a/frontend/src/App.vue b/frontend/src/App.vue index b63d187..5fc3971 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,5 +1,6 @@ +import HelloWorld from './components/HelloWorld.vue'; +