fix(web): restructure client as standalone Vite project
- client/ now has its own package.json (independent Vite project) - Tailwind + PostCSS config inlined into vite.config.ts - dev:client uses `cd client && npm run dev` (CWD = Vite root) - Root package.json only has server deps - Fix tsconfig deprecation (remove baseUrl) - Add `npm run setup` for one-command install Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2843
web/client/package-lock.json
generated
Normal file
2843
web/client/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
web/client/package.json
Normal file
31
web/client/package.json
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"name": "meitu-agent-client",
|
||||||
|
"version": "0.1.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite",
|
||||||
|
"build": "vite build"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"react": "^18.3.0",
|
||||||
|
"react-dom": "^18.3.0",
|
||||||
|
"zustand": "^5.0.0",
|
||||||
|
"lucide-react": "^0.460.0",
|
||||||
|
"clsx": "^2.1.0",
|
||||||
|
"tailwind-merge": "^2.6.0",
|
||||||
|
"class-variance-authority": "^0.7.1",
|
||||||
|
"markdown-it": "^14.1.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/react": "^18.3.0",
|
||||||
|
"@types/react-dom": "^18.3.0",
|
||||||
|
"@types/markdown-it": "^14.1.0",
|
||||||
|
"@vitejs/plugin-react": "^4.3.0",
|
||||||
|
"vite": "^5.4.0",
|
||||||
|
"tailwindcss": "^3.4.0",
|
||||||
|
"postcss": "^8.4.0",
|
||||||
|
"autoprefixer": "^10.4.0",
|
||||||
|
"typescript": "^5.6.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
export default {
|
|
||||||
plugins: {
|
|
||||||
tailwindcss: {},
|
|
||||||
autoprefixer: {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
import type { Config } from 'tailwindcss';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
content: ['./src/**/*.{ts,tsx}'],
|
|
||||||
darkMode: 'class',
|
|
||||||
theme: {
|
|
||||||
extend: {
|
|
||||||
colors: {
|
|
||||||
border: 'hsl(240 3.7% 15.9%)',
|
|
||||||
input: 'hsl(240 3.7% 15.9%)',
|
|
||||||
ring: 'hsl(240 4.9% 83.9%)',
|
|
||||||
background: 'hsl(240 10% 3.9%)',
|
|
||||||
foreground: 'hsl(0 0% 98%)',
|
|
||||||
primary: {
|
|
||||||
DEFAULT: 'hsl(0 0% 98%)',
|
|
||||||
foreground: 'hsl(240 5.9% 10%)',
|
|
||||||
},
|
|
||||||
secondary: {
|
|
||||||
DEFAULT: 'hsl(240 3.7% 15.9%)',
|
|
||||||
foreground: 'hsl(0 0% 98%)',
|
|
||||||
},
|
|
||||||
muted: {
|
|
||||||
DEFAULT: 'hsl(240 3.7% 15.9%)',
|
|
||||||
foreground: 'hsl(240 5% 64.9%)',
|
|
||||||
},
|
|
||||||
accent: {
|
|
||||||
DEFAULT: 'hsl(240 3.7% 15.9%)',
|
|
||||||
foreground: 'hsl(0 0% 98%)',
|
|
||||||
},
|
|
||||||
destructive: {
|
|
||||||
DEFAULT: 'hsl(0 62.8% 30.6%)',
|
|
||||||
foreground: 'hsl(0 0% 98%)',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
borderRadius: {
|
|
||||||
lg: '0.5rem',
|
|
||||||
md: 'calc(0.5rem - 2px)',
|
|
||||||
sm: 'calc(0.5rem - 4px)',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: [],
|
|
||||||
} satisfies Config;
|
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"outDir": "./dist",
|
"outDir": "./dist",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,64 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import tailwindcss from 'tailwindcss';
|
||||||
|
import autoprefixer from 'autoprefixer';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
root: path.resolve(__dirname),
|
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, 'src'),
|
'@': path.resolve(__dirname, 'src'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
css: {
|
||||||
|
postcss: {
|
||||||
|
plugins: [
|
||||||
|
tailwindcss({
|
||||||
|
content: ['./index.html', './src/**/*.{ts,tsx}'],
|
||||||
|
darkMode: 'class',
|
||||||
|
theme: {
|
||||||
|
extend: {
|
||||||
|
colors: {
|
||||||
|
border: 'hsl(240 3.7% 15.9%)',
|
||||||
|
input: 'hsl(240 3.7% 15.9%)',
|
||||||
|
ring: 'hsl(240 4.9% 83.9%)',
|
||||||
|
background: 'hsl(240 10% 3.9%)',
|
||||||
|
foreground: 'hsl(0 0% 98%)',
|
||||||
|
primary: {
|
||||||
|
DEFAULT: 'hsl(0 0% 98%)',
|
||||||
|
foreground: 'hsl(240 5.9% 10%)',
|
||||||
|
},
|
||||||
|
secondary: {
|
||||||
|
DEFAULT: 'hsl(240 3.7% 15.9%)',
|
||||||
|
foreground: 'hsl(0 0% 98%)',
|
||||||
|
},
|
||||||
|
muted: {
|
||||||
|
DEFAULT: 'hsl(240 3.7% 15.9%)',
|
||||||
|
foreground: 'hsl(240 5% 64.9%)',
|
||||||
|
},
|
||||||
|
accent: {
|
||||||
|
DEFAULT: 'hsl(240 3.7% 15.9%)',
|
||||||
|
foreground: 'hsl(0 0% 98%)',
|
||||||
|
},
|
||||||
|
destructive: {
|
||||||
|
DEFAULT: 'hsl(0 62.8% 30.6%)',
|
||||||
|
foreground: 'hsl(0 0% 98%)',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
borderRadius: {
|
||||||
|
lg: '0.5rem',
|
||||||
|
md: 'calc(0.5rem - 2px)',
|
||||||
|
sm: 'calc(0.5rem - 4px)',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: [],
|
||||||
|
}),
|
||||||
|
autoprefixer(),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 5173,
|
port: 5173,
|
||||||
proxy: {
|
proxy: {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
2737
web/package-lock.json
generated
2737
web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,44 +4,27 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "concurrently \"npm run dev:server\" \"npm run dev:client\"",
|
"dev": "concurrently \"npm run dev:server\" \"npm run dev:client\"",
|
||||||
"predev:server": "npx kill-port 3007",
|
"dev:server": "npx kill-port 3007 && tsx watch server/index.ts",
|
||||||
"dev:server": "tsx watch server/index.ts",
|
"dev:client": "cd client && npm run dev",
|
||||||
"dev:client": "vite --config client/vite.config.ts",
|
"build": "cd client && npm run build",
|
||||||
"build": "vite build --config client/vite.config.ts",
|
"db:init": "tsx server/db/schema.ts",
|
||||||
"db:init": "tsx server/db/schema.ts"
|
"setup": "npm install && cd client && npm install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@anthropic-ai/sdk": "^0.95.0",
|
"@anthropic-ai/sdk": "^0.95.0",
|
||||||
"better-sqlite3": "^11.6.0",
|
"better-sqlite3": "^11.6.0",
|
||||||
"class-variance-authority": "^0.7.1",
|
|
||||||
"clsx": "^2.1.0",
|
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"express": "^4.21.0",
|
"express": "^4.21.0",
|
||||||
"lucide-react": "^0.460.0",
|
"ws": "^8.18.0"
|
||||||
"markdown-it": "^14.1.1",
|
|
||||||
"react": "^18.3.0",
|
|
||||||
"react-dom": "^18.3.0",
|
|
||||||
"tailwind-merge": "^2.6.0",
|
|
||||||
"ws": "^8.18.0",
|
|
||||||
"zod": "^3.23.0",
|
|
||||||
"zustand": "^5.0.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/better-sqlite3": "^7.6.0",
|
"@types/better-sqlite3": "^7.6.0",
|
||||||
"@types/cors": "^2.8.0",
|
"@types/cors": "^2.8.0",
|
||||||
"@types/express": "^5.0.0",
|
"@types/express": "^5.0.0",
|
||||||
"@types/markdown-it": "^14.1.2",
|
|
||||||
"@types/react": "^18.3.0",
|
|
||||||
"@types/react-dom": "^18.3.0",
|
|
||||||
"@types/ws": "^8.5.0",
|
"@types/ws": "^8.5.0",
|
||||||
"@vitejs/plugin-react": "^4.3.0",
|
|
||||||
"autoprefixer": "^10.4.0",
|
|
||||||
"concurrently": "^9.1.0",
|
"concurrently": "^9.1.0",
|
||||||
"kill-port": "^2.0.1",
|
"kill-port": "^2.0.1",
|
||||||
"postcss": "^8.4.0",
|
|
||||||
"tailwindcss": "^3.4.0",
|
|
||||||
"tsx": "^4.19.0",
|
"tsx": "^4.19.0",
|
||||||
"typescript": "^5.6.0",
|
"typescript": "^5.6.0"
|
||||||
"vite": "^5.4.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user