Implemented the build for dtsgen
This commit is contained in:
parent
50d24f4e60
commit
b584279dc7
4 changed files with 31 additions and 2 deletions
|
@ -1,8 +1,12 @@
|
|||
import * as ts from "typescript";
|
||||
import {SyntaxKind} from "typescript";
|
||||
|
||||
if (!Array.prototype.last){
|
||||
Array.prototype.last = function(){
|
||||
interface Array<T> {
|
||||
last?(): T;
|
||||
}
|
||||
|
||||
if (!(<any>Array).prototype.last){
|
||||
(<any>Array).prototype.last = function(){
|
||||
if(this.length == 0) return undefined;
|
||||
return this[this.length - 1];
|
||||
};
|
||||
|
|
|
@ -10,6 +10,7 @@ function test2() : C {
|
|||
|
||||
return undefined;
|
||||
}
|
||||
// @ts-ignore
|
||||
function test4() : D {
|
||||
|
||||
return undefined;
|
||||
|
|
15
build/dtsgen/tsconfig.json
Normal file
15
build/dtsgen/tsconfig.json
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"moduleResolution": "node",
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
|
||||
"typeRoots": [],
|
||||
"types": []
|
||||
},
|
||||
"files": [
|
||||
"declarator.ts",
|
||||
"index.ts"
|
||||
]
|
||||
}
|
|
@ -19,6 +19,15 @@ function replace_tribble() {
|
|||
BASEDIR=$(dirname "$0")
|
||||
cd "$BASEDIR/../"
|
||||
|
||||
#Building the generator
|
||||
cd build/dtsgen
|
||||
execute_tsc -p tsconfig.json
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Failed to build typescript declaration generator"
|
||||
exit 1
|
||||
fi
|
||||
cd ../../
|
||||
|
||||
#Easy going: Each "module" has it's exports and imports
|
||||
#So lets first build the exports and ignore any errors
|
||||
#Note: For the client we have to use the given file
|
||||
|
|
Loading…
Add table
Reference in a new issue