GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NxeGamingNetwork/TypeScriptToLua: Typescript to lua transpiler. https://typescripttolua.github.io/

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

906 Commits
906 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
test
test
 
 
.codecov.yml
.codecov.yml
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.js
.prettierrc.js
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
build_lualib.ts
build_lualib.ts
 
 
jest.config.js
jest.config.js
 
 
logo-hq.png
logo-hq.png
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
tslint.json
tslint.json
 
 

Repository files navigation

TypeScriptToLua

TypeScriptToLua

Continuous Integration status Coverage Chat with us!

A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!

Large projects written in lua can become hard to maintain and make it easy to make mistakes. Writing code in TypeScript instead improves maintainability, readability and robustness, with the added bonus of good IDE support. This project is useful in any environment where Lua code is accepted, with the powerful option of simply declaring any existing API using TypeScript declaration files.

Documentation

More detailed documentation and info on writing declarations can be found on the wiki.

Changelog can be found in CHANGELOG.md

Usage Guide

Install

npm install -g typescript-to-lua

Compile Files

tstl path/to/file.ts path/to/other-file.ts

Compile Projects

tstl -p path/to/tsconfig.json

Compile project in watch mode

tstl -p path/to/tsconfig.json --watch

Example tsconfig.json

{
  "compilerOptions": {
    "target": "esnext",
    "lib": ["esnext"],
    "strict": true
  },
  "tstl": {
    "luaTarget": "JIT"
  }
}

Contributing

All contributions are welcome, but please read our contribution guidelines!

Declarations

The real power of this transpiler is usage together with good declarations for the Lua API provided. Some examples of Lua interface declarations can be found here:

  • Dota 2 Modding
  • Defold Game Engine Scripting
  • LÖVE 2D Game Development

Sublime Text integration

This compiler works great in combination with the Sublime Text Typescript plugin (available through the package manager as TypeScript).

You can simply open your typescript project assuming a valid tsconfig.json file is present. The default TypeScript plugin will provide all functionality of a regular TypeScript project.

Setting up a custom build system

To add the option to build with the Lua transpiler instead of the regular typescript compiler, go to Tools > Build System > New Build System.... In the new sublime-build file that opens, enter the following (adjust path to tstl if not installed globally):

{
    "cmd": ["tstl", "-p", "$file"],
    "shell": true
}

Save this in your Sublime settings as a TypeScriptToLua.sublime-build. You can now select the TypeScriptToLua build system in Tools > Build System to build using the normal hotkey (ctrl+B), or if you have multiple TypeScript projects open, you can choose your compiler before building by pressing ctrl+shift+B.

About

Typescript to lua transpiler. https://typescripttolua.github.io/

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.