The version catalog pointed kxs-ts-gen-core at a JitPack coordinate
(com.github.adamko-dev.kotlinx-serialization-typescript-generator) that
no longer serves real artifacts there, despite JitPack's build-status
API still reporting it as built. The library is properly published to
Maven Central under dev.adamko.kxstsgen - a commented-out line with
that exact coordinate was already sitting in the catalog. Swapping to
it fixes dependency resolution for every module depending on
versions-platform (which previously blocked any Gradle task touching
events-library, including all of its tests).
That unblocked two more pre-existing, unrelated bugs that had never
been caught because this module never previously compiled:
- LuaJsonList<T> : List<T> by list triggered a longstanding Kotlin
compiler bug (KT-3546, "accidental override" on generic toArray)
specific to delegating java.util.List via `by`. Replaced with a
hand-written Collection<T> implementation (no delegation codegen,
no bug), which still satisfies Kotest's forOne/forAll inspectors -
the only thing any code actually needs from it.
- The kxs-ts-gen Kotlin->TypeScript generator (kt2ts2.kt) still emitted
the pre-2.0 bare `uint`/`int` names and no import statement, since it
predates typed-factorio's move to virtual modules. Updated its
primitive-type mappings to uint32/int32 and added the "factorio:runtime"
import to its generated header, so the regenerated schema matches what
the rest of events-mod now expects.
Verified via real Gradle tasks (not just manual tooling): events-library
compiles and all tests pass; events-mod's full build - Kotlin schema
generation, npm install, tstl compile, and info.json generation (with
factorio_version "2.0" and the space-exploration/Krastorio2 optional
dependencies) - succeeds end-to-end.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
typed-factorio 2.0.0+ stopped declaring types as ambient globals - they
now live in virtual modules ("factorio:runtime", "factorio:common",
"factorio:settings") and must be explicitly imported. Adds those imports
throughout events-mod. Also:
- Bumps typescript-to-lua 1.11.1 -> 1.25.2 and typescript 4.9 -> 5.4.2,
since tstl pins an exact peer TypeScript version and typed-factorio
3.x needs a newer one than 4.9 supports (a real compiler bug in
TS 4.9 against the generated defines.segmented_unit_ai_state enum).
- Bumps the pinned isolated Node (14.19.1 -> 24.21.0), since
typescript-to-lua 1.25.2 requires Node >=16.10.0.
- Renames bare uint/int -> uint32/int32 (import aliases), since the
unsized aliases no longer exist.
- Drops OnEntityDestroyedEvent from an unused documentation-only union
type - that event no longer exists in the 2.0 API.
- LuaEntityPrototype.max_health is now get_max_health() (quality-aware).
- Fixes a branded-type mismatch between our generated schema's
ForceIndex and typed-factorio's own ForceIndex.
Verified by actually running tstl end-to-end (clean compile, Lua
emitted) after installing a real JDK and Node toolchain.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Bumps the Factorio engine pin and typed-factorio (1.11.0 -> 3.36.0,
targeting 2.0.75) and fixes the resulting breaking API changes:
global -> storage, game.*_prototypes -> prototypes.*, game.table_to_json/
encode_string -> helpers.*, OnBuiltEntityEvent.created_entity -> .entity,
removed TileRead/ColorTable/MapPositionTable-style write-form aliases,
new CollisionMask shape, restructured settings-stage type imports, and
new defines.entity_status values (added to the Status enum, generated
schema, and EntityStatusRecord mapping). Also declares optional mod
dependencies on space-exploration and Krastorio2.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>