batchCooking/specs
Nicolas 95bd8fab87 refactor: move ErrorHandlerService/HttpError out of express-tools
ErrorHandlerService has zero dependency on Express — it's a plain
"map an error to {status, body}" service that works identically
behind any HTTP framework. It had no business living in a package
named express-tools.

Extracted HttpError, ErrorHandlerService, and ErrorHandlingResult
into a new packages/error-tools package (same tsc-build-to-dist
pattern as shared/express-tools). express-tools now only keeps the
actual Express-specific layer: ExpressServer, wrapAsyncHandler, and
createErrorMiddleware (which adapts ErrorHandlerService, imported
from error-tools, onto Express).

- packages/error-tools: new package, depends on shared + zod
- packages/express-tools: drops zod dependency, adds error-tools
  dependency for error-middleware.ts's type import
- apps/api: adds error-tools dependency; app.ts, auth.service.ts,
  require-auth.ts now import HttpError/errorHandlerService from
  error-tools instead of express-tools
- apps/api/Dockerfile: adds COPY for packages/error-tools in the
  runtime stage
- specs/error-handling.md, specs/backend-architecture.md, README.md
  updated to reflect the new package split

Verified: pnpm lint, pnpm build (all packages, correct dependency
order), pnpm test (9/9 Mocha), pnpm test:bdd (5/5 Cucumber), full
Docker rebuild + compose up (no crash-loop), curl + browser checks
of /health, unknown-route 404, signup (201), duplicate-email 409
(code 4001 EMAIL_ALREADY_IN_USE) — all going through the moved
ErrorHandlerService/HttpError correctly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-16 18:21:09 +02:00
..
backend-architecture.md refactor: move ErrorHandlerService/HttpError out of express-tools 2026-08-16 18:21:09 +02:00
batch-cooking-architecture.md Centralize error handling (shared codes + API/client services), code quality pass 2026-08-16 15:44:09 +02:00
batch-cooking-modele.md Add specs + Prisma schema for the documented data model (#3) 2026-08-16 12:23:59 +02:00
error-handling.md refactor: move ErrorHandlerService/HttpError out of express-tools 2026-08-16 18:21:09 +02:00
frontend-architecture.md Address second review round: interface comments, res.locals, ExpressServer, assertIsNever 2026-08-16 17:00:23 +02:00