IppClub / Dora-SSR

Dora Project, Special Super Rare Edition.
https://dora-ssr.net/
Other
331 stars 44 forks source link

Tracking: support typescript as the scripting language #30

Open neverchanje opened 9 months ago

neverchanje commented 9 months ago

The background shared by @pigpigyyy:

Teal was introduced a long while ago in this project when Typescript was not yet mature. However, when it comes to a statically typed scripting language, Typescript has grown to be the most popular option today. We can explore the possiblity of transpiling TS to Lua https://github.com/TypeScriptToLua/TypeScriptToLua and provide the type definitions for Dorothy like https://github.com/hazzard993/love-typescript-definitions

Eventually, we may also need to provide a template project for scaffolding. https://github.com/hazzard993/love-typescript-template

pigpigyyy commented 4 months ago

Thank you for your suggestions. I've successfully integrated the TypeScriptToLua compiler with our Dora SSR project, and have added several tests to the repository to ensure its functionality. We now support TypeScript by allowing the Web IDE to compile TS and TSX code into Lua whenever the editor's save action is triggered. We plan to introduce support for npm-based toolchains in the future, which will allow developers to work with their preferred external IDEs rather than being confined to the Dora SSR Web IDE.