Skip to content

Commit fda1683

Browse files
authored
Merge pull request #148 from Perryvw/ts-lualib
Typescript lualib
2 parents 1dc962e + a819459 commit fda1683

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1290
-1229
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ coverage/
1717
.idea/
1818

1919
typescript_lualib.lua
20+
lualib_bundle.lua
21+
22+
dist/*

build_lualib.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import * as fs from "fs";
2+
import * as glob from "glob";
3+
import {compile} from "./src/Compiler";
4+
5+
const bundlePath = "./dist/lualib/lualib_bundle.lua";
6+
7+
compile([
8+
"--luaLibImport",
9+
"none",
10+
"--luaTarget",
11+
"5.1",
12+
"--noHeader",
13+
"--outDir",
14+
"./dist/lualib",
15+
"--rootDir",
16+
"./src/lualib",
17+
...glob.sync("./src/lualib/*.ts"),
18+
]);
19+
20+
if (fs.existsSync(bundlePath)) {
21+
fs.unlinkSync(bundlePath);
22+
}
23+
24+
let bundle = "";
25+
26+
glob.sync("./dist/lualib/*.lua").forEach(fileName => bundle += fs.readFileSync(fileName));
27+
28+
fs.writeFileSync(bundlePath, bundle);

dist/lualib/typescript.lua

Lines changed: 0 additions & 339 deletions
This file was deleted.

0 commit comments

Comments
 (0)