mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-08 13:46:08 +00:00
8ee79cf447
Swap the Sparkline chart component (the only chart in the panel) from recharts to uPlot, keeping its public prop API identical so the three consumers (SystemHistoryModal, XrayMetricsModal, NodeHistoryPanel) are untouched. This drops recharts and 32 transitive deps (es-toolkit, victory-vendor, d3, redux, immer), shrinking the chart vendor chunk to ~51KB (22KB gzip). The uPlot port reimplements every recharts feature on canvas: gradient area fill, spline curves, up to three series, dashed horizontal grid, formatted axes, hover tooltip and marker, reference lines, and min/max extrema dots. Because canvas cannot read CSS variables, axis and ring colors are resolved via getComputedStyle and repainted on theme changes through a MutationObserver on the body class and documentElement data-theme. Also removes the es-toolkit/compat resolver shim from vite.config.js, which existed only for recharts, and swaps the manualChunks entry to vendor-uplot. Note: repaint with redraw(false); a bare uPlot redraw() re-runs _setScale and nulls the index-based x-scale, which collapsed the series to a flat, partial line.
85 lines
2.3 KiB
JSON
85 lines
2.3 KiB
JSON
{
|
|
"name": "3x-ui-frontend",
|
|
"private": true,
|
|
"version": "0.4.1",
|
|
"type": "module",
|
|
"description": "3x-ui panel frontend (React 19 + Ant Design 6 + Vite 8).",
|
|
"engines": {
|
|
"node": ">=22.0.0",
|
|
"npm": ">=10.0.0"
|
|
},
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "npm run gen:api && vite build",
|
|
"preview": "vite preview",
|
|
"lint": "eslint src",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run",
|
|
"test:watch": "vitest",
|
|
"gen": "npm run gen:zod && npm run gen:api",
|
|
"gen:api": "node --experimental-strip-types --disable-warning=ExperimentalWarning scripts/build-openapi.mjs",
|
|
"gen:zod": "cd .. && go run ./tools/openapigen"
|
|
},
|
|
"dependencies": {
|
|
"@ant-design/icons": "^6.3.2",
|
|
"@codemirror/lang-json": "^6.0.2",
|
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
"@noble/hashes": "^2.2.0",
|
|
"@tanstack/react-query": "^5.101.2",
|
|
"@tanstack/react-query-devtools": "^5.101.2",
|
|
"antd": "^6.5.0",
|
|
"codemirror": "^6.0.2",
|
|
"dayjs": "^1.11.21",
|
|
"i18next": "^26.3.4",
|
|
"otpauth": "^9.5.1",
|
|
"persian-calendar-suite": "^1.5.5",
|
|
"react": "^19.2.7",
|
|
"react-dom": "^19.2.7",
|
|
"react-i18next": "^17.0.8",
|
|
"react-router-dom": "^7.18.1",
|
|
"swagger-ui-react": "^5.32.8",
|
|
"uplot": "^1.6.32",
|
|
"zod": "^4.4.3"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@testing-library/dom": "^10.4.1",
|
|
"@testing-library/react": "^16.3.2",
|
|
"@types/react": "^19.2.17",
|
|
"@types/react-dom": "^19.2.3",
|
|
"@types/swagger-ui-react": "^5.18.0",
|
|
"@vitejs/plugin-react": "^6.0.3",
|
|
"@vitest/coverage-v8": "^4.1.9",
|
|
"eslint": "^10.6.0",
|
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"globals": "^17.7.0",
|
|
"jsdom": "^29.1.1",
|
|
"typescript": "^6.0.3",
|
|
"typescript-eslint": "^8.62.1",
|
|
"vite": "8.1.3",
|
|
"vitest": "^4.1.9"
|
|
},
|
|
"overrides": {
|
|
"eslint-plugin-jsx-a11y": {
|
|
"eslint": "$eslint"
|
|
},
|
|
"dompurify": "^3.4.11",
|
|
"react-copy-to-clipboard": "^5.1.1",
|
|
"react-inspector": "^9.0.0",
|
|
"react-debounce-input": {
|
|
"react": "^19.0.0"
|
|
},
|
|
"swagger-ui-react": {
|
|
"js-yaml": "^4.2.0"
|
|
}
|
|
},
|
|
"allowScripts": {
|
|
"@scarf/scarf": false,
|
|
"@tree-sitter-grammars/tree-sitter-yaml": false,
|
|
"tree-sitter": false,
|
|
"core-js-pure": false,
|
|
"tree-sitter-json": false
|
|
}
|
|
}
|