feat: emit json schema in npm package
This commit is contained in:
parent
8613de6078
commit
9849e046a9
1 changed files with 30 additions and 7 deletions
14
scripts/build-dxt-schema.js
Normal file
14
scripts/build-dxt-schema.js
Normal 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",
|
||||
},
|
||||
);
|
||||
Loading…
Reference in a new issue