From 3263f7200405ec0e58b8cbc13da490a8fe425ffc Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Thu, 9 Jul 2026 13:25:37 -0600 Subject: [PATCH] Fix tests --- app/.server/classes/Plugins/Aspect.ts | 2 +- app/.server/classes/Plugins/Conversation.ts | 2 +- app/.server/classes/Plugins/Inventory.ts | 2 +- app/.server/classes/Plugins/Macro.ts | 2 +- app/.server/classes/Plugins/Mission.ts | 2 +- app/.server/classes/Plugins/Report.ts | 2 +- app/.server/classes/Plugins/ShipSystems/BaseSystem.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Battery.ts | 2 +- app/.server/classes/Plugins/ShipSystems/CoolantTank.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Exocomps.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Generic.ts | 2 +- app/.server/classes/Plugins/ShipSystems/ImpulseEngines.ts | 2 +- app/.server/classes/Plugins/ShipSystems/InertialDampeners.ts | 2 +- app/.server/classes/Plugins/ShipSystems/LongRangeComm.ts | 2 +- app/.server/classes/Plugins/ShipSystems/MainComputer.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Navigation.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Phasers.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Reactor.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Sensors.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Shields.ts | 2 +- app/.server/classes/Plugins/ShipSystems/ShortRangeComm.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Targeting.ts | 2 +- app/.server/classes/Plugins/ShipSystems/Thrusters.ts | 2 +- app/.server/classes/Plugins/ShipSystems/TorpedoLauncher.ts | 2 +- app/.server/classes/Plugins/ShipSystems/warpEngines.ts | 2 +- app/.server/classes/Plugins/StationComplement.ts | 2 +- app/.server/classes/Plugins/Theme.ts | 2 +- app/.server/classes/Plugins/Training.ts | 2 +- app/.server/classes/Plugins/Universe/SolarSystem.ts | 2 +- app/ecs-components/engineeringPanel.ts | 2 +- app/ecs-components/engineeringPanelTypes.ts | 2 +- app/ecs-components/timelineBlocks.ts | 2 +- app/routes/docs/Development/netRequests.md | 2 +- app/utils/.server/createMockDataContext.ts | 1 - 34 files changed, 33 insertions(+), 34 deletions(-) diff --git a/app/.server/classes/Plugins/Aspect.ts b/app/.server/classes/Plugins/Aspect.ts index cb9720fb..c1bf1b67 100644 --- a/app/.server/classes/Plugins/Aspect.ts +++ b/app/.server/classes/Plugins/Aspect.ts @@ -27,7 +27,7 @@ export abstract class Aspect extends DataStore { instance.meta.filePath = filePath; } let data = await instance.getData(); - if (this.schema) { + if (this.schema && data) { try { data = this.schema.parse(data); } catch (error) { diff --git a/app/.server/classes/Plugins/Conversation.ts b/app/.server/classes/Plugins/Conversation.ts index 09dfab63..1ca44e85 100644 --- a/app/.server/classes/Plugins/Conversation.ts +++ b/app/.server/classes/Plugins/Conversation.ts @@ -1,5 +1,5 @@ import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; -import { z } from "zod"; +import z from "zod"; import { Aspect } from "./Aspect"; import type BasePlugin from "./index"; diff --git a/app/.server/classes/Plugins/Inventory.ts b/app/.server/classes/Plugins/Inventory.ts index 8089a83f..800c7473 100644 --- a/app/.server/classes/Plugins/Inventory.ts +++ b/app/.server/classes/Plugins/Inventory.ts @@ -1,7 +1,7 @@ import { inventoryFlags, type InventoryFlags } from "@thorium/utils/flags/InventoryFlags"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; import type { Liter } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from "."; import { Aspect } from "./Aspect"; diff --git a/app/.server/classes/Plugins/Macro.ts b/app/.server/classes/Plugins/Macro.ts index e874cf5e..4aa4ba4f 100644 --- a/app/.server/classes/Plugins/Macro.ts +++ b/app/.server/classes/Plugins/Macro.ts @@ -1,7 +1,7 @@ import type { TimelineBlock } from "@thorium/components/timelineBuilder/TimelineBlockTypes"; import { timelineBlock } from "@thorium/ecs-components/timelineBlocks"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from "."; import { Aspect } from "./Aspect"; diff --git a/app/.server/classes/Plugins/Mission.ts b/app/.server/classes/Plugins/Mission.ts index d1e1b768..fa2f8f3e 100644 --- a/app/.server/classes/Plugins/Mission.ts +++ b/app/.server/classes/Plugins/Mission.ts @@ -3,7 +3,7 @@ import type { TimelineBlock } from "@thorium/components/timelineBuilder/Timeline import { timelineBlock } from "@thorium/ecs-components/timelineBlocks"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; import uniqid from "@thorium/utils/uniqid"; -import { z } from "zod"; +import z from "zod"; import { Aspect } from "./Aspect"; import type BasePlugin from "./index"; diff --git a/app/.server/classes/Plugins/Report.ts b/app/.server/classes/Plugins/Report.ts index f9e73973..906b18e5 100644 --- a/app/.server/classes/Plugins/Report.ts +++ b/app/.server/classes/Plugins/Report.ts @@ -3,7 +3,7 @@ import type { TimelineBlock } from "@thorium/components/timelineBuilder/Timeline import { timelineBlock } from "@thorium/ecs-components/timelineBlocks"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; import uniqid from "@thorium/utils/uniqid"; -import { z } from "zod"; +import z from "zod"; import { Aspect } from "./Aspect"; import type BasePlugin from "./index"; diff --git a/app/.server/classes/Plugins/ShipSystems/BaseSystem.ts b/app/.server/classes/Plugins/ShipSystems/BaseSystem.ts index 05b9f46b..8beba514 100644 --- a/app/.server/classes/Plugins/ShipSystems/BaseSystem.ts +++ b/app/.server/classes/Plugins/ShipSystems/BaseSystem.ts @@ -1,7 +1,7 @@ import type { Sound } from "@thorium/ecs-components/sound"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; import type { Kelvin, KelvinPerSecond, MegaWatt } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import { Aspect } from "../Aspect"; diff --git a/app/.server/classes/Plugins/ShipSystems/Battery.ts b/app/.server/classes/Plugins/ShipSystems/Battery.ts index 7c8605bc..eb153203 100644 --- a/app/.server/classes/Plugins/ShipSystems/Battery.ts +++ b/app/.server/classes/Plugins/ShipSystems/Battery.ts @@ -1,5 +1,5 @@ import type { MegaWatt, MegaWattHour } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/CoolantTank.ts b/app/.server/classes/Plugins/ShipSystems/CoolantTank.ts index 8df69e48..5d962f37 100644 --- a/app/.server/classes/Plugins/ShipSystems/CoolantTank.ts +++ b/app/.server/classes/Plugins/ShipSystems/CoolantTank.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; import type { ShipSystemFlags } from "./shipSystemTypes"; diff --git a/app/.server/classes/Plugins/ShipSystems/Exocomps.ts b/app/.server/classes/Plugins/ShipSystems/Exocomps.ts index 1ca17dc3..7f8f2c3a 100644 --- a/app/.server/classes/Plugins/ShipSystems/Exocomps.ts +++ b/app/.server/classes/Plugins/ShipSystems/Exocomps.ts @@ -1,6 +1,6 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; import type { Liter, MegaWatt, MegaWattHour, MetersPerSecond } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/Generic.ts b/app/.server/classes/Plugins/ShipSystems/Generic.ts index 9054fa56..75784aea 100644 --- a/app/.server/classes/Plugins/ShipSystems/Generic.ts +++ b/app/.server/classes/Plugins/ShipSystems/Generic.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; import type { ShipSystemFlags } from "./shipSystemTypes"; diff --git a/app/.server/classes/Plugins/ShipSystems/ImpulseEngines.ts b/app/.server/classes/Plugins/ShipSystems/ImpulseEngines.ts index f3b45ef0..5bb8efa3 100644 --- a/app/.server/classes/Plugins/ShipSystems/ImpulseEngines.ts +++ b/app/.server/classes/Plugins/ShipSystems/ImpulseEngines.ts @@ -1,7 +1,7 @@ import { engineSpeeds, type EngineSpeed } from "@thorium/ecs-components/shipSystems/engineSpeeds"; import { sound, type Sound } from "@thorium/ecs-components/sound"; import type { KilometerPerSecond, KiloNewtons } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/InertialDampeners.ts b/app/.server/classes/Plugins/ShipSystems/InertialDampeners.ts index cd6127f5..a203c53c 100644 --- a/app/.server/classes/Plugins/ShipSystems/InertialDampeners.ts +++ b/app/.server/classes/Plugins/ShipSystems/InertialDampeners.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/LongRangeComm.ts b/app/.server/classes/Plugins/ShipSystems/LongRangeComm.ts index aa6500cf..4c403a80 100644 --- a/app/.server/classes/Plugins/ShipSystems/LongRangeComm.ts +++ b/app/.server/classes/Plugins/ShipSystems/LongRangeComm.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/MainComputer.ts b/app/.server/classes/Plugins/ShipSystems/MainComputer.ts index ace5427b..2ebb988b 100644 --- a/app/.server/classes/Plugins/ShipSystems/MainComputer.ts +++ b/app/.server/classes/Plugins/ShipSystems/MainComputer.ts @@ -1,5 +1,5 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/Navigation.ts b/app/.server/classes/Plugins/ShipSystems/Navigation.ts index 1fba6e17..3d1efe79 100644 --- a/app/.server/classes/Plugins/ShipSystems/Navigation.ts +++ b/app/.server/classes/Plugins/ShipSystems/Navigation.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/Phasers.ts b/app/.server/classes/Plugins/ShipSystems/Phasers.ts index 83005e16..e35e774b 100644 --- a/app/.server/classes/Plugins/ShipSystems/Phasers.ts +++ b/app/.server/classes/Plugins/ShipSystems/Phasers.ts @@ -1,5 +1,5 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/Reactor.ts b/app/.server/classes/Plugins/ShipSystems/Reactor.ts index 779b74cf..8141bcd8 100644 --- a/app/.server/classes/Plugins/ShipSystems/Reactor.ts +++ b/app/.server/classes/Plugins/ShipSystems/Reactor.ts @@ -1,5 +1,5 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/Sensors.ts b/app/.server/classes/Plugins/ShipSystems/Sensors.ts index f76ec13d..f379d050 100644 --- a/app/.server/classes/Plugins/ShipSystems/Sensors.ts +++ b/app/.server/classes/Plugins/ShipSystems/Sensors.ts @@ -1,5 +1,5 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/Shields.ts b/app/.server/classes/Plugins/ShipSystems/Shields.ts index 56e0ca4a..c7a9feac 100644 --- a/app/.server/classes/Plugins/ShipSystems/Shields.ts +++ b/app/.server/classes/Plugins/ShipSystems/Shields.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/ShortRangeComm.ts b/app/.server/classes/Plugins/ShipSystems/ShortRangeComm.ts index df0cbb72..15620a2e 100644 --- a/app/.server/classes/Plugins/ShipSystems/ShortRangeComm.ts +++ b/app/.server/classes/Plugins/ShipSystems/ShortRangeComm.ts @@ -1,5 +1,5 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/Targeting.ts b/app/.server/classes/Plugins/ShipSystems/Targeting.ts index 06d67bfe..c4b740af 100644 --- a/app/.server/classes/Plugins/ShipSystems/Targeting.ts +++ b/app/.server/classes/Plugins/ShipSystems/Targeting.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; import type { ShipSystemFlags } from "./shipSystemTypes"; diff --git a/app/.server/classes/Plugins/ShipSystems/Thrusters.ts b/app/.server/classes/Plugins/ShipSystems/Thrusters.ts index d2c2f895..136085f4 100644 --- a/app/.server/classes/Plugins/ShipSystems/Thrusters.ts +++ b/app/.server/classes/Plugins/ShipSystems/Thrusters.ts @@ -1,6 +1,6 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; import type { KiloNewtons, MetersPerSecond, RotationsPerMinute } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/TorpedoLauncher.ts b/app/.server/classes/Plugins/ShipSystems/TorpedoLauncher.ts index 7847dd7e..df077504 100644 --- a/app/.server/classes/Plugins/ShipSystems/TorpedoLauncher.ts +++ b/app/.server/classes/Plugins/ShipSystems/TorpedoLauncher.ts @@ -1,5 +1,5 @@ import { sound, type Sound } from "@thorium/ecs-components/sound"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/ShipSystems/warpEngines.ts b/app/.server/classes/Plugins/ShipSystems/warpEngines.ts index a3c70a3f..9ca22a99 100644 --- a/app/.server/classes/Plugins/ShipSystems/warpEngines.ts +++ b/app/.server/classes/Plugins/ShipSystems/warpEngines.ts @@ -1,6 +1,6 @@ import { engineSpeeds, type EngineSpeed } from "@thorium/ecs-components/shipSystems/engineSpeeds"; import type { KilometerPerSecond } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import BaseShipSystemPlugin, { baseShipSystemSchema, registerSystem } from "./BaseSystem"; diff --git a/app/.server/classes/Plugins/StationComplement.ts b/app/.server/classes/Plugins/StationComplement.ts index 12372fe9..fd103d42 100644 --- a/app/.server/classes/Plugins/StationComplement.ts +++ b/app/.server/classes/Plugins/StationComplement.ts @@ -1,6 +1,6 @@ import { panelElementTypes } from "@thorium/ecs-components/engineeringPanelTypes"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from "."; import type Station from "../Station"; diff --git a/app/.server/classes/Plugins/Theme.ts b/app/.server/classes/Plugins/Theme.ts index a2a1689f..e0a7c03c 100644 --- a/app/.server/classes/Plugins/Theme.ts +++ b/app/.server/classes/Plugins/Theme.ts @@ -1,5 +1,5 @@ import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; -import { z } from "zod"; +import z from "zod"; import { Aspect } from "./Aspect"; import type BasePlugin from "./index"; diff --git a/app/.server/classes/Plugins/Training.ts b/app/.server/classes/Plugins/Training.ts index 9fed4a46..cd0c5407 100644 --- a/app/.server/classes/Plugins/Training.ts +++ b/app/.server/classes/Plugins/Training.ts @@ -3,7 +3,7 @@ import type { TimelineBlock } from "@thorium/components/timelineBuilder/Timeline import { timelineBlock } from "@thorium/ecs-components/timelineBlocks"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; import uniqid from "@thorium/utils/uniqid"; -import { z } from "zod"; +import z from "zod"; import { Aspect } from "./Aspect"; import type BasePlugin from "./index"; diff --git a/app/.server/classes/Plugins/Universe/SolarSystem.ts b/app/.server/classes/Plugins/Universe/SolarSystem.ts index 70a391f7..c433d32a 100644 --- a/app/.server/classes/Plugins/Universe/SolarSystem.ts +++ b/app/.server/classes/Plugins/Universe/SolarSystem.ts @@ -6,7 +6,7 @@ import SystemNames from "@thorium/utils/flags/systemNames"; import { generateIncrementedName } from "@thorium/utils/generateIncrementedName"; import { randomFromList } from "@thorium/utils/operations/randomFromList"; import type { AstronomicalUnit, LightMinute } from "@thorium/utils/unitTypes"; -import { z } from "zod"; +import z from "zod"; import type BasePlugin from ".."; import { Aspect } from "../Aspect"; diff --git a/app/ecs-components/engineeringPanel.ts b/app/ecs-components/engineeringPanel.ts index ef609fbc..82b9b1ec 100644 --- a/app/ecs-components/engineeringPanel.ts +++ b/app/ecs-components/engineeringPanel.ts @@ -1,5 +1,5 @@ import { panelElementTypes } from "@thorium/ecs-components/engineeringPanelTypes"; -import { z } from "zod"; +import z from "zod"; export const isPanel = z.object({}).default({}); diff --git a/app/ecs-components/engineeringPanelTypes.ts b/app/ecs-components/engineeringPanelTypes.ts index d09ad8e5..6aa2fe9a 100644 --- a/app/ecs-components/engineeringPanelTypes.ts +++ b/app/ecs-components/engineeringPanelTypes.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import z from "zod"; export const panelElementTypes = z.enum([ "toggleButton", diff --git a/app/ecs-components/timelineBlocks.ts b/app/ecs-components/timelineBlocks.ts index 48b80a89..ba648935 100644 --- a/app/ecs-components/timelineBlocks.ts +++ b/app/ecs-components/timelineBlocks.ts @@ -1,3 +1,3 @@ -import { z } from "zod"; +import z from "zod"; export const timelineBlock = z.any(); diff --git a/app/routes/docs/Development/netRequests.md b/app/routes/docs/Development/netRequests.md index 89b6f963..66efabf1 100644 --- a/app/routes/docs/Development/netRequests.md +++ b/app/routes/docs/Development/netRequests.md @@ -40,7 +40,7 @@ Take a look at this example which includes both a request and a send: import { t } from "@thorium/.server/init/t"; import { pubsub } from "@thorium/.server/init/pubsub"; import { getShipSystem } from "@thorium/utils/.server/ship/getShipSystem"; -import { z } from "zod"; +import z from "zod"; export const pilot = t.router({ impulseEngines: t.router({ diff --git a/app/utils/.server/createMockDataContext.ts b/app/utils/.server/createMockDataContext.ts index a8604c5b..275391bb 100644 --- a/app/utils/.server/createMockDataContext.ts +++ b/app/utils/.server/createMockDataContext.ts @@ -1,5 +1,4 @@ import type { FlightDataModel } from "@thorium/.server/classes/FlightDataModel"; -import type BasePlugin from "@thorium/.server/classes/Plugins"; import ShipPlugin from "@thorium/.server/classes/Plugins/Ship"; import type { ServerDataModel } from "@thorium/.server/classes/ServerDataModel"; import type { DataContext } from "@thorium/.server/DataContext"; -- 2.54.0