mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-12 17:10:43 -05:00
Updates NPM Packages - Node v20.11.1 LTS (!260)
Updates many of the out of date npm packages and brings us up to Node v20 LTS. :D Co-authored-by: chomp <chomp@noreply.dev.sp-tarkov.com> Reviewed-on: SPT-AKI/Server#260 Co-authored-by: Refringe <me@refringe.com> Co-committed-by: Refringe <me@refringe.com>
This commit is contained in:
parent
1dc5db42f3
commit
5edba7dd05
@ -21,7 +21,7 @@ git config --local user.email "USERNAME@SOMETHING.com"
|
|||||||
|
|
||||||
## Observations
|
## Observations
|
||||||
|
|
||||||
- The server was tested to work with **NodeJS 20.10.0**, if you are using a different version and experiencing difficulties change it before looking for support
|
- The server was tested to work with **NodeJS v20.11.1**, if you are using a different version and experiencing difficulties change it before looking for support
|
||||||
- If you are updating a branch you've had for some time, run `npm ci` before running any tasks. This will run the clean and install target from npm.
|
- If you are updating a branch you've had for some time, run `npm ci` before running any tasks. This will run the clean and install target from npm.
|
||||||
- You can debug your mods using the server, just copy your mod files into the `user/mods` folder and put breakpoints on the **JS** files. **DO NOT** contact the dev team for support on this.
|
- You can debug your mods using the server, just copy your mod files into the `user/mods` folder and put breakpoints on the **JS** files. **DO NOT** contact the dev team for support on this.
|
||||||
|
|
||||||
@ -347,6 +347,6 @@ Player profile is stored in SPT folder as a JSON file, allowing for changes to p
|
|||||||
- TypeScript
|
- TypeScript
|
||||||
- Majority of EFT request/response classes passed from client to server have been mapped
|
- Majority of EFT request/response classes passed from client to server have been mapped
|
||||||
- Unit Tests
|
- Unit Tests
|
||||||
- Supports tests via jest
|
- Supports tests via vitest
|
||||||
- Dependency injection
|
- Dependency injection
|
||||||
- Config files accessible from `Aki_Data\Server\configs` / `project\assets\configs`
|
- Config files accessible from `Aki_Data\Server\configs` / `project\assets\configs`
|
||||||
|
@ -1 +1 @@
|
|||||||
v20.10.0
|
v20.11.1
|
||||||
|
4
project/.vscode/launch.json
vendored
4
project/.vscode/launch.json
vendored
@ -4,7 +4,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Debug",
|
"name": "Debug",
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"runtimeVersion": "20.10.0",
|
"runtimeVersion": "20.11.1",
|
||||||
"runtimeExecutable": "npm",
|
"runtimeExecutable": "npm",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
@ -21,7 +21,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Run Vitest Tests",
|
"name": "Run Vitest Tests",
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"runtimeVersion": "20.10.0",
|
"runtimeVersion": "20.11.1",
|
||||||
"runtimeExecutable": "npm",
|
"runtimeExecutable": "npm",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
"runtimeArgs": [
|
"runtimeArgs": [
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true,
|
"recommended": true,
|
||||||
"style": {
|
"style": {
|
||||||
|
"useImportType": "off",
|
||||||
"noImplicitBoolean": "off",
|
"noImplicitBoolean": "off",
|
||||||
"noParameterAssign": "warn",
|
"noParameterAssign": "warn",
|
||||||
"useTemplate": "warn",
|
"useTemplate": "warn",
|
||||||
|
@ -1,35 +1,26 @@
|
|||||||
import crypto from "node:crypto";
|
import crypto from "node:crypto";
|
||||||
import fs from "node:fs/promises";
|
|
||||||
import os from "node:os";
|
|
||||||
import path from "node:path";
|
import path from "node:path";
|
||||||
import pkg from "@yao-pkg/pkg";
|
import pkg from "@yao-pkg/pkg";
|
||||||
import pkgfetch from "@yao-pkg/pkg-fetch";
|
import pkgfetch from "@yao-pkg/pkg-fetch";
|
||||||
|
import fs from "fs-extra";
|
||||||
import gulp from "gulp";
|
import gulp from "gulp";
|
||||||
|
import decompress from "gulp-decompress";
|
||||||
|
import download from "gulp-download";
|
||||||
import { exec } from "gulp-execa";
|
import { exec } from "gulp-execa";
|
||||||
import rename from "gulp-rename";
|
import rename from "gulp-rename";
|
||||||
import download from "gulp-download";
|
|
||||||
import decompress from "gulp-decompress";
|
|
||||||
import minimist from "minimist";
|
import minimist from "minimist";
|
||||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
import * as ResEdit from "resedit";
|
import * as ResEdit from "resedit";
|
||||||
import manifest from "./package.json" assert { type: "json" };
|
import manifest from "./package.json" assert { type: "json" };
|
||||||
|
|
||||||
const knownOptions = {
|
// Accept command line arguments for arch and platform
|
||||||
string: ["arch", "platform"],
|
const knownOptions = { string: ["arch", "platform"], default: { arch: process.arch, platform: process.platform } };
|
||||||
default: {
|
const options = minimist(process.argv.slice(2), knownOptions);
|
||||||
arch: process.arch,
|
|
||||||
platform: process.platform
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const options = minimist(process.argv.slice(2), knownOptions)
|
|
||||||
|
|
||||||
const targetArch = options.arch;
|
const targetArch = options.arch;
|
||||||
const targetPlatform = options.platform;
|
const targetPlatform = options.platform;
|
||||||
|
console.log(`target arch: ${targetArch}, target platform: ${targetPlatform}`);
|
||||||
|
|
||||||
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 = "node20"; // As of @yao-pkg/pkg-fetch v3.5.7, it's v20.10.0
|
|
||||||
const stdio = "inherit";
|
const stdio = "inherit";
|
||||||
const buildDir = "build/";
|
const buildDir = "build/";
|
||||||
const dataDir = path.join(buildDir, "Aki_Data", "Server");
|
const dataDir = path.join(buildDir, "Aki_Data", "Server");
|
||||||
@ -46,7 +37,32 @@ const licenseFile = "../LICENSE.md";
|
|||||||
/**
|
/**
|
||||||
* Transpile src files into Javascript with SWC
|
* Transpile src files into Javascript with SWC
|
||||||
*/
|
*/
|
||||||
const compile = async () => await exec("swc src -d obj", { stdio });
|
const compile = async () =>
|
||||||
|
{
|
||||||
|
// Compile TypeScript files using SWC
|
||||||
|
await exec("npx swc src -d obj", { stdio: "inherit" });
|
||||||
|
|
||||||
|
// Merge the contents from the /obj/src directory into /obj
|
||||||
|
const srcDir = path.join("obj", "src");
|
||||||
|
const destDir = path.join("obj");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
const entities = await fs.readdir(srcDir);
|
||||||
|
for (const entity of entities)
|
||||||
|
{
|
||||||
|
const srcPath = path.join(srcDir, entity);
|
||||||
|
const destPath = path.join(destDir, entity);
|
||||||
|
await fs.move(srcPath, destPath, { overwrite: true });
|
||||||
|
}
|
||||||
|
// After moving all contents, remove the now-empty /obj/src directory
|
||||||
|
await fs.remove(srcDir);
|
||||||
|
}
|
||||||
|
catch (error)
|
||||||
|
{
|
||||||
|
console.error("An error occurred during the merge operation:", error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// Packaging
|
// Packaging
|
||||||
const fetchPackageImage = async () =>
|
const fetchPackageImage = async () =>
|
||||||
@ -76,7 +92,7 @@ const updateBuildProperties = async () =>
|
|||||||
if (targetPlatform !== "win32")
|
if (targetPlatform !== "win32")
|
||||||
{
|
{
|
||||||
// can't modify executable's resource on non-windows build
|
// can't modify executable's resource on non-windows build
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const exe = ResEdit.NtExecutable.from(await fs.readFile(serverExe));
|
const exe = ResEdit.NtExecutable.from(await fs.readFile(serverExe));
|
||||||
@ -120,14 +136,17 @@ const copyAssets = () =>
|
|||||||
/**
|
/**
|
||||||
* Download pnpm executable
|
* Download pnpm executable
|
||||||
*/
|
*/
|
||||||
const downloadPnpm = async () => {
|
const downloadPnpm = async () =>
|
||||||
|
{
|
||||||
|
// Please ensure that the @pnpm/exe version in devDependencies is pinned to a specific version. If it's not, the
|
||||||
|
// following task will download *all* versions that are compatible with the semver range specified.
|
||||||
const pnpmVersion = manifest.devDependencies["@pnpm/exe"];
|
const pnpmVersion = manifest.devDependencies["@pnpm/exe"];
|
||||||
const pnpmPackageName = `@pnpm/${targetPlatform === "win32" ? "win" : targetPlatform}-${targetArch}`;
|
const pnpmPackageName = `@pnpm/${targetPlatform === "win32" ? "win" : targetPlatform}-${targetArch}`;
|
||||||
const npmResult = await exec(`npm view ${pnpmPackageName}@${pnpmVersion} dist.tarball`, {stdout: "pipe"});
|
const npmResult = await exec(`npm view ${pnpmPackageName}@${pnpmVersion} dist.tarball`, { stdout: "pipe" });
|
||||||
const pnpmLink = npmResult.stdout.trim()
|
const pnpmLink = npmResult.stdout.trim();
|
||||||
console.log(`Downloading pnpm binary from ${pnpmLink}`)
|
console.log(`Downloading pnpm binary from ${pnpmLink}`);
|
||||||
download(pnpmLink).pipe(decompress({strip: 1})).pipe(gulp.dest(path.join(dataDir, "@pnpm", "exe")));
|
download(pnpmLink).pipe(decompress({ strip: 1 })).pipe(gulp.dest(path.join(dataDir, "@pnpm", "exe")));
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rename and copy the license file
|
* Rename and copy the license file
|
||||||
|
4336
project/package-lock.json
generated
4336
project/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@
|
|||||||
"description": "The single-player modding framework for Escape From Tarkov.",
|
"description": "The single-player modding framework for Escape From Tarkov.",
|
||||||
"icon": "assets/images/icon.ico",
|
"icon": "assets/images/icon.ico",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "20.10.0"
|
"node": "20.11.1"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"check:circular": "madge --circular --ts-config tsconfig.json --extensions ts ./src/",
|
"check:circular": "madge --circular --ts-config tsconfig.json --extensions ts ./src/",
|
||||||
@ -30,55 +30,56 @@
|
|||||||
"gen:docs": "typedoc --options ./typedoc.json --entryPointStrategy expand ./src"
|
"gen:docs": "typedoc --options ./typedoc.json --entryPointStrategy expand ./src"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"atomically": "1.7.0",
|
"atomically": "~1.7",
|
||||||
"date-fns": "2.30.0",
|
"date-fns": "~2.30",
|
||||||
"date-fns-tz": "2.0.0",
|
"date-fns-tz": "~2.0",
|
||||||
"i18n": "0.15.1",
|
"i18n": "~0.15",
|
||||||
"json-fixer": "1.6.15",
|
"json-fixer": "~1.6",
|
||||||
"json5": "2.2.3",
|
"json5": "~2.2",
|
||||||
"jsonc": "2.0.0",
|
"jsonc": "~2.0",
|
||||||
"proper-lockfile": "4.1.2",
|
"proper-lockfile": "~4.1",
|
||||||
"reflect-metadata": "0.2.1",
|
"reflect-metadata": "~0.2",
|
||||||
"semver": "7.5.4",
|
"semver": "~7.6",
|
||||||
"source-map-support": "0.5.21",
|
"source-map-support": "~0.5",
|
||||||
"tsyringe": "4.8.0",
|
"tsyringe": "~4.8",
|
||||||
"typescript": "5.3.3",
|
"typescript": "~5.4",
|
||||||
"winston": "3.11.0",
|
"winston": "~3.12",
|
||||||
"winston-daily-rotate-file": "4.7.1",
|
"winston-daily-rotate-file": "~5.0",
|
||||||
"ws": "8.15.1"
|
"ws": "~8.16"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "1.4.1",
|
"@biomejs/biome": "~1.6",
|
||||||
"@pnpm/exe": "8.12.1",
|
"@pnpm/exe": "8.15.4",
|
||||||
"@swc/cli": "0.1.63",
|
"@swc/cli": "~0.3",
|
||||||
"@swc/core": "1.3.101",
|
"@swc/core": "~1.4",
|
||||||
"@types/i18n": "0.13.10",
|
"@types/i18n": "~0.13",
|
||||||
"@types/node": "20.10.5",
|
"@types/node": "~20.11",
|
||||||
"@types/proper-lockfile": "4.1.4",
|
"@types/proper-lockfile": "~4.1",
|
||||||
"@types/semver": "7.5.6",
|
"@types/semver": "~7.5",
|
||||||
"@types/ws": "8.5.10",
|
"@types/ws": "~8.5",
|
||||||
"@typescript-eslint/eslint-plugin": "6.15.0",
|
"@typescript-eslint/eslint-plugin": "~7.2",
|
||||||
"@typescript-eslint/parser": "6.15.0",
|
"@typescript-eslint/parser": "~7.2",
|
||||||
"@vitest/coverage-istanbul": "1.1.0",
|
"@vitest/coverage-istanbul": "~1.3",
|
||||||
"@vitest/ui": "1.1.0",
|
"@vitest/ui": "~1.3",
|
||||||
"@yao-pkg/pkg": "5.11.0",
|
"@yao-pkg/pkg": "5.11.5",
|
||||||
"@yao-pkg/pkg-fetch": "3.5.7",
|
"@yao-pkg/pkg-fetch": "3.5.9",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "~7.0",
|
||||||
"dprint": "0.44.0",
|
"dprint": "~0.45",
|
||||||
"eslint": "8.56.0",
|
"eslint": "~8.57",
|
||||||
"gulp": "4.0.2",
|
"fs-extra": "~11.2",
|
||||||
"gulp-decompress": "3.0.0",
|
"gulp": "~4.0",
|
||||||
"gulp-download": "0.0.1",
|
"gulp-decompress": "~3.0",
|
||||||
"gulp-execa": "6.0.0",
|
"gulp-download": "~0.0.1",
|
||||||
"gulp-rename": "2.0.0",
|
"gulp-execa": "~6.0",
|
||||||
"madge": "6.1.0",
|
"gulp-rename": "~2.0",
|
||||||
"minimist": "1.2.8",
|
"madge": "~6.1",
|
||||||
"resedit": "2.0.0",
|
"minimist": "~1.2",
|
||||||
"ts-node-dev": "2.0.0",
|
"resedit": "~2.0",
|
||||||
"tsconfig-paths": "4.2.0",
|
"ts-node-dev": "~2.0",
|
||||||
"typedoc": "0.25.4",
|
"tsconfig-paths": "~4.2",
|
||||||
"typemoq": "2.1.0",
|
"typedoc": "~0.25",
|
||||||
"vitest": "1.1.0"
|
"typemoq": "~2.1",
|
||||||
|
"vitest": "~1.3"
|
||||||
},
|
},
|
||||||
"targets": {
|
"targets": {
|
||||||
"default": {
|
"default": {
|
||||||
|
@ -2,6 +2,7 @@ import crypto from "node:crypto";
|
|||||||
import fs from "node:fs";
|
import fs from "node:fs";
|
||||||
import { promisify } from "node:util";
|
import { promisify } from "node:util";
|
||||||
import winston, { createLogger, format, transports } from "winston";
|
import winston, { createLogger, format, transports } from "winston";
|
||||||
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||||
import DailyRotateFile from "winston-daily-rotate-file";
|
import DailyRotateFile from "winston-daily-rotate-file";
|
||||||
|
|
||||||
import { Daum } from "@spt-aki/models/eft/itemEvent/IItemEventRouterRequest";
|
import { Daum } from "@spt-aki/models/eft/itemEvent/IItemEventRouterRequest";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user