kubb 5.24.1 → 5.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"defineConfig-C6FXk_hU.js","names":[],"sources":["../src/defineConfig.ts"],"sourcesContent":["import type { PossiblePromise } from '@internals/utils'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { applyDefaults } from 'unplugin-kubb'\n\ntype ConfigResult<TInput> = UserConfig<TInput> | Array<UserConfig<TInput>>\ntype ConfigFunction<TInput, TResult extends ConfigResult<TInput>> = (cli: CLIOptions) => PossiblePromise<TResult>\n\nfunction normalizeConfig<TInput>(config: ConfigResult<TInput>): ConfigResult<TInput> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Defines a Kubb build configuration and fills in defaults for any omitted fields.\n *\n * Defaults applied when omitted:\n * - `adapter` → `adapterOas()` (OpenAPI 2.0/3.0/3.1).\n * - `parsers` → `[parserTs(), parserTsx(), parserMd()]`.\n * - `reporters` → `[cliReporter, jsonReporter, fileReporter, htmlReporter]`.\n * - `plugins` → `pluginBarrel()` is appended when not already present.\n * - `output.barrel` → `false` when not set.\n * - `output.format` and `output.lint` → `false`.\n *\n * Accepts a config object, an array of configs, a Promise resolving to one,\n * or a function that receives the parsed CLI options and returns any of the\n * above. The return type is preserved so async/array variants stay typed.\n *\n * Each shape has its own overload so TypeScript checks the config against\n * `UserConfig` directly and reports unknown keys such as a misspelled `output.clean`.\n * The function overloads come first: TypeScript caches the callback's return type after\n * the first overload it tries, so an object overload before them would widen literals\n * such as `barrel: { type: 'named' }` to `string`.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * input: './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [pluginTs()],\n * })\n * ```\n *\n * @example Function form with CLI options\n * ```ts\n * import { defineConfig } from 'kubb'\n *\n * export default defineConfig(({ input }) => ({\n * input: input ?? './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [],\n * }))\n * ```\n */\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, UserConfig<TInput>>): (cli: CLIOptions) => Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, Array<UserConfig<TInput>>>): (cli: CLIOptions) => Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Promise<UserConfig<TInput>>): Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: Promise<Array<UserConfig<TInput>>>): Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Array<UserConfig<TInput>>): Array<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: UserConfig<TInput>): UserConfig<TInput>\nexport function defineConfig<TInput>(\n config: ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ConfigFunction<TInput, ConfigResult<TInput>>,\n): ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ((cli: CLIOptions) => Promise<ConfigResult<TInput>>) {\n if (typeof config === 'function') {\n return async (cli: CLIOptions) => normalizeConfig(await config(cli))\n }\n\n if (config instanceof Promise) {\n return config.then(normalizeConfig)\n }\n\n return normalizeConfig(config)\n}\n"],"mappings":";;;;;;;;AAOA,SAAS,gBAAwB,QAAoD;CACnF,IAAI,MAAM,QAAQ,MAAM,GACtB,OAAO,OAAO,IAAI,aAAa;CAGjC,OAAO,cAAc,MAAM;AAC7B;AAoDA,SAAgB,aACd,QAC6G;CAC7G,IAAI,OAAO,WAAW,YACpB,OAAO,OAAO,QAAoB,gBAAgB,MAAM,OAAO,GAAG,CAAC;CAGrE,IAAI,kBAAkB,SACpB,OAAO,OAAO,KAAK,eAAe;CAGpC,OAAO,gBAAgB,MAAM;AAC/B"}
1
+ {"version":3,"file":"defineConfig-C6FXk_hU.js","names":[],"sources":["../src/defineConfig.ts"],"sourcesContent":["import type { PossiblePromise } from '@internals/utils'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { applyDefaults } from 'unplugin-kubb'\n\nexport type ConfigResult<TInput> = UserConfig<TInput> | Array<UserConfig<TInput>>\nexport type ConfigFunction<TInput, TResult extends ConfigResult<TInput>> = (cli: CLIOptions) => PossiblePromise<TResult>\n\nfunction normalizeConfig<TInput>(config: ConfigResult<TInput>): ConfigResult<TInput> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Defines a Kubb build configuration and fills in defaults for any omitted fields.\n *\n * Defaults applied when omitted:\n * - `adapter` → `adapterOas()` (OpenAPI 2.0/3.0/3.1).\n * - `parsers` → `[parserTs(), parserTsx(), parserMd()]`.\n * - `reporters` → `[cliReporter, jsonReporter, fileReporter, htmlReporter]`.\n * - `plugins` → `pluginBarrel()` is appended when not already present.\n * - `output.barrel` → `false` when not set.\n * - `output.format` and `output.lint` → `false`.\n *\n * Accepts a config object, an array of configs, a Promise resolving to one,\n * or a function that receives the parsed CLI options and returns any of the\n * above. The return type is preserved so async/array variants stay typed.\n *\n * Each shape has its own overload so TypeScript checks the config against\n * `UserConfig` directly and reports unknown keys such as a misspelled `output.clean`.\n * The function overloads come first: TypeScript caches the callback's return type after\n * the first overload it tries, so an object overload before them would widen literals\n * such as `barrel: { type: 'named' }` to `string`.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * input: './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [pluginTs()],\n * })\n * ```\n *\n * @example Function form with CLI options\n * ```ts\n * import { defineConfig } from 'kubb'\n *\n * export default defineConfig(({ input }) => ({\n * input: input ?? './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [],\n * }))\n * ```\n */\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, UserConfig<TInput>>): (cli: CLIOptions) => Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, Array<UserConfig<TInput>>>): (cli: CLIOptions) => Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Promise<UserConfig<TInput>>): Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: Promise<Array<UserConfig<TInput>>>): Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Array<UserConfig<TInput>>): Array<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: UserConfig<TInput>): UserConfig<TInput>\nexport function defineConfig<TInput>(\n config: ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ConfigFunction<TInput, ConfigResult<TInput>>,\n): ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ((cli: CLIOptions) => Promise<ConfigResult<TInput>>) {\n if (typeof config === 'function') {\n return async (cli: CLIOptions) => normalizeConfig(await config(cli))\n }\n\n if (config instanceof Promise) {\n return config.then(normalizeConfig)\n }\n\n return normalizeConfig(config)\n}\n"],"mappings":";;;;;;;;AAOA,SAAS,gBAAwB,QAAoD;CACnF,IAAI,MAAM,QAAQ,MAAM,GACtB,OAAO,OAAO,IAAI,aAAa;CAGjC,OAAO,cAAc,MAAM;AAC7B;AAoDA,SAAgB,aACd,QAC6G;CAC7G,IAAI,OAAO,WAAW,YACpB,OAAO,OAAO,QAAoB,gBAAgB,MAAM,OAAO,GAAG,CAAC;CAGrE,IAAI,kBAAkB,SACpB,OAAO,OAAO,KAAK,eAAe;CAGpC,OAAO,gBAAgB,MAAM;AAC/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"defineConfig-tpUKTeYn.cjs","names":["applyDefaults"],"sources":["../src/defineConfig.ts"],"sourcesContent":["import type { PossiblePromise } from '@internals/utils'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { applyDefaults } from 'unplugin-kubb'\n\ntype ConfigResult<TInput> = UserConfig<TInput> | Array<UserConfig<TInput>>\ntype ConfigFunction<TInput, TResult extends ConfigResult<TInput>> = (cli: CLIOptions) => PossiblePromise<TResult>\n\nfunction normalizeConfig<TInput>(config: ConfigResult<TInput>): ConfigResult<TInput> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Defines a Kubb build configuration and fills in defaults for any omitted fields.\n *\n * Defaults applied when omitted:\n * - `adapter` → `adapterOas()` (OpenAPI 2.0/3.0/3.1).\n * - `parsers` → `[parserTs(), parserTsx(), parserMd()]`.\n * - `reporters` → `[cliReporter, jsonReporter, fileReporter, htmlReporter]`.\n * - `plugins` → `pluginBarrel()` is appended when not already present.\n * - `output.barrel` → `false` when not set.\n * - `output.format` and `output.lint` → `false`.\n *\n * Accepts a config object, an array of configs, a Promise resolving to one,\n * or a function that receives the parsed CLI options and returns any of the\n * above. The return type is preserved so async/array variants stay typed.\n *\n * Each shape has its own overload so TypeScript checks the config against\n * `UserConfig` directly and reports unknown keys such as a misspelled `output.clean`.\n * The function overloads come first: TypeScript caches the callback's return type after\n * the first overload it tries, so an object overload before them would widen literals\n * such as `barrel: { type: 'named' }` to `string`.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * input: './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [pluginTs()],\n * })\n * ```\n *\n * @example Function form with CLI options\n * ```ts\n * import { defineConfig } from 'kubb'\n *\n * export default defineConfig(({ input }) => ({\n * input: input ?? './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [],\n * }))\n * ```\n */\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, UserConfig<TInput>>): (cli: CLIOptions) => Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, Array<UserConfig<TInput>>>): (cli: CLIOptions) => Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Promise<UserConfig<TInput>>): Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: Promise<Array<UserConfig<TInput>>>): Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Array<UserConfig<TInput>>): Array<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: UserConfig<TInput>): UserConfig<TInput>\nexport function defineConfig<TInput>(\n config: ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ConfigFunction<TInput, ConfigResult<TInput>>,\n): ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ((cli: CLIOptions) => Promise<ConfigResult<TInput>>) {\n if (typeof config === 'function') {\n return async (cli: CLIOptions) => normalizeConfig(await config(cli))\n }\n\n if (config instanceof Promise) {\n return config.then(normalizeConfig)\n }\n\n return normalizeConfig(config)\n}\n"],"mappings":";;;;;;;;AAOA,SAAS,gBAAwB,QAAoD;CACnF,IAAI,MAAM,QAAQ,MAAM,GACtB,OAAO,OAAO,IAAIA,cAAAA,aAAa;CAGjC,QAAA,GAAOA,cAAAA,cAAAA,CAAc,MAAM;AAC7B;AAoDA,SAAgB,aACd,QAC6G;CAC7G,IAAI,OAAO,WAAW,YACpB,OAAO,OAAO,QAAoB,gBAAgB,MAAM,OAAO,GAAG,CAAC;CAGrE,IAAI,kBAAkB,SACpB,OAAO,OAAO,KAAK,eAAe;CAGpC,OAAO,gBAAgB,MAAM;AAC/B"}
1
+ {"version":3,"file":"defineConfig-tpUKTeYn.cjs","names":["applyDefaults"],"sources":["../src/defineConfig.ts"],"sourcesContent":["import type { PossiblePromise } from '@internals/utils'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { applyDefaults } from 'unplugin-kubb'\n\nexport type ConfigResult<TInput> = UserConfig<TInput> | Array<UserConfig<TInput>>\nexport type ConfigFunction<TInput, TResult extends ConfigResult<TInput>> = (cli: CLIOptions) => PossiblePromise<TResult>\n\nfunction normalizeConfig<TInput>(config: ConfigResult<TInput>): ConfigResult<TInput> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Defines a Kubb build configuration and fills in defaults for any omitted fields.\n *\n * Defaults applied when omitted:\n * - `adapter` → `adapterOas()` (OpenAPI 2.0/3.0/3.1).\n * - `parsers` → `[parserTs(), parserTsx(), parserMd()]`.\n * - `reporters` → `[cliReporter, jsonReporter, fileReporter, htmlReporter]`.\n * - `plugins` → `pluginBarrel()` is appended when not already present.\n * - `output.barrel` → `false` when not set.\n * - `output.format` and `output.lint` → `false`.\n *\n * Accepts a config object, an array of configs, a Promise resolving to one,\n * or a function that receives the parsed CLI options and returns any of the\n * above. The return type is preserved so async/array variants stay typed.\n *\n * Each shape has its own overload so TypeScript checks the config against\n * `UserConfig` directly and reports unknown keys such as a misspelled `output.clean`.\n * The function overloads come first: TypeScript caches the callback's return type after\n * the first overload it tries, so an object overload before them would widen literals\n * such as `barrel: { type: 'named' }` to `string`.\n *\n * @example\n * ```ts\n * import { defineConfig } from 'kubb'\n * import { pluginTs } from '@kubb/plugin-ts'\n *\n * export default defineConfig({\n * input: './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [pluginTs()],\n * })\n * ```\n *\n * @example Function form with CLI options\n * ```ts\n * import { defineConfig } from 'kubb'\n *\n * export default defineConfig(({ input }) => ({\n * input: input ?? './petStore.yaml',\n * output: { path: './src/gen' },\n * plugins: [],\n * }))\n * ```\n */\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, UserConfig<TInput>>): (cli: CLIOptions) => Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: ConfigFunction<TInput, Array<UserConfig<TInput>>>): (cli: CLIOptions) => Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Promise<UserConfig<TInput>>): Promise<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: Promise<Array<UserConfig<TInput>>>): Promise<Array<UserConfig<TInput>>>\nexport function defineConfig<TInput>(config: Array<UserConfig<TInput>>): Array<UserConfig<TInput>>\nexport function defineConfig<TInput>(config: UserConfig<TInput>): UserConfig<TInput>\nexport function defineConfig<TInput>(\n config: ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ConfigFunction<TInput, ConfigResult<TInput>>,\n): ConfigResult<TInput> | Promise<ConfigResult<TInput>> | ((cli: CLIOptions) => Promise<ConfigResult<TInput>>) {\n if (typeof config === 'function') {\n return async (cli: CLIOptions) => normalizeConfig(await config(cli))\n }\n\n if (config instanceof Promise) {\n return config.then(normalizeConfig)\n }\n\n return normalizeConfig(config)\n}\n"],"mappings":";;;;;;;;AAOA,SAAS,gBAAwB,QAAoD;CACnF,IAAI,MAAM,QAAQ,MAAM,GACtB,OAAO,OAAO,IAAIA,cAAAA,aAAa;CAGjC,QAAA,GAAOA,cAAAA,cAAAA,CAAc,MAAM;AAC7B;AAoDA,SAAgB,aACd,QAC6G;CAC7G,IAAI,OAAO,WAAW,YACpB,OAAO,OAAO,QAAoB,gBAAgB,MAAM,OAAO,GAAG,CAAC;CAGrE,IAAI,kBAAkB,SACpB,OAAO,OAAO,KAAK,eAAe;CAGpC,OAAO,gBAAgB,MAAM;AAC/B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kubb",
3
- "version": "5.24.1",
3
+ "version": "5.25.1",
4
4
  "description": "Turn your API spec into type-safe code. Generate TypeScript types, API clients, hooks, validators and mocks from a spec such as OpenAPI.",
5
5
  "keywords": [
6
6
  "api-client",
@@ -164,18 +164,18 @@
164
164
  "registry": "https://registry.npmjs.org/"
165
165
  },
166
166
  "dependencies": {
167
- "@kubb/adapter-oas": "5.24.1",
168
- "@kubb/ast": "5.24.1",
169
- "@kubb/cli": "5.24.1",
170
- "@kubb/core": "5.24.1",
171
- "@kubb/kit": "5.24.1",
172
- "@kubb/mcp": "5.24.1",
173
- "@kubb/parser-md": "5.24.1",
174
- "@kubb/parser-ts": "5.24.1",
175
- "@kubb/plugin-barrel": "5.24.1",
176
- "@kubb/renderer-jsx": "5.24.1",
177
- "@kubb/studio": "5.24.1",
178
- "unplugin-kubb": "5.24.1"
167
+ "@kubb/adapter-oas": "5.25.1",
168
+ "@kubb/ast": "5.25.1",
169
+ "@kubb/cli": "5.25.1",
170
+ "@kubb/core": "5.25.1",
171
+ "@kubb/kit": "5.25.1",
172
+ "@kubb/mcp": "5.25.1",
173
+ "@kubb/parser-md": "5.25.1",
174
+ "@kubb/parser-ts": "5.25.1",
175
+ "@kubb/plugin-barrel": "5.25.1",
176
+ "@kubb/renderer-jsx": "5.25.1",
177
+ "@kubb/studio": "5.25.1",
178
+ "unplugin-kubb": "5.25.1"
179
179
  },
180
180
  "devDependencies": {
181
181
  "@farmfe/core": "^2.0.1",