Skip to content

Commit e9f254c

Browse files
authored
Build & Release system (#32)
* Updated build configs * Removed build artifacts from repo * Added License * Added npm api key
1 parent af1b806 commit e9f254c

File tree

13 files changed

+251
-1462
lines changed

13 files changed

+251
-1462
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
node_modules/
33
*.lua
44
!json.lua
5-
!dist/*.js
65
!dist/lualib/*.lua
76

87
coverage/
98
.nyc*
9+
*.js.map
10+
11+
# Release
12+
*.tgz
1013

1114
# OSX
1215
.DS_Store

.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*
2+
!dist/**/*.js
3+
dist/**/*.map.js

.travis.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
language: node_js
2-
32
node_js:
4-
- 'stable'
5-
3+
- stable
64
install:
7-
- npm install
8-
5+
- npm install
96
script:
10-
- npm test
7+
- npm run build
8+
# Testing & Coverage
9+
- npm test
10+
after_success:
11+
- npm run coverage
12+
deploy:
13+
- provider: npm
14+
email: ''
15+
api_key:
16+
secure: FQoclPvgZwwA0aiGT1Hmh8BxcgzqyGyqyhIz/wcL1wGh1/9v0XA93W8lmnpWw4eT/sWd3CJt26aCzZd+9GbhRRUt4YaR/JS/kLseq6ahI4xSLrXbHRJuXQKsuAaVRnddIR0CTZh5Qy4X9MtKvm74fPLTYaMYDrGYWxtawO/s1PsqyDeZrwZt7MhbxBTGk5nkiqI03/kKTCoXPpvYncFlSGlJAlSXyx3G7gkbplIr3JL5eqNYmv2KdclU7Q8R9j2NGV2DCJbE6E6SUdwWPXWs5UaKP2HHzXinIqh4HRA8GVb9x08BW6PFVbXmNCCfVtZf748cizLpT+SFWKRXL8DSPnJihI2QH9xiwMqDTNeZhBVtzsxe2aomKdwqrlFIUMGe85s+cEnEM9pncLHqwEXIUB/TrDtjObd+UOvp/4GopF5ZQ1iOi0pt7RFRrR/uZq49R3yU9FlcIh8SOR8J8w8MQjsf/C2DfMAVYc46iQS0yKFLkOOcG4su7V7n/kw8e5vQBVnzLngFJ4YcvXp24VHWZ9A8hxIoMLwaYbxrMHu3NKTt/nJn1z//Lr+MYpkliOWDmyHJ8JektcuySpJ0xpIRK5043P7p4/LBL2yMh9cVvHiumxhekJ4y/G/x3guSC/lmDu+/X3K+zMhm04Aky1OLiniaamB4XnyeUZrcY8dGijY=
17+
on:
18+
tags: true
19+
repo: Perryvw/TypescriptToLua

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 [fullname]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,17 @@ Typescript to lua transpiler.
55

66
## Usage Guide
77

8-
#### Prerequisites
9-
- Node.Js
10-
- Typescript (`npm install -g typescript`)
8+
`npm install -g typescript-to-lua`
119

12-
### Required files
13-
To run the transpiler, download all files from [dist](https://github.com/Perryvw/TypescriptToLua/tree/master/dist):
14-
- Compiler.js
15-
- ForHelper.js
16-
- Transpiler.js
17-
- TSHelper.js
18-
19-
After copying these files to a locaton on your machine, run command `npm link typescript` in the directory the javascript files are in.
10+
`tstl path/to-my-file.ts`
2011

2112
**Optionally:**
22-
Add the lualib files to your project. This helper library unlocks additional typescript functions:
13+
Add the lualib files from dist/ to your project. This helper library unlocks additional typescript functions:
2314
- Ternary operator
2415
- Functional-style list operations (forEach/map/filter/every/some)
2516
- Includes lua `Map<S,T>` and `Set<T>` implementations
2617
Add `require("typescript")` in your code code if you want to use the lualib functionality.
2718

28-
### Transpiling an individual TypeScript file to Lua
29-
To transpile a typescript file to lua, run Compiler.js in node with the path to the file you want to compile, eg:
30-
31-
`node C:\Documents\TypescriptToLua\dist\Compiler.js .\my-file.ts`
32-
3319
### Transpiling a TypeScript project to Lua
3420
The compiler will automatically try to find a typescript configuration file `tsconfig.json` in the files. If found it will transpile all TypeScript files in subdirectories of the project.
3521

@@ -41,11 +27,11 @@ This compiler works great in combination with the [Sublime Text Typescript plugi
4127
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.
4228

4329
### Setting up a custom build system
44-
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 text with correct Compiler.js path:
30+
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):
4531

4632
```
4733
{
48-
"cmd": ["node", "C:/Documents/TypeScriptToLua/dist/Compiler.js", "$file"]
34+
"cmd": ["tstl", "$file"]
4935
}
5036
```
5137
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`.

dist/Compiler.js

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

dist/ForHelper.js

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

dist/TSHelper.js

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

0 commit comments

Comments
 (0)