Total rewrite of the build script. There were some issues with the original I built, so I spent some time rewriting it into this. I've been testing it with my mods for a while now, and I believe I've ironed out all of the issues. I wanted to replace the old script before 3.7 dropped. Notable Changes: - Dropped the inline ignore array for a `.buildignore` file. The syntax of this file now exactly matches that of a `.gitignore` file. - Dropped the `bestzip` package for `archiver`. - Dropped all custom functions that handled file and directory ignoring for the `Ignore` package. - Includes the `Winston` package for sexy logging. - Changed any function that touches a file to run asynchronously. - Changed the build process to use an OS temporary directory instead of creating one in the project directory. - Added a verbose option to display which files ended up being copied and which were ignored for testing the `.buildignore` file. - Changed the packaged mod to include the folder structure in which it must be installed: `/user/mods/mod-name-here`. - Updated some README files to add some more information. Closes issue #13 Co-authored-by: Refringe <brownelltyler@gmail.com> Reviewed-on: #14 Co-authored-by: Refringe <refringe@noreply.dev.sp-tarkov.com> Co-committed-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
Welcome to the SPT-AKI Modding Project
This project is designed to streamline the initial setup process for building and creating mods in the SPT-AKI environment. Follow this guide to set up your environment efficiently.
Table of Contents
- NodeJS Setup
- IDE Setup
- Workspace Configuration
- Environment Setup
- Essential Concepts
- Coding Guidelines
- Distribution Guidelines
NodeJS Setup
Before you begin, ensure to install NodeJS version v16.17.1
, which has been tested thoroughly with our mod templates and build scripts. Download it from the official NodeJS website.
After installation, it's advised to reboot your system.
IDE Setup
For this project, you can work with either VSCodium or VSCode. However, we strongly recommend using VSCode, as all development and testing have been carried out using this IDE, ensuring a smoother experience and compatibility with the project setups. Either way, we have a prepared a workspace file to assist you in setting up your environment.
Workspace Configuration
With NodeJS and your chosen IDE ready, initiate the mod.code-workspace
file using your IDE:
File -> Open Workspace from File...
Upon project loading, consider installing recommended plugins like the ESLint plugin.
Environment Setup
An automated task is available to configure your environment for Typescript utilization:
Terminal -> Run Task... -> Show All Tasks... -> npm: install
Note: Preserve the node_modules
folder as it contains necessary dependencies for Typescript and other functionalities.
Essential Concepts
Prioritize understanding Dependency Injection and Inversion of Control, the architectural principles SPT-AKI adopts. Comprehensive guidelines will be available on the hub upon release.
Some resources to get you started:
Coding Guidelines
Focus your mod development around the mod.ts
file. In the package.json
file, only alter these properties: "name"
, "version"
, "license"
, "author"
, and "akiVersion"
.
New to Typescript? Find comprehensive documentation on the official website.
Distribution Guidelines
Automated tasks are set up to bundle all necessary files for your mod to function in SPT-AKI:
Terminal -> Run Task... -> Show All Tasks... -> npm: build
The ZIP output, located in the dist
directory, contains all required files. Ensure all files are included and modify the .buildignore
file as needed. This ZIP file is your uploadable asset for the hub.
Conclusion
With this setup, you're ready to begin modding with SPT-AKI. If you run into any trouble be sure to check out the modding documentation on the hub. If you really get stuck feel free to join us in the #mods-development official Discord channel.
Build something awesome!