Developing

Thank you for considering to contribute code to the Suroi wiki!

If you find any bugs errors, or inconsistencies in general in the wiki, feel free to open an issue or pull request at the github repository.

We use the following tech stack:

Please refer to the documentation of each framework / library for more information.

Getting Started

This wiki utilizes git submodules, so first-time setup for a development environment is slightly different from normal:

git clone https://github.com/HasangerGames/suroi-wiki.git
cd suroi-wiki
git submodule init
# Do not use --remote as it does not respect the selected commit
git submodule update
pnpm install

Local Development

To start a local development server, run pnpm dev, then go to https://127.0.0.1:3000 in your browser (A different port maybe be used if 3000 is being used).

Production

To build for production, run pnpm build. To start the server, run pnpm start.

Note that we use pnpm, a high-performance alternative to npm.

Recommended Setup

  • Visual Studio Code / VSCodium
  • VSCode Extensions (VSCode should automatically recommend you workspace extensions)
    • TypeScript
    • ESLint
    • Prettier
    • Code Spell Checker
    • Tailwind CSS IntelliSense
  • pnpm
  • git

NOTE: These are just recommendations. Feel free to use whatever tools suit you best.

Pre-Commit Hooks

If you have been plagued by GitHub spamming your email about failed CI runs, try out Git Hooks!

At the project root:

echo "pnpm lint; pnpm spellcheck" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

Now Git will automatically lint and spellcheck for you on each commit!

DO's and DON'Ts

DON'T use <a></a> and <img />

We use the NextJS component equivalents, <Link></Link> and <Image />.

DON'T push large amounts of changes to the wiki code

Please make a branch / fork and create a pull request. Also have at least one maintainer review your code.
Small changes are an exception to this and don't need review (though it is best to get approval from @kenos1 (kenos) or @Compositr).

DON'T ignore the JSX key error

It's super annoying, but add a key prop anyways.

DON'T push hacky solutions

The only exception is if it will be refactored soon, or if another person is willing to refactor it.

DON'T use external images

Currently, the only exceptions to this rule are GitHub for game assets and Invidious for YouTube thumbnails.
Please upload any other assets in /public.

DON'T use emojis in commit messages

You will be publicly shamed.

DO use tree shaking

If you are adding new libraries, please use tree shaking whenever possible, to minimize bundle sizes.

DO use a formatter and linter

Execute this command to run ESLint over the codebase:

pnpm lint

DO use a spellchecker

Run this command to spellcheck:

pnpm spellcheck
Emote: bleh

Note that we run GitHub Actions to check for build errors, linting, and spellchecking!

Where To Start

If you want to contribute code; reach out to @zedaes on the Suroi Discord. Or, you can just edit things to make the website better! Anything helps!