New file |
| | |
| | | module.exports = { |
| | | root: true, |
| | | env: { browser: true, es2020: true }, |
| | | extends: [ |
| | | 'eslint:recommended', |
| | | 'plugin:react/recommended', |
| | | 'plugin:react/jsx-runtime', |
| | | 'plugin:react-hooks/recommended', |
| | | ], |
| | | ignorePatterns: ['dist', '.eslintrc.cjs'], |
| | | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, |
| | | settings: { react: { version: '18.2' } }, |
| | | plugins: ['react-refresh'], |
| | | rules: { |
| | | 'react-refresh/only-export-components': [ |
| | | 'warn', |
| | | { allowConstantExport: true }, |
| | | ], |
| | | }, |
| | | } |
New file |
| | |
| | | # Logs |
| | | logs |
| | | *.log |
| | | npm-debug.log* |
| | | yarn-debug.log* |
| | | yarn-error.log* |
| | | pnpm-debug.log* |
| | | lerna-debug.log* |
| | | |
| | | node_modules |
| | | dist |
| | | dist-ssr |
| | | *.local |
| | | |
| | | # Editor directories and files |
| | | .vscode/* |
| | | !.vscode/extensions.json |
| | | .idea |
| | | .DS_Store |
| | | *.suo |
| | | *.ntvs* |
| | | *.njsproj |
| | | *.sln |
| | | *.sw? |
New file |
| | |
| | | # React + Vite |
| | | |
| | | This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. |
| | | |
| | | Currently, two official plugins are available: |
| | | |
| | | - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh |
| | | - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
New file |
| | |
| | | <!doctype html> |
| | | <html lang="en"> |
| | | <head> |
| | | <meta charset="UTF-8" /> |
| | | <link rel="icon" type="image/svg+xml" href="/vite.svg" /> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| | | <title>asrs - flow</title> |
| | | </head> |
| | | <body> |
| | | <div id="root"></div> |
| | | <script type="module" src="/src/main.jsx"></script> |
| | | </body> |
| | | </html> |
New file |
| | |
| | | { |
| | | "name": "zy-asrs-flow", |
| | | "private": true, |
| | | "version": "0.0.0", |
| | | "type": "module", |
| | | "scripts": { |
| | | "dev": "vite", |
| | | "build": "vite build", |
| | | "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", |
| | | "preview": "vite preview" |
| | | }, |
| | | "dependencies": { |
| | | "@antv/g6": "^4.8.24", |
| | | "antd": "^5.13.2", |
| | | "axios": "^1.6.5", |
| | | "pixi.js": "^7.3.3", |
| | | "react": "^18.2.0", |
| | | "react-dom": "^18.2.0", |
| | | "react-router-dom": "^6.15.0", |
| | | "valtio": "^1.13.0" |
| | | }, |
| | | "devDependencies": { |
| | | "@types/react": "^18.2.43", |
| | | "@types/react-dom": "^18.2.17", |
| | | "@vitejs/plugin-react": "^4.2.1", |
| | | "eslint": "^8.55.0", |
| | | "eslint-plugin-react": "^7.33.2", |
| | | "eslint-plugin-react-hooks": "^4.6.0", |
| | | "eslint-plugin-react-refresh": "^0.4.5", |
| | | "vite": "^5.0.8" |
| | | } |
| | | } |
New file |
| | |
| | | |
| | | function App() { |
| | | |
| | | return ( |
| | | <> |
| | | <h1>Hello Flow</h1> |
| | | </> |
| | | ) |
| | | } |
| | | |
| | | export default App |
New file |
| | |
| | | import React from 'react' |
| | | import ReactDOM from 'react-dom/client' |
| | | import { RouterProvider } from 'react-router-dom' |
| | | import router from '@/router' |
| | | |
| | | import './styles/index.css' |
| | | |
| | | ReactDOM.createRoot(document.getElementById('root')).render( |
| | | <RouterProvider router={router} /> |
| | | ) |
New file |
| | |
| | | import { Link } from "react-router-dom"; |
| | | |
| | | const NotFound = () => { |
| | | return ( |
| | | <> |
| | | <div>404</div> |
| | | <div> |
| | | <Link to={'/'}>BACK</Link> |
| | | </div> |
| | | </> |
| | | |
| | | ) |
| | | } |
| | | |
| | | export default NotFound |
New file |
| | |
| | | import { createBrowserRouter, createHashRouter } from 'react-router-dom' |
| | | |
| | | import App from '@/App' |
| | | import NotFound from '@/pages/NotFound' |
| | | |
| | | // createBrowserRouter -> history |
| | | // createHashRouter -> hash (#) |
| | | |
| | | const router = createBrowserRouter([ |
| | | { |
| | | path: '/', |
| | | element: <App />, |
| | | }, |
| | | { |
| | | path: '*', |
| | | element: <NotFound /> |
| | | } |
| | | ]) |
| | | |
| | | export default router; |
New file |
| | |
| | | * { |
| | | margin: 0; |
| | | padding: 0; |
| | | box-sizing: border-box; |
| | | text-decoration: none; |
| | | } |
New file |
| | |
| | | import { defineConfig } from 'vite' |
| | | import react from '@vitejs/plugin-react' |
| | | import { resolve } from 'path' |
| | | |
| | | // https://vitejs.dev/config/ |
| | | export default defineConfig({ |
| | | plugins: [react()], |
| | | resolve: { |
| | | alias: { |
| | | '@/': resolve('src') + '/' |
| | | } |
| | | }, |
| | | server: { |
| | | host: '0.0.0.0' |
| | | }, |
| | | }) |