fix: resolve pre-existing TypeScript strictness build errors

- Add @types/node to API devDependencies
- Create HonoEnv type and apply to all routers + auth middleware for
  proper context.get/set("discordId") typing
- Use conditional spreads for exactOptionalPropertyTypes dailyChallenges
  in GameContext, tick engine, and prestige route
- Use conditional spread for optional signature in SaveRequest calls
- Add non-null assertions in shuffle/template index for noUncheckedIndexedAccess
- Cast GameState to never for Prisma InputJsonValue fields
- Exclude vite.config.ts from web tsconfig (it runs in Node context)
This commit is contained in:
2026-03-06 23:56:55 -08:00
committed by Naomi Carrigan
parent 078ae50e69
commit acda4c2fc4
10 changed files with 61 additions and 39 deletions
+3 -2
View File
@@ -1,7 +1,8 @@
import type { Context, Next } from "hono";
import type { MiddlewareHandler } from "hono";
import type { HonoEnv } from "../types/hono.js";
import { verifyToken } from "../services/jwt.js";
export const authMiddleware = async (context: Context, next: Next): Promise<void> => {
export const authMiddleware: MiddlewareHandler<HonoEnv> = async (context, next) => {
const authorization = context.req.header("Authorization");
if (!authorization?.startsWith("Bearer ")) {