feat: add hey-api configuration and update OpenAPI TypeScript plugin settings
This commit is contained in:
@ -1,35 +0,0 @@
|
|||||||
/** @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig} */
|
|
||||||
const config = {
|
|
||||||
printWidth: 100,
|
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: 'es5',
|
|
||||||
plugins: ['@ianvs/prettier-plugin-sort-imports'],
|
|
||||||
importOrder: [
|
|
||||||
'.*styles.css$',
|
|
||||||
'',
|
|
||||||
'dayjs',
|
|
||||||
'^react$',
|
|
||||||
'^next$',
|
|
||||||
'^next/.*$',
|
|
||||||
'<BUILTIN_MODULES>',
|
|
||||||
'<THIRD_PARTY_MODULES>',
|
|
||||||
'^@mantine/(.*)$',
|
|
||||||
'^@mantinex/(.*)$',
|
|
||||||
'^@mantine-tests/(.*)$',
|
|
||||||
'^@docs/(.*)$',
|
|
||||||
'^@/.*$',
|
|
||||||
'^../(?!.*.css$).*$',
|
|
||||||
'^./(?!.*.css$).*$',
|
|
||||||
'\\.css$',
|
|
||||||
],
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: '*.mdx',
|
|
||||||
options: {
|
|
||||||
printWidth: 70,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
|
|
||||||
export default config;
|
|
||||||
@ -3,10 +3,26 @@ import { defineConfig } from "@hey-api/openapi-ts";
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
input: "http://localhost:8000/openapi.json",
|
input: "http://localhost:8000/openapi.json",
|
||||||
output: "src/client",
|
output: "src/client",
|
||||||
|
|
||||||
plugins: [
|
plugins: [
|
||||||
"@hey-api/client-axios",
|
"@hey-api/client-axios",
|
||||||
"@hey-api/client-next",
|
|
||||||
"@tanstack/react-query",
|
"@tanstack/react-query",
|
||||||
"zod"
|
"@hey-api/typescript",
|
||||||
|
{
|
||||||
|
name: "zod",
|
||||||
|
requests: true,
|
||||||
|
responses: true,
|
||||||
|
definitions: true,
|
||||||
|
metadata: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "@hey-api/sdk",
|
||||||
|
asClass: false,
|
||||||
|
validator: "zod",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "@hey-api/client-next",
|
||||||
|
runtimeConfigPath: "./src/hey-api-config.ts",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|||||||
6
src/hey-api-config.ts
Normal file
6
src/hey-api-config.ts
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import type { CreateClientConfig } from './client/client.gen';
|
||||||
|
|
||||||
|
export const createClientConfig: CreateClientConfig = (config) => ({
|
||||||
|
...config,
|
||||||
|
baseUrl: 'http://crm.logidex.ru/api',
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user