Skip to content

Commit 675ecba

Browse files
authored
chore: Update Hey API OpenAPI TS to 0.99 (#197)
1 parent d5197f9 commit 675ecba

3 files changed

Lines changed: 54 additions & 40 deletions

File tree

package-lock.json

Lines changed: 42 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
},
7777
"devDependencies": {
7878
"@eslint/js": "^10.0.1",
79-
"@hey-api/openapi-ts": "^0.98.0",
79+
"@hey-api/openapi-ts": "^0.99.0",
8080
"@types/node": "^26.0.0",
8181
"@types/ws": "^8.5.13",
8282
"@typescript-eslint/eslint-plugin": "^8.57.1",

scripts/generate.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/env node
22

33
import { createClient } from "@hey-api/openapi-ts";
4+
import {
5+
transformers,
6+
typescript as typescriptPlugin,
7+
zod as zodPlugin,
8+
} from "@hey-api/openapi-ts/plugins";
49
import * as fs from "fs/promises";
510
import { dirname } from "path";
611
import * as prettier from "prettier";
@@ -39,13 +44,12 @@ async function main() {
3944
postProcess: ["prettier"],
4045
},
4146
plugins: [
42-
{
47+
zodPlugin({
4348
compatibilityVersion: 4,
44-
name: "zod",
45-
"~resolvers": createDeserializationResolvers(),
46-
},
47-
{ bigInt: false, name: "@hey-api/transformers" },
48-
"@hey-api/typescript",
49+
$resolvers: createDeserializationResolvers(),
50+
}),
51+
transformers({ bigInt: false }),
52+
typescriptPlugin(),
4953
],
5054
});
5155

@@ -205,7 +209,7 @@ function createDeserializationResolvers() {
205209
return undefined;
206210
}
207211

208-
ctx.chain.current = ctx.$(ctx.symbols.z).attr("number").call();
212+
ctx.chain.current = ctx.$(ctx.plugin.imports.z).attr("number").call();
209213
return ctx.chain.current;
210214
},
211215

0 commit comments

Comments
 (0)