From 995a3d0c5ad96114f2ee00f58dfc4309a05504ac Mon Sep 17 00:00:00 2001 From: Refringe Date: Mon, 30 Dec 2024 04:01:11 -0500 Subject: [PATCH] Updates to Node v22.12.0 LTS (#1005) - Updates version numbers in `.nvmrc`, `package.json`, and `Server.code-workspace` - Updates `@yao-pkg/pkg`, `@yao-pkg/pkg-fetch`, and `@types/node` to latest - Updates JSON import to FS read operation in `gulpfile.mjs` - Updates node build target in `gulpfile.mjs` Tested with local runs, Windows builds, and Linux builds. Have not tested a Windows build on Linux, but see no reason it wouldn't work. *[knocks on wood]* I feel this is safe to merge. --- README.md | 4 ++-- project/.nvmrc | 2 +- project/Server.code-workspace | 4 ++-- project/gulpfile.mjs | 8 +++++--- project/package.json | 10 +++++----- project/tsconfig.types.json | 1 + 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d9da0cc3..6a71cf06 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ To prepare the project for development you will need to: 1. Run `git clone https://github.com/sp-tarkov/server.git server` to clone the repository. 2. Run `git lfs pull` to download LFS files locally. 3. Open the `project/mod.code-workspace` file in Visual Studio Code (VSC). -4. Run `nvm use 20.11.1` in the VSC terminal. +4. Run `nvm use 22.12.0` in the VSC terminal. 5. Run `npm install` in the VSC terminal. ## Development @@ -91,7 +91,7 @@ We're really excited that you're interested in contributing! Before submitting y The default branch used for the latest stable release. This branch is protected and typically is only merged with release branches. - **3.10.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. -- **3.11.0-DEV** +- **4.0.0-DEV** 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. ### Pull Request Guidelines diff --git a/project/.nvmrc b/project/.nvmrc index ee09fac7..dc0bb0f4 100644 --- a/project/.nvmrc +++ b/project/.nvmrc @@ -1 +1 @@ -v20.11.1 +v22.12.0 diff --git a/project/Server.code-workspace b/project/Server.code-workspace index 50c09999..42b4964d 100644 --- a/project/Server.code-workspace +++ b/project/Server.code-workspace @@ -28,7 +28,7 @@ "name": "Debug", "type": "node", "program": "${workspaceFolder}/src/ide/TestEntry.ts", - "runtimeVersion": "20.11.1", + "runtimeVersion": "22.12.0", "runtimeExecutable": "tsx", "request": "launch", "runtimeArgs": [ @@ -45,7 +45,7 @@ { "name": "Run Vitest Tests", "type": "node", - "runtimeVersion": "20.11.1", + "runtimeVersion": "22.12.0", "runtimeExecutable": "npm", "request": "launch", "runtimeArgs": [ diff --git a/project/gulpfile.mjs b/project/gulpfile.mjs index f154660e..8893e7ff 100644 --- a/project/gulpfile.mjs +++ b/project/gulpfile.mjs @@ -10,7 +10,9 @@ import { exec } from "gulp-execa"; import rename from "gulp-rename"; import minimist from "minimist"; import * as ResEdit from "resedit"; -import manifest from "./package.json" assert { type: "json" }; + +// Load the package.json file +const manifest = JSON.parse(fs.readFileSync("./package.json", "utf8")); // Accept command line arguments for arch and platform const knownOptions = { string: ["arch", "platform"], default: { arch: process.arch, platform: process.platform } }; @@ -19,7 +21,7 @@ const targetArch = options.arch; const targetPlatform = options.platform; console.log(`target arch: ${targetArch}, target platform: ${targetPlatform}`); -const nodeVersion = "node20"; // As of @yao-pkg/pkg-fetch v3.5.9, it's v20.11.1 +const nodeVersion = "node22"; // As of @yao-pkg/pkg-fetch@3.5.18, it's Node 22.12.0 const stdio = "inherit"; const buildDir = "build/"; const dataDir = path.join(buildDir, "SPT_Data", "Server"); @@ -62,7 +64,7 @@ const compile = async () => { // Packaging const fetchPackageImage = async () => { try { - const output = "./.pkg-cache/v3.5"; + const output = "./.pkg-cache/v6.2"; const fetchedPkg = await pkgfetch.need({ arch: targetArch, nodeRange: nodeVersion, diff --git a/project/package.json b/project/package.json index e1478cbc..91d7e855 100644 --- a/project/package.json +++ b/project/package.json @@ -1,6 +1,6 @@ { "name": "spt-server", - "version": "3.10.4", + "version": "4.0.0", "author": "SPT Server", "license": "NCSA", "main": "obj/bundle.js", @@ -8,7 +8,7 @@ "description": "The single-player modding framework for Escape From Tarkov.", "icon": "assets/images/icon.ico", "engines": { - "node": "20.11.1" + "node": "22.12.0" }, "scripts": { "check:circular": "madge --circular --ts-config tsconfig.json --extensions ts ./src/", @@ -61,14 +61,14 @@ "@swc/cli": "~0.4", "@swc/core": "~1.7", "@types/i18n": "~0.13", - "@types/node": "~22.0", + "@types/node": "22.10.2", "@types/proper-lockfile": "~4.1", "@types/semver": "~7.5", "@types/ws": "~8.5", "@vitest/coverage-istanbul": "^2.1.8", "@vitest/ui": "^2.1.8", - "@yao-pkg/pkg": "5.12", - "@yao-pkg/pkg-fetch": "3.5.9", + "@yao-pkg/pkg": "6.2.0", + "@yao-pkg/pkg-fetch": "3.5.18", "cross-env": "~7.0", "gulp": "~5.0", "gulp-decompress": "~3.0", diff --git a/project/tsconfig.types.json b/project/tsconfig.types.json index a6a7d84e..4f2cb246 100644 --- a/project/tsconfig.types.json +++ b/project/tsconfig.types.json @@ -1,6 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { + "noEmit": false, "emitDeclarationOnly": true, "declaration": true, "declarationDir": "./types"