For the record, Godot has a pretty permissive license and can export to the web. It also has JS/TS bindings iirc. Definitely worth a look if you're interested in getting deeper.
https://breaka.club/blog/godots-most-powerful-scripting-lang...
I've got a HEAP of stuff I still need to upstream
https://github.com/godotjs/GodotJS/compare/main...Benjamin-D...