import { parse } from "./src/swc.ts";
import { basename } from "https://deno.land/std@0.159.0/path/posix.ts?s=basename";

const input = Deno.readTextFileSync(Deno.args[0]);
const ast = parse(input, { syntax: "typescript", target: "es2020" });
const json = JSON.stringify(ast, null, 2);
Deno.writeTextFileSync(basename(Deno.args[0]) + ".ast.json", json);