kubb 5.0.0-alpha.53 → 5.0.0-alpha.55
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.
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/src/defineConfig.ts +2 -0
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#endregion
|
|
3
3
|
let _kubb_adapter_oas = require("@kubb/adapter-oas");
|
|
4
|
+
let _kubb_middleware_barrel = require("@kubb/middleware-barrel");
|
|
4
5
|
let _kubb_parser_ts = require("@kubb/parser-ts");
|
|
5
6
|
//#region ../../internals/utils/src/promise.ts
|
|
6
7
|
/** Returns `true` when `result` is a thenable `Promise`.
|
|
@@ -26,7 +27,8 @@ function applyDefaults(config) {
|
|
|
26
27
|
return {
|
|
27
28
|
...config,
|
|
28
29
|
adapter: config.adapter ?? (0, _kubb_adapter_oas.adapterOas)(),
|
|
29
|
-
parsers: config.parsers?.length ? config.parsers : [_kubb_parser_ts.parserTs, _kubb_parser_ts.parserTsx]
|
|
30
|
+
parsers: config.parsers?.length ? config.parsers : [_kubb_parser_ts.parserTs, _kubb_parser_ts.parserTsx],
|
|
31
|
+
middleware: config.middleware?.length ? config.middleware : [_kubb_middleware_barrel.middlewareBarrel]
|
|
30
32
|
};
|
|
31
33
|
}
|
|
32
34
|
function normalizeConfig(config) {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["parserTs","parserTsx"],"sources":["../../../internals/utils/src/promise.ts","../src/defineConfig.ts"],"sourcesContent":["/** A value that may already be resolved or still pending.\n *\n * @example\n * ```ts\n * function load(id: string): PossiblePromise<string> {\n * return cache.get(id) ?? fetchRemote(id)\n * }\n * ```\n */\nexport type PossiblePromise<T> = Promise<T> | T\n\n/** Returns `true` when `result` is a thenable `Promise`.\n *\n * @example\n * ```ts\n * isPromise(Promise.resolve(1)) // true\n * isPromise(42) // false\n * ```\n */\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return result !== null && result !== undefined && typeof (result as Record<string, unknown>)['then'] === 'function'\n}\n\n/** Returns `true` when `result` is a fulfilled `Promise.allSettled` result.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseFulfilledResult).map((r) => r.value)\n * ```\n */\nexport function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled'\n}\n\n/** Returns `true` when `result` is a rejected `Promise.allSettled` result with a typed `reason`.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseRejectedResult<Error>).map((r) => r.reason.message)\n * ```\n */\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","import { isPromise, type PossiblePromise } from '@internals/utils'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\n\ntype AnyConfigResult = UserConfig<any> | Array<UserConfig<any>>\ntype ConfigInput = AnyConfigResult | Promise<AnyConfigResult> | ((cli: CLIOptions) => PossiblePromise<AnyConfigResult>)\ntype NormalizeConfig<TConfig> =\n TConfig extends Array<UserConfig<infer TInput>> ? Array<UserConfig<TInput>> : TConfig extends UserConfig<infer TInput> ? UserConfig<TInput> : never\ntype DefinedConfig<TConfig extends ConfigInput> = TConfig extends (cli: CLIOptions) => PossiblePromise<infer TResult>\n ? (cli: CLIOptions) => Promise<NormalizeConfig<TResult>>\n : TConfig extends Promise<infer TResult>\n ? Promise<NormalizeConfig<TResult>>\n : NormalizeConfig<TConfig>\n\n/**\n * Applies default adapter and parsers to a single user config when not set.\n *\n * - `adapter` defaults to `adapterOas()`\n * - `parsers` defaults to `[parserTs, parserTsx]`\n */\nfunction applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput> {\n return {\n ...config,\n adapter: config.adapter ?? adapterOas(),\n parsers: config.parsers?.length ? config.parsers : [parserTs, parserTsx],\n }\n}\n\nfunction normalizeConfig<TInput>(config: UserConfig<TInput> | Array<UserConfig<TInput>>): UserConfig<TInput> | Array<UserConfig<TInput>> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Helper for defining a Kubb configuration with built-in defaults.\n *\n * When no `adapter` is provided, `adapterOas()` is used automatically.\n * When no `parsers` are provided, `[parserTsx]` is used automatically.\n *\n * Accepts either:\n * - A config object or array of configs\n * - A function returning the config(s), optionally async,\n * receiving the CLI options as argument\n *\n * @example\n * export default defineConfig(({ logLevel }) => ({\n * root: 'src',\n * plugins: [myPlugin()],\n * }))\n */\nexport function defineConfig<TConfig extends ConfigInput>(config: TConfig): DefinedConfig<TConfig> {\n if (typeof config === 'function') {\n return (async (cli: CLIOptions) => {\n return normalizeConfig(await config(cli))\n }) as DefinedConfig<TConfig>\n }\n\n if (isPromise(config)) {\n return config.then((resolved) => normalizeConfig(resolved)) as DefinedConfig<TConfig>\n }\n\n return normalizeConfig(config) as DefinedConfig<TConfig>\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["parserTs","parserTsx","middlewareBarrel"],"sources":["../../../internals/utils/src/promise.ts","../src/defineConfig.ts"],"sourcesContent":["/** A value that may already be resolved or still pending.\n *\n * @example\n * ```ts\n * function load(id: string): PossiblePromise<string> {\n * return cache.get(id) ?? fetchRemote(id)\n * }\n * ```\n */\nexport type PossiblePromise<T> = Promise<T> | T\n\n/** Returns `true` when `result` is a thenable `Promise`.\n *\n * @example\n * ```ts\n * isPromise(Promise.resolve(1)) // true\n * isPromise(42) // false\n * ```\n */\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return result !== null && result !== undefined && typeof (result as Record<string, unknown>)['then'] === 'function'\n}\n\n/** Returns `true` when `result` is a fulfilled `Promise.allSettled` result.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseFulfilledResult).map((r) => r.value)\n * ```\n */\nexport function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled'\n}\n\n/** Returns `true` when `result` is a rejected `Promise.allSettled` result with a typed `reason`.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseRejectedResult<Error>).map((r) => r.reason.message)\n * ```\n */\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","import { isPromise, type PossiblePromise } from '@internals/utils'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { middlewareBarrel } from '@kubb/middleware-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\n\ntype AnyConfigResult = UserConfig<any> | Array<UserConfig<any>>\ntype ConfigInput = AnyConfigResult | Promise<AnyConfigResult> | ((cli: CLIOptions) => PossiblePromise<AnyConfigResult>)\ntype NormalizeConfig<TConfig> =\n TConfig extends Array<UserConfig<infer TInput>> ? Array<UserConfig<TInput>> : TConfig extends UserConfig<infer TInput> ? UserConfig<TInput> : never\ntype DefinedConfig<TConfig extends ConfigInput> = TConfig extends (cli: CLIOptions) => PossiblePromise<infer TResult>\n ? (cli: CLIOptions) => Promise<NormalizeConfig<TResult>>\n : TConfig extends Promise<infer TResult>\n ? Promise<NormalizeConfig<TResult>>\n : NormalizeConfig<TConfig>\n\n/**\n * Applies default adapter and parsers to a single user config when not set.\n *\n * - `adapter` defaults to `adapterOas()`\n * - `parsers` defaults to `[parserTs, parserTsx]`\n */\nfunction applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput> {\n return {\n ...config,\n adapter: config.adapter ?? adapterOas(),\n parsers: config.parsers?.length ? config.parsers : [parserTs, parserTsx],\n middleware: config.middleware?.length ? config.middleware : [middlewareBarrel],\n }\n}\n\nfunction normalizeConfig<TInput>(config: UserConfig<TInput> | Array<UserConfig<TInput>>): UserConfig<TInput> | Array<UserConfig<TInput>> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Helper for defining a Kubb configuration with built-in defaults.\n *\n * When no `adapter` is provided, `adapterOas()` is used automatically.\n * When no `parsers` are provided, `[parserTsx]` is used automatically.\n *\n * Accepts either:\n * - A config object or array of configs\n * - A function returning the config(s), optionally async,\n * receiving the CLI options as argument\n *\n * @example\n * export default defineConfig(({ logLevel }) => ({\n * root: 'src',\n * plugins: [myPlugin()],\n * }))\n */\nexport function defineConfig<TConfig extends ConfigInput>(config: TConfig): DefinedConfig<TConfig> {\n if (typeof config === 'function') {\n return (async (cli: CLIOptions) => {\n return normalizeConfig(await config(cli))\n }) as DefinedConfig<TConfig>\n }\n\n if (isPromise(config)) {\n return config.then((resolved) => normalizeConfig(resolved)) as DefinedConfig<TConfig>\n }\n\n return normalizeConfig(config) as DefinedConfig<TConfig>\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,SAAgB,UAAa,QAAkD;AAC7E,QAAO,WAAW,QAAQ,WAAW,KAAA,KAAa,OAAQ,OAAmC,YAAY;;;;;;;;;;ACE3G,SAAS,cAAsB,QAAgD;AAC7E,QAAO;EACL,GAAG;EACH,SAAS,OAAO,YAAA,GAAA,kBAAA,aAAuB;EACvC,SAAS,OAAO,SAAS,SAAS,OAAO,UAAU,CAACA,gBAAAA,UAAUC,gBAAAA,UAAU;EACxE,YAAY,OAAO,YAAY,SAAS,OAAO,aAAa,CAACC,wBAAAA,iBAAiB;EAC/E;;AAGH,SAAS,gBAAwB,QAAwG;AACvI,KAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,OAAO,IAAI,cAAc;AAGlC,QAAO,cAAc,OAAO;;;;;;;;;;;;;;;;;;;AAoB9B,SAAgB,aAA0C,QAAyC;AACjG,KAAI,OAAO,WAAW,WACpB,SAAQ,OAAO,QAAoB;AACjC,SAAO,gBAAgB,MAAM,OAAO,IAAI,CAAC;;AAI7C,KAAI,UAAU,OAAO,CACnB,QAAO,OAAO,MAAM,aAAa,gBAAgB,SAAS,CAAC;AAG7D,QAAO,gBAAgB,OAAO"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./chunk--u3MIqq1.js";
|
|
2
2
|
import { adapterOas } from "@kubb/adapter-oas";
|
|
3
|
+
import { middlewareBarrel } from "@kubb/middleware-barrel";
|
|
3
4
|
import { parserTs, parserTsx } from "@kubb/parser-ts";
|
|
4
5
|
//#region ../../internals/utils/src/promise.ts
|
|
5
6
|
/** Returns `true` when `result` is a thenable `Promise`.
|
|
@@ -25,7 +26,8 @@ function applyDefaults(config) {
|
|
|
25
26
|
return {
|
|
26
27
|
...config,
|
|
27
28
|
adapter: config.adapter ?? adapterOas(),
|
|
28
|
-
parsers: config.parsers?.length ? config.parsers : [parserTs, parserTsx]
|
|
29
|
+
parsers: config.parsers?.length ? config.parsers : [parserTs, parserTsx],
|
|
30
|
+
middleware: config.middleware?.length ? config.middleware : [middlewareBarrel]
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
function normalizeConfig(config) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../internals/utils/src/promise.ts","../src/defineConfig.ts"],"sourcesContent":["/** A value that may already be resolved or still pending.\n *\n * @example\n * ```ts\n * function load(id: string): PossiblePromise<string> {\n * return cache.get(id) ?? fetchRemote(id)\n * }\n * ```\n */\nexport type PossiblePromise<T> = Promise<T> | T\n\n/** Returns `true` when `result` is a thenable `Promise`.\n *\n * @example\n * ```ts\n * isPromise(Promise.resolve(1)) // true\n * isPromise(42) // false\n * ```\n */\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return result !== null && result !== undefined && typeof (result as Record<string, unknown>)['then'] === 'function'\n}\n\n/** Returns `true` when `result` is a fulfilled `Promise.allSettled` result.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseFulfilledResult).map((r) => r.value)\n * ```\n */\nexport function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled'\n}\n\n/** Returns `true` when `result` is a rejected `Promise.allSettled` result with a typed `reason`.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseRejectedResult<Error>).map((r) => r.reason.message)\n * ```\n */\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","import { isPromise, type PossiblePromise } from '@internals/utils'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\n\ntype AnyConfigResult = UserConfig<any> | Array<UserConfig<any>>\ntype ConfigInput = AnyConfigResult | Promise<AnyConfigResult> | ((cli: CLIOptions) => PossiblePromise<AnyConfigResult>)\ntype NormalizeConfig<TConfig> =\n TConfig extends Array<UserConfig<infer TInput>> ? Array<UserConfig<TInput>> : TConfig extends UserConfig<infer TInput> ? UserConfig<TInput> : never\ntype DefinedConfig<TConfig extends ConfigInput> = TConfig extends (cli: CLIOptions) => PossiblePromise<infer TResult>\n ? (cli: CLIOptions) => Promise<NormalizeConfig<TResult>>\n : TConfig extends Promise<infer TResult>\n ? Promise<NormalizeConfig<TResult>>\n : NormalizeConfig<TConfig>\n\n/**\n * Applies default adapter and parsers to a single user config when not set.\n *\n * - `adapter` defaults to `adapterOas()`\n * - `parsers` defaults to `[parserTs, parserTsx]`\n */\nfunction applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput> {\n return {\n ...config,\n adapter: config.adapter ?? adapterOas(),\n parsers: config.parsers?.length ? config.parsers : [parserTs, parserTsx],\n }\n}\n\nfunction normalizeConfig<TInput>(config: UserConfig<TInput> | Array<UserConfig<TInput>>): UserConfig<TInput> | Array<UserConfig<TInput>> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Helper for defining a Kubb configuration with built-in defaults.\n *\n * When no `adapter` is provided, `adapterOas()` is used automatically.\n * When no `parsers` are provided, `[parserTsx]` is used automatically.\n *\n * Accepts either:\n * - A config object or array of configs\n * - A function returning the config(s), optionally async,\n * receiving the CLI options as argument\n *\n * @example\n * export default defineConfig(({ logLevel }) => ({\n * root: 'src',\n * plugins: [myPlugin()],\n * }))\n */\nexport function defineConfig<TConfig extends ConfigInput>(config: TConfig): DefinedConfig<TConfig> {\n if (typeof config === 'function') {\n return (async (cli: CLIOptions) => {\n return normalizeConfig(await config(cli))\n }) as DefinedConfig<TConfig>\n }\n\n if (isPromise(config)) {\n return config.then((resolved) => normalizeConfig(resolved)) as DefinedConfig<TConfig>\n }\n\n return normalizeConfig(config) as DefinedConfig<TConfig>\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../internals/utils/src/promise.ts","../src/defineConfig.ts"],"sourcesContent":["/** A value that may already be resolved or still pending.\n *\n * @example\n * ```ts\n * function load(id: string): PossiblePromise<string> {\n * return cache.get(id) ?? fetchRemote(id)\n * }\n * ```\n */\nexport type PossiblePromise<T> = Promise<T> | T\n\n/** Returns `true` when `result` is a thenable `Promise`.\n *\n * @example\n * ```ts\n * isPromise(Promise.resolve(1)) // true\n * isPromise(42) // false\n * ```\n */\nexport function isPromise<T>(result: PossiblePromise<T>): result is Promise<T> {\n return result !== null && result !== undefined && typeof (result as Record<string, unknown>)['then'] === 'function'\n}\n\n/** Returns `true` when `result` is a fulfilled `Promise.allSettled` result.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseFulfilledResult).map((r) => r.value)\n * ```\n */\nexport function isPromiseFulfilledResult<T = unknown>(result: PromiseSettledResult<unknown>): result is PromiseFulfilledResult<T> {\n return result.status === 'fulfilled'\n}\n\n/** Returns `true` when `result` is a rejected `Promise.allSettled` result with a typed `reason`.\n *\n * @example\n * ```ts\n * const results = await Promise.allSettled([p1, p2])\n * results.filter(isPromiseRejectedResult<Error>).map((r) => r.reason.message)\n * ```\n */\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","import { isPromise, type PossiblePromise } from '@internals/utils'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport type { CLIOptions, UserConfig } from '@kubb/core'\nimport { middlewareBarrel } from '@kubb/middleware-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\n\ntype AnyConfigResult = UserConfig<any> | Array<UserConfig<any>>\ntype ConfigInput = AnyConfigResult | Promise<AnyConfigResult> | ((cli: CLIOptions) => PossiblePromise<AnyConfigResult>)\ntype NormalizeConfig<TConfig> =\n TConfig extends Array<UserConfig<infer TInput>> ? Array<UserConfig<TInput>> : TConfig extends UserConfig<infer TInput> ? UserConfig<TInput> : never\ntype DefinedConfig<TConfig extends ConfigInput> = TConfig extends (cli: CLIOptions) => PossiblePromise<infer TResult>\n ? (cli: CLIOptions) => Promise<NormalizeConfig<TResult>>\n : TConfig extends Promise<infer TResult>\n ? Promise<NormalizeConfig<TResult>>\n : NormalizeConfig<TConfig>\n\n/**\n * Applies default adapter and parsers to a single user config when not set.\n *\n * - `adapter` defaults to `adapterOas()`\n * - `parsers` defaults to `[parserTs, parserTsx]`\n */\nfunction applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput> {\n return {\n ...config,\n adapter: config.adapter ?? adapterOas(),\n parsers: config.parsers?.length ? config.parsers : [parserTs, parserTsx],\n middleware: config.middleware?.length ? config.middleware : [middlewareBarrel],\n }\n}\n\nfunction normalizeConfig<TInput>(config: UserConfig<TInput> | Array<UserConfig<TInput>>): UserConfig<TInput> | Array<UserConfig<TInput>> {\n if (Array.isArray(config)) {\n return config.map(applyDefaults)\n }\n\n return applyDefaults(config)\n}\n\n/**\n * Helper for defining a Kubb configuration with built-in defaults.\n *\n * When no `adapter` is provided, `adapterOas()` is used automatically.\n * When no `parsers` are provided, `[parserTsx]` is used automatically.\n *\n * Accepts either:\n * - A config object or array of configs\n * - A function returning the config(s), optionally async,\n * receiving the CLI options as argument\n *\n * @example\n * export default defineConfig(({ logLevel }) => ({\n * root: 'src',\n * plugins: [myPlugin()],\n * }))\n */\nexport function defineConfig<TConfig extends ConfigInput>(config: TConfig): DefinedConfig<TConfig> {\n if (typeof config === 'function') {\n return (async (cli: CLIOptions) => {\n return normalizeConfig(await config(cli))\n }) as DefinedConfig<TConfig>\n }\n\n if (isPromise(config)) {\n return config.then((resolved) => normalizeConfig(resolved)) as DefinedConfig<TConfig>\n }\n\n return normalizeConfig(config) as DefinedConfig<TConfig>\n}\n"],"mappings":";;;;;;;;;;;;;AAmBA,SAAgB,UAAa,QAAkD;AAC7E,QAAO,WAAW,QAAQ,WAAW,KAAA,KAAa,OAAQ,OAAmC,YAAY;;;;;;;;;;ACE3G,SAAS,cAAsB,QAAgD;AAC7E,QAAO;EACL,GAAG;EACH,SAAS,OAAO,WAAW,YAAY;EACvC,SAAS,OAAO,SAAS,SAAS,OAAO,UAAU,CAAC,UAAU,UAAU;EACxE,YAAY,OAAO,YAAY,SAAS,OAAO,aAAa,CAAC,iBAAiB;EAC/E;;AAGH,SAAS,gBAAwB,QAAwG;AACvI,KAAI,MAAM,QAAQ,OAAO,CACvB,QAAO,OAAO,IAAI,cAAc;AAGlC,QAAO,cAAc,OAAO;;;;;;;;;;;;;;;;;;;AAoB9B,SAAgB,aAA0C,QAAyC;AACjG,KAAI,OAAO,WAAW,WACpB,SAAQ,OAAO,QAAoB;AACjC,SAAO,gBAAgB,MAAM,OAAO,IAAI,CAAC;;AAI7C,KAAI,UAAU,OAAO,CACnB,QAAO,OAAO,MAAM,aAAa,gBAAgB,SAAS,CAAC;AAG7D,QAAO,gBAAgB,OAAO"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kubb",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.55",
|
|
4
4
|
"description": "Transform OpenAPI specifications into TypeScript, React-Query, Zod, Faker.js, MSW and more with a plugin-based code generation tool.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api-client",
|
|
@@ -57,12 +57,13 @@
|
|
|
57
57
|
"registry": "https://registry.npmjs.org/"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@kubb/
|
|
61
|
-
"@kubb/
|
|
62
|
-
"@kubb/
|
|
63
|
-
"@kubb/
|
|
64
|
-
"@kubb/mcp": "5.0.0-alpha.
|
|
65
|
-
"@kubb/parser-ts": "5.0.0-alpha.
|
|
60
|
+
"@kubb/agent": "5.0.0-alpha.55",
|
|
61
|
+
"@kubb/cli": "5.0.0-alpha.55",
|
|
62
|
+
"@kubb/core": "5.0.0-alpha.55",
|
|
63
|
+
"@kubb/middleware-barrel": "5.0.0-alpha.55",
|
|
64
|
+
"@kubb/mcp": "5.0.0-alpha.55",
|
|
65
|
+
"@kubb/parser-ts": "5.0.0-alpha.55",
|
|
66
|
+
"@kubb/adapter-oas": "5.0.0-alpha.55"
|
|
66
67
|
},
|
|
67
68
|
"devDependencies": {
|
|
68
69
|
"@internals/utils": "0.0.0"
|
package/src/defineConfig.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { isPromise, type PossiblePromise } from '@internals/utils'
|
|
2
2
|
import { adapterOas } from '@kubb/adapter-oas'
|
|
3
3
|
import type { CLIOptions, UserConfig } from '@kubb/core'
|
|
4
|
+
import { middlewareBarrel } from '@kubb/middleware-barrel'
|
|
4
5
|
import { parserTs, parserTsx } from '@kubb/parser-ts'
|
|
5
6
|
|
|
6
7
|
type AnyConfigResult = UserConfig<any> | Array<UserConfig<any>>
|
|
@@ -24,6 +25,7 @@ function applyDefaults<TInput>(config: UserConfig<TInput>): UserConfig<TInput> {
|
|
|
24
25
|
...config,
|
|
25
26
|
adapter: config.adapter ?? adapterOas(),
|
|
26
27
|
parsers: config.parsers?.length ? config.parsers : [parserTs, parserTsx],
|
|
28
|
+
middleware: config.middleware?.length ? config.middleware : [middlewareBarrel],
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|