Service | Master | Dev |
---|---|---|
CI Status | ||
Coverage |
This command line tool helps to transpile Typescript into other languages. The main goal was to support every aspect of Typescript. Typescript 2 and 3 are supported!
The following languages are currently supported:
- LUA
- World of Warcraft LUA Addon interpreter
$ npm install -g --save-dev @wartoshika/qhun-transpiler
$ qhun-transpiler -h
There are two possible ways of transpiling your sourcecode into other languages.
- Creating a JSON file containing project relevant information (recommended).
- Passing required data via command line arguments.
- You need to create a JSON file next to a
tsconfig.json
file. - Call the executable file of qhun-transpiler using the
-p
argument.- Example:
$ qhun-transpiler -p ./qhun-transpiler.json
- Example:
The qhun-transpiler.json
file must have the following structure:
{
"name": "The name of your program/project",
"version": "The version number as string of your program/project",
"author": "Your name",
"licence": "Your licence",
"description": "A longer description of your program/project",
"printFileHeader": true, // a boolean value that indicates that a text will be added to each file.
"stripOutDir": "src", // the name of the folder where you put your sourcecode in. Eg. src. Leave this empty if your code is not stored in one source folder
"target": "The target name. Eg. lua",
"tsconfig": "the relative path to the tsconfig.json file including its name",
"config": {
// A config block that varies between each target. See the target documentation for details
}
}
The tsconfig.json
file will tell the transpiler wich files shoule be transpiled. Please refer to the tsconfig.json Documentation.
Every file will be translated into the given target language. The directory where to put those files is stored in the tsconfig.json
file. Please refer to its documentation.
- There are no requirements.
- Call the executale and pass the following arguments:
-t
The target language. Eg. lua-f
The path to the file that should be transpiled
An example executable path could be $ qhun-transpiler -t lua -f ./myTypescriptFile.ts
The transpiles file will be placed next to the original file. The file extension will be changed to the target language's file extension.
You can find a documentation file for the desired target in the doc
folder.
- When using a number indexed object at default values in functions.
- BITOPS OR does not work as expected in certain cases
MIT license. See LICENSE for more details.