Browse Source

chore: update packages (#807)

Signed-off-by: ryjiang <jiangruiyi@gmail.com>
ryjiang 3 months ago
parent
commit
691d73ae8e
4 changed files with 319 additions and 451 deletions
  1. 15 25
      client/package.json
  2. 6 21
      client/src/i18n/index.ts
  3. 2 2
      client/vite.config.mts
  4. 296 403
      client/yarn.lock

+ 15 - 25
client/package.json

@@ -4,7 +4,7 @@
   "description": "Attu UI Client",
   "license": "Apache-2.0",
   "bugs": "https://github.com/zilliztech/attu/issues",
-  "private": true,
+  "private": false,
   "dependencies": {
     "@codemirror/commands": "^6.6.0",
     "@codemirror/lang-javascript": "^6.2.2",
@@ -18,17 +18,17 @@
     "@emotion/react": "^11.13.0",
     "@emotion/styled": "^11.13.0",
     "@json2csv/plainjs": "^7.0.6",
-    "@mui/icons-material": "^5.16.14",
-    "@mui/material": "^5.16.14",
-    "@mui/styles": "^5.16.12",
-    "@mui/x-tree-view": "^7.12.1",
+    "@mui/icons-material": "^5.17.1",
+    "@mui/material": "^5.17.1",
+    "@mui/styles": "^5.17.1",
+    "@mui/x-tree-view": "^7.28.0",
     "axios": "^1.8.2",
     "codemirror": "^6.0.1",
     "d3": "^7.9.0",
     "dayjs": "^1.11.13",
     "file-saver": "^2.0.5",
-    "i18next": "^20.3.1",
-    "i18next-browser-languagedetector": "^7.2.0",
+    "i18next": "^24.2.3",
+    "i18next-browser-languagedetector": "^8.0.4",
     "papaparse": "^5.4.1",
     "react": "^18.2.0",
     "react-dom": "^18.2.0",
@@ -36,40 +36,30 @@
     "react-i18next": "^13.5.0",
     "react-router-dom": "^6.23.1",
     "react-syntax-highlighter": "^15.6.1",
+    "remove": "^0.1.5",
     "socket.io-client": "^4.8.1",
     "web-vitals": "^1.0.1"
   },
   "devDependencies": {
-    "@testing-library/jest-dom": "^5.17.0",
-    "@testing-library/react": "12.1.2",
-    "@testing-library/react-hooks": "^7.0.1",
-    "@testing-library/user-event": "^12.1.10",
-    "@types/d3": "^7.4.0",
+    "@types/d3": "^7.4.3",
     "@types/file-saver": "^2.0.5",
-    "@types/loadable__component": "^5.13.4",
     "@types/node": "^12.0.0",
-    "@types/papaparse": "^5.3.14",
+    "@types/papaparse": "^5.3.15",
     "@types/react": "^18.2.15",
     "@types/react-dom": "^18.2.7",
-    "@types/react-highlight-words": "^0.16.4",
+    "@types/react-highlight-words": "^0.20.0",
     "@types/react-router-dom": "^5.3.3",
     "@types/react-syntax-highlighter": "^15.5.13",
-    "@types/webpack-env": "^1.18.1",
-    "@vitejs/plugin-react": "^4.0.3",
-    "@vitejs/plugin-react-refresh": "^1.3.6",
-    "jsdom": "^20.0.2",
-    "prettier": "2.3.2",
-    "typescript": "^4.1.2",
-    "vite": "^6.2.0",
+    "@vitejs/plugin-react": "^4.3.4",
+    "prettier": "^3.5.3",
+    "typescript": "^5.8.2",
+    "vite": "^6.2.2",
     "vite-plugin-svgr": "^4.2.0"
   },
   "homepage": "./",
   "scripts": {
     "start": "vite",
     "build": "vite build",
-    "test": "vitest",
-    "test:coverage": "vitest --coverage",
-    "test:watch": "vitest --watchAll",
     "format": "prettier --write '**/*.{ts,js,tsx,jsx,css}'"
   },
   "eslintConfig": {

+ 6 - 21
client/src/i18n/index.ts

@@ -84,44 +84,29 @@ export const resources = {
 
 // the translations
 // (tip move them in a JSON file and import them)
-
 i18n
-  // detect user language
-  // learn more: https://github.com/i18next/i18next-browser-languageDetector
   .use(LanguageDetector)
-  .use(initReactI18next) // passes i18n down to react-i18next
+  .use(initReactI18next)
   .init({
     fallbackLng: 'en',
     resources,
-    keySeparator: false, // we do not use keys in form messages.welcome
+    keySeparator: false,
     returnObjects: true,
     interpolation: {
-      escapeValue: false, // react already safes from xss
+      escapeValue: false,
     },
-
     detection: {
-      // order and from where user language should be detected
       order: ['localStorage', 'navigator', 'htmlTag', 'path', 'subdomain'],
-
-      // keys or params to lookup language from
       lookupLocalStorage: 'attu.ui.lang',
       lookupFromPathIndex: 0,
       lookupFromSubdomainIndex: 0,
-
-      // cache user language on
       caches: ['localStorage', 'cookie'],
-      excludeCacheFor: ['cimode'], // languages to not persist (cookie, localStorage)
-
-      // optional expire and domain for set cookie
+      excludeCacheFor: ['cimode'],
       cookieMinutes: 10,
-      cookieDomain: 'myDomain',
-
-      // optional htmlTag with lang attribute, the default is:
+      cookieDomain: '',
       htmlTag: document.documentElement,
-
-      // only detect languages that are in the whitelist
-      checkWhitelist: true,
     },
+    supportedLngs: ['en', 'zh-CN'], // Add your supported languages here
   });
 
 export default i18n;

+ 2 - 2
client/vite.config.mts

@@ -1,6 +1,6 @@
 import { defineConfig } from 'vite';
 import * as path from 'path';
-import reactRefresh from '@vitejs/plugin-react';
+import react from '@vitejs/plugin-react';
 import svgr from 'vite-plugin-svgr';
 
 // https://vitejs.dev/config/
@@ -25,7 +25,7 @@ export default defineConfig({
     },
   },
   plugins: [
-    reactRefresh(),
+    react(),
     svgr({
       // A minimatch pattern, or array of patterns, which specifies the files in the build the plugin should include.
       include: '**/*.svg?react',

File diff suppressed because it is too large
+ 296 - 403
client/yarn.lock


Some files were not shown because too many files changed in this diff