From c8de66247aa2eafe7442c9d87c40a995cb3796ff Mon Sep 17 00:00:00 2001 From: Lazzexus Date: Mon, 12 Oct 2026 15:53:03 +0200 Subject: [PATCH] Fix mod zip layout: set tsconfig rootDir so control.lua lands at mod root Without an explicit rootDir, tstl computed output paths relative to tsconfig.json's own directory (modules/events-mod/) rather than the actual TypeScript source root (src/main/typescript/), so control.lua and settings.lua ended up nested under src/main/typescript/ in the packaged mod zip instead of at its root - where Factorio requires them to be. The mod would not have loaded at all as packaged. This went uncaught because packageFactorioMod never previously produced real output (blocked by the now-fixed kxs-ts-gen-core/JitPack issue). Verified by actually running packageFactorioMod and inspecting the resulting zip: control.lua, settings.lua and info.json are now at the root, and control.lua's require() calls ("main.global-init" etc.) correctly resolve against that flat layout. Co-Authored-By: Claude Sonnet 5 --- modules/events-mod/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/events-mod/tsconfig.json b/modules/events-mod/tsconfig.json index 12aebe0..679f9b4 100644 --- a/modules/events-mod/tsconfig.json +++ b/modules/events-mod/tsconfig.json @@ -7,6 +7,7 @@ ], "module": "commonjs", "moduleResolution": "node", + "rootDir": "./src/main/typescript", "types": [ "@typescript-to-lua/language-extensions", "lua-types/5.2",