|
1 | | -# React + TypeScript + Vite |
| 1 | +🚀 快速开始 |
2 | 2 |
|
3 | | -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. |
4 | | - |
5 | | -Currently, two official plugins are available: |
6 | | - |
7 | | -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh |
8 | | -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh |
9 | | - |
10 | | -## Expanding the ESLint configuration |
11 | | - |
12 | | -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: |
13 | | - |
14 | | -```js |
15 | | -export default tseslint.config([ |
16 | | - globalIgnores(['dist']), |
17 | | - { |
18 | | - files: ['**/*.{ts,tsx}'], |
19 | | - extends: [ |
20 | | - // Other configs... |
21 | | - |
22 | | - // Remove tseslint.configs.recommended and replace with this |
23 | | - ...tseslint.configs.recommendedTypeChecked, |
24 | | - // Alternatively, use this for stricter rules |
25 | | - ...tseslint.configs.strictTypeChecked, |
26 | | - // Optionally, add this for stylistic rules |
27 | | - ...tseslint.configs.stylisticTypeChecked, |
28 | | - |
29 | | - // Other configs... |
30 | | - ], |
31 | | - languageOptions: { |
32 | | - parserOptions: { |
33 | | - project: ['./tsconfig.node.json', './tsconfig.app.json'], |
34 | | - tsconfigRootDir: import.meta.dirname, |
35 | | - }, |
36 | | - // other options... |
37 | | - }, |
38 | | - }, |
39 | | -]) |
| 3 | +``` |
| 4 | +npm install # 安装依赖 |
| 5 | +npm run dev # 启动项目 |
| 6 | +npm run mock # 启动后台Mock服务(可选) |
40 | 7 | ``` |
41 | 8 |
|
42 | | -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: |
43 | | - |
44 | | -```js |
45 | | -// eslint.config.js |
46 | | -import reactX from 'eslint-plugin-react-x' |
47 | | -import reactDom from 'eslint-plugin-react-dom' |
| 9 | +📁 项目结构 |
48 | 10 |
|
49 | | -export default tseslint.config([ |
50 | | - globalIgnores(['dist']), |
51 | | - { |
52 | | - files: ['**/*.{ts,tsx}'], |
53 | | - extends: [ |
54 | | - // Other configs... |
55 | | - // Enable lint rules for React |
56 | | - reactX.configs['recommended-typescript'], |
57 | | - // Enable lint rules for React DOM |
58 | | - reactDom.configs.recommended, |
59 | | - ], |
60 | | - languageOptions: { |
61 | | - parserOptions: { |
62 | | - project: ['./tsconfig.node.json', './tsconfig.app.json'], |
63 | | - tsconfigRootDir: import.meta.dirname, |
64 | | - }, |
65 | | - // other options... |
66 | | - }, |
67 | | - }, |
68 | | -]) |
| 11 | +``` |
| 12 | +frontend/ |
| 13 | +├── public/ # 📖 文档中心 |
| 14 | +│ ├── huawei-logo.webp/ # logo |
| 15 | +│ └── xxx/ # 标注工作台(可分离部署) |
| 16 | +│ |
| 17 | +├── src/ # 🎨 前端应用 |
| 18 | +│ ├── apps/ # 多前端应用 |
| 19 | +│ │ ├── console/ # 数据工作台&运营控制台 |
| 20 | +│ │ │ ├── next.config.js |
| 21 | +│ │ │ ├── package.json |
| 22 | +│ │ │ └── src/ |
| 23 | +│ │ └── annotation-studio/ # 标注工作台(可分离部署) |
| 24 | +│ │ |
| 25 | +│ ├── assets/ # 共享UI组件/SDK |
| 26 | +│ │ ├── xxx/ # 数据工作台&运营控制台 |
| 27 | +│ │ │ ├── next.config.js |
| 28 | +│ │ │ └── src/ |
| 29 | +│ │ │ |
| 30 | +│ │ │ |
| 31 | +│ │ └── xxx/ # 数据工作台&运营控制台 |
| 32 | +│ │ ├── package.json |
| 33 | +│ │ └── src/ |
| 34 | +│ │ |
| 35 | +│ ├── components/ # 构建与环境配置 |
| 36 | +│ │ ├── CardView.tsx # 数据工作台&运营控制台 |
| 37 | +│ │ ├── DetailHeader.tsx # 数据工作台&运营控制台 |
| 38 | +│ │ ├── RadioCard.tsx # 数据工作台&运营控制台 |
| 39 | +│ │ ├── SearchControls # 数据工作台&运营控制台 |
| 40 | +│ │ ├── TagList # 标注工作台(可分离部署) |
| 41 | +│ │ └── TaskPopover # 标注工作台(可分离部署) |
| 42 | +│ │ |
| 43 | +│ ├── hooks/ # 构建与环境配置 |
| 44 | +│ │ ├── console/ # 数据工作台&运营控制台 |
| 45 | +│ │ ├── next.config.js |
| 46 | +│ │ ├── next.config.js |
| 47 | +│ │ ├── next.config.js |
| 48 | +│ │ ├── next.config.js |
| 49 | +│ │ ├── next.config.js |
| 50 | +│ │ └── annotation-studio/ # 标注工作台(可分离部署) |
| 51 | +│ │ |
| 52 | +│ ├── mock/ # 构建与环境配置 |
| 53 | +│ │ ├── console/ # 数据工作台&运营控制台 |
| 54 | +│ │ ├── next.config.js |
| 55 | +│ │ ├── next.config.js |
| 56 | +│ │ ├── next.config.js |
| 57 | +│ │ ├── next.config.js |
| 58 | +│ │ └── annotation-studio/ # 标注工作台(可分离部署) |
| 59 | +│ │ |
| 60 | +│ ├── pages/ # 构建与环境配置 |
| 61 | +│ │ ├── console/ # 数据工作台&运营控制台 |
| 62 | +│ │ │ ├── next.config.js |
| 63 | +│ │ │ ├── package.json |
| 64 | +│ │ │ └── src/ |
| 65 | +│ │ └── annotation-studio/ # 标注工作台(可分离部署) |
| 66 | +│ │ |
| 67 | +│ ├── providers/ # 构建与环境配置 |
| 68 | +│ │ ├── console/ # 数据工作台&运营控制台 |
| 69 | +│ │ │ ├── next.config.js |
| 70 | +│ │ │ ├── package.json |
| 71 | +│ │ │ └── src/ |
| 72 | +│ │ └── annotation-studio/ # 标注工作台(可分离部署) |
| 73 | +│ │ |
| 74 | +│ ├── routes/ # 构建与环境配置 |
| 75 | +│ │ └── next.config.js |
| 76 | +│ │ |
| 77 | +│ ├── types/ # 构建与环境配置 |
| 78 | +│ │ ├── next.config.js |
| 79 | +│ │ ├── next.config.js |
| 80 | +│ │ ├── next.config.js |
| 81 | +│ │ ├── next.config.js |
| 82 | +│ │ └── next.config.js |
| 83 | +│ │ |
| 84 | +│ └── utils/ # 构建与环境配置 |
| 85 | +│ ├── next.config.js |
| 86 | +│ ├── next.config.js |
| 87 | +│ └── next.config.js |
| 88 | +│ |
| 89 | +├── eslint.config.js/ # 🔧 后端服务架构 |
| 90 | +├── index.html/ # 🔧 后端服务架构 |
| 91 | +├── package.json/ # 🔧 后端服务架构 |
| 92 | +├── README.md # 项目说明 |
| 93 | +├── tailwind.config.ts # 更新日志 |
| 94 | +├── vite.config.ts # 开源协议 |
| 95 | +└── pom.xml # Maven根配置 |
69 | 96 | ``` |
0 commit comments