generated from nhcarrigan/template
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:
@@ -1,5 +1,6 @@
|
||||
import type { BuyPrestigeUpgradeRequest, GameState, PrestigeRequest } from "@elysium/types";
|
||||
import { Hono } from "hono";
|
||||
import type { HonoEnv } from "../types/hono.js";
|
||||
import { prisma } from "../db/client.js";
|
||||
import { authMiddleware } from "../middleware/auth.js";
|
||||
import { DEFAULT_PRESTIGE_UPGRADES } from "../data/prestigeUpgrades.js";
|
||||
@@ -10,7 +11,7 @@ import {
|
||||
isEligibleForPrestige,
|
||||
} from "../services/prestige.js";
|
||||
|
||||
export const prestigeRouter = new Hono();
|
||||
export const prestigeRouter = new Hono<HonoEnv>();
|
||||
|
||||
prestigeRouter.use("*", authMiddleware);
|
||||
|
||||
@@ -55,7 +56,7 @@ prestigeRouter.post("/", async (context) => {
|
||||
// Preserve daily challenges across the prestige reset and apply any crystal rewards
|
||||
const finalState: GameState = {
|
||||
...newState,
|
||||
dailyChallenges: updatedDailyChallenges,
|
||||
...(updatedDailyChallenges !== undefined ? { dailyChallenges: updatedDailyChallenges } : {}),
|
||||
resources: {
|
||||
...newState.resources,
|
||||
crystals: newState.resources.crystals + challengeCrystals,
|
||||
|
||||
Reference in New Issue
Block a user