The starter code and build system for SVR.JS mods
Find a file Use this template
2024-08-30 22:50:40 +02:00
.github/workflows Create main.yml 2024-08-27 07:22:03 +02:00
src Update cluster shim for Bun (yet again) 2024-08-29 19:28:07 +02:00
tests/utils Initial commit 2024-08-27 07:15:53 +02:00
.gitignore Initial commit 2024-08-27 07:15:53 +02:00
esbuild.config.js Initial commit 2024-08-27 07:15:53 +02:00
eslint.config.js Initial commit 2024-08-27 07:15:53 +02:00
jest.config.js Initial commit 2024-08-27 07:15:53 +02:00
LICENSE Initial commit 2024-08-27 07:15:53 +02:00
modInfo.json Initial commit 2024-08-27 07:15:53 +02:00
package-lock.json Update dependencies 2024-08-30 22:50:40 +02:00
package.json Initial commit 2024-08-27 07:15:53 +02:00
README Initial commit 2024-08-27 07:15:53 +02:00

This repository contains SVR.JS mod starter code and its build system
The mod will work for SVR.JS Nightly-GitNext.

Before doing anything, run "npm install".
To build SVR.JS mod, run "npm run build".
To check SVR.JS mod code for errors with ESLint, run "npm run lint".
To fix and beautify SVR.JS mod code with ESLint and Prettier, run "npm run lint:fix".
To perform unit tests with Jest, run "npm test".

To test the mod:
1. Clone the SVR.JS repository with "git clone https://git.svrjs.org/svrjs/svrjs.git -b next" command.
2. Change the working directory to "svrjs" using "cd svr.js".
3. Build SVR.JS by first running "npm install" and then running "npm run build".
4. Copy the mod into mods directory in the dist directory using "cp ../dist/mod.js dist/mods" (GNU/Linux, Unix, BSD) or "copy ..\dist\mod.js dist\mods" (Windows).
5. Do the necessary mod configuration if the mod requires it.
6. Run SVR.JS by running "npm start".
7. Do some requests to the endpoints covered by the mod.

Structure:
 - dist - contains the built SVR.JS mod
 - src - contains SVR.JS mod source code
   - index.js - entry point
   - utils - utility functions
 - tests - Jest unit tests
   - utils - unit tests for utility functions
 - esbuild.config.js - the build script
 - eslint.config.js - ESLint configuration
 - jest.config.js - Jest configuration
 - modInfo.json - SVR.JS mod name and version