Skip to content

feat: TypeScript client generation#219

Open
madkarmaa wants to merge 6 commits intodevfrom
feat/ts-client
Open

feat: TypeScript client generation#219
madkarmaa wants to merge 6 commits intodevfrom
feat/ts-client

Conversation

@madkarmaa
Copy link
Member

@madkarmaa madkarmaa commented Mar 22, 2026

This PR adds automatic generation of a TypeScript client for the API, using @hey-api/openapi-ts.

How to

bun run gen:client:ts <resource>

A resource can be anything of what's listed here.

Example

bun run dev
bun run gen:client:ts http://localhost:8787/v5/openapi

Copilot AI review requested due to automatic review settings March 22, 2026 19:03
@madkarmaa madkarmaa requested a review from oSumAtrIX March 22, 2026 19:04
@madkarmaa madkarmaa self-assigned this Mar 22, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an auto-generated TypeScript SDK/client for the API using @hey-api/openapi-ts, intended to make consuming the /v5 endpoints easier and keep types in sync with the OpenAPI spec.

Changes:

  • Add generated API types (types.gen.ts) and endpoint SDK functions (sdk.gen.ts) under src/client/.
  • Add generated core client runtime (fetch client, serializers, SSE support) under src/client/client and src/client/core.
  • Add @hey-api/openapi-ts dev dependency and a build:client:ts script; update .gitignore for generator error logs.

Reviewed changes

Copilot reviewed 17 out of 19 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/client/types.gen.ts Generated API domain + endpoint request/response types
src/client/sdk.gen.ts Generated typed functions for calling API endpoints
src/client/index.ts Barrel exports for SDK functions and types
src/client/core/*.gen.ts Generated shared runtime utilities (auth, serializers, SSE, etc.)
src/client/client/*.gen.ts Generated fetch-based client implementation + config/types
src/client/client.gen.ts Creates default client instance targeting https://api.revanced.app
package.json Adds generator dependency and script; bumps @hono/zod-openapi
bun.lock Lockfile updates for new/updated dependencies
.gitignore Ignores openapi-ts error log artifacts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 24 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 24 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"module": "./dist/index.js",
"peerDependencies": {
"typescript": "^5.9.3"
},
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typescript is listed only as a peerDependency, but this package’s build script runs tsc. Peer deps are not installed automatically, so building client/ts in isolation (or in some CI setups) can fail unless TypeScript is provided externally. Consider adding typescript to devDependencies (optionally keeping it as a peer as well if you plan to publish).

Suggested change
},
},
"devDependencies": {
"typescript": "^5.9.3"
},

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants