From 432b5f613b444432bed9b6ea1b0f2cf6127ee29c Mon Sep 17 00:00:00 2001 From: d1rshan Date: Fri, 29 May 2026 18:24:28 +0530 Subject: [PATCH 1/3] organize --- apps/frontend/src/app/app.tsx | 6 +++--- apps/frontend/src/app/pages/home.tsx | 6 +++--- apps/frontend/src/app/pages/leaderboard.tsx | 6 +++--- apps/frontend/src/features/commandline/registry.ts | 6 +++--- .../{ => core}/components/difficulty-selector.tsx | 0 .../games/{ => core}/components/game-card.tsx | 2 +- .../games/{ => core}/components/game-input.tsx | 0 .../games/{ => core}/components/game-meta.tsx | 0 .../games/{ => core}/components/game-over.tsx | 0 .../games/{ => core}/components/game-selector.tsx | 4 ++-- .../games/{ => core}/components/game-stat.tsx | 0 apps/frontend/src/features/games/{ => core}/hooks.ts | 2 +- .../src/features/games/{ => core}/metrics.ts | 0 .../src/features/games/{ => core}/registry.ts | 2 +- apps/frontend/src/features/games/{ => core}/types.ts | 0 apps/frontend/src/features/games/{ => core}/utils.ts | 0 .../falling-words/components/falling-words-field.tsx | 2 +- .../falling-words/components/falling-words-hud.tsx | 2 +- .../src/features/games/falling-words/meta.ts | 2 +- .../src/features/games/falling-words/types.ts | 2 +- .../games/falling-words/use-falling-words-game.ts | 2 +- .../src/features/games/falling-words/view.tsx | 6 +++--- .../games/survival/components/survival-hud.tsx | 2 +- apps/frontend/src/features/games/survival/engine.ts | 6 +++--- apps/frontend/src/features/games/survival/meta.ts | 2 +- apps/frontend/src/features/games/survival/view.tsx | 12 ++++++------ .../features/users/pbs/components/personal-bests.tsx | 4 ++-- .../users/results/components/results-table.tsx | 2 +- 28 files changed, 39 insertions(+), 39 deletions(-) rename apps/frontend/src/features/games/{ => core}/components/difficulty-selector.tsx (100%) rename apps/frontend/src/features/games/{ => core}/components/game-card.tsx (94%) rename apps/frontend/src/features/games/{ => core}/components/game-input.tsx (100%) rename apps/frontend/src/features/games/{ => core}/components/game-meta.tsx (100%) rename apps/frontend/src/features/games/{ => core}/components/game-over.tsx (100%) rename apps/frontend/src/features/games/{ => core}/components/game-selector.tsx (86%) rename apps/frontend/src/features/games/{ => core}/components/game-stat.tsx (100%) rename apps/frontend/src/features/games/{ => core}/hooks.ts (92%) rename apps/frontend/src/features/games/{ => core}/metrics.ts (100%) rename apps/frontend/src/features/games/{ => core}/registry.ts (82%) rename apps/frontend/src/features/games/{ => core}/types.ts (100%) rename apps/frontend/src/features/games/{ => core}/utils.ts (100%) diff --git a/apps/frontend/src/app/app.tsx b/apps/frontend/src/app/app.tsx index e3d90e7..338936d 100644 --- a/apps/frontend/src/app/app.tsx +++ b/apps/frontend/src/app/app.tsx @@ -1,14 +1,14 @@ import { createEffect, createMemo } from "solid-js"; import { Router, Route, useNavigate, useSearchParams } from "@solidjs/router"; -import { games } from "@/features/games/registry"; -import { getHomeGamePath } from "@/features/games/utils"; +import { games } from "@/features/games/core/registry"; +import { getHomeGamePath } from "@/features/games/core/utils"; import AboutPage from "@/app/pages/about"; import AdminPage from "@/app/pages/admin"; import HomePage from "@/app/pages/home"; import Layout from "@/app/layout"; import LeaderboardPage from "@/app/pages/leaderboard"; import ProfilePage from "@/app/pages/profile"; -import type { GameId } from "@/features/games/types"; +import type { GameId } from "@/features/games/core/types"; import type { WordBankId } from "@/features/content/word-banks/types"; function App() { diff --git a/apps/frontend/src/app/pages/home.tsx b/apps/frontend/src/app/pages/home.tsx index cae0271..2361b0b 100644 --- a/apps/frontend/src/app/pages/home.tsx +++ b/apps/frontend/src/app/pages/home.tsx @@ -1,10 +1,10 @@ import { createMemo } from "solid-js"; import { Dynamic } from "solid-js/web"; -import GameSelector from "@/features/games/components/game-selector"; +import GameSelector from "@/features/games/core/components/game-selector"; import { FeedbackFeed } from "@/features/feedback/components/feedback-feed"; -import { games } from "@/features/games/registry"; -import type { GameId } from "@/features/games/types"; +import { games } from "@/features/games/core/registry"; +import type { GameId } from "@/features/games/core/types"; import type { WordBankId } from "@/features/content/word-banks/types"; type HomeProps = { diff --git a/apps/frontend/src/app/pages/leaderboard.tsx b/apps/frontend/src/app/pages/leaderboard.tsx index a9845e4..57e254b 100644 --- a/apps/frontend/src/app/pages/leaderboard.tsx +++ b/apps/frontend/src/app/pages/leaderboard.tsx @@ -1,10 +1,10 @@ import { For, createSignal } from "solid-js"; -import { gameRegistry } from "@/features/games/registry"; +import { gameRegistry } from "@/features/games/core/registry"; import type { LeaderboardDifficulty } from "@/features/leaderboard/types"; import { LeaderboardTable } from "@/features/leaderboard/components/leaderboard-table"; -import { getGameName } from "@/features/games/utils"; -import type { GameId } from "@/features/games/types"; +import { getGameName } from "@/features/games/core/utils"; +import type { GameId } from "@/features/games/core/types"; const difficulties: LeaderboardDifficulty[] = ["easy", "medium", "hard"]; diff --git a/apps/frontend/src/features/commandline/registry.ts b/apps/frontend/src/features/commandline/registry.ts index 2579e77..0d44ce3 100644 --- a/apps/frontend/src/features/commandline/registry.ts +++ b/apps/frontend/src/features/commandline/registry.ts @@ -2,14 +2,14 @@ import { useNavigate, useLocation, useSearchParams } from "@solidjs/router"; import { themes } from "@/features/content/themes/registry"; import { wordBanks } from "@/features/content/word-banks/registry"; import type { WordBankId } from "@/features/content/word-banks/types"; -import { gameRegistry } from "@/features/games/registry"; -import { getHomeGamePath } from "@/features/games/utils"; +import { gameRegistry } from "@/features/games/core/registry"; +import { getHomeGamePath } from "@/features/games/core/utils"; import type { ThemeName } from "@/features/content/themes/types"; import type { CommandlineItem, CommandlineScope, } from "@/features/commandline/types"; -import type { GameId } from "@/features/games/types"; +import type { GameId } from "@/features/games/core/types"; import { themeManager } from "@/features/content/themes/manager"; import { useAuthSession } from "@/features/auth/hooks"; diff --git a/apps/frontend/src/features/games/components/difficulty-selector.tsx b/apps/frontend/src/features/games/core/components/difficulty-selector.tsx similarity index 100% rename from apps/frontend/src/features/games/components/difficulty-selector.tsx rename to apps/frontend/src/features/games/core/components/difficulty-selector.tsx diff --git a/apps/frontend/src/features/games/components/game-card.tsx b/apps/frontend/src/features/games/core/components/game-card.tsx similarity index 94% rename from apps/frontend/src/features/games/components/game-card.tsx rename to apps/frontend/src/features/games/core/components/game-card.tsx index 0b610f5..2f5e956 100644 --- a/apps/frontend/src/features/games/components/game-card.tsx +++ b/apps/frontend/src/features/games/core/components/game-card.tsx @@ -1,5 +1,5 @@ import { ArrowRight } from "lucide-solid"; -import type { GameId } from "@/features/games/types"; +import type { GameId } from "../types"; type GameCardProps = { name: string; diff --git a/apps/frontend/src/features/games/components/game-input.tsx b/apps/frontend/src/features/games/core/components/game-input.tsx similarity index 100% rename from apps/frontend/src/features/games/components/game-input.tsx rename to apps/frontend/src/features/games/core/components/game-input.tsx diff --git a/apps/frontend/src/features/games/components/game-meta.tsx b/apps/frontend/src/features/games/core/components/game-meta.tsx similarity index 100% rename from apps/frontend/src/features/games/components/game-meta.tsx rename to apps/frontend/src/features/games/core/components/game-meta.tsx diff --git a/apps/frontend/src/features/games/components/game-over.tsx b/apps/frontend/src/features/games/core/components/game-over.tsx similarity index 100% rename from apps/frontend/src/features/games/components/game-over.tsx rename to apps/frontend/src/features/games/core/components/game-over.tsx diff --git a/apps/frontend/src/features/games/components/game-selector.tsx b/apps/frontend/src/features/games/core/components/game-selector.tsx similarity index 86% rename from apps/frontend/src/features/games/components/game-selector.tsx rename to apps/frontend/src/features/games/core/components/game-selector.tsx index 43adc5d..e091469 100644 --- a/apps/frontend/src/features/games/components/game-selector.tsx +++ b/apps/frontend/src/features/games/core/components/game-selector.tsx @@ -1,6 +1,6 @@ import { For } from "solid-js"; -import { gameRegistry } from "@/features/games/registry"; -import type { GameId } from "@/features/games/types"; +import { gameRegistry } from "../registry"; +import type { GameId } from "../types"; import { GameCard } from "./game-card"; type GameSelectorProps = { diff --git a/apps/frontend/src/features/games/components/game-stat.tsx b/apps/frontend/src/features/games/core/components/game-stat.tsx similarity index 100% rename from apps/frontend/src/features/games/components/game-stat.tsx rename to apps/frontend/src/features/games/core/components/game-stat.tsx diff --git a/apps/frontend/src/features/games/hooks.ts b/apps/frontend/src/features/games/core/hooks.ts similarity index 92% rename from apps/frontend/src/features/games/hooks.ts rename to apps/frontend/src/features/games/core/hooks.ts index 5a562e6..48ed5c2 100644 --- a/apps/frontend/src/features/games/hooks.ts +++ b/apps/frontend/src/features/games/core/hooks.ts @@ -1,7 +1,7 @@ import { useAuthSession } from "@/features/auth/hooks"; import { useCreateResultMutation } from "@/features/users/results/api"; import { toast } from "@/lib/toast"; -import type { DifficultyKey } from "@/features/games/types"; +import type { DifficultyKey } from "./types"; export function useSubmitGameResult(minScores: Record) { const auth = useAuthSession(); diff --git a/apps/frontend/src/features/games/metrics.ts b/apps/frontend/src/features/games/core/metrics.ts similarity index 100% rename from apps/frontend/src/features/games/metrics.ts rename to apps/frontend/src/features/games/core/metrics.ts diff --git a/apps/frontend/src/features/games/registry.ts b/apps/frontend/src/features/games/core/registry.ts similarity index 82% rename from apps/frontend/src/features/games/registry.ts rename to apps/frontend/src/features/games/core/registry.ts index 1d99fe4..4b067bc 100644 --- a/apps/frontend/src/features/games/registry.ts +++ b/apps/frontend/src/features/games/core/registry.ts @@ -1,6 +1,6 @@ import { meta as fallingWordsGame } from "@/features/games/falling-words"; import { meta as survivalGame } from "@/features/games/survival"; -import type { GameId, GameModule } from "@/features/games/types"; +import type { GameId, GameModule } from "./types"; export const games: Record = { "falling-words": fallingWordsGame, diff --git a/apps/frontend/src/features/games/types.ts b/apps/frontend/src/features/games/core/types.ts similarity index 100% rename from apps/frontend/src/features/games/types.ts rename to apps/frontend/src/features/games/core/types.ts diff --git a/apps/frontend/src/features/games/utils.ts b/apps/frontend/src/features/games/core/utils.ts similarity index 100% rename from apps/frontend/src/features/games/utils.ts rename to apps/frontend/src/features/games/core/utils.ts diff --git a/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx b/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx index c188beb..4ea6292 100644 --- a/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx +++ b/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx @@ -1,6 +1,6 @@ import { For } from "solid-js"; import { Kbd } from "@/components/ui/kbd"; -import type { GamePhase } from "@/features/games/types"; +import type { GamePhase } from "@/features/games/core/types"; import type { FallingWord } from "../types"; type FallingWordsFieldProps = { diff --git a/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx b/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx index d6781e6..cd0a020 100644 --- a/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx +++ b/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx @@ -1,4 +1,4 @@ -import { GameStat } from "@/features/games/components/game-stat"; +import { GameStat } from "@/features/games/core/components/game-stat"; export type FallingWordsHudProps = { score: number; diff --git a/apps/frontend/src/features/games/falling-words/meta.ts b/apps/frontend/src/features/games/falling-words/meta.ts index 613c6e9..c28e713 100644 --- a/apps/frontend/src/features/games/falling-words/meta.ts +++ b/apps/frontend/src/features/games/falling-words/meta.ts @@ -1,4 +1,4 @@ -import type { GameModule } from "@/features/games/types"; +import type { GameModule } from "@/features/games/core/types"; import FallingWordsView from "./view"; export const meta: GameModule = { diff --git a/apps/frontend/src/features/games/falling-words/types.ts b/apps/frontend/src/features/games/falling-words/types.ts index b42623d..4c79ddc 100644 --- a/apps/frontend/src/features/games/falling-words/types.ts +++ b/apps/frontend/src/features/games/falling-words/types.ts @@ -1,4 +1,4 @@ -import type { DifficultyKey } from "@/features/games/types"; +import type { DifficultyKey } from "@/features/games/core/types"; export type DifficultyConfig = { spawnIntervalMs: number; diff --git a/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts b/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts index 2141996..823eeec 100644 --- a/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts +++ b/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts @@ -7,7 +7,7 @@ import { } from "solid-js"; import { getWordBank } from "@/features/content/word-banks/manager"; import type { WordBankId } from "@/features/content/word-banks/types"; -import type { DifficultyKey, GamePhase } from "@/features/games/types"; +import type { DifficultyKey, GamePhase } from "@/features/games/core/types"; import type { DifficultyConfig, FallingWord, diff --git a/apps/frontend/src/features/games/falling-words/view.tsx b/apps/frontend/src/features/games/falling-words/view.tsx index 363fc26..0d30b4d 100644 --- a/apps/frontend/src/features/games/falling-words/view.tsx +++ b/apps/frontend/src/features/games/falling-words/view.tsx @@ -1,10 +1,10 @@ import { Show } from "solid-js"; import { useAuthSession } from "@/features/auth/hooks"; -import type { GameViewProps } from "@/features/games/types"; +import type { GameViewProps } from "@/features/games/core/types"; import { useCreateResultMutation } from "@/features/users/results/api"; import { toast } from "@/lib/toast"; -import { DifficultySelector } from "../components/difficulty-selector"; -import { GameMeta } from "../components/game-meta"; +import { DifficultySelector } from "../core/components/difficulty-selector"; +import { GameMeta } from "../core/components/game-meta"; import FallingWordsField from "./components/falling-words-field"; import { FallingWordsHud as Hud } from "./components/falling-words-hud"; import { useFallingWordsGame } from "./use-falling-words-game"; diff --git a/apps/frontend/src/features/games/survival/components/survival-hud.tsx b/apps/frontend/src/features/games/survival/components/survival-hud.tsx index 96d7d8c..45c50fb 100644 --- a/apps/frontend/src/features/games/survival/components/survival-hud.tsx +++ b/apps/frontend/src/features/games/survival/components/survival-hud.tsx @@ -1,6 +1,6 @@ import { Index } from "solid-js"; import { Heart } from "./heart"; -import { GameStat } from "@/features/games/components/game-stat"; +import { GameStat } from "@/features/games/core/components/game-stat"; export type SurvivalHudProps = { health: number; diff --git a/apps/frontend/src/features/games/survival/engine.ts b/apps/frontend/src/features/games/survival/engine.ts index e49690f..f44b734 100644 --- a/apps/frontend/src/features/games/survival/engine.ts +++ b/apps/frontend/src/features/games/survival/engine.ts @@ -2,9 +2,9 @@ import { createMemo, onCleanup, createEffect } from "solid-js"; import { createStore } from "solid-js/store"; import { getWordBank } from "@/features/content/word-banks/manager"; import type { WordBankId } from "@/features/content/word-banks/types"; -import type { DifficultyKey, GamePhase } from "@/features/games/types"; -import { getMetrics } from "@/features/games/metrics"; -import { randomWord } from "@/features/games/utils"; +import type { DifficultyKey, GamePhase } from "@/features/games/core/types"; +import { getMetrics } from "@/features/games/core/metrics"; +import { randomWord } from "@/features/games/core/utils"; const WORD_BATCH = 50; const WORD_REFILL_THRESHOLD = 20; diff --git a/apps/frontend/src/features/games/survival/meta.ts b/apps/frontend/src/features/games/survival/meta.ts index 4746e67..27b2f2d 100644 --- a/apps/frontend/src/features/games/survival/meta.ts +++ b/apps/frontend/src/features/games/survival/meta.ts @@ -1,4 +1,4 @@ -import type { GameModule } from "@/features/games/types"; +import type { GameModule } from "@/features/games/core/types"; import View from "./view"; export const meta: GameModule = { diff --git a/apps/frontend/src/features/games/survival/view.tsx b/apps/frontend/src/features/games/survival/view.tsx index 2eb5ba9..009321a 100644 --- a/apps/frontend/src/features/games/survival/view.tsx +++ b/apps/frontend/src/features/games/survival/view.tsx @@ -1,14 +1,14 @@ import { Show } from "solid-js"; -import type { GameViewProps } from "@/features/games/types"; +import type { GameViewProps } from "@/features/games/core/types"; import { meta } from "./meta"; import { useEngine } from "./engine"; -import { useSubmitGameResult } from "@/features/games/hooks"; -import { DifficultySelector } from "../components/difficulty-selector"; +import { useSubmitGameResult } from "@/features/games/core/hooks"; +import { DifficultySelector } from "../core/components/difficulty-selector"; import { SurvivalHud as Hud } from "./components/survival-hud"; import { Words } from "./components/words"; -import { GameOver } from "@/features/games/components/game-over"; -import { GameInput } from "../components/game-input"; -import { GameMeta } from "../components/game-meta"; +import { GameOver } from "@/features/games/core/components/game-over"; +import { GameInput } from "../core/components/game-input"; +import { GameMeta } from "../core/components/game-meta"; import "./animations.css"; diff --git a/apps/frontend/src/features/users/pbs/components/personal-bests.tsx b/apps/frontend/src/features/users/pbs/components/personal-bests.tsx index 2c2417a..0ea8258 100644 --- a/apps/frontend/src/features/users/pbs/components/personal-bests.tsx +++ b/apps/frontend/src/features/users/pbs/components/personal-bests.tsx @@ -1,7 +1,7 @@ import { For } from "solid-js"; -import { gameRegistry } from "@/features/games/registry"; -import type { DifficultyKey } from "@/features/games/types"; +import { gameRegistry } from "@/features/games/core/registry"; +import type { DifficultyKey } from "@/features/games/core/types"; import { formatDateTime } from "@/lib/utils"; import type { UserPBs } from "../types"; diff --git a/apps/frontend/src/features/users/results/components/results-table.tsx b/apps/frontend/src/features/users/results/components/results-table.tsx index ebde059..3d8af4a 100644 --- a/apps/frontend/src/features/users/results/components/results-table.tsx +++ b/apps/frontend/src/features/users/results/components/results-table.tsx @@ -1,5 +1,5 @@ import { Table, type TableColumn } from "@/components/table"; -import { getGameName } from "@/features/games/utils"; +import { getGameName } from "@/features/games/core/utils"; import type { Result } from "../types"; function formatResultsDateTime(value: string | Date) { From 0ac36872811567d834bdb130516303d08ab86c5e Mon Sep 17 00:00:00 2001 From: d1rshan Date: Fri, 29 May 2026 18:28:23 +0530 Subject: [PATCH 2/3] cleanup imports --- .../features/games/core/components/game-card.tsx | 1 + .../games/core/components/game-selector.tsx | 1 + apps/frontend/src/features/games/core/registry.ts | 4 ++-- .../components/falling-words-field.tsx | 4 +++- .../falling-words/components/falling-words-hud.tsx | 2 +- .../src/features/games/falling-words/meta.ts | 2 +- .../src/features/games/falling-words/types.ts | 2 +- .../games/falling-words/use-falling-words-game.ts | 4 +++- .../src/features/games/falling-words/view.tsx | 4 +++- .../games/survival/components/survival-hud.tsx | 2 +- apps/frontend/src/features/games/survival/engine.ts | 8 +++++--- apps/frontend/src/features/games/survival/meta.ts | 2 +- apps/frontend/src/features/games/survival/view.tsx | 13 +++++++------ 13 files changed, 30 insertions(+), 19 deletions(-) diff --git a/apps/frontend/src/features/games/core/components/game-card.tsx b/apps/frontend/src/features/games/core/components/game-card.tsx index 2f5e956..9cd1ff0 100644 --- a/apps/frontend/src/features/games/core/components/game-card.tsx +++ b/apps/frontend/src/features/games/core/components/game-card.tsx @@ -1,4 +1,5 @@ import { ArrowRight } from "lucide-solid"; + import type { GameId } from "../types"; type GameCardProps = { diff --git a/apps/frontend/src/features/games/core/components/game-selector.tsx b/apps/frontend/src/features/games/core/components/game-selector.tsx index e091469..4d3e2aa 100644 --- a/apps/frontend/src/features/games/core/components/game-selector.tsx +++ b/apps/frontend/src/features/games/core/components/game-selector.tsx @@ -1,4 +1,5 @@ import { For } from "solid-js"; + import { gameRegistry } from "../registry"; import type { GameId } from "../types"; import { GameCard } from "./game-card"; diff --git a/apps/frontend/src/features/games/core/registry.ts b/apps/frontend/src/features/games/core/registry.ts index 4b067bc..059a53d 100644 --- a/apps/frontend/src/features/games/core/registry.ts +++ b/apps/frontend/src/features/games/core/registry.ts @@ -1,5 +1,5 @@ -import { meta as fallingWordsGame } from "@/features/games/falling-words"; -import { meta as survivalGame } from "@/features/games/survival"; +import { meta as fallingWordsGame } from "../falling-words"; +import { meta as survivalGame } from "../survival"; import type { GameId, GameModule } from "./types"; export const games: Record = { diff --git a/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx b/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx index 4ea6292..9d97fd3 100644 --- a/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx +++ b/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx @@ -1,6 +1,8 @@ import { For } from "solid-js"; + import { Kbd } from "@/components/ui/kbd"; -import type { GamePhase } from "@/features/games/core/types"; + +import type { GamePhase } from "../core/types"; import type { FallingWord } from "../types"; type FallingWordsFieldProps = { diff --git a/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx b/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx index cd0a020..8052da2 100644 --- a/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx +++ b/apps/frontend/src/features/games/falling-words/components/falling-words-hud.tsx @@ -1,4 +1,4 @@ -import { GameStat } from "@/features/games/core/components/game-stat"; +import { GameStat } from "../../core/components/game-stat"; export type FallingWordsHudProps = { score: number; diff --git a/apps/frontend/src/features/games/falling-words/meta.ts b/apps/frontend/src/features/games/falling-words/meta.ts index c28e713..462f9c9 100644 --- a/apps/frontend/src/features/games/falling-words/meta.ts +++ b/apps/frontend/src/features/games/falling-words/meta.ts @@ -1,4 +1,4 @@ -import type { GameModule } from "@/features/games/core/types"; +import type { GameModule } from "../core/types"; import FallingWordsView from "./view"; export const meta: GameModule = { diff --git a/apps/frontend/src/features/games/falling-words/types.ts b/apps/frontend/src/features/games/falling-words/types.ts index 4c79ddc..3a6cf30 100644 --- a/apps/frontend/src/features/games/falling-words/types.ts +++ b/apps/frontend/src/features/games/falling-words/types.ts @@ -1,4 +1,4 @@ -import type { DifficultyKey } from "@/features/games/core/types"; +import type { DifficultyKey } from "../core/types"; export type DifficultyConfig = { spawnIntervalMs: number; diff --git a/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts b/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts index 823eeec..79e56d1 100644 --- a/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts +++ b/apps/frontend/src/features/games/falling-words/use-falling-words-game.ts @@ -5,9 +5,11 @@ import { onCleanup, onMount, } from "solid-js"; + import { getWordBank } from "@/features/content/word-banks/manager"; import type { WordBankId } from "@/features/content/word-banks/types"; -import type { DifficultyKey, GamePhase } from "@/features/games/core/types"; + +import type { DifficultyKey, GamePhase } from "../core/types"; import type { DifficultyConfig, FallingWord, diff --git a/apps/frontend/src/features/games/falling-words/view.tsx b/apps/frontend/src/features/games/falling-words/view.tsx index 0d30b4d..ed88ccd 100644 --- a/apps/frontend/src/features/games/falling-words/view.tsx +++ b/apps/frontend/src/features/games/falling-words/view.tsx @@ -1,8 +1,10 @@ import { Show } from "solid-js"; + import { useAuthSession } from "@/features/auth/hooks"; -import type { GameViewProps } from "@/features/games/core/types"; import { useCreateResultMutation } from "@/features/users/results/api"; import { toast } from "@/lib/toast"; + +import type { GameViewProps } from "../core/types"; import { DifficultySelector } from "../core/components/difficulty-selector"; import { GameMeta } from "../core/components/game-meta"; import FallingWordsField from "./components/falling-words-field"; diff --git a/apps/frontend/src/features/games/survival/components/survival-hud.tsx b/apps/frontend/src/features/games/survival/components/survival-hud.tsx index 45c50fb..15ceba3 100644 --- a/apps/frontend/src/features/games/survival/components/survival-hud.tsx +++ b/apps/frontend/src/features/games/survival/components/survival-hud.tsx @@ -1,6 +1,6 @@ import { Index } from "solid-js"; import { Heart } from "./heart"; -import { GameStat } from "@/features/games/core/components/game-stat"; +import { GameStat } from "../../core/components/game-stat"; export type SurvivalHudProps = { health: number; diff --git a/apps/frontend/src/features/games/survival/engine.ts b/apps/frontend/src/features/games/survival/engine.ts index f44b734..36c1c07 100644 --- a/apps/frontend/src/features/games/survival/engine.ts +++ b/apps/frontend/src/features/games/survival/engine.ts @@ -1,10 +1,12 @@ import { createMemo, onCleanup, createEffect } from "solid-js"; import { createStore } from "solid-js/store"; + import { getWordBank } from "@/features/content/word-banks/manager"; import type { WordBankId } from "@/features/content/word-banks/types"; -import type { DifficultyKey, GamePhase } from "@/features/games/core/types"; -import { getMetrics } from "@/features/games/core/metrics"; -import { randomWord } from "@/features/games/core/utils"; + +import type { DifficultyKey, GamePhase } from "../core/types"; +import { getMetrics } from "../core/metrics"; +import { randomWord } from "../core/utils"; const WORD_BATCH = 50; const WORD_REFILL_THRESHOLD = 20; diff --git a/apps/frontend/src/features/games/survival/meta.ts b/apps/frontend/src/features/games/survival/meta.ts index 27b2f2d..0fc9fdb 100644 --- a/apps/frontend/src/features/games/survival/meta.ts +++ b/apps/frontend/src/features/games/survival/meta.ts @@ -1,4 +1,4 @@ -import type { GameModule } from "@/features/games/core/types"; +import type { GameModule } from "../core/types"; import View from "./view"; export const meta: GameModule = { diff --git a/apps/frontend/src/features/games/survival/view.tsx b/apps/frontend/src/features/games/survival/view.tsx index 009321a..b3cea16 100644 --- a/apps/frontend/src/features/games/survival/view.tsx +++ b/apps/frontend/src/features/games/survival/view.tsx @@ -1,14 +1,15 @@ import { Show } from "solid-js"; -import type { GameViewProps } from "@/features/games/core/types"; + +import type { GameViewProps } from "../core/types"; +import { useSubmitGameResult } from "../core/hooks"; +import { DifficultySelector } from "../core/components/difficulty-selector"; +import { GameOver } from "../core/components/game-over"; +import { GameInput } from "../core/components/game-input"; +import { GameMeta } from "../core/components/game-meta"; import { meta } from "./meta"; import { useEngine } from "./engine"; -import { useSubmitGameResult } from "@/features/games/core/hooks"; -import { DifficultySelector } from "../core/components/difficulty-selector"; import { SurvivalHud as Hud } from "./components/survival-hud"; import { Words } from "./components/words"; -import { GameOver } from "@/features/games/core/components/game-over"; -import { GameInput } from "../core/components/game-input"; -import { GameMeta } from "../core/components/game-meta"; import "./animations.css"; From b35f0938a7e0b416769c9be1bfe96ff3b3f575c4 Mon Sep 17 00:00:00 2001 From: d1rshan Date: Fri, 29 May 2026 18:32:07 +0530 Subject: [PATCH 3/3] fix import --- .../games/falling-words/components/falling-words-field.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx b/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx index 9d97fd3..5ea9b6c 100644 --- a/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx +++ b/apps/frontend/src/features/games/falling-words/components/falling-words-field.tsx @@ -2,7 +2,7 @@ import { For } from "solid-js"; import { Kbd } from "@/components/ui/kbd"; -import type { GamePhase } from "../core/types"; +import type { GamePhase } from "../../core/types"; import type { FallingWord } from "../types"; type FallingWordsFieldProps = {