chore: patch npm advisories in shipped and build code; add a manager ESLint config

Platform-v2 step 2.99b.
- npm update of the advised packages, within their ranges: what ships to browsers
  is axios 1.15.1 -> 1.21.1 and react-router(-dom) 7.14.1 -> 7.18.5 (both apps);
  build tools: vite 8.0.9 -> 8.3.8 (rolldown 1.2), postcss 8.5.33, babel 7.29.x,
  browserslist, js-yaml, zod, brace-expansion, nanoid, source-map-js... 30 -> 11
  advisories; the 11 left are build-time only (vite-plugin-pwa/workbox-build chain,
  @capacitor/cli -> xcode -> uuid) and move to 2.99c.
- manager_dashboard/eslint.config.js = the waiter's rules; `npm run lint -w
  manager-dashboard` checks the v2 code (file list in the script), in run-all.mjs.
  set-state-in-effect is a warning until phase 6 moves page loading to react-query.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-14 12:35:50 +02:00
co-authored by Claude Opus 5.5
parent 7cbd0325a4
commit e9b6ef57e0
5 changed files with 2432 additions and 2731 deletions
+40
View File
@@ -0,0 +1,40 @@
// ESLint for the manager (plan step 2.99b): the waiter's rules (React Hooks 7, react-refresh).
// `npm run lint` checks the code written or converted in platform v2 (the list in V2 below).
// Older pages break these rules in places (e.g. setState in effects); phase 6 adds each page
// to V2 as it converts it. `npx eslint src` shows everything.
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import { defineConfig, globalIgnores } from 'eslint/config'
export default defineConfig([
globalIgnores(['dist', 'dev-dist']),
{
files: ['**/*.{js,jsx}'],
extends: [
js.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
parserOptions: {
ecmaVersion: 'latest',
ecmaFeatures: { jsx: true },
sourceType: 'module',
},
},
rules: {
'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
// The v2 pages load their data with `useEffect(() => { load() }, [load])` (setState after
// a fetch). A warning until phase 6 moves page loading to react-query (already a dependency).
'react-hooks/set-state-in-effect': 'warn',
},
},
{
files: ['tests/**/*.mjs', '*.config.js'],
languageOptions: { globals: globals.node },
},
])
+7 -1
View File
@@ -7,7 +7,8 @@
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"test": "node --test \"tests/*.test.mjs\"" "test": "node --test \"tests/*.test.mjs\"",
"lint": "eslint eslint.config.js tests src/shell src/live src/pages/platform src/pages/staff src/pages/Settings/sections src/pages/LoginPage.jsx src/components/NotificationBell.jsx src/components/UserMenuButton.jsx src/pages/reports/operations/LogsPanel.jsx src/api/client.js src/store/authStore.js src/main.jsx"
}, },
"dependencies": { "dependencies": {
"@tanstack/react-query": "^5.62.0", "@tanstack/react-query": "^5.62.0",
@@ -27,10 +28,15 @@
"zustand": "^5.0.2" "zustand": "^5.0.2"
}, },
"devDependencies": { "devDependencies": {
"@eslint/js": "^9.39.4",
"@types/react": "^19.2.14", "@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3", "@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^6.0.1", "@vitejs/plugin-react": "^6.0.1",
"autoprefixer": "^10.4.20", "autoprefixer": "^10.4.20",
"eslint": "^9.39.4",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.5.0",
"postcss": "^8.4.49", "postcss": "^8.4.49",
"tailwindcss": "^3.4.16", "tailwindcss": "^3.4.16",
"vite": "^8.0.9" "vite": "^8.0.9"
+2383 -2730
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -21,6 +21,7 @@ npm test -w @xenia/i18n # venue-time formatting (DST), money/nu
npm test -w @xenia/api # live client = the waiter's old WebSocket behaviour (backoff, cursor, online); HTTP client vs a fake backend (headers, codes, 401, offline, approval retry) npm test -w @xenia/api # live client = the waiter's old WebSocket behaviour (backoff, cursor, online); HTTP client vs a fake backend (headers, codes, 401, offline, approval retry)
npm test -w @xenia/access # can(): one key, any/all npm test -w @xenia/access # can(): one key, any/all
npm test -w manager-dashboard # platform pages' logic: module states, what stops with a module, device status/usage/limits npm test -w manager-dashboard # platform pages' logic: module states, what stops with a module, device status/usage/limits
npm run lint -w manager-dashboard # ESLint (waiter rules) on the manager's v2 code; the file list is the `lint` script
``` ```
**DB tests** (`local_backend/tests/conftest.py`) run the real FastAPI app against a throwaway SQLite database in a temp folder (never your dev or venue DB). Fixtures: `db` (session, rolled back after each test even if the code commits), `client` (TestClient with `get_db` overridden, license check open, no lifespan), `make_user(role=..., perms=...)` (password `password`, PIN `1234`), `login(user)` (auth headers). A test that uses any of them is marked `db` automatically. **DB tests** (`local_backend/tests/conftest.py`) run the real FastAPI app against a throwaway SQLite database in a temp folder (never your dev or venue DB). Fixtures: `db` (session, rolled back after each test even if the code commits), `client` (TestClient with `get_db` overridden, license check open, no lifespan), `make_user(role=..., perms=...)` (password `password`, PIN `1234`), `login(user)` (auth headers). A test that uses any of them is marked `db` automatically.
+1
View File
@@ -13,6 +13,7 @@ const suites = [
['unit: packages/api (node --test)', 'npm', ['test', '--silent', '-w', '@xenia/api'], CS], ['unit: packages/api (node --test)', 'npm', ['test', '--silent', '-w', '@xenia/api'], CS],
['unit: packages/access (node --test)', 'npm', ['test', '--silent', '-w', '@xenia/access'], CS], ['unit: packages/access (node --test)', 'npm', ['test', '--silent', '-w', '@xenia/access'], CS],
['unit: manager_dashboard (node --test)', 'npm', ['test', '--silent', '-w', 'manager-dashboard'], CS], ['unit: manager_dashboard (node --test)', 'npm', ['test', '--silent', '-w', 'manager-dashboard'], CS],
['lint: manager_dashboard (v2 code)', 'npm', ['run', 'lint', '--silent', '-w', 'manager-dashboard'], CS],
['install.sh', 'node', ['install.mjs'], E2E], ['install.sh', 'node', ['install.mjs'], E2E],
['license (cloud + site)', PYTHON, ['license_e2e.py'], E2E], ['license (cloud + site)', PYTHON, ['license_e2e.py'], E2E],
['browser', 'node', ['browser.mjs'], E2E], ['browser', 'node', ['browser.mjs'], E2E],