From e0e12eef340b17886cbe318a1668477d65f9c1a9 Mon Sep 17 00:00:00 2001 From: ark120202 Date: Sun, 5 Apr 2020 19:04:22 +0000 Subject: [PATCH 1/4] Update readme with website links --- README.md | 88 ++++++++----------------------------------------------- 1 file changed, 12 insertions(+), 76 deletions(-) diff --git a/README.md b/README.md index d8c929e23..386de6bcb 100644 --- a/README.md +++ b/README.md @@ -1,86 +1,22 @@
TypeScriptToLua

- TypeScriptToLua -

- Continuous Integration status +

TypeScriptToLua

+ CI status Coverage Chat with us!

+ Documentation + | + Try Online + | + Changelog + | + Contribution guidelines
-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](https://github.com/TypeScriptToLua/TypescriptToLua/wiki). - -Changelog can be found in [CHANGELOG.md](https://github.com/TypeScriptToLua/TypescriptToLua/blob/master/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** - -```json -{ - "compilerOptions": { - "target": "esnext", - "lib": ["esnext"], - "strict": true - }, - "tstl": { - "luaTarget": "JIT" - } -} -``` - -## Contributing - -All contributions are welcome, but please read our [contribution guidelines](https://github.com/TypeScriptToLua/TypescriptToLua/blob/master/CONTRIBUTING.md)! - -## 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](https://github.com/ModDota/API/tree/master/declarations/server) -- [Defold Game Engine Scripting](https://github.com/dasannikov/DefoldTypeScript/blob/master/defold.d.ts) -- [LÖVE 2D Game Development](https://github.com/hazzard993/love-typescript-definitions) -- [World of Warcraft - Addon Development](https://github.com/wartoshika/wow-declarations) -- [World of Warcraft Classic - Addon Development](https://github.com/wartoshika/wow-classic-declarations) - -## Sublime Text integration - -This compiler works great in combination with the [Sublime Text Typescript plugin](https://github.com/Microsoft/TypeScript-Sublime-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 -} -``` +A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua! -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`. +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. From ea8c9becd37832c99ac005893d8292cdbd0d6ee0 Mon Sep 17 00:00:00 2001 From: ark120202 Date: Wed, 29 Apr 2020 11:46:39 +0000 Subject: [PATCH 2/4] Add some tooling references to the description --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 386de6bcb..7d3d26aa3 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,10 @@ 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. +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 [tooling] support (including [ESLint], [Prettier], [Visual Studio Code] and [WebStorm]). 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. + +[tooling]: https://typescripttolua.github.io/docs/editor-support +[eslint]: https://eslint.org/ +[prettier]: https://prettier.io/ +[visual studio code]: https://code.visualstudio.com/ +[webstorm]: https://www.jetbrains.com/webstorm/ From 58ee988711806a193004008eb977180971092df3 Mon Sep 17 00:00:00 2001 From: ark120202 Date: Wed, 29 Apr 2020 18:23:29 +0000 Subject: [PATCH 3/4] Add a `Getting Started` section --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 7d3d26aa3..2a880dba2 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,19 @@ Large projects written in Lua can become hard to maintain and make it easy to ma [prettier]: https://prettier.io/ [visual studio code]: https://code.visualstudio.com/ [webstorm]: https://www.jetbrains.com/webstorm/ + +## Getting Started + +To install TypeScriptToLua add a `typescript-to-lua` npm package: + +```bash +$ npm install -D typescript-to-lua +``` + +This package includes a `tstl` command line application, which can be used similarly to `tsc`: + +``` +$ npx tstl +``` + +For more information, check out [Getting Started](https://typescripttolua.github.io/docs/getting-started) page in our documentation. From ef206d04d24fd75dbb948a068e625336d28a48c2 Mon Sep 17 00:00:00 2001 From: ark120202 Date: Thu, 30 Apr 2020 01:00:18 +0500 Subject: [PATCH 4/4] Apply suggestions from code review Co-Authored-By: Perry van Wesel --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2a880dba2..13198efc1 100644 --- a/README.md +++ b/README.md @@ -29,16 +29,16 @@ Large projects written in Lua can become hard to maintain and make it easy to ma ## Getting Started -To install TypeScriptToLua add a `typescript-to-lua` npm package: +To install TypeScriptToLua add the `typescript-to-lua` npm package: ```bash $ npm install -D typescript-to-lua ``` -This package includes a `tstl` command line application, which can be used similarly to `tsc`: +This package includes the `tstl` command line application, which can be used similarly to `tsc`: ``` $ npx tstl ``` -For more information, check out [Getting Started](https://typescripttolua.github.io/docs/getting-started) page in our documentation. +For more information, check out [Getting Started](https://typescripttolua.github.io/docs/getting-started) in our documentation.