Skip to content

Improve lualib integration #36

@lolleko

Description

@lolleko

Right now lualib is a bit hidden in the dist/ folder and will be even lesss visible in npm packages. Therefore we should automatically require lualib into projects. For that we will need to include the typings (lib-typescript.d.ts) when typescript is parsing the source file (before compilation).

Then we need to add the lualib functions to the output (during compilation), 2 possible approaches for that are:

  1. Keep track of functions/classes from lualib that are used and just copy them into the Lua source file where they are used e.g: local TS_Splice = function() .....

  2. Copy typescript.lua to output root directory of the compiled project. and require('typescript') in each file where the lib is used. (It would be better if we changed typescript.lua to a module structure that way we can do local = require, and utilise the module cache)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions