Skip to content

Commit

Permalink
Merge pull request #8 from aabidsofi19/fix/compilerOptions
Browse files Browse the repository at this point in the history
fix compiler options to export as esnext
  • Loading branch information
aabidsofi19 authored Dec 20, 2023
2 parents 2d11e09 + c06c19e commit 4820d25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
19 changes: 0 additions & 19 deletions src/apiCompilerConfig.json

This file was deleted.

19 changes: 15 additions & 4 deletions src/app.js
Original file line number Diff line number Diff line change
@@ -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>", "Input YAML schema file path")
Expand All @@ -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);
};
Expand Down

0 comments on commit 4820d25

Please sign in to comment.