11#! /usr/bin/env node
22var { program } = require ( "commander" ) ;
33var { exec } = require ( "child_process" ) ;
4- var { renameSync, rmdirSync, unlinkSync } = require ( "fs" ) ;
5- var { dirname, basename, join } = require ( "path" ) ;
4+ var { unlinkSync } = require ( "fs" ) ;
65var fs = require ( "fs" ) ;
76var ts = require ( "typescript" ) ;
8- var compileConfig = require ( "./apiCompilerConfig.json" ) ;
97
108program
119 . option ( "-i, --input <input>" , "Input YAML schema file path" )
@@ -19,7 +17,20 @@ program
1917const compileApi = ( tsPath , outputPath ) => {
2018 // read ts file
2119 const tsFile = fs . readFileSync ( tsPath , "utf8" ) ;
22- const result = ts . transpile ( tsFile , compileConfig ) ;
20+ const result = ts . transpile ( tsFile , {
21+ target : "ESNext" ,
22+ esModuleInterop : true ,
23+ forceConsistentCasingInFileNames : false ,
24+ strict : false ,
25+ noImplicitAny : false ,
26+ skipLibCheck : true ,
27+ module : "ESNext" ,
28+ declaration : false ,
29+ sourceMap : false ,
30+ moduleResolution : "node" ,
31+ allowSyntheticDefaultImports : true ,
32+ emitDeclarationOnly : false ,
33+ } ) ;
2334 console . log ( "Writing output to " + outputPath ) ;
2435 fs . writeFileSync ( outputPath , result ) ;
2536} ;
0 commit comments