Skip to content

Commit 947860e

Browse files
authored
Merge pull request #3551 from hey-api/refactor/dev-presets
refactor: remove plugins file
2 parents 13fcece + eb67057 commit 947860e

File tree

4 files changed

+61
-103
lines changed

4 files changed

+61
-103
lines changed

dev/python/plugins.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

dev/python/presets.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
import type { PluginConfig } from './plugins';
2-
import { pydantic, sdk } from './plugins';
1+
import type { UserConfig } from '@hey-api/openapi-python';
2+
3+
export type PluginConfig = NonNullable<NonNullable<UserConfig['plugins']>[number]>;
34

45
export const presets = {
56
sdk: () => [
67
/** SDK */
7-
sdk({
8+
{
9+
name: '@hey-api/python-sdk',
810
operations: {
911
containerName: 'OpenCode',
1012
strategy: 'single',
1113
},
1214
paramsStructure: 'flat',
13-
}),
15+
},
1416
],
1517
validated: () => [
1618
/** SDK + Pydantic validation */
17-
sdk({
19+
{
20+
name: '@hey-api/python-sdk',
1821
paramsStructure: 'flat',
19-
}),
20-
pydantic(),
22+
},
23+
'pydantic',
2124
],
2225
} as const satisfies Record<string, () => ReadonlyArray<PluginConfig>>;
2326

dev/typescript/plugins.ts

Lines changed: 0 additions & 57 deletions
This file was deleted.

dev/typescript/presets.ts

Lines changed: 51 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,75 @@
1-
import type { PluginConfig } from './plugins';
2-
import { sdk, tanstackReactQuery, transformers, typescript, valibot, zod } from './plugins';
1+
import type { UserConfig } from '@hey-api/openapi-ts';
2+
3+
export type PluginConfig = NonNullable<NonNullable<UserConfig['plugins']>[number]>;
34

45
export const presets = {
6+
angular: () => [
7+
{
8+
httpRequests: 'flat',
9+
name: '@angular/common',
10+
},
11+
],
512
full: () => [
613
/** Full kitchen sink for comprehensive testing */
7-
typescript(),
8-
sdk({ paramsStructure: 'flat' }),
9-
transformers(),
10-
zod({ metadata: true }),
11-
tanstackReactQuery({ queryKeys: { tags: true } }),
14+
'@hey-api/typescript',
15+
{
16+
name: '@hey-api/sdk',
17+
paramsStructure: 'flat',
18+
},
19+
'@hey-api/transformers',
20+
{
21+
metadata: true,
22+
name: 'zod',
23+
},
24+
{
25+
name: '@tanstack/react-query',
26+
queryKeys: {
27+
tags: true,
28+
},
29+
},
1230
],
1331
sdk: () => [
1432
/** SDK with types */
15-
typescript(),
16-
sdk({
33+
'@hey-api/typescript',
34+
{
35+
name: '@hey-api/sdk',
1736
operations: {
1837
containerName: 'OpenCode',
1938
strategy: 'single',
2039
},
2140
paramsStructure: 'flat',
22-
}),
41+
},
2342
],
2443
tanstack: () => [
2544
/** SDK + TanStack Query */
26-
typescript(),
27-
sdk(),
28-
tanstackReactQuery({ queryKeys: { tags: true } }),
45+
'@hey-api/typescript',
46+
'@hey-api/sdk',
47+
{
48+
name: '@tanstack/react-query',
49+
queryKeys: {
50+
tags: true,
51+
},
52+
},
2953
],
3054
types: () => [
3155
/** Just types, nothing else */
32-
typescript(),
56+
'@hey-api/typescript',
3357
],
3458
validated: () => [
3559
/** SDK + Zod validation */
36-
typescript(),
37-
sdk({ validator: 'zod' }),
38-
valibot({ metadata: true }),
39-
zod({ metadata: true }),
60+
'@hey-api/typescript',
61+
{
62+
name: '@hey-api/sdk',
63+
validator: 'zod',
64+
},
65+
{
66+
metadata: true,
67+
name: 'valibot',
68+
},
69+
{
70+
metadata: true,
71+
name: 'zod',
72+
},
4073
],
4174
} as const satisfies Record<string, () => ReadonlyArray<PluginConfig>>;
4275

0 commit comments

Comments
 (0)