feat(web): vite + vue 3 + ts + tailwind + naive ui scaffolding

This commit is contained in:
2026-04-29 07:32:32 +08:00
parent b72de98f15
commit aef7b0b661
11 changed files with 3244 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Agent Coding Workflow</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
+46
View File
@@ -0,0 +1,46 @@
{
"name": "web",
"version": "1.0.0",
"description": "",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview",
"test": "vitest run",
"test:watch": "vitest",
"lint": "eslint . --ext .vue,.ts,.tsx",
"format": "prettier -w .",
"typecheck": "vue-tsc --noEmit"
},
"keywords": [],
"author": "",
"license": "ISC",
"packageManager": "pnpm@10.32.1",
"dependencies": {
"naive-ui": "^2.44.1",
"pinia": "^3.0.4",
"vue": "^3.5.33",
"vue-router": "^5.0.6"
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@tailwindcss/vite": "^4.2.4",
"@types/node": "^25.6.0",
"@vitejs/plugin-vue": "^6.0.6",
"@vue/test-utils": "^2.4.9",
"autoprefixer": "^10.5.0",
"eslint": "^10.2.1",
"eslint-plugin-vue": "^10.9.0",
"happy-dom": "^20.9.0",
"postcss": "^8.5.12",
"prettier": "^3.8.3",
"tailwindcss": "^4.2.4",
"typescript": "^6.0.3",
"typescript-eslint": "^8.59.1",
"vite": "^8.0.10",
"vitest": "^4.1.5",
"vue-tsc": "^3.2.7"
}
}
+3079
View File
File diff suppressed because it is too large Load Diff
+9
View File
@@ -0,0 +1,9 @@
<template>
<div class="min-h-screen flex items-center justify-center">
<p class="text-lg">Agent Coding Workflow scaffolding ready.</p>
</div>
</template>
<script setup lang="ts">
// 占位组件:I5 接入 router 后改写为 RouterView + NConfigProvider。
</script>
+11
View File
@@ -0,0 +1,11 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import './styles/tailwind.css'
import './styles/tokens.css'
const app = createApp(App)
app.use(createPinia())
app.mount('#app')
+3
View File
@@ -0,0 +1,3 @@
@import "tailwindcss";
@variant dark (&:where(.dark, .dark *));
+20
View File
@@ -0,0 +1,20 @@
:root {
--color-bg: #ffffff;
--color-fg: #1a1a1a;
--color-muted: #6b7280;
--color-accent: #2563eb;
}
.dark {
--color-bg: #0f1115;
--color-fg: #e5e7eb;
--color-muted: #9ca3af;
--color-accent: #60a5fa;
}
body {
background: var(--color-bg);
color: var(--color-fg);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
Arial, "Microsoft YaHei", sans-serif;
}
+25
View File
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"jsx": "preserve",
"isolatedModules": true,
"skipLibCheck": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"types": ["vite/client", "node"],
"paths": {
"@/*": ["./src/*"]
},
"baseUrl": ".",
"ignoreDeprecations": "6.0"
},
"include": ["src/**/*", "test/**/*"],
"references": [{ "path": "./tsconfig.node.json" }]
}
+10
View File
@@ -0,0 +1,10 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Bundler",
"allowSyntheticDefaultImports": true,
"types": ["node"]
},
"include": ["vite.config.ts"]
}
+24
View File
@@ -0,0 +1,24 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
import { fileURLToPath, URL } from 'node:url'
export default defineConfig({
plugins: [vue(), tailwindcss()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
server: {
port: 5173,
proxy: {
'/api': 'http://localhost:8080',
'/healthz': 'http://localhost:8080',
},
},
build: {
outDir: 'dist',
emptyOutDir: true,
},
})