From e9676ada18c40e1707ec1afeeb3cf17690d198b4 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 24 May 2025 19:58:40 +0300 Subject: [PATCH] Refactor away in-game-lists barrel file Closes #2322 --- app/components/AbilitiesSelector.tsx | 2 +- app/components/BuildCard.tsx | 2 +- app/components/Combobox.tsx | 10 ++-- app/components/Image.tsx | 2 +- app/components/MapPoolSelector.tsx | 9 +-- app/constants.ts | 2 +- app/db/seed/index.ts | 22 +++---- app/db/tables.ts | 2 +- .../build-analyzer/analyzer-constants.ts | 2 +- app/features/build-analyzer/analyzer-hooks.ts | 16 ++--- app/features/build-analyzer/analyzer-types.ts | 2 +- .../components/PerInkTankGrid.tsx | 2 +- .../core/abilityChunksCalc.test.ts | 2 +- .../build-analyzer/core/abilityChunksCalc.ts | 10 ++-- .../build-analyzer/core/stats.test.ts | 3 +- app/features/build-analyzer/core/stats.ts | 18 +++--- app/features/build-analyzer/core/utils.ts | 6 +- .../build-analyzer/routes/analyzer.tsx | 16 ++--- app/features/build-stats/build-stats-utils.ts | 3 +- .../queries/abilitiesByWeaponId.server.ts | 2 +- .../queries/averageAbilityPoints.server.ts | 2 +- app/features/builds/BuildRepository.server.ts | 10 ++-- app/features/builds/builds-types.ts | 2 +- .../builds/components/FilterSection.tsx | 10 ++-- .../builds/core/ability-sorting.server.ts | 10 ++-- .../builds/core/cached-builds.server.ts | 2 +- app/features/builds/core/filter.server.ts | 5 +- app/features/builds/core/filter.test.ts | 2 +- .../builds/loaders/builds.$slug.server.ts | 2 +- .../builds/queries/buildsBy.server.ts | 3 +- app/features/builds/routes/builds.tsx | 7 ++- app/features/calendar/routes/calendar.new.tsx | 2 +- .../leaderboards/core/leaderboards.server.ts | 4 +- .../leaderboards/leaderboards-constants.ts | 5 +- .../loaders/leaderboards.server.ts | 4 +- .../queries/XPLeaderboard.server.ts | 2 +- .../seasonPopularUsersWeapon.server.ts | 2 +- .../leaderboards/routes/leaderboards.tsx | 2 +- app/features/lfg/components/LFGFilters.tsx | 2 +- app/features/lfg/core/filtering.ts | 2 +- app/features/lfg/lfg-types.ts | 2 +- .../core/map-list-generator/map-list.ts | 2 +- .../core/map-list-generator/modes.ts | 2 +- .../core/map-list-generator/utils.ts | 2 +- .../core/map-pool-serializer/serializer.ts | 8 +-- .../core/map-pool-serializer/types.ts | 5 +- .../map-list-generator/core/map-pool.ts | 7 +-- .../map-list-generator/routes/maps.tsx | 3 +- .../map-planner/components/Planner.tsx | 8 +-- .../calculator-constants.ts | 3 +- .../calculator-hooks.ts | 2 +- .../core/objectDamage.test.ts | 12 ++-- .../core/objectDamage.ts | 2 +- .../core/objectHitPoints.ts | 2 +- .../routes/object-damage-calculator.tsx | 2 +- .../sendouq-match/core/match.server.test.ts | 2 +- .../sendouq-match/core/match.server.ts | 4 +- .../core/reported-weapons.server.test.ts | 2 +- .../core/reported-weapons.server.ts | 2 +- .../queries/addReportedWeapons.server.ts | 2 +- .../sendouq-match/routes/q.match.$id.tsx | 2 +- .../QSettingsRepository.server.ts | 2 +- app/features/sendouq-settings/banned-maps.ts | 2 +- .../components/ModeMapPoolPicker.tsx | 4 +- .../q-settings-schemas.server.ts | 2 +- .../sendouq-settings/routes/q.settings.tsx | 2 +- app/features/sendouq/components/GroupCard.tsx | 2 +- app/features/sendouq/core/groups.server.ts | 2 +- app/features/sendouq/q-hooks.ts | 2 +- app/features/sendouq/q-types.ts | 2 +- app/features/sendouq/q-utils.ts | 2 +- .../queries/seasonMatchesByUserId.server.ts | 2 +- .../seasonReportedWeaponsByUserId.server.ts | 2 +- .../queries/seasonStagesByUserId.server.ts | 2 +- .../queries/weaponUsageStats.server.ts | 6 +- app/features/sendouq/routes/q.looking.test.ts | 2 +- .../top-search/loaders/xsearch.server.ts | 2 +- app/features/top-search/routes/xsearch.tsx | 2 +- .../components/BracketMapListDialog.tsx | 2 +- .../components/MatchActionsBanPicker.tsx | 7 +-- .../components/StartedMatch.tsx | 2 +- .../tournament-bracket/core/PickBan.ts | 2 +- .../tournament-bracket/core/Tournament.ts | 2 +- .../tournament-bracket/core/mapList.server.ts | 2 +- .../tournament-bracket/core/toMapList.ts | 2 +- .../allMatchResultsByTournamentId.server.ts | 2 +- .../tournament-bracket-utils.ts | 2 +- .../queries/findSubsByTournamentId.server.ts | 2 +- .../routes/to.$id.subs.new.tsx | 2 +- .../tournament-subs-schemas.server.ts | 2 +- .../tournament/TournamentRepository.server.ts | 2 +- app/features/tournament/core/sets.server.ts | 2 +- .../queries/setHistoryByTeamId.server.ts | 2 +- app/features/tournament/tournament-utils.ts | 2 +- .../u.$identifier.builds.new.server.ts | 4 +- .../core/build-sorting.server.test.ts | 2 +- .../user-page/core/build-sorting.server.ts | 3 +- .../u.$identifier.builds.new.server.ts | 2 +- .../loaders/u.$identifier.builds.server.ts | 2 +- .../routes/u.$identifier.builds.new.tsx | 2 +- .../user-page/routes/u.$identifier.builds.tsx | 4 +- .../routes/u.$identifier.edit.test.ts | 2 +- .../user-page/routes/u.$identifier.edit.tsx | 2 +- .../user-page/routes/u.$identifier.index.tsx | 2 +- .../routes/u.$identifier.seasons.tsx | 7 +-- app/features/vods/queries/findVods.server.ts | 6 +- app/features/vods/routes/vods.new.tsx | 8 +-- app/features/vods/routes/vods.tsx | 4 +- app/features/vods/vods-types.ts | 2 +- app/hooks/swr.ts | 2 +- app/modules/in-game-lists/index.ts | 59 ------------------- .../constants.ts | 4 +- .../generation.test.ts | 2 +- .../starter-map.ts | 4 +- .../tournament-map-list.ts | 3 +- .../tournament-map-list-generator/types.ts | 2 +- app/utils/unslugify.server.ts | 2 +- app/utils/urls.ts | 3 +- app/utils/zod.ts | 8 ++- e2e/tournament.spec.ts | 2 +- scripts/create-analyzer-json.ts | 7 ++- scripts/create-misc-json.ts | 2 +- scripts/create-object-dmg-json.ts | 2 +- scripts/map-popularity-q.ts | 5 +- scripts/map-popularity.ts | 5 +- scripts/placements/index.ts | 3 +- 126 files changed, 251 insertions(+), 282 deletions(-) delete mode 100644 app/modules/in-game-lists/index.ts diff --git a/app/components/AbilitiesSelector.tsx b/app/components/AbilitiesSelector.tsx index 340adc644..9437d2de5 100644 --- a/app/components/AbilitiesSelector.tsx +++ b/app/components/AbilitiesSelector.tsx @@ -1,6 +1,6 @@ import clsx from "clsx"; import * as React from "react"; -import { abilities } from "~/modules/in-game-lists"; +import { abilities } from "~/modules/in-game-lists/abilities"; import type { BuildAbilitiesTupleWithUnknown } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { abilityImageUrl } from "~/utils/urls"; diff --git a/app/components/BuildCard.tsx b/app/components/BuildCard.tsx index 2499345b0..678257daf 100644 --- a/app/components/BuildCard.tsx +++ b/app/components/BuildCard.tsx @@ -8,7 +8,7 @@ import { useIsMounted } from "~/hooks/useIsMounted"; import type { Ability as AbilityType, ModeShort, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import type { BuildAbilitiesTuple } from "~/modules/in-game-lists/types"; import { altWeaponIdToId } from "~/modules/in-game-lists/weapon-ids"; import { databaseTimestampToDate } from "~/utils/dates"; diff --git a/app/components/Combobox.tsx b/app/components/Combobox.tsx index 1371e5ed4..7657ebf87 100644 --- a/app/components/Combobox.tsx +++ b/app/components/Combobox.tsx @@ -6,16 +6,18 @@ import { useTranslation } from "react-i18next"; import type { GearType } from "~/db/tables"; import type { SerializedMapPoolEvent } from "~/features/calendar/routes/map-pool-events"; import { useAllEventsWithMapPools } from "~/hooks/swr"; -import type { MainWeaponId } from "~/modules/in-game-lists"; import { clothesGearIds, headGearIds, - mainWeaponIds, shoesGearIds, +} from "~/modules/in-game-lists/gear-ids"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; +import { weaponAltNames } from "~/modules/in-game-lists/weapon-alt-names"; +import { + mainWeaponIds, subWeaponIds, weaponCategories, -} from "~/modules/in-game-lists"; -import { weaponAltNames } from "~/modules/in-game-lists/weapon-alt-names"; +} from "~/modules/in-game-lists/weapon-ids"; import { nonBombSubWeaponIds, nonDamagingSpecialWeaponIds, diff --git a/app/components/Image.tsx b/app/components/Image.tsx index 45b96ebd2..1f726964b 100644 --- a/app/components/Image.tsx +++ b/app/components/Image.tsx @@ -1,7 +1,7 @@ import clsx from "clsx"; import { useTranslation } from "react-i18next"; import type { TierName } from "~/features/mmr/mmr-constants"; -import type { MainWeaponId, StageId } from "~/modules/in-game-lists"; +import type { MainWeaponId, StageId } from "~/modules/in-game-lists/types"; import type { ModeShortWithSpecial } from "~/modules/in-game-lists/types"; import { TIER_PLUS_URL, diff --git a/app/components/MapPoolSelector.tsx b/app/components/MapPoolSelector.tsx index 7eb544f5d..f72c91500 100644 --- a/app/components/MapPoolSelector.tsx +++ b/app/components/MapPoolSelector.tsx @@ -7,12 +7,9 @@ import type { Tables } from "~/db/tables"; import type { SerializedMapPoolEvent } from "~/features/calendar/routes/map-pool-events"; import { MapPool } from "~/features/map-list-generator/core/map-pool"; import { BANNED_MAPS } from "~/features/sendouq-settings/banned-maps"; -import { - type ModeShort, - type StageId, - modesShort, -} from "~/modules/in-game-lists"; -import { stageIds } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { split, startsWith } from "~/utils/strings"; import { assertType } from "~/utils/types"; import { modeImageUrl, stageImageUrl } from "~/utils/urls"; diff --git a/app/constants.ts b/app/constants.ts index f54948365..4b892d799 100644 --- a/app/constants.ts +++ b/app/constants.ts @@ -1,4 +1,4 @@ -import type { BuildAbilitiesTupleWithUnknown } from "./modules/in-game-lists"; +import type { BuildAbilitiesTupleWithUnknown } from "./modules/in-game-lists/types"; export const TWEET_LENGTH_MAX_LENGTH = 280; export const DISCORD_MESSAGE_MAX_LENGTH = 2000; diff --git a/app/db/seed/index.ts b/app/db/seed/index.ts index bba17da0e..25dccb2f5 100644 --- a/app/db/seed/index.ts +++ b/app/db/seed/index.ts @@ -50,21 +50,21 @@ import { secondsToHoursMinutesSecondString, youtubeIdToYoutubeUrl, } from "~/features/vods/vods-utils"; +import { abilities } from "~/modules/in-game-lists/abilities"; +import { + clothesGearIds, + headGearIds, + shoesGearIds, +} from "~/modules/in-game-lists/gear-ids"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; import type { AbilityType, MainWeaponId, StageId, -} from "~/modules/in-game-lists"; -import { - abilities, - clothesGearIds, - headGearIds, - mainWeaponIds, - modesShort, - shoesGearIds, - stageIds, -} from "~/modules/in-game-lists"; -import { rankedModesShort } from "~/modules/in-game-lists/modes"; +} from "~/modules/in-game-lists/types"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import type { TournamentMapListMap } from "~/modules/tournament-map-list-generator"; import { SENDOUQ_DEFAULT_MAPS } from "~/modules/tournament-map-list-generator/constants"; import { nullFilledArray } from "~/utils/arrays"; diff --git a/app/db/tables.ts b/app/db/tables.ts index 59d39e3cf..581e01469 100644 --- a/app/db/tables.ts +++ b/app/db/tables.ts @@ -21,7 +21,7 @@ import type { MainWeaponId, ModeShort, StageId, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import type { JSONColumnTypeNullable } from "~/utils/kysely.server"; type Generated = T extends ColumnType diff --git a/app/features/build-analyzer/analyzer-constants.ts b/app/features/build-analyzer/analyzer-constants.ts index fe94d3d2b..e579ad183 100644 --- a/app/features/build-analyzer/analyzer-constants.ts +++ b/app/features/build-analyzer/analyzer-constants.ts @@ -1,4 +1,4 @@ -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import type { DamageType } from "./analyzer-types"; export const MAX_LDE_INTENSITY = 21; diff --git a/app/features/build-analyzer/analyzer-hooks.ts b/app/features/build-analyzer/analyzer-hooks.ts index f26c1ef18..900ba1c5d 100644 --- a/app/features/build-analyzer/analyzer-hooks.ts +++ b/app/features/build-analyzer/analyzer-hooks.ts @@ -1,12 +1,12 @@ import { useSearchParams } from "@remix-run/react"; -import { - type Ability, - type AbilityWithUnknown, - type BuildAbilitiesTupleWithUnknown, - type MainWeaponId, - abilities, - isAbility, -} from "~/modules/in-game-lists"; +import { abilities } from "~/modules/in-game-lists/abilities"; +import type { + Ability, + AbilityWithUnknown, + BuildAbilitiesTupleWithUnknown, + MainWeaponId, +} from "~/modules/in-game-lists/types"; +import { isAbility } from "~/modules/in-game-lists/utils"; import invariant from "~/utils/invariant"; import { MAX_LDE_INTENSITY } from "./analyzer-constants"; import type { SpecialEffectType } from "./analyzer-types"; diff --git a/app/features/build-analyzer/analyzer-types.ts b/app/features/build-analyzer/analyzer-types.ts index 687778aec..ffef3bc82 100644 --- a/app/features/build-analyzer/analyzer-types.ts +++ b/app/features/build-analyzer/analyzer-types.ts @@ -3,7 +3,7 @@ import type { MainWeaponId, SpecialWeaponId, SubWeaponId, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import type { AbilityWithUnknown } from "~/modules/in-game-lists/types"; import type { DAMAGE_TYPE } from "./analyzer-constants"; import type { SPECIAL_EFFECTS } from "./core/specialEffects"; diff --git a/app/features/build-analyzer/components/PerInkTankGrid.tsx b/app/features/build-analyzer/components/PerInkTankGrid.tsx index 4938cf565..214347b94 100644 --- a/app/features/build-analyzer/components/PerInkTankGrid.tsx +++ b/app/features/build-analyzer/components/PerInkTankGrid.tsx @@ -3,7 +3,7 @@ import * as React from "react"; import { useTranslation } from "react-i18next"; import { Ability } from "~/components/Ability"; import { MAX_AP } from "~/constants"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { SendouButton } from "../../../components/elements/Button"; import { SendouPopover } from "../../../components/elements/Popover"; import type { FullInkTankOption } from "../analyzer-types"; diff --git a/app/features/build-analyzer/core/abilityChunksCalc.test.ts b/app/features/build-analyzer/core/abilityChunksCalc.test.ts index 4a9d94f9c..0cf946d8c 100644 --- a/app/features/build-analyzer/core/abilityChunksCalc.test.ts +++ b/app/features/build-analyzer/core/abilityChunksCalc.test.ts @@ -2,7 +2,7 @@ import { describe, expect, test } from "vitest"; import type { AbilityWithUnknown, BuildAbilitiesTupleWithUnknown, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import { getAbilityChunksMapAsArray } from "./abilityChunksCalc"; // Utility function that performs an order-agnostic check to see diff --git a/app/features/build-analyzer/core/abilityChunksCalc.ts b/app/features/build-analyzer/core/abilityChunksCalc.ts index 285dd597d..a3a3f9d16 100644 --- a/app/features/build-analyzer/core/abilityChunksCalc.ts +++ b/app/features/build-analyzer/core/abilityChunksCalc.ts @@ -1,8 +1,8 @@ -import { - type AbilityWithUnknown, - type BuildAbilitiesTupleWithUnknown, - abilities, -} from "~/modules/in-game-lists"; +import { abilities } from "~/modules/in-game-lists/abilities"; +import type { + AbilityWithUnknown, + BuildAbilitiesTupleWithUnknown, +} from "~/modules/in-game-lists/types"; import type { AbilityChunks } from "../analyzer-types"; // Reference for Ability Chunks numbers: https://splatoonwiki.org/wiki/Ability_chunk#Splatoon_3 diff --git a/app/features/build-analyzer/core/stats.test.ts b/app/features/build-analyzer/core/stats.test.ts index 767b1787e..fbc265af2 100644 --- a/app/features/build-analyzer/core/stats.test.ts +++ b/app/features/build-analyzer/core/stats.test.ts @@ -1,5 +1,6 @@ import { describe, expect, test } from "vitest"; -import { type MainWeaponId, mainWeaponIds } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import { damageTypeToWeaponType } from "../analyzer-constants"; import { buildStats } from "./stats"; diff --git a/app/features/build-analyzer/core/stats.ts b/app/features/build-analyzer/core/stats.ts index 40e756661..4925fde59 100644 --- a/app/features/build-analyzer/core/stats.ts +++ b/app/features/build-analyzer/core/stats.ts @@ -1,27 +1,27 @@ import { nanoid } from "nanoid"; import * as R from "remeda"; +import type { + Ability, + MainWeaponId, + SubWeaponId, +} from "~/modules/in-game-lists/types"; import { + ANGLE_SHOOTER_ID, AUTO_BOMB_ID, - type Ability, BURST_BOMB_ID, CRAB_TANK_ID, CURLING_BOMB_ID, FIZZY_BOMB_ID, - type MainWeaponId, + INK_MINE_ID, + POINT_SENSOR_ID, SPLASH_WALL_ID, SPLAT_BOMB_ID, SPRINKLER_ID, SUCTION_BOMB_ID, - type SubWeaponId, TORPEDO_ID, ZIPCASTER_ID, subWeaponIds, -} from "~/modules/in-game-lists"; -import { - ANGLE_SHOOTER_ID, - INK_MINE_ID, - POINT_SENSOR_ID, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/weapon-ids"; import invariant from "~/utils/invariant"; import { cutToNDecimalPlaces, roundToNDecimalPlaces } from "~/utils/number"; import { assertUnreachable } from "~/utils/types"; diff --git a/app/features/build-analyzer/core/utils.ts b/app/features/build-analyzer/core/utils.ts index 92b88db94..b3791ca5b 100644 --- a/app/features/build-analyzer/core/utils.ts +++ b/app/features/build-analyzer/core/utils.ts @@ -1,4 +1,5 @@ import { EMPTY_BUILD } from "~/constants"; +import { abilities } from "~/modules/in-game-lists/abilities"; import type { Ability, AbilityType, @@ -7,16 +8,15 @@ import type { MainWeaponId, SpecialWeaponId, SubWeaponId, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import { - abilities, mainWeaponIds, nonBombSubWeaponIds, nonDamagingSpecialWeaponIds, specialWeaponIds, subWeaponIds, weaponCategories, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/weapon-ids"; import invariant from "~/utils/invariant"; import type { Unpacked } from "~/utils/types"; import { UNKNOWN_SHORT } from "../analyzer-constants"; diff --git a/app/features/build-analyzer/routes/analyzer.tsx b/app/features/build-analyzer/routes/analyzer.tsx index 6c0cfdb9b..fe5649806 100644 --- a/app/features/build-analyzer/routes/analyzer.tsx +++ b/app/features/build-analyzer/routes/analyzer.tsx @@ -16,22 +16,24 @@ import { BeakerIcon } from "~/components/icons/Beaker"; import { MAX_AP } from "~/constants"; import { useUser } from "~/features/auth/core/user"; import { useIsMounted } from "~/hooks/useIsMounted"; -import type { Ability as AbilityType } from "~/modules/in-game-lists"; +import { abilitiesShort } from "~/modules/in-game-lists/abilities"; +import type { Ability as AbilityType } from "~/modules/in-game-lists/types"; +import type { + BuildAbilitiesTupleWithUnknown, + MainWeaponId, + SubWeaponId, +} from "~/modules/in-game-lists/types"; +import { isAbility } from "~/modules/in-game-lists/utils"; import { ANGLE_SHOOTER_ID, BIG_BUBBLER_ID, - type BuildAbilitiesTupleWithUnknown, INK_MINE_ID, INK_STORM_ID, KILLER_WAIL_ID, - type MainWeaponId, POINT_SENSOR_ID, - type SubWeaponId, TORPEDO_ID, TOXIC_MIST_ID, - abilitiesShort, - isAbility, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/weapon-ids"; import { atOrError, nullFilledArray } from "~/utils/arrays"; import { damageTypeTranslationString } from "~/utils/i18next"; import invariant from "~/utils/invariant"; diff --git a/app/features/build-stats/build-stats-utils.ts b/app/features/build-stats/build-stats-utils.ts index 308e6ef25..dbe8ac00f 100644 --- a/app/features/build-stats/build-stats-utils.ts +++ b/app/features/build-stats/build-stats-utils.ts @@ -1,5 +1,6 @@ import { MAX_AP } from "~/constants"; -import { type Ability, abilities } from "~/modules/in-game-lists"; +import { abilities } from "~/modules/in-game-lists/abilities"; +import type { Ability } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { roundToNDecimalPlaces } from "~/utils/number"; import { isStackableAbility } from "../build-analyzer/core/utils"; diff --git a/app/features/build-stats/queries/abilitiesByWeaponId.server.ts b/app/features/build-stats/queries/abilitiesByWeaponId.server.ts index 265c424f0..132c3c2d6 100644 --- a/app/features/build-stats/queries/abilitiesByWeaponId.server.ts +++ b/app/features/build-stats/queries/abilitiesByWeaponId.server.ts @@ -1,5 +1,5 @@ import { sql } from "~/db/sql"; -import type { Ability, MainWeaponId } from "~/modules/in-game-lists"; +import type { Ability, MainWeaponId } from "~/modules/in-game-lists/types"; // TODO: could consider removing private builds from this const stm = sql.prepare(/* sql */ ` diff --git a/app/features/build-stats/queries/averageAbilityPoints.server.ts b/app/features/build-stats/queries/averageAbilityPoints.server.ts index a80a4bf81..38b8d4246 100644 --- a/app/features/build-stats/queries/averageAbilityPoints.server.ts +++ b/app/features/build-stats/queries/averageAbilityPoints.server.ts @@ -1,5 +1,5 @@ import { sql } from "~/db/sql"; -import type { Ability, MainWeaponId } from "~/modules/in-game-lists"; +import type { Ability, MainWeaponId } from "~/modules/in-game-lists/types"; // TODO: could consider removing private builds from this const query = (includeWeaponId: boolean) => /* sql */ ` diff --git a/app/features/builds/BuildRepository.server.ts b/app/features/builds/BuildRepository.server.ts index 387b7ca7e..8ad494457 100644 --- a/app/features/builds/BuildRepository.server.ts +++ b/app/features/builds/BuildRepository.server.ts @@ -2,11 +2,11 @@ import type { Transaction } from "kysely"; import { jsonArrayFrom } from "kysely/helpers/sqlite"; import { db } from "~/db/sql"; import type { BuildWeapon, DB, Tables, TablesInsertable } from "~/db/tables"; -import { - type BuildAbilitiesTuple, - type ModeShort, - modesShort, -} from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import type { + BuildAbilitiesTuple, + ModeShort, +} from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; export async function allByUserId({ diff --git a/app/features/builds/builds-types.ts b/app/features/builds/builds-types.ts index 52fe40f5c..07e18216c 100644 --- a/app/features/builds/builds-types.ts +++ b/app/features/builds/builds-types.ts @@ -1,4 +1,4 @@ -import type { Ability, ModeShort } from "~/modules/in-game-lists"; +import type { Ability, ModeShort } from "~/modules/in-game-lists/types"; type WithId = T & { id: string }; diff --git a/app/features/builds/components/FilterSection.tsx b/app/features/builds/components/FilterSection.tsx index eaad2fe0e..49b187c0b 100644 --- a/app/features/builds/components/FilterSection.tsx +++ b/app/features/builds/components/FilterSection.tsx @@ -5,12 +5,10 @@ import { ModeImage } from "~/components/Image"; import { CrossIcon } from "~/components/icons/Cross"; import { PATCHES } from "~/constants"; import { possibleApValues } from "~/features/build-analyzer"; -import type { ModeShort } from "~/modules/in-game-lists"; -import { - type Ability as AbilityType, - abilities, - modesShort, -} from "~/modules/in-game-lists"; +import { abilities } from "~/modules/in-game-lists/abilities"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import type { ModeShort } from "~/modules/in-game-lists/types"; +import type { Ability as AbilityType } from "~/modules/in-game-lists/types"; import { dateToYYYYMMDD } from "~/utils/dates"; import type { AbilityBuildFilter, diff --git a/app/features/builds/core/ability-sorting.server.ts b/app/features/builds/core/ability-sorting.server.ts index 0c0469c63..2d0d1e87c 100644 --- a/app/features/builds/core/ability-sorting.server.ts +++ b/app/features/builds/core/ability-sorting.server.ts @@ -1,9 +1,9 @@ -import { - type Ability, - type BuildAbilitiesTuple, - abilities, -} from "~/modules/in-game-lists"; +import { abilities } from "~/modules/in-game-lists/abilities"; import { mainOnlyAbilitiesShort } from "~/modules/in-game-lists/abilities"; +import type { + Ability, + BuildAbilitiesTuple, +} from "~/modules/in-game-lists/types"; const abilityToIndex = abilities.reduce( (acc, ability, index) => { diff --git a/app/features/builds/core/cached-builds.server.ts b/app/features/builds/core/cached-builds.server.ts index 14826c2a5..0f7432017 100644 --- a/app/features/builds/core/cached-builds.server.ts +++ b/app/features/builds/core/cached-builds.server.ts @@ -1,5 +1,5 @@ import { BUILDS_PAGE_MAX_BUILDS } from "~/constants"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { cache, syncCached } from "~/utils/cache.server"; import { buildsByWeaponId } from "../queries/buildsBy.server"; diff --git a/app/features/builds/core/filter.server.ts b/app/features/builds/core/filter.server.ts index e68131a7b..344fe21c8 100644 --- a/app/features/builds/core/filter.server.ts +++ b/app/features/builds/core/filter.server.ts @@ -1,6 +1,9 @@ import type { Tables } from "~/db/tables"; import { buildToAbilityPoints } from "~/features/build-analyzer"; -import type { BuildAbilitiesTuple, ModeShort } from "~/modules/in-game-lists"; +import type { + BuildAbilitiesTuple, + ModeShort, +} from "~/modules/in-game-lists/types"; import { databaseTimestampToDate } from "~/utils/dates"; import { assertUnreachable } from "~/utils/types"; import type { BuildFiltersFromSearchParams } from "../builds-schemas.server"; diff --git a/app/features/builds/core/filter.test.ts b/app/features/builds/core/filter.test.ts index a8101237c..e381b53b6 100644 --- a/app/features/builds/core/filter.test.ts +++ b/app/features/builds/core/filter.test.ts @@ -4,7 +4,7 @@ import type { Ability, BuildAbilitiesTuple, ModeShort, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import { dateToDatabaseTimestamp } from "~/utils/dates"; import { filterBuilds } from "./filter.server"; diff --git a/app/features/builds/loaders/builds.$slug.server.ts b/app/features/builds/loaders/builds.$slug.server.ts index b8b89ee31..614157468 100644 --- a/app/features/builds/loaders/builds.$slug.server.ts +++ b/app/features/builds/loaders/builds.$slug.server.ts @@ -1,7 +1,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; import { BUILDS_PAGE_BATCH_SIZE, BUILDS_PAGE_MAX_BUILDS } from "~/constants"; import { i18next } from "~/modules/i18n/i18next.server"; -import { weaponIdIsNotAlt } from "~/modules/in-game-lists"; +import { weaponIdIsNotAlt } from "~/modules/in-game-lists/weapon-ids"; import { weaponNameSlugToId } from "~/utils/unslugify.server"; import { mySlugify } from "~/utils/urls"; import { FILTER_SEARCH_PARAM_KEY } from "../builds-constants"; diff --git a/app/features/builds/queries/buildsBy.server.ts b/app/features/builds/queries/buildsBy.server.ts index 155189bc3..1db5e34da 100644 --- a/app/features/builds/queries/buildsBy.server.ts +++ b/app/features/builds/queries/buildsBy.server.ts @@ -1,10 +1,11 @@ import { sql } from "~/db/sql"; import type { Tables, UserWithPlusTier } from "~/db/tables"; -import { type ModeShort, weaponIdToAltId } from "~/modules/in-game-lists"; +import type { ModeShort } from "~/modules/in-game-lists/types"; import type { BuildAbilitiesTuple, MainWeaponId, } from "~/modules/in-game-lists/types"; +import { weaponIdToAltId } from "~/modules/in-game-lists/weapon-ids"; import invariant from "~/utils/invariant"; import { sortAbilities } from "../core/ability-sorting.server"; diff --git a/app/features/builds/routes/builds.tsx b/app/features/builds/routes/builds.tsx index b4f2d0d9f..ac00b62a5 100644 --- a/app/features/builds/routes/builds.tsx +++ b/app/features/builds/routes/builds.tsx @@ -3,8 +3,11 @@ import { Link } from "@remix-run/react"; import { useTranslation } from "react-i18next"; import { Image } from "~/components/Image"; import { Main } from "~/components/Main"; -import type { MainWeaponId } from "~/modules/in-game-lists"; -import { weaponCategories, weaponIdIsNotAlt } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; +import { + weaponCategories, + weaponIdIsNotAlt, +} from "~/modules/in-game-lists/weapon-ids"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { BUILDS_PAGE, diff --git a/app/features/calendar/routes/calendar.new.tsx b/app/features/calendar/routes/calendar.new.tsx index e0171dcd2..cd0e9a998 100644 --- a/app/features/calendar/routes/calendar.new.tsx +++ b/app/features/calendar/routes/calendar.new.tsx @@ -23,7 +23,7 @@ import type { CalendarEventTag, Tables } from "~/db/tables"; import { MapPool } from "~/features/map-list-generator/core/map-pool"; import * as Progression from "~/features/tournament-bracket/core/Progression"; import { useIsMounted } from "~/hooks/useIsMounted"; -import type { RankedModeShort } from "~/modules/in-game-lists"; +import type { RankedModeShort } from "~/modules/in-game-lists/types"; import { isDefined } from "~/utils/arrays"; import { databaseTimestampToDate, diff --git a/app/features/leaderboards/core/leaderboards.server.ts b/app/features/leaderboards/core/leaderboards.server.ts index 9e92a5101..0a3c12f4c 100644 --- a/app/features/leaderboards/core/leaderboards.server.ts +++ b/app/features/leaderboards/core/leaderboards.server.ts @@ -5,8 +5,8 @@ import { USER_LEADERBOARD_MIN_ENTRIES_FOR_LEVIATHAN } from "~/features/mmr/mmr-c import { spToOrdinal } from "~/features/mmr/mmr-utils"; import { freshUserSkills, userSkills } from "~/features/mmr/tiered.server"; import * as UserRepository from "~/features/user-page/UserRepository.server"; -import type { MainWeaponId } from "~/modules/in-game-lists"; -import { weaponCategories } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; +import { weaponCategories } from "~/modules/in-game-lists/weapon-ids"; import { cache, ttl } from "~/utils/cache.server"; import type { Unwrapped } from "~/utils/types"; import { DEFAULT_LEADERBOARD_MAX_SIZE } from "../leaderboards-constants"; diff --git a/app/features/leaderboards/leaderboards-constants.ts b/app/features/leaderboards/leaderboards-constants.ts index 02a95950b..98ed2eecf 100644 --- a/app/features/leaderboards/leaderboards-constants.ts +++ b/app/features/leaderboards/leaderboards-constants.ts @@ -1,5 +1,8 @@ -import { mainWeaponIds, weaponCategories } from "~/modules/in-game-lists"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import { + mainWeaponIds, + weaponCategories, +} from "~/modules/in-game-lists/weapon-ids"; export const MATCHES_COUNT_NEEDED_FOR_LEADERBOARD = 7; export const DEFAULT_LEADERBOARD_MAX_SIZE = 500; diff --git a/app/features/leaderboards/loaders/leaderboards.server.ts b/app/features/leaderboards/loaders/leaderboards.server.ts index 5b69002e3..5862efb53 100644 --- a/app/features/leaderboards/loaders/leaderboards.server.ts +++ b/app/features/leaderboards/loaders/leaderboards.server.ts @@ -7,8 +7,8 @@ import * as Seasons from "~/features/mmr/core/Seasons"; import type { MainWeaponId, RankedModeShort, - weaponCategories, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; +import type { weaponCategories } from "~/modules/in-game-lists/weapon-ids"; import { cache, ttl } from "~/utils/cache.server"; import { cachedFullUserLeaderboard, diff --git a/app/features/leaderboards/queries/XPLeaderboard.server.ts b/app/features/leaderboards/queries/XPLeaderboard.server.ts index c252c63d1..8fd3e3986 100644 --- a/app/features/leaderboards/queries/XPLeaderboard.server.ts +++ b/app/features/leaderboards/queries/XPLeaderboard.server.ts @@ -1,6 +1,6 @@ import { sql } from "~/db/sql"; import type { Tables } from "~/db/tables"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { DEFAULT_LEADERBOARD_MAX_SIZE } from "../leaderboards-constants"; const getStm = (where = "") => diff --git a/app/features/leaderboards/queries/seasonPopularUsersWeapon.server.ts b/app/features/leaderboards/queries/seasonPopularUsersWeapon.server.ts index e5ec257cb..62a6c6f73 100644 --- a/app/features/leaderboards/queries/seasonPopularUsersWeapon.server.ts +++ b/app/features/leaderboards/queries/seasonPopularUsersWeapon.server.ts @@ -1,7 +1,7 @@ import { sql } from "~/db/sql"; import type { Tables } from "~/db/tables"; import * as Seasons from "~/features/mmr/core/Seasons"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { dateToDatabaseTimestamp } from "~/utils/dates"; import { MATCHES_COUNT_NEEDED_FOR_LEADERBOARD } from "../leaderboards-constants"; diff --git a/app/features/leaderboards/routes/leaderboards.tsx b/app/features/leaderboards/routes/leaderboards.tsx index fd9e8a385..1e9509afe 100644 --- a/app/features/leaderboards/routes/leaderboards.tsx +++ b/app/features/leaderboards/routes/leaderboards.tsx @@ -8,8 +8,8 @@ import { Main } from "~/components/Main"; import * as Seasons from "~/features/mmr/core/Seasons"; import { ordinalToSp } from "~/features/mmr/mmr-utils"; import type { SkillTierInterval } from "~/features/mmr/tiered.server"; -import { weaponCategories } from "~/modules/in-game-lists"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import { weaponCategories } from "~/modules/in-game-lists/weapon-ids"; import { metaTags } from "~/utils/remix"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { diff --git a/app/features/lfg/components/LFGFilters.tsx b/app/features/lfg/components/LFGFilters.tsx index e62d69af7..cdaabc862 100644 --- a/app/features/lfg/components/LFGFilters.tsx +++ b/app/features/lfg/components/LFGFilters.tsx @@ -9,7 +9,7 @@ import type { Tables } from "~/db/tables"; import type { TierName } from "~/features/mmr/mmr-constants"; import { TIERS } from "~/features/mmr/mmr-constants"; import { languagesUnified } from "~/modules/i18n/config"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { LFG } from "../lfg-constants"; import type { LFGFilter } from "../lfg-types"; diff --git a/app/features/lfg/core/filtering.ts b/app/features/lfg/core/filtering.ts index 6693e0215..94753e32d 100644 --- a/app/features/lfg/core/filtering.ts +++ b/app/features/lfg/core/filtering.ts @@ -1,5 +1,5 @@ import { compareTwoTiers } from "~/features/mmr/mmr-utils"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { altWeaponIdToId, mainWeaponIds, diff --git a/app/features/lfg/lfg-types.ts b/app/features/lfg/lfg-types.ts index c417eaede..4866198ba 100644 --- a/app/features/lfg/lfg-types.ts +++ b/app/features/lfg/lfg-types.ts @@ -1,6 +1,6 @@ import { type LFGType, LFG_TYPES } from "~/db/tables"; import { languagesUnified } from "~/modules/i18n/config"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { assertUnreachable } from "~/utils/types"; import { TIERS, type TierName } from "../mmr/mmr-constants"; diff --git a/app/features/map-list-generator/core/map-list-generator/map-list.ts b/app/features/map-list-generator/core/map-list-generator/map-list.ts index 9c03f3394..8200b008f 100644 --- a/app/features/map-list-generator/core/map-list-generator/map-list.ts +++ b/app/features/map-list-generator/core/map-list-generator/map-list.ts @@ -4,7 +4,7 @@ import type { ModeShort, ModeWithStage, StageId, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import type { MapPool } from "../map-pool"; import type { MapPoolObject } from "../map-pool-serializer/types"; diff --git a/app/features/map-list-generator/core/map-list-generator/modes.ts b/app/features/map-list-generator/core/map-list-generator/modes.ts index b29cbb64e..9a9d75268 100644 --- a/app/features/map-list-generator/core/map-list-generator/modes.ts +++ b/app/features/map-list-generator/core/map-list-generator/modes.ts @@ -1,5 +1,5 @@ import * as R from "remeda"; -import type { ModeShort } from "../../../../modules/in-game-lists"; +import type { ModeShort } from "../../../../modules/in-game-lists/types"; export function modesOrder( type: "EQUAL" | "SZ_EVERY_OTHER", diff --git a/app/features/map-list-generator/core/map-list-generator/utils.ts b/app/features/map-list-generator/core/map-list-generator/utils.ts index 2e44ac4a8..f743f30ea 100644 --- a/app/features/map-list-generator/core/map-list-generator/utils.ts +++ b/app/features/map-list-generator/core/map-list-generator/utils.ts @@ -1,5 +1,5 @@ import type { Tables } from "~/db/tables"; -import type { ModeShort } from "../../../../modules/in-game-lists"; +import type { ModeShort } from "../../../../modules/in-game-lists/types"; import type { MapPool } from "../map-pool"; import type { MapPoolObject } from "../map-pool-serializer/types"; diff --git a/app/features/map-list-generator/core/map-pool-serializer/serializer.ts b/app/features/map-list-generator/core/map-pool-serializer/serializer.ts index 490af70f1..1f028fb0c 100644 --- a/app/features/map-list-generator/core/map-pool-serializer/serializer.ts +++ b/app/features/map-list-generator/core/map-pool-serializer/serializer.ts @@ -1,9 +1,7 @@ import invariant from "~/utils/invariant"; -import { - type StageId, - modesShort, - stageIds, -} from "../../../../modules/in-game-lists"; +import { modesShort } from "../../../../modules/in-game-lists/modes"; +import { stageIds } from "../../../../modules/in-game-lists/stage-ids"; +import type { StageId } from "../../../../modules/in-game-lists/types"; import type { MapPoolObject, ReadonlyMapPoolObject } from "./types"; export function mapPoolToSerializedString( diff --git a/app/features/map-list-generator/core/map-pool-serializer/types.ts b/app/features/map-list-generator/core/map-pool-serializer/types.ts index 903b1cb41..2a203a711 100644 --- a/app/features/map-list-generator/core/map-pool-serializer/types.ts +++ b/app/features/map-list-generator/core/map-pool-serializer/types.ts @@ -1,4 +1,7 @@ -import type { ModeShort, StageId } from "../../../../modules/in-game-lists"; +import type { + ModeShort, + StageId, +} from "../../../../modules/in-game-lists/types"; export type MapPoolObject = Record; export type ReadonlyMapPoolObject = Readonly< diff --git a/app/features/map-list-generator/core/map-pool.ts b/app/features/map-list-generator/core/map-pool.ts index 5de9dac77..1948863e6 100644 --- a/app/features/map-list-generator/core/map-pool.ts +++ b/app/features/map-list-generator/core/map-pool.ts @@ -1,9 +1,6 @@ import type { Tables } from "~/db/tables"; -import { - type ModeShort, - type StageId, - stageIds, -} from "~/modules/in-game-lists"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { mapPoolListToMapPoolObject } from "./map-list-generator/utils"; import { mapPoolToSerializedString, diff --git a/app/features/map-list-generator/routes/maps.tsx b/app/features/map-list-generator/routes/maps.tsx index 252a52783..d22cbea6d 100644 --- a/app/features/map-list-generator/routes/maps.tsx +++ b/app/features/map-list-generator/routes/maps.tsx @@ -11,7 +11,8 @@ import { MapPoolSelector, MapPoolStages } from "~/components/MapPoolSelector"; import { SendouSwitch } from "~/components/elements/Switch"; import { EditIcon } from "~/components/icons/Edit"; import type { Tables } from "~/db/tables"; -import { type ModeWithStage, stageIds } from "~/modules/in-game-lists"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeWithStage } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { metaTags } from "~/utils/remix"; import type { SendouRouteHandle } from "~/utils/remix.server"; diff --git a/app/features/map-planner/components/Planner.tsx b/app/features/map-planner/components/Planner.tsx index 906f742bd..7e802dcad 100644 --- a/app/features/map-planner/components/Planner.tsx +++ b/app/features/map-planner/components/Planner.tsx @@ -20,14 +20,14 @@ import { useTranslation } from "react-i18next"; import * as R from "remeda"; import { usePlannerBg } from "~/hooks/usePlannerBg"; import type { LanguageCode } from "~/modules/i18n/config"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { specialWeaponIds, - stageIds, subWeaponIds, weaponCategories, -} from "~/modules/in-game-lists"; -import { modesShort } from "~/modules/in-game-lists/modes"; +} from "~/modules/in-game-lists/weapon-ids"; import { mainWeaponImageUrl, modeImageUrl, diff --git a/app/features/object-damage-calculator/calculator-constants.ts b/app/features/object-damage-calculator/calculator-constants.ts index 88042627c..79d51524a 100644 --- a/app/features/object-damage-calculator/calculator-constants.ts +++ b/app/features/object-damage-calculator/calculator-constants.ts @@ -1,4 +1,5 @@ -import { type MainWeaponId, mainWeaponIds } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import invariant from "~/utils/invariant"; import type { AnyWeapon, DamageType } from "../build-analyzer"; import type { CombineWith } from "./calculator-types"; diff --git a/app/features/object-damage-calculator/calculator-hooks.ts b/app/features/object-damage-calculator/calculator-hooks.ts index e3afdb92f..fd87fe4ae 100644 --- a/app/features/object-damage-calculator/calculator-hooks.ts +++ b/app/features/object-damage-calculator/calculator-hooks.ts @@ -7,7 +7,7 @@ import { possibleApValues, validatedAnyWeaponFromSearchParams, } from "~/features/build-analyzer"; -import { exampleMainWeaponIdWithSpecialWeaponId } from "~/modules/in-game-lists"; +import { exampleMainWeaponIdWithSpecialWeaponId } from "~/modules/in-game-lists/weapon-ids"; import { assertType } from "~/utils/types"; import type { AnyWeapon } from "../build-analyzer/analyzer-types"; import { diff --git a/app/features/object-damage-calculator/core/objectDamage.test.ts b/app/features/object-damage-calculator/core/objectDamage.test.ts index 7e0d73ff6..7233193f7 100644 --- a/app/features/object-damage-calculator/core/objectDamage.test.ts +++ b/app/features/object-damage-calculator/core/objectDamage.test.ts @@ -5,16 +5,16 @@ import type { AnalyzedBuild, DamageType, } from "~/features/build-analyzer"; -import { - exampleMainWeaponIdWithSpecialWeaponId, - mainWeaponIds, - specialWeaponIds, -} from "~/modules/in-game-lists"; import type { MainWeaponId, SpecialWeaponId, SubWeaponId, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; +import { + exampleMainWeaponIdWithSpecialWeaponId, + mainWeaponIds, + specialWeaponIds, +} from "~/modules/in-game-lists/weapon-ids"; import { calculateDamage } from "./objectDamage"; function calculate({ diff --git a/app/features/object-damage-calculator/core/objectDamage.ts b/app/features/object-damage-calculator/core/objectDamage.ts index f90330c82..50a1f8f6f 100644 --- a/app/features/object-damage-calculator/core/objectDamage.ts +++ b/app/features/object-damage-calculator/core/objectDamage.ts @@ -10,7 +10,7 @@ import type { MainWeaponId, SpecialWeaponId, SubWeaponId, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import { altWeaponIdToId } from "~/modules/in-game-lists/weapon-ids"; import invariant from "~/utils/invariant"; import { roundToNDecimalPlaces } from "~/utils/number"; diff --git a/app/features/object-damage-calculator/core/objectHitPoints.ts b/app/features/object-damage-calculator/core/objectHitPoints.ts index f64b5db5b..82a3e5606 100644 --- a/app/features/object-damage-calculator/core/objectHitPoints.ts +++ b/app/features/object-damage-calculator/core/objectHitPoints.ts @@ -12,7 +12,7 @@ import { BIG_BUBBLER_ID, CRAB_TANK_ID, SPLASH_WALL_ID, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/weapon-ids"; import invariant from "~/utils/invariant"; import type { HitPoints } from "../calculator-types"; diff --git a/app/features/object-damage-calculator/routes/object-damage-calculator.tsx b/app/features/object-damage-calculator/routes/object-damage-calculator.tsx index 8deeca485..d7bbb2e62 100644 --- a/app/features/object-damage-calculator/routes/object-damage-calculator.tsx +++ b/app/features/object-damage-calculator/routes/object-damage-calculator.tsx @@ -19,7 +19,7 @@ import { SQUID_BEAKON_ID, TORPEDO_ID, WAVE_BREAKER_ID, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/weapon-ids"; import { SUPER_CHUMP_ID, TRIPLE_SPLASHDOWN_ID, diff --git a/app/features/sendouq-match/core/match.server.test.ts b/app/features/sendouq-match/core/match.server.test.ts index 28a43f31f..c2509d9df 100644 --- a/app/features/sendouq-match/core/match.server.test.ts +++ b/app/features/sendouq-match/core/match.server.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "vitest"; import type { UserMapModePreferences } from "~/db/tables"; -import type { StageId } from "~/modules/in-game-lists"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import type { StageId } from "~/modules/in-game-lists/types"; import { SENDOUQ_DEFAULT_MAPS } from "~/modules/tournament-map-list-generator/constants"; import * as Test from "~/utils/Test"; import { nullFilledArray } from "~/utils/arrays"; diff --git a/app/features/sendouq-match/core/match.server.ts b/app/features/sendouq-match/core/match.server.ts index c4d4d63f2..96cd3f4b7 100644 --- a/app/features/sendouq-match/core/match.server.ts +++ b/app/features/sendouq-match/core/match.server.ts @@ -10,8 +10,8 @@ import { BANNED_MAPS } from "~/features/sendouq-settings/banned-maps"; import { addSkillsToGroups } from "~/features/sendouq/core/groups.server"; import { SENDOUQ_BEST_OF } from "~/features/sendouq/q-constants"; import type { LookingGroupWithInviteCode } from "~/features/sendouq/q-types"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; -import { modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { type TournamentMapListMap, createTournamentMapList, diff --git a/app/features/sendouq-match/core/reported-weapons.server.test.ts b/app/features/sendouq-match/core/reported-weapons.server.test.ts index 4555d9b58..0be1a82b9 100644 --- a/app/features/sendouq-match/core/reported-weapons.server.test.ts +++ b/app/features/sendouq-match/core/reported-weapons.server.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "vitest"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { mergeReportedWeapons } from "./reported-weapons.server"; describe("mergeReportedWeapons()", () => { diff --git a/app/features/sendouq-match/core/reported-weapons.server.ts b/app/features/sendouq-match/core/reported-weapons.server.ts index e3b73de5f..1dd1399de 100644 --- a/app/features/sendouq-match/core/reported-weapons.server.ts +++ b/app/features/sendouq-match/core/reported-weapons.server.ts @@ -1,5 +1,5 @@ import type { GroupForMatch } from "~/features/sendouq-match/QMatchRepository.server"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import type { MatchById } from "../queries/findMatchById.server"; import type { reportedWeaponsByMatchId } from "../queries/reportedWeaponsByMatchId.server"; diff --git a/app/features/sendouq-match/queries/addReportedWeapons.server.ts b/app/features/sendouq-match/queries/addReportedWeapons.server.ts index e21cc4c0a..b6e82226a 100644 --- a/app/features/sendouq-match/queries/addReportedWeapons.server.ts +++ b/app/features/sendouq-match/queries/addReportedWeapons.server.ts @@ -1,5 +1,5 @@ import { sql } from "~/db/sql"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; const insertStm = sql.prepare(/* sql */ ` insert into "ReportedWeapon" diff --git a/app/features/sendouq-match/routes/q.match.$id.tsx b/app/features/sendouq-match/routes/q.match.$id.tsx index a211a3bc3..f830fa65f 100644 --- a/app/features/sendouq-match/routes/q.match.$id.tsx +++ b/app/features/sendouq-match/routes/q.match.$id.tsx @@ -41,7 +41,7 @@ import { useRecentlyReportedWeapons } from "~/features/sendouq/q-hooks"; import { resolveRoomPass } from "~/features/tournament-bracket/tournament-bracket-utils"; import { useIsMounted } from "~/hooks/useIsMounted"; import { useWindowSize } from "~/hooks/useWindowSize"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { SPLATTERCOLOR_SCREEN_ID } from "~/modules/in-game-lists/weapon-ids"; import { useHasRole } from "~/modules/permissions/hooks"; import { joinListToNaturalString } from "~/utils/arrays"; diff --git a/app/features/sendouq-settings/QSettingsRepository.server.ts b/app/features/sendouq-settings/QSettingsRepository.server.ts index fded2d281..8a150964f 100644 --- a/app/features/sendouq-settings/QSettingsRepository.server.ts +++ b/app/features/sendouq-settings/QSettingsRepository.server.ts @@ -1,6 +1,6 @@ import { db } from "~/db/sql"; import type { QWeaponPool, Tables, UserMapModePreferences } from "~/db/tables"; -import { modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; import { COMMON_USER_FIELDS } from "~/utils/kysely.server"; export async function settingsByUserId(userId: number) { diff --git a/app/features/sendouq-settings/banned-maps.ts b/app/features/sendouq-settings/banned-maps.ts index ec6f4186a..2d22f5124 100644 --- a/app/features/sendouq-settings/banned-maps.ts +++ b/app/features/sendouq-settings/banned-maps.ts @@ -1,5 +1,5 @@ -import type { ModeShort, StageId } from "~/modules/in-game-lists"; import { stagesObj as s } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; export const BANNED_MAPS: Record = { TW: [], diff --git a/app/features/sendouq-settings/components/ModeMapPoolPicker.tsx b/app/features/sendouq-settings/components/ModeMapPoolPicker.tsx index e17090a2d..739a77e61 100644 --- a/app/features/sendouq-settings/components/ModeMapPoolPicker.tsx +++ b/app/features/sendouq-settings/components/ModeMapPoolPicker.tsx @@ -4,8 +4,8 @@ import { useTranslation } from "react-i18next"; import { Divider } from "~/components/Divider"; import { ModeImage } from "~/components/Image"; import { CheckmarkIcon } from "~/components/icons/Checkmark"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; -import { stageIds } from "~/modules/in-game-lists"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { nullFilledArray } from "~/utils/arrays"; import { stageImageUrl } from "~/utils/urls"; import { BANNED_MAPS } from "../banned-maps"; diff --git a/app/features/sendouq-settings/q-settings-schemas.server.ts b/app/features/sendouq-settings/q-settings-schemas.server.ts index 742b7f7a5..d1ba3ad77 100644 --- a/app/features/sendouq-settings/q-settings-schemas.server.ts +++ b/app/features/sendouq-settings/q-settings-schemas.server.ts @@ -1,6 +1,6 @@ import { z } from "zod"; import { languagesUnified } from "~/modules/i18n/config"; -import { modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; import { _action, checkboxValueToBoolean, diff --git a/app/features/sendouq-settings/routes/q.settings.tsx b/app/features/sendouq-settings/routes/q.settings.tsx index ad011ba61..0fc10b879 100644 --- a/app/features/sendouq-settings/routes/q.settings.tsx +++ b/app/features/sendouq-settings/routes/q.settings.tsx @@ -28,8 +28,8 @@ import { } from "~/features/chat/chat-utils"; import { useIsMounted } from "~/hooks/useIsMounted"; import { languagesUnified } from "~/modules/i18n/config"; -import type { MainWeaponId, ModeShort } from "~/modules/in-game-lists"; import { modesShort } from "~/modules/in-game-lists/modes"; +import type { MainWeaponId, ModeShort } from "~/modules/in-game-lists/types"; import { metaTags } from "~/utils/remix"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { assertUnreachable } from "~/utils/types"; diff --git a/app/features/sendouq/components/GroupCard.tsx b/app/features/sendouq/components/GroupCard.tsx index 9f37cde96..4a2c164c2 100644 --- a/app/features/sendouq/components/GroupCard.tsx +++ b/app/features/sendouq/components/GroupCard.tsx @@ -24,7 +24,7 @@ import { MATCHES_COUNT_NEEDED_FOR_LEADERBOARD } from "~/features/leaderboards/le import { ordinalToRoundedSp } from "~/features/mmr/mmr-utils"; import type { TieredSkill } from "~/features/mmr/tiered.server"; import { languagesUnified } from "~/modules/i18n/config"; -import type { ModeShort } from "~/modules/in-game-lists"; +import type { ModeShort } from "~/modules/in-game-lists/types"; import { SPLATTERCOLOR_SCREEN_ID } from "~/modules/in-game-lists/weapon-ids"; import { databaseTimestampToDate } from "~/utils/dates"; import { inGameNameWithoutDiscriminator } from "~/utils/strings"; diff --git a/app/features/sendouq/core/groups.server.ts b/app/features/sendouq/core/groups.server.ts index 72a1c0c28..727d05bf4 100644 --- a/app/features/sendouq/core/groups.server.ts +++ b/app/features/sendouq/core/groups.server.ts @@ -6,7 +6,7 @@ import type { TieredSkill, } from "~/features/mmr/tiered.server"; import { mapModePreferencesToModeList } from "~/features/sendouq-match/core/match.server"; -import { modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; import { databaseTimestampToDate } from "~/utils/dates"; import invariant from "~/utils/invariant"; import { FULL_GROUP_SIZE } from "../q-constants"; diff --git a/app/features/sendouq/q-hooks.ts b/app/features/sendouq/q-hooks.ts index 6a2d974a0..ef7cdf603 100644 --- a/app/features/sendouq/q-hooks.ts +++ b/app/features/sendouq/q-hooks.ts @@ -1,5 +1,5 @@ import * as React from "react"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; const LOCAL_STORAGE_KEY = "sq__reported-weapons"; const MAX_REPORTED_WEAPONS = 6; diff --git a/app/features/sendouq/q-types.ts b/app/features/sendouq/q-types.ts index d8f2efdb2..8d59c2215 100644 --- a/app/features/sendouq/q-types.ts +++ b/app/features/sendouq/q-types.ts @@ -1,5 +1,5 @@ import type { ParsedMemento, QWeaponPool, Tables } from "~/db/tables"; -import type { ModeShort } from "~/modules/in-game-lists"; +import type { ModeShort } from "~/modules/in-game-lists/types"; import type { TieredSkill } from "../mmr/tiered.server"; import type { GroupForMatch } from "../sendouq-match/QMatchRepository.server"; diff --git a/app/features/sendouq/q-utils.ts b/app/features/sendouq/q-utils.ts index b01746561..6a079e701 100644 --- a/app/features/sendouq/q-utils.ts +++ b/app/features/sendouq/q-utils.ts @@ -1,6 +1,6 @@ import type { Tables } from "~/db/tables"; -import { stageIds } from "~/modules/in-game-lists"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; import { databaseTimestampToDate } from "~/utils/dates"; import { SENDOUQ_LOOKING_PAGE, diff --git a/app/features/sendouq/queries/seasonMatchesByUserId.server.ts b/app/features/sendouq/queries/seasonMatchesByUserId.server.ts index fac48acc9..36a9da1ee 100644 --- a/app/features/sendouq/queries/seasonMatchesByUserId.server.ts +++ b/app/features/sendouq/queries/seasonMatchesByUserId.server.ts @@ -3,7 +3,7 @@ import { sql } from "~/db/sql"; import type { ParsedMemento, Tables } from "~/db/tables"; import * as Seasons from "~/features/mmr/core/Seasons"; import { MATCHES_PER_SEASONS_PAGE } from "~/features/user-page/user-page-constants"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { dateToDatabaseTimestamp } from "~/utils/dates"; import { parseDBArray, parseDBJsonArray } from "~/utils/sql"; diff --git a/app/features/sendouq/queries/seasonReportedWeaponsByUserId.server.ts b/app/features/sendouq/queries/seasonReportedWeaponsByUserId.server.ts index b78143917..89642ac27 100644 --- a/app/features/sendouq/queries/seasonReportedWeaponsByUserId.server.ts +++ b/app/features/sendouq/queries/seasonReportedWeaponsByUserId.server.ts @@ -1,6 +1,6 @@ import { sql } from "~/db/sql"; import * as Seasons from "~/features/mmr/core/Seasons"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { dateToDatabaseTimestamp } from "~/utils/dates"; const stm = sql.prepare(/* sql */ ` diff --git a/app/features/sendouq/queries/seasonStagesByUserId.server.ts b/app/features/sendouq/queries/seasonStagesByUserId.server.ts index b76ba6de1..989ec52fb 100644 --- a/app/features/sendouq/queries/seasonStagesByUserId.server.ts +++ b/app/features/sendouq/queries/seasonStagesByUserId.server.ts @@ -1,6 +1,6 @@ import { sql } from "~/db/sql"; import type { Tables } from "~/db/tables"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; const stm = sql.prepare(/* sql */ ` select diff --git a/app/features/sendouq/queries/weaponUsageStats.server.ts b/app/features/sendouq/queries/weaponUsageStats.server.ts index 0f85dd8bc..14b0b47b2 100644 --- a/app/features/sendouq/queries/weaponUsageStats.server.ts +++ b/app/features/sendouq/queries/weaponUsageStats.server.ts @@ -1,6 +1,10 @@ import { sql } from "~/db/sql"; import * as Seasons from "~/features/mmr/core/Seasons"; -import type { MainWeaponId, ModeShort, StageId } from "~/modules/in-game-lists"; +import type { + MainWeaponId, + ModeShort, + StageId, +} from "~/modules/in-game-lists/types"; import { dateToDatabaseTimestamp } from "~/utils/dates"; import { assertUnreachable } from "~/utils/types"; diff --git a/app/features/sendouq/routes/q.looking.test.ts b/app/features/sendouq/routes/q.looking.test.ts index f93f9645c..6c9373d44 100644 --- a/app/features/sendouq/routes/q.looking.test.ts +++ b/app/features/sendouq/routes/q.looking.test.ts @@ -5,7 +5,7 @@ import type { UserMapModePreferences } from "~/db/tables"; import type { matchSchema } from "~/features/sendouq-match/q-match-schemas"; import { action as rawMatchAction } from "~/features/sendouq-match/routes/q.match.$id"; import { BANNED_MAPS } from "~/features/sendouq-settings/banned-maps"; -import { stageIds } from "~/modules/in-game-lists"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; import { dbInsertUsers, dbReset, diff --git a/app/features/top-search/loaders/xsearch.server.ts b/app/features/top-search/loaders/xsearch.server.ts index b25f21e52..4f692d6f2 100644 --- a/app/features/top-search/loaders/xsearch.server.ts +++ b/app/features/top-search/loaders/xsearch.server.ts @@ -1,6 +1,6 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; -import type { RankedModeShort } from "~/modules/in-game-lists"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import type { RankedModeShort } from "~/modules/in-game-lists/types"; import { findPlacementsOfMonth } from "../queries/findPlacements.server"; import { monthYears } from "../queries/monthYears"; diff --git a/app/features/top-search/routes/xsearch.tsx b/app/features/top-search/routes/xsearch.tsx index 68cc2e887..068c0fecc 100644 --- a/app/features/top-search/routes/xsearch.tsx +++ b/app/features/top-search/routes/xsearch.tsx @@ -4,8 +4,8 @@ import { nanoid } from "nanoid"; import { useTranslation } from "react-i18next"; import { Main } from "~/components/Main"; import type { Tables } from "~/db/tables"; -import type { RankedModeShort } from "~/modules/in-game-lists"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import type { RankedModeShort } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { metaTags } from "~/utils/remix"; import type { SendouRouteHandle } from "~/utils/remix.server"; diff --git a/app/features/tournament-bracket/components/BracketMapListDialog.tsx b/app/features/tournament-bracket/components/BracketMapListDialog.tsx index 7153d2fc0..6a0960cfc 100644 --- a/app/features/tournament-bracket/components/BracketMapListDialog.tsx +++ b/app/features/tournament-bracket/components/BracketMapListDialog.tsx @@ -17,7 +17,7 @@ import { } from "~/features/tournament/routes/to.$id"; import { TOURNAMENT } from "~/features/tournament/tournament-constants"; import type { TournamentManagerDataSet } from "~/modules/brackets-manager/types"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { nullFilledArray } from "~/utils/arrays"; import { databaseTimestampToDate } from "~/utils/dates"; import invariant from "~/utils/invariant"; diff --git a/app/features/tournament-bracket/components/MatchActionsBanPicker.tsx b/app/features/tournament-bracket/components/MatchActionsBanPicker.tsx index 078f4affd..9eaa1798c 100644 --- a/app/features/tournament-bracket/components/MatchActionsBanPicker.tsx +++ b/app/features/tournament-bracket/components/MatchActionsBanPicker.tsx @@ -10,11 +10,8 @@ import { CrossIcon } from "~/components/icons/Cross"; import type { TournamentRoundMaps } from "~/db/tables"; import { useUser } from "~/features/auth/core/user"; import { useTournament } from "~/features/tournament/routes/to.$id"; -import { - type ModeShort, - type StageId, - modesShort, -} from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { stageImageUrl } from "~/utils/urls"; import * as PickBan from "../core/PickBan"; diff --git a/app/features/tournament-bracket/components/StartedMatch.tsx b/app/features/tournament-bracket/components/StartedMatch.tsx index c67123036..bf9c2dc58 100644 --- a/app/features/tournament-bracket/components/StartedMatch.tsx +++ b/app/features/tournament-bracket/components/StartedMatch.tsx @@ -18,7 +18,7 @@ import { useTournament } from "~/features/tournament/routes/to.$id"; import { resolveLeagueRoundStartDate } from "~/features/tournament/tournament-utils"; import { useIsMounted } from "~/hooks/useIsMounted"; import { useSearchParamState } from "~/hooks/useSearchParamState"; -import type { StageId } from "~/modules/in-game-lists"; +import type { StageId } from "~/modules/in-game-lists/types"; import { SPLATTERCOLOR_SCREEN_ID } from "~/modules/in-game-lists/weapon-ids"; import type { TournamentMapListMap } from "~/modules/tournament-map-list-generator"; import { nullFilledArray } from "~/utils/arrays"; diff --git a/app/features/tournament-bracket/core/PickBan.ts b/app/features/tournament-bracket/core/PickBan.ts index 840858173..89bd5b10a 100644 --- a/app/features/tournament-bracket/core/PickBan.ts +++ b/app/features/tournament-bracket/core/PickBan.ts @@ -4,7 +4,7 @@ import type { ModeShort, ModeWithStage, StageId, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import type { TournamentMapListMap } from "~/modules/tournament-map-list-generator"; import invariant from "~/utils/invariant"; import { logger } from "~/utils/logger"; diff --git a/app/features/tournament-bracket/core/Tournament.ts b/app/features/tournament-bracket/core/Tournament.ts index 310d9103d..673446588 100644 --- a/app/features/tournament-bracket/core/Tournament.ts +++ b/app/features/tournament-bracket/core/Tournament.ts @@ -15,7 +15,7 @@ import { } from "~/features/tournament/tournament-utils"; import type { TournamentManagerDataSet } from "~/modules/brackets-manager/types"; import type { Match, Stage } from "~/modules/brackets-model"; -import type { ModeShort } from "~/modules/in-game-lists"; +import type { ModeShort } from "~/modules/in-game-lists/types"; import { isAdmin } from "~/modules/permissions/utils"; import { databaseTimestampNow, diff --git a/app/features/tournament-bracket/core/mapList.server.ts b/app/features/tournament-bracket/core/mapList.server.ts index b56e800a8..0f636ddd7 100644 --- a/app/features/tournament-bracket/core/mapList.server.ts +++ b/app/features/tournament-bracket/core/mapList.server.ts @@ -3,7 +3,7 @@ import { MapPool } from "~/features/map-list-generator/core/map-pool"; import type * as PickBan from "~/features/tournament-bracket/core/PickBan"; import { mapPickingStyleToModes } from "~/features/tournament/tournament-utils"; import type { Round } from "~/modules/brackets-model"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import type { TournamentMapListMap } from "~/modules/tournament-map-list-generator"; import { type TournamentMaplistSource, diff --git a/app/features/tournament-bracket/core/toMapList.ts b/app/features/tournament-bracket/core/toMapList.ts index 7feaca878..3dc870588 100644 --- a/app/features/tournament-bracket/core/toMapList.ts +++ b/app/features/tournament-bracket/core/toMapList.ts @@ -3,7 +3,7 @@ import * as R from "remeda"; import type { Tables, TournamentRoundMaps } from "~/db/tables"; import type { Round } from "~/modules/brackets-model"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { SENDOUQ_DEFAULT_MAPS } from "~/modules/tournament-map-list-generator/constants"; import { logger } from "~/utils/logger"; import { assertUnreachable } from "~/utils/types"; diff --git a/app/features/tournament-bracket/queries/allMatchResultsByTournamentId.server.ts b/app/features/tournament-bracket/queries/allMatchResultsByTournamentId.server.ts index a4d773cde..50b61f992 100644 --- a/app/features/tournament-bracket/queries/allMatchResultsByTournamentId.server.ts +++ b/app/features/tournament-bracket/queries/allMatchResultsByTournamentId.server.ts @@ -1,5 +1,5 @@ import { sql } from "~/db/sql"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { parseDBArray, parseDBJsonArray } from "~/utils/sql"; diff --git a/app/features/tournament-bracket/tournament-bracket-utils.ts b/app/features/tournament-bracket/tournament-bracket-utils.ts index 350e5c43f..5796eca48 100644 --- a/app/features/tournament-bracket/tournament-bracket-utils.ts +++ b/app/features/tournament-bracket/tournament-bracket-utils.ts @@ -2,7 +2,7 @@ import type { TFunction } from "i18next"; import * as R from "remeda"; import type { Tables, TournamentRoundMaps } from "~/db/tables"; import type { TournamentManagerDataSet } from "~/modules/brackets-manager/types"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import type { TournamentMaplistSource } from "~/modules/tournament-map-list-generator"; import { seededRandom, diff --git a/app/features/tournament-subs/queries/findSubsByTournamentId.server.ts b/app/features/tournament-subs/queries/findSubsByTournamentId.server.ts index 5ebf4d312..758055395 100644 --- a/app/features/tournament-subs/queries/findSubsByTournamentId.server.ts +++ b/app/features/tournament-subs/queries/findSubsByTournamentId.server.ts @@ -1,6 +1,6 @@ import { sql } from "~/db/sql"; import type { Tables, UserWithPlusTier } from "~/db/tables"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; const stm = sql.prepare(/* sql */ ` select diff --git a/app/features/tournament-subs/routes/to.$id.subs.new.tsx b/app/features/tournament-subs/routes/to.$id.subs.new.tsx index 694f1cd81..e0a35303a 100644 --- a/app/features/tournament-subs/routes/to.$id.subs.new.tsx +++ b/app/features/tournament-subs/routes/to.$id.subs.new.tsx @@ -10,7 +10,7 @@ import { RequiredHiddenInput } from "~/components/RequiredHiddenInput"; import { SubmitButton } from "~/components/SubmitButton"; import { TrashIcon } from "~/components/icons/Trash"; import { useUser } from "~/features/auth/core/user"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { TOURNAMENT_SUB } from "../tournament-subs-constants"; diff --git a/app/features/tournament-subs/tournament-subs-schemas.server.ts b/app/features/tournament-subs/tournament-subs-schemas.server.ts index 57579b17f..2ffd86012 100644 --- a/app/features/tournament-subs/tournament-subs-schemas.server.ts +++ b/app/features/tournament-subs/tournament-subs-schemas.server.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { mainWeaponIds } from "~/modules/in-game-lists"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import { id, processMany, removeDuplicates, safeJSONParse } from "~/utils/zod"; import { TOURNAMENT_SUB } from "./tournament-subs-constants"; diff --git a/app/features/tournament/TournamentRepository.server.ts b/app/features/tournament/TournamentRepository.server.ts index 21378d9f5..589ed932a 100644 --- a/app/features/tournament/TournamentRepository.server.ts +++ b/app/features/tournament/TournamentRepository.server.ts @@ -11,7 +11,7 @@ import type { } from "~/db/tables"; import * as Progression from "~/features/tournament-bracket/core/Progression"; import { Status } from "~/modules/brackets-model"; -import { modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; import { nullFilledArray, nullifyingAvg } from "~/utils/arrays"; import { databaseTimestampNow, dateToDatabaseTimestamp } from "~/utils/dates"; import { COMMON_USER_FIELDS, userChatNameColor } from "~/utils/kysely.server"; diff --git a/app/features/tournament/core/sets.server.ts b/app/features/tournament/core/sets.server.ts index b06184cd9..593ec2d63 100644 --- a/app/features/tournament/core/sets.server.ts +++ b/app/features/tournament/core/sets.server.ts @@ -1,5 +1,5 @@ import type { Tables } from "~/db/tables"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import type { TournamentMaplistSource } from "~/modules/tournament-map-list-generator"; import { sourceTypes } from "~/modules/tournament-map-list-generator"; import invariant from "~/utils/invariant"; diff --git a/app/features/tournament/queries/setHistoryByTeamId.server.ts b/app/features/tournament/queries/setHistoryByTeamId.server.ts index 65792375f..cfe88b11f 100644 --- a/app/features/tournament/queries/setHistoryByTeamId.server.ts +++ b/app/features/tournament/queries/setHistoryByTeamId.server.ts @@ -1,7 +1,7 @@ import * as R from "remeda"; import { sql } from "~/db/sql"; import type { Tables } from "~/db/tables"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { parseDBArray } from "~/utils/sql"; const stm = sql.prepare(/* sql */ ` diff --git a/app/features/tournament/tournament-utils.ts b/app/features/tournament/tournament-utils.ts index 663627863..fd7fc9b58 100644 --- a/app/features/tournament/tournament-utils.ts +++ b/app/features/tournament/tournament-utils.ts @@ -1,7 +1,7 @@ import * as R from "remeda"; import { INVITE_CODE_LENGTH } from "~/constants"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; import { modesShort, rankedModesShort } from "~/modules/in-game-lists/modes"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { weekNumberToDate } from "~/utils/dates"; import { tournamentLogoUrl } from "~/utils/urls"; import type { Tables, TournamentStageSettings } from "../../db/tables"; diff --git a/app/features/user-page/actions/u.$identifier.builds.new.server.ts b/app/features/user-page/actions/u.$identifier.builds.new.server.ts index 73562e17e..4a1b3e160 100644 --- a/app/features/user-page/actions/u.$identifier.builds.new.server.ts +++ b/app/features/user-page/actions/u.$identifier.builds.new.server.ts @@ -9,9 +9,9 @@ import type { BuildWeaponWithTop500Info } from "~/features/builds/queries/builds import { clothesGearIds, headGearIds, - modesShort, shoesGearIds, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/gear-ids"; +import { modesShort } from "~/modules/in-game-lists/modes"; import type { BuildAbilitiesTuple, MainWeaponId, diff --git a/app/features/user-page/core/build-sorting.server.test.ts b/app/features/user-page/core/build-sorting.server.test.ts index 627e63c51..70b7c9206 100644 --- a/app/features/user-page/core/build-sorting.server.test.ts +++ b/app/features/user-page/core/build-sorting.server.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from "vitest"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { databaseTimestampNow } from "~/utils/dates"; import { sortBuilds } from "./build-sorting.server"; diff --git a/app/features/user-page/core/build-sorting.server.ts b/app/features/user-page/core/build-sorting.server.ts index 244679442..8786e67d2 100644 --- a/app/features/user-page/core/build-sorting.server.ts +++ b/app/features/user-page/core/build-sorting.server.ts @@ -1,6 +1,7 @@ import type { BuildSort } from "~/db/tables"; import type * as BuildRepository from "~/features/builds/BuildRepository.server"; -import { type MainWeaponId, modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { weaponIdToBucketId } from "~/modules/in-game-lists/weapon-ids"; import { DEFAULT_BUILD_SORT } from "../user-page-constants"; diff --git a/app/features/user-page/loaders/u.$identifier.builds.new.server.ts b/app/features/user-page/loaders/u.$identifier.builds.new.server.ts index 2073c67c3..b8f07722d 100644 --- a/app/features/user-page/loaders/u.$identifier.builds.new.server.ts +++ b/app/features/user-page/loaders/u.$identifier.builds.new.server.ts @@ -2,7 +2,7 @@ import type { LoaderFunctionArgs } from "@remix-run/node"; import { z } from "zod"; import { requireUserId } from "~/features/auth/core/user.server"; import * as BuildRepository from "~/features/builds/BuildRepository.server"; -import type { Ability } from "~/modules/in-game-lists"; +import type { Ability } from "~/modules/in-game-lists/types"; import { actualNumber, id } from "~/utils/zod"; const newBuildLoaderParamsSchema = z.object({ diff --git a/app/features/user-page/loaders/u.$identifier.builds.server.ts b/app/features/user-page/loaders/u.$identifier.builds.server.ts index 48b8f8fa3..60ad90322 100644 --- a/app/features/user-page/loaders/u.$identifier.builds.server.ts +++ b/app/features/user-page/loaders/u.$identifier.builds.server.ts @@ -3,7 +3,7 @@ import { getUserId } from "~/features/auth/core/user.server"; import * as BuildRepository from "~/features/builds/BuildRepository.server"; import { sortAbilities } from "~/features/builds/core/ability-sorting.server"; import * as UserRepository from "~/features/user-page/UserRepository.server"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import type { SerializeFrom } from "~/utils/remix"; import { notFoundIfFalsy, privatelyCachedJson } from "~/utils/remix.server"; import { sortBuilds } from "../core/build-sorting.server"; diff --git a/app/features/user-page/routes/u.$identifier.builds.new.tsx b/app/features/user-page/routes/u.$identifier.builds.new.tsx index 120c58cc3..6d992931b 100644 --- a/app/features/user-page/routes/u.$identifier.builds.new.tsx +++ b/app/features/user-page/routes/u.$identifier.builds.new.tsx @@ -24,7 +24,7 @@ import { validatedBuildFromSearchParams, validatedWeaponIdFromSearchParams, } from "~/features/build-analyzer"; -import { modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; import type { BuildAbilitiesTupleWithUnknown, diff --git a/app/features/user-page/routes/u.$identifier.builds.tsx b/app/features/user-page/routes/u.$identifier.builds.tsx index 51b8ee218..73c24e655 100644 --- a/app/features/user-page/routes/u.$identifier.builds.tsx +++ b/app/features/user-page/routes/u.$identifier.builds.tsx @@ -15,8 +15,7 @@ import { UnlockIcon } from "~/components/icons/Unlock"; import { BUILD_SORT_IDENTIFIERS, type BuildSort } from "~/db/tables"; import { useUser } from "~/features/auth/core/user"; import { useSearchParamState } from "~/hooks/useSearchParamState"; -import type { MainWeaponId } from "~/modules/in-game-lists"; -import { mainWeaponIds } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { atOrError } from "~/utils/arrays"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { weaponCategoryUrl } from "~/utils/urls"; @@ -24,6 +23,7 @@ import { SendouButton } from "../../../components/elements/Button"; import type { UserPageLoaderData } from "../loaders/u.$identifier.server"; import { DEFAULT_BUILD_SORT } from "../user-page-constants"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import { action } from "../actions/u.$identifier.builds.server"; import { type UserBuildsPageData, diff --git a/app/features/user-page/routes/u.$identifier.edit.test.ts b/app/features/user-page/routes/u.$identifier.edit.test.ts index 52cf3bc00..cca22759b 100644 --- a/app/features/user-page/routes/u.$identifier.edit.test.ts +++ b/app/features/user-page/routes/u.$identifier.edit.test.ts @@ -1,5 +1,5 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { dbInsertUsers, dbReset, wrappedAction } from "~/utils/Test"; import type { userEditActionSchema } from "../user-page-schemas.server"; import { action as editUserProfileAction } from "./u.$identifier.edit"; diff --git a/app/features/user-page/routes/u.$identifier.edit.tsx b/app/features/user-page/routes/u.$identifier.edit.tsx index ed74e7ef7..5b5a0e34f 100644 --- a/app/features/user-page/routes/u.$identifier.edit.tsx +++ b/app/features/user-page/routes/u.$identifier.edit.tsx @@ -19,7 +19,7 @@ import { USER } from "~/constants"; import type { Tables } from "~/db/tables"; import { BADGE } from "~/features/badges/badges-contants"; import { BadgesSelector } from "~/features/badges/components/BadgesSelector"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { useHasRole } from "~/modules/permissions/hooks"; import invariant from "~/utils/invariant"; import { rawSensToString } from "~/utils/strings"; diff --git a/app/features/user-page/routes/u.$identifier.index.tsx b/app/features/user-page/routes/u.$identifier.index.tsx index 3475f4d2d..6bbdfa8c9 100644 --- a/app/features/user-page/routes/u.$identifier.index.tsx +++ b/app/features/user-page/routes/u.$identifier.index.tsx @@ -12,7 +12,7 @@ import { DiscordIcon } from "~/components/icons/Discord"; import { TwitchIcon } from "~/components/icons/Twitch"; import { YouTubeIcon } from "~/components/icons/YouTube"; import { BadgeDisplay } from "~/features/badges/components/BadgeDisplay"; -import { modesShort } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; import { databaseTimestampToDate } from "~/utils/dates"; import invariant from "~/utils/invariant"; import type { SendouRouteHandle } from "~/utils/remix.server"; diff --git a/app/features/user-page/routes/u.$identifier.seasons.tsx b/app/features/user-page/routes/u.$identifier.seasons.tsx index e4e5576cb..739478667 100644 --- a/app/features/user-page/routes/u.$identifier.seasons.tsx +++ b/app/features/user-page/routes/u.$identifier.seasons.tsx @@ -28,12 +28,9 @@ import * as Seasons from "~/features/mmr/core/Seasons"; import { ordinalToSp } from "~/features/mmr/mmr-utils"; import { useWeaponUsage } from "~/hooks/swr"; import { useIsMounted } from "~/hooks/useIsMounted"; -import { - type ModeShort, - type StageId, - stageIds, -} from "~/modules/in-game-lists"; import { modesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { atOrError } from "~/utils/arrays"; import { databaseTimestampToDate } from "~/utils/dates"; import invariant from "~/utils/invariant"; diff --git a/app/features/vods/queries/findVods.server.ts b/app/features/vods/queries/findVods.server.ts index 811c3ed3a..bf83d1d52 100644 --- a/app/features/vods/queries/findVods.server.ts +++ b/app/features/vods/queries/findVods.server.ts @@ -1,7 +1,11 @@ import * as R from "remeda"; import { sql } from "~/db/sql"; import type { Tables } from "~/db/tables"; -import type { MainWeaponId, ModeShort, StageId } from "~/modules/in-game-lists"; +import type { + MainWeaponId, + ModeShort, + StageId, +} from "~/modules/in-game-lists/types"; import { parseDBArray, parseDBJsonArray } from "~/utils/sql"; import { weaponIdToArrayWithAlts } from "../../../modules/in-game-lists/weapon-ids"; import { VODS_PAGE_BATCH_SIZE } from "../vods-constants"; diff --git a/app/features/vods/routes/vods.new.tsx b/app/features/vods/routes/vods.new.tsx index 4e600e71c..a79417f98 100644 --- a/app/features/vods/routes/vods.new.tsx +++ b/app/features/vods/routes/vods.new.tsx @@ -18,11 +18,9 @@ import { UserSearch } from "~/components/elements/UserSearch"; import { AddFieldButton } from "~/components/form/AddFieldButton"; import { RemoveFieldButton } from "~/components/form/RemoveFieldButton"; import type { Tables } from "~/db/tables"; -import { - type MainWeaponId, - modesShort, - stageIds, -} from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import { useHasRole } from "~/modules/permissions/hooks"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { Alert } from "../../../components/Alert"; diff --git a/app/features/vods/routes/vods.tsx b/app/features/vods/routes/vods.tsx index c997b45e8..f2dfcd359 100644 --- a/app/features/vods/routes/vods.tsx +++ b/app/features/vods/routes/vods.tsx @@ -5,7 +5,9 @@ import { Button } from "~/components/Button"; import { WeaponCombobox } from "~/components/Combobox"; import { Label } from "~/components/Label"; import { Main } from "~/components/Main"; -import { mainWeaponIds, modesShort, stageIds } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import { metaTags } from "~/utils/remix"; import type { SendouRouteHandle } from "~/utils/remix.server"; import { VODS_PAGE, navIconUrl } from "~/utils/urls"; diff --git a/app/features/vods/vods-types.ts b/app/features/vods/vods-types.ts index 035d62b2f..dbef67b54 100644 --- a/app/features/vods/vods-types.ts +++ b/app/features/vods/vods-types.ts @@ -1,6 +1,6 @@ import type { z } from "zod"; import type { Tables } from "~/db/tables"; -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import type { videoMatchSchema, videoSchema } from "./vods-schemas"; export type VideoBeingAddedPartial = Partial; diff --git a/app/hooks/swr.ts b/app/hooks/swr.ts index 1af229400..04915c103 100644 --- a/app/hooks/swr.ts +++ b/app/hooks/swr.ts @@ -3,7 +3,7 @@ import type { EventsWithMapPoolsLoaderData } from "~/features/calendar/routes/ma import type { PatronsListLoaderData } from "~/features/front-page/routes/patrons-list"; import type { TrustersLoaderData } from "~/features/sendouq/routes/trusters"; import type { WeaponUsageLoaderData } from "~/features/sendouq/routes/weapon-usage"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { GET_ALL_EVENTS_WITH_MAP_POOLS_ROUTE, GET_TRUSTERS_ROUTE, diff --git a/app/modules/in-game-lists/index.ts b/app/modules/in-game-lists/index.ts deleted file mode 100644 index 37bb0b53d..000000000 --- a/app/modules/in-game-lists/index.ts +++ /dev/null @@ -1,59 +0,0 @@ -export { modesShort } from "./modes"; -export { - weaponCategories, - mainWeaponIds, - weaponIdToAltId, - weaponIdIsNotAlt, - subWeaponIds, - specialWeaponIds, - exampleMainWeaponIdWithSpecialWeaponId, - nonBombSubWeaponIds, - nonDamagingSpecialWeaponIds, - SPLAT_BOMB_ID, - SUCTION_BOMB_ID, - BURST_BOMB_ID, - SPRINKLER_ID, - SPLASH_WALL_ID, - FIZZY_BOMB_ID, - CURLING_BOMB_ID, - AUTO_BOMB_ID, - SQUID_BEAKON_ID, - POINT_SENSOR_ID, - INK_MINE_ID, - TOXIC_MIST_ID, - ANGLE_SHOOTER_ID, - TORPEDO_ID, - TRIZOOKA_ID, - BIG_BUBBLER_ID, - ZIPCASTER_ID, - TENTA_MISSILES_ID, - INK_STORM_ID, - BOOYAH_BOMB_ID, - WAVE_BREAKER_ID, - INK_VAC_ID, - KILLER_WAIL_ID, - INKJET_ID, - ULTRA_STAMP_ID, - CRAB_TANK_ID, - REEF_SLIDER_ID, - TRIPLE_INKSTRIKE_ID, - TACTICOOLER_ID, -} from "./weapon-ids"; -export { headGearIds, clothesGearIds, shoesGearIds } from "./gear-ids"; -export { abilitiesShort, abilities } from "./abilities"; -export type { - Ability, - AbilityType, - AbilityWithUnknown, - ModeShort, - ModeWithStage, - StageId, - BuildAbilitiesTuple, - BuildAbilitiesTupleWithUnknown, - MainWeaponId, - SubWeaponId, - SpecialWeaponId, - RankedModeShort, -} from "./types"; -export { isAbility } from "./utils"; -export { stageIds } from "./stage-ids"; diff --git a/app/modules/tournament-map-list-generator/constants.ts b/app/modules/tournament-map-list-generator/constants.ts index ac7809b15..b30391f75 100644 --- a/app/modules/tournament-map-list-generator/constants.ts +++ b/app/modules/tournament-map-list-generator/constants.ts @@ -1,9 +1,9 @@ import { MapPool } from "~/features/map-list-generator/core/map-pool"; import { BANNED_MAPS } from "~/features/sendouq-settings/banned-maps"; import invariant from "~/utils/invariant"; -import type { ModeShort, StageId } from "../in-game-lists"; -import { modesShort } from "../in-game-lists"; +import { modesShort } from "../in-game-lists/modes"; import { stagesObj as s } from "../in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "../in-game-lists/types"; export const SENDOUQ_DEFAULT_MAPS: Record< ModeShort, diff --git a/app/modules/tournament-map-list-generator/generation.test.ts b/app/modules/tournament-map-list-generator/generation.test.ts index 98cdb94f7..b51a14059 100644 --- a/app/modules/tournament-map-list-generator/generation.test.ts +++ b/app/modules/tournament-map-list-generator/generation.test.ts @@ -1,8 +1,8 @@ import { describe, expect, test } from "vitest"; import { MapPool } from "~/features/map-list-generator/core/map-pool"; import { createTournamentMapList } from "."; -import type { RankedModeShort } from "../in-game-lists"; import { rankedModesShort } from "../in-game-lists/modes"; +import type { RankedModeShort } from "../in-game-lists/types"; import { DEFAULT_MAP_POOL } from "./constants"; import type { TournamentMaplistInput } from "./types"; diff --git a/app/modules/tournament-map-list-generator/starter-map.ts b/app/modules/tournament-map-list-generator/starter-map.ts index c2c5af489..612a53071 100644 --- a/app/modules/tournament-map-list-generator/starter-map.ts +++ b/app/modules/tournament-map-list-generator/starter-map.ts @@ -2,13 +2,15 @@ // if a tie breaker -> random tiebreaker // seed = always same +import { stageIds } from "~/modules/in-game-lists/stage-ids"; import { logger } from "~/utils/logger"; import { type TournamentMapListMap, type TournamentMaplistInput, seededRandom, } from "."; -import { type ModeWithStage, modesShort, stageIds } from "../in-game-lists"; +import { modesShort } from "../in-game-lists/modes"; +import type { ModeWithStage } from "../in-game-lists/types"; type StarterMapArgs = Pick< TournamentMaplistInput, diff --git a/app/modules/tournament-map-list-generator/tournament-map-list.ts b/app/modules/tournament-map-list-generator/tournament-map-list.ts index a994fe89c..e290b81ef 100644 --- a/app/modules/tournament-map-list-generator/tournament-map-list.ts +++ b/app/modules/tournament-map-list-generator/tournament-map-list.ts @@ -1,5 +1,6 @@ +import { stageIds } from "~/modules/in-game-lists/stage-ids"; import invariant from "~/utils/invariant"; -import { type ModeShort, type StageId, stageIds } from "../in-game-lists"; +import type { ModeShort, StageId } from "../in-game-lists/types"; import { DEFAULT_MAP_POOL } from "./constants"; import type { TournamentMapListMap, diff --git a/app/modules/tournament-map-list-generator/types.ts b/app/modules/tournament-map-list-generator/types.ts index c8c377df9..08bc1c692 100644 --- a/app/modules/tournament-map-list-generator/types.ts +++ b/app/modules/tournament-map-list-generator/types.ts @@ -1,5 +1,5 @@ import type { MapPool } from "~/features/map-list-generator/core/map-pool"; -import type { ModeShort, ModeWithStage } from "../in-game-lists"; +import type { ModeShort, ModeWithStage } from "../in-game-lists/types"; import type { sourceTypes } from "./constants"; export type BracketType = diff --git a/app/utils/unslugify.server.ts b/app/utils/unslugify.server.ts index 63312aee3..30592f3bc 100644 --- a/app/utils/unslugify.server.ts +++ b/app/utils/unslugify.server.ts @@ -1,4 +1,4 @@ -import type { MainWeaponId } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; import weaponTranslations from "../../locales/en/weapons.json"; import { mySlugify } from "./urls"; diff --git a/app/utils/urls.ts b/app/utils/urls.ts index f7a173c1b..595b0db15 100644 --- a/app/utils/urls.ts +++ b/app/utils/urls.ts @@ -7,7 +7,7 @@ import type { CalendarFilters } from "~/features/calendar/calendar-types"; import type { StageBackgroundStyle } from "~/features/map-planner"; import type { TierName } from "~/features/mmr/mmr-constants"; import { JOIN_CODE_SEARCH_PARAM_KEY } from "~/features/sendouq/q-constants"; -import type { ModeShort, weaponCategories } from "~/modules/in-game-lists"; +import type { ModeShort } from "~/modules/in-game-lists/types"; import type { Ability, AbilityWithUnknown, @@ -18,6 +18,7 @@ import type { StageId, SubWeaponId, } from "~/modules/in-game-lists/types"; +import type { weaponCategories } from "~/modules/in-game-lists/weapon-ids"; import type { DayMonthYear } from "~/utils/zod"; const staticAssetsUrl = ({ diff --git a/app/utils/zod.ts b/app/utils/zod.ts index af9aaaff2..f841e99e1 100644 --- a/app/utils/zod.ts +++ b/app/utils/zod.ts @@ -1,8 +1,12 @@ import type { ZodType } from "zod"; import { z } from "zod"; import { CUSTOM_CSS_VAR_COLORS, INVITE_CODE_LENGTH } from "~/constants"; -import type { abilitiesShort } from "~/modules/in-game-lists"; -import { abilities, mainWeaponIds, stageIds } from "~/modules/in-game-lists"; +import { + abilities, + type abilitiesShort, +} from "~/modules/in-game-lists/abilities"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import { FRIEND_CODE_REGEXP } from "../features/sendouq/q-constants"; import type { Unpacked } from "./types"; import { assertType } from "./types"; diff --git a/e2e/tournament.spec.ts b/e2e/tournament.spec.ts index 6f77b507e..3d2078f60 100644 --- a/e2e/tournament.spec.ts +++ b/e2e/tournament.spec.ts @@ -3,8 +3,8 @@ import { ADMIN_ID } from "~/constants"; import { NZAP_TEST_ID } from "~/db/seed/constants"; import { BANNED_MAPS } from "~/features/sendouq-settings/banned-maps"; import type { TournamentLoaderData } from "~/features/tournament/loaders/to.$id.server"; -import type { StageId } from "~/modules/in-game-lists"; import { rankedModesShort } from "~/modules/in-game-lists/modes"; +import type { StageId } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { fetchSendouInk, diff --git a/scripts/create-analyzer-json.ts b/scripts/create-analyzer-json.ts index c46f22b18..c59cd3706 100644 --- a/scripts/create-analyzer-json.ts +++ b/scripts/create-analyzer-json.ts @@ -11,8 +11,11 @@ import fs from "node:fs"; import { z } from "zod"; import type { MainWeaponParams, SubWeaponParams } from "~/modules/analyzer"; import type { ParamsJson } from "~/modules/analyzer/types"; -import { SQUID_BEAKON_ID, type SpecialWeaponId } from "~/modules/in-game-lists"; -import { type SubWeaponId, subWeaponIds } from "~/modules/in-game-lists"; +import { + SQUID_BEAKON_ID, + type SpecialWeaponId, +} from "~/modules/in-game-lists/types"; +import { type SubWeaponId, subWeaponIds } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import playersParams from "./dicts/SplPlayer.game__GameParameterTable.json"; import weapons from "./dicts/WeaponInfoMain.json"; diff --git a/scripts/create-misc-json.ts b/scripts/create-misc-json.ts index 6334c5331..024cd4087 100644 --- a/scripts/create-misc-json.ts +++ b/scripts/create-misc-json.ts @@ -1,7 +1,7 @@ // @ts-nocheck import fs from "node:fs"; -import { abilitiesShort } from "~/modules/in-game-lists"; +import { abilitiesShort } from "~/modules/in-game-lists/types"; import invariant from "~/utils/invariant"; import { LANG_JSONS_TO_CREATE, diff --git a/scripts/create-object-dmg-json.ts b/scripts/create-object-dmg-json.ts index a7bdef352..92ba41b4a 100644 --- a/scripts/create-object-dmg-json.ts +++ b/scripts/create-object-dmg-json.ts @@ -6,7 +6,7 @@ import { mainWeaponIds, specialWeaponIds, subWeaponIds, -} from "~/modules/in-game-lists"; +} from "~/modules/in-game-lists/types"; import weapons from "./dicts/WeaponInfoMain.json"; import specialWeapons from "./dicts/WeaponInfoSpecial.json"; import subWeapons from "./dicts/WeaponInfoSub.json"; diff --git a/scripts/map-popularity-q.ts b/scripts/map-popularity-q.ts index 1ee1f68ee..d72cf8a46 100644 --- a/scripts/map-popularity-q.ts +++ b/scripts/map-popularity-q.ts @@ -1,8 +1,9 @@ import "dotenv/config"; import { db } from "~/db/sql"; import { BANNED_MAPS } from "~/features/sendouq-settings/banned-maps"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; -import { modesShort, stageIds } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { databaseTimestampToDate, dateToDatabaseTimestamp, diff --git a/scripts/map-popularity.ts b/scripts/map-popularity.ts index 77f07ed2d..bb7c4de6b 100644 --- a/scripts/map-popularity.ts +++ b/scripts/map-popularity.ts @@ -1,8 +1,9 @@ import "dotenv/config"; import { db } from "~/db/sql"; import { BANNED_MAPS } from "~/features/sendouq-settings/banned-maps"; -import type { ModeShort, StageId } from "~/modules/in-game-lists"; -import { modesShort, stageIds } from "~/modules/in-game-lists"; +import { modesShort } from "~/modules/in-game-lists/modes"; +import { stageIds } from "~/modules/in-game-lists/stage-ids"; +import type { ModeShort, StageId } from "~/modules/in-game-lists/types"; import { databaseTimestampToDate } from "~/utils/dates"; import { logger } from "~/utils/logger"; import { cutToNDecimalPlaces } from "~/utils/number"; diff --git a/scripts/placements/index.ts b/scripts/placements/index.ts index b7ae0c4d0..e81be33fd 100644 --- a/scripts/placements/index.ts +++ b/scripts/placements/index.ts @@ -3,7 +3,8 @@ import "dotenv/config"; import { sql } from "~/db/sql"; import type { Tables } from "~/db/tables"; import { syncXPBadges } from "~/features/badges/queries/syncXPBadges.server"; -import { type MainWeaponId, mainWeaponIds } from "~/modules/in-game-lists"; +import type { MainWeaponId } from "~/modules/in-game-lists/types"; +import { mainWeaponIds } from "~/modules/in-game-lists/weapon-ids"; import invariant from "~/utils/invariant"; import { logger } from "~/utils/logger"; import { xRankSchema } from "./schemas";