Skip to content

Commit

Permalink
chore(schemas): tweaks to the schema generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Kiyo5hi committed Mar 27, 2024
1 parent e42d097 commit 36ea57d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/generateSchemas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { TypeScriptToTypeBox } from "@sinclair/typebox-codegen";

const types = await Bun.file("./types.ts").text();
if (Bun.argv.length < 3) {
console.error("Usage: bun run scripts/generateSchemas.ts <path/to/types.ts>");
process.exit(1);
}

const types = await Bun.file(Bun.argv.at(-1) as string).text();
const schemas = TypeScriptToTypeBox.Generate(types);
console.log(schemas);

0 comments on commit 36ea57d

Please sign in to comment.