fix: 补全前端最小可运行入口 + 修前端配置缺陷

- 新增 index.html / src/main.tsx / src/App.tsx / src/index.css 最小入口
- 补 tsconfig.node.json(tsconfig 引用却缺失,导致 tsc 失败)
- package.json 加 type:module + 缺失的 eslint 依赖
  (@eslint/js / globals / typescript-eslint),eslint.config.js 此前 import 即崩
- 验证:pnpm build / lint / typecheck 三门禁全过,dist 正常产出

至此 backend / agent / frontend 三服务最小骨架均可运行。
This commit is contained in:
baozaotumao
2026-06-01 23:21:57 -07:00
parent df48c36422
commit c09c754983
6 changed files with 67 additions and 2 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>{{ project_name }}</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
+4 -2
View File
@@ -2,6 +2,7 @@
"name": "{{ project_slug }}-frontend", "name": "{{ project_slug }}-frontend",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc && vite build", "build": "tsc && vite build",
@@ -27,8 +28,9 @@
"vite": "^5.4.0", "vite": "^5.4.0",
"typescript": "^5.5.0", "typescript": "^5.5.0",
"eslint": "^9.11.0", "eslint": "^9.11.0",
"@typescript-eslint/eslint-plugin": "^8.7.0", "@eslint/js": "^9.11.0",
"@typescript-eslint/parser": "^8.7.0", "globals": "^15.9.0",
"typescript-eslint": "^8.7.0",
"eslint-plugin-react-hooks": "^5.1.0", "eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.0", "eslint-plugin-react-refresh": "^0.4.0",
"prettier": "^3.3.0", "prettier": "^3.3.0",
+8
View File
@@ -0,0 +1,8 @@
export default function App() {
return (
<main>
<h1>{{ project_name }}</h1>
<p>脚手架已就绪。按 <code>.claude/rules</code> 在 <code>src/</code> 下分层实现业务。</p>
</main>
);
}
+17
View File
@@ -0,0 +1,17 @@
:root {
font-family: system-ui, -apple-system, sans-serif;
line-height: 1.5;
color: #1a1a1a;
}
body {
margin: 0;
padding: 2rem;
}
code {
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
background: #f0f0f0;
padding: 0.1em 0.3em;
border-radius: 3px;
}
+14
View File
@@ -0,0 +1,14 @@
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import "./index.css";
const root = document.getElementById("root");
if (!root) throw new Error("root element not found");
createRoot(root).render(
<StrictMode>
<App />
</StrictMode>,
);
+12
View File
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true,
"strict": true
},
"include": ["vite.config.ts", "vitest.config.ts"]
}