fix(manavoxel): rename inventory.ts to .svelte.ts for $state runes support

$state() is Svelte 5 runes syntax that only works in .svelte or .svelte.ts
files. The Inventory class used $state for reactive slots/heldSlot which
caused "ReferenceError: $state is not defined" in production builds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-03-29 15:08:59 +02:00
parent 08744cd6fd
commit 13cbdf027b
5 changed files with 4 additions and 4 deletions

View file

@ -1,5 +1,5 @@
<script lang="ts">
import { type Inventory, type GameItem, MAX_INVENTORY_SLOTS } from '$lib/engine/inventory';
import { type Inventory, type GameItem, MAX_INVENTORY_SLOTS } from '$lib/engine/inventory.svelte';
let {
inventory,

View file

@ -1,5 +1,5 @@
<script lang="ts">
import type { GameItem } from '$lib/engine/inventory';
import type { GameItem } from '$lib/engine/inventory.svelte';
import type { ElementType, Rarity } from '@manavoxel/shared';
let {

View file

@ -7,7 +7,7 @@ import { ParticleSystem } from './particles';
import { AreaManager, generateDemoStreet, generateDemoInterior } from './area-manager';
import { UndoStack, brushStroke, floodFill, pipette, type ToolType } from '$lib/editor/tools';
import { DEFAULT_MATERIALS, MATERIAL_AIR, type Material } from '@manavoxel/shared';
import type { Inventory } from './inventory';
import type { Inventory } from './inventory.svelte';
export class GameEngine {
app: Application;

View file

@ -8,7 +8,7 @@
import InventoryUI from '$lib/components/Inventory.svelte';
import PropertyPanel from '$lib/editor/property-panel.svelte';
import TriggerEditor from '$lib/editor/trigger-editor.svelte';
import { Inventory, createItem, type GameItem } from '$lib/engine/inventory';
import { Inventory, createItem, type GameItem } from '$lib/engine/inventory.svelte';
import { gameStore } from '$lib/data/local-store';
import { loadWorld, getAllWorlds } from '$lib/data/world-loader';