diff --git a/components/analyzer/BuildStats.tsx b/components/analyzer/BuildStats.tsx index 59f1fb8ee..63dd51388 100644 --- a/components/analyzer/BuildStats.tsx +++ b/components/analyzer/BuildStats.tsx @@ -13,9 +13,9 @@ import { ViewSlotsAbilities } from "components/builds/ViewSlots"; import AbilityIcon from "components/common/AbilityIcon"; import { useMyTheme } from "hooks/common"; import { Explanation } from "hooks/useAbilityEffects"; -import { isMainAbility } from "lib/lists/abilities"; import { useState } from "react"; import { FaChartLine, FaQuestion } from "react-icons/fa"; +import { isMainAbility } from "utils/lists/abilities"; import StatChart from "./StatChart"; interface BuildStatsProps { diff --git a/components/analyzer/EditableBuilds.tsx b/components/analyzer/EditableBuilds.tsx index a28a5fb80..fab4fc24f 100644 --- a/components/analyzer/EditableBuilds.tsx +++ b/components/analyzer/EditableBuilds.tsx @@ -2,8 +2,8 @@ import { Box, Button, Flex, IconButton } from "@chakra-ui/react"; import { t } from "@lingui/macro"; import ViewSlots, { ViewSlotsAbilities } from "components/builds/ViewSlots"; import AbilitiesSelector from "components/u/AbilitiesSelector"; -import { AbilityOrUnknown } from "lib/types"; import { FiCopy, FiEdit, FiSquare } from "react-icons/fi"; +import { AbilityOrUnknown } from "utils/types"; import HeadOnlyToggle from "./HeadOnlyToggle"; import LdeSlider from "./LdeSlider"; diff --git a/components/analyzer/StatChart.tsx b/components/analyzer/StatChart.tsx index 07f4589bf..d3d085565 100644 --- a/components/analyzer/StatChart.tsx +++ b/components/analyzer/StatChart.tsx @@ -1,6 +1,5 @@ import { t } from "@lingui/macro"; import { useMyTheme } from "hooks/common"; -import { abilityPoints } from "lib/lists/abilityPoints"; import React from "react"; import { CartesianGrid, @@ -12,6 +11,7 @@ import { XAxis, YAxis, } from "recharts"; +import { abilityPoints } from "utils/lists/abilityPoints"; interface StatChartProps { title: string; diff --git a/components/builds/APStats.tsx b/components/builds/APStats.tsx index 565c734a7..db3574a1c 100644 --- a/components/builds/APStats.tsx +++ b/components/builds/APStats.tsx @@ -10,7 +10,7 @@ import { TableHeader, TableRow, } from "components/common/Table"; -import { mainOnlyAbilities } from "lib/lists/abilities"; +import { mainOnlyAbilities } from "utils/lists/abilities"; interface Props { stats: { diff --git a/components/builds/BuildCard.tsx b/components/builds/BuildCard.tsx index d162f5fbc..a3c97fa2d 100644 --- a/components/builds/BuildCard.tsx +++ b/components/builds/BuildCard.tsx @@ -16,11 +16,11 @@ import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { getEmojiFlag } from "countries-list"; import { useMyTheme } from "hooks/common"; -import { PartialBy } from "lib/types"; import Image from "next/image"; import Link from "next/link"; import { useState } from "react"; import { FiBarChart2, FiEdit, FiInfo, FiTarget } from "react-icons/fi"; +import { PartialBy } from "utils/types"; import Gears from "./Gears"; import ViewAP from "./ViewAP"; import ViewSlots from "./ViewSlots"; diff --git a/components/builds/BuildFilters.tsx b/components/builds/BuildFilters.tsx index cddeddf06..b4e911926 100644 --- a/components/builds/BuildFilters.tsx +++ b/components/builds/BuildFilters.tsx @@ -19,9 +19,9 @@ import { UseBuildsByWeaponState, } from "hooks/builds"; import { useMyTheme } from "hooks/common"; -import { abilities, isMainAbility } from "lib/lists/abilities"; import { Fragment, useState } from "react"; import { FiTrash } from "react-icons/fi"; +import { abilities, isMainAbility } from "utils/lists/abilities"; interface Props { filters: UseBuildsByWeaponState["filters"]; diff --git a/components/builds/ViewAP.tsx b/components/builds/ViewAP.tsx index 4cc72999d..1357b7e9d 100644 --- a/components/builds/ViewAP.tsx +++ b/components/builds/ViewAP.tsx @@ -3,7 +3,7 @@ import { t } from "@lingui/macro"; import { Ability } from "@prisma/client"; import AbilityIcon from "components/common/AbilityIcon"; import { useMyTheme } from "hooks/common"; -import { mainOnlyAbilities } from "lib/lists/abilities"; +import { mainOnlyAbilities } from "utils/lists/abilities"; interface ViewAPProps { aps: Record; diff --git a/components/builds/ViewSlots.tsx b/components/builds/ViewSlots.tsx index 2095bb1d9..c9645c588 100644 --- a/components/builds/ViewSlots.tsx +++ b/components/builds/ViewSlots.tsx @@ -1,6 +1,6 @@ import { Box, BoxProps, Flex } from "@chakra-ui/react"; import AbilityIcon from "components/common/AbilityIcon"; -import { AbilityOrUnknown } from "lib/types"; +import { AbilityOrUnknown } from "utils/types"; export type ViewSlotsAbilities = { headAbilities: AbilityOrUnknown[]; diff --git a/components/common/Emoji.tsx b/components/common/Emoji.tsx index 96d3cf4af..98dab2f24 100644 --- a/components/common/Emoji.tsx +++ b/components/common/Emoji.tsx @@ -1,10 +1,10 @@ import AbilityIcon from "components/common/AbilityIcon"; import GearImage from "components/common/GearImage"; import WeaponImage from "components/common/WeaponImage"; -import { abilityMarkdownCodes } from "lib/lists/abilityMarkdownCodes"; -import { gearMarkdownCodes } from "lib/lists/gearMarkdownCodes"; -import { codeToWeapon } from "lib/lists/weaponCodes"; import Image from "next/image"; +import { abilityMarkdownCodes } from "utils/lists/abilityMarkdownCodes"; +import { gearMarkdownCodes } from "utils/lists/gearMarkdownCodes"; +import { codeToWeapon } from "utils/lists/weaponCodes"; const modeCodes: Record = { turf_war: "TW", diff --git a/components/common/GearImage.tsx b/components/common/GearImage.tsx index da3562702..c8d817704 100644 --- a/components/common/GearImage.tsx +++ b/components/common/GearImage.tsx @@ -1,7 +1,7 @@ import { useLingui } from "@lingui/react"; -import englishToInteral from "lib/data/englishToInternal.json"; import Image from "next/image"; import React from "react"; +import englishToInteral from "utils/data/englishToInternal.json"; interface GearImageProps { englishName: string; diff --git a/components/common/GearSelector.tsx b/components/common/GearSelector.tsx index 19452189f..226d0a55f 100644 --- a/components/common/GearSelector.tsx +++ b/components/common/GearSelector.tsx @@ -1,7 +1,7 @@ import { Box, Flex } from "@chakra-ui/react"; import { useLingui } from "@lingui/react"; -import { gear } from "lib/lists/gear"; import { components } from "react-select"; +import { gear } from "utils/lists/gear"; import GearImage from "./GearImage"; import MySelect from "./MySelect"; diff --git a/components/common/WeaponSelector.tsx b/components/common/WeaponSelector.tsx index 213b50a7f..d026938a1 100644 --- a/components/common/WeaponSelector.tsx +++ b/components/common/WeaponSelector.tsx @@ -1,11 +1,11 @@ import { Box, Center, Flex } from "@chakra-ui/react"; import { t, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; +import { components } from "react-select"; import { salmonRunWeapons, weaponsWithHeroCategorized, -} from "lib/lists/weaponsWithHero"; -import { components } from "react-select"; +} from "utils/lists/weaponsWithHero"; import MySelect from "./MySelect"; import WeaponImage from "./WeaponImage"; diff --git a/components/freeagents/FAModal.tsx b/components/freeagents/FAModal.tsx index fa8904519..6ed69404c 100644 --- a/components/freeagents/FAModal.tsx +++ b/components/freeagents/FAModal.tsx @@ -23,18 +23,18 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { t, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import MarkdownTextarea from "components/common/MarkdownTextarea"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; -import { Unpacked } from "lib/types"; -import { - FA_POST_CONTENT_LIMIT, - freeAgentPostSchema, -} from "lib/validators/fapost"; import { GetAllFreeAgentPostsData } from "prisma/queries/getAllFreeAgentPosts"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { FiTrash } from "react-icons/fi"; import { mutate } from "swr"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; +import { Unpacked } from "utils/types"; +import { + FA_POST_CONTENT_LIMIT, + freeAgentPostSchema, +} from "utils/validators/fapost"; import * as z from "zod"; interface Props { diff --git a/components/layout/FooterContent.tsx b/components/layout/FooterContent.tsx index 3c5b463b4..4d541b576 100644 --- a/components/layout/FooterContent.tsx +++ b/components/layout/FooterContent.tsx @@ -1,9 +1,9 @@ import { Box, Flex } from "@chakra-ui/react"; import { useMyTheme } from "hooks/common"; -import { DiscordIcon } from "lib/assets/icons"; import Link from "next/link"; import { FaGithub, FaTwitter } from "react-icons/fa"; import { FiInfo } from "react-icons/fi"; +import { DiscordIcon } from "utils/assets/icons"; const FooterContent: React.FC = () => { const { themeColorHex: themeColor } = useMyTheme(); diff --git a/components/layout/IconNavBar.tsx b/components/layout/IconNavBar.tsx index 650326e03..fd2b03795 100644 --- a/components/layout/IconNavBar.tsx +++ b/components/layout/IconNavBar.tsx @@ -15,10 +15,10 @@ import { import { t, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { useMyTheme } from "hooks/common"; -import { getVotingRange } from "lib/plus"; import { useRouter } from "next/dist/client/router"; import Image from "next/image"; import Link from "next/link"; +import { getVotingRange } from "utils/plus"; export const navIcons: { code: string; diff --git a/components/layout/LanguageSelector.tsx b/components/layout/LanguageSelector.tsx index 31fe7ab95..02ec9c579 100644 --- a/components/layout/LanguageSelector.tsx +++ b/components/layout/LanguageSelector.tsx @@ -9,9 +9,9 @@ import { import { t } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { useMyTheme } from "hooks/common"; -import { activateLocale } from "lib/i18n"; import React from "react"; import { FiGlobe } from "react-icons/fi"; +import { activateLocale } from "utils/i18n"; export const languages = [ { code: "de", name: "Deutsch" }, diff --git a/components/layout/TopNav.tsx b/components/layout/TopNav.tsx index 210f74ea6..e92b3de1e 100644 --- a/components/layout/TopNav.tsx +++ b/components/layout/TopNav.tsx @@ -14,11 +14,11 @@ import { } from "@chakra-ui/react"; import { Trans } from "@lingui/macro"; import { useUser } from "hooks/common"; -import { DiscordIcon } from "lib/assets/icons"; import { signIn, signOut } from "next-auth/client"; import Link from "next/link"; import { FaHeart } from "react-icons/fa"; import { FiMoon, FiSun } from "react-icons/fi"; +import { DiscordIcon } from "utils/assets/icons"; import { LanguageSelector } from "./LanguageSelector"; const TopNav = () => { diff --git a/components/plans/DraggableImageAdder.tsx b/components/plans/DraggableImageAdder.tsx index 10ce01861..6f35212a6 100644 --- a/components/plans/DraggableImageAdder.tsx +++ b/components/plans/DraggableImageAdder.tsx @@ -2,10 +2,10 @@ import { Box, Flex } from "@chakra-ui/react"; import { Trans } from "@lingui/macro"; import WeaponImage from "components/common/WeaponImage"; import { useMyTheme } from "hooks/common"; -import { weapons } from "lib/lists/weapons"; import Image from "next/image"; import { useState } from "react"; import Draggable from "react-draggable"; +import { weapons } from "utils/lists/weapons"; interface DraggableImageAdderProps { addImageToSketch: (imgSrc: string) => void; diff --git a/components/plans/StageSelector.tsx b/components/plans/StageSelector.tsx index 1792bb603..75a2150b3 100644 --- a/components/plans/StageSelector.tsx +++ b/components/plans/StageSelector.tsx @@ -18,8 +18,8 @@ import salmonRunHighTide from "lib/assets/SalmonRunHighTide.svg"; import salmonRunLowTide from "lib/assets/SalmonRunLowTide.svg"; // @ts-ignore import salmonRunMidTide from "lib/assets/SalmonRunMidTide.svg"; -import { salmonRunStages, stages } from "lib/lists/stages"; import { PlannerMapBg } from "pages/plans"; +import { salmonRunStages, stages } from "utils/lists/stages"; interface StageSelectorProps { handleChange: (event: React.ChangeEvent) => void; diff --git a/components/play/LadderTeam.tsx b/components/play/LadderTeam.tsx index 18a094638..056842d76 100644 --- a/components/play/LadderTeam.tsx +++ b/components/play/LadderTeam.tsx @@ -3,8 +3,8 @@ import SubText from "components/common/SubText"; import TwitterAvatar from "components/common/TwitterAvatar"; import UserAvatar from "components/common/UserAvatar"; import { useMyTheme } from "hooks/common"; -import { Unpacked } from "lib/types"; import { GetAllLadderRegisteredTeamsData } from "prisma/queries/getAllLadderRegisteredTeams"; +import { Unpacked } from "utils/types"; interface Props { roster: Unpacked["roster"]; diff --git a/components/play/MatchUp.tsx b/components/play/MatchUp.tsx index 8b964164e..3dc055b66 100644 --- a/components/play/MatchUp.tsx +++ b/components/play/MatchUp.tsx @@ -1,6 +1,6 @@ import { Box } from "@chakra-ui/react"; -import { Unpacked } from "lib/types"; import { GetLadderDayData } from "prisma/queries/getLadderDay"; +import { Unpacked } from "utils/types"; import LadderTeam from "./LadderTeam"; interface Props { diff --git a/components/play/RegisterHeader.tsx b/components/play/RegisterHeader.tsx index 848a90181..e9a36291d 100644 --- a/components/play/RegisterHeader.tsx +++ b/components/play/RegisterHeader.tsx @@ -10,10 +10,10 @@ import { import { t, Trans } from "@lingui/macro"; import { useUser } from "hooks/common"; import { useLadderTeams } from "hooks/play"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; import { useEffect, useState } from "react"; import { FiCheck, FiTrash } from "react-icons/fi"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; interface Props {} diff --git a/components/player/QuadTable.tsx b/components/player/QuadTable.tsx index 39cbe4f01..6743335c2 100644 --- a/components/player/QuadTable.tsx +++ b/components/player/QuadTable.tsx @@ -13,8 +13,8 @@ import { } from "components/common/Table"; import WeaponImage from "components/common/WeaponImage"; import { useMyTheme } from "hooks/common"; -import { getRankingString } from "lib/strings"; import { GetPlayerWithPlacementsData } from "prisma/queries/getPlayerWithPlacements"; +import { getRankingString } from "utils/strings"; interface Props { player: NonNullable; diff --git a/components/player/TwinTable.tsx b/components/player/TwinTable.tsx index 639b56a8b..f80be3f1c 100644 --- a/components/player/TwinTable.tsx +++ b/components/player/TwinTable.tsx @@ -14,8 +14,8 @@ import { import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { useMyTheme } from "hooks/common"; -import { getRankingString } from "lib/strings"; import { GetPlayerWithPlacementsData } from "prisma/queries/getPlayerWithPlacements"; +import { getRankingString } from "utils/strings"; interface Props { player: NonNullable; diff --git a/components/player/XRankTable.tsx b/components/player/XRankTable.tsx index ae02a5a78..c922e9644 100644 --- a/components/player/XRankTable.tsx +++ b/components/player/XRankTable.tsx @@ -11,8 +11,8 @@ import { } from "components/common/Table"; import WeaponImage from "components/common/WeaponImage"; import { useMyTheme } from "hooks/common"; -import { getRankingString } from "lib/strings"; import { GetPlayerWithPlacementsData } from "prisma/queries/getPlayerWithPlacements"; +import { getRankingString } from "utils/strings"; interface Props { player: NonNullable; diff --git a/components/plus/PlusHomePage.tsx b/components/plus/PlusHomePage.tsx index 6368fa322..a64c87ba8 100644 --- a/components/plus/PlusHomePage.tsx +++ b/components/plus/PlusHomePage.tsx @@ -11,9 +11,9 @@ import MyHead from "components/common/MyHead"; import SubText from "components/common/SubText"; import { useUser } from "hooks/common"; import { usePlus } from "hooks/plus"; -import { getFullUsername } from "lib/strings"; import { Fragment } from "react"; import { PlusStatuses, Suggestions } from "services/plus"; +import { getFullUsername } from "utils/strings"; import Suggestion from "./Suggestion"; import SuggestionModal from "./SuggestionModal"; import VotingInfoHeader from "./VotingInfoHeader"; diff --git a/components/plus/PlusVotingHistoryPage.tsx b/components/plus/PlusVotingHistoryPage.tsx index b0a88c386..df935b336 100644 --- a/components/plus/PlusVotingHistoryPage.tsx +++ b/components/plus/PlusVotingHistoryPage.tsx @@ -13,9 +13,9 @@ import { TableRow, } from "components/common/Table"; import UserAvatar from "components/common/UserAvatar"; -import { getFullUsername, getLocalizedMonthYearString } from "lib/strings"; import { useRouter } from "next/router"; import { FiCheck } from "react-icons/fi"; +import { getFullUsername, getLocalizedMonthYearString } from "utils/strings"; import { DistinctSummaryMonths, VotingSummariesByMonthAndTier, diff --git a/components/plus/Suggestion.tsx b/components/plus/Suggestion.tsx index 1e3085822..ad2580879 100644 --- a/components/plus/Suggestion.tsx +++ b/components/plus/Suggestion.tsx @@ -14,15 +14,15 @@ import SubText from "components/common/SubText"; import UserAvatar from "components/common/UserAvatar"; import { useMyTheme } from "hooks/common"; import useMutation from "hooks/useMutation"; -import { getFullUsername } from "lib/strings"; -import { Unpacked } from "lib/types"; -import { - resuggestionSchema, - SUGGESTION_DESCRIPTION_LIMIT, -} from "lib/validators/suggestion"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { Suggestions } from "services/plus"; +import { getFullUsername } from "utils/strings"; +import { Unpacked } from "utils/types"; +import { + resuggestionSchema, + SUGGESTION_DESCRIPTION_LIMIT, +} from "utils/validators/suggestion"; import * as z from "zod"; type FormData = z.infer; diff --git a/components/plus/SuggestionModal.tsx b/components/plus/SuggestionModal.tsx index b07e07835..b00e3727b 100644 --- a/components/plus/SuggestionModal.tsx +++ b/components/plus/SuggestionModal.tsx @@ -17,12 +17,12 @@ import { import { zodResolver } from "@hookform/resolvers/zod"; import UserSelector from "components/common/UserSelector"; import useMutation from "hooks/useMutation"; +import { useState } from "react"; +import { Controller, useForm } from "react-hook-form"; import { suggestionFullSchema, SUGGESTION_DESCRIPTION_LIMIT, -} from "lib/validators/suggestion"; -import { useState } from "react"; -import { Controller, useForm } from "react-hook-form"; +} from "utils/validators/suggestion"; import * as z from "zod"; interface Props { diff --git a/components/plus/VotingInfoHeader.tsx b/components/plus/VotingInfoHeader.tsx index 8e77bc992..f25b9f9b5 100644 --- a/components/plus/VotingInfoHeader.tsx +++ b/components/plus/VotingInfoHeader.tsx @@ -1,5 +1,5 @@ import MyLink from "components/common/MyLink"; -import { getVotingRange } from "lib/plus"; +import { getVotingRange } from "utils/plus"; const VotingInfoHeader = ({ isMember }: { isMember: boolean }) => { const { isHappening, endDate, nextVotingDate } = getVotingRange(); diff --git a/components/plus/VouchModal.tsx b/components/plus/VouchModal.tsx index 21ff183bf..033f91962 100644 --- a/components/plus/VouchModal.tsx +++ b/components/plus/VouchModal.tsx @@ -16,9 +16,9 @@ import { import { zodResolver } from "@hookform/resolvers/zod"; import UserSelector from "components/common/UserSelector"; import useMutation from "hooks/useMutation"; -import { vouchSchema } from "lib/validators/vouch"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; +import { vouchSchema } from "utils/validators/vouch"; import * as z from "zod"; interface Props { diff --git a/components/sr/RotationSelector.tsx b/components/sr/RotationSelector.tsx index 2c45bb4a0..44da1719e 100644 --- a/components/sr/RotationSelector.tsx +++ b/components/sr/RotationSelector.tsx @@ -5,10 +5,10 @@ import SubText from "components/common/SubText"; import WeaponImage from "components/common/WeaponImage"; import WeaponSelector from "components/common/WeaponSelector"; import { useMyTheme } from "hooks/common"; -import { salmonRunStages } from "lib/lists/stages"; import { GetAllSalmonRunRotationsData } from "prisma/queries/getAllSalmonRunRotations"; import { useState } from "react"; import useSWR from "swr"; +import { salmonRunStages } from "utils/lists/stages"; export const randomToNaturalName = { RANDOM: t`Random`, diff --git a/components/t/CreateNewTeamModal.tsx b/components/t/CreateNewTeamModal.tsx index 87995f8ae..880781149 100644 --- a/components/t/CreateNewTeamModal.tsx +++ b/components/t/CreateNewTeamModal.tsx @@ -14,10 +14,10 @@ import { ModalOverlay, } from "@chakra-ui/react"; import { t, Trans } from "@lingui/macro"; -import { makeNameUrlFriendly } from "lib/makeNameUrlFriendly"; -import { sendData } from "lib/postData"; import { useRouter } from "next/router"; import { useState } from "react"; +import { makeNameUrlFriendly } from "utils/makeNameUrlFriendly"; +import { sendData } from "utils/postData"; const CreateNewTeamModal = () => { const router = useRouter(); diff --git a/components/t/RosterPlayerBar.tsx b/components/t/RosterPlayerBar.tsx index cbed62978..2e4dffeef 100644 --- a/components/t/RosterPlayerBar.tsx +++ b/components/t/RosterPlayerBar.tsx @@ -4,8 +4,8 @@ import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { getEmojiFlag } from "countries-list"; import { useMyTheme } from "hooks/common"; -import { Unpacked } from "lib/types"; import { GetTeamData } from "prisma/queries/getTeam"; +import { Unpacked } from "utils/types"; interface Props { user: Unpacked["roster"]>>; diff --git a/components/t/TeamManagementModal.tsx b/components/t/TeamManagementModal.tsx index bf419d1bd..bc1d38198 100644 --- a/components/t/TeamManagementModal.tsx +++ b/components/t/TeamManagementModal.tsx @@ -16,13 +16,13 @@ import { } from "@chakra-ui/react"; import { t, Trans } from "@lingui/macro"; import UserAvatar from "components/common/UserAvatar"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; import { useRouter } from "next/router"; import { GetTeamData } from "prisma/queries/getTeam"; import { Fragment, useEffect, useState } from "react"; import { FiCheck, FiTrash, FiUsers } from "react-icons/fi"; import { mutate } from "swr"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; interface Props { team: NonNullable; diff --git a/components/t/TeamProfileModal.tsx b/components/t/TeamProfileModal.tsx index 02403a3eb..ef8373168 100644 --- a/components/t/TeamProfileModal.tsx +++ b/components/t/TeamProfileModal.tsx @@ -21,18 +21,18 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { t, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import MarkdownTextarea from "components/common/MarkdownTextarea"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; -import { - teamSchema, - TEAM_BIO_CHARACTER_LIMIT, - TEAM_RECRUITING_POST_CHARACTER_LIMIT, -} from "lib/validators/team"; import { GetTeamData } from "prisma/queries/getTeam"; import { useState } from "react"; import { useForm } from "react-hook-form"; import { FaTwitter } from "react-icons/fa"; import { mutate } from "swr"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; +import { + teamSchema, + TEAM_BIO_CHARACTER_LIMIT, + TEAM_RECRUITING_POST_CHARACTER_LIMIT, +} from "utils/validators/team"; import * as z from "zod"; interface Props { diff --git a/components/top500/Top500Table.tsx b/components/top500/Top500Table.tsx index 2d50544f7..6028027be 100644 --- a/components/top500/Top500Table.tsx +++ b/components/top500/Top500Table.tsx @@ -12,9 +12,9 @@ import { import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { useMyTheme } from "hooks/common"; -import { getProfilePath, getRankingString } from "lib/strings"; import Link from "next/link"; import { GetTop500PlacementsByMonthData } from "prisma/queries/getTop500PlacementsByMonth"; +import { getProfilePath, getRankingString } from "utils/strings"; interface Props { placements: GetTop500PlacementsByMonthData; diff --git a/components/u/AbilitiesSelector.tsx b/components/u/AbilitiesSelector.tsx index 81eb39b1a..3460aa195 100644 --- a/components/u/AbilitiesSelector.tsx +++ b/components/u/AbilitiesSelector.tsx @@ -1,7 +1,7 @@ import { Box, Divider, Flex } from "@chakra-ui/react"; import { ViewSlotsAbilities } from "components/builds/ViewSlots"; import AbilityIcon from "components/common/AbilityIcon"; -import { abilities as allAbilities } from "lib/lists/abilities"; +import { abilities as allAbilities } from "utils/lists/abilities"; type ArrayElement = A extends readonly (infer T)[] ? T : never; diff --git a/components/u/AvatarWithInfo.tsx b/components/u/AvatarWithInfo.tsx index b95efab2f..c7ea94caf 100644 --- a/components/u/AvatarWithInfo.tsx +++ b/components/u/AvatarWithInfo.tsx @@ -16,11 +16,11 @@ import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { countries, getEmojiFlag } from "countries-list"; import { useMyTheme, useUser } from "hooks/common"; -import { getFullUsername } from "lib/strings"; import Image from "next/image"; import { GetUserByIdentifierData } from "prisma/queries/getUserByIdentifier"; import { FaGamepad, FaTwitch, FaTwitter, FaYoutube } from "react-icons/fa"; import { FiInfo } from "react-icons/fi"; +import { getFullUsername } from "utils/strings"; interface AvatarWithInfoProps { user: NonNullable; diff --git a/components/u/BuildModal.tsx b/components/u/BuildModal.tsx index c8e82f02c..700fa8b07 100644 --- a/components/u/BuildModal.tsx +++ b/components/u/BuildModal.tsx @@ -26,20 +26,20 @@ import ViewSlots from "components/builds/ViewSlots"; import GearSelector from "components/common/GearSelector"; import WeaponSelector from "components/common/WeaponSelector"; import { useUser } from "hooks/common"; -import { getToastOptions } from "lib/getToastOptions"; -import { weapons } from "lib/lists/weapons"; -import { sendData } from "lib/postData"; -import { Unpacked } from "lib/types"; -import { - buildSchema, - DESCRIPTION_CHARACTER_LIMIT, - TITLE_CHARACTER_LIMIT, -} from "lib/validators/build"; import { GetBuildsByUserData } from "prisma/queries/getBuildsByUser"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { FiTrash } from "react-icons/fi"; import { mutate } from "swr"; +import { getToastOptions } from "utils/getToastOptions"; +import { weapons } from "utils/lists/weapons"; +import { sendData } from "utils/postData"; +import { Unpacked } from "utils/types"; +import { + buildSchema, + DESCRIPTION_CHARACTER_LIMIT, + TITLE_CHARACTER_LIMIT, +} from "utils/validators/build"; import * as z from "zod"; import AbilitiesSelector from "./AbilitiesSelector"; diff --git a/components/u/ProfileModal.tsx b/components/u/ProfileModal.tsx index 5dbeaa53b..b3268179f 100644 --- a/components/u/ProfileModal.tsx +++ b/components/u/ProfileModal.tsx @@ -23,17 +23,17 @@ import ChakraSelect from "components/common/ChakraSelect"; import MarkdownTextarea from "components/common/MarkdownTextarea"; import WeaponSelector from "components/common/WeaponSelector"; import { countries } from "countries-list"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; -import { - profileSchemaFrontend, - PROFILE_CHARACTER_LIMIT, -} from "lib/validators/profile"; import { GetUserByIdentifierData } from "prisma/queries/getUserByIdentifier"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { FaGamepad, FaTwitch, FaTwitter, FaYoutube } from "react-icons/fa"; import { mutate } from "swr"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; +import { + profileSchemaFrontend, + PROFILE_CHARACTER_LIMIT, +} from "utils/validators/profile"; import * as z from "zod"; const sensOptions = [ diff --git a/hooks/builds.ts b/hooks/builds.ts index 871778d04..70b35d245 100644 --- a/hooks/builds.ts +++ b/hooks/builds.ts @@ -1,12 +1,12 @@ import { Ability, Mode } from "@prisma/client"; -import { abilities, isMainAbility } from "lib/lists/abilities"; -import { weaponToCode } from "lib/lists/weaponCodes"; -import { weapons } from "lib/lists/weapons"; -import { setSearchParams } from "lib/setSearchParams"; import { useRouter } from "next/router"; import { GetBuildsByWeaponData } from "prisma/queries/getBuildsByWeapon"; import { Dispatch, useReducer } from "react"; import useSWR from "swr"; +import { abilities, isMainAbility } from "utils/lists/abilities"; +import { weaponToCode } from "utils/lists/weaponCodes"; +import { weapons } from "utils/lists/weapons"; +import { setSearchParams } from "utils/setSearchParams"; export type BuildFilterType = "AT_LEAST" | "AT_MOST" | "HAS" | "DOES_NOT_HAVE"; diff --git a/hooks/freeagents.ts b/hooks/freeagents.ts index 3ca1497cd..5cf9298db 100644 --- a/hooks/freeagents.ts +++ b/hooks/freeagents.ts @@ -1,11 +1,11 @@ import { Playstyle } from "@prisma/client"; import { useUser } from "hooks/common"; -import { setSearchParams } from "lib/setSearchParams"; import { useRouter } from "next/router"; import { FreeAgentLikeInfo } from "pages/api/freeagents/like"; import { GetAllFreeAgentPostsData } from "prisma/queries/getAllFreeAgentPosts"; import { useReducer } from "react"; import useSWR from "swr"; +import { setSearchParams } from "utils/setSearchParams"; interface UseFreeAgentsState { playstyle?: Playstyle; diff --git a/hooks/sr.ts b/hooks/sr.ts index abfde2565..7bbb98e69 100644 --- a/hooks/sr.ts +++ b/hooks/sr.ts @@ -1,11 +1,11 @@ import { SalmonRunRecordCategory } from "@prisma/client"; -import { salmonRunStages } from "lib/lists/stages"; -import { setSearchParams } from "lib/setSearchParams"; import { useRouter } from "next/router"; import { salmonRunCategoryToNatural } from "pages/sr/leaderboards/new"; import { GetAllSalmonRunRecordsData } from "prisma/queries/getAllSalmonRunRecords"; import { useReducer } from "react"; import useSWR from "swr"; +import { salmonRunStages } from "utils/lists/stages"; +import { setSearchParams } from "utils/setSearchParams"; export type WeaponsFilter = | "NORMAL" diff --git a/hooks/u.ts b/hooks/u.ts index 6671a596f..45c4952d2 100644 --- a/hooks/u.ts +++ b/hooks/u.ts @@ -1,7 +1,7 @@ -import { weaponsWithHero } from "lib/lists/weaponsWithHero"; import { GetBuildsByUserData } from "prisma/queries/getBuildsByUser"; import { useState } from "react"; import useSWR from "swr"; +import { weaponsWithHero } from "utils/lists/weaponsWithHero"; export function useBuildsByUser(userId?: number, weaponPool?: string[]) { const [weapon, setWeapon] = useState(null); diff --git a/hooks/useAbilityEffects/index.ts b/hooks/useAbilityEffects/index.ts index db2ce722c..3af823384 100644 --- a/hooks/useAbilityEffects/index.ts +++ b/hooks/useAbilityEffects/index.ts @@ -2,10 +2,10 @@ import { t } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { Ability } from "@prisma/client"; import { ViewSlotsAbilities } from "components/builds/ViewSlots"; -import abilityJson from "lib/data/abilityData.json"; -import weaponJson from "lib/data/weaponData.json"; -import { weapons } from "lib/lists/weapons"; import { useEffect, useState } from "react"; +import abilityJson from "utils/data/abilityData.json"; +import weaponJson from "utils/data/weaponData.json"; +import { weapons } from "utils/lists/weapons"; import { getEffect } from "./getAbilityEffect"; export interface Explanation { diff --git a/hooks/useMutation.ts b/hooks/useMutation.ts index a26d96bc4..47f514304 100644 --- a/hooks/useMutation.ts +++ b/hooks/useMutation.ts @@ -1,8 +1,8 @@ import { useToast } from "@chakra-ui/react"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; import { useState } from "react"; import { mutate } from "swr"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; import { useUser } from "./common"; const useMutation = ({ diff --git a/pages/_app.tsx b/pages/_app.tsx index 60b595f2c..d8f2a94c1 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -3,8 +3,6 @@ import { mode } from "@chakra-ui/theme-tools"; import { i18n } from "@lingui/core"; import { I18nProvider } from "@lingui/react"; import Layout from "components/layout"; -import { activateLocale } from "lib/i18n"; -import { locales } from "lib/lists/locales"; import { Provider as NextAuthProvider } from "next-auth/client"; import { DefaultSeo } from "next-seo"; import type { AppProps } from "next/app"; @@ -13,6 +11,8 @@ import { Router } from "next/router"; import NProgress from "nprogress"; import { useEffect } from "react"; import { theme } from "theme"; +import { activateLocale } from "utils/i18n"; +import { locales } from "utils/lists/locales"; import "./styles.css"; NProgress.configure({ showSpinner: false }); diff --git a/pages/admin.tsx b/pages/admin.tsx index 1c13cd7dd..dc872211a 100644 --- a/pages/admin.tsx +++ b/pages/admin.tsx @@ -1,10 +1,10 @@ import { Box, Button, Flex, Heading, Input, useToast } from "@chakra-ui/react"; import SubText from "components/common/SubText"; import { useUser } from "hooks/common"; -import { ADMIN_DISCORD_ID } from "lib/constants"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; import { useState } from "react"; +import { ADMIN_DISCORD_ID } from "utils/constants"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; const AdminPage = () => { const toast = useToast(); diff --git a/pages/analyzer.tsx b/pages/analyzer.tsx index 507c6df19..7bfae759b 100644 --- a/pages/analyzer.tsx +++ b/pages/analyzer.tsx @@ -15,12 +15,12 @@ import WeaponSelector from "components/common/WeaponSelector"; import HeaderBanner from "components/layout/HeaderBanner"; import { useMyTheme } from "hooks/common"; import useAbilityEffects from "hooks/useAbilityEffects"; -import { isAbilityArray } from "lib/lists/abilities"; -import { isWeapon } from "lib/lists/weapons"; -import { AbilityOrUnknown } from "lib/types"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; import { FiSettings } from "react-icons/fi"; +import { isAbilityArray } from "utils/lists/abilities"; +import { isWeapon } from "utils/lists/weapons"; +import { AbilityOrUnknown } from "utils/types"; const CURRENT_PATCH = "5.4."; diff --git a/pages/api/builds/[weapon].ts b/pages/api/builds/[weapon].ts index ad16fbb51..8f6e0a918 100644 --- a/pages/api/builds/[weapon].ts +++ b/pages/api/builds/[weapon].ts @@ -1,9 +1,9 @@ -import { codeToWeapon } from "lib/lists/weaponCodes"; import { NextApiRequest, NextApiResponse } from "next"; import { getBuildsByWeapon, GetBuildsByWeaponData, } from "prisma/queries/getBuildsByWeapon"; +import { codeToWeapon } from "utils/lists/weaponCodes"; const weaponHandler = async ( req: NextApiRequest, diff --git a/pages/api/builds/index.ts b/pages/api/builds/index.ts index 659287ce5..509dc18c5 100644 --- a/pages/api/builds/index.ts +++ b/pages/api/builds/index.ts @@ -1,10 +1,10 @@ import { Ability } from "@prisma/client"; -import { getMySession } from "lib/api"; -import { GANBA_DISCORD_ID } from "lib/constants"; -import { getWeaponNormalized } from "lib/lists/weapons"; -import { buildSchema } from "lib/validators/build"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; +import { GANBA_DISCORD_ID } from "utils/constants"; +import { getWeaponNormalized } from "utils/lists/weapons"; +import { buildSchema } from "utils/validators/build"; const modes = ["TW", "SZ", "TC", "RM", "CB"]; diff --git a/pages/api/freeagents/index.ts b/pages/api/freeagents/index.ts index 8c5d7f6b8..b1796d291 100644 --- a/pages/api/freeagents/index.ts +++ b/pages/api/freeagents/index.ts @@ -1,8 +1,8 @@ -import { getMySession } from "lib/api"; -import { freeAgentPostSchema } from "lib/validators/fapost"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; import { getAllFreeAgentPosts } from "prisma/queries/getAllFreeAgentPosts"; +import { getMySession } from "utils/api"; +import { freeAgentPostSchema } from "utils/validators/fapost"; const freeAgentsHandler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/freeagents/like.ts b/pages/api/freeagents/like.ts index c31a29290..71103173f 100644 --- a/pages/api/freeagents/like.ts +++ b/pages/api/freeagents/like.ts @@ -1,6 +1,6 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; const handler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/me/profile.ts b/pages/api/me/profile.ts index 5986b1430..23af60eb8 100644 --- a/pages/api/me/profile.ts +++ b/pages/api/me/profile.ts @@ -1,7 +1,7 @@ -import { getMySession } from "lib/api"; -import { profileSchemaBackend } from "lib/validators/profile"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; +import { profileSchemaBackend } from "utils/validators/profile"; const profileHandler = async (req: NextApiRequest, res: NextApiResponse) => { if (req.method === "PUT") { diff --git a/pages/api/play/matches.ts b/pages/api/play/matches.ts index 154863476..ca95aaa5c 100644 --- a/pages/api/play/matches.ts +++ b/pages/api/play/matches.ts @@ -1,7 +1,7 @@ -import { detailedMapSchema } from "lib/validators/detailedMap"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; import { rate, Rating } from "ts-trueskill"; +import { detailedMapSchema } from "utils/validators/detailedMap"; import * as z from "zod"; const matchesHandler = async (req: NextApiRequest, res: NextApiResponse) => { diff --git a/pages/api/play/teams/index.ts b/pages/api/play/teams/index.ts index deec3020a..9d28f7689 100644 --- a/pages/api/play/teams/index.ts +++ b/pages/api/play/teams/index.ts @@ -1,7 +1,7 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; import { getAllLadderRegisteredTeams } from "prisma/queries/getAllLadderRegisteredTeams"; +import { getMySession } from "utils/api"; import { v4 as uuidv4 } from "uuid"; const teamsHandler = async (req: NextApiRequest, res: NextApiResponse) => { diff --git a/pages/api/play/teams/join.ts b/pages/api/play/teams/join.ts index 0722fed88..7eb6b8c61 100644 --- a/pages/api/play/teams/join.ts +++ b/pages/api/play/teams/join.ts @@ -1,7 +1,7 @@ -import { getMySession } from "lib/api"; -import { LADDER_ROSTER_LIMIT } from "lib/constants"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; +import { LADDER_ROSTER_LIMIT } from "utils/constants"; const joinHandler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/play/teams/leave.ts b/pages/api/play/teams/leave.ts index 1ae292851..c9529b155 100644 --- a/pages/api/play/teams/leave.ts +++ b/pages/api/play/teams/leave.ts @@ -1,6 +1,6 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; const playLeaveHandler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/players/connect.ts b/pages/api/players/connect.ts index 9afa624f5..e8613980c 100644 --- a/pages/api/players/connect.ts +++ b/pages/api/players/connect.ts @@ -1,6 +1,6 @@ -import { getWeaponNormalized } from "lib/lists/weapons"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getWeaponNormalized } from "utils/lists/weapons"; const connectHandler = async (req: NextApiRequest, res: NextApiResponse) => { if (req.method !== "POST") { @@ -25,12 +25,10 @@ const connectHandler = async (req: NextApiRequest, res: NextApiResponse) => { }); if (!user) { - return res - .status(400) - .json({ - message: - "Please log-in to sendou.ink first. After logging in use the !sendoulink command.", - }); + return res.status(400).json({ + message: + "Please log-in to sendou.ink first. After logging in use the !sendoulink command.", + }); } if (user.player) { diff --git a/pages/api/plus/index.ts b/pages/api/plus/index.ts index 47b968023..811b6d04d 100644 --- a/pages/api/plus/index.ts +++ b/pages/api/plus/index.ts @@ -1,4 +1,3 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import plusService from "services/plus"; diff --git a/pages/api/plus/suggestions.ts b/pages/api/plus/suggestions.ts index 9a81fdab4..3fe4720d9 100644 --- a/pages/api/plus/suggestions.ts +++ b/pages/api/plus/suggestions.ts @@ -1,7 +1,7 @@ -import { getMySession } from "lib/api"; -import { UserError } from "lib/errors"; import { NextApiRequest, NextApiResponse } from "next"; import plusService from "services/plus"; +import { getMySession } from "utils/api"; +import { UserError } from "utils/errors"; import { ZodError } from "zod"; const suggestionsHandler = async ( diff --git a/pages/api/plus/vouch.ts b/pages/api/plus/vouch.ts index 7b644d75f..180ea03ff 100644 --- a/pages/api/plus/vouch.ts +++ b/pages/api/plus/vouch.ts @@ -1,7 +1,7 @@ -import { getMySession } from "lib/api"; -import { UserError } from "lib/errors"; import { NextApiRequest, NextApiResponse } from "next"; import plusService from "services/plus"; +import { getMySession } from "utils/api"; +import { UserError } from "utils/errors"; import { ZodError } from "zod"; const vouchHandler = async (req: NextApiRequest, res: NextApiResponse) => { diff --git a/pages/api/sr/records/[id].ts b/pages/api/sr/records/[id].ts index b77d61385..027b6bd39 100644 --- a/pages/api/sr/records/[id].ts +++ b/pages/api/sr/records/[id].ts @@ -1,7 +1,7 @@ -import { getMySession } from "lib/api"; -import { SALMON_RUN_ADMIN_DISCORD_IDS } from "lib/constants"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; +import { SALMON_RUN_ADMIN_DISCORD_IDS } from "utils/constants"; const salmonRunRecordIdHandler = async ( req: NextApiRequest, diff --git a/pages/api/sr/records/index.ts b/pages/api/sr/records/index.ts index 06ad58469..36fba331b 100644 --- a/pages/api/sr/records/index.ts +++ b/pages/api/sr/records/index.ts @@ -1,9 +1,9 @@ -import { getMySession } from "lib/api"; -import { SALMON_RUN_ADMIN_DISCORD_IDS } from "lib/constants"; -import { salmonRunRecordSchema } from "lib/validators/salmonRunRecord"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; import { getAllSalmonRunRecords } from "prisma/queries/getAllSalmonRunRecords"; +import { getMySession } from "utils/api"; +import { SALMON_RUN_ADMIN_DISCORD_IDS } from "utils/constants"; +import { salmonRunRecordSchema } from "utils/validators/salmonRunRecord"; const getHandler = async (req: NextApiRequest, res: NextApiResponse) => { const user = await getMySession(req); diff --git a/pages/api/teams/[id].ts b/pages/api/teams/[id].ts index 97dea3d65..e14f0edc9 100644 --- a/pages/api/teams/[id].ts +++ b/pages/api/teams/[id].ts @@ -1,6 +1,6 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import { getTeam, GetTeamData } from "prisma/queries/getTeam"; +import { getMySession } from "utils/api"; const teamByIdHandler = async ( req: NextApiRequest, diff --git a/pages/api/teams/code.ts b/pages/api/teams/code.ts index 1c50aacc9..bd928bc5c 100644 --- a/pages/api/teams/code.ts +++ b/pages/api/teams/code.ts @@ -1,6 +1,6 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; import { v4 as uuidv4 } from "uuid"; const codeHandler = async (req: NextApiRequest, res: NextApiResponse) => { diff --git a/pages/api/teams/index.ts b/pages/api/teams/index.ts index 6472dd2c8..7e6c4e2e6 100644 --- a/pages/api/teams/index.ts +++ b/pages/api/teams/index.ts @@ -1,8 +1,8 @@ -import { getMySession } from "lib/api"; -import { makeNameUrlFriendly } from "lib/makeNameUrlFriendly"; -import { teamSchema } from "lib/validators/team"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; +import { makeNameUrlFriendly } from "utils/makeNameUrlFriendly"; +import { teamSchema } from "utils/validators/team"; import { v4 as uuidv4 } from "uuid"; const teamsHandler = async (req: NextApiRequest, res: NextApiResponse) => { diff --git a/pages/api/teams/join.ts b/pages/api/teams/join.ts index 920a24dcf..44a76d4bc 100644 --- a/pages/api/teams/join.ts +++ b/pages/api/teams/join.ts @@ -1,7 +1,7 @@ -import { getMySession } from "lib/api"; -import { TEAM_ROSTER_LIMIT } from "lib/constants"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; +import { TEAM_ROSTER_LIMIT } from "utils/constants"; const joinHandler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/teams/kick.ts b/pages/api/teams/kick.ts index 6e2351e7c..97aafda99 100644 --- a/pages/api/teams/kick.ts +++ b/pages/api/teams/kick.ts @@ -1,6 +1,6 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; const kickHandler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/teams/leave.ts b/pages/api/teams/leave.ts index dec2604fa..cf4e00316 100644 --- a/pages/api/teams/leave.ts +++ b/pages/api/teams/leave.ts @@ -1,6 +1,6 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; const leaveHandler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/teams/owner.ts b/pages/api/teams/owner.ts index b80f39f8e..d16cc59c1 100644 --- a/pages/api/teams/owner.ts +++ b/pages/api/teams/owner.ts @@ -1,6 +1,6 @@ -import { getMySession } from "lib/api"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; const ownerHandler = async (req: NextApiRequest, res: NextApiResponse) => { switch (req.method) { diff --git a/pages/api/users/[id]/player.ts b/pages/api/users/[id]/player.ts index 27b5afcc6..c52af5c6a 100644 --- a/pages/api/users/[id]/player.ts +++ b/pages/api/users/[id]/player.ts @@ -1,8 +1,8 @@ -import { getMySession } from "lib/api"; -import { ADMIN_DISCORD_ID } from "lib/constants"; -import { getWeaponNormalized } from "lib/lists/weapons"; import { NextApiRequest, NextApiResponse } from "next"; import prisma from "prisma/client"; +import { getMySession } from "utils/api"; +import { ADMIN_DISCORD_ID } from "utils/constants"; +import { getWeaponNormalized } from "utils/lists/weapons"; const userHandler = async (req: NextApiRequest, res: NextApiResponse) => { if (req.method !== "PATCH") { diff --git a/pages/freeagents.tsx b/pages/freeagents.tsx index bc3ea144e..4d2342ee4 100644 --- a/pages/freeagents.tsx +++ b/pages/freeagents.tsx @@ -28,8 +28,6 @@ import HeaderBanner from "components/layout/HeaderBanner"; import { countries, getEmojiFlag } from "countries-list"; import { useMyTheme, useUser } from "hooks/common"; import { useFreeAgents } from "hooks/freeagents"; -import { sendData } from "lib/postData"; -import { Unpacked } from "lib/types"; import { useRouter } from "next/router"; import { GetAllFreeAgentPostsData } from "prisma/queries/getAllFreeAgentPosts"; import { RefObject, useEffect, useRef, useState } from "react"; @@ -41,6 +39,8 @@ import { RiSwordLine, } from "react-icons/ri"; import { mutate } from "swr"; +import { sendData } from "utils/postData"; +import { Unpacked } from "utils/types"; const FreeAgentsPage = () => { const { diff --git a/pages/links.tsx b/pages/links.tsx index 729bde4d8..75b6dee4b 100644 --- a/pages/links.tsx +++ b/pages/links.tsx @@ -3,7 +3,7 @@ import { t, Trans } from "@lingui/macro"; import MyHead from "components/common/MyHead"; import HeaderBanner from "components/layout/HeaderBanner"; import { useMyTheme } from "hooks/common"; -import links from "lib/data/links.json"; +import links from "utils/data/links.json"; interface Link { title: string; diff --git a/pages/maps.tsx b/pages/maps.tsx index 711f98809..fcbb4133f 100644 --- a/pages/maps.tsx +++ b/pages/maps.tsx @@ -25,12 +25,12 @@ import { RankedMode } from "@prisma/client"; import ModeImage from "components/common/ModeImage"; import SubText from "components/common/SubText"; import HeaderBanner from "components/layout/HeaderBanner"; -import { stages } from "lib/lists/stages"; -import { setManySearchParams } from "lib/setSearchParams"; -import { shuffleArray } from "lib/shuffleArray"; import { useRouter } from "next/router"; import { ChangeEvent, Fragment, useEffect, useState } from "react"; import { FiCheck, FiFilter, FiRotateCw } from "react-icons/fi"; +import { stages } from "utils/lists/stages"; +import { setManySearchParams } from "utils/setSearchParams"; +import { shuffleArray } from "utils/shuffleArray"; const MapsGeneratorPage = () => { const router = useRouter(); diff --git a/pages/markdown.tsx b/pages/markdown.tsx index 08f10ba0a..92486157b 100644 --- a/pages/markdown.tsx +++ b/pages/markdown.tsx @@ -3,10 +3,10 @@ import Emoji from "components/common/Emoji"; import MyHead from "components/common/MyHead"; import MyLink from "components/common/MyLink"; import WeaponImage from "components/common/WeaponImage"; -import { abilityMarkdownCodes } from "lib/lists/abilityMarkdownCodes"; -import { gearMarkdownCodes } from "lib/lists/gearMarkdownCodes"; -import { codeToWeapon } from "lib/lists/weaponCodes"; import { useState } from "react"; +import { abilityMarkdownCodes } from "utils/lists/abilityMarkdownCodes"; +import { gearMarkdownCodes } from "utils/lists/gearMarkdownCodes"; +import { codeToWeapon } from "utils/lists/weaponCodes"; const MarkdownHelpPage = () => { const [showWeapons, setShowWeapons] = useState(false); diff --git a/pages/plans.tsx b/pages/plans.tsx index 9414898be..916d77d71 100644 --- a/pages/plans.tsx +++ b/pages/plans.tsx @@ -4,7 +4,6 @@ import HeaderBanner from "components/layout/HeaderBanner"; import DraggableImageAdder from "components/plans/DraggableImageAdder"; import DraggableToolsSelector from "components/plans/DraggableToolsSelector"; import StageSelector from "components/plans/StageSelector"; -import { stages } from "lib/lists/stages"; import dynamic from "next/dynamic"; import { useEffect, useRef, useState } from "react"; import { @@ -13,6 +12,7 @@ import { FaFileImage, FaFileUpload, } from "react-icons/fa"; +import { stages } from "utils/lists/stages"; const MapSketch = dynamic(() => import("components/plans/MapSketch"), { ssr: false, diff --git a/pages/play/index.tsx b/pages/play/index.tsx index 94ca30124..c5f7b5978 100644 --- a/pages/play/index.tsx +++ b/pages/play/index.tsx @@ -1,5 +1,5 @@ import { Box, Center, Flex, Grid, Heading } from "@chakra-ui/react"; -import { t, Trans } from "@lingui/macro"; +import { Trans } from "@lingui/macro"; import ModeImage from "components/common/ModeImage"; import SubText from "components/common/SubText"; import LadderTeam from "components/play/LadderTeam"; @@ -7,13 +7,13 @@ import MatchUp from "components/play/MatchUp"; import RegisterHeader from "components/play/RegisterHeader"; import { useMyTheme } from "hooks/common"; import { useLadderTeams } from "hooks/play"; -import { getLadderRounds } from "lib/playFunctions"; -import { shuffleArray } from "lib/shuffleArray"; import { GetStaticProps } from "next"; import prisma from "prisma/client"; import { getAllLadderRegisteredTeamsForMatches } from "prisma/queries/getAllLadderRegisteredTeamsForMatches"; import { getLadderDay, GetLadderDayData } from "prisma/queries/getLadderDay"; import { Fragment } from "react"; +import { getLadderRounds } from "utils/playFunctions"; +import { shuffleArray } from "utils/shuffleArray"; interface Props { ladderDay: GetLadderDayData; diff --git a/pages/play/join.tsx b/pages/play/join.tsx index 5ed398e0e..f353cfb85 100644 --- a/pages/play/join.tsx +++ b/pages/play/join.tsx @@ -1,9 +1,9 @@ import { t } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { useLadderTeams } from "hooks/play"; -import { sendData } from "lib/postData"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; +import { sendData } from "utils/postData"; const statusMessage = { LOADING: t`Please wait...`, diff --git a/pages/player/[id].tsx b/pages/player/[id].tsx index c0a86ae9d..bd3de5905 100644 --- a/pages/player/[id].tsx +++ b/pages/player/[id].tsx @@ -1,10 +1,9 @@ import { Box, HStack, Radio, RadioGroup } from "@chakra-ui/react"; -import { t, Trans } from "@lingui/macro"; +import { Trans } from "@lingui/macro"; import MyLink from "components/common/MyLink"; import QuadTable from "components/player/QuadTable"; import TwinTable from "components/player/TwinTable"; import XRankTable from "components/player/XRankTable"; -import { setSearchParams } from "lib/setSearchParams"; import { GetStaticPaths, GetStaticProps } from "next"; import { useRouter } from "next/router"; import { @@ -12,6 +11,7 @@ import { GetPlayerWithPlacementsData, } from "prisma/queries/getPlayerWithPlacements"; import { useState } from "react"; +import { setSearchParams } from "utils/setSearchParams"; interface Props { player: GetPlayerWithPlacementsData; diff --git a/pages/sr/leaderboards/admin.tsx b/pages/sr/leaderboards/admin.tsx index b7859f942..d4e81c27c 100644 --- a/pages/sr/leaderboards/admin.tsx +++ b/pages/sr/leaderboards/admin.tsx @@ -10,12 +10,12 @@ import { } from "components/common/Table"; import WeaponImage from "components/common/WeaponImage"; import { useUser } from "hooks/common"; -import { SALMON_RUN_ADMIN_DISCORD_IDS } from "lib/constants"; -import { sendData } from "lib/postData"; import { useRouter } from "next/router"; import { GetAllSalmonRunRecordsData } from "prisma/queries/getAllSalmonRunRecords"; import { useState } from "react"; import useSWR, { mutate } from "swr"; +import { SALMON_RUN_ADMIN_DISCORD_IDS } from "utils/constants"; +import { sendData } from "utils/postData"; import { salmonRunCategoryToNatural } from "./new"; const SalmonRunAdminPage = ({}) => { diff --git a/pages/sr/leaderboards/index.tsx b/pages/sr/leaderboards/index.tsx index f2f04a811..9a95c9e0c 100644 --- a/pages/sr/leaderboards/index.tsx +++ b/pages/sr/leaderboards/index.tsx @@ -12,7 +12,7 @@ import { Select, Stack, } from "@chakra-ui/react"; -import { Plural, t, Trans } from "@lingui/macro"; +import { Plural, Trans } from "@lingui/macro"; import { useLingui } from "@lingui/react"; import { SalmonRunRecordCategory } from "@prisma/client"; import LinkButton from "components/common/LinkButton"; @@ -28,10 +28,10 @@ import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import HeaderBanner from "components/layout/HeaderBanner"; import { useSalmonRunRecords, WeaponsFilter } from "hooks/sr"; -import { salmonRunStages } from "lib/lists/stages"; -import { getRankingString } from "lib/strings"; import Image from "next/image"; import Link from "next/link"; +import { salmonRunStages } from "utils/lists/stages"; +import { getRankingString } from "utils/strings"; import { salmonRunCategoryToNatural } from "./new"; const SalmonRunLeaderboardsPage = ({}) => { diff --git a/pages/sr/leaderboards/new.tsx b/pages/sr/leaderboards/new.tsx index 9b0bba0d5..04d8e853f 100644 --- a/pages/sr/leaderboards/new.tsx +++ b/pages/sr/leaderboards/new.tsx @@ -20,13 +20,13 @@ import UserSelector from "components/common/UserSelector"; import HeaderBanner from "components/layout/HeaderBanner"; import RotationSelector from "components/sr/RotationSelector"; import { useUser } from "hooks/common"; -import { sendData } from "lib/postData"; -import { salmonRunRecordSchema } from "lib/validators/salmonRunRecord"; import Image from "next/image"; import { useRouter } from "next/router"; import { useState } from "react"; import { Controller, useForm } from "react-hook-form"; import { mutate } from "swr"; +import { sendData } from "utils/postData"; +import { salmonRunRecordSchema } from "utils/validators/salmonRunRecord"; import * as z from "zod"; export const salmonRunCategoryToNatural = { diff --git a/pages/sr/player/[id].tsx b/pages/sr/player/[id].tsx index c6015e9a9..d6037efcf 100644 --- a/pages/sr/player/[id].tsx +++ b/pages/sr/player/[id].tsx @@ -6,7 +6,6 @@ import SubText from "components/common/SubText"; import UserAvatar from "components/common/UserAvatar"; import WeaponImage from "components/common/WeaponImage"; import { useMyTheme } from "hooks/common"; -import { salmonRunStages } from "lib/lists/stages"; import { GetStaticPaths, GetStaticProps } from "next"; import Image from "next/image"; import { salmonRunCategoryToNatural } from "pages/sr/leaderboards/new"; @@ -14,6 +13,7 @@ import { getUsersSalmonRunRecords, GetUsersSalmonRunRecordsData, } from "prisma/queries/getUsersSalmonRunRecords"; +import { salmonRunStages } from "utils/lists/stages"; interface Props { user: GetUsersSalmonRunRecordsData; diff --git a/pages/t/[team].tsx b/pages/t/[team].tsx index 3a12934e6..a1528ed93 100644 --- a/pages/t/[team].tsx +++ b/pages/t/[team].tsx @@ -25,8 +25,6 @@ import RosterPlayerBar from "components/t/RosterPlayerBar"; import TeamManagementModal from "components/t/TeamManagementModal"; import TeamProfileModal from "components/t/TeamProfileModal"; import { useMyTheme, useUser } from "hooks/common"; -import { getToastOptions } from "lib/getToastOptions"; -import { sendData } from "lib/postData"; import { GetStaticPaths, GetStaticProps } from "next"; import Image from "next/image"; import { getTeam, GetTeamData } from "prisma/queries/getTeam"; @@ -34,6 +32,8 @@ import { Fragment, useEffect, useState } from "react"; import { FaTwitter } from "react-icons/fa"; import { FiEdit } from "react-icons/fi"; import useSWR, { mutate } from "swr"; +import { getToastOptions } from "utils/getToastOptions"; +import { sendData } from "utils/postData"; interface Props { team: GetTeamData; diff --git a/pages/t/join.tsx b/pages/t/join.tsx index 0675968f2..c65bc8313 100644 --- a/pages/t/join.tsx +++ b/pages/t/join.tsx @@ -1,8 +1,8 @@ import { t } from "@lingui/macro"; import { useLingui } from "@lingui/react"; -import { sendData } from "lib/postData"; import { useRouter } from "next/router"; import { useEffect, useState } from "react"; +import { sendData } from "utils/postData"; const statusMessage = { LOADING: t`Please wait...`, diff --git a/pages/u/[identifier].tsx b/pages/u/[identifier].tsx index 5aa7580eb..b70a9079b 100644 --- a/pages/u/[identifier].tsx +++ b/pages/u/[identifier].tsx @@ -11,7 +11,6 @@ import BuildModal from "components/u/BuildModal"; import ProfileModal from "components/u/ProfileModal"; import { useUser } from "hooks/common"; import { useBuildsByUser } from "hooks/u"; -import { GANBA_DISCORD_ID } from "lib/constants"; import { GetStaticPaths, GetStaticProps } from "next"; import { useRouter } from "next/router"; import { getPlayersPeak } from "prisma/queries/getPlayersPeak"; @@ -23,6 +22,7 @@ import { useEffect, useState } from "react"; import { FiEdit } from "react-icons/fi"; import { RiTShirtLine } from "react-icons/ri"; import useSWR from "swr"; +import { GANBA_DISCORD_ID } from "utils/constants"; interface Props { user: GetUserByIdentifierData; diff --git a/pages/u/index.tsx b/pages/u/index.tsx index 3c1f48952..948fd5d1c 100644 --- a/pages/u/index.tsx +++ b/pages/u/index.tsx @@ -5,14 +5,11 @@ import { InputGroup, InputLeftElement, } from "@chakra-ui/react"; -import { t } from "@lingui/macro"; import MyLink from "components/common/MyLink"; import UserAvatar from "components/common/UserAvatar"; import HeaderBanner from "components/layout/HeaderBanner"; import { getEmojiFlag } from "countries-list"; import { useDebounce, useMyTheme } from "hooks/common"; -import { setSearchParams } from "lib/setSearchParams"; -import { Unpacked } from "lib/types"; import { GetStaticProps } from "next"; import Head from "next/head"; import Link from "next/link"; @@ -21,6 +18,8 @@ import { getAllUsers, GetAllUsersData } from "prisma/queries/getAllUsers"; import { useEffect, useMemo, useState } from "react"; import { FaTwitter } from "react-icons/fa"; import { FiSearch } from "react-icons/fi"; +import { setSearchParams } from "utils/setSearchParams"; +import { Unpacked } from "utils/types"; interface Props { users: GetAllUsersData; diff --git a/pages/xsearch/[[...slug]].tsx b/pages/xsearch/[[...slug]].tsx index 4bbbaddc3..6f8013319 100644 --- a/pages/xsearch/[[...slug]].tsx +++ b/pages/xsearch/[[...slug]].tsx @@ -3,7 +3,6 @@ import { t } from "@lingui/macro"; import { RankedMode } from "@prisma/client"; import HeaderBanner from "components/layout/HeaderBanner"; import Top500Table from "components/top500/Top500Table"; -import { getLocalizedMonthYearString } from "lib/strings"; import { GetStaticPaths, GetStaticProps } from "next"; import { useRouter } from "next/router"; import prisma from "prisma/client"; @@ -12,6 +11,7 @@ import { GetTop500PlacementsByMonthData, } from "prisma/queries/getTop500PlacementsByMonth"; import { useEffect, useState } from "react"; +import { getLocalizedMonthYearString } from "utils/strings"; interface Props { placements: GetTop500PlacementsByMonthData; diff --git a/services/plus.ts b/services/plus.ts index 8ff9ba32f..736c07170 100644 --- a/services/plus.ts +++ b/services/plus.ts @@ -1,10 +1,10 @@ import { Prisma } from "@prisma/client"; -import { UserError } from "lib/errors"; -import { getPercentageFromCounts, getVotingRange } from "lib/plus"; -import { userBasicSelection } from "lib/prisma"; -import { suggestionFullSchema } from "lib/validators/suggestion"; -import { vouchSchema } from "lib/validators/vouch"; import prisma from "prisma/client"; +import { UserError } from "utils/errors"; +import { getPercentageFromCounts, getVotingRange } from "utils/plus"; +import { userBasicSelection } from "utils/prisma"; +import { suggestionFullSchema } from "utils/validators/suggestion"; +import { vouchSchema } from "utils/validators/vouch"; export type PlusStatuses = Prisma.PromiseReturnType; diff --git a/lib/api.ts b/utils/api.ts similarity index 100% rename from lib/api.ts rename to utils/api.ts diff --git a/lib/assets/SalmonRunHighTide.svg b/utils/assets/SalmonRunHighTide.svg similarity index 100% rename from lib/assets/SalmonRunHighTide.svg rename to utils/assets/SalmonRunHighTide.svg diff --git a/lib/assets/SalmonRunLowTide.svg b/utils/assets/SalmonRunLowTide.svg similarity index 100% rename from lib/assets/SalmonRunLowTide.svg rename to utils/assets/SalmonRunLowTide.svg diff --git a/lib/assets/SalmonRunMidTide.svg b/utils/assets/SalmonRunMidTide.svg similarity index 100% rename from lib/assets/SalmonRunMidTide.svg rename to utils/assets/SalmonRunMidTide.svg diff --git a/lib/assets/icons.tsx b/utils/assets/icons.tsx similarity index 100% rename from lib/assets/icons.tsx rename to utils/assets/icons.tsx diff --git a/lib/assets/splatnet/autobomb-rush.svg b/utils/assets/splatnet/autobomb-rush.svg similarity index 100% rename from lib/assets/splatnet/autobomb-rush.svg rename to utils/assets/splatnet/autobomb-rush.svg diff --git a/lib/assets/splatnet/baller.svg b/utils/assets/splatnet/baller.svg similarity index 100% rename from lib/assets/splatnet/baller.svg rename to utils/assets/splatnet/baller.svg diff --git a/lib/assets/splatnet/booyah-bomb.svg b/utils/assets/splatnet/booyah-bomb.svg similarity index 100% rename from lib/assets/splatnet/booyah-bomb.svg rename to utils/assets/splatnet/booyah-bomb.svg diff --git a/lib/assets/splatnet/bubbleblower.svg b/utils/assets/splatnet/bubbleblower.svg similarity index 100% rename from lib/assets/splatnet/bubbleblower.svg rename to utils/assets/splatnet/bubbleblower.svg diff --git a/lib/assets/splatnet/burstbomb-rush.svg b/utils/assets/splatnet/burstbomb-rush.svg similarity index 100% rename from lib/assets/splatnet/burstbomb-rush.svg rename to utils/assets/splatnet/burstbomb-rush.svg diff --git a/lib/assets/splatnet/colorDefs.svg b/utils/assets/splatnet/colorDefs.svg similarity index 100% rename from lib/assets/splatnet/colorDefs.svg rename to utils/assets/splatnet/colorDefs.svg diff --git a/lib/assets/splatnet/curlingbomb-rush.svg b/utils/assets/splatnet/curlingbomb-rush.svg similarity index 100% rename from lib/assets/splatnet/curlingbomb-rush.svg rename to utils/assets/splatnet/curlingbomb-rush.svg diff --git a/lib/assets/splatnet/deaths.svg b/utils/assets/splatnet/deaths.svg similarity index 100% rename from lib/assets/splatnet/deaths.svg rename to utils/assets/splatnet/deaths.svg diff --git a/lib/assets/splatnet/inkarmor.svg b/utils/assets/splatnet/inkarmor.svg similarity index 100% rename from lib/assets/splatnet/inkarmor.svg rename to utils/assets/splatnet/inkarmor.svg diff --git a/lib/assets/splatnet/inkjet.svg b/utils/assets/splatnet/inkjet.svg similarity index 100% rename from lib/assets/splatnet/inkjet.svg rename to utils/assets/splatnet/inkjet.svg diff --git a/lib/assets/splatnet/inkstorm.svg b/utils/assets/splatnet/inkstorm.svg similarity index 100% rename from lib/assets/splatnet/inkstorm.svg rename to utils/assets/splatnet/inkstorm.svg diff --git a/lib/assets/splatnet/kills.svg b/utils/assets/splatnet/kills.svg similarity index 100% rename from lib/assets/splatnet/kills.svg rename to utils/assets/splatnet/kills.svg diff --git a/lib/assets/splatnet/missiles.svg b/utils/assets/splatnet/missiles.svg similarity index 100% rename from lib/assets/splatnet/missiles.svg rename to utils/assets/splatnet/missiles.svg diff --git a/lib/assets/splatnet/ray.svg b/utils/assets/splatnet/ray.svg similarity index 100% rename from lib/assets/splatnet/ray.svg rename to utils/assets/splatnet/ray.svg diff --git a/lib/assets/splatnet/splashdown.svg b/utils/assets/splatnet/splashdown.svg similarity index 100% rename from lib/assets/splatnet/splashdown.svg rename to utils/assets/splatnet/splashdown.svg diff --git a/lib/assets/splatnet/splatbomb-rush.svg b/utils/assets/splatnet/splatbomb-rush.svg similarity index 100% rename from lib/assets/splatnet/splatbomb-rush.svg rename to utils/assets/splatnet/splatbomb-rush.svg diff --git a/lib/assets/splatnet/stamp.svg b/utils/assets/splatnet/stamp.svg similarity index 100% rename from lib/assets/splatnet/stamp.svg rename to utils/assets/splatnet/stamp.svg diff --git a/lib/assets/splatnet/suction-rush.svg b/utils/assets/splatnet/suction-rush.svg similarity index 100% rename from lib/assets/splatnet/suction-rush.svg rename to utils/assets/splatnet/suction-rush.svg diff --git a/lib/constants.ts b/utils/constants.ts similarity index 100% rename from lib/constants.ts rename to utils/constants.ts diff --git a/lib/data/abilityData.json b/utils/data/abilityData.json similarity index 100% rename from lib/data/abilityData.json rename to utils/data/abilityData.json diff --git a/lib/data/englishToInternal.json b/utils/data/englishToInternal.json similarity index 100% rename from lib/data/englishToInternal.json rename to utils/data/englishToInternal.json diff --git a/lib/data/links.json b/utils/data/links.json similarity index 100% rename from lib/data/links.json rename to utils/data/links.json diff --git a/lib/data/sr/advanced.md b/utils/data/sr/advanced.md similarity index 100% rename from lib/data/sr/advanced.md rename to utils/data/sr/advanced.md diff --git a/lib/data/sr/fundamentals.md b/utils/data/sr/fundamentals.md similarity index 100% rename from lib/data/sr/fundamentals.md rename to utils/data/sr/fundamentals.md diff --git a/lib/data/weaponData.json b/utils/data/weaponData.json similarity index 100% rename from lib/data/weaponData.json rename to utils/data/weaponData.json diff --git a/lib/errors.ts b/utils/errors.ts similarity index 100% rename from lib/errors.ts rename to utils/errors.ts diff --git a/lib/getToastOptions.ts b/utils/getToastOptions.ts similarity index 100% rename from lib/getToastOptions.ts rename to utils/getToastOptions.ts diff --git a/lib/i18n.ts b/utils/i18n.ts similarity index 100% rename from lib/i18n.ts rename to utils/i18n.ts diff --git a/lib/lists/abilities.ts b/utils/lists/abilities.ts similarity index 100% rename from lib/lists/abilities.ts rename to utils/lists/abilities.ts diff --git a/lib/lists/abilityMarkdownCodes.ts b/utils/lists/abilityMarkdownCodes.ts similarity index 100% rename from lib/lists/abilityMarkdownCodes.ts rename to utils/lists/abilityMarkdownCodes.ts diff --git a/lib/lists/abilityPoints.ts b/utils/lists/abilityPoints.ts similarity index 100% rename from lib/lists/abilityPoints.ts rename to utils/lists/abilityPoints.ts diff --git a/lib/lists/gear.ts b/utils/lists/gear.ts similarity index 100% rename from lib/lists/gear.ts rename to utils/lists/gear.ts diff --git a/lib/lists/gearMarkdownCodes.ts b/utils/lists/gearMarkdownCodes.ts similarity index 100% rename from lib/lists/gearMarkdownCodes.ts rename to utils/lists/gearMarkdownCodes.ts diff --git a/lib/lists/locales.ts b/utils/lists/locales.ts similarity index 100% rename from lib/lists/locales.ts rename to utils/lists/locales.ts diff --git a/lib/lists/stages.ts b/utils/lists/stages.ts similarity index 100% rename from lib/lists/stages.ts rename to utils/lists/stages.ts diff --git a/lib/lists/weaponCodes.ts b/utils/lists/weaponCodes.ts similarity index 100% rename from lib/lists/weaponCodes.ts rename to utils/lists/weaponCodes.ts diff --git a/lib/lists/weapons.ts b/utils/lists/weapons.ts similarity index 100% rename from lib/lists/weapons.ts rename to utils/lists/weapons.ts diff --git a/lib/lists/weaponsWithHero.ts b/utils/lists/weaponsWithHero.ts similarity index 100% rename from lib/lists/weaponsWithHero.ts rename to utils/lists/weaponsWithHero.ts diff --git a/lib/makeNameUrlFriendly.ts b/utils/makeNameUrlFriendly.ts similarity index 100% rename from lib/makeNameUrlFriendly.ts rename to utils/makeNameUrlFriendly.ts diff --git a/lib/playFunctions.ts b/utils/playFunctions.ts similarity index 100% rename from lib/playFunctions.ts rename to utils/playFunctions.ts diff --git a/lib/plus.ts b/utils/plus.ts similarity index 100% rename from lib/plus.ts rename to utils/plus.ts diff --git a/lib/postData.ts b/utils/postData.ts similarity index 100% rename from lib/postData.ts rename to utils/postData.ts diff --git a/lib/prisma.ts b/utils/prisma.ts similarity index 100% rename from lib/prisma.ts rename to utils/prisma.ts diff --git a/lib/setSearchParams.ts b/utils/setSearchParams.ts similarity index 100% rename from lib/setSearchParams.ts rename to utils/setSearchParams.ts diff --git a/lib/shuffleArray.ts b/utils/shuffleArray.ts similarity index 100% rename from lib/shuffleArray.ts rename to utils/shuffleArray.ts diff --git a/lib/strings.ts b/utils/strings.ts similarity index 100% rename from lib/strings.ts rename to utils/strings.ts diff --git a/lib/translateThese.ts b/utils/translateThese.ts similarity index 100% rename from lib/translateThese.ts rename to utils/translateThese.ts diff --git a/lib/types.ts b/utils/types.ts similarity index 100% rename from lib/types.ts rename to utils/types.ts diff --git a/lib/validators/build.ts b/utils/validators/build.ts similarity index 87% rename from lib/validators/build.ts rename to utils/validators/build.ts index 1376f54fa..2670d7bd1 100644 --- a/lib/validators/build.ts +++ b/utils/validators/build.ts @@ -1,6 +1,6 @@ -import { isAbilityArray } from "lib/lists/abilities"; -import { clothingGear, headGear, shoesGear } from "lib/lists/gear"; -import { weaponsWithHero } from "lib/lists/weaponsWithHero"; +import { isAbilityArray } from "utils/lists/abilities"; +import { clothingGear, headGear, shoesGear } from "utils/lists/gear"; +import { weaponsWithHero } from "utils/lists/weaponsWithHero"; import * as z from "zod"; import { abilityEnum, hasNoDuplicates } from "./common"; diff --git a/lib/validators/common.ts b/utils/validators/common.ts similarity index 100% rename from lib/validators/common.ts rename to utils/validators/common.ts diff --git a/lib/validators/detailedMap.ts b/utils/validators/detailedMap.ts similarity index 96% rename from lib/validators/detailedMap.ts rename to utils/validators/detailedMap.ts index 9731c795a..78c644480 100644 --- a/lib/validators/detailedMap.ts +++ b/utils/validators/detailedMap.ts @@ -1,4 +1,4 @@ -import { weapons } from "lib/lists/weapons"; +import { weapons } from "utils/lists/weapons"; import * as z from "zod"; import { abilityEnum } from "./common"; diff --git a/lib/validators/fapost.ts b/utils/validators/fapost.ts similarity index 100% rename from lib/validators/fapost.ts rename to utils/validators/fapost.ts diff --git a/lib/validators/profile.ts b/utils/validators/profile.ts similarity index 95% rename from lib/validators/profile.ts rename to utils/validators/profile.ts index a171a92e1..62ea26305 100644 --- a/lib/validators/profile.ts +++ b/utils/validators/profile.ts @@ -1,5 +1,5 @@ import { countries } from "countries-list"; -import { weaponsWithHero } from "lib/lists/weaponsWithHero"; +import { weaponsWithHero } from "utils/lists/weaponsWithHero"; import * as z from "zod"; import { hasNoDuplicates } from "./common"; diff --git a/lib/validators/salmonRunRecord.ts b/utils/validators/salmonRunRecord.ts similarity index 100% rename from lib/validators/salmonRunRecord.ts rename to utils/validators/salmonRunRecord.ts diff --git a/lib/validators/suggestion.ts b/utils/validators/suggestion.ts similarity index 100% rename from lib/validators/suggestion.ts rename to utils/validators/suggestion.ts diff --git a/lib/validators/team.ts b/utils/validators/team.ts similarity index 100% rename from lib/validators/team.ts rename to utils/validators/team.ts diff --git a/lib/validators/vouch.ts b/utils/validators/vouch.ts similarity index 100% rename from lib/validators/vouch.ts rename to utils/validators/vouch.ts