diff --git a/src/apiCompilerConfig.json b/src/apiCompilerConfig.json deleted file mode 100644 index d483409..0000000 --- a/src/apiCompilerConfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": false, - "strict": false, - "noImplicitAny": false, - "skipLibCheck": true, - "module": "ESNext", - "declaration": false, - "sourceMap": false, - "moduleResolution": "node", - "allowSyntheticDefaultImports": true, - "emitDeclarationOnly": false, - "allowJs": true, - "outDir": "./dist" - }, - "files": ["api.ts"] -} diff --git a/src/app.js b/src/app.js index a8e01e6..77c8071 100755 --- a/src/app.js +++ b/src/app.js @@ -1,11 +1,9 @@ #! /usr/bin/env node var { program } = require("commander"); var { exec } = require("child_process"); -var { renameSync, rmdirSync, unlinkSync } = require("fs"); -var { dirname, basename, join } = require("path"); +var { unlinkSync } = require("fs"); var fs = require("fs"); var ts = require("typescript"); -var compileConfig = require("./apiCompilerConfig.json"); program .option("-i, --input ", "Input YAML schema file path") @@ -19,7 +17,20 @@ program const compileApi = (tsPath, outputPath) => { // read ts file const tsFile = fs.readFileSync(tsPath, "utf8"); - const result = ts.transpile(tsFile, compileConfig); + const result = ts.transpile(tsFile, { + target: "ESNext", + esModuleInterop: true, + forceConsistentCasingInFileNames: false, + strict: false, + noImplicitAny: false, + skipLibCheck: true, + module: "ESNext", + declaration: false, + sourceMap: false, + moduleResolution: "node", + allowSyntheticDefaultImports: true, + emitDeclarationOnly: false, + }); console.log("Writing output to " + outputPath); fs.writeFileSync(outputPath, result); };