Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/caveats.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ title: Caveats

## Feature support

| Feature | Lua 5.1 | Lua 5.2 | Lua 5.3 | LuaJIT |
| ------------------- | :-----: | :-----: | :-----: | :----: |
| [Missing features] | ❌ | ❌ | ❌ | ❌ |
| [Bitwise operators] | ❌ | ✔️ | ✔️ | ✔️ |
| [`continue`] | ❌ | ✔️ | ✔️ | ✔️ |
| (everything else) | ✔️ | ✔️ | ✔️ | ✔️ |
| Feature | Lua 5.0 | Lua 5.1 | Lua 5.2 | Lua 5.3 | LuaJIT |
| ------------------- | :-----: | :-----: | :-----: | :-----: | :----: |
| [Missing features] | ❌ | ❌ | ❌ | ❌ | ❌ |
| [Bitwise operators] | ❌ | ❌ | ✔️ | ✔️ | ✔️ |
| [`continue`] | ❌ | ❌ | ✔️ | ✔️ | ✔️ |
| (everything else) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |

[missing features]: https://github.com/TypeScriptToLua/TypeScriptToLua/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22missing+feature%22
[bitwise operators]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators
Expand Down
32 changes: 16 additions & 16 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ You can use our [VS Code extension](editor-support.md) or manually specify the J
}
```

| Option | Values | Description |
| -------------------------------- | -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `buildMode` | `"default"`, `"library"` (default: `"library"`) | Use `buildMode: "library"` to build [publishable library packages](publishing-modules.md). |
| `extension` | File extension (default: `".lua"`) | Extension of emitted lua files. |
| `luaTarget` | `"JIT"`, `"5.3"`, `"5.2"`, `"5.1"`, `"universal"` (default: `"universal"`) | Specifies the Lua version you want to generate code for. Choosing `universal` makes TypeScriptToLua generate code compatible with all supported Lua targets. |
| `noImplicitGlobalVariables` | `true`, `false` (default: `false`) | If true, always makes root level function and variable declarations local, even if not in a module (would be global in TypeScript). |
| `noImplicitSelf` | `true`, `false` (default: `false`) | If true, treats all project files as if they were prefixed with<br />`/** @noSelfInFile **/`. |
| `noHeader` | `true`, `false` (default: `false`) | Set this to true if you don't want to include our header in the output. |
| `lua51AllowTryCatchInAsyncAwait` | `true`, `false` (default: `false`) | Disable warning diagnostic about try/catch inside `async` functions for Lua 5.1, in case you are using a modified 5.1 environment that can handle this. |
| `luaLibImport` | `"inline"`, `"require"`, `"none"` (default: `"require"`) | We polyfill certain JavaScript features with Lua functions, this option specifies how these functions are imported into the Lua output. `"inline"`: Inline used functions in code; `"require"`: Require full lualib bundle if used in file. `"none"`: Never require/inline any lualib features. |
| `sourceMapTraceback` | `true`, `false` (default: `false`) | Overrides Lua's `debug.traceback` to apply sourcemaps to Lua stacktraces. This will make error messages point to your original TypeScript code instead of the generated Lua. |
| `luaBundle` | File path (relative to the `tsconfig.json`) | Will bundle all output lua files into a single bundle file. Requires **luaBundleEntry** to be set! |
| `luaBundleEntry` | File path (relative to the `tsconfig.json`) | This should be the name/path of the TS file in your project that will serve as entry point to the bundled code. |
| `luaPlugins` | `Array<{ name: string; import?: string }>` | List of [TypeScriptToLua plugins](api/plugins.md). |
| `tstlVerbose` | `true`, `false` (default: `false`) | Output additional logging when performing a tstl build, to help diagnose issues. |
| `noResolvePaths` | `Array<string>` | An array of require paths that will **NOT** be resolved. For example `["require1", "sub.require2"]` will stop tstl from trying to resolve Lua sources for `require("require1")` and `require("sub.require2")`. |
| Option | Values | Description |
| -------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `buildMode` | `"default"`, `"library"` (default: `"library"`) | Use `buildMode: "library"` to build [publishable library packages](publishing-modules.md). |
| `extension` | File extension (default: `".lua"`) | Extension of emitted lua files. |
| `luaTarget` | `"JIT"`, `"5.3"`, `"5.2"`, `"5.1"`, `"universal"`, `"5.0"` (default: `"universal"`) | Specifies the Lua version you want to generate code for. Choosing `universal` makes TypeScriptToLua generate code compatible with all supported Lua targets, except for Lua 5.0, which features an unique syntax not compatible with that of the other targets. |
| `noImplicitGlobalVariables` | `true`, `false` (default: `false`) | If true, always makes root level function and variable declarations local, even if not in a module (would be global in TypeScript). |
| `noImplicitSelf` | `true`, `false` (default: `false`) | If true, treats all project files as if they were prefixed with<br />`/** @noSelfInFile **/`. |
| `noHeader` | `true`, `false` (default: `false`) | Set this to true if you don't want to include our header in the output. |
| `lua51AllowTryCatchInAsyncAwait` | `true`, `false` (default: `false`) | Disable warning diagnostic about try/catch inside `async` functions for Lua 5.1, in case you are using a modified 5.1 environment that can handle this. |
| `luaLibImport` | `"inline"`, `"require"`, `"none"` (default: `"require"`) | We polyfill certain JavaScript features with Lua functions, this option specifies how these functions are imported into the Lua output. `"inline"`: Inline used functions in code; `"require"`: Require full lualib bundle if used in file. `"none"`: Never require/inline any lualib features. |
| `sourceMapTraceback` | `true`, `false` (default: `false`) | Overrides Lua's `debug.traceback` to apply sourcemaps to Lua stacktraces. This will make error messages point to your original TypeScript code instead of the generated Lua. |
| `luaBundle` | File path (relative to the `tsconfig.json`) | Will bundle all output lua files into a single bundle file. Requires **luaBundleEntry** to be set! |
| `luaBundleEntry` | File path (relative to the `tsconfig.json`) | This should be the name/path of the TS file in your project that will serve as entry point to the bundled code. |
| `luaPlugins` | `Array<{ name: string; import?: string }>` | List of [TypeScriptToLua plugins](api/plugins.md). |
| `tstlVerbose` | `true`, `false` (default: `false`) | Output additional logging when performing a tstl build, to help diagnose issues. |
| `noResolvePaths` | `Array<string>` | An array of require paths that will **NOT** be resolved. For example `["require1", "sub.require2"]` will stop tstl from trying to resolve Lua sources for `require("require1")` and `require("sub.require2")`. |

## Standard options

Expand Down