2024-04-25 19:26:47 +02:00
# Single Player Tarkov - Server Project
This is the Server project for the Single Player Tarkov mod for Escape From Tarkov. It can be run locally to replicate responses to the modified Escape From Tarkov client.
# Table of Contents
- [Features ](#features )
- [Installation ](#installation )
2024-05-16 10:41:05 +02:00
- [Requirements ](#requirements )
- [Initial Setup ](#initial-setup )
2024-04-25 19:26:47 +02:00
- [Development ](#development )
2024-05-16 10:41:05 +02:00
- [Commands ](#commands )
- [Debugging ](#debugging )
- [Mod Debugging ](#mod-debugging )
2024-04-25 19:26:47 +02:00
- [Contributing ](#contributing )
2024-05-16 10:41:05 +02:00
- [Branches ](#branchs )
- [Pull Request Guidelines ](#pull-request-guidelines )
- [Tests ](#tests )
2024-04-25 19:26:47 +02:00
- [License ](#license )
## Features
For a full list of features, please see [FEATURES.md ](FEATURES.md ).
## Installation
### Requirements
This project has been built in [Visual Studio Code ](https://code.visualstudio.com/ ) (VSC) using [Node.js ](https://nodejs.org/ ). We recommend using [NVM ](https://github.com/coreybutler/nvm-windows ) to manage installation and switching Node versions. If you do not wish to use NVM, you will need to install the version of Node.js listed within the `.nvmrc` file manually.
There are a number of VSC extensions that we recommended for this project. VSC will prompt you to install these when you open the workspace file. If you do not see the prompt, you can install them manually:
- [EditorConfig ](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig ) - Editor Settings Synchronization
- [Vitest ](https://marketplace.visualstudio.com/items?itemName=vitest.explorer ) - Debugging Tests
- [SPT ID Highlighter ](https://marketplace.visualstudio.com/items?itemName=refringe.spt-id-highlighter ) - Converts IDs to Names
Adds Biome - Removes ESLint & Prettier (!383)
Boogidy, boogidy, boogidy. Let's go racing! 🏎️
Removes the over-complicated and super-slow setup we had with ESLint & Prettier in favour of Biome. The largest change with the formatting is moving from Allman braces to 1TBS braces. Other than that, it's *pretty much* the same. Ah, and that Biome runs formatting and linting on the entire project about x10 faster than the old system ran formatting on one file. Seriously, the guy who came up with that last solution should be fired. :runs:
I've kept all of the formatting and linting commands the same as before, with the main mamma-jamma being: `npm run format`, which applies formatting and linting changes to the entire project.
Formatting-on-save works (quickly!) by (1) ensuring that you're working within the VSC workspace (as you should be), and (2) have the recommended Biome VSC extension installed. The link to the Biome extension is in the README.
This limits our options on code formatting going forward; Biome, like prettier, is very opinionated with very few formatting options available. But I see this as a good thing. I'd rather spend my time arguing about which gun in Tarkov is the best, rather than coding brace styles...
...It's the TOZ, and it always will be. Don't DM me.
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
2024-07-22 23:15:57 +02:00
- [Biome ](https://marketplace.visualstudio.com/items?itemName=biomejs.biome ) - Automatic Formatting & Code Standards Linting
2024-04-25 19:26:47 +02:00
### Initial Setup
To prepare the project for development you will need to:
2024-05-21 20:05:12 +02:00
1. Run `git clone https://dev.sp-tarkov.com/SPT/Server.git server` to clone the repository.
2024-04-25 19:26:47 +02:00
2. Run `git lfs pull` to download LFS files locally.
2024-05-16 10:41:05 +02:00
3. Open the `project/mod.code-workspace` file in Visual Studio Code (VSC).
2024-06-03 18:34:22 +02:00
4. Run `nvm use 20.11.1` in the VSC terminal.
2024-05-16 10:41:05 +02:00
5. Run `npm install` in the VSC terminal.
2024-04-25 19:26:47 +02:00
## Development
### Commands
The following commands are available after the initial setup. Run them with `npm run <command>` .
Adds Biome - Removes ESLint & Prettier (!383)
Boogidy, boogidy, boogidy. Let's go racing! 🏎️
Removes the over-complicated and super-slow setup we had with ESLint & Prettier in favour of Biome. The largest change with the formatting is moving from Allman braces to 1TBS braces. Other than that, it's *pretty much* the same. Ah, and that Biome runs formatting and linting on the entire project about x10 faster than the old system ran formatting on one file. Seriously, the guy who came up with that last solution should be fired. :runs:
I've kept all of the formatting and linting commands the same as before, with the main mamma-jamma being: `npm run format`, which applies formatting and linting changes to the entire project.
Formatting-on-save works (quickly!) by (1) ensuring that you're working within the VSC workspace (as you should be), and (2) have the recommended Biome VSC extension installed. The link to the Biome extension is in the README.
This limits our options on code formatting going forward; Biome, like prettier, is very opinionated with very few formatting options available. But I see this as a good thing. I'd rather spend my time arguing about which gun in Tarkov is the best, rather than coding brace styles...
...It's the TOZ, and it always will be. Don't DM me.
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
2024-07-22 23:15:57 +02:00
| Command | Description |
2024-07-24 17:50:07 +02:00
|----------------------|---------------------------------------------------------------------------|
Adds Biome - Removes ESLint & Prettier (!383)
Boogidy, boogidy, boogidy. Let's go racing! 🏎️
Removes the over-complicated and super-slow setup we had with ESLint & Prettier in favour of Biome. The largest change with the formatting is moving from Allman braces to 1TBS braces. Other than that, it's *pretty much* the same. Ah, and that Biome runs formatting and linting on the entire project about x10 faster than the old system ran formatting on one file. Seriously, the guy who came up with that last solution should be fired. :runs:
I've kept all of the formatting and linting commands the same as before, with the main mamma-jamma being: `npm run format`, which applies formatting and linting changes to the entire project.
Formatting-on-save works (quickly!) by (1) ensuring that you're working within the VSC workspace (as you should be), and (2) have the recommended Biome VSC extension installed. The link to the Biome extension is in the README.
This limits our options on code formatting going forward; Biome, like prettier, is very opinionated with very few formatting options available. But I see this as a good thing. I'd rather spend my time arguing about which gun in Tarkov is the best, rather than coding brace styles...
...It's the TOZ, and it always will be. Don't DM me.
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
2024-07-22 23:15:57 +02:00
| `check:circular` | Check for circular dependencies in the project. |
| `lint` | Check the project for coding standards issues using Biome. |
| `lint:fix` | Automatically fix coding standards issues using Biome. |
| `style` | Check the project for formatting issues using Biome. |
| `style:fix` | Automatically fix formatting issues using Biome. |
| `format` | Automatically fix all coding standards and formatting issues using Biome. |
| `test` | Run all tests. |
| `test:watch` | Run tests in watch mode. Tests will re-run when files are changed. |
| `test:coverage` | Run tests and generate a coverage report. |
| `test:ui` | Run tests in UI mode. This will open a browser window to view tests. |
| `build:release` | Build the project for release. |
| `build:debug` | Build the project for debugging. |
| `build:bleeding` | Build the project on the bleeding edge. |
| `build:bleedingmods` | Build the project on the bleeding edge with mods. |
| `run:build` | Run the project in build mode. |
| `run:debug` | Run the project in debug mode. |
| `run:profiler` | Run the project in profiler mode. |
| `gen:types` | Generate types for the project. |
| `gen:docs` | Generate documentation for the project. |
2024-04-25 19:26:47 +02:00
### Debugging
To debug the project in Visual Studio Code, you can select the `Run` tab and then select the `Start Debugging` option (or the `F5` shortcut). This will start the server in debug mode, attaching a debugger to code execution, allowing you to set breakpoints and step through the code as it runs.
### Mod Debugging
To debug a server mod in Visual Studio Code, you can copy the mod files into the `user/mods` folder and then start the server in [debug mode ](#debugging ). You should now be able to set breakpoints in the mod's Typescript files and they will be hit when the server runs the mod files.
2024-05-06 08:35:06 +02:00
## Contributing
2024-04-25 19:26:47 +02:00
We're really excited that you're interested in contributing! Before submitting your contribution, please consider the following:
2024-07-24 17:50:07 +02:00
### Branches
2024-04-25 19:26:47 +02:00
2024-05-16 10:41:05 +02:00
- **master**
2024-04-25 19:26:47 +02:00
The default branch used for the latest stable release. This branch is protected and typically is only merges with release branches.
2024-07-24 17:50:07 +02:00
- **3.9.x-DEV**
Development for the next hotfix release. Hotfix releases include bug fixes and minor features that do not affect the coding structure of the project. Special care is taken to not break server mod stability. These always target the same version of EFT as the last minor release.
Adds Biome - Removes ESLint & Prettier (!383)
Boogidy, boogidy, boogidy. Let's go racing! 🏎️
Removes the over-complicated and super-slow setup we had with ESLint & Prettier in favour of Biome. The largest change with the formatting is moving from Allman braces to 1TBS braces. Other than that, it's *pretty much* the same. Ah, and that Biome runs formatting and linting on the entire project about x10 faster than the old system ran formatting on one file. Seriously, the guy who came up with that last solution should be fired. :runs:
I've kept all of the formatting and linting commands the same as before, with the main mamma-jamma being: `npm run format`, which applies formatting and linting changes to the entire project.
Formatting-on-save works (quickly!) by (1) ensuring that you're working within the VSC workspace (as you should be), and (2) have the recommended Biome VSC extension installed. The link to the Biome extension is in the README.
This limits our options on code formatting going forward; Biome, like prettier, is very opinionated with very few formatting options available. But I see this as a good thing. I'd rather spend my time arguing about which gun in Tarkov is the best, rather than coding brace styles...
...It's the TOZ, and it always will be. Don't DM me.
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
2024-07-22 23:15:57 +02:00
- **3.10.0-DEV**
2024-07-24 17:50:07 +02:00
Development for the next minor release of SPT. Minor releases target the latest version of EFT. Late in the minor release cycle the EFT version is frozen for stability to prepare for release. Larger changes to the project structure may be included in minor releases.
2024-04-25 19:26:47 +02:00
### Pull Request Guidelines
2024-05-16 10:41:05 +02:00
- **Keep Them Small**
2024-04-25 19:26:47 +02:00
If you're fixing a bug, try to keep the changes to the bug fix only. If you're adding a feature, try to keep the changes to the feature only. This will make it easier to review and merge your changes.
2024-05-16 10:41:05 +02:00
- **Perform a Self-Review**
2024-04-25 19:26:47 +02:00
Before submitting your changes, review your own code. This will help you catch any mistakes you may have made.
2024-05-16 10:41:05 +02:00
- **Remove Noise**
2024-04-25 19:26:47 +02:00
Remove any unnecessary changes to white space, code style formatting, or some text change that has no impact related to the intention of the PR.
2024-05-16 10:41:05 +02:00
- **Create a Meaningful Title**
2024-04-25 19:26:47 +02:00
When creating a PR, make sure the title is meaningful and describes the changes you've made.
2024-05-16 10:41:05 +02:00
- **Write Detailed Commit Messages**
2024-04-25 19:26:47 +02:00
Bring out your table manners, speak the Queen's English and be on your best behaviour.
### Style Guide
Adds Biome - Removes ESLint & Prettier (!383)
Boogidy, boogidy, boogidy. Let's go racing! 🏎️
Removes the over-complicated and super-slow setup we had with ESLint & Prettier in favour of Biome. The largest change with the formatting is moving from Allman braces to 1TBS braces. Other than that, it's *pretty much* the same. Ah, and that Biome runs formatting and linting on the entire project about x10 faster than the old system ran formatting on one file. Seriously, the guy who came up with that last solution should be fired. :runs:
I've kept all of the formatting and linting commands the same as before, with the main mamma-jamma being: `npm run format`, which applies formatting and linting changes to the entire project.
Formatting-on-save works (quickly!) by (1) ensuring that you're working within the VSC workspace (as you should be), and (2) have the recommended Biome VSC extension installed. The link to the Biome extension is in the README.
This limits our options on code formatting going forward; Biome, like prettier, is very opinionated with very few formatting options available. But I see this as a good thing. I'd rather spend my time arguing about which gun in Tarkov is the best, rather than coding brace styles...
...It's the TOZ, and it always will be. Don't DM me.
Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/383
Co-authored-by: Refringe <me@refringe.com>
Co-committed-by: Refringe <me@refringe.com>
2024-07-22 23:15:57 +02:00
We use Biome to enforce a consistent code style. Please run `npm run format` before submitting any changes. This is made easier by opening the VSC workspace and installing the recommended VSC extensions; this will ensure that your code is automatically formatted whenever you save a file.
2024-04-25 19:26:47 +02:00
### Tests
We have a number of tests that are run automatically when you submit a pull request. You can run these tests locally by running `npm run test` . If you're adding a new feature or fixing a bug, please conceder adding tests to cover your changes so that we can ensure they don't break in the future.
## License
This project is licensed under the NCSA Open Source License. See the [LICENSE ](LICENSE.md ) file for details.