Kaynağa Gözat

:beers: add antd & antd-pro support(dependency conflicts)

Jeremy Zheng 3 ay önce
ebeveyn
işleme
4d50f28c50

+ 6 - 69
dashboard-v6/README.md

@@ -1,73 +1,10 @@
-# React + TypeScript + Vite
+# Dashboard
 
-This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
+## Usage
 
-Currently, two official plugins are available:
+```bash
+npm install
 
-- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
-- [@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
-
-## React Compiler
-
-The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
-
-## Expanding the ESLint configuration
-
-If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
-
-```js
-export default defineConfig([
-  globalIgnores(['dist']),
-  {
-    files: ['**/*.{ts,tsx}'],
-    extends: [
-      // Other configs...
-
-      // Remove tseslint.configs.recommended and replace with this
-      tseslint.configs.recommendedTypeChecked,
-      // Alternatively, use this for stricter rules
-      tseslint.configs.strictTypeChecked,
-      // Optionally, add this for stylistic rules
-      tseslint.configs.stylisticTypeChecked,
-
-      // Other configs...
-    ],
-    languageOptions: {
-      parserOptions: {
-        project: ['./tsconfig.node.json', './tsconfig.app.json'],
-        tsconfigRootDir: import.meta.dirname,
-      },
-      // other options...
-    },
-  },
-])
-```
-
-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:
-
-```js
-// eslint.config.js
-import reactX from 'eslint-plugin-react-x'
-import reactDom from 'eslint-plugin-react-dom'
-
-export default defineConfig([
-  globalIgnores(['dist']),
-  {
-    files: ['**/*.{ts,tsx}'],
-    extends: [
-      // Other configs...
-      // Enable lint rules for React
-      reactX.configs['recommended-typescript'],
-      // Enable lint rules for React DOM
-      reactDom.configs.recommended,
-    ],
-    languageOptions: {
-      parserOptions: {
-        project: ['./tsconfig.node.json', './tsconfig.app.json'],
-        tsconfigRootDir: import.meta.dirname,
-      },
-      // other options...
-    },
-  },
-])
+# http://localhost:4000/pcd-v2/
+npm run dev
 ```

+ 11 - 1
dashboard-v6/package.json

@@ -10,8 +10,18 @@
     "preview": "vite preview"
   },
   "dependencies": {
+    "@graphiql/react": "^0.37.3",
+    "@reduxjs/toolkit": "^2.11.0",
+    "@types/js-cookie": "^3.0.6",
+    "antd": "^6.0.1",
+    "jose": "^6.1.3",
+    "js-cookie": "^3.0.5",
     "react": "^19.2.0",
-    "react-dom": "^19.2.0"
+    "react-dom": "^19.2.0",
+    "react-intl": "^7.1.14",
+    "react-redux": "^9.2.0",
+    "react-router": "^7.10.1",
+    "usehooks-ts": "^3.1.1"
   },
   "devDependencies": {
     "@eslint/js": "^9.39.1",

+ 12 - 0
dashboard-v6/scripts/dashboard.sh

@@ -0,0 +1,12 @@
+#!/bin/bash
+
+set -e
+
+npm install --save \
+    react-router react-intl @reduxjs/toolkit react-redux \
+    @graphiql/react \
+    usehooks-ts jose \
+    js-cookie @types/js-cookie \
+    antd @ant-design/pro-components
+
+exit 0

+ 11 - 3
dashboard-v6/vite.config.ts

@@ -1,7 +1,15 @@
-import { defineConfig } from 'vite'
-import react from '@vitejs/plugin-react'
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
 
 // https://vite.dev/config/
 export default defineConfig({
+  base: "/pcd-v2/",
+  server: {
+    host: "127.0.0.1",
+    port: 4000,
+    proxy: {
+      "/api": "http://127.0.0.1:8080",
+    },
+  },
   plugins: [react()],
-})
+});