diff --git a/.prettierignore b/.prettierignore index 22d0d82f..57cb8b45 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,9 @@ vendor +.git +.github +.next +.vscode +node_modules +*.md +package.json +pnpm-lock.yaml diff --git a/app/(wiki)/buildings/[item]/page.tsx b/app/(wiki)/buildings/[item]/page.tsx index 89b3234e..7197c44e 100644 --- a/app/(wiki)/buildings/[item]/page.tsx +++ b/app/(wiki)/buildings/[item]/page.tsx @@ -7,29 +7,41 @@ const toExport = GenericArticlePage({ items: Buildings.definitions, path: "buildings", Sidebar: BuildingSidebar, - combinedArticles: [ - { - title: "Oil Tanker", - items: [ "oil_tanker_ship_tanks", "oil_tanker_ship" ], - fileName: "oil_tanker" - }, - { - title: "Containers", - items: range(11, 1).map((n) => `container_${n}`), // This is so dumb lmao - fileName: "containers" - }, - { - title: "Port", - items: [ "port_warehouse_red", "port_warehouse_blue", "crane", "port", "port_complex" ], - fileName: "port_meta" // For some reason using `port` crashes my browser - }, - { - title: "Armory", - items: [ "armory_barracks", "armory_center", "armory_vault", "armory_inner_vault", "armory" ], - fileName: "armory_meta" // Same as port - } - ] -}) + combinedArticles: [ + { + title: "Oil Tanker", + items: ["oil_tanker_ship_tanks", "oil_tanker_ship"], + fileName: "oil_tanker", + }, + { + title: "Containers", + items: range(11, 1).map((n) => `container_${n}`), // This is so dumb lmao + fileName: "containers", + }, + { + title: "Port", + items: [ + "port_warehouse_red", + "port_warehouse_blue", + "crane", + "port", + "port_complex", + ], + fileName: "port_meta", // For some reason using `port` crashes my browser + }, + { + title: "Armory", + items: [ + "armory_barracks", + "armory_center", + "armory_vault", + "armory_inner_vault", + "armory", + ], + fileName: "armory_meta", // Same as port + }, + ], +}); export const { generateMetadata, generateStaticParams } = toExport; export default toExport.default; diff --git a/app/(wiki)/credits/page.tsx b/app/(wiki)/credits/page.tsx index 7e55e1c1..31242f42 100644 --- a/app/(wiki)/credits/page.tsx +++ b/app/(wiki)/credits/page.tsx @@ -121,7 +121,7 @@ export const ARTISTS: string[] = [ export default function CreditsPage() { return ( -
+

Credits

Wiki Team

diff --git a/app/(wiki)/equipment/armor/page.tsx b/app/(wiki)/equipment/armor/page.tsx index 952864d9..6f70cc0e 100644 --- a/app/(wiki)/equipment/armor/page.tsx +++ b/app/(wiki)/equipment/armor/page.tsx @@ -13,10 +13,10 @@ import { Table } from "lucide-react"; import MatrixTable from "@/components/tables/MatrixTable"; const Helmets = Armors.definitions.filter( - (armor) => armor.armorType === ArmorType.Helmet + (armor) => armor.armorType === ArmorType.Helmet, ); const Vests = Armors.definitions.filter( - (armor) => armor.armorType === ArmorType.Vest + (armor) => armor.armorType === ArmorType.Vest, ); const vest2 = Vests[2]; @@ -145,7 +145,7 @@ export default function ArmorPage() { ).toFixed(2)}
- )) + )), )} /> diff --git a/app/(wiki)/equipment/backpacks/[item]/page.tsx b/app/(wiki)/equipment/backpacks/[item]/page.tsx index 473a7a86..99399487 100644 --- a/app/(wiki)/equipment/backpacks/[item]/page.tsx +++ b/app/(wiki)/equipment/backpacks/[item]/page.tsx @@ -6,7 +6,7 @@ const toExport = GenericArticlePage({ items: Backpacks.definitions, path: "equipment/backpacks", Sidebar: BackpackSidebar, -}) +}); export const { generateMetadata, generateStaticParams } = toExport; export default toExport.default; diff --git a/app/(wiki)/equipment/backpacks/page.tsx b/app/(wiki)/equipment/backpacks/page.tsx index eddcba79..2284e857 100644 --- a/app/(wiki)/equipment/backpacks/page.tsx +++ b/app/(wiki)/equipment/backpacks/page.tsx @@ -9,7 +9,7 @@ import AmmoIcon from "@/components/icons/AmmoIcon"; import { Fragment } from "react"; export default function BackpackPage() { return ( -
+

Backpacks

@@ -71,7 +71,7 @@ export default function BackpackPage() { height={40} className="w-10 h-10" /> - ) + ), ), ]} content={[...Backpacks].map((backpack) => [ diff --git a/app/(wiki)/healing/page.tsx b/app/(wiki)/healing/page.tsx index 7bef85d4..f34934af 100644 --- a/app/(wiki)/healing/page.tsx +++ b/app/(wiki)/healing/page.tsx @@ -8,7 +8,7 @@ import PageCard from "@/components/cards/PageCard"; export default function HealingPage() { return ( -

+

Healing Items

diff --git a/app/(wiki)/layout.tsx b/app/(wiki)/layout.tsx index 3b4152d0..e8700079 100644 --- a/app/(wiki)/layout.tsx +++ b/app/(wiki)/layout.tsx @@ -1,7 +1,5 @@ export default function ArticleLayout({ children }: React.PropsWithChildren) { return ( -

- {children} -
+
{children}
); } diff --git a/app/(wiki)/loot/page.tsx b/app/(wiki)/loot/page.tsx index 03efc423..7320f2a2 100644 --- a/app/(wiki)/loot/page.tsx +++ b/app/(wiki)/loot/page.tsx @@ -8,7 +8,7 @@ import TableWithHeader from "@/components/tables/TableWithHeader"; export default function LootPage() { return ( -
+

Loot Tables

diff --git a/app/(wiki)/skins/page.tsx b/app/(wiki)/skins/page.tsx index b2b7a965..a67b39d5 100644 --- a/app/(wiki)/skins/page.tsx +++ b/app/(wiki)/skins/page.tsx @@ -4,7 +4,7 @@ import { Skins } from "@/vendor/suroi/common/src/definitions/skins"; export default function SkinsPage() { return ( -

+

Skins

There are {Skins.definitions.length} skins.{" "} diff --git a/app/(wiki)/weapons/guns/[item]/layout.tsx b/app/(wiki)/weapons/guns/[item]/layout.tsx index 9f3e0226..fa1dcafc 100644 --- a/app/(wiki)/weapons/guns/[item]/layout.tsx +++ b/app/(wiki)/weapons/guns/[item]/layout.tsx @@ -22,7 +22,7 @@ export default function GunLayout({ return ( <> -
+

{gun.name}

diff --git a/app/(wiki)/weapons/page.tsx b/app/(wiki)/weapons/page.tsx index 537154fb..e7d61083 100644 --- a/app/(wiki)/weapons/page.tsx +++ b/app/(wiki)/weapons/page.tsx @@ -9,7 +9,7 @@ import Collapsible from "@/components/interactive/Collapsible"; export default function WeaponsPage() { return ( -
+

Weapons

diff --git a/app/(wiki)/weapons/throwables/[item]/layout.tsx b/app/(wiki)/weapons/throwables/[item]/layout.tsx index eb8d61bf..fd4b9949 100644 --- a/app/(wiki)/weapons/throwables/[item]/layout.tsx +++ b/app/(wiki)/weapons/throwables/[item]/layout.tsx @@ -16,7 +16,7 @@ export default function ThrowableLayout({ if (!throwable) notFound(); return ( <> -

+

{throwable.name}

{children}
diff --git a/components/articles/KillFeedImage.tsx b/components/articles/KillFeedImage.tsx index 831f4fd2..27be8f70 100644 --- a/components/articles/KillFeedImage.tsx +++ b/components/articles/KillFeedImage.tsx @@ -1,23 +1,28 @@ -import { getSuroiItem, getSuroiKillfeedImageLink } from "@/lib/util/suroi" -import Image from "next/image" +import { getSuroiItem, getSuroiKillfeedImageLink } from "@/lib/util/suroi"; +import Image from "next/image"; -export default function KillFeedImage({weaponID, width, height, rotation}: KillFeedImageProps) { - return ( - {getSuroiItem(weaponID)?.name} - ) +export default function KillFeedImage({ + weaponID, + width, + height, + rotation, +}: KillFeedImageProps) { + return ( + {getSuroiItem(weaponID)?.name} + ); } export interface KillFeedImageProps extends React.PropsWithChildren { - weaponID: string, - width?: number, - height?: number, - rotation?: number, + weaponID: string; + width?: number; + height?: number; + rotation?: number; } diff --git a/components/articles/SuroiItemImage.tsx b/components/articles/SuroiItemImage.tsx index 548ac3d8..65e0afea 100644 --- a/components/articles/SuroiItemImage.tsx +++ b/components/articles/SuroiItemImage.tsx @@ -1,26 +1,41 @@ -import { getSuroiImageLink, getSuroiItem } from "@/lib/util/suroi" -import Image from "next/image" +import { getSuroiImageLink, getSuroiItem } from "@/lib/util/suroi"; +import Image from "next/image"; -export default function SuroiItemImage({itemID, width, height, rotation, variation, append, dual}: SuroiItemImageProps) { - return ( - {getSuroiItem(itemID)?.name} - ) +export default function SuroiItemImage({ + itemID, + width, + height, + rotation, + variation, + append, + dual, +}: SuroiItemImageProps) { + return ( + {getSuroiItem(itemID)?.name} + ); } export interface SuroiItemImageProps extends React.PropsWithChildren { - itemID: string, - width?: number, - height?: number, - rotation?: number, - variation?: number, - append?: string, - dual?: boolean + itemID: string; + width?: number; + height?: number; + rotation?: number; + variation?: number; + append?: string; + dual?: boolean; } diff --git a/components/generics/GenericArticlePage.tsx b/components/generics/GenericArticlePage.tsx index 04d49543..fa0d28cc 100644 --- a/components/generics/GenericArticlePage.tsx +++ b/components/generics/GenericArticlePage.tsx @@ -91,10 +91,13 @@ export default function GenericArticlePage( return ( <> -
+

{item?.name ?? combinedArticle?.title} - +

{ // If there is an article, render it @@ -105,9 +108,7 @@ export default function GenericArticlePage( ) } - { - args.After && args.After - } + {args.After && args.After}
{item ? ( @@ -138,7 +139,7 @@ export interface GenericArticlePageArgs { items: T[]; combinedArticles?: CombinedArticle[]; Sidebar: ComponentType<{ item: T }>; - After?: ReactNode + After?: ReactNode; } export interface CombinedArticle { diff --git a/components/layouts/Footer.tsx b/components/layouts/Footer.tsx index 7de5c925..37015278 100644 --- a/components/layouts/Footer.tsx +++ b/components/layouts/Footer.tsx @@ -46,7 +46,10 @@ export default function Footer() { ); } -function FooterLink({ href, children }: React.PropsWithChildren & { href: string }) { +function FooterLink({ + href, + children, +}: React.PropsWithChildren & { href: string }) { return ( {children} diff --git a/components/layouts/GenericLayoutFactory.tsx b/components/layouts/GenericLayoutFactory.tsx index e202cfa8..808d9591 100644 --- a/components/layouts/GenericLayoutFactory.tsx +++ b/components/layouts/GenericLayoutFactory.tsx @@ -24,7 +24,7 @@ export default function GenericLayoutFactory( return ( <> -
+

{item.name}

{children}
diff --git a/components/sidebars/BackpackSidebar.tsx b/components/sidebars/BackpackSidebar.tsx index c4aec052..45727e21 100644 --- a/components/sidebars/BackpackSidebar.tsx +++ b/components/sidebars/BackpackSidebar.tsx @@ -5,7 +5,11 @@ import InfoboxHeader from "./utils/InfoboxHeader"; import InfoboxColumn from "./utils/InfoboxColumn"; import AmmoIcon from "../icons/AmmoIcon"; import HealingIcon from "../icons/HealingIcon"; -import { IMAGE_BASE_URL, getSuroiImageLink, getSuroiItem } from "@/lib/util/suroi"; +import { + IMAGE_BASE_URL, + getSuroiImageLink, + getSuroiItem, +} from "@/lib/util/suroi"; import Image from "next/image"; export default function BackpackSidebar({ @@ -16,16 +20,16 @@ export default function BackpackSidebar({ return ( Healing Capacity @@ -58,68 +62,68 @@ export default function BackpackSidebar({ Ammo Capacity - - {["12g", "556mm"].map((ammo) => ( - + {["12g", "556mm"].map((ammo) => ( +
- } - > - {item.maxCapacity[ammo]} - - ))} - - - {["762mm", "9mm"].map((ammo) => ( - + {item.maxCapacity[ammo]} + + ))} + + + {["762mm", "9mm"].map((ammo) => ( +
- } - > - {item.maxCapacity[ammo]} - - ))} - - - {["127mm", "power_cell", "curadell"].map((ammo) => ( - + {item.maxCapacity[ammo]} + + ))} + + + {["127mm", "power_cell", "curadell"].map((ammo) => ( +
- } - > - {item.maxCapacity[ammo]} - - ))} - - Throwable Capacity - - {["frag_grenade", "smoke_grenade"].map((throwable) => ( - - {throwable} -
- } - > - {item.maxCapacity[throwable]} - - ))} - + } + > + {item.maxCapacity[ammo]} + + ))} + + Throwable Capacity + + {["frag_grenade", "smoke_grenade"].map((throwable) => ( + + {throwable} +
+ } + > + {item.maxCapacity[throwable]} + + ))} + ); } diff --git a/components/sidebars/GunDetails.tsx b/components/sidebars/GunDetails.tsx index 6976bfa8..026eb7de 100644 --- a/components/sidebars/GunDetails.tsx +++ b/components/sidebars/GunDetails.tsx @@ -1,6 +1,6 @@ import { Unpacked } from "@/lib/ts/utility"; import { - SOUND_BASE_URL, + SOUND_BASE_URL, getSuroiImageLink, getSuroiItem, getSuroiKillfeedImageLink, diff --git a/components/sidebars/utils/ExplosionRow.tsx b/components/sidebars/utils/ExplosionRow.tsx index 8cddd023..b43a7330 100644 --- a/components/sidebars/utils/ExplosionRow.tsx +++ b/components/sidebars/utils/ExplosionRow.tsx @@ -25,14 +25,14 @@ export default function ExplosionRow({ explosion }: ExplosionRowProps) { {explosionData.shrapnelCount} - + {explosionData.radius.min} {explosionData.radius.max} - + {explosionData.ballistics.damage} diff --git a/components/sidebars/utils/GenericSidebar.tsx b/components/sidebars/utils/GenericSidebar.tsx index 86f3bb5b..1414a610 100644 --- a/components/sidebars/utils/GenericSidebar.tsx +++ b/components/sidebars/utils/GenericSidebar.tsx @@ -8,7 +8,7 @@ export default function GenericSidebar({ imageVariations, }: GenericSidebarProps) { return ( -
+

{title}

diff --git a/components/sidebars/utils/InfoboxRow.tsx b/components/sidebars/utils/InfoboxRow.tsx index ef480819..788c9d65 100644 --- a/components/sidebars/utils/InfoboxRow.tsx +++ b/components/sidebars/utils/InfoboxRow.tsx @@ -9,7 +9,8 @@ export default function InfoboxRow({ columns, children }: InfoboxRowProps) { // Make infoboxrow empty if there are no children if (childrenCount === 0) return <>; - if (childrenCount > 3) console.error("Having more than three children can lead to layout issues") + if (childrenCount > 3) + console.error("Having more than three children can lead to layout issues"); return (
{header.map((cell, i) => ( - + {cell} ))} @@ -32,7 +35,10 @@ export default function TableWithHeader({ }} > {row.map((cell, j) => ( - + {cell} ))} diff --git a/cspell.json b/cspell.json index b887cd3f..482de9d7 100644 --- a/cspell.json +++ b/cspell.json @@ -2,7 +2,7 @@ "version": "0.2", "language": "en_US,ru-ru", "allowCompoundWords": true, - "ignorePaths": ["vendor/**", "node_modules/**"], + "ignorePaths": ["vendor/**", "node_modules/**"], "words": [ // Internet-speak "tldr", @@ -21,8 +21,8 @@ "quickswitch", "adren", "ghillie", - "detonated", - "undetonated", + "detonated", + "undetonated", // Buildings "porta", @@ -32,16 +32,16 @@ // Weapons "glock", - "glocks", - "minimi", + "glocks", + "minimi", "garand", "usas", "mosin", "léon", "nagant", "steyr", - "kriss", - "vepr", + "kriss", + "vepr", /* CZ-75A */ "františek", "koucký", @@ -106,13 +106,13 @@ "kenos", "sniperboi", "Medeus", - "eipi", + "eipi", // Random "excipients", // Plural of excipient "retextured", - "misaligning", - "synergize" + "misaligning", + "synergize" ], "import": ["@cspell/dict-ru_ru/cspell-ext.json"] diff --git a/package.json b/package.json index 81fa9850..9c676de2 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint && prettier **/*.{mdx,tsx,ts} --write", - "ci:lint": "next lint ; prettier **/*.{mdx,tsx,ts} --check", + "lint": "next lint && prettier ./ --write", + "ci:lint": "next lint ; prettier ./ --check", "spellcheck": "cspell '**/*.{md,mdx}' --show-context --show-suggestions" }, "dependencies": { diff --git a/postcss.config.js b/postcss.config.js index 33ad091d..12a703d9 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/vendor/suroi b/vendor/suroi index c72e0fd4..fa82b8cb 160000 --- a/vendor/suroi +++ b/vendor/suroi @@ -1 +1 @@ -Subproject commit c72e0fd440933a4bc36791bac115def92c76d301 +Subproject commit fa82b8cbd6d52ee0c8e926a10a88c6a2a27a5ffe