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 * as ts from "typescript";
|
||||||
import {SyntaxKind} from "typescript";
|
import {SyntaxKind} from "typescript";
|
||||||
|
|
||||||
if (!Array.prototype.last){
|
interface Array<T> {
|
||||||
Array.prototype.last = function(){
|
last?(): T;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(<any>Array).prototype.last){
|
||||||
|
(<any>Array).prototype.last = function(){
|
||||||
if(this.length == 0) return undefined;
|
if(this.length == 0) return undefined;
|
||||||
return this[this.length - 1];
|
return this[this.length - 1];
|
||||||
};
|
};
|
||||||
|
|
|
@ -10,6 +10,7 @@ function test2() : C {
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
// @ts-ignore
|
||||||
function test4() : D {
|
function test4() : D {
|
||||||
|
|
||||||
return undefined;
|
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")
|
BASEDIR=$(dirname "$0")
|
||||||
cd "$BASEDIR/../"
|
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
|
#Easy going: Each "module" has it's exports and imports
|
||||||
#So lets first build the exports and ignore any errors
|
#So lets first build the exports and ignore any errors
|
||||||
#Note: For the client we have to use the given file
|
#Note: For the client we have to use the given file
|
||||||
|
|
Loading…
Add table
Reference in a new issue