-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbackend-kubb.config.ts
More file actions
62 lines (61 loc) · 1.77 KB
/
backend-kubb.config.ts
File metadata and controls
62 lines (61 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { defineConfig } from '@kubb/core'
import { pluginOas } from '@kubb/plugin-oas'
import { pluginTs } from '@kubb/plugin-ts'
import { pluginReactQuery } from '@kubb/plugin-react-query'
import { pluginZod } from '@kubb/plugin-zod'
export default defineConfig(() => {
return {
name: 'backend-api',
input: {
path: './specs/backend-openapi.json',
},
output: {
barrelType: 'named',
clean: true,
path: './generated/backend',
},
plugins: [
pluginOas({
output: {
path: 'schemas',
barrelType: false,
},
}),
pluginTs({
enumType: 'literal',
output: {
path: 'types',
barrelType: 'named',
},
unknownType: 'unknown',
}),
pluginReactQuery({
client: {
importPath: '../../../backend-query-client',
},
output: {
path: 'hooks',
barrelType: 'named',
},
infinite: {
cursorParam: 'next',
queryParam: 'cursor',
initialPageParam: '',
},
paramsType: 'object',
pathParamsType: 'object',
parser: 'client',
}),
pluginZod({
output: {
path: 'zod',
barrelType: 'named',
},
typed: false,
unknownType: 'unknown',
inferred: true,
dateType: false,
}),
],
}
})