Skip to content

Commit b026369

Browse files
authored
feat(hey-api): adapt and improve compatibility (#593)
1 parent c493220 commit b026369

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

.github/dependabot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ updates:
77
interval: daily
88
versioning-strategy: increase
99
groups:
10+
hey-api:
11+
patterns:
12+
- '@hey-api/*'
1013
dev-dependencies-minor-patch:
1114
dependency-type: development
1215
update-types:

apps/content/docs/integrations/hey-api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ description: Easily convert a Hey API generated client into an oRPC client to ta
77

88
Easily convert a [Hey API](https://heyapi.dev/) generated client into an oRPC client to take full advantage of the oRPC ecosystem.
99

10+
::: warning
11+
[Hey API](https://heyapi.dev/) is still in an unstable stage. As a result, this integration may introduce breaking changes in the future to keep up with its ongoing development.
12+
:::
13+
1014
## Installation
1115

1216
::: code-group

apps/content/docs/integrations/pinia-colada.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This documentation assumes you are already familiar with [Pinia Colada](https://
1212
:::
1313

1414
::: warning
15-
[Pinia Colada](https://pinia-colada.esm.dev/) is still in an unstable stage. As a result, oRPC's integration with Pinia Colada may introduce breaking changes in the future to keep up with its ongoing development.
15+
[Pinia Colada](https://pinia-colada.esm.dev/) is still in an unstable stage. As a result, this integration may introduce breaking changes in the future to keep up with its ongoing development.
1616
:::
1717

1818
## Installation

packages/hey-api/package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,12 @@
3535
"type:check": "tsc -b",
3636
"prepare": "openapi-ts -i ./tests/spec.json -o ./tests/client -c @hey-api/client-fetch"
3737
},
38-
"peerDependencies": {
39-
"@hey-api/client-fetch": "*"
40-
},
4138
"dependencies": {
4239
"@orpc/client": "workspace:*",
4340
"@orpc/shared": "workspace:*"
4441
},
4542
"devDependencies": {
46-
"@hey-api/client-fetch": "^0.10.1",
43+
"@hey-api/client-fetch": "^0.11.0",
4744
"@hey-api/openapi-ts": "^0.69.2"
4845
}
4946
}

packages/hey-api/src/to-orpc-client.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import type { RequestResult } from '@hey-api/client-fetch'
21
import type { Client, ThrowableError } from '@orpc/client'
32

43
export type experimental_ToORPCClientResult<T extends Record<string, any>> = {
54
[K in keyof T]:
65
T[K] extends (options: infer UInput extends Record<any, any> | undefined)
7-
=> RequestResult<infer USuccessResponse extends Record<number, any> | undefined, any, any>
6+
=> Promise<infer UResult>
87
? Client<Record<never, never>, UInput, {
9-
body: Exclude<USuccessResponse, undefined>[keyof Exclude<USuccessResponse, undefined>]
8+
body: UResult extends { data: infer USuccess } ? Exclude<USuccess, undefined> : never
109
request: Request
1110
response: Response
1211
}, ThrowableError>

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)