lovr-docs icon indicating copy to clipboard operation
lovr-docs copied to clipboard

Luau/Teal/LuaLS Type Definitions

Open bjornbytes opened this issue 1 year ago • 2 comments

We could use the data in this repository to generate type annotations for Lua variants like tl and Luau.

Here's a version of it for LÖVE https://github.com/MikuAuahDark/love2d-tl

bjornbytes avatar Apr 26 '24 22:04 bjornbytes

type annotations for luals would also be nice

pterror avatar Jun 26 '24 14:06 pterror

Some LuaLS definitions already exist here, but it might be a good idea to start generating them here in lovr-docs so that they are kept up to date.

bjornbytes avatar Jun 26 '24 16:06 bjornbytes

This is basically done! LuaLS definitions are generated from the main docs and will automatically be kept up to date:

  • The docs script has a system for "generators" now. The existing generator (that writes api/init.lua) is called the Lua generator.
  • Added a new LuaLS/LuaCATS generator based on the script in #154.
  • Added a new GitHub actions workflow that generates cats definitions and publishes them to a new cats branch. This is because LuaLS requires addons to follow a specific folder structure.
    • LLS-Addons could point their lovr submodule at the cats branch so that installing LÖVR with the addon manager grabs these new definition files.

Other generators could be added in the future (Teal, TypeScriptToLua, Luau, HTML, etc.).

bjornbytes avatar Feb 21 '25 02:02 bjornbytes