@kubb/core 4.12.5 → 4.12.7

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.
Files changed (43) hide show
  1. package/dist/{fs-DhLl4-lT.cjs → fs-B7S6Neks.cjs} +3 -3
  2. package/dist/{fs-DhLl4-lT.cjs.map → fs-B7S6Neks.cjs.map} +1 -1
  3. package/dist/{fs-ph1OdgEr.js → fs-DzeDAeja.js} +3 -3
  4. package/dist/{fs-ph1OdgEr.js.map → fs-DzeDAeja.js.map} +1 -1
  5. package/dist/fs.cjs +1 -1
  6. package/dist/fs.js +1 -1
  7. package/dist/{getBarrelFiles-BEWbZEZf.d.ts → getBarrelFiles-BOZ_wYov.d.ts} +2 -2
  8. package/dist/{getBarrelFiles-ZPeKtx6a.cjs → getBarrelFiles-CKNu_noL.cjs} +56 -11
  9. package/dist/getBarrelFiles-CKNu_noL.cjs.map +1 -0
  10. package/dist/{getBarrelFiles-LW3anr-E.d.cts → getBarrelFiles-CSqnakvm.d.cts} +2 -2
  11. package/dist/{getBarrelFiles-BDklg98q.js → getBarrelFiles-D14cwdcu.js} +38 -11
  12. package/dist/getBarrelFiles-D14cwdcu.js.map +1 -0
  13. package/dist/hooks.cjs +1 -1
  14. package/dist/hooks.d.cts +1 -1
  15. package/dist/hooks.d.ts +1 -1
  16. package/dist/index.cjs +25 -17
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +2 -2
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +24 -16
  21. package/dist/index.js.map +1 -1
  22. package/dist/{transformers-ClYW4Jl8.cjs → transformers-mwhBtsSu.cjs} +2 -2
  23. package/dist/{transformers-ClYW4Jl8.cjs.map → transformers-mwhBtsSu.cjs.map} +1 -1
  24. package/dist/transformers.cjs +2 -2
  25. package/dist/{types-DZARm27h.d.ts → types-6ENPfetT.d.cts} +9 -4
  26. package/dist/{types-icDNKrIP.d.cts → types-AoEOgnSE.d.ts} +9 -4
  27. package/dist/utils.cjs +6 -3
  28. package/dist/utils.d.cts +19 -3
  29. package/dist/utils.d.ts +19 -3
  30. package/dist/utils.js +2 -2
  31. package/package.json +5 -8
  32. package/src/Kubb.ts +3 -2
  33. package/src/PackageManager.ts +2 -2
  34. package/src/PluginManager.ts +4 -4
  35. package/src/build.ts +24 -12
  36. package/src/fs/write.ts +2 -2
  37. package/src/utils/TreeNode.ts +6 -6
  38. package/src/utils/formatHrtime.ts +33 -0
  39. package/src/utils/index.ts +1 -0
  40. package/src/utils/types.ts +0 -4
  41. package/dist/getBarrelFiles-BDklg98q.js.map +0 -1
  42. package/dist/getBarrelFiles-ZPeKtx6a.cjs.map +0 -1
  43. package/src/utils/EventEmitter.ts +0 -23
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getBarrelFiles-D14cwdcu.js","names":["#head","#tail","#size","resolve","promise: Promise<unknown>","#options","#plugins","#usedPluginNames","#promiseManager","#parse","mergedExtras: Record<string, any>","#getSortedPlugins","path","items: Array<ReturnType<ParseResult<H>>>","#execute","#executeSync","parseResult: SafeParseResult<H>","output: unknown","#emitter","NodeEventEmitter","path","#options","params: Record<string, string>","#cachedLeaves","leaves: TreeNode[]","root: DirectoryTree","currentLevel: DirectoryTree[]","barrelFile: KubbFile.File","item"],"sources":["../src/errors.ts","../../../node_modules/.pnpm/yocto-queue@1.2.2/node_modules/yocto-queue/index.js","../../../node_modules/.pnpm/p-limit@7.2.0/node_modules/p-limit/index.js","../src/utils/executeStrategies.ts","../src/PromiseManager.ts","../src/utils/uniqueName.ts","../src/PluginManager.ts","../src/utils/AsyncEventEmitter.ts","../src/utils/formatHrtime.ts","../src/utils/URLPath.ts","../src/utils/TreeNode.ts","../src/BarrelManager.ts","../src/utils/getBarrelFiles.ts"],"sourcesContent":["export class ValidationPluginError extends Error {}\n","/*\nHow it works:\n`this.#head` is an instance of `Node` which keeps track of its current value and nests another instance of `Node` that keeps the value that comes after it. When a value is provided to `.enqueue()`, the code needs to iterate through `this.#head`, going deeper and deeper to find the last value. However, iterating through every single item is slow. This problem is solved by saving a reference to the last value as `this.#tail` so that it can reference it to add a new value.\n*/\n\nclass Node {\n\tvalue;\n\tnext;\n\n\tconstructor(value) {\n\t\tthis.value = value;\n\t}\n}\n\nexport default class Queue {\n\t#head;\n\t#tail;\n\t#size;\n\n\tconstructor() {\n\t\tthis.clear();\n\t}\n\n\tenqueue(value) {\n\t\tconst node = new Node(value);\n\n\t\tif (this.#head) {\n\t\t\tthis.#tail.next = node;\n\t\t\tthis.#tail = node;\n\t\t} else {\n\t\t\tthis.#head = node;\n\t\t\tthis.#tail = node;\n\t\t}\n\n\t\tthis.#size++;\n\t}\n\n\tdequeue() {\n\t\tconst current = this.#head;\n\t\tif (!current) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.#head = this.#head.next;\n\t\tthis.#size--;\n\n\t\t// Clean up tail reference when queue becomes empty\n\t\tif (!this.#head) {\n\t\t\tthis.#tail = undefined;\n\t\t}\n\n\t\treturn current.value;\n\t}\n\n\tpeek() {\n\t\tif (!this.#head) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn this.#head.value;\n\n\t\t// TODO: Node.js 18.\n\t\t// return this.#head?.value;\n\t}\n\n\tclear() {\n\t\tthis.#head = undefined;\n\t\tthis.#tail = undefined;\n\t\tthis.#size = 0;\n\t}\n\n\tget size() {\n\t\treturn this.#size;\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tlet current = this.#head;\n\n\t\twhile (current) {\n\t\t\tyield current.value;\n\t\t\tcurrent = current.next;\n\t\t}\n\t}\n\n\t* drain() {\n\t\twhile (this.#head) {\n\t\t\tyield this.dequeue();\n\t\t}\n\t}\n}\n","import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tvalidateConcurrency(concurrency);\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst resumeNext = () => {\n\t\t// Process the next queued function if we're under the concurrency limit\n\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\tactiveCount++;\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst next = () => {\n\t\tactiveCount--;\n\t\tresumeNext();\n\t};\n\n\tconst run = async (function_, resolve, arguments_) => {\n\t\t// Execute the function and capture the result promise\n\t\tconst result = (async () => function_(...arguments_))();\n\n\t\t// Resolve immediately with the promise (don't wait for completion)\n\t\tresolve(result);\n\n\t\t// Wait for the function to complete (success or failure)\n\t\t// We catch errors here to prevent unhandled rejections,\n\t\t// but the original promise rejection is preserved for the caller\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\t// Decrement active count and process next queued function\n\t\tnext();\n\t};\n\n\tconst enqueue = (function_, resolve, arguments_) => {\n\t\t// Queue the internal resolve function instead of the run function\n\t\t// to preserve the asynchronous execution context.\n\t\tnew Promise(internalResolve => { // eslint-disable-line promise/param-names\n\t\t\tqueue.enqueue(internalResolve);\n\t\t}).then(run.bind(undefined, function_, resolve, arguments_)); // eslint-disable-line promise/prefer-await-to-then\n\n\t\t// Start processing immediately if we haven't reached the concurrency limit\n\t\tif (activeCount < concurrency) {\n\t\t\tresumeNext();\n\t\t}\n\t};\n\n\tconst generator = (function_, ...arguments_) => new Promise(resolve => {\n\t\tenqueue(function_, resolve, arguments_);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue() {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t\tconcurrency: {\n\t\t\tget: () => concurrency,\n\n\t\t\tset(newConcurrency) {\n\t\t\t\tvalidateConcurrency(newConcurrency);\n\t\t\t\tconcurrency = newConcurrency;\n\n\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t// eslint-disable-next-line no-unmodified-loop-condition\n\t\t\t\t\twhile (activeCount < concurrency && queue.size > 0) {\n\t\t\t\t\t\tresumeNext();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t},\n\t\tmap: {\n\t\t\tasync value(iterable, function_) {\n\t\t\t\tconst promises = Array.from(iterable, (value, index) => this(function_, value, index));\n\t\t\t\treturn Promise.all(promises);\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n\nexport function limitFunction(function_, options) {\n\tconst {concurrency} = options;\n\tconst limit = pLimit(concurrency);\n\n\treturn (...arguments_) => limit(() => function_(...arguments_));\n}\n\nfunction validateConcurrency(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n}\n","import pLimit from 'p-limit'\n\ntype PromiseFunc<T = unknown, T2 = never> = (state?: T) => T2 extends never ? Promise<T> : Promise<T> | T2\n\ntype ValueOfPromiseFuncArray<TInput extends Array<unknown>> = TInput extends Array<PromiseFunc<infer X, infer Y>> ? X | Y : never\n\ntype SeqOutput<TInput extends Array<PromiseFunc<TValue, null>>, TValue> = Promise<Array<Awaited<ValueOfPromiseFuncArray<TInput>>>>\n\n/**\n * Chains promises\n */\nexport function hookSeq<TInput extends Array<PromiseFunc<TValue, null>>, TValue, TOutput = SeqOutput<TInput, TValue>>(promises: TInput): TOutput {\n return promises.filter(Boolean).reduce(\n (promise, func) => {\n if (typeof func !== 'function') {\n throw new Error('HookSeq needs a function that returns a promise `() => Promise<unknown>`')\n }\n\n return promise.then((state) => {\n const calledFunc = func(state as TValue)\n\n if (calledFunc) {\n return calledFunc.then(Array.prototype.concat.bind(state))\n }\n })\n },\n Promise.resolve([] as unknown),\n ) as TOutput\n}\n\ntype HookFirstOutput<TInput extends Array<PromiseFunc<TValue, null>>, TValue = unknown> = ValueOfPromiseFuncArray<TInput>\n\n/**\n * Chains promises, first non-null result stops and returns\n */\nexport function hookFirst<TInput extends Array<PromiseFunc<TValue, null>>, TValue = unknown, TOutput = HookFirstOutput<TInput, TValue>>(\n promises: TInput,\n nullCheck = (state: any) => state !== null,\n): TOutput {\n let promise: Promise<unknown> = Promise.resolve(null) as Promise<unknown>\n\n for (const func of promises.filter(Boolean)) {\n promise = promise.then((state) => {\n if (nullCheck(state)) {\n return state\n }\n\n return func(state as TValue)\n })\n }\n\n return promise as TOutput\n}\n\ntype HookParallelOutput<TInput extends Array<PromiseFunc<TValue, null>>, TValue> = Promise<PromiseSettledResult<Awaited<ValueOfPromiseFuncArray<TInput>>>[]>\n\n/**\n * Runs an array of promise functions with optional concurrency limit.\n */\nexport function hookParallel<TInput extends Array<PromiseFunc<TValue, null>>, TValue = unknown, TOutput = HookParallelOutput<TInput, TValue>>(\n promises: TInput,\n concurrency: number = Number.POSITIVE_INFINITY,\n): TOutput {\n const limit = pLimit(concurrency)\n\n const tasks = promises.filter(Boolean).map((promise) => limit(() => promise()))\n\n return Promise.allSettled(tasks) as TOutput\n}\n\nexport type Strategy = 'seq' | 'first' | 'parallel'\n\nexport type StrategySwitch<TStrategy extends Strategy, TInput extends Array<PromiseFunc<TValue, null>>, TValue> = TStrategy extends 'first'\n ? HookFirstOutput<TInput, TValue>\n : TStrategy extends 'seq'\n ? SeqOutput<TInput, TValue>\n : TStrategy extends 'parallel'\n ? HookParallelOutput<TInput, TValue>\n : never\n","import type { Strategy, StrategySwitch } from './utils/executeStrategies.ts'\nimport { hookFirst, hookParallel, hookSeq } from './utils/executeStrategies.ts'\n\ntype PromiseFunc<T = unknown, T2 = never> = () => T2 extends never ? Promise<T> : Promise<T> | T2\n\ntype Options<TState = any> = {\n nullCheck?: (state: TState) => boolean\n}\n\nexport class PromiseManager<TState = any> {\n #options: Options<TState> = {}\n\n constructor(options: Options<TState> = {}) {\n this.#options = options\n\n return this\n }\n\n run<TInput extends Array<PromiseFunc<TValue, null>>, TValue, TStrategy extends Strategy, TOutput = StrategySwitch<TStrategy, TInput, TValue>>(\n strategy: TStrategy,\n promises: TInput,\n { concurrency = Number.POSITIVE_INFINITY }: { concurrency?: number } = {},\n ): TOutput {\n if (strategy === 'seq') {\n return hookSeq<TInput, TValue, TOutput>(promises)\n }\n\n if (strategy === 'first') {\n return hookFirst<TInput, TValue, TOutput>(promises, this.#options.nullCheck)\n }\n\n if (strategy === 'parallel') {\n return hookParallel<TInput, TValue, TOutput>(promises, concurrency)\n }\n\n throw new Error(`${strategy} not implemented`)\n }\n}\n\nexport function isPromiseRejectedResult<T>(result: PromiseSettledResult<unknown>): result is Omit<PromiseRejectedResult, 'reason'> & { reason: T } {\n return result.status === 'rejected'\n}\n","export function getUniqueName(originalName: string, data: Record<string, number>): string {\n let used = data[originalName] || 0\n if (used) {\n data[originalName] = ++used\n originalName += used\n }\n data[originalName] = 1\n return originalName\n}\n\nexport function setUniqueName(originalName: string, data: Record<string, number>): string {\n let used = data[originalName] || 0\n if (used) {\n data[originalName] = ++used\n\n return originalName\n }\n data[originalName] = 1\n return originalName\n}\n","import path from 'node:path'\nimport { performance } from 'node:perf_hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Fabric } from '@kubb/react-fabric'\nimport { ValidationPluginError } from './errors.ts'\nimport { isPromiseRejectedResult, PromiseManager } from './PromiseManager.ts'\nimport { transformReservedWord } from './transformers/transformReservedWord.ts'\nimport { trim } from './transformers/trim.ts'\nimport type {\n Config,\n GetPluginFactoryOptions,\n KubbEvents,\n Plugin,\n PluginContext,\n PluginFactoryOptions,\n PluginLifecycle,\n PluginLifecycleHooks,\n PluginParameter,\n PluginWithLifeCycle,\n ResolveNameParams,\n ResolvePathParams,\n UserPlugin,\n} from './types.ts'\nimport type { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\nimport { setUniqueName } from './utils/uniqueName.ts'\n\ntype RequiredPluginLifecycle = Required<PluginLifecycle>\n\nexport type Strategy = 'hookFirst' | 'hookForPlugin' | 'hookParallel' | 'hookSeq'\n\ntype ParseResult<H extends PluginLifecycleHooks> = RequiredPluginLifecycle[H]\n\ntype SafeParseResult<H extends PluginLifecycleHooks, Result = ReturnType<ParseResult<H>>> = {\n result: Result\n plugin: Plugin\n}\n\n// inspired by: https://github.com/rollup/rollup/blob/master/src/utils/PluginDriver.ts#\n\ntype Options = {\n fabric: Fabric\n events: AsyncEventEmitter<KubbEvents>\n /**\n * @default Number.POSITIVE_INFINITY\n */\n concurrency?: number\n}\n\ntype GetFileProps<TOptions = object> = {\n name: string\n mode?: KubbFile.Mode\n extname: KubbFile.Extname\n pluginKey: Plugin['key']\n options?: TOptions\n}\n\nexport function getMode(fileOrFolder: string | undefined | null): KubbFile.Mode {\n if (!fileOrFolder) {\n return 'split'\n }\n return path.extname(fileOrFolder) ? 'single' : 'split'\n}\n\nexport class PluginManager {\n readonly config: Config\n readonly options: Options\n\n readonly #plugins = new Set<Plugin<GetPluginFactoryOptions<any>>>()\n readonly #usedPluginNames: Record<string, number> = {}\n readonly #promiseManager: PromiseManager\n\n constructor(config: Config, options: Options) {\n this.config = config\n this.options = options\n this.#promiseManager = new PromiseManager({\n nullCheck: (state: SafeParseResult<'resolveName'> | null) => !!state?.result,\n })\n ;[...(config.plugins || [])].forEach((plugin) => {\n const parsedPlugin = this.#parse(plugin as UserPlugin)\n\n this.#plugins.add(parsedPlugin)\n })\n\n return this\n }\n\n get events() {\n return this.options.events\n }\n\n getContext<TOptions extends PluginFactoryOptions>(plugin: Plugin<TOptions>): PluginContext<TOptions> & Record<string, any> {\n const plugins = [...this.#plugins]\n const baseContext = {\n fabric: this.options.fabric,\n config: this.config,\n plugin,\n events: this.options.events,\n pluginManager: this,\n mode: getMode(path.resolve(this.config.root, this.config.output.path)),\n addFile: async (...files: Array<KubbFile.File>) => {\n await this.options.fabric.addFile(...files)\n },\n upsertFile: async (...files: Array<KubbFile.File>) => {\n await this.options.fabric.upsertFile(...files)\n },\n } as unknown as PluginContext<TOptions>\n\n const mergedExtras: Record<string, any> = {}\n for (const p of plugins) {\n if (typeof p.inject === 'function') {\n const injector = p.inject.bind(baseContext as any) as any\n\n const result = injector(baseContext)\n if (result && typeof result === 'object') {\n Object.assign(mergedExtras, result)\n }\n }\n }\n\n return {\n ...baseContext,\n ...mergedExtras,\n }\n }\n\n get plugins(): Array<Plugin> {\n return this.#getSortedPlugins()\n }\n\n getFile<TOptions = object>({ name, mode, extname, pluginKey, options }: GetFileProps<TOptions>): KubbFile.File<{ pluginKey: Plugin['key'] }> {\n const baseName = `${name}${extname}` as const\n const path = this.resolvePath({ baseName, mode, pluginKey, options })\n\n if (!path) {\n throw new Error(`Filepath should be defined for resolvedName \"${name}\" and pluginKey [${JSON.stringify(pluginKey)}]`)\n }\n\n return {\n path,\n baseName,\n meta: {\n pluginKey,\n },\n sources: [],\n }\n }\n\n resolvePath = <TOptions = object>(params: ResolvePathParams<TOptions>): KubbFile.Path => {\n const root = path.resolve(this.config.root, this.config.output.path)\n const defaultPath = path.resolve(root, params.baseName)\n\n if (params.pluginKey) {\n const paths = this.hookForPluginSync({\n pluginKey: params.pluginKey,\n hookName: 'resolvePath',\n parameters: [params.baseName, params.mode, params.options as object],\n })\n\n return paths?.at(0) || defaultPath\n }\n\n const firstResult = this.hookFirstSync({\n hookName: 'resolvePath',\n parameters: [params.baseName, params.mode, params.options as object],\n })\n\n return firstResult?.result || defaultPath\n }\n //TODO refactor by using the order of plugins and the cache of the fileManager instead of guessing and recreating the name/path\n resolveName = (params: ResolveNameParams): string => {\n if (params.pluginKey) {\n const names = this.hookForPluginSync({\n pluginKey: params.pluginKey,\n hookName: 'resolveName',\n parameters: [trim(params.name), params.type],\n })\n\n const uniqueNames = new Set(names)\n\n return transformReservedWord([...uniqueNames].at(0) || params.name)\n }\n\n const name = this.hookFirstSync({\n hookName: 'resolveName',\n parameters: [trim(params.name), params.type],\n }).result\n\n return transformReservedWord(name)\n }\n\n /**\n * Run a specific hookName for plugin x.\n */\n async hookForPlugin<H extends PluginLifecycleHooks>({\n pluginKey,\n hookName,\n parameters,\n }: {\n pluginKey: Plugin['key']\n hookName: H\n parameters: PluginParameter<H>\n }): Promise<Array<ReturnType<ParseResult<H>> | null>> {\n const plugins = this.getPluginsByKey(hookName, pluginKey)\n\n this.events.emit('plugins:hook:progress:start', {\n hookName,\n plugins,\n })\n\n const items: Array<ReturnType<ParseResult<H>>> = []\n\n for (const plugin of plugins) {\n const result = await this.#execute<H>({\n strategy: 'hookFirst',\n hookName,\n parameters,\n plugin,\n })\n\n if (result !== undefined && result !== null) {\n items.push(result)\n }\n }\n\n this.events.emit('plugins:hook:progress:end', { hookName })\n\n return items\n }\n /**\n * Run a specific hookName for plugin x.\n */\n\n hookForPluginSync<H extends PluginLifecycleHooks>({\n pluginKey,\n hookName,\n parameters,\n }: {\n pluginKey: Plugin['key']\n hookName: H\n parameters: PluginParameter<H>\n }): Array<ReturnType<ParseResult<H>>> | null {\n const plugins = this.getPluginsByKey(hookName, pluginKey)\n\n const result = plugins\n .map((plugin) => {\n return this.#executeSync<H>({\n strategy: 'hookFirst',\n hookName,\n parameters,\n plugin,\n })\n })\n .filter(Boolean)\n\n return result\n }\n\n /**\n * First non-null result stops and will return it's value.\n */\n async hookFirst<H extends PluginLifecycleHooks>({\n hookName,\n parameters,\n skipped,\n }: {\n hookName: H\n parameters: PluginParameter<H>\n skipped?: ReadonlySet<Plugin> | null\n }): Promise<SafeParseResult<H>> {\n const plugins = this.#getSortedPlugins(hookName).filter((plugin) => {\n return skipped ? skipped.has(plugin) : true\n })\n\n this.events.emit('plugins:hook:progress:start', { hookName, plugins })\n\n const promises = plugins.map((plugin) => {\n return async () => {\n const value = await this.#execute<H>({\n strategy: 'hookFirst',\n hookName,\n parameters,\n plugin,\n })\n\n return Promise.resolve({\n plugin,\n result: value,\n } as SafeParseResult<H>)\n }\n })\n\n const result = await this.#promiseManager.run('first', promises)\n\n this.events.emit('plugins:hook:progress:end', { hookName })\n\n return result\n }\n\n /**\n * First non-null result stops and will return it's value.\n */\n hookFirstSync<H extends PluginLifecycleHooks>({\n hookName,\n parameters,\n skipped,\n }: {\n hookName: H\n parameters: PluginParameter<H>\n skipped?: ReadonlySet<Plugin> | null\n }): SafeParseResult<H> {\n let parseResult: SafeParseResult<H> = null as unknown as SafeParseResult<H>\n const plugins = this.#getSortedPlugins(hookName).filter((plugin) => {\n return skipped ? skipped.has(plugin) : true\n })\n\n for (const plugin of plugins) {\n parseResult = {\n result: this.#executeSync<H>({\n strategy: 'hookFirst',\n hookName,\n parameters,\n plugin,\n }),\n plugin,\n } as SafeParseResult<H>\n\n if (parseResult?.result != null) {\n break\n }\n }\n\n return parseResult\n }\n\n /**\n * Run all plugins in parallel(order will be based on `this.plugin` and if `pre` or `post` is set).\n */\n async hookParallel<H extends PluginLifecycleHooks, TOuput = void>({\n hookName,\n parameters,\n }: {\n hookName: H\n parameters?: Parameters<RequiredPluginLifecycle[H]> | undefined\n }): Promise<Awaited<TOuput>[]> {\n const plugins = this.#getSortedPlugins(hookName)\n this.events.emit('plugins:hook:progress:start', { hookName, plugins })\n\n const promises = plugins.map((plugin) => {\n return () =>\n this.#execute({\n strategy: 'hookParallel',\n hookName,\n parameters,\n plugin,\n }) as Promise<TOuput>\n })\n\n const results = await this.#promiseManager.run('parallel', promises, {\n concurrency: this.options.concurrency,\n })\n\n results.forEach((result, index) => {\n if (isPromiseRejectedResult<Error>(result)) {\n const plugin = this.#getSortedPlugins(hookName)[index]\n\n if (plugin) {\n this.events.emit('error', result.reason, {\n plugin,\n hookName,\n strategy: 'hookParallel',\n duration: 0,\n parameters,\n })\n }\n }\n })\n\n this.events.emit('plugins:hook:progress:end', { hookName })\n\n return results.reduce((acc, result) => {\n if (result.status === 'fulfilled') {\n acc.push(result.value)\n }\n return acc\n }, [] as Awaited<TOuput>[])\n }\n\n /**\n * Chains plugins\n */\n async hookSeq<H extends PluginLifecycleHooks>({ hookName, parameters }: { hookName: H; parameters?: PluginParameter<H> }): Promise<void> {\n const plugins = this.#getSortedPlugins(hookName)\n this.events.emit('plugins:hook:progress:start', { hookName, plugins })\n\n const promises = plugins.map((plugin) => {\n return () =>\n this.#execute({\n strategy: 'hookSeq',\n hookName,\n parameters,\n plugin,\n })\n })\n\n await this.#promiseManager.run('seq', promises)\n\n this.events.emit('plugins:hook:progress:end', { hookName })\n }\n\n #getSortedPlugins(hookName?: keyof PluginLifecycle): Array<Plugin> {\n const plugins = [...this.#plugins]\n\n if (hookName) {\n return plugins.filter((plugin) => hookName in plugin)\n }\n // TODO add test case for sorting with pre/post\n\n return plugins\n .map((plugin) => {\n if (plugin.pre) {\n const missingPlugins = plugin.pre.filter((pluginName) => !plugins.find((pluginToFind) => pluginToFind.name === pluginName))\n\n if (missingPlugins.length > 0) {\n throw new ValidationPluginError(`The plugin '${plugin.name}' has a pre set that references missing plugins for '${missingPlugins.join(', ')}'`)\n }\n }\n\n return plugin\n })\n .sort((a, b) => {\n if (b.pre?.includes(a.name)) {\n return 1\n }\n if (b.post?.includes(a.name)) {\n return -1\n }\n return 0\n })\n }\n\n getPluginByKey(pluginKey: Plugin['key']): Plugin | undefined {\n const plugins = [...this.#plugins]\n const [searchPluginName] = pluginKey\n\n return plugins.find((item) => {\n const [name] = item.key\n\n return name === searchPluginName\n })\n }\n\n getPluginsByKey(hookName: keyof PluginWithLifeCycle, pluginKey: Plugin['key']): Plugin[] {\n const plugins = [...this.plugins]\n const [searchPluginName, searchIdentifier] = pluginKey\n\n const pluginByPluginName = plugins\n .filter((plugin) => hookName in plugin)\n .filter((item) => {\n const [name, identifier] = item.key\n\n const identifierCheck = identifier?.toString() === searchIdentifier?.toString()\n const nameCheck = name === searchPluginName\n\n if (searchIdentifier) {\n return identifierCheck && nameCheck\n }\n\n return nameCheck\n })\n\n if (!pluginByPluginName?.length) {\n // fallback on the core plugin when there is no match\n\n const corePlugin = plugins.find((plugin) => plugin.name === 'core' && hookName in plugin)\n // Removed noisy debug logs for missing hooks - these are expected behavior, not errors\n\n return corePlugin ? [corePlugin] : []\n }\n\n return pluginByPluginName\n }\n\n /**\n * Run an async plugin hook and return the result.\n * @param hookName Name of the plugin hook. Must be either in `PluginHooks` or `OutputPluginValueHooks`.\n * @param args Arguments passed to the plugin hook.\n * @param plugin The actual pluginObject to run.\n */\n // Implementation signature\n #execute<H extends PluginLifecycleHooks>({\n strategy,\n hookName,\n parameters,\n plugin,\n }: {\n strategy: Strategy\n hookName: H\n parameters: unknown[] | undefined\n plugin: PluginWithLifeCycle\n }): Promise<ReturnType<ParseResult<H>> | null> | null {\n const hook = plugin[hookName]\n let output: unknown\n\n if (!hook) {\n return null\n }\n\n this.events.emit('plugins:hook:processing:start', {\n strategy,\n hookName,\n parameters,\n plugin,\n })\n\n const startTime = performance.now()\n\n const task = (async () => {\n try {\n if (typeof hook === 'function') {\n const context = this.getContext(plugin)\n const result = await Promise.resolve((hook as Function).apply(context, parameters))\n\n output = result\n\n this.events.emit('plugins:hook:processing:end', {\n duration: Math.round(performance.now() - startTime),\n parameters,\n output,\n strategy,\n hookName,\n plugin,\n })\n\n return result\n }\n\n output = hook\n\n this.events.emit('plugins:hook:processing:end', {\n duration: Math.round(performance.now() - startTime),\n parameters,\n output,\n strategy,\n hookName,\n plugin,\n })\n\n return hook\n } catch (error) {\n this.events.emit('error', error as Error, {\n plugin,\n hookName,\n strategy,\n duration: Math.round(performance.now() - startTime),\n })\n\n return null\n }\n })()\n\n return task\n }\n\n /**\n * Run a sync plugin hook and return the result.\n * @param hookName Name of the plugin hook. Must be in `PluginHooks`.\n * @param args Arguments passed to the plugin hook.\n * @param plugin The acutal plugin\n * @param replaceContext When passed, the plugin context can be overridden.\n */\n #executeSync<H extends PluginLifecycleHooks>({\n strategy,\n hookName,\n parameters,\n plugin,\n }: {\n strategy: Strategy\n hookName: H\n parameters: PluginParameter<H>\n plugin: PluginWithLifeCycle\n }): ReturnType<ParseResult<H>> | null {\n const hook = plugin[hookName]\n let output: unknown\n\n if (!hook) {\n return null\n }\n\n this.events.emit('plugins:hook:processing:start', {\n strategy,\n hookName,\n parameters,\n plugin,\n })\n\n const startTime = performance.now()\n\n try {\n if (typeof hook === 'function') {\n const context = this.getContext(plugin)\n const fn = (hook as Function).apply(context, parameters) as ReturnType<ParseResult<H>>\n\n output = fn\n\n this.events.emit('plugins:hook:processing:end', {\n duration: Math.round(performance.now() - startTime),\n parameters,\n output,\n strategy,\n hookName,\n plugin,\n })\n\n return fn\n }\n\n output = hook\n\n this.events.emit('plugins:hook:processing:end', {\n duration: Math.round(performance.now() - startTime),\n parameters,\n output,\n strategy,\n hookName,\n plugin,\n })\n\n return hook\n } catch (error) {\n this.events.emit('error', error as Error, {\n plugin,\n hookName,\n strategy,\n duration: Math.round(performance.now() - startTime),\n })\n\n return null\n }\n }\n\n #parse(plugin: UserPlugin): Plugin {\n const usedPluginNames = this.#usedPluginNames\n\n setUniqueName(plugin.name, usedPluginNames)\n\n return {\n install() {},\n ...plugin,\n key: [plugin.name, usedPluginNames[plugin.name]].filter(Boolean) as [typeof plugin.name, string],\n } as unknown as Plugin\n }\n}\n","import { EventEmitter as NodeEventEmitter } from 'node:events'\n\nexport class AsyncEventEmitter<TEvents extends Record<string, any>> {\n constructor(maxListener = 100) {\n this.#emitter.setMaxListeners(maxListener)\n }\n #emitter = new NodeEventEmitter()\n\n async emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void> {\n const listeners = this.#emitter.listeners(eventName) as Array<(...args: TEvents[TEventName]) => any>\n\n if (listeners.length === 0) {\n return undefined\n }\n\n await Promise.all(\n listeners.map(async (listener) => {\n try {\n return await listener(...eventArgs)\n } catch (err) {\n console.error(`Error in async listener for \"${eventName}\":`, err)\n }\n }),\n )\n }\n\n on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void {\n this.#emitter.on(eventName, handler as any)\n }\n\n onOnce<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArgs: TEvents[TEventName]) => void): void {\n const wrapper = (...args: TEvents[TEventName]) => {\n this.off(eventName, wrapper)\n handler(...args)\n }\n this.on(eventName, wrapper)\n }\n\n off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void {\n this.#emitter.off(eventName, handler as any)\n }\n removeAll(): void {\n this.#emitter.removeAllListeners()\n }\n}\n","/**\n * Calculates elapsed time in milliseconds from a high-resolution start time.\n * Rounds to 2 decimal places to provide sub-millisecond precision without noise.\n */\nexport function getElapsedMs(hrStart: [number, number]): number {\n const [seconds, nanoseconds] = process.hrtime(hrStart)\n const ms = seconds * 1000 + nanoseconds / 1e6\n return Math.round(ms * 100) / 100\n}\n\n/**\n * Converts a millisecond duration into a human-readable string.\n * Adjusts units (ms, s, m s) based on the magnitude of the duration.\n */\nexport function formatMs(ms: number): string {\n if (ms >= 60000) {\n const mins = Math.floor(ms / 60000)\n const secs = ((ms % 60000) / 1000).toFixed(1)\n return `${mins}m ${secs}s`\n }\n\n if (ms >= 1000) {\n return `${(ms / 1000).toFixed(2)}s`\n }\n return `${Math.round(ms).toFixed(0)}ms`\n}\n\n/**\n * Convenience helper to get and format elapsed time in one step.\n */\nexport function formatHrtime(hrStart: [number, number]): string {\n return formatMs(getElapsedMs(hrStart))\n}\n","import { camelCase, isValidVarName } from '../transformers'\n\nexport type URLObject = {\n url: string\n params?: Record<string, string>\n}\n\ntype ObjectOptions = {\n type?: 'path' | 'template'\n replacer?: (pathParam: string) => string\n stringify?: boolean\n}\n\ntype Options = {\n casing?: 'camelcase'\n}\n\nexport class URLPath {\n path: string\n #options: Options\n\n constructor(path: string, options: Options = {}) {\n this.path = path\n this.#options = options\n\n return this\n }\n\n /**\n * Convert Swagger path to URLPath(syntax of Express)\n * @example /pet/{petId} => /pet/:petId\n */\n get URL(): string {\n return this.toURLPath()\n }\n get isURL(): boolean {\n try {\n const url = new URL(this.path)\n if (url?.href) {\n return true\n }\n } catch (_error) {\n return false\n }\n return false\n }\n\n /**\n * Convert Swagger path to template literals/ template strings(camelcase)\n * @example /pet/{petId} => `/pet/${petId}`\n * @example /account/monetary-accountID => `/account/${monetaryAccountId}`\n * @example /account/userID => `/account/${userId}`\n */\n get template(): string {\n return this.toTemplateString()\n }\n get object(): URLObject | string {\n return this.toObject()\n }\n get params(): Record<string, string> | undefined {\n return this.getParams()\n }\n\n toObject({ type = 'path', replacer, stringify }: ObjectOptions = {}): URLObject | string {\n const object = {\n url: type === 'path' ? this.toURLPath() : this.toTemplateString({ replacer }),\n params: this.getParams(),\n }\n\n if (stringify) {\n if (type === 'template') {\n return JSON.stringify(object).replaceAll(\"'\", '').replaceAll(`\"`, '')\n }\n\n if (object.params) {\n return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll(\"'\", '').replaceAll(`\"`, '')} }`\n }\n\n return `{ url: '${object.url}' }`\n }\n\n return object\n }\n\n /**\n * Convert Swagger path to template literals/ template strings(camelcase)\n * @example /pet/{petId} => `/pet/${petId}`\n * @example /account/monetary-accountID => `/account/${monetaryAccountId}`\n * @example /account/userID => `/account/${userId}`\n */\n toTemplateString({ prefix = '', replacer }: { prefix?: string; replacer?: (pathParam: string) => string } = {}): string {\n const regex = /{(\\w|-)*}/g\n const found = this.path.match(regex)\n let newPath = this.path.replaceAll('{', '${')\n\n if (found) {\n newPath = found.reduce((prev, path) => {\n const pathWithoutBrackets = path.replaceAll('{', '').replaceAll('}', '')\n\n let param = isValidVarName(pathWithoutBrackets) ? pathWithoutBrackets : camelCase(pathWithoutBrackets)\n\n if (this.#options.casing === 'camelcase') {\n param = camelCase(param)\n }\n\n return prev.replace(path, `\\${${replacer ? replacer(param) : param}}`)\n }, this.path)\n }\n\n return `\\`${prefix}${newPath}\\``\n }\n\n getParams(replacer?: (pathParam: string) => string): Record<string, string> | undefined {\n const regex = /{(\\w|-)*}/g\n const found = this.path.match(regex)\n\n if (!found) {\n return undefined\n }\n\n const params: Record<string, string> = {}\n found.forEach((item) => {\n item = item.replaceAll('{', '').replaceAll('}', '')\n\n let param = isValidVarName(item) ? item : camelCase(item)\n\n if (this.#options.casing === 'camelcase') {\n param = camelCase(param)\n }\n\n const key = replacer ? replacer(param) : param\n\n params[key] = key\n }, this.path)\n\n return params\n }\n\n /**\n * Convert Swagger path to URLPath(syntax of Express)\n * @example /pet/{petId} => /pet/:petId\n */\n toURLPath(): string {\n return this.path.replaceAll('{', ':').replaceAll('}', '')\n }\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\nimport { getMode } from '../PluginManager.ts'\n\ntype BarrelData = {\n file?: KubbFile.File\n /**\n * @deprecated use file instead\n */\n type: KubbFile.Mode\n path: string\n name: string\n}\n\nexport class TreeNode {\n data: BarrelData\n parent?: TreeNode\n children: Array<TreeNode> = []\n #cachedLeaves?: Array<TreeNode> = undefined\n\n constructor(data: BarrelData, parent?: TreeNode) {\n this.data = data\n this.parent = parent\n return this\n }\n\n addChild(data: BarrelData): TreeNode {\n const child = new TreeNode(data, this)\n if (!this.children) {\n this.children = []\n }\n this.children.push(child)\n return child\n }\n\n get root(): TreeNode {\n if (!this.parent) {\n return this\n }\n return this.parent.root\n }\n\n get leaves(): Array<TreeNode> {\n if (!this.children || this.children.length === 0) {\n // this is a leaf\n return [this]\n }\n\n if (this.#cachedLeaves) {\n return this.#cachedLeaves\n }\n\n // if not a leaf, return all children's leaves recursively\n const leaves: TreeNode[] = []\n if (this.children) {\n for (let childIndex = 0, { length } = this.children; childIndex < length; childIndex++) {\n leaves.push.apply(leaves, this.children[childIndex]!.leaves)\n }\n }\n\n this.#cachedLeaves = leaves\n\n return leaves\n }\n\n forEach(callback: (treeNode: TreeNode) => void): this {\n if (typeof callback !== 'function') {\n throw new TypeError('forEach() callback must be a function')\n }\n\n // run this node through function\n callback(this)\n\n // do the same for all children\n if (this.children) {\n for (let childIndex = 0, { length } = this.children; childIndex < length; childIndex++) {\n this.children[childIndex]?.forEach(callback)\n }\n }\n\n return this\n }\n\n findDeep(predicate?: (value: TreeNode, index: number, obj: TreeNode[]) => boolean): TreeNode | undefined {\n if (typeof predicate !== 'function') {\n throw new TypeError('find() predicate must be a function')\n }\n\n return this.leaves.find(predicate)\n }\n\n forEachDeep(callback: (treeNode: TreeNode) => void): void {\n if (typeof callback !== 'function') {\n throw new TypeError('forEach() callback must be a function')\n }\n\n this.leaves.forEach(callback)\n }\n\n filterDeep(callback: (treeNode: TreeNode) => boolean): Array<TreeNode> {\n if (typeof callback !== 'function') {\n throw new TypeError('filter() callback must be a function')\n }\n\n return this.leaves.filter(callback)\n }\n\n mapDeep<T>(callback: (treeNode: TreeNode) => T): Array<T> {\n if (typeof callback !== 'function') {\n throw new TypeError('map() callback must be a function')\n }\n\n return this.leaves.map(callback)\n }\n\n public static build(files: KubbFile.File[], root?: string): TreeNode | null {\n try {\n const filteredTree = buildDirectoryTree(files, root)\n\n if (!filteredTree) {\n return null\n }\n\n const treeNode = new TreeNode({\n name: filteredTree.name,\n path: filteredTree.path,\n file: filteredTree.file,\n type: getMode(filteredTree.path),\n })\n\n const recurse = (node: typeof treeNode, item: DirectoryTree) => {\n const subNode = node.addChild({\n name: item.name,\n path: item.path,\n file: item.file,\n type: getMode(item.path),\n })\n\n if (item.children?.length) {\n item.children?.forEach((child) => {\n recurse(subNode, child)\n })\n }\n }\n\n filteredTree.children?.forEach((child) => {\n recurse(treeNode, child)\n })\n\n return treeNode\n } catch (error) {\n throw new Error('Something went wrong with creating barrel files with the TreeNode class', { cause: error })\n }\n }\n}\n\nexport type DirectoryTree = {\n name: string\n path: string\n file?: KubbFile.File\n children: Array<DirectoryTree>\n}\n\nconst normalizePath = (p: string): string => p.replace(/\\\\/g, '/')\n\nexport function buildDirectoryTree(files: Array<KubbFile.File>, rootFolder = ''): DirectoryTree | null {\n const normalizedRootFolder = normalizePath(rootFolder)\n const rootPrefix = normalizedRootFolder.endsWith('/') ? normalizedRootFolder : `${normalizedRootFolder}/`\n\n const filteredFiles = files.filter((file) => {\n const normalizedFilePath = normalizePath(file.path)\n return rootFolder ? normalizedFilePath.startsWith(rootPrefix) && !normalizedFilePath.endsWith('.json') : !normalizedFilePath.endsWith('.json')\n })\n\n if (filteredFiles.length === 0) {\n return null // No files match the root folder\n }\n\n const root: DirectoryTree = {\n name: rootFolder || '',\n path: rootFolder || '',\n children: [],\n }\n\n filteredFiles.forEach((file) => {\n const path = file.path.slice(rootFolder.length)\n const parts = path.split('/')\n let currentLevel: DirectoryTree[] = root.children\n let currentPath = rootFolder\n\n parts.forEach((part, index) => {\n if (index !== 0) {\n currentPath += `/${part}`\n } else {\n currentPath += `${part}`\n }\n\n let existingNode = currentLevel.find((node) => node.name === part)\n\n if (!existingNode) {\n if (index === parts.length - 1) {\n // If it's the last part, it's a file\n existingNode = {\n name: part,\n file,\n path: currentPath,\n } as DirectoryTree\n } else {\n // Otherwise, it's a folder\n existingNode = {\n name: part,\n path: currentPath,\n children: [],\n } as DirectoryTree\n }\n currentLevel.push(existingNode)\n }\n\n // Move to the next level if it's a folder\n if (!existingNode.file) {\n currentLevel = existingNode.children\n }\n })\n })\n\n return root\n}\n","/** biome-ignore-all lint/suspicious/useIterableCallbackReturn: not needed */\nimport { join } from 'node:path'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { getRelativePath } from './fs/index.ts'\n\nimport type { FileMetaBase } from './utils/getBarrelFiles.ts'\nimport { TreeNode } from './utils/TreeNode.ts'\n\ntype BarrelManagerOptions = {}\n\nexport class BarrelManager {\n constructor(_options: BarrelManagerOptions = {}) {\n return this\n }\n\n getFiles({ files: generatedFiles, root }: { files: KubbFile.File[]; root?: string; meta?: FileMetaBase | undefined }): Array<KubbFile.File> {\n const cachedFiles = new Map<KubbFile.Path, KubbFile.File>()\n\n TreeNode.build(generatedFiles, root)?.forEach((treeNode) => {\n if (!treeNode || !treeNode.children || !treeNode.parent?.data.path) {\n return undefined\n }\n\n const barrelFile: KubbFile.File = {\n path: join(treeNode.parent?.data.path, 'index.ts') as KubbFile.Path,\n baseName: 'index.ts',\n exports: [],\n sources: [],\n }\n const previousBarrelFile = cachedFiles.get(barrelFile.path)\n const leaves = treeNode.leaves\n\n leaves.forEach((item) => {\n if (!item.data.name) {\n return undefined\n }\n\n const sources = item.data.file?.sources || []\n\n sources.forEach((source) => {\n if (!item.data.file?.path || !source.isIndexable || !source.name) {\n return undefined\n }\n const alreadyContainInPreviousBarrelFile = previousBarrelFile?.sources.some(\n (item) => item.name === source.name && item.isTypeOnly === source.isTypeOnly,\n )\n\n if (alreadyContainInPreviousBarrelFile) {\n return undefined\n }\n\n if (!barrelFile.exports) {\n barrelFile.exports = []\n }\n\n // true when we have a subdirectory that also contains barrel files\n const isSubExport = !!treeNode.parent?.data.path?.split?.('/')?.length\n\n if (isSubExport) {\n barrelFile.exports.push({\n name: [source.name],\n path: getRelativePath(treeNode.parent?.data.path, item.data.path),\n isTypeOnly: source.isTypeOnly,\n })\n } else {\n barrelFile.exports.push({\n name: [source.name],\n path: `./${item.data.file.baseName}`,\n isTypeOnly: source.isTypeOnly,\n })\n }\n\n barrelFile.sources.push({\n name: source.name,\n isTypeOnly: source.isTypeOnly,\n //TODO use parser to generate import\n value: '',\n isExportable: false,\n isIndexable: false,\n })\n })\n })\n\n if (previousBarrelFile) {\n previousBarrelFile.sources.push(...barrelFile.sources)\n previousBarrelFile.exports?.push(...(barrelFile.exports || []))\n } else {\n cachedFiles.set(barrelFile.path, barrelFile)\n }\n })\n\n return [...cachedFiles.values()]\n }\n}\n","import { join } from 'node:path'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport { BarrelManager } from '../BarrelManager.ts'\nimport type { BarrelType, Plugin } from '../types.ts'\n\nexport type FileMetaBase = {\n pluginKey?: Plugin['key']\n}\n\ntype AddIndexesProps = {\n type: BarrelType | false | undefined\n /**\n * Root based on root and output.path specified in the config\n */\n root: string\n /**\n * Output for plugin\n */\n output: {\n path: string\n }\n group?: {\n output: string\n exportAs: string\n }\n\n meta?: FileMetaBase\n}\n\nfunction trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n\nexport async function getBarrelFiles(files: Array<KubbFile.ResolvedFile>, { type, meta = {}, root, output }: AddIndexesProps): Promise<KubbFile.File[]> {\n if (!type || type === 'propagate') {\n return []\n }\n\n const barrelManager = new BarrelManager({})\n\n const pathToBuildFrom = join(root, output.path)\n\n if (trimExtName(pathToBuildFrom).endsWith('index')) {\n return []\n }\n\n const barrelFiles = barrelManager.getFiles({\n files,\n root: pathToBuildFrom,\n meta,\n })\n\n if (type === 'all') {\n return barrelFiles.map((file) => {\n return {\n ...file,\n exports: file.exports?.map((exportItem) => {\n return {\n ...exportItem,\n name: undefined,\n }\n }),\n }\n })\n }\n\n return barrelFiles.map((indexFile) => {\n return {\n ...indexFile,\n meta,\n }\n })\n}\n"],"x_google_ignoreList":[1,2],"mappings":";;;;;;;AAAA,IAAa,wBAAb,cAA2C,MAAM;;;;ACKjD,IAAM,OAAN,MAAW;CACV;CACA;CAEA,YAAY,OAAO;AAClB,OAAK,QAAQ;;;AAIf,IAAqB,QAArB,MAA2B;CAC1B;CACA;CACA;CAEA,cAAc;AACb,OAAK,OAAO;;CAGb,QAAQ,OAAO;EACd,MAAM,OAAO,IAAI,KAAK,MAAM;AAE5B,MAAI,MAAKA,MAAO;AACf,SAAKC,KAAM,OAAO;AAClB,SAAKA,OAAQ;SACP;AACN,SAAKD,OAAQ;AACb,SAAKC,OAAQ;;AAGd,QAAKC;;CAGN,UAAU;EACT,MAAM,UAAU,MAAKF;AACrB,MAAI,CAAC,QACJ;AAGD,QAAKA,OAAQ,MAAKA,KAAM;AACxB,QAAKE;AAGL,MAAI,CAAC,MAAKF,KACT,OAAKC,OAAQ;AAGd,SAAO,QAAQ;;CAGhB,OAAO;AACN,MAAI,CAAC,MAAKD,KACT;AAGD,SAAO,MAAKA,KAAM;;CAMnB,QAAQ;AACP,QAAKA,OAAQ;AACb,QAAKC,OAAQ;AACb,QAAKC,OAAQ;;CAGd,IAAI,OAAO;AACV,SAAO,MAAKA;;CAGb,EAAG,OAAO,YAAY;EACrB,IAAI,UAAU,MAAKF;AAEnB,SAAO,SAAS;AACf,SAAM,QAAQ;AACd,aAAU,QAAQ;;;CAIpB,CAAE,QAAQ;AACT,SAAO,MAAKA,KACX,OAAM,KAAK,SAA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;AAEF,SAAO,CAAC,GAAG,YAAY,QAAQ,CAAC;;;;;;AC9DpC,SAAS,YAAY,MAAsB;AACzC,QAAO,KAAK,QAAQ,aAAa,GAAG;;AAGtC,eAAsB,eAAe,OAAqC,EAAE,MAAM,OAAO,EAAE,EAAE,MAAM,UAAqD;AACtJ,KAAI,CAAC,QAAQ,SAAS,YACpB,QAAO,EAAE;CAGX,MAAM,gBAAgB,IAAI,cAAc,EAAE,CAAC;CAE3C,MAAM,kBAAkB,KAAK,MAAM,OAAO,KAAK;AAE/C,KAAI,YAAY,gBAAgB,CAAC,SAAS,QAAQ,CAChD,QAAO,EAAE;CAGX,MAAM,cAAc,cAAc,SAAS;EACzC;EACA,MAAM;EACN;EACD,CAAC;AAEF,KAAI,SAAS,MACX,QAAO,YAAY,KAAK,SAAS;AAC/B,SAAO;GACL,GAAG;GACH,SAAS,KAAK,SAAS,KAAK,eAAe;AACzC,WAAO;KACL,GAAG;KACH,MAAM;KACP;KACD;GACH;GACD;AAGJ,QAAO,YAAY,KAAK,cAAc;AACpC,SAAO;GACL,GAAG;GACH;GACD;GACD"}
package/dist/hooks.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_fs = require('./fs-DhLl4-lT.cjs');
1
+ const require_fs = require('./fs-B7S6Neks.cjs');
2
2
  let _kubb_react_fabric = require("@kubb/react-fabric");
3
3
 
4
4
  //#region src/hooks/useMode.ts
package/dist/hooks.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as PluginManager, f as Plugin, m as PluginFactoryOptions } from "./types-icDNKrIP.cjs";
1
+ import { O as PluginManager, f as Plugin, m as PluginFactoryOptions } from "./types-6ENPfetT.cjs";
2
2
  import { KubbFile } from "@kubb/fabric-core/types";
3
3
 
4
4
  //#region src/hooks/useMode.d.ts
package/dist/hooks.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { O as PluginManager, f as Plugin, m as PluginFactoryOptions } from "./types-DZARm27h.js";
1
+ import { O as PluginManager, f as Plugin, m as PluginFactoryOptions } from "./types-AoEOgnSE.js";
2
2
  import { KubbFile } from "@kubb/fabric-core/types";
3
3
 
4
4
  //#region src/hooks/useMode.d.ts
package/dist/index.cjs CHANGED
@@ -1,10 +1,9 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_fs = require('./fs-DhLl4-lT.cjs');
3
- const require_getBarrelFiles = require('./getBarrelFiles-ZPeKtx6a.cjs');
4
- require('./transformers-ClYW4Jl8.cjs');
2
+ const require_fs = require('./fs-B7S6Neks.cjs');
3
+ const require_getBarrelFiles = require('./getBarrelFiles-CKNu_noL.cjs');
4
+ require('./transformers-mwhBtsSu.cjs');
5
5
  let node_path = require("node:path");
6
6
  node_path = require_fs.__toESM(node_path);
7
- let node_perf_hooks = require("node:perf_hooks");
8
7
  let _kubb_react_fabric = require("@kubb/react-fabric");
9
8
  let _kubb_react_fabric_parsers = require("@kubb/react-fabric/parsers");
10
9
  let _kubb_react_fabric_plugins = require("@kubb/react-fabric/plugins");
@@ -74,7 +73,7 @@ function isInputPath(config) {
74
73
 
75
74
  //#endregion
76
75
  //#region package.json
77
- var version = "4.12.5";
76
+ var version = "4.12.7";
78
77
 
79
78
  //#endregion
80
79
  //#region src/utils/diagnostics.ts
@@ -121,9 +120,9 @@ async function setup(options) {
121
120
  logs: [`✓ Input file validated: ${userConfig.input.path}`]
122
121
  });
123
122
  }
124
- } catch (e) {
123
+ } catch (caughtError) {
125
124
  if (isInputPath(userConfig)) {
126
- const error = e;
125
+ const error = caughtError;
127
126
  throw new Error(`Cannot read file/URL defined in \`input.path\` or set with \`kubb generate PATH\` in the CLI of your Kubb config ${userConfig.input.path}`, { cause: error });
128
127
  }
129
128
  }
@@ -215,9 +214,9 @@ async function safeBuild(options, overrides) {
215
214
  try {
216
215
  for (const plugin of pluginManager.plugins) {
217
216
  const context = pluginManager.getContext(plugin);
217
+ const hrStart = process.hrtime();
218
218
  const installer = plugin.install.bind(context);
219
219
  try {
220
- const startTime = node_perf_hooks.performance.now();
221
220
  const timestamp = /* @__PURE__ */ new Date();
222
221
  await events.emit("plugin:start", plugin);
223
222
  await events.emit("debug", {
@@ -225,16 +224,25 @@ async function safeBuild(options, overrides) {
225
224
  logs: ["Installing plugin...", ` • Plugin Key: ${JSON.stringify(plugin.key)}`]
226
225
  });
227
226
  await installer(context);
228
- const duration = Math.round(node_perf_hooks.performance.now() - startTime);
227
+ const duration = require_getBarrelFiles.getElapsedMs(hrStart);
229
228
  pluginTimings.set(plugin.name, duration);
230
- await events.emit("plugin:end", plugin, duration);
229
+ await events.emit("plugin:end", plugin, {
230
+ duration,
231
+ success: true
232
+ });
231
233
  await events.emit("debug", {
232
234
  date: /* @__PURE__ */ new Date(),
233
- logs: [`✓ Plugin installed successfully (${duration}ms)`]
235
+ logs: [`✓ Plugin installed successfully (${require_getBarrelFiles.formatMs(duration)}`]
234
236
  });
235
- } catch (e) {
236
- const error = e;
237
+ } catch (caughtError) {
238
+ const error = caughtError;
237
239
  const errorTimestamp = /* @__PURE__ */ new Date();
240
+ const duration = require_getBarrelFiles.getElapsedMs(hrStart);
241
+ await events.emit("plugin:end", plugin, {
242
+ duration,
243
+ success: false,
244
+ error
245
+ });
238
246
  await events.emit("debug", {
239
247
  date: errorTimestamp,
240
248
  logs: [
@@ -305,14 +313,14 @@ async function safeBuild(options, overrides) {
305
313
  pluginManager,
306
314
  pluginTimings
307
315
  };
308
- } catch (e) {
316
+ } catch (error) {
309
317
  return {
310
318
  failedPlugins,
311
319
  fabric,
312
320
  files: [],
313
321
  pluginManager,
314
322
  pluginTimings,
315
- error: e
323
+ error
316
324
  };
317
325
  }
318
326
  }
@@ -538,8 +546,8 @@ var PackageManager = class PackageManager {
538
546
  if (node_os.default.platform() === "win32") location = (0, node_url.pathToFileURL)(location).href;
539
547
  const module$1 = await import(location);
540
548
  return module$1?.default ?? module$1;
541
- } catch (e) {
542
- console.error(e);
549
+ } catch (error) {
550
+ console.error(error);
543
551
  return;
544
552
  }
545
553
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["#context","#options","AsyncEventEmitter","URLPath","exists","definedConfig: Config","clean","fsPlugin","typescriptParser","write","PluginManager","performance","rootFile: KubbFile.File","getRelativePath","build","Queue","resolve","toPath","process","fsPromises","path","fs","path","#cache","#cwd","#SLASHES","path","mod","os","module","read","readSync","version","#match"],"sources":["../src/BaseGenerator.ts","../src/config.ts","../package.json","../src/utils/diagnostics.ts","../src/build.ts","../src/defineLogger.ts","../src/definePlugin.ts","../../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js","../../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js","../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../src/PackageManager.ts","../src/types.ts"],"sourcesContent":["/**\n * Abstract class that contains the building blocks for plugins to create their own Generator\n * @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137\n */\nexport abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {\n #options: TOptions = {} as TOptions\n #context: TContext = {} as TContext\n\n constructor(options?: TOptions, context?: TContext) {\n if (context) {\n this.#context = context\n }\n\n if (options) {\n this.#options = options\n }\n\n return this\n }\n\n get options(): TOptions {\n return this.#options\n }\n\n get context(): TContext {\n return this.#context\n }\n\n set options(options: TOptions) {\n this.#options = { ...this.#options, ...options }\n }\n\n abstract build(...params: unknown[]): unknown\n}\n","import type { InputPath, UserConfig } from './types.ts'\nimport type { PossiblePromise } from './utils/types.ts'\n\n/**\n * CLI options derived from command-line flags.\n */\nexport type CLIOptions = {\n /** Path to `kubb.config.js` */\n config?: string\n\n /** Enable watch mode for input files */\n watch?: boolean\n\n /**\n * Logging verbosity for CLI usage.\n *\n * - `silent`: hide non-essential logs\n * - `info`: show general logs (non-plugin-related)\n * - `debug`: include detailed plugin lifecycle logs\n * @default 'silent'\n */\n logLevel?: 'silent' | 'info' | 'debug'\n\n /** Run Kubb with Bun */\n bun?: boolean\n}\n\n/**\n * Helper for defining a Kubb configuration.\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(\n config: PossiblePromise<UserConfig | UserConfig[]> | ((cli: CLIOptions) => PossiblePromise<UserConfig | UserConfig[]>),\n): typeof config {\n return config\n}\n\n/**\n * Type guard to check if a given config has an `input.path`.\n */\nexport function isInputPath(config: UserConfig | undefined): config is UserConfig<InputPath> {\n return typeof config?.input === 'object' && config.input !== null && 'path' in config.input\n}\n","","import { version as nodeVersion } from 'node:process'\nimport { version as KubbVersion } from '../../package.json'\n\n/**\n * Get diagnostic information for debugging\n */\nexport function getDiagnosticInfo() {\n return {\n nodeVersion,\n KubbVersion,\n platform: process.platform,\n arch: process.arch,\n cwd: process.cwd(),\n } as const\n}\n","import { join, resolve } from 'node:path'\nimport { performance } from 'node:perf_hooks'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Fabric } from '@kubb/react-fabric'\nimport { createFabric } from '@kubb/react-fabric'\nimport { typescriptParser } from '@kubb/react-fabric/parsers'\nimport { fsPlugin } from '@kubb/react-fabric/plugins'\nimport { isInputPath } from './config.ts'\nimport { clean, exists, getRelativePath, write } from './fs/index.ts'\nimport { PluginManager } from './PluginManager.ts'\nimport type { Config, KubbEvents, Output, Plugin, UserConfig } from './types.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\nimport { getDiagnosticInfo } from './utils/diagnostics.ts'\nimport { URLPath } from './utils/URLPath.ts'\n\ntype BuildOptions = {\n config: UserConfig\n events?: AsyncEventEmitter<KubbEvents>\n}\n\ntype BuildOutput = {\n failedPlugins: Set<{ plugin: Plugin; error: Error }>\n fabric: Fabric\n files: Array<KubbFile.ResolvedFile>\n pluginManager: PluginManager\n pluginTimings: Map<string, number>\n error?: Error\n}\n\ntype SetupResult = {\n events: AsyncEventEmitter<KubbEvents>\n fabric: Fabric\n pluginManager: PluginManager\n}\n\nexport async function setup(options: BuildOptions): Promise<SetupResult> {\n const { config: userConfig, events = new AsyncEventEmitter<KubbEvents>() } = options\n\n const diagnosticInfo = getDiagnosticInfo()\n\n if (Array.isArray(userConfig.input)) {\n await events.emit('warn', 'This feature is still under development — use with caution')\n }\n\n await events.emit('debug', {\n date: new Date(),\n logs: [\n 'Configuration:',\n ` • Name: ${userConfig.name || 'unnamed'}`,\n ` • Root: ${userConfig.root || process.cwd()}`,\n ` • Output: ${userConfig.output?.path || 'not specified'}`,\n ` • Plugins: ${userConfig.plugins?.length || 0}`,\n 'Output Settings:',\n ` • Write: ${userConfig.output?.write !== false ? 'enabled' : 'disabled'}`,\n ` • Formater: ${userConfig.output?.format || 'none'}`,\n ` • Linter: ${userConfig.output?.lint || 'none'}`,\n 'Environment:',\n Object.entries(diagnosticInfo)\n .map(([key, value]) => ` • ${key}: ${value}`)\n .join('\\n'),\n ],\n })\n\n try {\n if (isInputPath(userConfig) && !new URLPath(userConfig.input.path).isURL) {\n await exists(userConfig.input.path)\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`✓ Input file validated: ${userConfig.input.path}`],\n })\n }\n } catch (e) {\n if (isInputPath(userConfig)) {\n const error = e as Error\n\n throw new Error(\n `Cannot read file/URL defined in \\`input.path\\` or set with \\`kubb generate PATH\\` in the CLI of your Kubb config ${userConfig.input.path}`,\n {\n cause: error,\n },\n )\n }\n }\n\n const definedConfig: Config = {\n root: userConfig.root || process.cwd(),\n ...userConfig,\n output: {\n write: true,\n barrelType: 'named',\n extension: {\n '.ts': '.ts',\n },\n defaultBanner: 'simple',\n ...userConfig.output,\n },\n plugins: userConfig.plugins as Config['plugins'],\n }\n\n if (definedConfig.output.clean) {\n await events.emit('debug', {\n date: new Date(),\n logs: ['Cleaning output directories', ` • Output: ${definedConfig.output.path}`, ' • Cache: .kubb'],\n })\n await clean(definedConfig.output.path)\n await clean(join(definedConfig.root, '.kubb'))\n }\n\n const fabric = createFabric()\n fabric.use(fsPlugin, { dryRun: !definedConfig.output.write })\n fabric.use(typescriptParser)\n\n fabric.context.on('files:processing:start', (files) => {\n events.emit('files:processing:start', files)\n events.emit('debug', {\n date: new Date(),\n logs: [`Writing ${files.length} files...`],\n })\n })\n\n fabric.context.on('file:processing:update', async (params) => {\n const { file, source } = params\n await events.emit('file:processing:update', { ...params, config: definedConfig, source })\n\n if (source) {\n await write(file.path, source, { sanity: false })\n }\n })\n\n fabric.context.on('files:processing:end', async (files) => {\n await events.emit('files:processing:end', files)\n await events.emit('debug', {\n date: new Date(),\n logs: ['✓ File write process completed'],\n })\n })\n\n await events.emit('debug', {\n date: new Date(),\n logs: [\n '✓ Fabric initialized',\n ` • File writing: ${definedConfig.output.write ? 'enabled' : 'disabled (dry-run)'}`,\n ` • Barrel type: ${definedConfig.output.barrelType || 'none'}`,\n ],\n })\n\n const pluginManager = new PluginManager(definedConfig, {\n fabric,\n events,\n concurrency: 5,\n })\n\n return {\n events,\n fabric,\n pluginManager,\n }\n}\n\nexport async function build(options: BuildOptions, overrides?: SetupResult): Promise<BuildOutput> {\n const { fabric, files, pluginManager, failedPlugins, pluginTimings, error } = await safeBuild(options, overrides)\n\n if (error) {\n throw error\n }\n\n return {\n failedPlugins,\n fabric,\n files,\n pluginManager,\n pluginTimings,\n error,\n }\n}\n\nexport async function safeBuild(options: BuildOptions, overrides?: SetupResult): Promise<BuildOutput> {\n const { fabric, pluginManager, events } = overrides ? overrides : await setup(options)\n\n const failedPlugins = new Set<{ plugin: Plugin; error: Error }>()\n const pluginTimings = new Map<string, number>()\n const config = pluginManager.config\n\n try {\n for (const plugin of pluginManager.plugins) {\n const context = pluginManager.getContext(plugin)\n\n const installer = plugin.install.bind(context)\n\n try {\n const startTime = performance.now()\n const timestamp = new Date()\n\n await events.emit('plugin:start', plugin)\n\n await events.emit('debug', {\n date: timestamp,\n logs: ['Installing plugin...', ` • Plugin Key: ${JSON.stringify(plugin.key)}`],\n })\n\n await installer(context)\n\n const duration = Math.round(performance.now() - startTime)\n pluginTimings.set(plugin.name, duration)\n\n await events.emit('plugin:end', plugin, duration)\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`✓ Plugin installed successfully (${duration}ms)`],\n })\n } catch (e) {\n const error = e as Error\n const errorTimestamp = new Date()\n\n await events.emit('debug', {\n date: errorTimestamp,\n logs: [\n '✗ Plugin installation failed',\n ` • Plugin Key: ${JSON.stringify(plugin.key)}`,\n ` • Error: ${error.constructor.name} - ${error.message}`,\n ' • Stack Trace:',\n error.stack || 'No stack trace available',\n ],\n })\n\n failedPlugins.add({ plugin, error })\n }\n }\n\n if (config.output.barrelType) {\n const root = resolve(config.root)\n const rootPath = resolve(root, config.output.path, 'index.ts')\n\n await events.emit('debug', {\n date: new Date(),\n logs: ['Generating barrel file', ` • Type: ${config.output.barrelType}`, ` • Path: ${rootPath}`],\n })\n\n const barrelFiles = fabric.files.filter((file) => {\n return file.sources.some((source) => source.isIndexable)\n })\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`Found ${barrelFiles.length} indexable files for barrel export`],\n })\n\n // Build a Map of plugin keys to plugins for efficient lookups\n const pluginKeyMap = new Map<string, Plugin>()\n for (const plugin of pluginManager.plugins) {\n pluginKeyMap.set(JSON.stringify(plugin.key), plugin)\n }\n\n const rootFile: KubbFile.File = {\n path: rootPath,\n baseName: 'index.ts',\n exports: barrelFiles\n .flatMap((file) => {\n const containsOnlyTypes = file.sources?.every((source) => source.isTypeOnly)\n\n return file.sources\n ?.map((source) => {\n if (!file.path || !source.isIndexable) {\n return undefined\n }\n\n // validate of the file is coming from plugin x, needs pluginKey on every file TODO update typing\n const meta = file.meta as any\n const plugin = meta?.pluginKey ? pluginKeyMap.get(JSON.stringify(meta.pluginKey)) : undefined\n const pluginOptions = plugin?.options as {\n output?: Output<any>\n }\n\n if (!pluginOptions || pluginOptions?.output?.barrelType === false) {\n return undefined\n }\n\n return {\n name: config.output.barrelType === 'all' ? undefined : [source.name],\n path: getRelativePath(rootPath, file.path),\n isTypeOnly: config.output.barrelType === 'all' ? containsOnlyTypes : source.isTypeOnly,\n } as KubbFile.Export\n })\n .filter(Boolean)\n })\n .filter(Boolean),\n sources: [],\n meta: {},\n }\n\n await fabric.upsertFile(rootFile)\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`✓ Generated barrel file (${rootFile.exports?.length || 0} exports)`],\n })\n }\n\n const files = [...fabric.files]\n\n await fabric.write({ extension: config.output.extension })\n\n return {\n failedPlugins,\n fabric,\n files,\n pluginManager,\n pluginTimings,\n }\n } catch (e) {\n return {\n failedPlugins,\n fabric,\n files: [],\n pluginManager,\n pluginTimings,\n error: e as Error,\n }\n }\n}\n","import type { Logger, LoggerOptions, UserLogger } from './types.ts'\n\nexport function defineLogger<Options extends LoggerOptions = LoggerOptions>(logger: UserLogger<Options>): Logger<Options> {\n return {\n ...logger,\n }\n}\n","import type { PluginFactoryOptions, UserPluginWithLifeCycle } from './types.ts'\n\ntype PluginBuilder<T extends PluginFactoryOptions = PluginFactoryOptions> = (options: T['options']) => UserPluginWithLifeCycle<T>\n\n/**\n * Wraps a plugin builder to make the options parameter optional.\n */\nexport function definePlugin<T extends PluginFactoryOptions = PluginFactoryOptions>(\n build: PluginBuilder<T>,\n): (options?: T['options']) => UserPluginWithLifeCycle<T> {\n return (options) => build(options ?? ({} as T['options']))\n}\n","import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, args) => {\n\t\tqueue.enqueue(run.bind(undefined, fn, resolve, args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n","import pLimit from 'p-limit';\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nexport default async function pLocate(\n\titerable,\n\ttester,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tpreserveOrder = true,\n\t} = {},\n) {\n\tconst limit = pLimit(concurrency);\n\n\t// Start all the promises concurrently with optional limit.\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently.\n\tconst checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n","import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n","import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","import mod from 'node:module'\nimport os from 'node:os'\nimport { pathToFileURL } from 'node:url'\n\nimport { findUp, findUpSync } from 'find-up'\nimport { coerce, satisfies } from 'semver'\n\nimport { read, readSync } from './fs/index.ts'\n\ntype PackageJSON = {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n}\n\ntype DependencyName = string\n\ntype DependencyVersion = string\n\nexport class PackageManager {\n static #cache: Record<DependencyName, DependencyVersion> = {}\n\n #cwd?: string\n #SLASHES = new Set(['/', '\\\\'])\n constructor(workspace?: string) {\n if (workspace) {\n this.#cwd = workspace\n }\n\n return this\n }\n\n set workspace(workspace: string) {\n this.#cwd = workspace\n }\n\n get workspace(): string | undefined {\n return this.#cwd\n }\n\n normalizeDirectory(directory: string): string {\n if (!this.#SLASHES.has(directory[directory.length - 1]!)) {\n return `${directory}/`\n }\n\n return directory\n }\n\n getLocation(path: string): string {\n let location = path\n\n if (this.#cwd) {\n const require = mod.createRequire(this.normalizeDirectory(this.#cwd))\n location = require.resolve(path)\n }\n\n return location\n }\n\n async import(path: string): Promise<any | undefined> {\n try {\n let location = this.getLocation(path)\n\n if (os.platform() === 'win32') {\n location = pathToFileURL(location).href\n }\n\n const module = await import(location)\n\n return module?.default ?? module\n } catch (e) {\n console.error(e)\n return undefined\n }\n }\n\n async getPackageJSON(): Promise<PackageJSON | undefined> {\n const pkgPath = await findUp(['package.json'], {\n cwd: this.#cwd,\n })\n if (!pkgPath) {\n return undefined\n }\n\n const json = await read(pkgPath)\n\n return JSON.parse(json) as PackageJSON\n }\n\n getPackageJSONSync(): PackageJSON | undefined {\n const pkgPath = findUpSync(['package.json'], {\n cwd: this.#cwd,\n })\n if (!pkgPath) {\n return undefined\n }\n\n const json = readSync(pkgPath)\n\n return JSON.parse(json) as PackageJSON\n }\n\n static setVersion(dependency: DependencyName, version: DependencyVersion): void {\n PackageManager.#cache[dependency] = version\n }\n\n #match(packageJSON: PackageJSON, dependency: DependencyName | RegExp): string | undefined {\n const dependencies = {\n ...(packageJSON['dependencies'] || {}),\n ...(packageJSON['devDependencies'] || {}),\n }\n\n if (typeof dependency === 'string' && dependencies[dependency]) {\n return dependencies[dependency]\n }\n\n const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency))\n\n return matchedDependency ? dependencies[matchedDependency] : undefined\n }\n\n async getVersion(dependency: DependencyName | RegExp): Promise<DependencyVersion | undefined> {\n if (typeof dependency === 'string' && PackageManager.#cache[dependency]) {\n return PackageManager.#cache[dependency]\n }\n\n const packageJSON = await this.getPackageJSON()\n\n if (!packageJSON) {\n return undefined\n }\n\n return this.#match(packageJSON, dependency)\n }\n\n getVersionSync(dependency: DependencyName | RegExp): DependencyVersion | undefined {\n if (typeof dependency === 'string' && PackageManager.#cache[dependency]) {\n return PackageManager.#cache[dependency]\n }\n\n const packageJSON = this.getPackageJSONSync()\n\n if (!packageJSON) {\n return undefined\n }\n\n return this.#match(packageJSON, dependency)\n }\n\n async isValid(dependency: DependencyName | RegExp, version: DependencyVersion): Promise<boolean> {\n const packageVersion = await this.getVersion(dependency)\n\n if (!packageVersion) {\n return false\n }\n\n if (packageVersion === version) {\n return true\n }\n\n const semVer = coerce(packageVersion)\n\n if (!semVer) {\n throw new Error(`${packageVersion} is not valid`)\n }\n\n return satisfies(semVer, version)\n }\n isValidSync(dependency: DependencyName | RegExp, version: DependencyVersion): boolean {\n const packageVersion = this.getVersionSync(dependency)\n\n if (!packageVersion) {\n return false\n }\n\n if (version === 'next' && packageVersion === version) {\n return true\n }\n\n const semVer = coerce(packageVersion)\n\n if (!semVer) {\n return false\n }\n\n return satisfies(semVer, version)\n }\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Fabric } from '@kubb/react-fabric'\nimport type { KubbEvents } from './Kubb.ts'\nimport type { PluginManager } from './PluginManager.ts'\nimport type { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\nimport type { PossiblePromise } from './utils/types.ts'\n\ndeclare global {\n namespace Kubb {\n interface PluginContext {}\n }\n}\n\n/**\n * Config used in `kubb.config.ts`\n *\n * @example\n * import { defineConfig } from '@kubb/core'\n * export default defineConfig({\n * ...\n * })\n */\nexport type UserConfig<TInput = Input> = Omit<Config<TInput>, 'root' | 'plugins'> & {\n /**\n * The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.\n * @default process.cwd()\n */\n root?: string\n /**\n * An array of Kubb plugins used for generation. Each plugin may have additional configurable options (defined within the plugin itself). If a plugin relies on another plugin, an error will occur if the required dependency is missing. Refer to “pre” for more details.\n */\n // inject needs to be omitted because else we have a clash with the PluginManager instance\n plugins?: Array<Omit<UnknownUserPlugin, 'inject'>>\n}\n\nexport type InputPath = {\n /**\n * Specify your Swagger/OpenAPI file, either as an absolute path or a path relative to the root.\n */\n path: string\n}\n\nexport type InputData = {\n /**\n * A `string` or `object` that contains your Swagger/OpenAPI data.\n */\n data: string | unknown\n}\n\ntype Input = InputPath | InputData | Array<InputPath>\n\nexport type BarrelType = 'all' | 'named' | 'propagate'\n\n/**\n * @private\n */\nexport type Config<TInput = Input> = {\n /**\n * The name to display in the CLI output.\n */\n name?: string\n /**\n * The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.\n * @default process.cwd()\n */\n root: string\n /**\n * You can use either `input.path` or `input.data`, depending on your specific needs.\n */\n input: TInput\n output: {\n /**\n * The path where all generated files will be exported.\n * This can be an absolute path or a path relative to the specified root option.\n */\n path: string\n /**\n * Clean the output directory before each build.\n */\n clean?: boolean\n /**\n * Save files to the file system.\n * @default true\n */\n write?: boolean\n /**\n * Specifies the formatting tool to be used.\n * @default prettier\n *\n * Possible values:\n * - 'prettier': Uses Prettier for code formatting.\n * - 'biome': Uses Biome for code formatting.\n *\n */\n format?: 'prettier' | 'biome' | false\n /**\n * Specifies the linter that should be used to analyze the code.\n * The accepted values indicate different linting tools.\n *\n * Possible values:\n * - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.\n * - 'biome': Represents the Biome linter, a modern tool for code scanning.\n * - 'oxlint': Represents the Oxlint tool for linting purposes.\n *\n */\n lint?: 'eslint' | 'biome' | 'oxlint' | false\n /**\n * Override the extension to the generated imports and exports, by default each plugin will add an extension\n * @default { '.ts': '.ts'}\n */\n extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>\n /**\n * Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.\n * @default 'named'\n */\n barrelType?: Exclude<BarrelType, 'propagate'> | false\n /**\n * Add a default banner to the beginning of every generated file. This makes it clear that the file was generated by Kubb.\n * - 'simple': will only add banner with link to Kubb\n * - 'full': will add source, title, description and the OpenAPI version used\n * @default 'simple'\n */\n defaultBanner?: 'simple' | 'full' | false\n }\n /**\n * An array of Kubb plugins that will be used in the generation.\n * Each plugin may include additional configurable options(defined in the plugin itself).\n * If a plugin depends on another plugin, an error will be returned if the required dependency is missing. See pre for more details.\n */\n plugins?: Array<Plugin>\n /**\n * Hooks that will be called when a specific action is triggered in Kubb.\n */\n hooks?: {\n /**\n * Hook that will be triggered at the end of all executions.\n * Useful for running Prettier or ESLint to format/lint your code.\n */\n done?: string | Array<string>\n }\n}\n\n// plugin\n\nexport type PluginFactoryOptions<\n /**\n * Name to be used for the plugin, this will also be used for they key.\n */\n TName extends string = string,\n /**\n * Options of the plugin.\n */\n TOptions extends object = object,\n /**\n * Options of the plugin that can be used later on, see `options` inside your plugin config.\n */\n TResolvedOptions extends object = TOptions,\n /**\n * Context that you want to expose to other plugins.\n */\n TContext = any,\n /**\n * When calling `resolvePath` you can specify better types.\n */\n TResolvePathOptions extends object = object,\n> = {\n name: TName\n /**\n * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`\n */\n key: PluginKey<TName | string>\n options: TOptions\n resolvedOptions: TResolvedOptions\n context: TContext\n resolvePathOptions: TResolvePathOptions\n}\n\nexport type PluginKey<TName> = [name: TName, identifier?: string | number]\n\nexport type GetPluginFactoryOptions<TPlugin extends UserPlugin> = TPlugin extends UserPlugin<infer X> ? X : never\n\nexport type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n /**\n * Unique name used for the plugin\n * The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.\n * @example @kubb/typescript\n */\n name: TOptions['name']\n /**\n * Options set for a specific plugin(see kubb.config.js), passthrough of options.\n */\n options: TOptions['resolvedOptions']\n /**\n * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.\n * Can be used to validate dependent plugins.\n */\n pre?: Array<string>\n /**\n * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.\n */\n post?: Array<string>\n inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context']\n}\n\nexport type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>\n\ntype UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any>>\n\nexport type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n /**\n * Unique name used for the plugin\n * @example @kubb/typescript\n */\n name: TOptions['name']\n /**\n * Internal key used when a developer uses more than one of the same plugin\n * @private\n */\n key: TOptions['key']\n /**\n * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.\n * Can be used to validate dependent plugins.\n */\n pre?: Array<string>\n /**\n * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.\n */\n post?: Array<string>\n /**\n * Options set for a specific plugin(see kubb.config.js), passthrough of options.\n */\n options: TOptions['resolvedOptions']\n\n install: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => PossiblePromise<void>\n /**\n * Define a context that can be used by other plugins, see `PluginManager' where we convert from `UserPlugin` to `Plugin`(used when calling `definePlugin`).\n */\n inject: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context']\n}\n\nexport type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>\n\nexport type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n /**\n * Start of the lifecycle of a plugin.\n * @type hookParallel\n */\n install?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => PossiblePromise<void>\n /**\n * Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).\n * Options can als be included.\n * @type hookFirst\n * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'\n */\n resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.Path\n /**\n * Resolve to a name based on a string.\n * Useful when converting to PascalCase or camelCase.\n * @type hookFirst\n * @example ('pet') => 'Pet'\n */\n resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string\n}\n\nexport type PluginLifecycleHooks = keyof PluginLifecycle\n\nexport type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>\n\nexport type ResolvePathParams<TOptions = object> = {\n pluginKey?: Plugin['key']\n baseName: KubbFile.BaseName\n mode?: KubbFile.Mode\n /**\n * Options to be passed to 'resolvePath' 3th parameter\n */\n options?: TOptions\n}\n\nexport type ResolveNameParams = {\n name: string\n pluginKey?: Plugin['key']\n /**\n * `file` will be used to customize the name of the created file(use of camelCase)\n * `function` can be used to customize the exported functions(use of camelCase)\n * `type` is a special type for TypeScript(use of PascalCase)\n * `const` can be used for variables(use of camelCase)\n */\n type?: 'file' | 'function' | 'type' | 'const'\n}\n\nexport type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n fabric: Fabric\n config: Config\n pluginManager: PluginManager\n /**\n * Only add when the file does not exist yet\n */\n addFile: (...file: Array<KubbFile.File>) => Promise<void>\n /**\n * merging multiple sources into the same output file\n */\n upsertFile: (...file: Array<KubbFile.File>) => Promise<void>\n events: AsyncEventEmitter<KubbEvents>\n mode: KubbFile.Mode\n /**\n * Current plugin\n */\n plugin: Plugin<TOptions>\n} & Kubb.PluginContext\n/**\n * Specify the export location for the files and define the behavior of the output\n */\nexport type Output<TOptions> = {\n /**\n * Path to the output folder or file that will contain the generated code\n */\n path: string\n /**\n * Define what needs to be exported, here you can also disable the export of barrel files\n * @default 'named'\n */\n barrelType?: BarrelType | false\n /**\n * Add a banner text in the beginning of every file\n */\n banner?: string | ((options: TOptions) => string)\n /**\n * Add a footer text in the beginning of every file\n */\n footer?: string | ((options: TOptions) => string)\n}\n\ntype GroupContext = {\n group: string\n}\n\nexport type Group = {\n /**\n * Define a type where to group the files on\n */\n type: 'tag' | 'path'\n /**\n * Return the name of a group based on the group name, this will be used for the file and name generation\n */\n name?: (context: GroupContext) => string\n}\n\nexport const LogLevel = {\n silent: Number.NEGATIVE_INFINITY,\n error: 0,\n warn: 1,\n info: 3,\n verbose: 4,\n debug: 5,\n} as const\n\nexport type LoggerOptions = {\n /**\n * @default 3\n */\n logLevel: (typeof LogLevel)[keyof typeof LogLevel]\n}\n\n/**\n * Shared context passed to all plugins, parsers, and Fabric internals.\n */\nexport interface LoggerContext extends AsyncEventEmitter<KubbEvents> {}\n\ntype Install<TOptions = unknown> = (context: LoggerContext, options?: TOptions) => void | Promise<void>\n\nexport type Logger<TOptions extends LoggerOptions = LoggerOptions> = {\n name: string\n install: Install<TOptions>\n}\n\nexport type UserLogger<TOptions extends LoggerOptions = LoggerOptions> = Omit<Logger<TOptions>, 'logLevel'>\n\nexport type { KubbEvents } from './Kubb.ts'\n"],"x_google_ignoreList":[7,8,9,10,11],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAsB,gBAAtB,MAA4E;CAC1E,WAAqB,EAAE;CACvB,WAAqB,EAAE;CAEvB,YAAY,SAAoB,SAAoB;AAClD,MAAI,QACF,OAAKA,UAAW;AAGlB,MAAI,QACF,OAAKC,UAAW;AAGlB,SAAO;;CAGT,IAAI,UAAoB;AACtB,SAAO,MAAKA;;CAGd,IAAI,UAAoB;AACtB,SAAO,MAAKD;;CAGd,IAAI,QAAQ,SAAmB;AAC7B,QAAKC,UAAW;GAAE,GAAG,MAAKA;GAAU,GAAG;GAAS;;;;;;;;;;;;;;;;;;;;ACYpD,SAAgB,aACd,QACe;AACf,QAAO;;;;;AAMT,SAAgB,YAAY,QAAiE;AAC3F,QAAO,OAAO,QAAQ,UAAU,YAAY,OAAO,UAAU,QAAQ,UAAU,OAAO;;;;;;;;;;;;AE7CxF,SAAgB,oBAAoB;AAClC,QAAO;EACL;EACA;EACA,UAAU,QAAQ;EAClB,MAAM,QAAQ;EACd,KAAK,QA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AAO;EAGT,MAAM,4BAAgB,eAAe;AAErC,MAAI,CAAC,OACH,QAAO;AAGT,+BAAiB,QAAQA,UAAQ;;;;;;ACmKrC,MAAa,WAAW;CACtB,QAAQ,OAAO;CACf,OAAO;CACP,MAAM;CACN,MAAM;CACN,SAAS;CACT,OAAO;CACR"}
1
+ {"version":3,"file":"index.cjs","names":["#context","#options","AsyncEventEmitter","URLPath","exists","definedConfig: Config","clean","fsPlugin","typescriptParser","write","PluginManager","getElapsedMs","formatMs","rootFile: KubbFile.File","getRelativePath","build","Queue","resolve","toPath","process","fsPromises","path","fs","path","#cache","#cwd","#SLASHES","path","mod","os","module","read","readSync","version","#match"],"sources":["../src/BaseGenerator.ts","../src/config.ts","../package.json","../src/utils/diagnostics.ts","../src/build.ts","../src/defineLogger.ts","../src/definePlugin.ts","../../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js","../../../node_modules/.pnpm/p-locate@6.0.0/node_modules/p-locate/index.js","../../../node_modules/.pnpm/locate-path@7.2.0/node_modules/locate-path/index.js","../../../node_modules/.pnpm/unicorn-magic@0.1.0/node_modules/unicorn-magic/node.js","../../../node_modules/.pnpm/find-up@7.0.0/node_modules/find-up/index.js","../src/PackageManager.ts","../src/types.ts"],"sourcesContent":["/**\n * Abstract class that contains the building blocks for plugins to create their own Generator\n * @link idea based on https://github.com/colinhacks/zod/blob/master/src/types.ts#L137\n */\nexport abstract class BaseGenerator<TOptions = unknown, TContext = unknown> {\n #options: TOptions = {} as TOptions\n #context: TContext = {} as TContext\n\n constructor(options?: TOptions, context?: TContext) {\n if (context) {\n this.#context = context\n }\n\n if (options) {\n this.#options = options\n }\n\n return this\n }\n\n get options(): TOptions {\n return this.#options\n }\n\n get context(): TContext {\n return this.#context\n }\n\n set options(options: TOptions) {\n this.#options = { ...this.#options, ...options }\n }\n\n abstract build(...params: unknown[]): unknown\n}\n","import type { InputPath, UserConfig } from './types.ts'\nimport type { PossiblePromise } from './utils/types.ts'\n\n/**\n * CLI options derived from command-line flags.\n */\nexport type CLIOptions = {\n /** Path to `kubb.config.js` */\n config?: string\n\n /** Enable watch mode for input files */\n watch?: boolean\n\n /**\n * Logging verbosity for CLI usage.\n *\n * - `silent`: hide non-essential logs\n * - `info`: show general logs (non-plugin-related)\n * - `debug`: include detailed plugin lifecycle logs\n * @default 'silent'\n */\n logLevel?: 'silent' | 'info' | 'debug'\n\n /** Run Kubb with Bun */\n bun?: boolean\n}\n\n/**\n * Helper for defining a Kubb configuration.\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(\n config: PossiblePromise<UserConfig | UserConfig[]> | ((cli: CLIOptions) => PossiblePromise<UserConfig | UserConfig[]>),\n): typeof config {\n return config\n}\n\n/**\n * Type guard to check if a given config has an `input.path`.\n */\nexport function isInputPath(config: UserConfig | undefined): config is UserConfig<InputPath> {\n return typeof config?.input === 'object' && config.input !== null && 'path' in config.input\n}\n","","import { version as nodeVersion } from 'node:process'\nimport { version as KubbVersion } from '../../package.json'\n\n/**\n * Get diagnostic information for debugging\n */\nexport function getDiagnosticInfo() {\n return {\n nodeVersion,\n KubbVersion,\n platform: process.platform,\n arch: process.arch,\n cwd: process.cwd(),\n } as const\n}\n","import { join, resolve } from 'node:path'\nimport type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Fabric } from '@kubb/react-fabric'\nimport { createFabric } from '@kubb/react-fabric'\nimport { typescriptParser } from '@kubb/react-fabric/parsers'\nimport { fsPlugin } from '@kubb/react-fabric/plugins'\nimport { isInputPath } from './config.ts'\nimport { clean, exists, getRelativePath, write } from './fs/index.ts'\nimport { PluginManager } from './PluginManager.ts'\nimport type { Config, KubbEvents, Output, Plugin, UserConfig } from './types.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\nimport { getDiagnosticInfo } from './utils/diagnostics.ts'\nimport { formatMs, getElapsedMs } from './utils/formatHrtime.ts'\nimport { URLPath } from './utils/URLPath.ts'\n\ntype BuildOptions = {\n config: UserConfig\n events?: AsyncEventEmitter<KubbEvents>\n}\n\ntype BuildOutput = {\n failedPlugins: Set<{ plugin: Plugin; error: Error }>\n fabric: Fabric\n files: Array<KubbFile.ResolvedFile>\n pluginManager: PluginManager\n pluginTimings: Map<string, number>\n error?: Error\n}\n\ntype SetupResult = {\n events: AsyncEventEmitter<KubbEvents>\n fabric: Fabric\n pluginManager: PluginManager\n}\n\nexport async function setup(options: BuildOptions): Promise<SetupResult> {\n const { config: userConfig, events = new AsyncEventEmitter<KubbEvents>() } = options\n\n const diagnosticInfo = getDiagnosticInfo()\n\n if (Array.isArray(userConfig.input)) {\n await events.emit('warn', 'This feature is still under development — use with caution')\n }\n\n await events.emit('debug', {\n date: new Date(),\n logs: [\n 'Configuration:',\n ` • Name: ${userConfig.name || 'unnamed'}`,\n ` • Root: ${userConfig.root || process.cwd()}`,\n ` • Output: ${userConfig.output?.path || 'not specified'}`,\n ` • Plugins: ${userConfig.plugins?.length || 0}`,\n 'Output Settings:',\n ` • Write: ${userConfig.output?.write !== false ? 'enabled' : 'disabled'}`,\n ` • Formater: ${userConfig.output?.format || 'none'}`,\n ` • Linter: ${userConfig.output?.lint || 'none'}`,\n 'Environment:',\n Object.entries(diagnosticInfo)\n .map(([key, value]) => ` • ${key}: ${value}`)\n .join('\\n'),\n ],\n })\n\n try {\n if (isInputPath(userConfig) && !new URLPath(userConfig.input.path).isURL) {\n await exists(userConfig.input.path)\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`✓ Input file validated: ${userConfig.input.path}`],\n })\n }\n } catch (caughtError) {\n if (isInputPath(userConfig)) {\n const error = caughtError as Error\n\n throw new Error(\n `Cannot read file/URL defined in \\`input.path\\` or set with \\`kubb generate PATH\\` in the CLI of your Kubb config ${userConfig.input.path}`,\n {\n cause: error,\n },\n )\n }\n }\n\n const definedConfig: Config = {\n root: userConfig.root || process.cwd(),\n ...userConfig,\n output: {\n write: true,\n barrelType: 'named',\n extension: {\n '.ts': '.ts',\n },\n defaultBanner: 'simple',\n ...userConfig.output,\n },\n plugins: userConfig.plugins as Config['plugins'],\n }\n\n if (definedConfig.output.clean) {\n await events.emit('debug', {\n date: new Date(),\n logs: ['Cleaning output directories', ` • Output: ${definedConfig.output.path}`, ' • Cache: .kubb'],\n })\n await clean(definedConfig.output.path)\n await clean(join(definedConfig.root, '.kubb'))\n }\n\n const fabric = createFabric()\n fabric.use(fsPlugin, { dryRun: !definedConfig.output.write })\n fabric.use(typescriptParser)\n\n fabric.context.on('files:processing:start', (files) => {\n events.emit('files:processing:start', files)\n events.emit('debug', {\n date: new Date(),\n logs: [`Writing ${files.length} files...`],\n })\n })\n\n fabric.context.on('file:processing:update', async (params) => {\n const { file, source } = params\n await events.emit('file:processing:update', {\n ...params,\n config: definedConfig,\n source,\n })\n\n if (source) {\n await write(file.path, source, { sanity: false })\n }\n })\n\n fabric.context.on('files:processing:end', async (files) => {\n await events.emit('files:processing:end', files)\n await events.emit('debug', {\n date: new Date(),\n logs: ['✓ File write process completed'],\n })\n })\n\n await events.emit('debug', {\n date: new Date(),\n logs: [\n '✓ Fabric initialized',\n ` • File writing: ${definedConfig.output.write ? 'enabled' : 'disabled (dry-run)'}`,\n ` • Barrel type: ${definedConfig.output.barrelType || 'none'}`,\n ],\n })\n\n const pluginManager = new PluginManager(definedConfig, {\n fabric,\n events,\n concurrency: 5,\n })\n\n return {\n events,\n fabric,\n pluginManager,\n }\n}\n\nexport async function build(options: BuildOptions, overrides?: SetupResult): Promise<BuildOutput> {\n const { fabric, files, pluginManager, failedPlugins, pluginTimings, error } = await safeBuild(options, overrides)\n\n if (error) {\n throw error\n }\n\n return {\n failedPlugins,\n fabric,\n files,\n pluginManager,\n pluginTimings,\n error,\n }\n}\n\nexport async function safeBuild(options: BuildOptions, overrides?: SetupResult): Promise<BuildOutput> {\n const { fabric, pluginManager, events } = overrides ? overrides : await setup(options)\n\n const failedPlugins = new Set<{ plugin: Plugin; error: Error }>()\n // in ms\n const pluginTimings = new Map<string, number>()\n const config = pluginManager.config\n\n try {\n for (const plugin of pluginManager.plugins) {\n const context = pluginManager.getContext(plugin)\n const hrStart = process.hrtime()\n\n const installer = plugin.install.bind(context)\n\n try {\n const timestamp = new Date()\n\n await events.emit('plugin:start', plugin)\n\n await events.emit('debug', {\n date: timestamp,\n logs: ['Installing plugin...', ` • Plugin Key: ${JSON.stringify(plugin.key)}`],\n })\n\n await installer(context)\n\n const duration = getElapsedMs(hrStart)\n pluginTimings.set(plugin.name, duration)\n\n await events.emit('plugin:end', plugin, { duration, success: true })\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`✓ Plugin installed successfully (${formatMs(duration)}`],\n })\n } catch (caughtError) {\n const error = caughtError as Error\n const errorTimestamp = new Date()\n const duration = getElapsedMs(hrStart)\n\n await events.emit('plugin:end', plugin, {\n duration,\n success: false,\n error,\n })\n\n await events.emit('debug', {\n date: errorTimestamp,\n logs: [\n '✗ Plugin installation failed',\n ` • Plugin Key: ${JSON.stringify(plugin.key)}`,\n ` • Error: ${error.constructor.name} - ${error.message}`,\n ' • Stack Trace:',\n error.stack || 'No stack trace available',\n ],\n })\n\n failedPlugins.add({ plugin, error })\n }\n }\n\n if (config.output.barrelType) {\n const root = resolve(config.root)\n const rootPath = resolve(root, config.output.path, 'index.ts')\n\n await events.emit('debug', {\n date: new Date(),\n logs: ['Generating barrel file', ` • Type: ${config.output.barrelType}`, ` • Path: ${rootPath}`],\n })\n\n const barrelFiles = fabric.files.filter((file) => {\n return file.sources.some((source) => source.isIndexable)\n })\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`Found ${barrelFiles.length} indexable files for barrel export`],\n })\n\n // Build a Map of plugin keys to plugins for efficient lookups\n const pluginKeyMap = new Map<string, Plugin>()\n for (const plugin of pluginManager.plugins) {\n pluginKeyMap.set(JSON.stringify(plugin.key), plugin)\n }\n\n const rootFile: KubbFile.File = {\n path: rootPath,\n baseName: 'index.ts',\n exports: barrelFiles\n .flatMap((file) => {\n const containsOnlyTypes = file.sources?.every((source) => source.isTypeOnly)\n\n return file.sources\n ?.map((source) => {\n if (!file.path || !source.isIndexable) {\n return undefined\n }\n\n // validate of the file is coming from plugin x, needs pluginKey on every file TODO update typing\n const meta = file.meta as any\n const plugin = meta?.pluginKey ? pluginKeyMap.get(JSON.stringify(meta.pluginKey)) : undefined\n const pluginOptions = plugin?.options as {\n output?: Output<any>\n }\n\n if (!pluginOptions || pluginOptions?.output?.barrelType === false) {\n return undefined\n }\n\n return {\n name: config.output.barrelType === 'all' ? undefined : [source.name],\n path: getRelativePath(rootPath, file.path),\n isTypeOnly: config.output.barrelType === 'all' ? containsOnlyTypes : source.isTypeOnly,\n } as KubbFile.Export\n })\n .filter(Boolean)\n })\n .filter(Boolean),\n sources: [],\n meta: {},\n }\n\n await fabric.upsertFile(rootFile)\n\n await events.emit('debug', {\n date: new Date(),\n logs: [`✓ Generated barrel file (${rootFile.exports?.length || 0} exports)`],\n })\n }\n\n const files = [...fabric.files]\n\n await fabric.write({ extension: config.output.extension })\n\n return {\n failedPlugins,\n fabric,\n files,\n pluginManager,\n pluginTimings,\n }\n } catch (error) {\n return {\n failedPlugins,\n fabric,\n files: [],\n pluginManager,\n pluginTimings,\n error: error as Error,\n }\n }\n}\n","import type { Logger, LoggerOptions, UserLogger } from './types.ts'\n\nexport function defineLogger<Options extends LoggerOptions = LoggerOptions>(logger: UserLogger<Options>): Logger<Options> {\n return {\n ...logger,\n }\n}\n","import type { PluginFactoryOptions, UserPluginWithLifeCycle } from './types.ts'\n\ntype PluginBuilder<T extends PluginFactoryOptions = PluginFactoryOptions> = (options: T['options']) => UserPluginWithLifeCycle<T>\n\n/**\n * Wraps a plugin builder to make the options parameter optional.\n */\nexport function definePlugin<T extends PluginFactoryOptions = PluginFactoryOptions>(\n build: PluginBuilder<T>,\n): (options?: T['options']) => UserPluginWithLifeCycle<T> {\n return (options) => build(options ?? ({} as T['options']))\n}\n","import Queue from 'yocto-queue';\n\nexport default function pLimit(concurrency) {\n\tif (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {\n\t\tthrow new TypeError('Expected `concurrency` to be a number from 1 and up');\n\t}\n\n\tconst queue = new Queue();\n\tlet activeCount = 0;\n\n\tconst next = () => {\n\t\tactiveCount--;\n\n\t\tif (queue.size > 0) {\n\t\t\tqueue.dequeue()();\n\t\t}\n\t};\n\n\tconst run = async (fn, resolve, args) => {\n\t\tactiveCount++;\n\n\t\tconst result = (async () => fn(...args))();\n\n\t\tresolve(result);\n\n\t\ttry {\n\t\t\tawait result;\n\t\t} catch {}\n\n\t\tnext();\n\t};\n\n\tconst enqueue = (fn, resolve, args) => {\n\t\tqueue.enqueue(run.bind(undefined, fn, resolve, args));\n\n\t\t(async () => {\n\t\t\t// This function needs to wait until the next microtask before comparing\n\t\t\t// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously\n\t\t\t// when the run function is dequeued and called. The comparison in the if-statement\n\t\t\t// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.\n\t\t\tawait Promise.resolve();\n\n\t\t\tif (activeCount < concurrency && queue.size > 0) {\n\t\t\t\tqueue.dequeue()();\n\t\t\t}\n\t\t})();\n\t};\n\n\tconst generator = (fn, ...args) => new Promise(resolve => {\n\t\tenqueue(fn, resolve, args);\n\t});\n\n\tObject.defineProperties(generator, {\n\t\tactiveCount: {\n\t\t\tget: () => activeCount,\n\t\t},\n\t\tpendingCount: {\n\t\t\tget: () => queue.size,\n\t\t},\n\t\tclearQueue: {\n\t\t\tvalue: () => {\n\t\t\t\tqueue.clear();\n\t\t\t},\n\t\t},\n\t});\n\n\treturn generator;\n}\n","import pLimit from 'p-limit';\n\nclass EndError extends Error {\n\tconstructor(value) {\n\t\tsuper();\n\t\tthis.value = value;\n\t}\n}\n\n// The input can also be a promise, so we await it.\nconst testElement = async (element, tester) => tester(await element);\n\n// The input can also be a promise, so we `Promise.all()` them both.\nconst finder = async element => {\n\tconst values = await Promise.all(element);\n\tif (values[1] === true) {\n\t\tthrow new EndError(values[0]);\n\t}\n\n\treturn false;\n};\n\nexport default async function pLocate(\n\titerable,\n\ttester,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tpreserveOrder = true,\n\t} = {},\n) {\n\tconst limit = pLimit(concurrency);\n\n\t// Start all the promises concurrently with optional limit.\n\tconst items = [...iterable].map(element => [element, limit(testElement, element, tester)]);\n\n\t// Check the promises either serially or concurrently.\n\tconst checkLimit = pLimit(preserveOrder ? 1 : Number.POSITIVE_INFINITY);\n\n\ttry {\n\t\tawait Promise.all(items.map(element => checkLimit(finder, element)));\n\t} catch (error) {\n\t\tif (error instanceof EndError) {\n\t\t\treturn error.value;\n\t\t}\n\n\t\tthrow error;\n\t}\n}\n","import process from 'node:process';\nimport path from 'node:path';\nimport fs, {promises as fsPromises} from 'node:fs';\nimport {fileURLToPath} from 'node:url';\nimport pLocate from 'p-locate';\n\nconst typeMappings = {\n\tdirectory: 'isDirectory',\n\tfile: 'isFile',\n};\n\nfunction checkType(type) {\n\tif (Object.hasOwnProperty.call(typeMappings, type)) {\n\t\treturn;\n\t}\n\n\tthrow new Error(`Invalid type specified: ${type}`);\n}\n\nconst matchType = (type, stat) => stat[typeMappings[type]]();\n\nconst toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n\nexport async function locatePath(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t\tconcurrency,\n\t\tpreserveOrder,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fsPromises.stat : fsPromises.lstat;\n\n\treturn pLocate(paths, async path_ => {\n\t\ttry {\n\t\t\tconst stat = await statFunction(path.resolve(cwd, path_));\n\t\t\treturn matchType(type, stat);\n\t\t} catch {\n\t\t\treturn false;\n\t\t}\n\t}, {concurrency, preserveOrder});\n}\n\nexport function locatePathSync(\n\tpaths,\n\t{\n\t\tcwd = process.cwd(),\n\t\ttype = 'file',\n\t\tallowSymlinks = true,\n\t} = {},\n) {\n\tcheckType(type);\n\tcwd = toPath(cwd);\n\n\tconst statFunction = allowSymlinks ? fs.statSync : fs.lstatSync;\n\n\tfor (const path_ of paths) {\n\t\ttry {\n\t\t\tconst stat = statFunction(path.resolve(cwd, path_), {\n\t\t\t\tthrowIfNoEntry: false,\n\t\t\t});\n\n\t\t\tif (!stat) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (matchType(type, stat)) {\n\t\t\t\treturn path_;\n\t\t\t}\n\t\t} catch {}\n\t}\n}\n","import {fileURLToPath} from 'node:url';\n\nexport function toPath(urlOrPath) {\n\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;\n}\n\nexport * from './default.js';\n","import path from 'node:path';\nimport {locatePath, locatePathSync} from 'locate-path';\nimport {toPath} from 'unicorn-magic';\n\nexport const findUpStop = Symbol('findUpStop');\n\nexport async function findUpMultiple(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt ?? root));\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = async locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePath(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = await name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePath([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\t// eslint-disable-next-line no-await-in-loop\n\t\tconst foundPath = await runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport function findUpMultipleSync(name, options = {}) {\n\tlet directory = path.resolve(toPath(options.cwd) ?? '');\n\tconst {root} = path.parse(directory);\n\tconst stopAt = path.resolve(directory, toPath(options.stopAt) ?? root);\n\tconst limit = options.limit ?? Number.POSITIVE_INFINITY;\n\tconst paths = [name].flat();\n\n\tconst runMatcher = locateOptions => {\n\t\tif (typeof name !== 'function') {\n\t\t\treturn locatePathSync(paths, locateOptions);\n\t\t}\n\n\t\tconst foundPath = name(locateOptions.cwd);\n\t\tif (typeof foundPath === 'string') {\n\t\t\treturn locatePathSync([foundPath], locateOptions);\n\t\t}\n\n\t\treturn foundPath;\n\t};\n\n\tconst matches = [];\n\t// eslint-disable-next-line no-constant-condition\n\twhile (true) {\n\t\tconst foundPath = runMatcher({...options, cwd: directory});\n\n\t\tif (foundPath === findUpStop) {\n\t\t\tbreak;\n\t\t}\n\n\t\tif (foundPath) {\n\t\t\tmatches.push(path.resolve(directory, foundPath));\n\t\t}\n\n\t\tif (directory === stopAt || matches.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\n\t\tdirectory = path.dirname(directory);\n\t}\n\n\treturn matches;\n}\n\nexport async function findUp(name, options = {}) {\n\tconst matches = await findUpMultiple(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport function findUpSync(name, options = {}) {\n\tconst matches = findUpMultipleSync(name, {...options, limit: 1});\n\treturn matches[0];\n}\n\nexport {\n\tpathExists,\n\tpathExistsSync,\n} from 'path-exists';\n","import mod from 'node:module'\nimport os from 'node:os'\nimport { pathToFileURL } from 'node:url'\n\nimport { findUp, findUpSync } from 'find-up'\nimport { coerce, satisfies } from 'semver'\n\nimport { read, readSync } from './fs/index.ts'\n\ntype PackageJSON = {\n dependencies?: Record<string, string>\n devDependencies?: Record<string, string>\n}\n\ntype DependencyName = string\n\ntype DependencyVersion = string\n\nexport class PackageManager {\n static #cache: Record<DependencyName, DependencyVersion> = {}\n\n #cwd?: string\n #SLASHES = new Set(['/', '\\\\'])\n constructor(workspace?: string) {\n if (workspace) {\n this.#cwd = workspace\n }\n\n return this\n }\n\n set workspace(workspace: string) {\n this.#cwd = workspace\n }\n\n get workspace(): string | undefined {\n return this.#cwd\n }\n\n normalizeDirectory(directory: string): string {\n if (!this.#SLASHES.has(directory[directory.length - 1]!)) {\n return `${directory}/`\n }\n\n return directory\n }\n\n getLocation(path: string): string {\n let location = path\n\n if (this.#cwd) {\n const require = mod.createRequire(this.normalizeDirectory(this.#cwd))\n location = require.resolve(path)\n }\n\n return location\n }\n\n async import(path: string): Promise<any | undefined> {\n try {\n let location = this.getLocation(path)\n\n if (os.platform() === 'win32') {\n location = pathToFileURL(location).href\n }\n\n const module = await import(location)\n\n return module?.default ?? module\n } catch (error) {\n console.error(error)\n return undefined\n }\n }\n\n async getPackageJSON(): Promise<PackageJSON | undefined> {\n const pkgPath = await findUp(['package.json'], {\n cwd: this.#cwd,\n })\n if (!pkgPath) {\n return undefined\n }\n\n const json = await read(pkgPath)\n\n return JSON.parse(json) as PackageJSON\n }\n\n getPackageJSONSync(): PackageJSON | undefined {\n const pkgPath = findUpSync(['package.json'], {\n cwd: this.#cwd,\n })\n if (!pkgPath) {\n return undefined\n }\n\n const json = readSync(pkgPath)\n\n return JSON.parse(json) as PackageJSON\n }\n\n static setVersion(dependency: DependencyName, version: DependencyVersion): void {\n PackageManager.#cache[dependency] = version\n }\n\n #match(packageJSON: PackageJSON, dependency: DependencyName | RegExp): string | undefined {\n const dependencies = {\n ...(packageJSON['dependencies'] || {}),\n ...(packageJSON['devDependencies'] || {}),\n }\n\n if (typeof dependency === 'string' && dependencies[dependency]) {\n return dependencies[dependency]\n }\n\n const matchedDependency = Object.keys(dependencies).find((dep) => dep.match(dependency))\n\n return matchedDependency ? dependencies[matchedDependency] : undefined\n }\n\n async getVersion(dependency: DependencyName | RegExp): Promise<DependencyVersion | undefined> {\n if (typeof dependency === 'string' && PackageManager.#cache[dependency]) {\n return PackageManager.#cache[dependency]\n }\n\n const packageJSON = await this.getPackageJSON()\n\n if (!packageJSON) {\n return undefined\n }\n\n return this.#match(packageJSON, dependency)\n }\n\n getVersionSync(dependency: DependencyName | RegExp): DependencyVersion | undefined {\n if (typeof dependency === 'string' && PackageManager.#cache[dependency]) {\n return PackageManager.#cache[dependency]\n }\n\n const packageJSON = this.getPackageJSONSync()\n\n if (!packageJSON) {\n return undefined\n }\n\n return this.#match(packageJSON, dependency)\n }\n\n async isValid(dependency: DependencyName | RegExp, version: DependencyVersion): Promise<boolean> {\n const packageVersion = await this.getVersion(dependency)\n\n if (!packageVersion) {\n return false\n }\n\n if (packageVersion === version) {\n return true\n }\n\n const semVer = coerce(packageVersion)\n\n if (!semVer) {\n throw new Error(`${packageVersion} is not valid`)\n }\n\n return satisfies(semVer, version)\n }\n isValidSync(dependency: DependencyName | RegExp, version: DependencyVersion): boolean {\n const packageVersion = this.getVersionSync(dependency)\n\n if (!packageVersion) {\n return false\n }\n\n if (version === 'next' && packageVersion === version) {\n return true\n }\n\n const semVer = coerce(packageVersion)\n\n if (!semVer) {\n return false\n }\n\n return satisfies(semVer, version)\n }\n}\n","import type { KubbFile } from '@kubb/fabric-core/types'\nimport type { Fabric } from '@kubb/react-fabric'\nimport type { KubbEvents } from './Kubb.ts'\nimport type { PluginManager } from './PluginManager.ts'\nimport type { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\nimport type { PossiblePromise } from './utils/types.ts'\n\ndeclare global {\n namespace Kubb {\n interface PluginContext {}\n }\n}\n\n/**\n * Config used in `kubb.config.ts`\n *\n * @example\n * import { defineConfig } from '@kubb/core'\n * export default defineConfig({\n * ...\n * })\n */\nexport type UserConfig<TInput = Input> = Omit<Config<TInput>, 'root' | 'plugins'> & {\n /**\n * The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.\n * @default process.cwd()\n */\n root?: string\n /**\n * An array of Kubb plugins used for generation. Each plugin may have additional configurable options (defined within the plugin itself). If a plugin relies on another plugin, an error will occur if the required dependency is missing. Refer to “pre” for more details.\n */\n // inject needs to be omitted because else we have a clash with the PluginManager instance\n plugins?: Array<Omit<UnknownUserPlugin, 'inject'>>\n}\n\nexport type InputPath = {\n /**\n * Specify your Swagger/OpenAPI file, either as an absolute path or a path relative to the root.\n */\n path: string\n}\n\nexport type InputData = {\n /**\n * A `string` or `object` that contains your Swagger/OpenAPI data.\n */\n data: string | unknown\n}\n\ntype Input = InputPath | InputData | Array<InputPath>\n\nexport type BarrelType = 'all' | 'named' | 'propagate'\n\n/**\n * @private\n */\nexport type Config<TInput = Input> = {\n /**\n * The name to display in the CLI output.\n */\n name?: string\n /**\n * The project root directory, which can be either an absolute path or a path relative to the location of your `kubb.config.ts` file.\n * @default process.cwd()\n */\n root: string\n /**\n * You can use either `input.path` or `input.data`, depending on your specific needs.\n */\n input: TInput\n output: {\n /**\n * The path where all generated files will be exported.\n * This can be an absolute path or a path relative to the specified root option.\n */\n path: string\n /**\n * Clean the output directory before each build.\n */\n clean?: boolean\n /**\n * Save files to the file system.\n * @default true\n */\n write?: boolean\n /**\n * Specifies the formatting tool to be used.\n * @default prettier\n *\n * Possible values:\n * - 'prettier': Uses Prettier for code formatting.\n * - 'biome': Uses Biome for code formatting.\n *\n */\n format?: 'prettier' | 'biome' | false\n /**\n * Specifies the linter that should be used to analyze the code.\n * The accepted values indicate different linting tools.\n *\n * Possible values:\n * - 'eslint': Represents the use of ESLint, a widely used JavaScript linter.\n * - 'biome': Represents the Biome linter, a modern tool for code scanning.\n * - 'oxlint': Represents the Oxlint tool for linting purposes.\n *\n */\n lint?: 'eslint' | 'biome' | 'oxlint' | false\n /**\n * Override the extension to the generated imports and exports, by default each plugin will add an extension\n * @default { '.ts': '.ts'}\n */\n extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>\n /**\n * Specify how `index.ts` files should be created. You can also disable the generation of barrel files here. While each plugin has its own `barrelType` option, this setting controls the creation of the root barrel file, such as` src/gen/index.ts`.\n * @default 'named'\n */\n barrelType?: Exclude<BarrelType, 'propagate'> | false\n /**\n * Add a default banner to the beginning of every generated file. This makes it clear that the file was generated by Kubb.\n * - 'simple': will only add banner with link to Kubb\n * - 'full': will add source, title, description and the OpenAPI version used\n * @default 'simple'\n */\n defaultBanner?: 'simple' | 'full' | false\n }\n /**\n * An array of Kubb plugins that will be used in the generation.\n * Each plugin may include additional configurable options(defined in the plugin itself).\n * If a plugin depends on another plugin, an error will be returned if the required dependency is missing. See pre for more details.\n */\n plugins?: Array<Plugin>\n /**\n * Hooks that will be called when a specific action is triggered in Kubb.\n */\n hooks?: {\n /**\n * Hook that will be triggered at the end of all executions.\n * Useful for running Prettier or ESLint to format/lint your code.\n */\n done?: string | Array<string>\n }\n}\n\n// plugin\n\nexport type PluginFactoryOptions<\n /**\n * Name to be used for the plugin, this will also be used for they key.\n */\n TName extends string = string,\n /**\n * Options of the plugin.\n */\n TOptions extends object = object,\n /**\n * Options of the plugin that can be used later on, see `options` inside your plugin config.\n */\n TResolvedOptions extends object = TOptions,\n /**\n * Context that you want to expose to other plugins.\n */\n TContext = any,\n /**\n * When calling `resolvePath` you can specify better types.\n */\n TResolvePathOptions extends object = object,\n> = {\n name: TName\n /**\n * Same behaviour like what has been done with `QueryKey` in `@tanstack/react-query`\n */\n key: PluginKey<TName | string>\n options: TOptions\n resolvedOptions: TResolvedOptions\n context: TContext\n resolvePathOptions: TResolvePathOptions\n}\n\nexport type PluginKey<TName> = [name: TName, identifier?: string | number]\n\nexport type GetPluginFactoryOptions<TPlugin extends UserPlugin> = TPlugin extends UserPlugin<infer X> ? X : never\n\nexport type UserPlugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n /**\n * Unique name used for the plugin\n * The name of the plugin follows the format scope:foo-bar or foo-bar, adding scope: can avoid naming conflicts with other plugins.\n * @example @kubb/typescript\n */\n name: TOptions['name']\n /**\n * Options set for a specific plugin(see kubb.config.js), passthrough of options.\n */\n options: TOptions['resolvedOptions']\n /**\n * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.\n * Can be used to validate dependent plugins.\n */\n pre?: Array<string>\n /**\n * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.\n */\n post?: Array<string>\n inject?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context']\n}\n\nexport type UserPluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = UserPlugin<TOptions> & PluginLifecycle<TOptions>\n\ntype UnknownUserPlugin = UserPlugin<PluginFactoryOptions<any, any, any, any, any>>\n\nexport type Plugin<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n /**\n * Unique name used for the plugin\n * @example @kubb/typescript\n */\n name: TOptions['name']\n /**\n * Internal key used when a developer uses more than one of the same plugin\n * @private\n */\n key: TOptions['key']\n /**\n * Specifies the preceding plugins for the current plugin. You can pass an array of preceding plugin names, and the current plugin will be executed after these plugins.\n * Can be used to validate dependent plugins.\n */\n pre?: Array<string>\n /**\n * Specifies the succeeding plugins for the current plugin. You can pass an array of succeeding plugin names, and the current plugin will be executed before these plugins.\n */\n post?: Array<string>\n /**\n * Options set for a specific plugin(see kubb.config.js), passthrough of options.\n */\n options: TOptions['resolvedOptions']\n\n install: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => PossiblePromise<void>\n /**\n * Define a context that can be used by other plugins, see `PluginManager' where we convert from `UserPlugin` to `Plugin`(used when calling `definePlugin`).\n */\n inject: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => TOptions['context']\n}\n\nexport type PluginWithLifeCycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = Plugin<TOptions> & PluginLifecycle<TOptions>\n\nexport type PluginLifecycle<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n /**\n * Start of the lifecycle of a plugin.\n * @type hookParallel\n */\n install?: (this: PluginContext<TOptions>, context: PluginContext<TOptions>) => PossiblePromise<void>\n /**\n * Resolve to a Path based on a baseName(example: `./Pet.ts`) and directory(example: `./models`).\n * Options can als be included.\n * @type hookFirst\n * @example ('./Pet.ts', './src/gen/') => '/src/gen/Pet.ts'\n */\n resolvePath?: (this: PluginContext<TOptions>, baseName: KubbFile.BaseName, mode?: KubbFile.Mode, options?: TOptions['resolvePathOptions']) => KubbFile.Path\n /**\n * Resolve to a name based on a string.\n * Useful when converting to PascalCase or camelCase.\n * @type hookFirst\n * @example ('pet') => 'Pet'\n */\n resolveName?: (this: PluginContext<TOptions>, name: ResolveNameParams['name'], type?: ResolveNameParams['type']) => string\n}\n\nexport type PluginLifecycleHooks = keyof PluginLifecycle\n\nexport type PluginParameter<H extends PluginLifecycleHooks> = Parameters<Required<PluginLifecycle>[H]>\n\nexport type ResolvePathParams<TOptions = object> = {\n pluginKey?: Plugin['key']\n baseName: KubbFile.BaseName\n mode?: KubbFile.Mode\n /**\n * Options to be passed to 'resolvePath' 3th parameter\n */\n options?: TOptions\n}\n\nexport type ResolveNameParams = {\n name: string\n pluginKey?: Plugin['key']\n /**\n * `file` will be used to customize the name of the created file(use of camelCase)\n * `function` can be used to customize the exported functions(use of camelCase)\n * `type` is a special type for TypeScript(use of PascalCase)\n * `const` can be used for variables(use of camelCase)\n */\n type?: 'file' | 'function' | 'type' | 'const'\n}\n\nexport type PluginContext<TOptions extends PluginFactoryOptions = PluginFactoryOptions> = {\n fabric: Fabric\n config: Config\n pluginManager: PluginManager\n /**\n * Only add when the file does not exist yet\n */\n addFile: (...file: Array<KubbFile.File>) => Promise<void>\n /**\n * merging multiple sources into the same output file\n */\n upsertFile: (...file: Array<KubbFile.File>) => Promise<void>\n events: AsyncEventEmitter<KubbEvents>\n mode: KubbFile.Mode\n /**\n * Current plugin\n */\n plugin: Plugin<TOptions>\n} & Kubb.PluginContext\n/**\n * Specify the export location for the files and define the behavior of the output\n */\nexport type Output<TOptions> = {\n /**\n * Path to the output folder or file that will contain the generated code\n */\n path: string\n /**\n * Define what needs to be exported, here you can also disable the export of barrel files\n * @default 'named'\n */\n barrelType?: BarrelType | false\n /**\n * Add a banner text in the beginning of every file\n */\n banner?: string | ((options: TOptions) => string)\n /**\n * Add a footer text in the beginning of every file\n */\n footer?: string | ((options: TOptions) => string)\n}\n\ntype GroupContext = {\n group: string\n}\n\nexport type Group = {\n /**\n * Define a type where to group the files on\n */\n type: 'tag' | 'path'\n /**\n * Return the name of a group based on the group name, this will be used for the file and name generation\n */\n name?: (context: GroupContext) => string\n}\n\nexport const LogLevel = {\n silent: Number.NEGATIVE_INFINITY,\n error: 0,\n warn: 1,\n info: 3,\n verbose: 4,\n debug: 5,\n} as const\n\nexport type LoggerOptions = {\n /**\n * @default 3\n */\n logLevel: (typeof LogLevel)[keyof typeof LogLevel]\n}\n\n/**\n * Shared context passed to all plugins, parsers, and Fabric internals.\n */\nexport interface LoggerContext extends AsyncEventEmitter<KubbEvents> {}\n\ntype Install<TOptions = unknown> = (context: LoggerContext, options?: TOptions) => void | Promise<void>\n\nexport type Logger<TOptions extends LoggerOptions = LoggerOptions> = {\n name: string\n install: Install<TOptions>\n}\n\nexport type UserLogger<TOptions extends LoggerOptions = LoggerOptions> = Omit<Logger<TOptions>, 'logLevel'>\n\nexport type { KubbEvents } from './Kubb.ts'\n"],"x_google_ignoreList":[7,8,9,10,11],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAsB,gBAAtB,MAA4E;CAC1E,WAAqB,EAAE;CACvB,WAAqB,EAAE;CAEvB,YAAY,SAAoB,SAAoB;AAClD,MAAI,QACF,OAAKA,UAAW;AAGlB,MAAI,QACF,OAAKC,UAAW;AAGlB,SAAO;;CAGT,IAAI,UAAoB;AACtB,SAAO,MAAKA;;CAGd,IAAI,UAAoB;AACtB,SAAO,MAAKD;;CAGd,IAAI,QAAQ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AGF,SAAO,MAAKU,MAAO,aAAa,WAAW;;CAG7C,MAAM,QAAQ,YAAqC,WAA8C;EAC/F,MAAM,iBAAiB,MAAM,KAAK,WAAW,WAAW;AAExD,MAAI,CAAC,eACH,QAAO;AAGT,MAAI,mBAAmBD,UACrB,QAAO;EAGT,MAAM,4BAAgB,eAAe;AAErC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,GAAG,eAAe,eAAe;AAGnD,+BAAiB,QAAQA,UAAQ;;CAEnC,YAAY,YAAqC,WAAqC;EACpF,MAAM,iBAAiB,KAAK,eAAe,WAAW;AAEtD,MAAI,CAAC,eACH,QAAO;AAGT,MAAIA,cAAY,UAAU,mBAAmBA,UAC3C,QAAO;EAGT,MAAM,4BAAgB,eAAe;AAErC,MAAI,CAAC,OACH,QAAO;AAGT,+BAAiB,QAAQA,UAAQ;;;;;;ACmKrC,MAAa,WAAW;CACtB,QAAQ,OAAO;CACf,OAAO;CACP,MAAM;CACN,MAAM;CACN,SAAS;CACT,OAAO;CACR"}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AsyncEventEmitter, C as UserLogger, D as KubbEvents, E as PossiblePromise, O as PluginManager, S as UserConfig, T as UserPluginWithLifeCycle, _ as PluginLifecycleHooks, a as InputData, b as ResolveNameParams, c as Logger, d as Output, f as Plugin, g as PluginLifecycle, h as PluginKey, i as Group, k as getMode, l as LoggerContext, m as PluginFactoryOptions, n as Config, o as InputPath, p as PluginContext, r as GetPluginFactoryOptions, s as LogLevel, t as BarrelType, u as LoggerOptions, v as PluginParameter, w as UserPlugin, x as ResolvePathParams, y as PluginWithLifeCycle } from "./types-icDNKrIP.cjs";
2
- import { n as getBarrelFiles, t as FileMetaBase } from "./getBarrelFiles-LW3anr-E.cjs";
1
+ import { A as AsyncEventEmitter, C as UserLogger, D as KubbEvents, E as PossiblePromise, O as PluginManager, S as UserConfig, T as UserPluginWithLifeCycle, _ as PluginLifecycleHooks, a as InputData, b as ResolveNameParams, c as Logger, d as Output, f as Plugin, g as PluginLifecycle, h as PluginKey, i as Group, k as getMode, l as LoggerContext, m as PluginFactoryOptions, n as Config, o as InputPath, p as PluginContext, r as GetPluginFactoryOptions, s as LogLevel, t as BarrelType, u as LoggerOptions, v as PluginParameter, w as UserPlugin, x as ResolvePathParams, y as PluginWithLifeCycle } from "./types-6ENPfetT.cjs";
2
+ import { n as getBarrelFiles, t as FileMetaBase } from "./getBarrelFiles-CSqnakvm.cjs";
3
3
  import { KubbFile } from "@kubb/fabric-core/types";
4
4
  import { Fabric } from "@kubb/react-fabric";
5
5
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AsyncEventEmitter, C as UserLogger, D as KubbEvents, E as PossiblePromise, O as PluginManager, S as UserConfig, T as UserPluginWithLifeCycle, _ as PluginLifecycleHooks, a as InputData, b as ResolveNameParams, c as Logger, d as Output, f as Plugin, g as PluginLifecycle, h as PluginKey, i as Group, k as getMode, l as LoggerContext, m as PluginFactoryOptions, n as Config, o as InputPath, p as PluginContext, r as GetPluginFactoryOptions, s as LogLevel, t as BarrelType, u as LoggerOptions, v as PluginParameter, w as UserPlugin, x as ResolvePathParams, y as PluginWithLifeCycle } from "./types-DZARm27h.js";
2
- import { n as getBarrelFiles, t as FileMetaBase } from "./getBarrelFiles-BEWbZEZf.js";
1
+ import { A as AsyncEventEmitter, C as UserLogger, D as KubbEvents, E as PossiblePromise, O as PluginManager, S as UserConfig, T as UserPluginWithLifeCycle, _ as PluginLifecycleHooks, a as InputData, b as ResolveNameParams, c as Logger, d as Output, f as Plugin, g as PluginLifecycle, h as PluginKey, i as Group, k as getMode, l as LoggerContext, m as PluginFactoryOptions, n as Config, o as InputPath, p as PluginContext, r as GetPluginFactoryOptions, s as LogLevel, t as BarrelType, u as LoggerOptions, v as PluginParameter, w as UserPlugin, x as ResolvePathParams, y as PluginWithLifeCycle } from "./types-AoEOgnSE.js";
2
+ import { n as getBarrelFiles, t as FileMetaBase } from "./getBarrelFiles-BOZ_wYov.js";
3
3
  import { Fabric } from "@kubb/react-fabric";
4
4
  import { KubbFile } from "@kubb/fabric-core/types";
5
5