batchCooking/apps/web/package.json
Nicolas ff36cefcde
Some checks failed
CI / lint (push) Failing after 1m59s
CI / build (push) Successful in 3m55s
CI / test (push) Has been cancelled
CI / intent-service-test (push) Has been cancelled
CI / e2e (push) Has been cancelled
feat(web): plomberie web pour la coquille Capacitor Android (#39 phase 2)
Tout ce qui est vérifiable en CI de la phase 2 du portage mobile. La
génération du projet natif (`npx cap add android`), le build de l'APK et
le test sur appareil restent une étape manuelle (pas d'Android Studio ici)
— cf. le corps de l'issue #39.

- Dépendances : `@capacitor/core`, `@capacitor/android`,
  `@capacitor/preferences` (+ `@capacitor/cli` en dev), toutes en 8.5.x.
- `capacitor.config.ts` : `appId` `fr.kyuno.batchcooking`, `webDir: "dist"`.
- `apps/web/src/api/capacitor-token-store.ts` : implémentation `TokenStore`
  adossée à `@capacitor/preferences`, branchée via `setTokenStore()` (le
  point d'injection posé en phase 1). Importée dynamiquement dans
  `main.tsx` uniquement quand `Capacitor.isNativePlatform()` — le bundle
  web ne charge jamais `@capacitor/preferences` (vérifié : chunk séparé de
  0,5 ko jamais requis côté navigateur).
- `main.tsx` : `HashRouter` en natif (le bundle packagé sert `dist/`
  depuis l'origine locale de la WebView, sans réécriture des liens
  profonds vers `index.html`), `BrowserRouter` inchangé sur le web ;
  bootstrap async pour poser le token store avant le premier rendu.
- `build:capacitor` (`vite build --mode capacitor`) + `.env.capacitor.example` :
  le build packagé a besoin de l'URL absolue de l'API en dur (pas de
  "même origine que la page" possible).

Vérifié : `pnpm build` + `pnpm lint` verts ; Cypress smoke/layout/sidebar
14/14 en local (le refactor du bootstrap et le choix de routeur ne
cassent rien côté web).

Refs #39
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 03:56:15 +02:00

51 lines
1.5 KiB
JSON

{
"name": "web",
"version": "0.2.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite --host 0.0.0.0",
"build": "tsc -b && vite build",
"build:capacitor": "tsc -b && vite build --mode capacitor",
"preview": "vite preview",
"test": "echo \"no unit tests yet\" && exit 0",
"cy:open": "cypress open",
"cy:run": "cypress run",
"e2e": "start-server-and-test dev http://localhost:5173 cy:run",
"cy:run:component": "cypress run --component"
},
"dependencies": {
"@batch-cooking/date-tools": "workspace:*",
"@batch-cooking/shared": "workspace:*",
"@capacitor/android": "^8.5.1",
"@capacitor/core": "^8.5.1",
"@capacitor/preferences": "^8.0.1",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/utilities": "^3.2.2",
"i18next": "^26.3.6",
"lucide-react": "^1.32.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^17.0.11",
"react-router-dom": "^7.18.2",
"recharts": "^2.15.0",
"socket.io-client": "^4.8.3",
"zod": "^3.25.76"
},
"devDependencies": {
"@badeball/cypress-cucumber-preprocessor": "22.2.0",
"@bahmutov/cypress-esbuild-preprocessor": "2.2.8",
"@capacitor/cli": "^8.5.1",
"@cypress/vite-dev-server": "5.2.1",
"@types/node": "^22.9.0",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.3",
"cypress": "13.17.0",
"esbuild": "0.21.5",
"sass": "^1.102.0",
"start-server-and-test": "^2.0.8",
"typescript": "^5.7.2",
"vite": "^5.4.11"
}
}