1.0.3 • Published 4 years ago

tstl-lurker v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

TSTL Lurker

Declarations for lurker, a small module which automatically hotswaps changed Lua files in a running LÖVE project.

CommandDescription
yarn add -D tstl-lurkerInstall these declarations
yarn add rxi/lume rxi/lurkerInstall Lurker
tstl -p tsconfig.json --watchTranspile and continue to transpile changed .ts files
love /path/to/game/directoryRun the game. Make sure lurker.update() is called

Upon installation these declarations can be linked to a tsconfig.json file.

{
    "compilerOptions": {
        "types": [
            "tstl-lurker"
        ]
    }
}

And used within any .ts file.

import lurker = require("lurker");
// this import style is not available in esnext

lurker.path = "./entities";
lurker.quiet = false;

love.update = () => {
    lurker.update();
};

Make sure to append ";./node_modules/?/?.lua" to your package.path in a conf.ts file (this is run first) to assist where Lua looks for modules.

package.path += ";./node_modules/?/?.lua";