From 9e80c212e027796e321e042eedc33a16d3f9fb8c Mon Sep 17 00:00:00 2001 From: TheSumm Date: Thu, 21 Dec 2023 22:16:30 +0100 Subject: [PATCH 1/3] docs: fix links and formatting --- docs/guide/installation.md | 2 +- docs/guide/tutorial/basic.md | 12 ++++++------ docs/plugins/core/globals.md | 6 +++--- docs/plugins/core/index.md | 9 ++++----- docs/plugins/swagger-client/client.md | 10 +++------- docs/plugins/swagger-client/globals.md | 4 ++-- docs/plugins/swagger-ts/index.md | 2 +- docs/plugins/swagger/index.md | 6 +++--- 8 files changed, 23 insertions(+), 28 deletions(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 50b838381..bfcc02988 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -31,7 +31,7 @@ If you are using an older TypeScript version, please migrate to version 4.7 or l ## Latest -You can install Kubb via [NPM](https://www.npmjs.com/). +You can install Kubb via [bun](https://bun.sh/), [pnpm](https://pnpm.io/), [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/). ::: code-group diff --git a/docs/guide/tutorial/basic.md b/docs/guide/tutorial/basic.md index 3015a1d77..09dc17cdc 100644 --- a/docs/guide/tutorial/basic.md +++ b/docs/guide/tutorial/basic.md @@ -7,7 +7,7 @@ outline: deep # Basic tutorial -This tutorial will describe how you can set up Kubb + use the TypeScript plugin to generate types based on the `petStore.yaml` file. +This tutorial will describe how you can set up Kubb and use the [`@kubb/swagger-ts`](/plugins/swagger-ts/) plugin to generate types based on the `petStore.yaml` file. The setup will contain from the beginning the following folder structure: @@ -21,13 +21,13 @@ The setup will contain from the beginning the following folder structure: ## Step one -Set up your `kubb.config.ts`` file based on the [Quick-start](/guide/quick-start). +Set up your `kubb.config.ts` file based on the [Quick start](/guide/quick-start). -We will add here the [Swagger](/plugins/swagger) and [SwaggerTypescript](/plugins/swagger-ts)(which is dependent on the [Swagger](/plugins/swagger) plugin) plugin, those 2 plugins together will generate the TypeScript types. +We will add the plugins [`@kubb/swagger`](/plugins/swagger) and [`@kubb/swagger-ts`](/plugins/swagger-ts)(which is dependent on the [`@kubb/swagger`](/plugins/swagger) plugin). Together these two plugins will generate the TypeScript types. -Next to that, we will also set `output` to false for the [Swagger](/plugins/swagger) plugin because we don't need the plugin to generate the JSON schemas for us. +Next to that, we will also set `output` to false for the [`@kubb/swagger`](/plugins/swagger) plugin because we do not need the plugin to generate the JSON schemas for us. -- For the [SwaggerTypescript](/plugins/swagger-ts) plugin, we will set the `output` to the models folder. +- For the [`@kubb/swagger-ts`](/plugins/swagger-ts/) plugin, we will set the `output` to the `models` folder. ::: code-group @@ -81,7 +81,7 @@ This will result in the following folder structure when Kubb has been executed ## Step two -Update your `package.json` and install `Kubb, see the [installation](/guide/introduction.html#configuration-file). +Update your `package.json` and install `Kubb`, see the [installation](/guide/installation). Your `package.json` will look like this: diff --git a/docs/plugins/core/globals.md b/docs/plugins/core/globals.md index 1675cf247..1fefc2871 100644 --- a/docs/plugins/core/globals.md +++ b/docs/plugins/core/globals.md @@ -9,9 +9,9 @@ outline: deep ## Features -Every plugin of `Kubb` has options and with the global `Kubb`, you can access those options with `KubbJSONPlugins`. +Every plugin of `Kubb` has options and with the global `Kubb`, you can access those options with `Kubb.Plugins`. -See [packages/core/src/globals.d.ts](https://github.com/kubb-project/kubb/blob/main/packages/core/global.d.ts) +See [packages/core/src/globals.d.ts](https://github.com/kubb-project/kubb/blob/main/packages/core/globals.d.ts) ::: code-group @@ -67,5 +67,5 @@ export type SwaggerPluginOptions = Kubb.OptionsPlugins['@kubb/swagger']['options This feature could be useful for: -- Types support for 'kubb' options +- Types support for `Kubb` options - Prototyping diff --git a/docs/plugins/core/index.md b/docs/plugins/core/index.md index 9bab34ec5..04ea7c1c9 100644 --- a/docs/plugins/core/index.md +++ b/docs/plugins/core/index.md @@ -14,15 +14,14 @@ The core contains the building blocks for all plugins. - Read and write to the file system(Windows, Mac and Linux support). - Format code/source with [Prettier](https://prettier.io/). - Types needed to create a plugin and the types needed for the lifecycle/pluginManager. -- Basic utilities such as `isPromise`, [`isURL`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/utils/isURL.ts), [`createJSDocBlockText`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/utils/createJSDocBlockText.ts), `cache`,... +- Basic utilities such as `isPromise`, [`isURL`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/utils/URLPath.ts), [`createJSDocBlockText`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/transformers/createJSDocBlockText.ts), `cache`,... - [`createPlugin`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/plugin.ts) functionality to set up a plugin. - [`defineConfig`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/config.ts) functionality to set up the `kubb.config.js` file. - Abstract classes for plugins - - [`Generator`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/generators/Generator.ts) which contains the base with a getter for `options` and a `build` function. - - [`SchemaGenerator`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/generators/SchemaGenerator.ts) which is a layer on top of the `Generator`. + - [`Generator`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/Generator.ts) which contains the base with a getter for `options` and a `build` function. - Managers classes as the base for all logic - - [`FileManager`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/managers/fileManager/FileManager.ts) which is used to store all files before those are saved to the file system. - - [`PluginManager`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/managers/pluginManager/PluginManager.ts) which contains the logic of when which plugin can be triggered, see [pluginManager](/reference/pluginManager/). + - [`FileManager`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/FileManager.ts) which is used to store all files before those are saved to the file system. + - [`PluginManager`](https://github.com/kubb-project/kubb/blob/main/packages/core/src/PluginManager.ts) which contains the logic of when which plugin can be triggered, see [pluginManager](/reference/pluginManager/). ## Installation diff --git a/docs/plugins/swagger-client/client.md b/docs/plugins/swagger-client/client.md index 17403b3d2..b27d55577 100644 --- a/docs/plugins/swagger-client/client.md +++ b/docs/plugins/swagger-client/client.md @@ -9,12 +9,12 @@ outline: deep ## Features -- Client that is using 'axios' behind the scenes to do REST calls +- Client that is using [Axios](https://axios-http.com/docs/intro) behind the scenes to do REST calls - Override with your own implementation ### Default `client` -By default, `@kubb/swagger-client/client` is getting used as the [`client`](http://localhost:3000/plugins/swagger-client/client#default-client). +By default, `@kubb/swagger-client/client` is getting used as the [`client`](/plugins/swagger-client/client#default-client). ::: code-group @@ -105,7 +105,7 @@ export function addPet export default axiosClient ``` - -## Links - -- [plugins/core/fileManager#getenveource](/plugins/core/fileManager#getenveource) diff --git a/docs/plugins/swagger-client/globals.md b/docs/plugins/swagger-client/globals.md index 9156b471c..b684879ce 100644 --- a/docs/plugins/swagger-client/globals.md +++ b/docs/plugins/swagger-client/globals.md @@ -12,7 +12,7 @@ outline: deep - `AXIOS_BASE` for Axios's `baseURL` - `AXIOS_HEADERS` for Axios's `headers` -See [reference/fileManager#getenveource](/reference/fileManager#getenveource) for more information about how this works in the background. +See [FileManager#getEnvSource](https://github.com/kubb-project/kubb/blob/main/packages/core/src/FileManager.ts) for more information about how this works in the background. ::: code-group <<< @/../packages/swagger-client/src/types.ts{12-15} @@ -56,4 +56,4 @@ This feature could be useful for: ## Links -- [reference#getenveource](/reference#getenveource) +- [FileManager#getEnvSource](https://github.com/kubb-project/kubb/blob/main/packages/core/src/FileManager.ts) diff --git a/docs/plugins/swagger-ts/index.md b/docs/plugins/swagger-ts/index.md index f93a472c7..e54eb473d 100644 --- a/docs/plugins/swagger-ts/index.md +++ b/docs/plugins/swagger-ts/index.md @@ -671,7 +671,7 @@ export default defineConfig({ ### oasType Export an Oas object as Oas type with `import type { Infer } from '@kubb/swagger-ts/oas'`
-See [infer](/plugins/swagger/ts/infer) in how to use the types with `@kubb/swagger-ts/oas`.
+See [infer](/plugins/swagger-ts/infer) in how to use the types with `@kubb/swagger-ts/oas`.
::: info Type: `'infer' | false`
diff --git a/docs/plugins/swagger/index.md b/docs/plugins/swagger/index.md index 9fc47986e..cbc5ac69f 100644 --- a/docs/plugins/swagger/index.md +++ b/docs/plugins/swagger/index.md @@ -19,8 +19,8 @@ The Swagger plugin also contains some classes and functions that can be used in - For example, we have [`getReference`](https://github.com/kubb-project/kubb/blob/main/packages/swagger/src/utils/getReference.ts) that will return the ref based on the spec. -- Next to that we also have the class [`OperationGenerator`](https://github.com/kubb-project/kubb/blob/main/packages/swagger/src/generators/OperationGenerator.ts). This class contains the building blocks of getting the request, response, params, .... -
Just call `this.getSchemas` and you will retreive an object contains all the info you need to set up a TypeScript type, React-Query hook,.... +- Next to that we also have the class [`OperationGenerator`](https://github.com/kubb-project/kubb/blob/main/packages/swagger/src/OperationGenerator.ts). This class contains the building blocks of getting the request, response, params, .... +
Just call `this.getSchemas` and you will retrieve an object contains all the info you need to set up a TypeScript type, React-Query hook,.... ## Installation @@ -48,7 +48,7 @@ yarn add @kubb/swagger ### validate -Validate your input(see kubb.config) based on @apidevtools/swagger-parser +Validate your [`input`](/config/input) based on `@apidevtools/swagger-parser` ::: info Type: `boolean`
Default: `true` From 35190f277220561d638d576d13a30a8ff9d26442 Mon Sep 17 00:00:00 2001 From: TheSumm Date: Thu, 21 Dec 2023 22:26:21 +0100 Subject: [PATCH 2/3] docs: update edit page link --- docs/.vitepress/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index d2f5dff55..373bb66cf 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -543,7 +543,7 @@ export default defineConfig({ }, ], editLink: { - pattern: 'https://github.com/kubb-project/kubb/edit/main/docs/src/:path', + pattern: 'https://github.com/kubb-project/kubb/edit/main/docs/:path', }, sidebar: { '/config': configSidebar, From 8406a50d87d568703771831b45a4a1747acfca1e Mon Sep 17 00:00:00 2001 From: TheSumm Date: Thu, 21 Dec 2023 22:45:29 +0100 Subject: [PATCH 3/3] docs: fix defineConfig import --- docs/plugins/swagger-client/index.md | 28 ++++++++-------- docs/plugins/swagger-faker/index.md | 22 ++++++------- docs/plugins/swagger-msw/index.md | 20 ++++++------ docs/plugins/swagger-swr/index.md | 24 +++++++------- docs/plugins/swagger-tanstack-query/index.md | 34 ++++++++++---------- docs/plugins/swagger-ts/index.md | 34 ++++++++++---------- docs/plugins/swagger-zod/index.md | 12 +++---- docs/plugins/swagger-zodios/index.md | 6 ++-- docs/plugins/swagger/index.md | 12 +++---- 9 files changed, 96 insertions(+), 96 deletions(-) diff --git a/docs/plugins/swagger-client/index.md b/docs/plugins/swagger-client/index.md index 6e5f3a1e3..54a5ec2f5 100644 --- a/docs/plugins/swagger-client/index.md +++ b/docs/plugins/swagger-client/index.md @@ -45,7 +45,7 @@ Default: `'clients'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -83,7 +83,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -121,7 +121,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -198,7 +198,7 @@ Default: `'{{tag}}Service'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -243,7 +243,7 @@ Default: `'@kubb/swagger-client/client'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -308,7 +308,7 @@ Default: `'data'` ::: code-group ```typescript ['data'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -333,7 +333,7 @@ export default defineConfig({ ``` ```typescript ['full'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -396,7 +396,7 @@ Default: `'data'` ::: code-group ```typescript ['object'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -421,7 +421,7 @@ export default defineConfig({ ``` ```typescript ['inline'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -469,7 +469,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -522,7 +522,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -576,7 +576,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -625,7 +625,7 @@ Type: `(name: string, type?: "function" | "type" | "file" ) => string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -684,7 +684,7 @@ Type: `Templates`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' diff --git a/docs/plugins/swagger-faker/index.md b/docs/plugins/swagger-faker/index.md index c2a04669a..67b5d4241 100644 --- a/docs/plugins/swagger-faker/index.md +++ b/docs/plugins/swagger-faker/index.md @@ -47,7 +47,7 @@ Default: `'mocks'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -85,7 +85,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -123,7 +123,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -198,7 +198,7 @@ Default: `'{{tag}}Mocks'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -252,7 +252,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -305,7 +305,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -359,7 +359,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -406,7 +406,7 @@ Type: `(name: string, type?: "function" | "type" | "file" ) => string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -466,7 +466,7 @@ Default: `'string'` ::: code-group ```typescript ['string'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -491,7 +491,7 @@ export default defineConfig({ ``` ```typescript ['date'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' @@ -529,7 +529,7 @@ Type: `'number' | 'number[]'`
::: code-group ```typescript -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerTS from '@kubb/swagger-ts' diff --git a/docs/plugins/swagger-msw/index.md b/docs/plugins/swagger-msw/index.md index 9061f2158..8e1e422ed 100644 --- a/docs/plugins/swagger-msw/index.md +++ b/docs/plugins/swagger-msw/index.md @@ -54,7 +54,7 @@ Type: `string`
Default: `'mocks'` ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -94,7 +94,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -134,7 +134,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -211,7 +211,7 @@ Default: `'{{tag}}Handlers'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -264,7 +264,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -319,7 +319,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -375,7 +375,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -426,7 +426,7 @@ Type: `(name: string) => string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -490,14 +490,14 @@ Type: `Templates`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' import { templates } from './CustomTemplate' -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' diff --git a/docs/plugins/swagger-swr/index.md b/docs/plugins/swagger-swr/index.md index fd3a2b479..d57b77dc5 100644 --- a/docs/plugins/swagger-swr/index.md +++ b/docs/plugins/swagger-swr/index.md @@ -45,7 +45,7 @@ Type: `string`
Default: `'hooks'` ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -83,7 +83,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -121,7 +121,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -198,7 +198,7 @@ Default: `'{{tag}}SWRHooks'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerFaker from '@kubb/swagger-faker' import createSwaggerMsw from '@kubb/swagger-msw' @@ -245,7 +245,7 @@ Default: `'@kubb/swagger-client/client'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -308,7 +308,7 @@ Default: `'data'` ::: code-group ```typescript ['data'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -333,7 +333,7 @@ export default defineConfig({ ``` ```typescript ['full'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -381,7 +381,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -434,7 +434,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -488,7 +488,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerClient from '@kubb/swagger-client' import createSwaggerTS from '@kubb/swagger-ts' @@ -537,7 +537,7 @@ Type: `(name: string, type?: "function" | "type" | "file" ) => string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' @@ -600,7 +600,7 @@ Type: `Templates`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerSwr from '@kubb/swagger-swr' import createSwaggerTS from '@kubb/swagger-ts' diff --git a/docs/plugins/swagger-tanstack-query/index.md b/docs/plugins/swagger-tanstack-query/index.md index 96688ef10..d71abced0 100644 --- a/docs/plugins/swagger-tanstack-query/index.md +++ b/docs/plugins/swagger-tanstack-query/index.md @@ -58,7 +58,7 @@ Default: `'hooks'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -94,7 +94,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -130,7 +130,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -205,7 +205,7 @@ Default: `'{{tag}}Hooks'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -250,7 +250,7 @@ Default: `'@kubb/swagger-client/client'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -315,7 +315,7 @@ Default: `'data'` ::: code-group ```typescript ['data'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -340,7 +340,7 @@ export default defineConfig({ ``` ```typescript ['full'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -378,7 +378,7 @@ Default: `'react'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -436,7 +436,7 @@ Type: `Infinite`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -470,7 +470,7 @@ Default: `'id'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -508,7 +508,7 @@ Default: `'0'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -554,7 +554,7 @@ Type: `Suspense`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -598,7 +598,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -651,7 +651,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -705,7 +705,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -754,7 +754,7 @@ Type: `(name: string, type?: "function" | "type" | "file" ) => string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' @@ -815,7 +815,7 @@ Type: `Templates`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTanstackQuery from '@kubb/swagger-tanstack-query' import createSwaggerTS from '@kubb/swagger-ts' diff --git a/docs/plugins/swagger-ts/index.md b/docs/plugins/swagger-ts/index.md index e54eb473d..c8d550ea4 100644 --- a/docs/plugins/swagger-ts/index.md +++ b/docs/plugins/swagger-ts/index.md @@ -47,7 +47,7 @@ Default: `'types'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -81,7 +81,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -115,7 +115,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -177,7 +177,7 @@ Default: `'${output}/{{tag}}Controller'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -243,7 +243,7 @@ Default: `'asConst'` ::: code-group ```typescript ['enum'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -264,7 +264,7 @@ export default defineConfig({ ``` ```typescript ['asConst'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -285,7 +285,7 @@ export default defineConfig({ ``` ```typescript ['asPascalConst'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -331,7 +331,7 @@ Type: `'string' | 'date'`
Default: `'string'` ```typescript ['string'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -352,7 +352,7 @@ export default defineConfig({ ``` ```typescript ['date'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -404,7 +404,7 @@ Default: `'questionToken'` ::: code-group ```typescript ['questionToken'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -425,7 +425,7 @@ export default defineConfig({ ``` ```typescript ['undefined'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -446,7 +446,7 @@ export default defineConfig({ ``` ```typescript ['questionTokenAndUndefined'] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -490,7 +490,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -541,7 +541,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -593,7 +593,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -640,7 +640,7 @@ Type: `(name: string, type?: "function" | "type" | "file" ) => string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' @@ -679,7 +679,7 @@ Type: `'infer' | false`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerTS from '@kubb/swagger-ts' diff --git a/docs/plugins/swagger-zod/index.md b/docs/plugins/swagger-zod/index.md index 3752bde79..2f8f4ec1a 100644 --- a/docs/plugins/swagger-zod/index.md +++ b/docs/plugins/swagger-zod/index.md @@ -45,7 +45,7 @@ Default: `'zod'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' @@ -111,7 +111,7 @@ Default: `'{{tag}}Schemas'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' @@ -160,7 +160,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' @@ -211,7 +211,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' @@ -263,7 +263,7 @@ Type: `Array`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' @@ -311,7 +311,7 @@ Type: `(name: string, type?: "function" | "type" | "file" ) => string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' diff --git a/docs/plugins/swagger-zodios/index.md b/docs/plugins/swagger-zodios/index.md index c6be8a435..0d3497d99 100644 --- a/docs/plugins/swagger-zodios/index.md +++ b/docs/plugins/swagger-zodios/index.md @@ -48,7 +48,7 @@ Default: `'zodios.ts'` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' import createSwaggerZodios from '@kubb/swagger-zodios' @@ -86,7 +86,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' import createSwaggerZodios from '@kubb/swagger-zodios' @@ -124,7 +124,7 @@ Type: `string`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' import createSwaggerZod from '@kubb/swagger-zod' import createSwaggerZodios from '@kubb/swagger-zodios' diff --git a/docs/plugins/swagger/index.md b/docs/plugins/swagger/index.md index cbc5ac69f..6ad4f2443 100644 --- a/docs/plugins/swagger/index.md +++ b/docs/plugins/swagger/index.md @@ -56,7 +56,7 @@ Default: `true` ::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' export default defineConfig({ @@ -88,7 +88,7 @@ Default: `'schemas'` ::: code-group ```typescript [output string] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' export default defineConfig({ @@ -109,7 +109,7 @@ export default defineConfig({ ``` ```typescript [output false] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' export default defineConfig({ @@ -155,7 +155,7 @@ servers: ``` ```typescript [serverIndex 0] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' export default defineConfig({ @@ -172,7 +172,7 @@ export default defineConfig({ ``` ```typescript [serverIndex 1] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' export default defineConfig({ @@ -208,7 +208,7 @@ Type: `ContentType`
::: code-group ```typescript [kubb.config.js] -import { defineConfig } from '@kubb/swagger' +import { defineConfig } from '@kubb/core' import createSwagger from '@kubb/swagger' export default defineConfig({