From b21321c80c78bddd1548131aa6e57600f19bdc64 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sun, 17 May 2026 11:21:39 +0800 Subject: [PATCH] auto-sync: 2026-05-17 11:21:39 --- src/frontend/package.json | 26 +++++++++++++++--------- src/frontend/postcss.config.js | 6 ++++++ src/frontend/tailwind.config.js | 36 +++++++++++++++++++++++++++++++++ src/frontend/tsconfig.app.json | 25 +++++++++++++++++++++++ src/frontend/vite.config.ts | 14 ++++++++----- 5 files changed, 92 insertions(+), 15 deletions(-) create mode 100644 src/frontend/postcss.config.js create mode 100644 src/frontend/tailwind.config.js create mode 100644 src/frontend/tsconfig.app.json diff --git a/src/frontend/package.json b/src/frontend/package.json index aaf612e..fbb8609 100644 --- a/src/frontend/package.json +++ b/src/frontend/package.json @@ -1,22 +1,28 @@ { - "name": "moziplus-v2-dashboard", - "version": "2.6.0", + "name": "moziplus-dashboard", "private": true, + "version": "1.0.0", "type": "module", "scripts": { "dev": "vite", - "build": "tsc && vite build", + "build": "tsc -b && vite build", "preview": "vite preview" }, "dependencies": { - "react": "^18.3.0", - "react-dom": "^18.3.0" + "react": "^18.3.1", + "react-dom": "^18.3.1", + "zustand": "^4.5.5", + "lucide-react": "^0.460.0", + "clsx": "^2.1.1" }, "devDependencies": { - "@types/react": "^18.3.0", - "@types/react-dom": "^18.3.0", - "@vitejs/plugin-react": "^4.3.0", - "typescript": "^5.5.0", - "vite": "^5.4.0" + "@types/react": "^18.3.12", + "@types/react-dom": "^18.3.1", + "@vitejs/plugin-react": "^4.3.4", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.47", + "tailwindcss": "^3.4.15", + "typescript": "^5.6.3", + "vite": "^6.0.1" } } diff --git a/src/frontend/postcss.config.js b/src/frontend/postcss.config.js new file mode 100644 index 0000000..2e7af2b --- /dev/null +++ b/src/frontend/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/src/frontend/tailwind.config.js b/src/frontend/tailwind.config.js new file mode 100644 index 0000000..aa6f7ed --- /dev/null +++ b/src/frontend/tailwind.config.js @@ -0,0 +1,36 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'], + theme: { + extend: { + colors: { + // 三省六部主题色 + imperial: { + 50: '#fef7ed', + 100: '#fdecd4', + 200: '#fad5a8', + 300: '#f7b671', + 400: '#f38d38', + 500: '#f07012', + 600: '#e15808', + 700: '#bb4009', + 800: '#95330f', + 900: '#792c10', + }, + dynasty: { + 50: '#fdf4f3', + 100: '#fce8e4', + 200: '#fad4ce', + 300: '#f5b5ab', + 400: '#ee8a7a', + 500: '#e25f4d', + 600: '#cf4430', + 700: '#ae3624', + 800: '#903022', + 900: '#782d23', + }, + }, + }, + }, + plugins: [], +} diff --git a/src/frontend/tsconfig.app.json b/src/frontend/tsconfig.app.json new file mode 100644 index 0000000..7f42e5f --- /dev/null +++ b/src/frontend/tsconfig.app.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023", "DOM"], + "module": "esnext", + "types": ["vite/client"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts index 94c5801..522ae77 100644 --- a/src/frontend/vite.config.ts +++ b/src/frontend/vite.config.ts @@ -1,15 +1,19 @@ -import { defineConfig } from 'vite'; -import react from '@vitejs/plugin-react'; +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], server: { - port: 8083, + port: 5173, proxy: { - '/api': 'http://localhost:8080', + '/api': { + target: 'http://localhost:8083', + changeOrigin: true, + }, }, }, build: { outDir: 'dist', + emptyOutDir: true, }, -}); +})