luxiaotao1123
2024-01-23 a3bf5a80b67a22c02e6f66de65d5b6e7f92d3fde
#zy-asrs-flow
12个文件已添加
6296 ■■■■■ 已修改文件
zy-asrs-flow/.eslintrc.cjs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/.gitignore 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/README.md 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/index.html 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/package-lock.json 6121 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/package.json 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/App.jsx 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/main.jsx 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/NotFound.jsx 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/router/index.jsx 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/styles/index.css 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/vite.config.js 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/.eslintrc.cjs
New file
@@ -0,0 +1,20 @@
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 },
    ],
  },
}
zy-asrs-flow/.gitignore
New file
@@ -0,0 +1,24 @@
# 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?
zy-asrs-flow/README.md
New file
@@ -0,0 +1,8 @@
# 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
zy-asrs-flow/index.html
New file
@@ -0,0 +1,13 @@
<!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>
zy-asrs-flow/package-lock.json
New file
Diff too large
zy-asrs-flow/package.json
New file
@@ -0,0 +1,32 @@
{
  "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"
  }
}
zy-asrs-flow/src/App.jsx
New file
@@ -0,0 +1,11 @@
function App() {
  return (
    <>
      <h1>Hello Flow</h1>
    </>
  )
}
export default App
zy-asrs-flow/src/main.jsx
New file
@@ -0,0 +1,10 @@
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} />
)
zy-asrs-flow/src/pages/NotFound.jsx
New file
@@ -0,0 +1,15 @@
import { Link } from "react-router-dom";
const NotFound = () => {
    return (
        <>
            <div>404</div>
            <div>
                <Link to={'/'}>BACK</Link>
            </div>
        </>
    )
}
export default NotFound
zy-asrs-flow/src/router/index.jsx
New file
@@ -0,0 +1,20 @@
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;
zy-asrs-flow/src/styles/index.css
New file
@@ -0,0 +1,6 @@
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
}
zy-asrs-flow/vite.config.js
New file
@@ -0,0 +1,16 @@
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'
  },
})