0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Biome Configuration Updates (#1042)

See 0d1e1ba3591458bb195812232d3b8c3345abbeaa for actual changes. The
rest is from running the `style:fix` script.

- Consolidated ignores
- Enabled for `ModCompilerService.ts`
- Added a format ignore line to `ModCompilerService.ts` to prevent
mappings from being affected
- Enabled for `jsonc` file types

---------

Co-authored-by: Chomp <27521899+chompDev@users.noreply.github.com>
This commit is contained in:
Refringe 2025-01-07 10:36:08 -05:00 committed by GitHub
parent f1b1dd46eb
commit 7190557805
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 596 additions and 602 deletions

View File

@ -11,6 +11,9 @@
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit", "source.organizeImports.biome": "explicit",
"quickfix.biome": "explicit" "quickfix.biome": "explicit"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome"
} }
}, },
"extensions": { "extensions": {
@ -31,16 +34,10 @@
"runtimeVersion": "22.12.0", "runtimeVersion": "22.12.0",
"runtimeExecutable": "tsx", "runtimeExecutable": "tsx",
"request": "launch", "request": "launch",
"runtimeArgs": [ "runtimeArgs": ["watch", "--clear-screen=false"],
"watch",
"--clear-screen=false"
],
"console": "integratedTerminal", "console": "integratedTerminal",
"internalConsoleOptions": "neverOpen", "internalConsoleOptions": "neverOpen",
"skipFiles": [ "skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"]
"<node_internals>/**",
"${workspaceFolder}/node_modules/**",
],
}, },
{ {
"name": "Run Vitest Tests", "name": "Run Vitest Tests",
@ -48,16 +45,10 @@
"runtimeVersion": "22.12.0", "runtimeVersion": "22.12.0",
"runtimeExecutable": "npm", "runtimeExecutable": "npm",
"request": "launch", "request": "launch",
"runtimeArgs": [ "runtimeArgs": ["run", "test"],
"run",
"test"
],
"console": "integratedTerminal", "console": "integratedTerminal",
"internalConsoleOptions": "neverOpen", "internalConsoleOptions": "neverOpen",
"skipFiles": [ "skipFiles": ["<node_internals>/**", "${workspaceFolder}/node_modules/**"]
"<node_internals>/**",
"${workspaceFolder}/node_modules/**",
],
} }
] ]
} }

View File

@ -8523,7 +8523,8 @@
"maxToSendPlayer": 5 "maxToSendPlayer": 5
}, },
"NewYear2024": { "NewYear2024": {
"items": [{ "items": [
{
"_id": "6773b39ccf4c2fe4e50a7ec3", "_id": "6773b39ccf4c2fe4e50a7ec3",
"_tpl": "67124dcfa3541f2a1f0e788b", "_tpl": "67124dcfa3541f2a1f0e788b",
"upd": { "upd": {
@ -8537,37 +8538,44 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ec4", "_id": "6773b39ccf4c2fe4e50a7ec4",
"_tpl": "6719023b612cc94b9008e78c", "_tpl": "6719023b612cc94b9008e78c",
"parentId": "6773b39ccf4c2fe4e50a7ec3", "parentId": "6773b39ccf4c2fe4e50a7ec3",
"slotId": "mod_stock" "slotId": "mod_stock"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ec5", "_id": "6773b39ccf4c2fe4e50a7ec5",
"_tpl": "6709133fa532466d5403fb7c", "_tpl": "6709133fa532466d5403fb7c",
"parentId": "6773b39ccf4c2fe4e50a7ec3", "parentId": "6773b39ccf4c2fe4e50a7ec3",
"slotId": "mod_magazine" "slotId": "mod_magazine"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ec6", "_id": "6773b39ccf4c2fe4e50a7ec6",
"_tpl": "670fd0a8d8d4eae4790c8187", "_tpl": "670fd0a8d8d4eae4790c8187",
"parentId": "6773b39ccf4c2fe4e50a7ec3", "parentId": "6773b39ccf4c2fe4e50a7ec3",
"slotId": "mod_barrel" "slotId": "mod_barrel"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ec7", "_id": "6773b39ccf4c2fe4e50a7ec7",
"_tpl": "6710cea62bb09af72f0e6bf8", "_tpl": "6710cea62bb09af72f0e6bf8",
"parentId": "6773b39ccf4c2fe4e50a7ec6", "parentId": "6773b39ccf4c2fe4e50a7ec6",
"slotId": "mod_mount" "slotId": "mod_mount"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ec8", "_id": "6773b39ccf4c2fe4e50a7ec8",
"_tpl": "57d17c5e2459775a5c57d17d", "_tpl": "57d17c5e2459775a5c57d17d",
"parentId": "6773b39ccf4c2fe4e50a7ec7", "parentId": "6773b39ccf4c2fe4e50a7ec7",
"slotId": "mod_tactical_003" "slotId": "mod_tactical_003"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ec9", "_id": "6773b39ccf4c2fe4e50a7ec9",
"_tpl": "6165ac8c290d254f5e6b2f6c", "_tpl": "6165ac8c290d254f5e6b2f6c",
"parentId": "6773b39ccf4c2fe4e50a7ec3", "parentId": "6773b39ccf4c2fe4e50a7ec3",
"slotId": "mod_scope" "slotId": "mod_scope"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ecb", "_id": "6773b39ccf4c2fe4e50a7ecb",
"_tpl": "6709133fa532466d5403fb7c", "_tpl": "6709133fa532466d5403fb7c",
"upd": { "upd": {
@ -8575,7 +8583,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ecd", "_id": "6773b39ccf4c2fe4e50a7ecd",
"_tpl": "6709133fa532466d5403fb7c", "_tpl": "6709133fa532466d5403fb7c",
"upd": { "upd": {
@ -8583,7 +8592,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ecf", "_id": "6773b39ccf4c2fe4e50a7ecf",
"_tpl": "6709133fa532466d5403fb7c", "_tpl": "6709133fa532466d5403fb7c",
"upd": { "upd": {
@ -8591,7 +8601,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ed1", "_id": "6773b39ccf4c2fe4e50a7ed1",
"_tpl": "5c0d591486f7744c505b416f", "_tpl": "5c0d591486f7744c505b416f",
"upd": { "upd": {
@ -8599,7 +8610,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ed3", "_id": "6773b39ccf4c2fe4e50a7ed3",
"_tpl": "5c0d591486f7744c505b416f", "_tpl": "5c0d591486f7744c505b416f",
"upd": { "upd": {
@ -8607,7 +8619,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ed5", "_id": "6773b39ccf4c2fe4e50a7ed5",
"_tpl": "5c0d591486f7744c505b416f", "_tpl": "5c0d591486f7744c505b416f",
"upd": { "upd": {
@ -8615,62 +8628,74 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ed6", "_id": "6773b39ccf4c2fe4e50a7ed6",
"_tpl": "5ab8e79e86f7742d8b372e78", "_tpl": "5ab8e79e86f7742d8b372e78",
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ed7", "_id": "6773b39ccf4c2fe4e50a7ed7",
"_tpl": "65732688d9d89ff7ac0d9c4c", "_tpl": "65732688d9d89ff7ac0d9c4c",
"parentId": "6773b39ccf4c2fe4e50a7ed6", "parentId": "6773b39ccf4c2fe4e50a7ed6",
"slotId": "Soft_armor_front" "slotId": "Soft_armor_front"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ed8", "_id": "6773b39ccf4c2fe4e50a7ed8",
"_tpl": "657326978c1cc6dcd9098b56", "_tpl": "657326978c1cc6dcd9098b56",
"parentId": "6773b39ccf4c2fe4e50a7ed6", "parentId": "6773b39ccf4c2fe4e50a7ed6",
"slotId": "Soft_armor_back" "slotId": "Soft_armor_back"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ed9", "_id": "6773b39ccf4c2fe4e50a7ed9",
"_tpl": "657326a28c1cc6dcd9098b5a", "_tpl": "657326a28c1cc6dcd9098b5a",
"parentId": "6773b39ccf4c2fe4e50a7ed6", "parentId": "6773b39ccf4c2fe4e50a7ed6",
"slotId": "Soft_armor_left" "slotId": "Soft_armor_left"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7eda", "_id": "6773b39ccf4c2fe4e50a7eda",
"_tpl": "657326b08c1cc6dcd9098b5e", "_tpl": "657326b08c1cc6dcd9098b5e",
"parentId": "6773b39ccf4c2fe4e50a7ed6", "parentId": "6773b39ccf4c2fe4e50a7ed6",
"slotId": "soft_armor_right" "slotId": "soft_armor_right"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7edb", "_id": "6773b39ccf4c2fe4e50a7edb",
"_tpl": "657326bc5d3a3129fb05f36b", "_tpl": "657326bc5d3a3129fb05f36b",
"parentId": "6773b39ccf4c2fe4e50a7ed6", "parentId": "6773b39ccf4c2fe4e50a7ed6",
"slotId": "Collar" "slotId": "Collar"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7edc", "_id": "6773b39ccf4c2fe4e50a7edc",
"_tpl": "656f611f94b480b8a500c0db", "_tpl": "656f611f94b480b8a500c0db",
"parentId": "6773b39ccf4c2fe4e50a7ed6", "parentId": "6773b39ccf4c2fe4e50a7ed6",
"slotId": "Front_plate" "slotId": "Front_plate"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7edd", "_id": "6773b39ccf4c2fe4e50a7edd",
"_tpl": "65573fa5655447403702a816", "_tpl": "65573fa5655447403702a816",
"parentId": "6773b39ccf4c2fe4e50a7ed6", "parentId": "6773b39ccf4c2fe4e50a7ed6",
"slotId": "Back_plate" "slotId": "Back_plate"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ede", "_id": "6773b39ccf4c2fe4e50a7ede",
"_tpl": "675956062f6ddfe8ff0e2806", "_tpl": "675956062f6ddfe8ff0e2806",
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7edf", "_id": "6773b39ccf4c2fe4e50a7edf",
"_tpl": "676307c004856a0b3c0dfffd", "_tpl": "676307c004856a0b3c0dfffd",
"parentId": "6773b39ccf4c2fe4e50a7ede", "parentId": "6773b39ccf4c2fe4e50a7ede",
"slotId": "Helmet_top" "slotId": "Helmet_top"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ee0", "_id": "6773b39ccf4c2fe4e50a7ee0",
"_tpl": "676307b4d9ec0af3d9001fa8", "_tpl": "676307b4d9ec0af3d9001fa8",
"parentId": "6773b39ccf4c2fe4e50a7ede", "parentId": "6773b39ccf4c2fe4e50a7ede",
"slotId": "Helmet_back" "slotId": "Helmet_back"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ee2", "_id": "6773b39ccf4c2fe4e50a7ee2",
"_tpl": "674589d98dd67746010329e6", "_tpl": "674589d98dd67746010329e6",
"upd": { "upd": {
@ -8678,7 +8703,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ee4", "_id": "6773b39ccf4c2fe4e50a7ee4",
"_tpl": "67458794e21e5d724e066976", "_tpl": "67458794e21e5d724e066976",
"upd": { "upd": {
@ -8686,7 +8712,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ee6", "_id": "6773b39ccf4c2fe4e50a7ee6",
"_tpl": "5d40407c86f774318526545a", "_tpl": "5d40407c86f774318526545a",
"upd": { "upd": {
@ -8694,7 +8721,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7ee8", "_id": "6773b39ccf4c2fe4e50a7ee8",
"_tpl": "5d40407c86f774318526545a", "_tpl": "5d40407c86f774318526545a",
"upd": { "upd": {
@ -8702,7 +8730,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7eea", "_id": "6773b39ccf4c2fe4e50a7eea",
"_tpl": "5d403f9186f7743cac3f229b", "_tpl": "5d403f9186f7743cac3f229b",
"upd": { "upd": {
@ -8710,7 +8739,8 @@
}, },
"parentId": "6773b39ccf4c2fe4e50a7ec2", "parentId": "6773b39ccf4c2fe4e50a7ec2",
"slotId": "main" "slotId": "main"
}, { },
{
"_id": "6773b39ccf4c2fe4e50a7eec", "_id": "6773b39ccf4c2fe4e50a7eec",
"_tpl": "5d403f9186f7743cac3f229b", "_tpl": "5d403f9186f7743cac3f229b",
"upd": { "upd": {

View File

@ -1411,7 +1411,7 @@
"_type": "opened case - walter event quest", "_type": "opened case - walter event quest",
"rewardCount": 4, "rewardCount": 4,
"foundInRaid": true, "foundInRaid": true,
"rewardTplPool": {"67409848d0b2f8eb9b034db9": 1} "rewardTplPool": { "67409848d0b2f8eb9b034db9": 1 }
}, },
"674098588466ebb03408b210": { "674098588466ebb03408b210": {
"_type": "opened box - walter event quest", "_type": "opened box - walter event quest",

View File

@ -800,10 +800,12 @@
"followerBoarClose2" "followerBoarClose2"
], ],
"additionalFriendlyTypes": ["gifter", "shooterBTR", "sectactPriestEvent", "peacefullZryachiyEvent"], "additionalFriendlyTypes": ["gifter", "shooterBTR", "sectactPriestEvent", "peacefullZryachiyEvent"],
"chancedEnemies": [{ "chancedEnemies": [
{
"EnemyChance": 85, "EnemyChance": 85,
"Role": "pmcUSEC" "Role": "pmcUSEC"
}, { },
{
"EnemyChance": 100, "EnemyChance": 100,
"Role": "pmcBEAR" "Role": "pmcBEAR"
} }
@ -843,10 +845,12 @@
"followerBoarClose2" "followerBoarClose2"
], ],
"additionalFriendlyTypes": ["gifter", "shooterBTR", "sectactPriestEvent", "peacefullZryachiyEvent"], "additionalFriendlyTypes": ["gifter", "shooterBTR", "sectactPriestEvent", "peacefullZryachiyEvent"],
"chancedEnemies": [{ "chancedEnemies": [
{
"EnemyChance": 85, "EnemyChance": 85,
"Role": "pmcBEAR" "Role": "pmcBEAR"
}, { },
{
"EnemyChance": 100, "EnemyChance": 100,
"Role": "pmcUSEC" "Role": "pmcUSEC"
} }

View File

@ -337,7 +337,7 @@
"newPriceHandbookMultiplier": 11 "newPriceHandbookMultiplier": 11
} }
}, },
"itemPriceOverrideRouble":{ "itemPriceOverrideRouble": {
"66bc98a01a47be227a5e956e": 500000, "66bc98a01a47be227a5e956e": 500000,
"63a8970d7108f713591149f5": 50000, "63a8970d7108f713591149f5": 50000,
"63a898a328e385334e0640a5": 100000, "63a898a328e385334e0640a5": 100000,

View File

@ -97,56 +97,64 @@
"weights": [1, 2] "weights": [1, 2]
} }
}, },
"seasonDates": [{ "seasonDates": [
{
"seasonType": 0, "seasonType": 0,
"name": "SUMMER", "name": "SUMMER",
"startDay": "2", "startDay": "2",
"startMonth": "6", "startMonth": "6",
"endDay": "15", "endDay": "15",
"endMonth": "10" "endMonth": "10"
}, { },
{
"seasonType": 1, "seasonType": 1,
"name": "AUTUMN", "name": "AUTUMN",
"startDay": "15", "startDay": "15",
"startMonth": "10", "startMonth": "10",
"endDay": "1", "endDay": "1",
"endMonth": "11" "endMonth": "11"
}, { },
{
"seasonType": 4, "seasonType": 4,
"name": "AUTUMN_LATE", "name": "AUTUMN_LATE",
"startDay": "1", "startDay": "1",
"startMonth": "11", "startMonth": "11",
"endDay": "21", "endDay": "21",
"endMonth": "12" "endMonth": "12"
}, { },
{
"seasonType": 2, "seasonType": 2,
"name": "WINTER_START", "name": "WINTER_START",
"startDay": "21", "startDay": "21",
"startMonth": "12", "startMonth": "12",
"endDay": "31", "endDay": "31",
"endMonth": "12" "endMonth": "12"
}, { },
{
"seasonType": 2, "seasonType": 2,
"name": "WINTER_END", "name": "WINTER_END",
"startDay": "1", "startDay": "1",
"startMonth": "1", "startMonth": "1",
"endDay": "9", "endDay": "9",
"endMonth": "1" "endMonth": "1"
}, { },
{
"seasonType": 5, "seasonType": 5,
"name": "SPRING_EARLY", "name": "SPRING_EARLY",
"startDay": "9", "startDay": "9",
"startMonth": "1", "startMonth": "1",
"endDay": "25", "endDay": "25",
"endMonth": "3" "endMonth": "3"
}, { },
{
"seasonType": 3, "seasonType": 3,
"name": "SPRING", "name": "SPRING",
"startDay": "25", "startDay": "25",
"startMonth": "3", "startMonth": "3",
"endDay": "2", "endDay": "2",
"endMonth": "6" "endMonth": "6"
}, { },
{
"seasonType": 4, "seasonType": 4,
"name": "STORM", "name": "STORM",
"startDay": "24", "startDay": "24",

View File

@ -8,24 +8,23 @@
".editorconfig", ".editorconfig",
".git/*", ".git/*",
".pkg-cache/*", ".pkg-cache/*",
".vscode/*", "assets/database/*",
"build/*", "build/*",
"node_modules/*", "node_modules/*",
"obj/*", "obj/*",
"out/*",
"src/services/ModCompilerService.ts",
"tests/__cache__/*", "tests/__cache__/*",
"tests/__coverage__/*", "tests/__coverage__/*",
"types/*", "types/*",
"user/mods/*", "user/*"
"user/profiles/*",
"assets/database/*"
] ]
}, },
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
"recommended": true, "recommended": true,
"suspicious": {
"noExplicitAny": "warn"
},
"style": { "style": {
"useImportType": "off" "useImportType": "off"
} }
@ -34,17 +33,6 @@
"formatter": { "formatter": {
"enabled": true, "enabled": true,
"formatWithErrors": false, "formatWithErrors": false,
"ignore": [
"**/.git",
"**/.pkg-cache",
"**/.vscode",
"**/build",
"**/node_modules",
"**/types",
"**/tests/__cache__",
"**/tests/__coverage__",
"**/.editorconfig"
],
"attributePosition": "auto", "attributePosition": "auto",
"indentStyle": "space", "indentStyle": "space",
"indentWidth": 4, "indentWidth": 4,
@ -72,14 +60,7 @@
}, },
"overrides": [ "overrides": [
{ {
"include": ["tests/*"], "include": ["tests/*"]
"linter": {
"rules": {
"suspicious": {
"noExplicitAny": "off"
}
}
}
} }
] ]
} }

View File

@ -335,7 +335,7 @@ export class RagfairController {
// Figure out how many items the requirementsCost is applying to, and what the per-item price is // Figure out how many items the requirementsCost is applying to, and what the per-item price is
const offerItemCount = Math.max( const offerItemCount = Math.max(
offer.sellInOnePiece ? (offer.items[0].upd?.StackObjectsCount ?? 1) : 1, offer.sellInOnePiece ? offer.items[0].upd?.StackObjectsCount ?? 1 : 1,
); );
const perItemPrice = offer.requirementsCost / offerItemCount; const perItemPrice = offer.requirementsCost / offerItemCount;

View File

@ -1,6 +1,5 @@
// This is an auto generated file, do not modify. Re-generate with `npm run gen:items` // This is an auto generated file, do not modify. Re-generate with `npm run gen:items`
export enum ItemTpl export enum ItemTpl {
{
AMMOBOX_127X33_COPPER_20RND = "676009ddb623f3b8ba079419", AMMOBOX_127X33_COPPER_20RND = "676009ddb623f3b8ba079419",
AMMOBOX_127X33_FMJ_20RND = "676009ed8f1fee08740f9479", AMMOBOX_127X33_FMJ_20RND = "676009ed8f1fee08740f9479",
AMMOBOX_127X33_JHP_20RND = "676009fe8f1fee08740f947c", AMMOBOX_127X33_JHP_20RND = "676009fe8f1fee08740f947c",

View File

@ -1,6 +1,5 @@
// This is an auto generated file, do not modify. Re-generate with `npm run gen:items` // This is an auto generated file, do not modify. Re-generate with `npm run gen:items`
export enum Weapons export enum Weapons {
{
ASSAULTCARBINE_762X39_OP_SKS = "587e02ff24597743df3deaeb", ASSAULTCARBINE_762X39_OP_SKS = "587e02ff24597743df3deaeb",
ASSAULTCARBINE_762X39_SKS = "574d967124597745970e7c94", ASSAULTCARBINE_762X39_SKS = "574d967124597745970e7c94",
ASSAULTCARBINE_762X51_VPO_101_VEPR_HUNTER = "5c501a4d2e221602b412b540", ASSAULTCARBINE_762X51_VPO_101_VEPR_HUNTER = "5c501a4d2e221602b412b540",

View File

@ -38,7 +38,7 @@ export interface ISeasonalEventSettings {
enableSummoning: boolean; enableSummoning: boolean;
enableHalloweenHideout: boolean; enableHalloweenHideout: boolean;
enableChristmasHideout: boolean; enableChristmasHideout: boolean;
enableSanta: boolean, enableSanta: boolean;
adjustBotAppearances: boolean; adjustBotAppearances: boolean;
addEventGearToBots: boolean; addEventGearToBots: boolean;
addEventLootToBots: boolean; addEventLootToBots: boolean;

View File

@ -16,8 +16,8 @@ export class SPTWebSocket extends WebSocket {
public closeAsync(): Promise<void> { public closeAsync(): Promise<void> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.on('close', () => resolve()); this.on("close", () => resolve());
this.on('error', (err) => reject(err)); this.on("error", (err) => reject(err));
this.close(); this.close();
}); });
} }

View File

@ -1,23 +1,21 @@
import fs from "node:fs"; import fs from "node:fs";
import path from "node:path"; import path from "node:path";
import { inject, injectable } from "tsyringe";
import { ScriptTarget, ModuleKind, ModuleResolutionKind, transpileModule, CompilerOptions } from "typescript";
import { ProgramStatics } from "@spt/ProgramStatics"; import { ProgramStatics } from "@spt/ProgramStatics";
import type { ILogger } from "@spt/models/spt/utils/ILogger"; import type { ILogger } from "@spt/models/spt/utils/ILogger";
import { ModHashCacheService } from "@spt/services/cache/ModHashCacheService"; import { ModHashCacheService } from "@spt/services/cache/ModHashCacheService";
import { VFS } from "@spt/utils/VFS"; import { VFS } from "@spt/utils/VFS";
import { inject, injectable } from "tsyringe";
import { CompilerOptions, ModuleKind, ModuleResolutionKind, ScriptTarget, transpileModule } from "typescript";
@injectable() @injectable()
export class ModCompilerService export class ModCompilerService {
{
protected serverDependencies: string[]; protected serverDependencies: string[];
constructor( constructor(
@inject("PrimaryLogger") protected logger: ILogger, @inject("PrimaryLogger") protected logger: ILogger,
@inject("ModHashCacheService") protected modHashCacheService: ModHashCacheService, @inject("ModHashCacheService") protected modHashCacheService: ModHashCacheService,
@inject("VFS") protected vfs: VFS, @inject("VFS") protected vfs: VFS,
) ) {
{
const packageJsonPath: string = path.join(__dirname, "../../package.json"); const packageJsonPath: string = path.join(__dirname, "../../package.json");
this.serverDependencies = Object.keys(JSON.parse(this.vfs.readFile(packageJsonPath)).dependencies); this.serverDependencies = Object.keys(JSON.parse(this.vfs.readFile(packageJsonPath)).dependencies);
} }
@ -29,33 +27,28 @@ export class ModCompilerService
* @param modTypeScriptFiles * @param modTypeScriptFiles
* @returns * @returns
*/ */
public async compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void> public async compileMod(modName: string, modPath: string, modTypeScriptFiles: string[]): Promise<void> {
{
// Concatenate TS files into one string // Concatenate TS files into one string
let tsFileContents = ""; let tsFileContents = "";
let fileExists = true; // does every js file exist (been compiled before) let fileExists = true; // does every js file exist (been compiled before)
for (const file of modTypeScriptFiles) for (const file of modTypeScriptFiles) {
{
const fileContent = this.vfs.readFile(file); const fileContent = this.vfs.readFile(file);
tsFileContents += fileContent; tsFileContents += fileContent;
// Does equivalent .js file exist // Does equivalent .js file exist
if (!this.vfs.exists(file.replace(".ts", ".js"))) if (!this.vfs.exists(file.replace(".ts", ".js"))) {
{
fileExists = false; fileExists = false;
} }
} }
const hashMatches = this.modHashCacheService.calculateAndCompareHash(modName, tsFileContents); const hashMatches = this.modHashCacheService.calculateAndCompareHash(modName, tsFileContents);
if (fileExists && hashMatches) if (fileExists && hashMatches) {
{
// Everything exists and matches, escape early // Everything exists and matches, escape early
return; return;
} }
if (!hashMatches) if (!hashMatches) {
{
// Store / update hash in json file // Store / update hash in json file
this.modHashCacheService.calculateAndStoreHash(modName, tsFileContents); this.modHashCacheService.calculateAndStoreHash(modName, tsFileContents);
} }
@ -82,13 +75,11 @@ export class ModCompilerService
* @param fileNames Paths to TS files * @param fileNames Paths to TS files
* @param options Compiler options * @param options Compiler options
*/ */
protected async compile(fileNames: string[], options: CompilerOptions): Promise<void> protected async compile(fileNames: string[], options: CompilerOptions): Promise<void> {
{
// C:/snapshot/project || /snapshot/project // C:/snapshot/project || /snapshot/project
const baseDir: string = __dirname.replace(/\\/g, "/").split("/").slice(0, 3).join("/"); const baseDir: string = __dirname.replace(/\\/g, "/").split("/").slice(0, 3).join("/");
for (const filePath of fileNames) for (const filePath of fileNames) {
{
const destPath = filePath.replace(".ts", ".js"); const destPath = filePath.replace(".ts", ".js");
const parsedPath = path.parse(filePath); const parsedPath = path.parse(filePath);
const parsedDestPath = path.parse(destPath); const parsedDestPath = path.parse(destPath);
@ -97,20 +88,17 @@ export class ModCompilerService
if (ProgramStatics.COMPILED) { if (ProgramStatics.COMPILED) {
replacedText = text.replace(/(@spt)/g, `${baseDir}/obj`); replacedText = text.replace(/(@spt)/g, `${baseDir}/obj`);
for (const dependency of this.serverDependencies) for (const dependency of this.serverDependencies) {
{
replacedText = replacedText.replace(`"${dependency}"`, `"${baseDir}/node_modules/${dependency}"`); replacedText = replacedText.replace(`"${dependency}"`, `"${baseDir}/node_modules/${dependency}"`);
} }
} } else {
else
{
replacedText = text.replace(/(@spt)/g, path.join(__dirname, "..").replace(/\\/g, "/")); replacedText = text.replace(/(@spt)/g, path.join(__dirname, "..").replace(/\\/g, "/"));
} }
const output = transpileModule(replacedText, { compilerOptions: options }); const output = transpileModule(replacedText, { compilerOptions: options });
if (output.sourceMapText) if (output.sourceMapText) {
{ // biome-ignore format: these mappings should not be formatted
output.outputText = output.outputText.replace( output.outputText = output.outputText.replace(
"//# sourceMappingURL\=module.js.map", "//# sourceMappingURL\=module.js.map",
`//# sourceMappingURL\=${parsedDestPath.base}.map`, `//# sourceMappingURL\=${parsedDestPath.base}.map`,
@ -125,8 +113,7 @@ export class ModCompilerService
fs.writeFileSync(destPath, output.outputText); fs.writeFileSync(destPath, output.outputText);
} }
while (!this.areFilesReady(fileNames)) while (!this.areFilesReady(fileNames)) {
{
await this.delay(200); await this.delay(200);
} }
} }
@ -136,8 +123,7 @@ export class ModCompilerService
* @param fileNames * @param fileNames
* @returns * @returns
*/ */
protected areFilesReady(fileNames: string[]): boolean protected areFilesReady(fileNames: string[]): boolean {
{
return fileNames.filter((x) => !this.vfs.exists(x.replace(".ts", ".js"))).length === 0; return fileNames.filter((x) => !this.vfs.exists(x.replace(".ts", ".js"))).length === 0;
} }
@ -146,8 +132,7 @@ export class ModCompilerService
* @param ms Milliseconds * @param ms Milliseconds
* @returns * @returns
*/ */
protected delay(ms: number): Promise<unknown> protected delay(ms: number): Promise<unknown> {
{
return new Promise((resolve) => setTimeout(resolve, ms)); return new Promise((resolve) => setTimeout(resolve, ms));
} }
} }

View File

@ -11,7 +11,12 @@ import { SeasonalEventType } from "@spt/models/enums/SeasonalEventType";
import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig"; import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig"; import { ILocationConfig } from "@spt/models/spt/config/ILocationConfig";
import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig"; import { IQuestConfig } from "@spt/models/spt/config/IQuestConfig";
import { ISeasonalEvent, ISeasonalEventConfig, ISeasonalEventSettings, IZombieSettings } from "@spt/models/spt/config/ISeasonalEventConfig"; import {
ISeasonalEvent,
ISeasonalEventConfig,
ISeasonalEventSettings,
IZombieSettings,
} from "@spt/models/spt/config/ISeasonalEventConfig";
import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig"; import { IWeatherConfig } from "@spt/models/spt/config/IWeatherConfig";
import type { ILogger } from "@spt/models/spt/utils/ILogger"; import type { ILogger } from "@spt/models/spt/utils/ILogger";
import { ConfigServer } from "@spt/servers/ConfigServer"; import { ConfigServer } from "@spt/servers/ConfigServer";

View File

@ -70,7 +70,8 @@ export class HideoutCustomisationGen {
} }
const matchingQuest = this.questCustomisationReward[questOrAchievementRequirement.target as string]; const matchingQuest = this.questCustomisationReward[questOrAchievementRequirement.target as string];
const matchingAchievement = this.achievementCustomisationReward[questOrAchievementRequirement.target as string]; const matchingAchievement =
this.achievementCustomisationReward[questOrAchievementRequirement.target as string];
let source = null; let source = null;
if (matchingQuest) { if (matchingQuest) {

View File

@ -26,7 +26,7 @@ export default (<Environment>{
await importDatabase(container); await importDatabase(container);
return { return {
async teardown() { }, async teardown() {},
}; };
}, },
}); });

View File

@ -13,16 +13,9 @@
"verbatimModuleSyntax": false, "verbatimModuleSyntax": false,
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {
"@spt/*": [ "@spt/*": ["./src/*"],
"./src/*" "@tests/*": ["./tests/*"]
], }
"@tests/*": [
"./tests/*"
]
}, },
}, "include": ["src/*", "src/**/*"]
"include": [
"src/*",
"src/**/*"
]
} }

View File

@ -7,7 +7,5 @@
"declaration": true, "declaration": true,
"declarationDir": "./types" "declarationDir": "./types"
}, },
"exclude": [ "exclude": ["./types/**/*"]
"./types/**/*"
]
} }