feat: emit json schema in npm package

This commit is contained in:
Alex Yang 2025-07-03 15:45:39 -07:00 • committed by GitHub
commit 9849e046a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,14 @@
import { DxtManifestSchema } from "../src/schemas.ts";
import * as z from "zod/v4";
import fs from "node:fs/promises";
import path from "node:path";
const schema = z.toJSONSchema(DxtManifestSchema);
await fs.mkdir(path.join(import.meta.dirname, "../dist"), { recursive: true });
await fs.writeFile(
path.join(import.meta.dirname, "../dist", "dxt-manifest.schema.json"),
JSON.stringify(schema, null, 2),
{
encoding: "utf8",
},
);