Forráskód Böngészése

chore(deps): bump i18next, react-i18next and @xyflow/react (#2262)

i18next 27 and react-i18next 18: the hand-typed StepT alias becomes TFunction, which fixes the agents table and the fleet page, and the topology links table branches on possibly-undefined options. @xyflow/react 13: colorMode gives way to forceColorMode in the rack page.

tsc -b and vite build green, eslint 0 errors, and an A/B in demo mode against the pre-bump build shows identical page text and node counts with no page errors.

Supersedes #2257, #2258 and #2259.
Nacho 2 napja
szülő
commit
91ede45d61

+ 79 - 60
app/package-lock.json

@@ -34,14 +34,14 @@
         "@radix-ui/react-toggle": "^1.1.19",
         "@radix-ui/react-toggle-group": "^1.1.20",
         "@radix-ui/react-tooltip": "^1.3.0",
-        "@xyflow/react": "^12.12.0",
+        "@xyflow/react": "^13.0.3",
         "class-variance-authority": "^0.7.1",
         "clsx": "^2.1.1",
         "cmdk": "^1.1.1",
         "date-fns": "^4.1.0",
         "embla-carousel-react": "^8.6.0",
         "framer-motion": "^14.14.0",
-        "i18next": "^26.4.2",
+        "i18next": "^27.2.10",
         "i18next-browser-languagedetector": "^8.3.1",
         "i18next-http-backend": "^4.1.2",
         "input-otp": "^1.5.0",
@@ -50,7 +50,7 @@
         "react-day-picker": "^10.0.2",
         "react-dom": "^19.3.0",
         "react-hook-form": "^7.92.0",
-        "react-i18next": "^17.0.16",
+        "react-i18next": "^18.0.3",
         "react-is": "^19.3.0",
         "react-resizable-panels": "^4.27.0",
         "react-router": "^8.5.3",
@@ -4637,9 +4637,9 @@
       }
     },
     "node_modules/@types/d3-selection": {
-      "version": "3.0.12",
-      "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.12.tgz",
-      "integrity": "sha512-Qe/KWYhEiIIxGs7HrAAjMfShxKldx19SJtr5zu53f3afPsdZNz7HHtdTLXo/kqeiWNXVycI24kSnfzBYkTzpgw==",
+      "version": "3.0.13",
+      "resolved": "https://registry.npmjs.org/@types/d3-selection/-/d3-selection-3.0.13.tgz",
+      "integrity": "sha512-oXz0iHVpWOhurycj7P8KehdevbbwQfdOyYPd6u5TUcrk6ofXeQfY0e4Ow+0/35arZ24gs6ubpjJX0CuZHV5fdw==",
       "license": "MIT"
     },
     "node_modules/@types/d3-shape": {
@@ -5518,20 +5518,24 @@
       }
     },
     "node_modules/@xyflow/react": {
-      "version": "12.12.0",
-      "resolved": "https://registry.npmjs.org/@xyflow/react/-/react-12.12.0.tgz",
-      "integrity": "sha512-74oXI0Rgm1Eu33cHQAd74J6oVgCH9mbFyTVQbsGgp2kmWwh0HdtBr2VP04z8mbPD+M/xO69nqG5dDEt7/EN2rQ==",
+      "version": "13.0.3",
+      "resolved": "https://registry.npmjs.org/@xyflow/react/-/react-13.0.3.tgz",
+      "integrity": "sha512-deKfJUYe1aAMd2j6g/LL+5YRbqIeebOXNfwHhdu6qk4L+h7XRY9UcBgqVSYT8WyXSX+3k6ZGr/hnfx7hLfgUtA==",
       "license": "MIT",
       "dependencies": {
-        "@xyflow/system": "0.0.83",
-        "classcat": "^5.0.3",
-        "zustand": "^4.4.0"
+        "@xyflow/system": "1.0.1",
+        "classcat": "^5.0.5",
+        "react-compiler-runtime": "^1.0.0",
+        "zustand": "^5.0.15"
+      },
+      "engines": {
+        "node": ">=20"
       },
       "peerDependencies": {
-        "@types/react": ">=17",
-        "@types/react-dom": ">=17",
-        "react": ">=17",
-        "react-dom": ">=17"
+        "@types/react": ">=18",
+        "@types/react-dom": ">=18",
+        "react": ">=18",
+        "react-dom": ">=18"
       },
       "peerDependenciesMeta": {
         "@types/react": {
@@ -5543,20 +5547,23 @@
       }
     },
     "node_modules/@xyflow/system": {
-      "version": "0.0.83",
-      "resolved": "https://registry.npmjs.org/@xyflow/system/-/system-0.0.83.tgz",
-      "integrity": "sha512-a//eDjez3WZF47aaPTfVUDD0OINOq+WVwBZCRTqG+m0a5euX8EwlJ4jMY1Wxz0Ocj4xOeekJ70V22Pq0ll8RJw==",
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/@xyflow/system/-/system-1.0.1.tgz",
+      "integrity": "sha512-0vMyv9EbnV9lNe15USaIbBxJVuLF2awbzZNT+foIOd59Mpc2rw04oaozoms1TaSetTa376aHl7mJ/YNKqIoqJA==",
       "license": "MIT",
       "dependencies": {
         "@types/d3-drag": "^3.0.7",
         "@types/d3-interpolate": "^3.0.4",
-        "@types/d3-selection": "^3.0.10",
-        "@types/d3-transition": "^3.0.8",
+        "@types/d3-selection": "^3.0.11",
+        "@types/d3-transition": "^3.0.9",
         "@types/d3-zoom": "^3.0.8",
         "d3-drag": "^3.0.0",
         "d3-interpolate": "^3.0.1",
         "d3-selection": "^3.0.0",
         "d3-zoom": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=20"
       }
     },
     "node_modules/acorn": {
@@ -6078,18 +6085,18 @@
       }
     },
     "node_modules/d3-dispatch": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz",
-      "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==",
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.2.tgz",
+      "integrity": "sha512-sAzH4Y4nsLo8eSqw5jKiZt+LU2wZmL/qS+OkxQGjhwazB/D7TY34R/QK1eshfGr7cZEKymKZ/Haem7m+lu98Sg==",
       "license": "ISC",
       "engines": {
         "node": ">=12"
       }
     },
     "node_modules/d3-drag": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.0.tgz",
-      "integrity": "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-drag/-/d3-drag-3.0.1.tgz",
+      "integrity": "sha512-OWeoayCq8J69hUIjvL+Mb6Q6Oaj/fyHV5XaXByEUAG+JUjIfTGDnk3qGpcXrD3VmQ3BSV96fcbM6fqq7C0tbPA==",
       "license": "ISC",
       "dependencies": {
         "d3-dispatch": "1 - 3",
@@ -6155,9 +6162,9 @@
       }
     },
     "node_modules/d3-selection": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
-      "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.1.tgz",
+      "integrity": "sha512-ODSf35vqCrlCfp7hrm0eZjvOosSXSYLjqvIlhMBV9q9VOx7EBJG6pc+uXBswEZNJgCGJ+qnKYcWutbZDIxe/Xg==",
       "license": "ISC",
       "engines": {
         "node": ">=12"
@@ -6209,9 +6216,9 @@
       }
     },
     "node_modules/d3-transition": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.1.tgz",
-      "integrity": "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==",
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-3.0.2.tgz",
+      "integrity": "sha512-RcjCsdFgyFoDB+QXLC5m60ZkTN0k9zH+ovoLlTdJnDS1AbfbcuowiM4pCKSTOclNibS4f4J4cbv2m7O7y8NTOQ==",
       "license": "ISC",
       "dependencies": {
         "d3-color": "1 - 3",
@@ -6228,9 +6235,9 @@
       }
     },
     "node_modules/d3-zoom": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.0.tgz",
-      "integrity": "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw==",
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/d3-zoom/-/d3-zoom-3.0.1.tgz",
+      "integrity": "sha512-kfjD3BDQu/FOatpZ6JdMSyIoDwTxIpI29ySTI2J5ZlDaH1WbuJGQJ2Q9oJkWTEZEW98j6idezoomSD3Cn2zwiw==",
       "license": "ISC",
       "dependencies": {
         "d3-dispatch": "1 - 3",
@@ -7481,9 +7488,9 @@
       }
     },
     "node_modules/i18next": {
-      "version": "26.5.11",
-      "resolved": "https://registry.npmjs.org/i18next/-/i18next-26.5.11.tgz",
-      "integrity": "sha512-Wc0klBPKxqZ2tL2qdAnF8xvvnWgr1IMGSY2ikTiAvaFVbz7xiFARtkoU4RidBDw1SyziGROp0qxu6qnJ7l2Wug==",
+      "version": "27.2.10",
+      "resolved": "https://registry.npmjs.org/i18next/-/i18next-27.2.10.tgz",
+      "integrity": "sha512-v2hQPOZ4yvfhK5CNyXevVjneTX85rDxgTKSV96tftmp89yrF1MEFIDV0i6jYKEnzR3lnWDe62HktDFy6624/UQ==",
       "funding": [
         {
           "type": "individual",
@@ -7499,6 +7506,9 @@
         }
       ],
       "license": "MIT",
+      "engines": {
+        "node": ">=22"
+      },
       "peerDependencies": {
         "typescript": "^5 || ^6 || ^7"
       },
@@ -8943,6 +8953,15 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/react-compiler-runtime": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/react-compiler-runtime/-/react-compiler-runtime-1.0.0.tgz",
+      "integrity": "sha512-rRfjYv66HlG8896yPUDONgKzG5BxZD1nV9U6rkm+7VCuvQc903C4MjcoZR4zPw53IKSOX9wMQVpA1IAbRtzQ7w==",
+      "license": "MIT",
+      "peerDependencies": {
+        "react": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^0.0.0-experimental"
+      }
+    },
     "node_modules/react-day-picker": {
       "version": "10.0.2",
       "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-10.0.2.tgz",
@@ -9004,25 +9023,24 @@
       }
     },
     "node_modules/react-i18next": {
-      "version": "17.1.9",
-      "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-17.1.9.tgz",
-      "integrity": "sha512-OgYqIH13XHPlWTaaI795Dz+k2AdKnXcOxNQVnf750T8Ij0TYWp1nYvXRpoJBulPqlyk2OAbn1PM4tFKiIj/byA==",
+      "version": "18.0.3",
+      "resolved": "https://registry.npmjs.org/react-i18next/-/react-i18next-18.0.3.tgz",
+      "integrity": "sha512-S84rtVuaKuiRtoCOspbGEaDlFjka+KvK/A5YCOr4LQ41XF3iJOrJ5rqQTD/jJHFVUf6X1i4ZMN5PGGgpz8NN6g==",
       "license": "MIT",
       "dependencies": {
-        "@babel/runtime": "^7.29.7",
-        "html-parse-stringify": "^4.0.1",
-        "use-sync-external-store": "^1.6.0"
+        "html-parse-stringify": "^4.0.1"
+      },
+      "engines": {
+        "node": ">=22"
       },
       "peerDependencies": {
-        "i18next": ">= 26.2.0",
-        "react": ">= 16.8.0",
+        "@types/react": "*",
+        "i18next": ">= 27.0.1",
+        "react": ">= 18.0.0",
         "typescript": "^5 || ^6 || ^7"
       },
       "peerDependenciesMeta": {
-        "react-dom": {
-          "optional": true
-        },
-        "react-native": {
+        "@types/react": {
           "optional": true
         },
         "typescript": {
@@ -10933,20 +10951,18 @@
       }
     },
     "node_modules/zustand": {
-      "version": "4.5.7",
-      "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.5.7.tgz",
-      "integrity": "sha512-CHOUy7mu3lbD6o6LJLfllpjkzhHXSBlX8B9+qPddUsIfeF5S/UZ5q0kmCsnRqT1UHFQZchNFDDzMbQsuesHWlw==",
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.1.0.tgz",
+      "integrity": "sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA==",
       "license": "MIT",
-      "dependencies": {
-        "use-sync-external-store": "^1.2.2"
-      },
       "engines": {
-        "node": ">=12.7.0"
+        "node": ">=12.20.0"
       },
       "peerDependencies": {
-        "@types/react": ">=16.8",
+        "@types/react": ">=18.0.0",
         "immer": ">=9.0.6",
-        "react": ">=16.8"
+        "react": ">=18.0.0",
+        "use-sync-external-store": ">=1.2.0"
       },
       "peerDependenciesMeta": {
         "@types/react": {
@@ -10957,6 +10973,9 @@
         },
         "react": {
           "optional": true
+        },
+        "use-sync-external-store": {
+          "optional": true
         }
       }
     }

+ 3 - 3
app/package.json

@@ -36,14 +36,14 @@
     "@radix-ui/react-toggle": "^1.1.19",
     "@radix-ui/react-toggle-group": "^1.1.20",
     "@radix-ui/react-tooltip": "^1.3.0",
-    "@xyflow/react": "^12.12.0",
+    "@xyflow/react": "^13.0.3",
     "class-variance-authority": "^0.7.1",
     "clsx": "^2.1.1",
     "cmdk": "^1.1.1",
     "date-fns": "^4.1.0",
     "embla-carousel-react": "^8.6.0",
     "framer-motion": "^14.14.0",
-    "i18next": "^26.4.2",
+    "i18next": "^27.2.10",
     "i18next-browser-languagedetector": "^8.3.1",
     "i18next-http-backend": "^4.1.2",
     "input-otp": "^1.5.0",
@@ -52,7 +52,7 @@
     "react-day-picker": "^10.0.2",
     "react-dom": "^19.3.0",
     "react-hook-form": "^7.92.0",
-    "react-i18next": "^17.0.16",
+    "react-i18next": "^18.0.3",
     "react-is": "^19.3.0",
     "react-resizable-panels": "^4.27.0",
     "react-router": "^8.5.3",

+ 3 - 1
app/src/components/routers/AgentUpgradeButton.tsx

@@ -1,4 +1,5 @@
 import { useEffect, useRef, useState } from 'react'
+import type { TFunction } from 'i18next'
 import { useTranslation } from 'react-i18next'
 import { Loader2 } from 'lucide-react'
 import { useNetPulse } from '@/data/DataProvider'
@@ -13,7 +14,8 @@ interface AgentUpgradeButtonProps {
 
 type UpgradeState = 'idle' | 'busy' | 'sent' | 'queued' | 'not_connected' | 'fail'
 
-type StepT = (key: string, opts?: Record<string, unknown>) => string
+// TFunction de i18next 27: la firma manual no era asignable a t.
+type StepT = TFunction
 
 /** Ventana que considera "vivo" un reporte de progreso (segundos, #284). */
 export const UPGRADE_LIVE_WINDOW_S = 120

+ 1 - 1
app/src/components/topology/LinksTable.tsx

@@ -80,7 +80,7 @@ function LinkNames({ row }: { row: BackhaulRow }) {
       <span className={cn('text-text-muted', row.kind === 'wg' && 'text-tunnel')} aria-hidden>
         {row.kind === 'wg' ? '⇢' : '↔'}
       </span>
-      <span className="font-medium text-text-primary">{row.bKey ? t(row.bKey, row.bVars) : row.b}</span>
+      <span className="font-medium text-text-primary">{row.bKey ? row.bVars ? t(row.bKey, row.bVars) : t(row.bKey) : row.b}</span>
     </span>
   )
 }

+ 1 - 1
app/src/pages/Rack.tsx

@@ -1373,7 +1373,7 @@ function RackCanvas() {
               onDrop={onPickerDrop}
               minZoom={0.25}
               maxZoom={2.5}
-              colorMode={lightTheme ? 'light' : 'dark'}
+              forceColorMode={lightTheme ? 'light' : 'dark'}
               proOptions={{ hideAttribution: true }}
             >
               <Background variant={BackgroundVariant.Dots} gap={24} size={1} />