Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hazzard993/tstl-lurker
Declarations for lurker for use with TypeScriptToLua.
https://github.com/hazzard993/tstl-lurker
definitions hotswap love2d lurker
Last synced: 4 months ago
JSON representation
Declarations for lurker for use with TypeScriptToLua.
- Host: GitHub
- URL: https://github.com/hazzard993/tstl-lurker
- Owner: hazzard993
- License: mit
- Created: 2019-06-18T13:11:09.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-14T13:11:24.000Z (about 4 years ago)
- Last Synced: 2024-10-02T11:21:05.619Z (4 months ago)
- Topics: definitions, hotswap, love2d, lurker
- Size: 7.81 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TSTL Lurker
Declarations for [lurker](https://github.com/rxi/lurker), a small module which automatically hotswaps changed Lua files in a running LÖVE project.
| Command | Description |
|-|-|
| `yarn add -D tstl-lurker` | Install these declarations |
| `yarn add rxi/lume rxi/lurker` | Install Lurker |
| `tstl -p tsconfig.json --watch` | Transpile and continue to transpile changed _.ts_ files |
| `love /path/to/game/directory` | Run the game. Make sure `lurker.update()` is called |Upon installation these declarations can be linked to a _tsconfig.json_ file.
```json
{
"compilerOptions": {
"types": [
"tstl-lurker"
]
}
}
```And used within any _.ts_ file.
```ts
import lurker = require("lurker");
// this import style is not available in esnextlurker.preswap = (f) => f === "lualib_bundle.lua";
// do NOT hotswap lualib_bundle.lua, lurker can't hotswap thislurker.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.
```ts
package.path += ";./node_modules/?/?.lua";
```