diff --git a/eslint.config.mjs b/eslint.config.mjs index c1332bdf..2627fb79 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,6 +7,7 @@ import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended' import reactPlugin from 'eslint-plugin-react' import prettier from 'eslint-plugin-prettier' import nextPlugin from '@next/eslint-plugin-next' +import pluginQuery from '@tanstack/eslint-plugin-query' export default [ { @@ -29,6 +30,7 @@ export default [ }, { languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } } }, { languageOptions: { globals: { ...globals.browser, ...globals.node } } }, + ...pluginQuery.configs['flat/recommended'], pluginJs.configs.recommended, ...tseslint.configs.recommended, ...fixupConfigRules(pluginReactConfig), diff --git a/package.json b/package.json index 794bcbc6..c95b4968 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "peanut", - "version": "4.0.2", + "version": "4.1.0", "private": true, "scripts": { "clean": "rm -rf .next .swc coverage test-results", @@ -33,10 +33,10 @@ "@influxdata/influxdb-client": "^1.35.0", "@influxdata/influxdb-client-apis": "^1.35.0", "@material-tailwind/react": "^2.1.10", - "@tanstack/react-query": "^5.62.0", - "chart.js": "^4.4.6", + "@tanstack/react-query": "^5.62.2", + "chart.js": "^4.4.7", "chartjs-plugin-annotation": "^3.1.0", - "i18next": "^24.0.2", + "i18next": "^24.0.5", "i18next-browser-languagedetector": "^8.0.0", "i18next-resources-to-backend": "^1.2.1", "js-yaml": "^4.1.0", @@ -56,6 +56,7 @@ "@next/bundle-analyzer": "^15.0.3", "@next/eslint-plugin-next": "^15.0.3", "@playwright/test": "^1.49.0", + "@tanstack/eslint-plugin-query": "^5.62.1", "@testing-library/dom": "^10.4.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.0.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1a646c6a..b781c0c1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -27,17 +27,17 @@ importers: specifier: ^2.1.10 version: 2.1.10(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@tanstack/react-query': - specifier: ^5.62.0 - version: 5.62.0(react@18.3.1) + specifier: ^5.62.2 + version: 5.62.2(react@18.3.1) chart.js: - specifier: ^4.4.6 - version: 4.4.6 + specifier: ^4.4.7 + version: 4.4.7 chartjs-plugin-annotation: specifier: ^3.1.0 - version: 3.1.0(chart.js@4.4.6) + version: 3.1.0(chart.js@4.4.7) i18next: - specifier: ^24.0.2 - version: 24.0.2(typescript@5.7.2) + specifier: ^24.0.5 + version: 24.0.5(typescript@5.7.2) i18next-browser-languagedetector: specifier: ^8.0.0 version: 8.0.0 @@ -55,19 +55,19 @@ importers: version: 15.0.3(@babel/core@7.23.6)(@playwright/test@1.49.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next-i18next: specifier: ^15.4.0 - version: 15.4.0(i18next@24.0.2(typescript@5.7.2))(next@15.0.3(@babel/core@7.23.6)(@playwright/test@1.49.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-i18next@15.1.3(i18next@24.0.2(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + version: 15.4.0(i18next@24.0.5(typescript@5.7.2))(next@15.0.3(@babel/core@7.23.6)(@playwright/test@1.49.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-i18next@15.1.3(i18next@24.0.5(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) react: specifier: ^18.3.1 version: 18.3.1 react-chartjs-2: specifier: ^5.2.0 - version: 5.2.0(chart.js@4.4.6)(react@18.3.1) + version: 5.2.0(chart.js@4.4.7)(react@18.3.1) react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) react-i18next: specifier: ^15.1.3 - version: 15.1.3(i18next@24.0.2(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 15.1.3(i18next@24.0.5(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react-toastify: specifier: ^10.0.6 version: 10.0.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -90,6 +90,9 @@ importers: '@playwright/test': specifier: ^1.49.0 version: 1.49.0 + '@tanstack/eslint-plugin-query': + specifier: ^5.62.1 + version: 5.62.1(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2) '@testing-library/dom': specifier: ^10.4.0 version: 10.4.0 @@ -991,11 +994,16 @@ packages: '@swc/helpers@0.5.13': resolution: {integrity: sha512-UoKGxQ3r5kYI9dALKJapMmuK+1zWM/H17Z1+iwnNmzcJRnfFuevZs375TA5rW31pu4BS4NoSy1fRsexDXfWn5w==} - '@tanstack/query-core@5.62.0': - resolution: {integrity: sha512-sx38bGrqF9bop92AXOvzDr0L9fWDas5zXdPglxa9cuqeVSWS7lY6OnVyl/oodfXjgOGRk79IfCpgVmxrbHuFHg==} + '@tanstack/eslint-plugin-query@5.62.1': + resolution: {integrity: sha512-1886D5U+re1TW0wSH4/kUGG36yIoW5Wkz4twVEzlk3ZWmjF3XkRSWgB+Sc7n+Lyzt8usNV8ZqkZE6DA7IC47fQ==} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + + '@tanstack/query-core@5.62.2': + resolution: {integrity: sha512-LcwVcC5qpsDpHcqlXUUL5o9SaOBwhNkGeV+B06s0GBoyBr8FqXPuXT29XzYXR36lchhnerp6XO+CWc84/vh7Zg==} - '@tanstack/react-query@5.62.0': - resolution: {integrity: sha512-tj2ltjAn2a3fs+Dqonlvs6GyLQ/LKVJE2DVSYW+8pJ3P6/VCVGrfqv5UEchmlP7tLOvvtZcOuSyI2ooVlR5Yqw==} + '@tanstack/react-query@5.62.2': + resolution: {integrity: sha512-fkTpKKfwTJtVPKVR+ag7YqFgG/7TRVVPzduPAUF9zRCiiA8Wu305u+KJl8rCrh98Qce77vzIakvtUyzWLtaPGA==} peerDependencies: react: ^18 || ^19 @@ -1517,8 +1525,8 @@ packages: character-reference-invalid@1.1.4: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} - chart.js@4.4.6: - resolution: {integrity: sha512-8Y406zevUPbbIBA/HRk33khEmQPk5+cxeflWE/2rx1NJsjVWMPw/9mSP9rxHP5eqi6LNoPBVMfZHxbwLSgldYA==} + chart.js@4.4.7: + resolution: {integrity: sha512-pwkcKfdzTMAU/+jNosKhNL2bHtJc/sSmYgVbuGTEDhzkrhmyihmP7vUc/5ZK9WopidMDHNe3Wm7jOd/WhuHWuw==} engines: {pnpm: '>=8'} chartjs-plugin-annotation@3.1.0: @@ -2354,8 +2362,8 @@ packages: i18next-resources-to-backend@1.2.1: resolution: {integrity: sha512-okHbVA+HZ7n1/76MsfhPqDou0fptl2dAlhRDu2ideXloRRduzHsqDOznJBef+R3DFZnbvWoBW+KxJ7fnFjd6Yw==} - i18next@24.0.2: - resolution: {integrity: sha512-D88xyIGcWAKwBTAs4RSqASi8NXR/NhCVSTM4LDbdoU8qb/5dcEZjNCLDhtQBB7Epw/Cp1w2vH/3ujoTbqLSs5g==} + i18next@24.0.5: + resolution: {integrity: sha512-1jSdEzgFPGLZRsQwydoMFCBBaV+PmrVEO5WhANllZPX4y2JSGTxUjJ+xVklHIsiS95uR8gYc/y0hYZWevucNjg==} peerDependencies: typescript: ^5 peerDependenciesMeta: @@ -5487,11 +5495,19 @@ snapshots: dependencies: tslib: 2.6.2 - '@tanstack/query-core@5.62.0': {} + '@tanstack/eslint-plugin-query@5.62.1(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2)': + dependencies: + '@typescript-eslint/utils': 8.16.0(eslint@9.16.0(jiti@1.21.6))(typescript@5.7.2) + eslint: 9.16.0(jiti@1.21.6) + transitivePeerDependencies: + - supports-color + - typescript + + '@tanstack/query-core@5.62.2': {} - '@tanstack/react-query@5.62.0(react@18.3.1)': + '@tanstack/react-query@5.62.2(react@18.3.1)': dependencies: - '@tanstack/query-core': 5.62.0 + '@tanstack/query-core': 5.62.2 react: 18.3.1 '@testing-library/dom@10.4.0': @@ -6108,13 +6124,13 @@ snapshots: character-reference-invalid@1.1.4: {} - chart.js@4.4.6: + chart.js@4.4.7: dependencies: '@kurkle/color': 0.3.2 - chartjs-plugin-annotation@3.1.0(chart.js@4.4.6): + chartjs-plugin-annotation@3.1.0(chart.js@4.4.7): dependencies: - chart.js: 4.4.6 + chart.js: 4.4.7 chokidar@3.6.0: dependencies: @@ -7059,7 +7075,7 @@ snapshots: dependencies: '@babel/runtime': 7.23.6 - i18next@24.0.2(typescript@5.7.2): + i18next@24.0.5(typescript@5.7.2): dependencies: '@babel/runtime': 7.25.6 optionalDependencies: @@ -7867,17 +7883,17 @@ snapshots: neotraverse@0.6.18: {} - next-i18next@15.4.0(i18next@24.0.2(typescript@5.7.2))(next@15.0.3(@babel/core@7.23.6)(@playwright/test@1.49.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-i18next@15.1.3(i18next@24.0.2(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): + next-i18next@15.4.0(i18next@24.0.5(typescript@5.7.2))(next@15.0.3(@babel/core@7.23.6)(@playwright/test@1.49.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react-i18next@15.1.3(i18next@24.0.5(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.25.6 '@types/hoist-non-react-statics': 3.3.5 core-js: 3.34.0 hoist-non-react-statics: 3.3.2 - i18next: 24.0.2(typescript@5.7.2) + i18next: 24.0.5(typescript@5.7.2) i18next-fs-backend: 2.6.0 next: 15.0.3(@babel/core@7.23.6)(@playwright/test@1.49.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 - react-i18next: 15.1.3(i18next@24.0.2(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react-i18next: 15.1.3(i18next@24.0.5(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) next-swagger-doc@0.4.1(next@15.0.3(@babel/core@7.23.6)(@playwright/test@1.49.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(openapi-types@12.1.3): dependencies: @@ -8274,9 +8290,9 @@ snapshots: strip-json-comments: 2.0.1 optional: true - react-chartjs-2@5.2.0(chart.js@4.4.6)(react@18.3.1): + react-chartjs-2@5.2.0(chart.js@4.4.7)(react@18.3.1): dependencies: - chart.js: 4.4.6 + chart.js: 4.4.7 react: 18.3.1 react-copy-to-clipboard@5.1.0(react@18.3.1): @@ -8297,11 +8313,11 @@ snapshots: react: 18.3.1 scheduler: 0.23.2 - react-i18next@15.1.3(i18next@24.0.2(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + react-i18next@15.1.3(i18next@24.0.5(typescript@5.7.2))(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.25.6 html-parse-stringify: 3.0.1 - i18next: 24.0.2(typescript@5.7.2) + i18next: 24.0.5(typescript@5.7.2) react: 18.3.1 optionalDependencies: react-dom: 18.3.1(react@18.3.1) diff --git a/src/client/components/grid.tsx b/src/client/components/grid.tsx index 9db057d2..dfb1d3ff 100644 --- a/src/client/components/grid.tsx +++ b/src/client/components/grid.tsx @@ -30,7 +30,7 @@ export default function NutGrid(props: Props) { const [edit, setEdit] = useState(-1) const ref = useRef(null) const { data: descriptions } = useQuery({ - queryKey: ['deviceDescriptions'], + queryKey: ['deviceDescriptions', data.name, data.vars], queryFn: () => getAllVarDescriptions(data.name, Object.keys(data.vars)), })