# Contribution to TerraFirmaGreg-Modern
## Table of Contents
- [Contribution to TerraFirmaGreg-Modern](#contribution-to-terrafirmagreg-modern)
- [Table of Contents](#table-of-contents)
- [English Version](#english-version)
- [1. Required and Recommended Software](#1-required-and-recommended-software)
- [Required Software](#required-software)
- [Recommended Software](#recommended-software)
- [Reccomended Plugins:](#reccomended-plugins)
- [2. Project Preparation](#2-project-preparation)
- [Step 1: Creating a New Instance in PrismLauncher](#step-1-creating-a-new-instance-in-prismlauncher)
- [Step 2: Finding the Prism Folder](#step-2-finding-the-prism-folder)
- [Step 3: Make a fork of the Repository](#step-3-make-a-fork-of-the-repository)
- [Step 4: Cloning the Repository](#step-4-cloning-the-repository)
- [Step 5: Copying and linking development \& instance folders](#step-5-copying-and-linking-development--instance-folders)
- [Step 6: Synchronizing Dependencies via Pakku](#step-6-synchronizing-dependencies-via-pakku)
- [Step 7: Working with Branches and Creating Pull Request](#step-7-working-with-branches-and-creating-pull-request)
- [Step 8: Processing and Merging Pull Request](#step-8-processing-and-merging-pull-request)
- [3. Additional Recommendations](#3-additional-recommendations)
- [Russian Version](#russian-version)
- [1. Необходимое и рекомендуемое ПО](#1-необходимое-и-рекомендуемое-по)
- [Необходимое ПО](#необходимое-по)
- [Рекомендуемое ПО](#рекомендуемое-по)
- [2. Подготовка проекта](#2-подготовка-проекта)
- [Шаг 1: Клонирование основного репозитория](#шаг-1-клонирование-основного-репозитория)
- [Шаг 2: Создание новой инстанции в PrismLauncher](#шаг-2-создание-новой-инстанции-в-prismlauncher)
- [Шаг 3: Очистка папки проекта](#шаг-3-очистка-папки-проекта)
- [Шаг 4: Клонирование репозитория в пустую папку](#шаг-4-клонирование-репозитория-в-пустую-папку)
- [Шаг 5: Синхронизация зависимостей через Pakku](#шаг-5-синхронизация-зависимостей-через-pakku)
- [Шаг 6: Работа с ветками и создание Pull Request](#шаг-6-работа-с-ветками-и-создание-pull-request)
- [Шаг 7: Обработка и вливание Pull Request](#шаг-7-обработка-и-вливание-pull-request)
- [3. Дополнительные рекомендации](#3-дополнительные-рекомендации)
---
## Video Guide: https://www.youtube.com/watch?v=vLL7jTtuOuw
## English Version
### 1. Required and Recommended Software
#### Required Software
- [Git]: A version control system for managing source code.
- [Pakku]: A tool for dependency management and modpack building.
> [!WARNING]
> Ensure that Java version 17 is installed on your machine, as it is required for Forge and Pakku to function properly.
#### Recommended Software
- [PrismLauncher]: An optimized launcher for Minecraft modifications, making it easier to create separate instances.
- [Github Desktop] A graphical client for managing Git repositories developed by GitHub.
- [Visual Studio Code]: A code editor with extensive capabilities for working with projects and integrating various plugins.
###### Reccomended Plugins:
- [Github Pull Requests] Has many of the features of Github Desktop built in for an all-in-one editing suite.
---
### 2. Project Preparation
#### Step 1: Creating a New Instance in PrismLauncher
1. Open [PrismLauncher] and click on the **`Add Instance`** button.
2. In the **Name** field, enter the name **`TerraFirmaGreg-Modern`**.
3. Select Minecraft version **`1.20.1`** and Forge version **`47.4.13`** — these versions are necessary for the modpack to work correctly.
> [!TIP]
> Creating instance (Select 47.4.13 for forge instead of pictured)
> 
#### Step 2: Finding the Prism Folder
1. Locate the instance folder in the PrismLauncher directory at **`TerraFirmaGreg-Modern/minecraft`**.
> [!TIP]
> For quick access, right-click on the instance and select **`Folder`**.
> 
#### Step 3: Make a fork of the Repository
You can do all of this in a web browser.
1. Open [TerraFirmaGreg-Modern] repository.
2. Make sure you are signed in, and press **`Fork`**.
3. Configure and press **`Create fork`**
#### Step 4: Cloning the Repository
First, create a new folder to store your development folder, to prevent configs getting messed up.
**Method A: Visual Studio Code**
1. Open [Visual Studio Code] and ensure your are logged into github. (Bottom left user)
2. Press Ctrl + Shift + P to open the Command Palette.
3. Search **`Git: Clone`** and select it.
4. Select **`Clone from Github`**.
5. Search your repository name ("YourNameHere/TerraFirmaGreg-Modern") and select it.
6. If you are prompted to open existing clone, press **`Clone Again`**.
7. Select your development folder to clone into.
**Method B: GitHub Desktop**
1. Open [GitHub Desktop] and log in.
2. Select **File → Clone repository...**
3. On the **URL** tab, enter: **`https://github.com/YourNameHere/TerraFirmaGreg-Modern.git`**
4. In the **Local Path** field, select your development folder.
5. Click **Clone**.
**Method C: Terminal / cmd**
This can also be done inside VSCode, using the terminal at the bottom of your screen.
1. Open **terminal** or **cmd** in the root directory of your development folder.
2. Execute the command:
```bash
git clone https://github.com/YourNameHere/TerraFirmaGreg-Modern.git
```
#### Step 5: Copying and linking development & instance folders
1. Copy all of your files from your development folder into the **`minecraft`** folder.
2. Delete any folders you are going to change. The most likely one is **`kubejs`**.
3. Symbolically link your development **`kubejs`** folder to your prism folder. There are a few ways to do this, the easiest being using `mklink Link Target` in a command prompt.
>[!TIP]
> This is done so you can edit files in your development instance without your game messing up most files.
> If you update your development instance, you should also update your prism instance.
> It is technically possible to develop in your instance folder, but strongly discouraged.
> If you do, use `.git/info/exclude` like a local .gitignore.
#### Step 6: Synchronizing Dependencies via Pakku
1. Open **terminal** or **cmd** in the root directory of your Prism instance folder.
2. Execute the following command:
```bash
pakku fetch
```
> [!TIP]
> This command downloads all necessary project files into the modpack's folder. Note that the command may differ depending on how Pakku was installed.
>[!WARNING]
> This will not update your TerraFirmaGreg-Core-Modern! Keep following.
3. Open [TerraFirmaGreg-Core-Modern] and download latest release.
4. In your mods folder, find the TerraFirmaGreg-Core-Modern jar file, delete it, and replace it with the one you just downloaded.
>[!TIP]
> Even newer releases may be available in Github Actions. Additionally, if you are developing [TerraFirmaGreg-Core-Modern], you can copy your built jars to test them.
#### Step 7: Working with Branches and Creating Pull Request
There are two approaches to creating a Pull Request: via terminal and via Visual Studio Code.
**Branch Designation**
- **`main`:**
- This branch contains the stable, tested, and released version of the project.
- It should only contain changes that have passed the full review cycle.
- Changes can be accepted by members of the **Project-Lead** team; at least one approval is required.
- **`dev`:**
- The main development branch where new features, bug fixes, and experimental changes are integrated.
- After testing, changes from dev may be merged into the main branch for a new version release.
- Changes can be accepted by members of the **Modern-Team** team; at least two approvals are required.
- **`feature/bugfix-branch`:**
- For example, (`feature/add-custom-quest`) or (`bugfix/fix-launch-crash`).
- It is recommended to create separate branches from dev for developing specific features or fixing bugs.
- After completing the work, merge them back into dev.
- Members of the **Modern-Team** team can create branches in the main repository.
>[!TIP]
> Remember, you can make branches in your fork freely! It makes pull requests a lot easier.
**Process of Creating Pull Request**
**Method A: Visual Studio Code**
>[!TIP]
>Most everything in VSCode can also be done through the command palette!
1. **Creating a New Branch:**
- Open [Visual Studio Code] and ensure that you are in your development folder.
- In the sidebar, open the **Source Control** menu.
- Next to changes, click the three dots and click **`Branch > Create Branch`**
- In the appearing window, enter a name for your new branch (e.g., **`feature/add-custom-quest`** or **`bugfix/fix-launch-crash`**).
- Press Enter to confirm. Now you are in a new branch created from the dev branch.
2. **Making and Committing Changes:**
- Make the necessary changes to the project.
- Return to Source Control, where you will see a list of modified files.
- Add a description of your changes, enter a commit message, and click **`Commit`**.
3. **Publishing the Branch:**
- After committing changes, click the new **`Push`** button.
- This will send your new branch to GitHub.
4. **Creating Pull Request:**
- After a successful push, you can open the [Github Pull Requests] menu, if installed, and press **Create Pull Request**.
- Ensure that:
- The base branch for merging is set to **`dev`** of the main repository.
- The title and description of the Pull Request contain detailed descriptions of the changes made, as well as links to related Issues if necessary.
- Click **Create Pull Request** to send a request to merge your changes into the dev branch.
>[!TIP]
> You can also create a pull request using the website, if you prefer.
**Method B: GitHub Desktop**
1. **Creating a New Branch:**
- Open [GitHub Desktop] and ensure that your local repository **`TerraFirmaGreg-Modern`** is selected.
- In the top menu, select **`Branch → New Branch...`**.
- In the appearing window, enter a name for your new branch (e.g., **`feature/add-custom-quest`** or **`bugfix/fix-launch-crash`**).
- Click **`Create Branch`**. Now you are in a new branch created from the dev branch.
2. **Making and Committing Changes:**
- Make the necessary changes to the project using your favorite code editor (e.g., [Visual Studio Code]).
- Return to GitHub Desktop, go to the **`Changes`** tab, where you will see a list of modified files.
- Add a description of your changes, enter a commit message, and click **`Commit to `**.
3. **Publishing the Branch:**
- After committing changes, click the **`Push origin`** button in the top right corner of GitHub Desktop.
- This will send your new branch to GitHub.
4. **Creating Pull Request:**
- After a successful push, [GitHub Desktop] will offer you a **Create Pull Request** button or a link **View on GitHub**. Click it.
- In the opened web interface of GitHub, ensure that:
- The base branch for merging is set to **`dev`** of the main repository.
- The title and description of the Pull Request contain detailed descriptions of the changes made, as well as links to related Issues if necessary.
- Click **Create Pull Request** to send a request to merge your changes into the dev branch.
**Method C: Using terminal / cmd**
1. **Synchronizing with upstream:**
- Ensure that your local repository is up-to-date. If you have already set up remote upstream (the official repository), execute:
```bash
git checkout dev
git pull upstream dev
```
2. **Creating a new branch for changes:**
- From the dev branch, create a new feature or bugfix branch:
```bash
git checkout -b feature/name-of-feature
```
- Name your branch clearly (e.g., feature/add-custom-quest or bugfix/fix-crash-on-launch).
3. **Making changes:**
- Make changes to the code, accompanied by commits with clear messages:
```bash
git add .
git commit -m "Brief description of changes made"
```
4. **Pushing the branch to GitHub:**
- Push your branch to your fork:
```bash
git push origin feature/name-of-feature
```
5. **Creating Pull Request:**
- Go to the page of your fork on GitHub.
- Click the Compare & Pull Request button next to the just pushed branch.
- Ensure that dev of the main repository is selected as the base branch.
- Fill in the title and description of the Pull Request, mention which problems this PR solves, and if possible, provide links to corresponding Issues.
- Send the request by clicking Create Pull Request.
> [!TIP]
> If you have questions about formatting a Pull Request or are unsure with which branch to merge, refer to the project documentation or contact the team via [Discord].
#### Step 8: Processing and Merging Pull Request
1. Reviewing Pull Request:
- After creating a Pull Request, it enters a queue for review by members of the team.
- Members of [Dev-Modern] (for merging into main) or [Contributor-Modern] (for merging into dev) review the changes made, leave comments, and request revisions if necessary.
2. Making Corrections:
- If corrections are required, the PR author makes them in their branch, and the updated commit automatically appears in the open request.
3. Approval:
- After making all necessary corrections and receiving positive feedback from reviewers, the PR is considered approved.
- To merge changes into main, at least one approval from members of the [Dev-Modern] team is required.
- For merging into dev – at least two approvals from members of the [Contributor-Modern] team are required.
4. Merging Pull Request:
- After approval, an authorized member or maintainer performs the merge PR (using Squash and Merge according to project rules).
- After successful merging, it is recommended to delete the branch to maintain repository cleanliness.
5. Post-Merge:
- The merge of PR triggers build and testing processes to ensure the stability of the changes made.
- If issues are discovered after merging, a new Pull Request is created for their resolution.
---
### 3. Additional Recommendations
- #### Semantic Versioning Rules:
- The project follows [Semantic Versioning](https://semver.org/).
- **Patch**: Bug fixes and small changes (`1.0.0` → `1.0.1`)
- **Minor**: New features that don't break compatibility (`1.0.0` → `1.1.0`)
- **Major**: Breaking changes (`1.0.0` → `2.0.0`)
- #### Working with Git:
- Create separate branches for each new functionality or bug fix.
- Regularly synchronize your fork with the original repository to avoid conflicts.
- Use clear commit messages for better understanding of changes.
- #### Debugging and Testing:
- Before making your changes, ensure that the project runs without errors.
- Check PrismLauncher logs to identify potential issues.
- Using Visual Studio Code with the [ProbeJs] extension helps quickly detect and fix errors.
- #### Documentation and Discussion:
- If you have questions or problems, refer to the Issues or Discussions section of the GitHub project, as well as forums on [Discord].
- Collective discussion often leads to finding optimal solutions and improving the project overall.
- #### Collaborative Development:
- Always test the integration of your changes with the main project.
- Before sending a Pull Request, it is important to ensure that your changes do not disrupt the modpack's operation and comply with [internal code of conduct](CODE_OF_CONDUCT.md).
- #### Localization:
- If you're looking for Localizing the modpack to a Language, please feel free to head to the [Crowdin]
- #### Linting & Typescript support
All development tools configuration is located in the `kubejs/` folder.
**Installation:**
```bash
# From the modpack root
npm install --prefix kubejs
# Or from the kubejs folder
npm install
```
**Running the linter:**
```bash
# From the modpack root
npm run lint --prefix kubejs
npm run lint:fix --prefix kubejs
# Or from the kubejs folder
cd kubejs
npm run lint
npm run lint:fix
```
**Code formatting:**
> Note: Do not run prettier or lint over an entire file. Or it will become difficult to review and will likely be rejected. Only run prettier over your own changes by using Format Selection instead of Format Document. Unless approved by a team member.
**TypeScript checking:**
1. Install dependencies (see above)
2. Run ProbeJS to generate types
3. Set `"noCheck": false` in `kubejs/tsconfig.json`
---
## Russian Version
### 1. Необходимое и рекомендуемое ПО
#### Необходимое ПО
- [Git]: Система контроля версий для управления исходным кодом.
- [Pakku]: Инструмент для управления зависимостями и сборкой модпака.
> [!WARNING]
> Убедитесь, что на вашей машине установлена 17 версия Java, необходимая для работы Forge и Pakku.
#### Рекомендуемое ПО
- [PrismLauncher]: Лаунчер, оптимизированный для работы с модификациями Minecraft, облегчающий создание отдельных инстанций.
- [Github Desktop]: Графический клиент для управления Git-репозиториями, разработанный GitHub.
- [Visual Studio Code]: Редактор кода с широкими возможностями для работы с проектами и интеграции различных плагинов.
###### Рекомендуемые плагины:
- [Github Pull Requests]: Имеет многие функции Github Desktop, встроенные в единую среду редактирования.
---
### 2. Подготовка проекта
#### Шаг 1: Создание новой инстанции в PrismLauncher
1. Откройте [PrismLauncher] и нажмите на кнопку **`Add Instance`**.
2. В поле **Name** введите название **`TerraFirmaGreg-Modern`**.
3. Выберите версию Minecraft **`1.20.1`** и версию Forge **`47.4.13`** — эти версии необходимы для корректной работы модпака.
> [!TIP]
> Создание инстанции (Выберите 47.4.13 для forge вместо указанного на изображении)
> 
#### Шаг 2: Поиск папки Prism
1. Найдите папку инстанции в директории PrismLauncher по пути **`TerraFirmaGreg-Modern/minecraft`**.
> [!TIP]
> Для быстрого доступа нажмите правой кнопкой по инстанции и выберите **`Folder`**.
> 
#### Шаг 3: Создание форка репозитория
Вы можете сделать всё это в веб-браузере.
1. Откройте репозиторий [TerraFirmaGreg-Modern].
2. Убедитесь, что вы вошли в систему, и нажмите **`Fork`**.
3. Настройте и нажмите **`Create fork`**.
#### Шаг 4: Клонирование репозитория
Сначала создайте новую папку для хранения вашей папки разработки, чтобы избежать путаницы с конфигами.
**Способ A: Visual Studio Code**
1. Откройте [Visual Studio Code] и убедитесь, что вы вошли в GitHub (пользователь в левом нижнем углу).
2. Нажмите Ctrl + Shift + P, чтобы открыть палитру команд.
3. Найдите **`Git: Clone`** и выберите его.
4. Выберите **`Clone from Github`**.
5. Найдите имя вашего репозитория ("YourNameHere/TerraFirmaGreg-Modern") и выберите его.
6. Если вам предложат открыть существующий клон, нажмите **`Clone Again`**.
7. Выберите вашу папку разработки для клонирования.
**Способ B: GitHub Desktop**
1. Откройте [GitHub Desktop] и войдите в систему.
2. Выберите **File → Clone repository...**
3. На вкладке **URL** введите: **`https://github.com/YourNameHere/TerraFirmaGreg-Modern.git`**
4. В поле **Local Path** выберите вашу папку разработки.
5. Нажмите **Clone**.
**Способ C: Terminal / cmd**
Это также можно сделать внутри VSCode, используя терминал в нижней части экрана.
1. Откройте **terminal** или **cmd** в корневой директории вашей папки разработки.
2. Выполните команду:
```bash
git clone https://github.com/YourNameHere/TerraFirmaGreg-Modern.git
```
#### Шаг 5: Копирование и связывание папок разработки и инстанции
1. Скопируйте все файлы из вашей папки разработки в папку **`minecraft`**.
2. Удалите любые папки, которые вы собираетесь изменять. Наиболее вероятная - **`kubejs`**.
3. Создайте символическую ссылку из вашей папки разработки **`kubejs`** в папку Prism. Есть несколько способов сделать это, самый простой - использовать `mklink Link Target` в командной строке.
>[!TIP]
> Это делается для того, чтобы вы могли редактировать файлы в вашей среде разработки, не нарушая работу большинства файлов в игре.
> Если вы обновляете среду разработки, вам также следует обновить инстанцию Prism.
> Технически возможно разрабатывать прямо в папке инстанции, но это крайне не рекомендуется.
#### Шаг 6: Синхронизация зависимостей через Pakku
1. Откройте **terminal** или **cmd** в корневой директории папки вашей инстанции Prism.
2. Выполните следующую команду:
```bash
pakku fetch
```
> [!TIP]
> Эта команда загружает все необходимые файлы проекта в папку модпака.
> Учтите, что команда может отличаться в зависимости от способа установки Pakku.
>[!WARNING]
> Это не обновит ваш TerraFirmaGreg-Core-Modern! Продолжайте следовать инструкциям.
3. Откройте [TerraFirmaGreg-Core-Modern] и скачайте последний релиз.
4. В папке mods найдите jar-файл TerraFirmaGreg-Core-Modern, удалите его и замените на только что скачанный.
>[!TIP]
> Более новые версии могут быть доступны в Github Actions.
> Кроме того, если вы разрабатываете [TerraFirmaGreg-Core-Modern], вы можете скопировать собранные jar-файлы для их тестирования.
#### Шаг 7: Работа с ветками и создание Pull Request
Есть три подхода для создания Pull Request: через Visual Studio Code, через GitHub Desktop и через терминал.
**Назначение веток**
- **`main`:**:
- Эта ветка содержит стабильную, протестированную и релизную версию проекта.
- В ней должны находиться только изменения, прошедшие полный цикл проверки.
- Принимать изменения могут участники команды **Project-Lead**; требуется одобрение хотя бы одного.
- **`dev`:**:
- Основная ветка для разработки, где интегрируются новые функции, исправления ошибок и экспериментальные изменения.
- После тестирования изменения из dev могут быть перенесены в ветку main для выпуска новой версии.
- Принимать изменения могут участники команды **Modern-Team**; требуется одобрение хотя бы двух.
- **`feature/bugfix-branch`:**:
- Например, (`feature/add-custom-quest`) или (`bugfix/fix-launch-crash`).
- Рекомендуется создавать отдельные ветки от dev для разработки конкретных функций или исправления ошибок.
- После завершения работы их следует слить обратно в dev.
- Участники команды **Modern-Team** могут создавать ветки в основном репозитории.
>[!TIP]
> Помните, что вы можете свободно создавать ветки в своём форке! Это значительно упрощает создание pull request.
**Процесс создания Pull Request**
>[!WARNING]
> Если вы изменили конфигурационный файл, он может не учитываться. Почему? Проверьте .gitignore и удалите его из списка, если **вы** внесли в него изменения.
> Часто игра обновляет эти файлы самостоятельно, что нормально, но если модпак вообще не использует их, не добавляйте новые файлы в коммит.
> Если мод обновил конфиг, проверьте его и убедитесь, что наши настройки не были случайно изменены.
**Способ A: Visual Studio Code**
>[!TIP]
>Большинство действий в VSCode можно выполнить через палитру команд!
1. **Создание новой ветки:**
- Откройте [Visual Studio Code] и убедитесь, что вы находитесь в папке разработки.
- На боковой панели откройте меню **Source Control**.
- Рядом с изменениями нажмите на три точки и выберите **`Branch > Create Branch`**.
- В появившемся окне введите имя для вашей новой ветки (например, **`feature/add-custom-quest`** или **`bugfix/fix-launch-crash`**).
- Нажмите Enter для подтверждения. Теперь вы находитесь в новой ветке, созданной от ветки dev.
2. **Внесение и фиксация изменений:**
- Внесите необходимые изменения в проект.
- Вернитесь в Source Control, где вы увидите список изменённых файлов.
- Добавьте описание ваших изменений, введите сообщение коммита и нажмите **`Commit`**.
3. **Публикация ветки:**
- После фиксации изменений нажмите новую кнопку **`Push`**.
- Это отправит вашу новую ветку на GitHub.
4. **Создание Pull Request:**
- После успешной отправки вы можете открыть меню [Github Pull Requests], если оно установлено, и нажать **Create Pull Request**.
- Убедитесь, что:
- Базовая ветка для слияния установлена как **`dev`** основного репозитория.
- Заголовок и описание Pull Request содержат подробное описание внесённых изменений, а также при необходимости ссылки на связанные Issues.
- Нажмите **Create Pull Request**, чтобы отправить запрос на слияние ваших изменений в ветку dev.
>[!TIP]
> Вы также можете создать pull request через веб-сайт, если предпочитаете.
**Способ B: GitHub Desktop**
1. **Создание новой ветки:**
- Откройте [GitHub Desktop] и убедитесь, что выбран ваш локальный репозиторий **`TerraFirmaGreg-Modern`**.
- В верхнем меню выберите **`Branch → New Branch...`**.
- В появившемся окне введите имя для вашей новой ветки (например, **`feature/add-custom-quest`** или **`bugfix/fix-launch-crash`**).
- Нажмите **`Create Branch`**. Теперь вы находитесь в новой ветке, созданной от ветки dev.
2. **Внесение и фиксация изменений:**
- Внесите необходимые изменения в проект с помощью вашего любимого редактора кода (например, [Visual Studio Code]).
- Вернувшись в GitHub Desktop, перейдите на вкладку **`Changes`**, где вы увидите список изменённых файлов.
- Добавьте описание своих изменений, введите сообщение коммита и нажмите **`Commit to <имя_ветки>`**.
3. **Публикация ветки:**
- После фиксации изменений нажмите кнопку **`Push origin`** в правом верхнем углу GitHub Desktop.
- Это отправит вашу новую ветку на GitHub.
4. **Создание Pull Request:**
- После успешной отправки [GitHub Desktop] предложит вам кнопку **Create Pull Request** или ссылку **View on GitHub**. Нажмите её.
- В открывшемся веб-интерфейсе GitHub убедитесь, что:
- Базовая ветка для слияния установлена как **`dev`** основного репозитория.
- Заголовок и описание Pull Request содержат подробное описание вносимых изменений, а также при необходимости ссылки на связанные Issues.
- Нажмите **Create Pull Request** для отправки запроса на слияние ваших изменений в ветку dev.
**Способ C: Использование terminal / cmd**
1. **Синхронизация с upstream:**
- Убедитесь, что ваш локальный репозиторий актуален. Если вы уже настроили remote upstream (официальный репозиторий), выполните:
```bash
git checkout dev
git pull upstream dev
```
2. **Создание новой ветки для изменений:**
- Из ветки dev создайте новую feature или bugfix ветку:
```bash
git checkout -b feature/имя-фичи
```
- Назовите ветку понятно (например, feature/add-custom-quest или bugfix/fix-crash-on-launch).
3. **Внесение изменений:**
- Делайте изменения в коде, сопровождая их коммитами с понятными сообщениями:
```bash
git add .
git commit -m "Краткое описание внесённых изменений"
```
4. **Отправка ветки на GitHub:**
- Запушьте свою ветку в свой форк:
```bash
git push origin feature/имя-фичи
```
5. **Создание Pull Request:**
- Перейдите на страницу вашего форка на GitHub.
- Нажмите кнопку Compare & Pull Request напротив только что запушенной ветки.
- Убедитесь, что в качестве базовой ветки выбран dev основного репозитория.
- Заполните заголовок и описание Pull Request, упомяните, какие проблемы решает данный PR, и, если возможно, укажите ссылки на соответствующие Issues.
- Отправьте запрос, нажав Create Pull Request.
> [!TIP]
> Если у вас возникнут вопросы по оформлению Pull Request или вы не уверены, с какой веткой проводить слияние, обратитесь к документации проекта или свяжитесь с командой через [Discord].
#### Шаг 8: Обработка и слияние Pull Request
1. Рассмотрение Pull Request:
- После создания Pull Request он попадает в очередь на рассмотрение членами команды.
- Участники [Project-Lead] (для слияния в main) или [Modern-Team] (для слияния в dev) просматривают внесённые изменения, оставляют комментарии и, при необходимости, запрашивают доработки.
2. Внесение корректировок:
- Если требуются изменения, автор PR вносит корректировки в свою ветку, и обновлённый коммит автоматически появляется в открытом запросе.
3. Одобрение:
- После внесения всех необходимых правок и получения положительных отзывов от рецензентов PR считается одобренным.
- Для слияния изменений в main требуется минимум одно одобрение от участников команды [Project-Lead].
- Для слияния в dev – минимум два одобрения от участников команды [Modern-Team].
4. Слияние Pull Request:
- После одобрения уполномоченный участник или мейнтейнер выполняет слияние PR (при помощи Squash and Merge, согласно правилам проекта).
- После успешного слияния рекомендуется удалить ветку, чтобы поддерживать чистоту репозитория.
5. Пост-слияние:
- Слияние PR запускает процессы сборки и тестирования, чтобы убедиться в стабильности внесённых изменений.
- Если после слияния обнаружены проблемы, создаётся новый Pull Request для их исправления.
---
### 3. Дополнительные рекомендации
- #### Правила семантического версионирования:
- Проект следует [Семантическому версионированию](https://semver.org/).
- **Patch**: Исправления ошибок и небольшие изменения (`1.0.0` → `1.0.1`)
- **Minor**: Новые функции, которые не нарушают совместимость (`1.0.0` → `1.1.0`)
- **Major**: Критические изменения (`1.0.0` → `2.0.0`)
- #### Работа с Git:
- Создавайте отдельные ветки для каждой новой функциональности или исправления ошибок.
- Регулярно синхронизируйте свой форк с оригинальным репозиторием, чтобы избежать конфликтов.
- Используйте понятные сообщения коммитов для лучшего понимания изменений.
- #### Отладка и тестирование:
- Перед внесением ваших изменений убедитесь, что проект запускается без ошибок.
- Проверяйте логи PrismLauncher для выявления возможных проблем.
- Использование Visual Studio Code с расширением [ProbeJs] поможет быстрее обнаруживать и устранять ошибки.
- #### Документация и обсуждение:
- Если у вас возникли вопросы или проблемы, обратитесь к разделу Issues или Discussions на GitHub проекта, а также к форумам на [Discord].
- Коллективное обсуждение часто приводит к нахождению оптимальных решений и улучшению проекта в целом.
- #### Совместная разработка:
- Всегда тестируйте интеграцию ваших изменений с основным проектом.
- Перед отправкой Pull Request важно убедиться, что ваши изменения не нарушают работу модпака и соответствуют [внутренним соглашениям по коду](CODE_OF_CONDUCT.md).
- #### Локализация:
- Если вы хотите помочь с локализацией модпака на другой язык, пожалуйста, перейдите на [Crowdin].
- #### Линтинг и поддержка TypeScript:
Вся конфигурация инструментов разработки находится в папке `kubejs/`.
**Установка:**
```bash
# Из корня модпака
npm install --prefix kubejs
# Или из папки kubejs
npm install
```
**Запуск линтера:**
```bash
# Из корня модпака
npm run lint --prefix kubejs
npm run lint:fix --prefix kubejs
# Или из папки kubejs
npm run lint
npm run lint:fix
```
**Форматирование кода:**
> Примечание: не запускайте Prettier или линтер для всего файла целиком. В противном случае такой код будет сложно проверить, и его, скорее всего, отклонят. Применяйте Prettier только к внесенным вами изменениям, используя функцию «Форматировать выделенное» (Format Selection) вместо «Форматировать документ» (Format Document). Если не одобрено членом команды.
**Проверка типов TypeScript:**
1. Установите зависимости (см. выше)
2. Запустите ProbeJS для генерации типов
3. Установите `"noCheck": false` в `kubejs/tsconfig.json`
---
[TerraFirmaGreg-Modern]: https://github.com/TerraFirmaGreg-Team/Modpack-Modern
[Dev-Modern]: https://github.com/orgs/TerraFirmaGreg-Team/teams/dev-modern
[Contributor-Modern]: https://github.com/orgs/TerraFirmaGreg-Team/teams/contributor-modern
[Crowdin]: https://crowdin.com/project/terrafirmagreg-modern
[PrismLauncher]: https://prismlauncher.org
[Visual Studio Code]: https://code.visualstudio.com
[Git]: https://git-scm.com
[GitHub Desktop]: https://desktop.github.com/download
[Pakku]: https://juraj-hrivnak.github.io/Pakku/home.html
[ProbeJs]: https://marketplace.visualstudio.com/items/?itemName=Prunoideae.probejs
[Discord]: https://discord.gg/AEaCzCTUwQ
[GitHub Pull Requests]: https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github
[TerraFirmaGreg-Core-Modern]: https://github.com/TerraFirmaGreg-Team/Core-Modern