Skip to content

Commit

Permalink
MDX to MD file migration
Browse files Browse the repository at this point in the history
  • Loading branch information
kenos1 committed Jan 8, 2024
1 parent cb99cd4 commit cfc24dc
Show file tree
Hide file tree
Showing 104 changed files with 12 additions and 8 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 6 additions & 2 deletions components/generics/GenericArticlePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ReferenceTo,
} from "@/vendor/suroi/common/src/utils/objectDefinitions";
import path from "path";
import { ComponentType } from "react";
import { ComponentType, ReactNode } from "react";
import fs from "node:fs/promises";
import { serialize } from "next-mdx-remote/serialize";
import { notFound, redirect } from "next/navigation";
Expand Down Expand Up @@ -77,7 +77,7 @@ export default function GenericArticlePage<T extends ObjectDefinition>(
);

const article =
articles[(params.item ?? combinedArticle?.fileName) + ".mdx"] ?? null;
articles[(params.item ?? combinedArticle?.fileName) + ".md"] ?? null;

if (!item) {
// Lookup combined articles
Expand Down Expand Up @@ -105,6 +105,9 @@ export default function GenericArticlePage<T extends ObjectDefinition>(
<Empty />
)
}
{
args.After && args.After
}
</div>
{item ? (
<args.Sidebar item={item} />
Expand Down Expand Up @@ -135,6 +138,7 @@ export interface GenericArticlePageArgs<T extends ObjectDefinition> {
items: T[];
combinedArticles?: CombinedArticle<T>[];
Sidebar: ComponentType<{ item: T }>;
After?: ReactNode
}

export interface CombinedArticle<T extends ObjectDefinition> {
Expand Down
2 changes: 1 addition & 1 deletion components/layouts/GenericMDXPageFactory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function GenericMDXPageFactory(args: GenericMDXPageFactoryArgs) {
if (params.item.startsWith("dual_"))
return redirect(`/weapons/guns/${params.item.replace("dual_", "")}`);

const article = articles[params.item + ".mdx"] ?? null;
const article = articles[params.item + ".md"] ?? null;

if (article)
return (
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint && prettier **/*.{mdx,tsx,ts} --write",
"spellcheck": "cspell '**/*.mdx' --show-context --show-suggestions"
"lint": "next lint && prettier **/*.{md,mdx,tsx,ts} --write",
"spellcheck": "cspell '**/*.md' --show-context --show-suggestions"
},
"dependencies": {
"@cspell/dict-ru_ru": "^2.2.0",
Expand Down
4 changes: 2 additions & 2 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type { Config } from "tailwindcss";

const config: Config = {
content: [
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,md,mdx}",
"./app/**/*.{js,ts,jsx,tsx,md,mdx}",
],
theme: {
container: {
Expand Down
2 changes: 1 addition & 1 deletion vendor/suroi
Submodule suroi updated 69 files
+ client/public/audio/sfx/gun_click.mp3
+ client/public/audio/sfx/hits/sand_destroyed.mp3
+ client/public/audio/sfx/hits/sand_hit_1.mp3
+ client/public/audio/sfx/hits/sand_hit_2.mp3
+ client/public/audio/sfx/weapons/ak47_reload.mp3
+ client/public/audio/sfx/weapons/vector_fire.mp3
+ client/public/audio/sfx/weapons/vector_reload.mp3
+ client/public/audio/sfx/weapons/vector_switch.mp3
+ client/public/audio/sfx/weapons/vepr12_reload.mp3
+ client/public/audio/sfx/weapons/vepr12_switch.mp3
+14 −9 client/public/img/credits.txt
+820 −4,658 client/public/img/game/buildings/oil_tanker_ship_tank_ceiling.svg
+14 −14 client/public/img/game/obstacles/crane_base_part.svg
+17 −146 client/public/img/game/obstacles/port_fence.svg
+31 −242 client/public/img/game/obstacles/port_fence_side.svg
+72 −400 client/public/img/game/obstacles/sandbags.svg
+5 −2 client/public/img/game/particles/9mm_particle.svg
+7 −7 client/public/img/game/particles/sandbags_particle.svg
+0 −104 client/public/img/game/residues/sand_particle_1.svg
+0 −101 client/public/img/game/residues/sand_particle_2.svg
+0 −103 client/public/img/game/residues/sand_particle_3.svg
+22 −107 client/public/img/game/weapons/ice_pick.svg
+4 −0 client/public/img/killfeed/ice_pick_killfeed.svg
+4 −0 client/public/img/killfeed/seax_killfeed.svg
+2 −2 client/src/scripts/objects/building.ts
+1 −1 client/src/scripts/objects/explosion.ts
+3 −3 client/src/scripts/objects/obstacle.ts
+1 −1 client/src/scripts/objects/parachute.ts
+1 −1 client/src/scripts/objects/plane.ts
+105 −89 client/src/scripts/objects/player.ts
+0 −2 client/src/scripts/objects/syncedParticle.ts
+42 −4 client/src/scripts/objects/throwableProj.ts
+2 −2 client/src/scripts/utils/console/gameConsole.ts
+5 −5 client/src/scripts/utils/inputManager.ts
+3 −3 client/src/scripts/utils/soundManager.ts
+5 −6 client/src/scripts/utils/uiManager.ts
+63 −50 client/src/scss/pages/client/game.scss
+1 −1 client/src/scss/utils/buttons.scss
+3 −0 common/src/constants.ts
+8 −8 common/src/definitions/backpacks.ts
+92 −69 common/src/definitions/buildings.ts
+1 −1 common/src/definitions/decals.ts
+1 −1 common/src/definitions/explosions.ts
+8 −8 common/src/definitions/guns.ts
+8 −8 common/src/definitions/melees.ts
+106 −21 common/src/definitions/obstacles.ts
+1 −4 common/src/definitions/syncedParticles.ts
+24 −10 common/src/definitions/throwables.ts
+16 −17 common/src/packets/updatePacket.ts
+50 −44 common/src/utils/objectsSerializations.ts
+63 −63 common/src/utils/suroiBitStream.ts
+8 −2 common/src/utils/terrain.ts
+1 −1 server/src/data/gasStages.ts
+8 −4 server/src/data/lootTables.ts
+59 −14 server/src/data/maps.ts
+36 −19 server/src/game.ts
+5 −11 server/src/inventory/action.ts
+13 −14 server/src/inventory/gunItem.ts
+1 −1 server/src/inventory/inventory.ts
+1 −2 server/src/inventory/meleeItem.ts
+101 −42 server/src/inventory/throwableItem.ts
+12 −8 server/src/objects/loot.ts
+5 −5 server/src/objects/obstacle.ts
+67 −37 server/src/objects/player.ts
+3 −3 server/src/objects/syncedParticle.ts
+174 −91 server/src/objects/throwableProj.ts
+1 −3 server/src/utils/grid.ts
+493 −235 tests/src/validateDefinitions.ts
+174 −2 tests/src/validationUtils.ts

0 comments on commit cfc24dc

Please sign in to comment.