Plan step 4.1. No visible change to layout or flows. - api/client.js on @xenia/api createApiClient (CS-8 baseURL, 401 → sign out, no answer → backend-offline, err.xenia, the manager-approval retry); the PIN login handles its own 401 (before, a wrong PIN reloaded the page). - <AccessProvider> at the root with an i18n instance: modules, permission keys, venue, language from bootstrap; who is signed in comes with it (no more /api/auth/me polling). packages/access: AccessProvider gains `cache` (the last bootstrap per session; used when the server can't be reached, `offline` in the context, keeps retrying) and `failed` (the app's own screen when there's nothing cached). The waiter caches per venue, shows its offline page (server search) on a first start without a server, retries every 5 s; ServerRediscovery and BundleSync run outside the bootstrap. - Role names → keys: the shift gate and the user menu use core.dashboard.access. - One shared, offline-cached read of the venue settings (api/venueSettings.js) instead of seven GET /api/settings/ calls; apiError() shows backend error codes in the user's language (17 places). - Lint: 78 errors → 0 (unused code, empty catches, two duplicate style keys, a component created during render, refs read during render → state, hooks after an early return); set-state-in-effect is a warning like the manager/terminal; lint in run-all. - Tests: tests/bootstrapCache.test.mjs; e2e browser: an offline restart stays signed in. Android rediscovery waits for what the screen shows instead of fixed sleeps: 10/10 three runs in a row (KI-009). Terminal 3.4 waits for both displays before the sale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
50 lines
1.4 KiB
JSON
50 lines
1.4 KiB
JSON
{
|
|
"name": "waiter_pwa",
|
|
"private": true,
|
|
"version": "0.0.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "vite build",
|
|
"lint": "eslint .",
|
|
"preview": "vite preview",
|
|
"build:native": "vite build --mode native && cap sync android",
|
|
"apk:debug": "npm run build:native && node scripts/build-apk.mjs debug",
|
|
"apk:release": "npm run build:native && node scripts/build-apk.mjs release",
|
|
"test": "node --test \"tests/*.test.mjs\""
|
|
},
|
|
"dependencies": {
|
|
"@capacitor/android": "8.6.2",
|
|
"@capacitor/app": "8.1.2",
|
|
"@capacitor/core": "8.6.2",
|
|
"@capgo/capacitor-updater": "8.54.2",
|
|
"@tanstack/react-query": "^5.107.1",
|
|
"@xenia/access": "^0.0.0",
|
|
"@xenia/api": "^0.0.0",
|
|
"@xenia/i18n": "^0.0.0",
|
|
"@xenia/ui": "^0.0.0",
|
|
"axios": "^1.21.1",
|
|
"dexie": "^4.4.7",
|
|
"qr-scanner": "^1.4.2",
|
|
"react": "^19.3.1",
|
|
"react-dom": "^19.3.1",
|
|
"react-router-dom": "^7.18.5",
|
|
"vite-plugin-pwa": "^2.0.0",
|
|
"workbox-window": "^7.4.1",
|
|
"zustand": "^5.1.0"
|
|
},
|
|
"devDependencies": {
|
|
"@capacitor/cli": "8.6.2",
|
|
"@eslint/js": "^9.39.5",
|
|
"@types/react": "^19.3.0",
|
|
"@types/react-dom": "^19.3.0",
|
|
"@vitejs/plugin-react": "^6.3.0",
|
|
"eslint": "^9.39.5",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"eslint-plugin-react-refresh": "^0.5.7",
|
|
"fflate": "^0.8.3",
|
|
"globals": "^17.14.0",
|
|
"vite": "^8.3.8"
|
|
}
|
|
}
|