diff options
author | Florian Dold <florian@dold.me> | 2022-02-14 16:51:13 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-02-14 16:52:02 +0100 |
commit | e6c1294c910e6b54d24d62981632cf5e5f79d33f (patch) | |
tree | cd53e923bde518d7a9fa7ace59d5c470661b4834 /packages/pogen/po2.js | |
parent | aa7d48bfb1235ab7c5ca19e814733b7891f382c3 (diff) |
pogen: read files from tsconfig, import po2ts
Diffstat (limited to 'packages/pogen/po2.js')
-rw-r--r-- | packages/pogen/po2.js | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/packages/pogen/po2.js b/packages/pogen/po2.js deleted file mode 100644 index 532a1522f..000000000 --- a/packages/pogen/po2.js +++ /dev/null @@ -1,32 +0,0 @@ -const ts = require("typescript"); - -const configPath = ts.findConfigFile( - /*searchPath*/ "./", - ts.sys.fileExists, - "tsconfig.json" - ); -if (!configPath) { - throw new Error("Could not find a valid 'tsconfig.json'."); -} - -console.log(configPath); - -const cmdline = ts.getParsedCommandLineOfConfigFile(configPath, {}, { - fileExists: ts.sys.fileExists, - getCurrentDirectory: ts.sys.getCurrentDirectory, - onUnRecoverableConfigFileDiagnostic: (e) => console.log(e), - readDirectory: ts.sys.readDirectory, - readFile: ts.sys.readFile, - useCaseSensitiveFileNames: true, -}) - -console.log(cmdline); - -const prog = ts.createProgram({ - options: cmdline.options, - rootNames: cmdline.fileNames, -}); - -const allFiles = prog.getSourceFiles(); - -console.log(allFiles.map(x => x.path));
\ No newline at end of file |