feat: also emit dxt signature info schema (#44)
This commit is contained in:
parent
9ce2d6fd0e
commit
2654e313b9
1 changed files with 30 additions and 18 deletions
|
|
@ -1,14 +1,23 @@
|
|||
import { DxtManifestSchema } from "../src/schemas.ts";
|
||||
import { DxtManifestSchema, DxtSignatureInfoSchema } 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);
|
||||
const schemasToWrite = {
|
||||
'dxt-manifest': DxtManifestSchema,
|
||||
'dxt-signature-info': DxtSignatureInfoSchema
|
||||
}
|
||||
|
||||
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",
|
||||
},
|
||||
);
|
||||
|
||||
for (const key in schemasToWrite) {
|
||||
const schema = z.toJSONSchema(schemasToWrite[key]);
|
||||
await fs.writeFile(
|
||||
path.join(import.meta.dirname, "../dist", `${key}.schema.json`),
|
||||
JSON.stringify(schema, null, 2),
|
||||
{
|
||||
encoding: "utf8",
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue