unplugin-kubb 5.0.0-beta.97 → 5.0.0-beta.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/astro.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  const require_vite = require("./vite.cjs");
3
3
  //#region src/astro.ts
4
4
  var astro_default = /* @__PURE__ */ require_unpluginFactory.__name((options) => ({
package/dist/esbuild.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  //#region src/esbuild.ts
3
3
  var esbuild_default = (0, require("unplugin").createEsbuildPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/esbuild.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createEsbuildPlugin } from "unplugin";
3
3
  //#region src/esbuild.ts
4
4
  var esbuild_default = createEsbuildPlugin(unpluginFactory);
package/dist/farm.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  //#region src/farm.ts
3
3
  var farm_default = (0, require("unplugin").createFarmPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/farm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createFarmPlugin } from "unplugin";
3
3
  //#region src/farm.ts
4
4
  var farm_default = createFarmPlugin(unpluginFactory);
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
5
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
6
6
  //#region src/index.ts
7
7
  const plugin = /* #__PURE__ */ (0, require("unplugin").createUnplugin)(require_unpluginFactory.unpluginFactory);
8
8
  //#endregion
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createUnplugin } from "unplugin";
3
3
  //#region src/index.ts
4
4
  const plugin = /* #__PURE__ */ createUnplugin(unpluginFactory);
package/dist/nuxt.cjs CHANGED
@@ -1,4 +1,4 @@
1
- require("./unpluginFactory-BYGsiFh_.cjs");
1
+ require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  const require_vite = require("./vite.cjs");
3
3
  const require_webpack = require("./webpack.cjs");
4
4
  let _nuxt_kit = require("@nuxt/kit");
package/dist/rolldown.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  //#region src/rolldown.ts
3
3
  var rolldown_default = (0, require("unplugin").createRolldownPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/rolldown.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createRolldownPlugin } from "unplugin";
3
3
  //#region src/rolldown.ts
4
4
  var rolldown_default = createRolldownPlugin(unpluginFactory);
package/dist/rollup.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  //#region src/rollup.ts
3
3
  var rollup_default = (0, require("unplugin").createRollupPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/rollup.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createRollupPlugin } from "unplugin";
3
3
  //#region src/rollup.ts
4
4
  var rollup_default = createRollupPlugin(unpluginFactory);
package/dist/rspack.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  //#region src/rspack.ts
3
3
  var rspack_default = (0, require("unplugin").createRspackPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/rspack.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createRspackPlugin } from "unplugin";
3
3
  //#region src/rspack.ts
4
4
  var rspack_default = createRspackPlugin(unpluginFactory);
@@ -31,7 +31,7 @@ let _kubb_core = require("@kubb/core");
31
31
  let _kubb_plugin_barrel = require("@kubb/plugin-barrel");
32
32
  let _kubb_parser_ts = require("@kubb/parser-ts");
33
33
  //#region package.json
34
- var version = "5.0.0-beta.97";
34
+ var version = "5.0.0-beta.99";
35
35
  //#endregion
36
36
  //#region src/unpluginFactory.ts
37
37
  /**
@@ -154,4 +154,4 @@ Object.defineProperty(exports, "unpluginFactory", {
154
154
  }
155
155
  });
156
156
 
157
- //# sourceMappingURL=unpluginFactory-BYGsiFh_.cjs.map
157
+ //# sourceMappingURL=unpluginFactory-Dwhiz47J.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"unpluginFactory-BYGsiFh_.cjs","names":["Hookable","Diagnostics","pluginBarrelName","process","unpluginVersion","userConfig"],"sources":["../package.json","../src/unpluginFactory.ts"],"sourcesContent":["","import process from 'node:process'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport { applyConfigDefaults, type Config, createKubb, Diagnostics, type KubbHooks, Hookable } from '@kubb/core'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs\n * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS\n * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.\n */\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const hooks = new Hookable<KubbHooks>()\n const isVite = meta.framework === 'vite'\n\n hooks.hook('kubb:lifecycle:start', ({ version }) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n hooks.hook('kubb:error', ({ error }) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n hooks.hook('kubb:warn', ({ message }) => {\n console.warn(`⚠ ${message}`)\n })\n\n hooks.hook('kubb:info', ({ message }) => {\n console.info(`ℹ ${message}`)\n })\n\n hooks.hook('kubb:success', ({ message }) => {\n console.log(`✓ ${message}`)\n })\n\n hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n hooks.hook('kubb:files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n hooks.hook('kubb:generation:end', ({ config, status, diagnostics }) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n\n if (!diagnostics || !status) return\n\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const pluginsCount = config.plugins.length\n const successCount = pluginsCount - failedCount\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`,\n )\n })\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n ;(ctx.error ?? console.error)(`[${name}] Config is not set`)\n return\n }\n\n const { adapter, output, plugins } = applyConfigDefaults(options.config, {\n defaultAdapter: adapterOas(),\n barrelPlugin: pluginBarrel(),\n barrelPluginName: pluginBarrelName,\n defaultOutput: { barrel: { type: 'named' }, format: false, lint: false },\n })\n\n const config = {\n ...options.config,\n adapter,\n parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],\n plugins,\n output,\n }\n const hrStart = process.hrtime()\n\n await hooks.callHook('kubb:lifecycle:start', { version: unpluginVersion })\n\n const userConfig = config as Config\n\n const kubb = createKubb(userConfig, { hooks })\n await kubb.setup()\n\n await hooks.callHook('kubb:generation:start', { config: kubb.config })\n\n const { diagnostics, files, storage } = await kubb.safeBuild()\n\n const hasFailures = Diagnostics.hasError(diagnostics)\n\n // Surface every problem by severity. Unplugin has no diagnostic renderer, so route\n // errors/warnings/info to the channels it does listen on. Non-problem diagnostics are skipped.\n for (const diagnostic of diagnostics) {\n if (!Diagnostics.isProblem(diagnostic)) {\n continue\n }\n if (diagnostic.severity === 'error') {\n await hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n } else if (diagnostic.severity === 'warning') {\n await hooks.callHook('kubb:warn', { message: diagnostic.message })\n } else {\n await hooks.callHook('kubb:info', { message: diagnostic.message })\n }\n }\n\n await hooks.callHook('kubb:generation:end', {\n config: kubb.config,\n storage,\n diagnostics,\n filesCreated: files.length,\n status: hasFailures ? 'failed' : 'success',\n hrStart,\n })\n\n await hooks.callHook('kubb:lifecycle:end')\n\n if (hasFailures) {\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const firstError = diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === 'error')\n const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : (firstError?.message ?? 'Build failed')\n if (ctx.error) {\n ctx.error(`[${name}] ${message}`)\n return\n }\n\n throw new Error(`[${name}] ${message}`, { cause: firstError?.cause })\n }\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n vite: {},\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsBA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,QAAQ,IAAIA,WAAAA,SAAoB;CACtC,MAAM,SAAS,KAAK,cAAc;CAElC,MAAM,KAAK,yBAAyB,EAAE,cAAc;EAClD,QAAQ,IAAI,iBAAiB,QAAQ,IAAI;CAC3C,CAAC;CAED,MAAM,KAAK,eAAe,EAAE,YAAY;EACtC,QAAQ,MAAM,KAAK,OAAO,WAAW,UAAU;CACjD,CAAC;CAED,MAAM,KAAK,cAAc,EAAE,cAAc;EACvC,QAAQ,KAAK,KAAK,SAAS;CAC7B,CAAC;CAED,MAAM,KAAK,cAAc,EAAE,cAAc;EACvC,QAAQ,KAAK,KAAK,SAAS;CAC7B,CAAC;CAED,MAAM,KAAK,iBAAiB,EAAE,cAAc;EAC1C,QAAQ,IAAI,KAAK,SAAS;CAC5B,CAAC;CAED,MAAM,KAAK,oBAAoB,EAAE,QAAQ,eAAe;EACtD,MAAM,cAAc,YAAY,MAAO,IA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UAAU,KAAA;EAC1B,MAAM,aAAa;GACjB,MAAM,SAAS,IAAgC;EACjD;EACA,MAAM,CAAC;CACT;AACF"}
1
+ {"version":3,"file":"unpluginFactory-Dwhiz47J.cjs","names":["Hookable","Diagnostics","pluginBarrelName","process","unpluginVersion","userConfig"],"sources":["../package.json","../src/unpluginFactory.ts"],"sourcesContent":["","import process from 'node:process'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport { applyConfigDefaults, type Config, createKubb, Diagnostics, type KubbHooks, Hookable } from '@kubb/core'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs\n * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS\n * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.\n */\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const hooks = new Hookable<KubbHooks>()\n const isVite = meta.framework === 'vite'\n\n hooks.hook('kubb:lifecycle:start', ({ version }) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n hooks.hook('kubb:error', ({ error }) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n hooks.hook('kubb:warn', ({ message }) => {\n console.warn(`⚠ ${message}`)\n })\n\n hooks.hook('kubb:info', ({ message }) => {\n console.info(`ℹ ${message}`)\n })\n\n hooks.hook('kubb:success', ({ message }) => {\n console.log(`✓ ${message}`)\n })\n\n hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n hooks.hook('kubb:files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n hooks.hook('kubb:generation:end', ({ config, status, diagnostics }) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n\n if (!diagnostics || !status) return\n\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const pluginsCount = config.plugins.length\n const successCount = pluginsCount - failedCount\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`,\n )\n })\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n ;(ctx.error ?? console.error)(`[${name}] Config is not set`)\n return\n }\n\n const { adapter, output, plugins } = applyConfigDefaults(options.config, {\n defaultAdapter: adapterOas(),\n barrelPlugin: pluginBarrel(),\n barrelPluginName: pluginBarrelName,\n defaultOutput: { barrel: { type: 'named' }, format: false, lint: false },\n })\n\n const config = {\n ...options.config,\n adapter,\n parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],\n plugins,\n output,\n }\n const hrStart = process.hrtime()\n\n await hooks.callHook('kubb:lifecycle:start', { version: unpluginVersion })\n\n const userConfig = config as Config\n\n const kubb = createKubb(userConfig, { hooks })\n await kubb.setup()\n\n await hooks.callHook('kubb:generation:start', { config: kubb.config })\n\n const { diagnostics, files, storage } = await kubb.safeBuild()\n\n const hasFailures = Diagnostics.hasError(diagnostics)\n\n // Surface every problem by severity. Unplugin has no diagnostic renderer, so route\n // errors/warnings/info to the channels it does listen on. Non-problem diagnostics are skipped.\n for (const diagnostic of diagnostics) {\n if (!Diagnostics.isProblem(diagnostic)) {\n continue\n }\n if (diagnostic.severity === 'error') {\n await hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n } else if (diagnostic.severity === 'warning') {\n await hooks.callHook('kubb:warn', { message: diagnostic.message })\n } else {\n await hooks.callHook('kubb:info', { message: diagnostic.message })\n }\n }\n\n await hooks.callHook('kubb:generation:end', {\n config: kubb.config,\n storage,\n diagnostics,\n filesCreated: files.length,\n status: hasFailures ? 'failed' : 'success',\n hrStart,\n })\n\n await hooks.callHook('kubb:lifecycle:end')\n\n if (hasFailures) {\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const firstError = diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === 'error')\n const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : (firstError?.message ?? 'Build failed')\n if (ctx.error) {\n ctx.error(`[${name}] ${message}`)\n return\n }\n\n throw new Error(`[${name}] ${message}`, { cause: firstError?.cause })\n }\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n vite: {},\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACsBA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,QAAQ,IAAIA,WAAAA,SAAoB;CACtC,MAAM,SAAS,KAAK,cAAc;CAElC,MAAM,KAAK,yBAAyB,EAAE,cAAc;EAClD,QAAQ,IAAI,iBAAiB,QAAQ,IAAI;CAC3C,CAAC;CAED,MAAM,KAAK,eAAe,EAAE,YAAY;EACtC,QAAQ,MAAM,KAAK,OAAO,WAAW,UAAU;CACjD,CAAC;CAED,MAAM,KAAK,cAAc,EAAE,cAAc;EACvC,QAAQ,KAAK,KAAK,SAAS;CAC7B,CAAC;CAED,MAAM,KAAK,cAAc,EAAE,cAAc;EACvC,QAAQ,KAAK,KAAK,SAAS;CAC7B,CAAC;CAED,MAAM,KAAK,iBAAiB,EAAE,cAAc;EAC1C,QAAQ,IAAI,KAAK,SAAS;CAC5B,CAAC;CAED,MAAM,KAAK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CAAC;EACtE;CACF;CAEA,OAAO;EACL;EACA,SAAS;EACT,OAAO,SAAS,UAAU,KAAA;EAC1B,MAAM,aAAa;GACjB,MAAM,SAAS,IAAgC;EACjD;EACA,MAAM,CAAC;CACT;AACF"}
@@ -5,7 +5,7 @@ import { Diagnostics, Hookable, applyConfigDefaults, createKubb } from "@kubb/co
5
5
  import { pluginBarrel, pluginBarrelName } from "@kubb/plugin-barrel";
6
6
  import { parserTs, parserTsx } from "@kubb/parser-ts";
7
7
  //#region package.json
8
- var version = "5.0.0-beta.97";
8
+ var version = "5.0.0-beta.99";
9
9
  //#endregion
10
10
  //#region src/unpluginFactory.ts
11
11
  /**
@@ -117,4 +117,4 @@ const unpluginFactory = (options, meta) => {
117
117
  //#endregion
118
118
  export { unpluginFactory as t };
119
119
 
120
- //# sourceMappingURL=unpluginFactory-okNdii3V.js.map
120
+ //# sourceMappingURL=unpluginFactory-MeM4qOk-.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"unpluginFactory-okNdii3V.js","names":["unpluginVersion","userConfig"],"sources":["../package.json","../src/unpluginFactory.ts"],"sourcesContent":["","import process from 'node:process'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport { applyConfigDefaults, type Config, createKubb, Diagnostics, type KubbHooks, Hookable } from '@kubb/core'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs\n * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS\n * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.\n */\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const hooks = new Hookable<KubbHooks>()\n const isVite = meta.framework === 'vite'\n\n hooks.hook('kubb:lifecycle:start', ({ version }) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n hooks.hook('kubb:error', ({ error }) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n hooks.hook('kubb:warn', ({ message }) => {\n console.warn(`⚠ ${message}`)\n })\n\n hooks.hook('kubb:info', ({ message }) => {\n console.info(`ℹ ${message}`)\n })\n\n hooks.hook('kubb:success', ({ message }) => {\n console.log(`✓ ${message}`)\n })\n\n hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n hooks.hook('kubb:files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n hooks.hook('kubb:generation:end', ({ config, status, diagnostics }) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n\n if (!diagnostics || !status) return\n\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const pluginsCount = config.plugins.length\n const successCount = pluginsCount - failedCount\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`,\n )\n })\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n ;(ctx.error ?? console.error)(`[${name}] Config is not set`)\n return\n }\n\n const { adapter, output, plugins } = applyConfigDefaults(options.config, {\n defaultAdapter: adapterOas(),\n barrelPlugin: pluginBarrel(),\n barrelPluginName: pluginBarrelName,\n defaultOutput: { barrel: { type: 'named' }, format: false, lint: false },\n })\n\n const config = {\n ...options.config,\n adapter,\n parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],\n plugins,\n output,\n }\n const hrStart = process.hrtime()\n\n await hooks.callHook('kubb:lifecycle:start', { version: unpluginVersion })\n\n const userConfig = config as Config\n\n const kubb = createKubb(userConfig, { hooks })\n await kubb.setup()\n\n await hooks.callHook('kubb:generation:start', { config: kubb.config })\n\n const { diagnostics, files, storage } = await kubb.safeBuild()\n\n const hasFailures = Diagnostics.hasError(diagnostics)\n\n // Surface every problem by severity. Unplugin has no diagnostic renderer, so route\n // errors/warnings/info to the channels it does listen on. Non-problem diagnostics are skipped.\n for (const diagnostic of diagnostics) {\n if (!Diagnostics.isProblem(diagnostic)) {\n continue\n }\n if (diagnostic.severity === 'error') {\n await hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n } else if (diagnostic.severity === 'warning') {\n await hooks.callHook('kubb:warn', { message: diagnostic.message })\n } else {\n await hooks.callHook('kubb:info', { message: diagnostic.message })\n }\n }\n\n await hooks.callHook('kubb:generation:end', {\n config: kubb.config,\n storage,\n diagnostics,\n filesCreated: files.length,\n status: hasFailures ? 'failed' : 'success',\n hrStart,\n })\n\n await hooks.callHook('kubb:lifecycle:end')\n\n if (hasFailures) {\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const firstError = diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === 'error')\n const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : (firstError?.message ?? 'Build failed')\n if (ctx.error) {\n ctx.error(`[${name}] ${message}`)\n return\n }\n\n throw new Error(`[${name}] ${message}`, { cause: firstError?.cause })\n }\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n vite: {},\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACsBA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,QAAQ,IAAI,SAAoB;CACtC,MAAM,SAAS,KAAK,cAAc;CAElC,MAAM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AC,CAAC,MAAM,eAAe,WAAW,aAAa,OAAO;GACjH,MAAM,UAAU,cAAc,IAAI,oBAAoB,YAAY,mBAAoB,YAAY,WAAW;GAC7G,IAAI,IAAI,OAAO;IACb,IAAI,MAAM,IAAI,KAAK,IAAI,SAAS;IAChC;GACF;GAEA,MAAM,IAAI,MAAM,IAAI,KAAK,IAAI,WAAW,EAAE,OAAO,YAAY,MAAM,CAAC;EACtE;CACF;CAEA,OAAO;EACL;EACA,SAAS;EACT,OAAO,SAAS,UAAU,KAAA;EAC1B,MAAM,aAAa;GACjB,MAAM,SAAS,IAAgC;EACjD;EACA,MAAM,CAAC;CACT;AACF"}
1
+ {"version":3,"file":"unpluginFactory-MeM4qOk-.js","names":["unpluginVersion","userConfig"],"sources":["../package.json","../src/unpluginFactory.ts"],"sourcesContent":["","import process from 'node:process'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport { applyConfigDefaults, type Config, createKubb, Diagnostics, type KubbHooks, Hookable } from '@kubb/core'\nimport { pluginBarrel, pluginBarrelName } from '@kubb/plugin-barrel'\nimport { parserTs, parserTsx } from '@kubb/parser-ts'\nimport type { UnpluginFactory } from 'unplugin'\nimport { version as unpluginVersion } from '../package.json'\nimport type { Options } from './types.ts'\n\ntype RollupContext = {\n info?: (message: string) => void\n warn?: (message: string) => void\n error?: (message: string) => void\n}\n\n/**\n * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).\n *\n * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs\n * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS\n * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.\n */\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const hooks = new Hookable<KubbHooks>()\n const isVite = meta.framework === 'vite'\n\n hooks.hook('kubb:lifecycle:start', ({ version }) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n hooks.hook('kubb:error', ({ error }) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n hooks.hook('kubb:warn', ({ message }) => {\n console.warn(`⚠ ${message}`)\n })\n\n hooks.hook('kubb:info', ({ message }) => {\n console.info(`ℹ ${message}`)\n })\n\n hooks.hook('kubb:success', ({ message }) => {\n console.log(`✓ ${message}`)\n })\n\n hooks.hook('kubb:plugin:end', ({ plugin, duration }) => {\n const durationStr = duration >= 1000 ? `${(duration / 1000).toFixed(2)}s` : `${duration}ms`\n\n console.log(`✓ ${plugin.name} completed in ${durationStr}`)\n })\n\n hooks.hook('kubb:files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n hooks.hook('kubb:generation:end', ({ config, status, diagnostics }) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n\n if (!diagnostics || !status) return\n\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const pluginsCount = config.plugins.length\n const successCount = pluginsCount - failedCount\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${successCount} successful, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${successCount} successful, ✗ ${failedCount} failed, ${pluginsCount} total`,\n )\n })\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n ;(ctx.error ?? console.error)(`[${name}] Config is not set`)\n return\n }\n\n const { adapter, output, plugins } = applyConfigDefaults(options.config, {\n defaultAdapter: adapterOas(),\n barrelPlugin: pluginBarrel(),\n barrelPluginName: pluginBarrelName,\n defaultOutput: { barrel: { type: 'named' }, format: false, lint: false },\n })\n\n const config = {\n ...options.config,\n adapter,\n parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],\n plugins,\n output,\n }\n const hrStart = process.hrtime()\n\n await hooks.callHook('kubb:lifecycle:start', { version: unpluginVersion })\n\n const userConfig = config as Config\n\n const kubb = createKubb(userConfig, { hooks })\n await kubb.setup()\n\n await hooks.callHook('kubb:generation:start', { config: kubb.config })\n\n const { diagnostics, files, storage } = await kubb.safeBuild()\n\n const hasFailures = Diagnostics.hasError(diagnostics)\n\n // Surface every problem by severity. Unplugin has no diagnostic renderer, so route\n // errors/warnings/info to the channels it does listen on. Non-problem diagnostics are skipped.\n for (const diagnostic of diagnostics) {\n if (!Diagnostics.isProblem(diagnostic)) {\n continue\n }\n if (diagnostic.severity === 'error') {\n await hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n } else if (diagnostic.severity === 'warning') {\n await hooks.callHook('kubb:warn', { message: diagnostic.message })\n } else {\n await hooks.callHook('kubb:info', { message: diagnostic.message })\n }\n }\n\n await hooks.callHook('kubb:generation:end', {\n config: kubb.config,\n storage,\n diagnostics,\n filesCreated: files.length,\n status: hasFailures ? 'failed' : 'success',\n hrStart,\n })\n\n await hooks.callHook('kubb:lifecycle:end')\n\n if (hasFailures) {\n const failedCount = Diagnostics.failedPlugins(diagnostics).length\n const firstError = diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === 'error')\n const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : (firstError?.message ?? 'Build failed')\n if (ctx.error) {\n ctx.error(`[${name}] ${message}`)\n return\n }\n\n throw new Error(`[${name}] ${message}`, { cause: firstError?.cause })\n }\n }\n\n return {\n name,\n enforce: 'pre',\n apply: isVite ? 'build' : undefined,\n async buildStart() {\n await runBuild(this as unknown as RollupContext)\n },\n vite: {},\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;ACsBA,MAAa,mBAAyD,SAAS,SAAS;CACtF,MAAM,OAAO;CACb,MAAM,QAAQ,IAAI,SAAoB;CACtC,MAAM,SAAS,KAAK,cAAc;CAElC,MAAM,KAAK,yBAAyB,EAAE,cAAc;EAClD,QAAQ,IAAI,iBAAiB,QAAQ,IAAI;CAC3C,CAAC;CAED,MAAM,KAAK,eAAe,EAAE,YAAY;EACtC,QAAQ,MAAM,KAAK,OAAO,WAAW,UAAU;CACjD,CAAC;CAED,MAAM,K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EA,MAAM,IAAI,MAAM,IAAI,KAAK,IAAI,WAAW,EAAE,OAAO,YAAY,MAAM,CAAC;EACtE;CACF;CAEA,OAAO;EACL;EACA,SAAS;EACT,OAAO,SAAS,UAAU,KAAA;EAC1B,MAAM,aAAa;GACjB,MAAM,SAAS,IAAgC;EACjD;EACA,MAAM,CAAC;CACT;AACF"}
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
2
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
3
3
  exports.unpluginFactory = require_unpluginFactory.unpluginFactory;
@@ -1,2 +1,2 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  export { unpluginFactory };
package/dist/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  //#region src/vite.ts
3
3
  var vite_default = (0, require("unplugin").createVitePlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/vite.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createVitePlugin } from "unplugin";
3
3
  //#region src/vite.ts
4
4
  var vite_default = createVitePlugin(unpluginFactory);
package/dist/webpack.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-BYGsiFh_.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-Dwhiz47J.cjs");
2
2
  //#region src/webpack.ts
3
3
  var webpack_default = (0, require("unplugin").createWebpackPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/webpack.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-okNdii3V.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-MeM4qOk-.js";
2
2
  import { createWebpackPlugin } from "unplugin";
3
3
  //#region src/webpack.ts
4
4
  var webpack_default = createWebpackPlugin(unpluginFactory);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unplugin-kubb",
3
- "version": "5.0.0-beta.97",
3
+ "version": "5.0.0-beta.99",
4
4
  "description": "Integration of Kubb for Vite, Webpack, Rollup, esbuild, Rspack, Nuxt, and Astro.",
5
5
  "keywords": [
6
6
  "astro",
@@ -100,10 +100,10 @@
100
100
  },
101
101
  "dependencies": {
102
102
  "unplugin": "^3.3.0",
103
- "@kubb/adapter-oas": "5.0.0-beta.97",
104
- "@kubb/parser-ts": "5.0.0-beta.97",
105
- "@kubb/plugin-barrel": "5.0.0-beta.97",
106
- "@kubb/core": "5.0.0-beta.97"
103
+ "@kubb/adapter-oas": "5.0.0-beta.99",
104
+ "@kubb/core": "5.0.0-beta.99",
105
+ "@kubb/parser-ts": "5.0.0-beta.99",
106
+ "@kubb/plugin-barrel": "5.0.0-beta.99"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@farmfe/core": "^1.7.11",
@@ -114,7 +114,7 @@
114
114
  "rollup": "^4.62.2",
115
115
  "vite": "^8.1.4",
116
116
  "webpack": "^5.108.4",
117
- "@kubb/ast": "5.0.0-beta.97"
117
+ "@kubb/ast": "5.0.0-beta.99"
118
118
  },
119
119
  "peerDependencies": {
120
120
  "@farmfe/core": "^1.7.0",