1
1
#! /usr/bin/env node
2
2
var { program } = require ( "commander" ) ;
3
3
var { exec } = require ( "child_process" ) ;
4
- var { renameSync, rmdirSync, unlinkSync } = require ( "fs" ) ;
5
- var { dirname, basename, join } = require ( "path" ) ;
4
+ var { unlinkSync } = require ( "fs" ) ;
6
5
var fs = require ( "fs" ) ;
7
6
var ts = require ( "typescript" ) ;
8
- var compileConfig = require ( "./apiCompilerConfig.json" ) ;
9
7
10
8
program
11
9
. option ( "-i, --input <input>" , "Input YAML schema file path" )
@@ -19,7 +17,20 @@ program
19
17
const compileApi = ( tsPath , outputPath ) => {
20
18
// read ts file
21
19
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
+ } ) ;
23
34
console . log ( "Writing output to " + outputPath ) ;
24
35
fs . writeFileSync ( outputPath , result ) ;
25
36
} ;
0 commit comments