feat: add CodeMirror-based code editor component and routing setup

- Implemented CodeEditor component using CodeMirror for JavaScript editing.
- Added global styles in index.css for consistent UI.
- Set up routing with TanStack Router, including root and nested routes.
- Created About, C, and Editor routes with respective components.
- Integrated CodeEditor into the Editor route for code editing functionality.
- Configured TypeScript settings in tsconfig.json for strict type checking.
- Established Vite configuration for React and TanStack Router integration.
This commit is contained in:
2026-01-28 02:22:44 +08:00
commit 4cbec4ed1d
17 changed files with 2313 additions and 0 deletions

26
package.json Normal file
View File

@@ -0,0 +1,26 @@
{
"name": "tanstack-router-app",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview"
},
"dependencies": {
"@codemirror/lang-javascript": "^6.2.4",
"@tanstack/react-router": "^1.157.16",
"@uiw/react-codemirror": "^4.25.4",
"react": "^19.2.4",
"react-dom": "^19.2.4"
},
"devDependencies": {
"@tanstack/react-router-devtools": "^1.157.16",
"@tanstack/router-plugin": "^1.157.16",
"@types/react": "^19.2.10",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^5.1.2",
"typescript": "^5.9.3",
"vite": "^7.3.1"
}
}