@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
package/dist/index.js CHANGED
@@ -1,9 +1,8 @@
1
- import { a as exists, i as readSync, n as getRelativePath, o as clean, r as read, t as write } from "./fs-ph1OdgEr.js";
2
- import { a as getMode, c as PromiseManager, i as PluginManager, l as Queue, n as URLPath, r as AsyncEventEmitter, t as getBarrelFiles } from "./getBarrelFiles-BDklg98q.js";
1
+ import { a as exists, i as readSync, n as getRelativePath, o as clean, r as read, t as write } from "./fs-DzeDAeja.js";
2
+ import { a as getElapsedMs, c as getMode, d as PromiseManager, f as Queue, i as formatMs, n as URLPath, o as AsyncEventEmitter, s as PluginManager, t as getBarrelFiles } from "./getBarrelFiles-D14cwdcu.js";
3
3
  import "./transformers-DhOMHEmx.js";
4
4
  import mod from "node:module";
5
5
  import path, { join, resolve } from "node:path";
6
- import { performance } from "node:perf_hooks";
7
6
  import { createFabric } from "@kubb/react-fabric";
8
7
  import { typescriptParser } from "@kubb/react-fabric/parsers";
9
8
  import { fsPlugin } from "@kubb/react-fabric/plugins";
@@ -68,7 +67,7 @@ function isInputPath(config) {
68
67
 
69
68
  //#endregion
70
69
  //#region package.json
71
- var version$1 = "4.12.5";
70
+ var version$1 = "4.12.7";
72
71
 
73
72
  //#endregion
74
73
  //#region src/utils/diagnostics.ts
@@ -115,9 +114,9 @@ async function setup(options) {
115
114
  logs: [`✓ Input file validated: ${userConfig.input.path}`]
116
115
  });
117
116
  }
118
- } catch (e) {
117
+ } catch (caughtError) {
119
118
  if (isInputPath(userConfig)) {
120
- const error = e;
119
+ const error = caughtError;
121
120
  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 });
122
121
  }
123
122
  }
@@ -209,9 +208,9 @@ async function safeBuild(options, overrides) {
209
208
  try {
210
209
  for (const plugin of pluginManager.plugins) {
211
210
  const context = pluginManager.getContext(plugin);
211
+ const hrStart = process.hrtime();
212
212
  const installer = plugin.install.bind(context);
213
213
  try {
214
- const startTime = performance.now();
215
214
  const timestamp = /* @__PURE__ */ new Date();
216
215
  await events.emit("plugin:start", plugin);
217
216
  await events.emit("debug", {
@@ -219,16 +218,25 @@ async function safeBuild(options, overrides) {
219
218
  logs: ["Installing plugin...", ` • Plugin Key: ${JSON.stringify(plugin.key)}`]
220
219
  });
221
220
  await installer(context);
222
- const duration = Math.round(performance.now() - startTime);
221
+ const duration = getElapsedMs(hrStart);
223
222
  pluginTimings.set(plugin.name, duration);
224
- await events.emit("plugin:end", plugin, duration);
223
+ await events.emit("plugin:end", plugin, {
224
+ duration,
225
+ success: true
226
+ });
225
227
  await events.emit("debug", {
226
228
  date: /* @__PURE__ */ new Date(),
227
- logs: [`✓ Plugin installed successfully (${duration}ms)`]
229
+ logs: [`✓ Plugin installed successfully (${formatMs(duration)}`]
228
230
  });
229
- } catch (e) {
230
- const error = e;
231
+ } catch (caughtError) {
232
+ const error = caughtError;
231
233
  const errorTimestamp = /* @__PURE__ */ new Date();
234
+ const duration = getElapsedMs(hrStart);
235
+ await events.emit("plugin:end", plugin, {
236
+ duration,
237
+ success: false,
238
+ error
239
+ });
232
240
  await events.emit("debug", {
233
241
  date: errorTimestamp,
234
242
  logs: [
@@ -299,14 +307,14 @@ async function safeBuild(options, overrides) {
299
307
  pluginManager,
300
308
  pluginTimings
301
309
  };
302
- } catch (e) {
310
+ } catch (error) {
303
311
  return {
304
312
  failedPlugins,
305
313
  fabric,
306
314
  files: [],
307
315
  pluginManager,
308
316
  pluginTimings,
309
- error: e
317
+ error
310
318
  };
311
319
  }
312
320
  }
@@ -532,8 +540,8 @@ var PackageManager = class PackageManager {
532
540
  if (os.platform() === "win32") location = pathToFileURL(location).href;
533
541
  const module = await import(location);
534
542
  return module?.default ?? module;
535
- } catch (e) {
536
- console.error(e);
543
+ } catch (error) {
544
+ console.error(error);
537
545
  return;
538
546
  }
539
547
  }
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["#context","#options","definedConfig: Config","rootFile: KubbFile.File","build","resolve","toPath","process","fsPromises","#cache","#cwd","#SLASHES","path","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;GAA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AAS,OAAO,eAAe;AAErC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,GAAG,eAAe,eAAe;AAGnD,SAAO,UAAU,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,SAAS,OAAO,eAAe;AAErC,MAAI,CAAC,OACH,QAAO;AAGT,SAAO,UAAU,QAAQA,UAAQ;;;;;;ACmKrC,MAAa,WAAW;CACtB,QAAQ,OAAO;CACf,OAAO;CACP,MAAM;CACN,MAAM;CACN,SAAS;CACT,OAAO;CACR"}
1
+ {"version":3,"file":"index.js","names":["#context","#options","definedConfig: Config","rootFile: KubbFile.File","build","resolve","toPath","process","fsPromises","#cache","#cwd","#SLASHES","path","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;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gBAAeL,MAAO,YAC1D,QAAO,gBAAeA,MAAO;EAG/B,MAAM,cAAc,KAAK,oBAAoB;AAE7C,MAAI,CAAC,YACH;AAGF,SAAO,MAAKK,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,SAAS,OAAO,eAAe;AAErC,MAAI,CAAC,OACH,OAAM,IAAI,MAAM,GAAG,eAAe,eAAe;AAGnD,SAAO,UAAU,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,SAAS,OAAO,eAAe;AAErC,MAAI,CAAC,OACH,QAAO;AAGT,SAAO,UAAU,QAAQA,UAAQ;;;;;;ACmKrC,MAAa,WAAW;CACtB,QAAQ,OAAO;CACf,OAAO;CACP,MAAM;CACN,MAAM;CACN,SAAS;CACT,OAAO;CACR"}
@@ -1,4 +1,4 @@
1
- const require_fs = require('./fs-DhLl4-lT.cjs');
1
+ const require_fs = require('./fs-B7S6Neks.cjs');
2
2
  let natural_orderby = require("natural-orderby");
3
3
  let remeda = require("remeda");
4
4
 
@@ -438,4 +438,4 @@ Object.defineProperty(exports, 'trimQuotes', {
438
438
  return trimQuotes;
439
439
  }
440
440
  });
441
- //# sourceMappingURL=transformers-ClYW4Jl8.cjs.map
441
+ //# sourceMappingURL=transformers-mwhBtsSu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformers-ClYW4Jl8.cjs","names":["preserveConsecutiveUppercase","camelCase","_camelcase","value"],"sources":["../src/transformers/transformReservedWord.ts","../src/transformers/trim.ts","../../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js","../src/transformers/casing.ts","../src/transformers/combineCodes.ts","../src/transformers/createJSDocBlockText.ts","../src/transformers/escape.ts","../src/transformers/indent.ts","../src/transformers/nameSorter.ts","../src/transformers/searchAndReplace.ts","../src/transformers/stringify.ts","../src/transformers/toRegExp.ts","../src/transformers/index.ts"],"sourcesContent":["/**\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = [\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n\n 'Array',\n 'Date',\n 'eval',\n 'function',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n]\n\nexport function transformReservedWord(word: string): string {\n if ((word && reservedWords.includes(word)) || word?.match(/^\\d/)) {\n return `_${word}`\n }\n\n return word\n}\n\nexport function isValidVarName(name: string) {\n try {\n Function(`var ${name}`)\n } catch (_e) {\n return false\n }\n return true\n}\n","export function trim(text: string): string {\n return text.replaceAll(/\\n/g, '').trim()\n}\n\nexport function trimQuotes(text: string): string {\n if (text.match(/^\"(.*)\"$/)) {\n return text.replace(/^\"(.*)\"$/, '$1')\n }\n if (text.match(/^'(.*)'$/)) {\n return text.replace(/^'(.*)'$/, '$1')\n }\n\n if (text.match(/^`(.*)`$/)) {\n return text.replace(/^`(.*)`$/, '$1')\n }\n\n return text\n}\n","const UPPERCASE = /[\\p{Lu}]/u;\nconst LOWERCASE = /[\\p{Ll}]/u;\nconst LEADING_CAPITAL = /^[\\p{Lu}](?![\\p{Lu}])/gu;\nconst IDENTIFIER = /([\\p{Alpha}\\p{N}_]|$)/u;\nconst SEPARATORS = /[_.\\- ]+/;\n\nconst LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);\nconst SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');\nconst NUMBERS_AND_IDENTIFIER = new RegExp('\\\\d+' + IDENTIFIER.source, 'gu');\n\nconst preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase) => {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\tlet isLastLastCharPreserved = false;\n\n\tfor (let index = 0; index < string.length; index++) {\n\t\tconst character = string[index];\n\t\tisLastLastCharPreserved = index > 2 ? string[index - 3] === '-' : true;\n\n\t\tif (isLastCharLower && UPPERCASE.test(character)) {\n\t\t\tstring = string.slice(0, index) + '-' + string.slice(index);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\tindex++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase)) {\n\t\t\tstring = string.slice(0, index - 1) + '-' + string.slice(index - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst preserveConsecutiveUppercase = (input, toLowerCase) => {\n\tLEADING_CAPITAL.lastIndex = 0;\n\n\treturn input.replaceAll(LEADING_CAPITAL, match => toLowerCase(match));\n};\n\nconst postProcess = (input, toUpperCase) => {\n\tSEPARATORS_AND_IDENTIFIER.lastIndex = 0;\n\tNUMBERS_AND_IDENTIFIER.lastIndex = 0;\n\n\treturn input\n\t\t.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ['_', '-'].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match))\n\t\t.replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));\n};\n\nexport default function camelCase(input, options) {\n\tif (!(typeof input === 'string' || Array.isArray(input))) {\n\t\tthrow new TypeError('Expected the input to be `string | string[]`');\n\t}\n\n\toptions = {\n\t\tpascalCase: false,\n\t\tpreserveConsecutiveUppercase: false,\n\t\t...options,\n\t};\n\n\tif (Array.isArray(input)) {\n\t\tinput = input.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tinput = input.trim();\n\t}\n\n\tif (input.length === 0) {\n\t\treturn '';\n\t}\n\n\tconst toLowerCase = options.locale === false\n\t\t? string => string.toLowerCase()\n\t\t: string => string.toLocaleLowerCase(options.locale);\n\n\tconst toUpperCase = options.locale === false\n\t\t? string => string.toUpperCase()\n\t\t: string => string.toLocaleUpperCase(options.locale);\n\n\tif (input.length === 1) {\n\t\tif (SEPARATORS.test(input)) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn options.pascalCase ? toUpperCase(input) : toLowerCase(input);\n\t}\n\n\tconst hasUpperCase = input !== toLowerCase(input);\n\n\tif (hasUpperCase) {\n\t\tinput = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);\n\t}\n\n\tinput = input.replace(LEADING_SEPARATORS, '');\n\tinput = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);\n\n\tif (options.pascalCase) {\n\t\tinput = toUpperCase(input.charAt(0)) + input.slice(1);\n\t}\n\n\treturn postProcess(input, toUpperCase);\n}\n","import _camelcase from 'camelcase'\n\ntype Options = {\n /**\n * When set it will replace all `.` with `/`.\n */\n isFile?: boolean\n prefix?: string\n suffix?: string\n}\n\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? camelCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return _camelcase(`${prefix} ${text} ${suffix}`, { pascalCase: false, preserveConsecutiveUppercase: true }).replace(/[^a-zA-Z0-9]/g, '')\n}\n\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? pascalCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return _camelcase(`${prefix} ${text} ${suffix}`, { pascalCase: true, preserveConsecutiveUppercase: true }).replace(/[^a-zA-Z0-9]/g, '')\n}\n","export function combineCodes(codes: string[]): string {\n return codes.join('\\n')\n}\n","export function createJSDocBlockText({ comments }: { comments: Array<string> }): string {\n const filteredComments = comments.filter(Boolean)\n\n if (!filteredComments.length) {\n return ''\n }\n\n return `/**\\n * ${filteredComments.join('\\n * ')}\\n */`\n}\n","export function escape(text?: string): string {\n return text ? text.replaceAll('`', '\\\\`') : ''\n}\n\n/**\n * Escape all characters not included in SingleStringCharacters and DoubleStringCharacters on\n * @link http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n * @link https://github.com/joliss/js-string-escape/blob/master/index.js\n */\n\nexport function jsStringEscape(input: any): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n // Four possible LineTerminator characters need to be escaped:\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n","export function createIndent(size: number): string {\n return Array.from({ length: size + 1 }).join(' ')\n}\n","export function nameSorter<T extends { name: string }>(a: T, b: T): 0 | 1 | -1 {\n if (a.name < b.name) {\n return -1\n }\n if (a.name > b.name) {\n return 1\n }\n return 0\n}\n","type Options = {\n text: string\n replaceBy: string\n prefix?: string\n key: string\n searchValues?: (prefix: string, key: string) => Array<RegExp | string>\n}\n\nexport function searchAndReplace(options: Options): string {\n const { text, replaceBy, prefix = '', key } = options\n\n const searchValues = options.searchValues?.(prefix, key) || [\n `${prefix}[\"${key}\"]`,\n `${prefix}['${key}']`,\n `${prefix}[\\`${key}\\`]`,\n `${prefix}\"${key}\"`,\n `${prefix}'${key}'`,\n `${prefix}\\`${key}\\``,\n new RegExp(`${prefix}${key}`, 'g'),\n ]\n\n return searchValues.reduce((prev, searchValue) => {\n return prev.toString().replaceAll(searchValue, replaceBy)\n }, text) as string\n}\n","import { trimQuotes } from './trim'\n\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) {\n return '\"\"'\n }\n\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\nexport function stringifyObject(value: object): string {\n const items = Object.entries(value)\n .map(([key, value]) => {\n if (typeof value === 'object') {\n return `${key}: {\n ${stringifyObject(value)}\n }`\n }\n\n return `${key}: ${value}`\n })\n .filter(Boolean)\n\n return items.join(',\\n')\n}\n","import { trimQuotes } from './trim'\n\nexport function toRegExpString(text: string, func: string | null = 'RegExp'): string {\n const raw = trimQuotes(text)\n\n const [, replacementTarget = '', matchedFlags] = raw.match(/^\\^(\\(\\?([igmsuy]+)\\))/i) ?? []\n const cleaned = raw\n .replace(/^\\\\?\\//, '')\n .replace(/\\\\?\\/$/, '')\n .replace(replacementTarget, '')\n\n const regex = new RegExp(cleaned, matchedFlags)\n const source = regex.source\n const flags = regex.flags\n\n if (func === null) {\n return `/${source}/${flags}`\n }\n\n // return as constructor → new RegExp(\"pattern\", \"flags\")\n return `new ${func}(${JSON.stringify(source)}${flags ? `, ${JSON.stringify(flags)}` : ''})`\n}\n","import { orderBy } from 'natural-orderby'\nimport { merge } from 'remeda'\n\nimport { camelCase, pascalCase } from './casing.ts'\nimport { combineCodes } from './combineCodes.ts'\nimport { createJSDocBlockText } from './createJSDocBlockText.ts'\nimport { escape, jsStringEscape } from './escape.ts'\nimport { createIndent } from './indent.ts'\nimport { nameSorter } from './nameSorter.ts'\nimport { searchAndReplace } from './searchAndReplace.ts'\nimport { stringify, stringifyObject } from './stringify.ts'\nimport { toRegExpString } from './toRegExp.ts'\nimport { isValidVarName, transformReservedWord } from './transformReservedWord.ts'\nimport { trim, trimQuotes } from './trim.ts'\n\nexport { orderBy } from 'natural-orderby'\nexport { merge } from 'remeda'\nexport { camelCase, pascalCase } from './casing.ts'\nexport { combineCodes } from './combineCodes.ts'\nexport { createJSDocBlockText } from './createJSDocBlockText.ts'\nexport { escape, jsStringEscape } from './escape.ts'\nexport { createIndent } from './indent.ts'\nexport { nameSorter } from './nameSorter.ts'\nexport { searchAndReplace } from './searchAndReplace.ts'\nexport { stringify, stringifyObject } from './stringify.ts'\nexport { toRegExpString } from './toRegExp.ts'\nexport { isValidVarName, transformReservedWord } from './transformReservedWord.ts'\nexport { trim, trimQuotes } from './trim.ts'\n\nexport default {\n combineCodes,\n escape,\n jsStringEscape,\n createIndent,\n transformReservedWord,\n isValidVarName,\n nameSorter,\n searchAndReplace,\n stringify,\n stringifyObject,\n toRegExpString,\n trim,\n trimQuotes,\n JSDoc: {\n createJSDocBlockText,\n },\n orderBy,\n merge,\n camelCase,\n pascalCase,\n} as const\n"],"x_google_ignoreList":[2],"mappings":";;;;;;;;AAGA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;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AAS,KACX,QAAO,IAAI,OAAO,GAAG;AAIvB,QAAO,OAAO,KAAK,GAAG,KAAK,UAAU,OAAO,GAAG,QAAQ,KAAK,KAAK,UAAU,MAAM,KAAK,GAAG;;;;;ACS3F,2BAAe;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,OAAO,EACL,sBACD;CACD;CACA;CACA;CACA;CACD"}
1
+ {"version":3,"file":"transformers-mwhBtsSu.cjs","names":["preserveConsecutiveUppercase","camelCase","_camelcase","value"],"sources":["../src/transformers/transformReservedWord.ts","../src/transformers/trim.ts","../../../node_modules/.pnpm/camelcase@8.0.0/node_modules/camelcase/index.js","../src/transformers/casing.ts","../src/transformers/combineCodes.ts","../src/transformers/createJSDocBlockText.ts","../src/transformers/escape.ts","../src/transformers/indent.ts","../src/transformers/nameSorter.ts","../src/transformers/searchAndReplace.ts","../src/transformers/stringify.ts","../src/transformers/toRegExp.ts","../src/transformers/index.ts"],"sourcesContent":["/**\n * @link https://github.com/jonschlinkert/reserved/blob/master/index.js\n */\nconst reservedWords = [\n 'abstract',\n 'arguments',\n 'boolean',\n 'break',\n 'byte',\n 'case',\n 'catch',\n 'char',\n 'class',\n 'const',\n 'continue',\n 'debugger',\n 'default',\n 'delete',\n 'do',\n 'double',\n 'else',\n 'enum',\n 'eval',\n 'export',\n 'extends',\n 'false',\n 'final',\n 'finally',\n 'float',\n 'for',\n 'function',\n 'goto',\n 'if',\n 'implements',\n 'import',\n 'in',\n 'instanceof',\n 'int',\n 'interface',\n 'let',\n 'long',\n 'native',\n 'new',\n 'null',\n 'package',\n 'private',\n 'protected',\n 'public',\n 'return',\n 'short',\n 'static',\n 'super',\n 'switch',\n 'synchronized',\n 'this',\n 'throw',\n 'throws',\n 'transient',\n 'true',\n 'try',\n 'typeof',\n 'var',\n 'void',\n 'volatile',\n 'while',\n 'with',\n 'yield',\n\n 'Array',\n 'Date',\n 'eval',\n 'function',\n 'hasOwnProperty',\n 'Infinity',\n 'isFinite',\n 'isNaN',\n 'isPrototypeOf',\n 'length',\n 'Math',\n 'name',\n 'NaN',\n 'Number',\n 'Object',\n 'prototype',\n 'String',\n 'toString',\n 'undefined',\n 'valueOf',\n]\n\nexport function transformReservedWord(word: string): string {\n if ((word && reservedWords.includes(word)) || word?.match(/^\\d/)) {\n return `_${word}`\n }\n\n return word\n}\n\nexport function isValidVarName(name: string) {\n try {\n Function(`var ${name}`)\n } catch (_e) {\n return false\n }\n return true\n}\n","export function trim(text: string): string {\n return text.replaceAll(/\\n/g, '').trim()\n}\n\nexport function trimQuotes(text: string): string {\n if (text.match(/^\"(.*)\"$/)) {\n return text.replace(/^\"(.*)\"$/, '$1')\n }\n if (text.match(/^'(.*)'$/)) {\n return text.replace(/^'(.*)'$/, '$1')\n }\n\n if (text.match(/^`(.*)`$/)) {\n return text.replace(/^`(.*)`$/, '$1')\n }\n\n return text\n}\n","const UPPERCASE = /[\\p{Lu}]/u;\nconst LOWERCASE = /[\\p{Ll}]/u;\nconst LEADING_CAPITAL = /^[\\p{Lu}](?![\\p{Lu}])/gu;\nconst IDENTIFIER = /([\\p{Alpha}\\p{N}_]|$)/u;\nconst SEPARATORS = /[_.\\- ]+/;\n\nconst LEADING_SEPARATORS = new RegExp('^' + SEPARATORS.source);\nconst SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, 'gu');\nconst NUMBERS_AND_IDENTIFIER = new RegExp('\\\\d+' + IDENTIFIER.source, 'gu');\n\nconst preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase) => {\n\tlet isLastCharLower = false;\n\tlet isLastCharUpper = false;\n\tlet isLastLastCharUpper = false;\n\tlet isLastLastCharPreserved = false;\n\n\tfor (let index = 0; index < string.length; index++) {\n\t\tconst character = string[index];\n\t\tisLastLastCharPreserved = index > 2 ? string[index - 3] === '-' : true;\n\n\t\tif (isLastCharLower && UPPERCASE.test(character)) {\n\t\t\tstring = string.slice(0, index) + '-' + string.slice(index);\n\t\t\tisLastCharLower = false;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = true;\n\t\t\tindex++;\n\t\t} else if (isLastCharUpper && isLastLastCharUpper && LOWERCASE.test(character) && (!isLastLastCharPreserved || preserveConsecutiveUppercase)) {\n\t\t\tstring = string.slice(0, index - 1) + '-' + string.slice(index - 1);\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = false;\n\t\t\tisLastCharLower = true;\n\t\t} else {\n\t\t\tisLastCharLower = toLowerCase(character) === character && toUpperCase(character) !== character;\n\t\t\tisLastLastCharUpper = isLastCharUpper;\n\t\t\tisLastCharUpper = toUpperCase(character) === character && toLowerCase(character) !== character;\n\t\t}\n\t}\n\n\treturn string;\n};\n\nconst preserveConsecutiveUppercase = (input, toLowerCase) => {\n\tLEADING_CAPITAL.lastIndex = 0;\n\n\treturn input.replaceAll(LEADING_CAPITAL, match => toLowerCase(match));\n};\n\nconst postProcess = (input, toUpperCase) => {\n\tSEPARATORS_AND_IDENTIFIER.lastIndex = 0;\n\tNUMBERS_AND_IDENTIFIER.lastIndex = 0;\n\n\treturn input\n\t\t.replaceAll(NUMBERS_AND_IDENTIFIER, (match, pattern, offset) => ['_', '-'].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match))\n\t\t.replaceAll(SEPARATORS_AND_IDENTIFIER, (_, identifier) => toUpperCase(identifier));\n};\n\nexport default function camelCase(input, options) {\n\tif (!(typeof input === 'string' || Array.isArray(input))) {\n\t\tthrow new TypeError('Expected the input to be `string | string[]`');\n\t}\n\n\toptions = {\n\t\tpascalCase: false,\n\t\tpreserveConsecutiveUppercase: false,\n\t\t...options,\n\t};\n\n\tif (Array.isArray(input)) {\n\t\tinput = input.map(x => x.trim())\n\t\t\t.filter(x => x.length)\n\t\t\t.join('-');\n\t} else {\n\t\tinput = input.trim();\n\t}\n\n\tif (input.length === 0) {\n\t\treturn '';\n\t}\n\n\tconst toLowerCase = options.locale === false\n\t\t? string => string.toLowerCase()\n\t\t: string => string.toLocaleLowerCase(options.locale);\n\n\tconst toUpperCase = options.locale === false\n\t\t? string => string.toUpperCase()\n\t\t: string => string.toLocaleUpperCase(options.locale);\n\n\tif (input.length === 1) {\n\t\tif (SEPARATORS.test(input)) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn options.pascalCase ? toUpperCase(input) : toLowerCase(input);\n\t}\n\n\tconst hasUpperCase = input !== toLowerCase(input);\n\n\tif (hasUpperCase) {\n\t\tinput = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase);\n\t}\n\n\tinput = input.replace(LEADING_SEPARATORS, '');\n\tinput = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input);\n\n\tif (options.pascalCase) {\n\t\tinput = toUpperCase(input.charAt(0)) + input.slice(1);\n\t}\n\n\treturn postProcess(input, toUpperCase);\n}\n","import _camelcase from 'camelcase'\n\ntype Options = {\n /**\n * When set it will replace all `.` with `/`.\n */\n isFile?: boolean\n prefix?: string\n suffix?: string\n}\n\nexport function camelCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? camelCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return _camelcase(`${prefix} ${text} ${suffix}`, { pascalCase: false, preserveConsecutiveUppercase: true }).replace(/[^a-zA-Z0-9]/g, '')\n}\n\nexport function pascalCase(text: string, { isFile, prefix = '', suffix = '' }: Options = {}): string {\n if (isFile) {\n const splitArray = text.split('.')\n return splitArray.map((item, i) => (i === splitArray.length - 1 ? pascalCase(item, { prefix, suffix }) : camelCase(item))).join('/')\n }\n\n return _camelcase(`${prefix} ${text} ${suffix}`, { pascalCase: true, preserveConsecutiveUppercase: true }).replace(/[^a-zA-Z0-9]/g, '')\n}\n","export function combineCodes(codes: string[]): string {\n return codes.join('\\n')\n}\n","export function createJSDocBlockText({ comments }: { comments: Array<string> }): string {\n const filteredComments = comments.filter(Boolean)\n\n if (!filteredComments.length) {\n return ''\n }\n\n return `/**\\n * ${filteredComments.join('\\n * ')}\\n */`\n}\n","export function escape(text?: string): string {\n return text ? text.replaceAll('`', '\\\\`') : ''\n}\n\n/**\n * Escape all characters not included in SingleStringCharacters and DoubleStringCharacters on\n * @link http://www.ecma-international.org/ecma-262/5.1/#sec-7.8.4\n * @link https://github.com/joliss/js-string-escape/blob/master/index.js\n */\n\nexport function jsStringEscape(input: any): string {\n return `${input}`.replace(/[\"'\\\\\\n\\r\\u2028\\u2029]/g, (character) => {\n switch (character) {\n case '\"':\n case \"'\":\n case '\\\\':\n return `\\\\${character}`\n // Four possible LineTerminator characters need to be escaped:\n case '\\n':\n return '\\\\n'\n case '\\r':\n return '\\\\r'\n case '\\u2028':\n return '\\\\u2028'\n case '\\u2029':\n return '\\\\u2029'\n default:\n return ''\n }\n })\n}\n","export function createIndent(size: number): string {\n return Array.from({ length: size + 1 }).join(' ')\n}\n","export function nameSorter<T extends { name: string }>(a: T, b: T): 0 | 1 | -1 {\n if (a.name < b.name) {\n return -1\n }\n if (a.name > b.name) {\n return 1\n }\n return 0\n}\n","type Options = {\n text: string\n replaceBy: string\n prefix?: string\n key: string\n searchValues?: (prefix: string, key: string) => Array<RegExp | string>\n}\n\nexport function searchAndReplace(options: Options): string {\n const { text, replaceBy, prefix = '', key } = options\n\n const searchValues = options.searchValues?.(prefix, key) || [\n `${prefix}[\"${key}\"]`,\n `${prefix}['${key}']`,\n `${prefix}[\\`${key}\\`]`,\n `${prefix}\"${key}\"`,\n `${prefix}'${key}'`,\n `${prefix}\\`${key}\\``,\n new RegExp(`${prefix}${key}`, 'g'),\n ]\n\n return searchValues.reduce((prev, searchValue) => {\n return prev.toString().replaceAll(searchValue, replaceBy)\n }, text) as string\n}\n","import { trimQuotes } from './trim'\n\nexport function stringify(value: string | number | boolean | undefined): string {\n if (value === undefined || value === null) {\n return '\"\"'\n }\n\n return JSON.stringify(trimQuotes(value.toString()))\n}\n\nexport function stringifyObject(value: object): string {\n const items = Object.entries(value)\n .map(([key, value]) => {\n if (typeof value === 'object') {\n return `${key}: {\n ${stringifyObject(value)}\n }`\n }\n\n return `${key}: ${value}`\n })\n .filter(Boolean)\n\n return items.join(',\\n')\n}\n","import { trimQuotes } from './trim'\n\nexport function toRegExpString(text: string, func: string | null = 'RegExp'): string {\n const raw = trimQuotes(text)\n\n const [, replacementTarget = '', matchedFlags] = raw.match(/^\\^(\\(\\?([igmsuy]+)\\))/i) ?? []\n const cleaned = raw\n .replace(/^\\\\?\\//, '')\n .replace(/\\\\?\\/$/, '')\n .replace(replacementTarget, '')\n\n const regex = new RegExp(cleaned, matchedFlags)\n const source = regex.source\n const flags = regex.flags\n\n if (func === null) {\n return `/${source}/${flags}`\n }\n\n // return as constructor → new RegExp(\"pattern\", \"flags\")\n return `new ${func}(${JSON.stringify(source)}${flags ? `, ${JSON.stringify(flags)}` : ''})`\n}\n","import { orderBy } from 'natural-orderby'\nimport { merge } from 'remeda'\n\nimport { camelCase, pascalCase } from './casing.ts'\nimport { combineCodes } from './combineCodes.ts'\nimport { createJSDocBlockText } from './createJSDocBlockText.ts'\nimport { escape, jsStringEscape } from './escape.ts'\nimport { createIndent } from './indent.ts'\nimport { nameSorter } from './nameSorter.ts'\nimport { searchAndReplace } from './searchAndReplace.ts'\nimport { stringify, stringifyObject } from './stringify.ts'\nimport { toRegExpString } from './toRegExp.ts'\nimport { isValidVarName, transformReservedWord } from './transformReservedWord.ts'\nimport { trim, trimQuotes } from './trim.ts'\n\nexport { orderBy } from 'natural-orderby'\nexport { merge } from 'remeda'\nexport { camelCase, pascalCase } from './casing.ts'\nexport { combineCodes } from './combineCodes.ts'\nexport { createJSDocBlockText } from './createJSDocBlockText.ts'\nexport { escape, jsStringEscape } from './escape.ts'\nexport { createIndent } from './indent.ts'\nexport { nameSorter } from './nameSorter.ts'\nexport { searchAndReplace } from './searchAndReplace.ts'\nexport { stringify, stringifyObject } from './stringify.ts'\nexport { toRegExpString } from './toRegExp.ts'\nexport { isValidVarName, transformReservedWord } from './transformReservedWord.ts'\nexport { trim, trimQuotes } from './trim.ts'\n\nexport default {\n combineCodes,\n escape,\n jsStringEscape,\n createIndent,\n transformReservedWord,\n isValidVarName,\n nameSorter,\n searchAndReplace,\n stringify,\n stringifyObject,\n toRegExpString,\n trim,\n trimQuotes,\n JSDoc: {\n createJSDocBlockText,\n },\n orderBy,\n merge,\n camelCase,\n pascalCase,\n} as const\n"],"x_google_ignoreList":[2],"mappings":";;;;;;;;AAGA,MAAM,gBAAgB;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAEA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,SAAgB,sBAAsB,MAAsB;AAC1D,KAAK,QAAQ,cAAc,SAAS,KAAK,IAAK,MAAM,MAAM,MAAM,CAC9D,QAAO,IAAI;AAGb,QAAO;;AAGT,SAAgB,eAAe,MAAc;AAC3C,KAAI;AACF,WAAS,OAAO,OAAO;UAChB,IAAI;AACX,SAAO;;AAET,QAAO;;;;;ACxGT,SAAgB,KAAK,MAAsB;AACzC,QAAO,KAAK,WAAW,OAAO,GAAG,CAAC,MAAM;;AAG1C,SAAgB,WAAW,MAAsB;AAC/C,KAAI,KAAK,MAAM,WAAW,CACxB,QAAO,KAAK,QAAQ,YAAY,KAAK;AAEvC,KAAI,KAAK,MAAM,WAAW,CACxB,Q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SAAO,GAAG,IAAI,IAAIA;GAClB,CACD,OAAO,QAAQ,CAEL,KAAK,MAAM;;;;;ACrB1B,SAAgB,eAAe,MAAc,OAAsB,UAAkB;CACnF,MAAM,MAAM,WAAW,KAAK;CAE5B,MAAM,GAAG,oBAAoB,IAAI,gBAAgB,IAAI,MAAM,0BAA0B,IAAI,EAAE;CAC3F,MAAM,UAAU,IACb,QAAQ,UAAU,GAAG,CACrB,QAAQ,UAAU,GAAG,CACrB,QAAQ,mBAAmB,GAAG;CAEjC,MAAM,QAAQ,IAAI,OAAO,SAAS,aAAa;CAC/C,MAAM,SAAS,MAAM;CACrB,MAAM,QAAQ,MAAM;AAEpB,KAAI,SAAS,KACX,QAAO,IAAI,OAAO,GAAG;AAIvB,QAAO,OAAO,KAAK,GAAG,KAAK,UAAU,OAAO,GAAG,QAAQ,KAAK,KAAK,UAAU,MAAM,KAAK,GAAG;;;;;ACS3F,2BAAe;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,OAAO,EACL,sBACD;CACD;CACA;CACA;CACA;CACD"}
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_fs = require('./fs-DhLl4-lT.cjs');
3
- const require_transformers = require('./transformers-ClYW4Jl8.cjs');
2
+ const require_fs = require('./fs-B7S6Neks.cjs');
3
+ const require_transformers = require('./transformers-mwhBtsSu.cjs');
4
4
  let natural_orderby = require("natural-orderby");
5
5
  let remeda = require("remeda");
6
6
 
@@ -1,5 +1,5 @@
1
- import { Fabric } from "@kubb/react-fabric";
2
1
  import { KubbFile } from "@kubb/fabric-core/types";
2
+ import { Fabric } from "@kubb/react-fabric";
3
3
 
4
4
  //#region src/utils/AsyncEventEmitter.d.ts
5
5
  declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
@@ -170,7 +170,7 @@ type ExecutedMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
170
170
  * console.log('Starting Kubb generation')
171
171
  * })
172
172
  *
173
- * events.on('plugin:end', (plugin, duration) => {
173
+ * events.on('plugin:end', (plugin, { duration }) => {
174
174
  * console.log(`Plugin ${plugin.name} completed in ${duration}ms`)
175
175
  * })
176
176
  * ```
@@ -316,8 +316,13 @@ interface KubbEvents {
316
316
  'plugin:start': [plugin: Plugin];
317
317
  /**
318
318
  * Emitted when a plugin completes execution.
319
+ * Duration in ms
319
320
  */
320
- 'plugin:end': [plugin: Plugin, duration: number];
321
+ 'plugin:end': [plugin: Plugin, meta: {
322
+ duration: number;
323
+ success: boolean;
324
+ error?: Error;
325
+ }];
321
326
  /**
322
327
  * Emitted when plugin hook progress tracking starts.
323
328
  * Contains the hook name and list of plugins to execute.
@@ -682,4 +687,4 @@ type Logger<TOptions extends LoggerOptions = LoggerOptions> = {
682
687
  type UserLogger<TOptions extends LoggerOptions = LoggerOptions> = Omit<Logger<TOptions>, 'logLevel'>;
683
688
  //#endregion
684
689
  export { AsyncEventEmitter as A, UserLogger as C, KubbEvents as D, PossiblePromise as E, PluginManager as O, UserConfig as S, UserPluginWithLifeCycle as T, PluginLifecycleHooks as _, InputData as a, ResolveNameParams as b, Logger as c, Output as d, Plugin as f, PluginLifecycle as g, PluginKey as h, Group as i, getMode as k, LoggerContext as l, PluginFactoryOptions as m, Config as n, InputPath as o, PluginContext as p, GetPluginFactoryOptions as r, LogLevel as s, BarrelType as t, LoggerOptions as u, PluginParameter as v, UserPlugin as w, ResolvePathParams as x, PluginWithLifeCycle as y };
685
- //# sourceMappingURL=types-DZARm27h.d.ts.map
690
+ //# sourceMappingURL=types-6ENPfetT.d.cts.map
@@ -1,5 +1,5 @@
1
- import { KubbFile } from "@kubb/fabric-core/types";
2
1
  import { Fabric } from "@kubb/react-fabric";
2
+ import { KubbFile } from "@kubb/fabric-core/types";
3
3
 
4
4
  //#region src/utils/AsyncEventEmitter.d.ts
5
5
  declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
@@ -170,7 +170,7 @@ type ExecutedMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
170
170
  * console.log('Starting Kubb generation')
171
171
  * })
172
172
  *
173
- * events.on('plugin:end', (plugin, duration) => {
173
+ * events.on('plugin:end', (plugin, { duration }) => {
174
174
  * console.log(`Plugin ${plugin.name} completed in ${duration}ms`)
175
175
  * })
176
176
  * ```
@@ -316,8 +316,13 @@ interface KubbEvents {
316
316
  'plugin:start': [plugin: Plugin];
317
317
  /**
318
318
  * Emitted when a plugin completes execution.
319
+ * Duration in ms
319
320
  */
320
- 'plugin:end': [plugin: Plugin, duration: number];
321
+ 'plugin:end': [plugin: Plugin, meta: {
322
+ duration: number;
323
+ success: boolean;
324
+ error?: Error;
325
+ }];
321
326
  /**
322
327
  * Emitted when plugin hook progress tracking starts.
323
328
  * Contains the hook name and list of plugins to execute.
@@ -682,4 +687,4 @@ type Logger<TOptions extends LoggerOptions = LoggerOptions> = {
682
687
  type UserLogger<TOptions extends LoggerOptions = LoggerOptions> = Omit<Logger<TOptions>, 'logLevel'>;
683
688
  //#endregion
684
689
  export { AsyncEventEmitter as A, UserLogger as C, KubbEvents as D, PossiblePromise as E, PluginManager as O, UserConfig as S, UserPluginWithLifeCycle as T, PluginLifecycleHooks as _, InputData as a, ResolveNameParams as b, Logger as c, Output as d, Plugin as f, PluginLifecycle as g, PluginKey as h, Group as i, getMode as k, LoggerContext as l, PluginFactoryOptions as m, Config as n, InputPath as o, PluginContext as p, GetPluginFactoryOptions as r, LogLevel as s, BarrelType as t, LoggerOptions as u, PluginParameter as v, UserPlugin as w, ResolvePathParams as x, PluginWithLifeCycle as y };
685
- //# sourceMappingURL=types-icDNKrIP.d.cts.map
690
+ //# sourceMappingURL=types-AoEOgnSE.d.ts.map
package/dist/utils.cjs CHANGED
@@ -1,6 +1,6 @@
1
- const require_fs = require('./fs-DhLl4-lT.cjs');
2
- const require_getBarrelFiles = require('./getBarrelFiles-ZPeKtx6a.cjs');
3
- const require_transformers = require('./transformers-ClYW4Jl8.cjs');
1
+ const require_fs = require('./fs-B7S6Neks.cjs');
2
+ const require_getBarrelFiles = require('./getBarrelFiles-CKNu_noL.cjs');
3
+ const require_transformers = require('./transformers-mwhBtsSu.cjs');
4
4
  let node_path = require("node:path");
5
5
  node_path = require_fs.__toESM(node_path);
6
6
  let natural_orderby = require("natural-orderby");
@@ -219,7 +219,10 @@ exports.Cache = Cache;
219
219
  exports.FunctionParams = FunctionParams;
220
220
  exports.URLPath = require_getBarrelFiles.URLPath;
221
221
  exports.buildJSDoc = buildJSDoc;
222
+ exports.formatHrtime = require_getBarrelFiles.formatHrtime;
223
+ exports.formatMs = require_getBarrelFiles.formatMs;
222
224
  exports.getBarrelFiles = require_getBarrelFiles.getBarrelFiles;
225
+ exports.getElapsedMs = require_getBarrelFiles.getElapsedMs;
223
226
  exports.getNestedAccessor = getNestedAccessor;
224
227
  exports.getUniqueName = require_getBarrelFiles.getUniqueName;
225
228
  exports.isPromise = isPromise;
package/dist/utils.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AsyncEventEmitter, E as PossiblePromise } from "./types-icDNKrIP.cjs";
2
- import { n as getBarrelFiles } from "./getBarrelFiles-LW3anr-E.cjs";
1
+ import { A as AsyncEventEmitter, E as PossiblePromise } from "./types-6ENPfetT.cjs";
2
+ import { n as getBarrelFiles } from "./getBarrelFiles-CSqnakvm.cjs";
3
3
 
4
4
  //#region src/utils/buildJSDoc.d.ts
5
5
 
@@ -84,6 +84,22 @@ declare class FunctionParams {
84
84
  toString(): string;
85
85
  }
86
86
  //#endregion
87
+ //#region src/utils/formatHrtime.d.ts
88
+ /**
89
+ * Calculates elapsed time in milliseconds from a high-resolution start time.
90
+ * Rounds to 2 decimal places to provide sub-millisecond precision without noise.
91
+ */
92
+ declare function getElapsedMs(hrStart: [number, number]): number;
93
+ /**
94
+ * Converts a millisecond duration into a human-readable string.
95
+ * Adjusts units (ms, s, m s) based on the magnitude of the duration.
96
+ */
97
+ declare function formatMs(ms: number): string;
98
+ /**
99
+ * Convenience helper to get and format elapsed time in one step.
100
+ */
101
+ declare function formatHrtime(hrStart: [number, number]): string;
102
+ //#endregion
87
103
  //#region src/utils/getNestedAccessor.d.ts
88
104
  /**
89
105
  * Converts a param path (string with dot notation or array of strings) to a JavaScript accessor expression.
@@ -187,5 +203,5 @@ declare class URLPath {
187
203
  declare function getUniqueName(originalName: string, data: Record<string, number>): string;
188
204
  declare function setUniqueName(originalName: string, data: Record<string, number>): string;
189
205
  //#endregion
190
- export { AsyncEventEmitter, Cache, FunctionParams, type FunctionParamsAST, type URLObject, URLPath, buildJSDoc, getBarrelFiles, getNestedAccessor, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, resolveModuleSource, setUniqueName, timeout };
206
+ export { AsyncEventEmitter, Cache, FunctionParams, type FunctionParamsAST, type URLObject, URLPath, buildJSDoc, formatHrtime, formatMs, getBarrelFiles, getElapsedMs, getNestedAccessor, getUniqueName, isPromise, isPromiseFulfilledResult, isPromiseRejectedResult, renderTemplate, resolveModuleSource, setUniqueName, timeout };
191
207
  //# sourceMappingURL=utils.d.cts.map