mirror of
https://github.com/nicotsx/zerobyte.git
synced 2026-06-15 12:00:29 -04:00
21 lines
693 B
TypeScript
21 lines
693 B
TypeScript
import { execFileSync } from "node:child_process";
|
|
import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts";
|
|
|
|
const openApiInput = `${execFileSync("portless", ["get", "zerobyte"], { encoding: "utf8" }).trim().replace(/\/$/, "")}/api/v1/openapi.json`;
|
|
|
|
export default defineConfig({
|
|
input: openApiInput,
|
|
output: {
|
|
path: "./app/client/api-client",
|
|
header: ["// @ts-nocheck", "// This file is auto-generated by @hey-api/openapi-ts"],
|
|
postProcess: [
|
|
{
|
|
command: "vp",
|
|
args: ["fmt", "--write", "{{path}}"],
|
|
},
|
|
{ command: "node", args: ["scripts/patch-api-client.ts"] },
|
|
],
|
|
},
|
|
plugins: [...defaultPlugins, "@tanstack/react-query", "@hey-api/client-fetch"],
|
|
});
|