Skip to content

Commit afd66f5

Browse files
committed
2 parents b6f6f7b + 68c87fb commit afd66f5

31 files changed

+600
-202
lines changed

.codecov.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
comment: off
2+
13
coverage:
24
status:
3-
patch: false
4-
changes: false
5-
project: false
6-
7-
comment: false
5+
project:
6+
default:
7+
target: 95
8+
threshold: null
9+
base: auto
10+
changes: off
11+
patch: off

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 0.7.0
4+
* Lualib runtime library is now compiled from TypeScript using the transpiler when building!
5+
* Split up runtime library definition into individual files.
6+
* Added multiple inclusion modes using the tsconfig option `lubLibImport`, options are:
7+
* `require` : Requires the entire library if lualib features are used.
8+
* `always` : Always require the runtime library.
9+
* `inline` : Inline the library code for used features in the file.
10+
* `none` : Do not include the runtime library
11+
* Added support for assigning expressions (`+=`, `&=`, `++`, etc) in other expressions (i.e. `lastIndex = i++` or `return a += b`) by transpiling them as immediately called anonymous functions.
12+
* Unreachable code (after returns) is no longer transpiled, preventing a Lua syntax error.
13+
* Fixed issue with destructing statements in Lua 5.1
14+
* Fixed issue with escaped characters in strings.
15+
* Fixed bug regarding changing an exported variable after its export.
16+
17+
318
## 0.6.0
419
* Reworked part of the class system to solve some issues.
520
* Reworked class tests from translation to functional.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "typescript-to-lua",
33
"license": "MIT",
4-
"version": "0.6.0",
4+
"version": "0.7.0",
55
"repository": "https://github.com/Perryvw/TypescriptToLua",
66
"keywords": [
77
"typescript",

src/Compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export function compileFilesWithOptions(fileNames: string[], options: CompilerOp
9595
});
9696

9797
// Copy lualib to target dir
98-
if (options.luaLibImport === LuaLibImportKind.Require) {
98+
if (options.luaLibImport === LuaLibImportKind.Require || options.luaLibImport === LuaLibImportKind.Always) {
9999
fs.copyFileSync(
100100
path.resolve(__dirname, "../dist/lualib/lualib_bundle.lua"),
101101
path.join(options.outDir, "lualib_bundle.lua")

src/TSHelper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,10 @@ export class TSHelper {
190190

191191
return [false, null];
192192
}
193+
194+
public static isExpressionStatement(node: ts.Expression): boolean {
195+
return node.parent === undefined
196+
|| ts.isExpressionStatement(node.parent)
197+
|| ts.isForStatement(node.parent);
198+
}
193199
}

0 commit comments

Comments
 (0)