unplugin-kubb 5.0.0-beta.9 → 5.0.0-beta.91

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 (78) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +26 -22
  3. package/dist/astro.cjs +1 -1
  4. package/dist/astro.cjs.map +1 -1
  5. package/dist/astro.d.ts +1 -1
  6. package/dist/astro.js +1 -1
  7. package/dist/astro.js.map +1 -1
  8. package/dist/esbuild.cjs +1 -1
  9. package/dist/esbuild.cjs.map +1 -1
  10. package/dist/esbuild.d.ts +2 -3
  11. package/dist/esbuild.js +1 -1
  12. package/dist/esbuild.js.map +1 -1
  13. package/dist/farm.cjs +1 -1
  14. package/dist/farm.cjs.map +1 -1
  15. package/dist/farm.d.ts +2 -3
  16. package/dist/farm.js +1 -1
  17. package/dist/farm.js.map +1 -1
  18. package/dist/index.cjs +2 -2
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.ts +3 -4
  21. package/dist/index.js +2 -2
  22. package/dist/index.js.map +1 -1
  23. package/dist/nuxt.cjs +1 -1
  24. package/dist/nuxt.cjs.map +1 -1
  25. package/dist/nuxt.d.ts +2 -4
  26. package/dist/nuxt.js +1 -1
  27. package/dist/nuxt.js.map +1 -1
  28. package/dist/rolldown.cjs +1 -1
  29. package/dist/rolldown.cjs.map +1 -1
  30. package/dist/rolldown.d.ts +2 -3
  31. package/dist/rolldown.js +1 -1
  32. package/dist/rolldown.js.map +1 -1
  33. package/dist/rollup.cjs +1 -1
  34. package/dist/rollup.cjs.map +1 -1
  35. package/dist/rollup.d.ts +2 -3
  36. package/dist/rollup.js +1 -1
  37. package/dist/rollup.js.map +1 -1
  38. package/dist/rspack.cjs +1 -1
  39. package/dist/rspack.cjs.map +1 -1
  40. package/dist/rspack.d.ts +1 -1
  41. package/dist/rspack.js +1 -1
  42. package/dist/rspack.js.map +1 -1
  43. package/dist/types.d.ts +1 -1
  44. package/dist/unpluginFactory-65RF6Gbg.cjs +157 -0
  45. package/dist/unpluginFactory-65RF6Gbg.cjs.map +1 -0
  46. package/dist/unpluginFactory-E2XDRtLl.js +120 -0
  47. package/dist/unpluginFactory-E2XDRtLl.js.map +1 -0
  48. package/dist/unpluginFactory.cjs +1 -1
  49. package/dist/unpluginFactory.d.ts +8 -1
  50. package/dist/unpluginFactory.js +1 -1
  51. package/dist/vite.cjs +1 -1
  52. package/dist/vite.cjs.map +1 -1
  53. package/dist/vite.d.ts +2 -3
  54. package/dist/vite.js +1 -1
  55. package/dist/vite.js.map +1 -1
  56. package/dist/webpack.cjs +1 -1
  57. package/dist/webpack.cjs.map +1 -1
  58. package/dist/webpack.d.ts +1 -1
  59. package/dist/webpack.js +1 -1
  60. package/dist/webpack.js.map +1 -1
  61. package/package.json +16 -19
  62. package/dist/unpluginFactory-Amggr1Ea.cjs +0 -279
  63. package/dist/unpluginFactory-Amggr1Ea.cjs.map +0 -1
  64. package/dist/unpluginFactory-C_rK_c2a.js +0 -236
  65. package/dist/unpluginFactory-C_rK_c2a.js.map +0 -1
  66. package/src/astro.ts +0 -12
  67. package/src/esbuild.ts +0 -5
  68. package/src/farm.ts +0 -5
  69. package/src/index.ts +0 -10
  70. package/src/nuxt.ts +0 -20
  71. package/src/rolldown.ts +0 -5
  72. package/src/rollup.ts +0 -5
  73. package/src/rspack.ts +0 -5
  74. package/src/types.ts +0 -8
  75. package/src/unpluginFactory.ts +0 -164
  76. package/src/vite.ts +0 -5
  77. package/src/webpack.ts +0 -7
  78. /package/dist/{chunk--u3MIqq1.js → rolldown-runtime-C0LytTxp.js} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unpluginFactory-65RF6Gbg.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 hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n } else if (diagnostic.severity === 'warning') {\n hooks.callHook('kubb:warn', { message: diagnostic.message })\n } else {\n 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,IAAI,WAAW,IAAA,CAAM,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS;EAExF,QAAQ,IAAI,KAAK,OAAO,KAAK,gBAAgB,aAAa;CAC5D,CAAC;CAED,MAAM,KAAK,mCAAmC;EAG5C,QAAQ,IAAI,8BAAI;CAClB,CAAC;CAED,MAAM,KAAK,wBAAwB,EAAE,QAAQ,QAAQ,kBAAk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AO,YAAY,MAAM,KAAK,UAAU;EAE7D,MAAM,cAAcJ,WAAAA,YAAY,SAAS,WAAW;EAIpD,KAAK,MAAM,cAAc,aAAa;GACpC,IAAI,CAACA,WAAAA,YAAY,UAAU,UAAU,GACnC;GAEF,IAAI,WAAW,aAAa,SAC1B,MAAM,SAAS,cAAc,EAAE,OAAO,WAAW,SAAS,IAAI,MAAM,WAAW,OAAO,EAAE,CAAC;QACpF,IAAI,WAAW,aAAa,WACjC,MAAM,SAAS,aAAa,EAAE,SAAS,WAAW,QAAQ,CAAC;QAE3D,MAAM,SAAS,aAAa,EAAE,SAAS,WAAW,QAAQ,CAAC;EAE/D;EAEA,MAAM,MAAM,SAAS,uBAAuB;GAC1C,QAAQ,KAAK;GACb;GACA;GACA,cAAc,MAAM;GACpB,QAAQ,cAAc,WAAW;GACjC;EACF,CAAC;EAED,MAAM,MAAM,SAAS,oBAAoB;EAEzC,IAAI,aAAa;GACf,MAAM,cAAcA,WAAAA,YAAY,cAAc,WAAW,CAAC,CAAC;GAC3D,MAAM,aAAa,YAAY,OAAOA,WAAAA,YAAY,SAAS,CAAC,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"}
@@ -0,0 +1,120 @@
1
+ import "./rolldown-runtime-C0LytTxp.js";
2
+ import process from "node:process";
3
+ import { adapterOas } from "@kubb/adapter-oas";
4
+ import { Diagnostics, Hookable, applyConfigDefaults, createKubb } from "@kubb/core";
5
+ import { pluginBarrel, pluginBarrelName } from "@kubb/plugin-barrel";
6
+ import { parserTs, parserTsx } from "@kubb/parser-ts";
7
+ //#region package.json
8
+ var version = "5.0.0-beta.91";
9
+ //#endregion
10
+ //#region src/unpluginFactory.ts
11
+ /**
12
+ * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).
13
+ *
14
+ * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs
15
+ * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS
16
+ * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.
17
+ */
18
+ const unpluginFactory = (options, meta) => {
19
+ const name = "unplugin-kubb";
20
+ const hooks = new Hookable();
21
+ const isVite = meta.framework === "vite";
22
+ hooks.hook("kubb:lifecycle:start", ({ version }) => {
23
+ console.log(`Kubb Unplugin ${version} 🧩`);
24
+ });
25
+ hooks.hook("kubb:error", ({ error }) => {
26
+ console.error(`✗ ${error?.message || "failed"}`);
27
+ });
28
+ hooks.hook("kubb:warn", ({ message }) => {
29
+ console.warn(`⚠ ${message}`);
30
+ });
31
+ hooks.hook("kubb:info", ({ message }) => {
32
+ console.info(`ℹ ${message}`);
33
+ });
34
+ hooks.hook("kubb:success", ({ message }) => {
35
+ console.log(`✓ ${message}`);
36
+ });
37
+ hooks.hook("kubb:plugin:end", ({ plugin, duration }) => {
38
+ const durationStr = duration >= 1e3 ? `${(duration / 1e3).toFixed(2)}s` : `${duration}ms`;
39
+ console.log(`✓ ${plugin.name} completed in ${durationStr}`);
40
+ });
41
+ hooks.hook("kubb:files:processing:end", () => {
42
+ console.log("✓ Files written successfully");
43
+ });
44
+ hooks.hook("kubb:generation:end", ({ config, status, diagnostics }) => {
45
+ console.log(config.name ? `✓ Generation completed for ${config.name}` : "✓ Generation completed");
46
+ if (!diagnostics || !status) return;
47
+ const failedCount = Diagnostics.failedPlugins(diagnostics).length;
48
+ const pluginsCount = config.plugins.length;
49
+ const successCount = pluginsCount - failedCount;
50
+ console.log(status === "success" ? `Kubb Summary: ✓ ${`${successCount} successful`}, ${pluginsCount} total` : `Kubb Summary: ✓ ${`${successCount} successful`}, ✗ ${`${failedCount} failed`}, ${pluginsCount} total`);
51
+ });
52
+ async function runBuild(ctx) {
53
+ if (!options?.config) {
54
+ (ctx.error ?? console.error)(`[${name}] Config is not set`);
55
+ return;
56
+ }
57
+ const { adapter, output, plugins } = applyConfigDefaults(options.config, {
58
+ defaultAdapter: adapterOas(),
59
+ barrelPlugin: pluginBarrel(),
60
+ barrelPluginName: pluginBarrelName,
61
+ defaultOutput: {
62
+ barrel: { type: "named" },
63
+ format: false,
64
+ lint: false
65
+ }
66
+ });
67
+ const config = {
68
+ ...options.config,
69
+ adapter,
70
+ parsers: options.config.parsers?.length ? options.config.parsers : [parserTs(), parserTsx()],
71
+ plugins,
72
+ output
73
+ };
74
+ const hrStart = process.hrtime();
75
+ await hooks.callHook("kubb:lifecycle:start", { version });
76
+ const kubb = createKubb(config, { hooks });
77
+ await kubb.setup();
78
+ await hooks.callHook("kubb:generation:start", { config: kubb.config });
79
+ const { diagnostics, files, storage } = await kubb.safeBuild();
80
+ const hasFailures = Diagnostics.hasError(diagnostics);
81
+ for (const diagnostic of diagnostics) {
82
+ if (!Diagnostics.isProblem(diagnostic)) continue;
83
+ if (diagnostic.severity === "error") hooks.callHook("kubb:error", { error: diagnostic.cause ?? new Error(diagnostic.message) });
84
+ else if (diagnostic.severity === "warning") hooks.callHook("kubb:warn", { message: diagnostic.message });
85
+ else hooks.callHook("kubb:info", { message: diagnostic.message });
86
+ }
87
+ await hooks.callHook("kubb:generation:end", {
88
+ config: kubb.config,
89
+ storage,
90
+ diagnostics,
91
+ filesCreated: files.length,
92
+ status: hasFailures ? "failed" : "success",
93
+ hrStart
94
+ });
95
+ await hooks.callHook("kubb:lifecycle:end");
96
+ if (hasFailures) {
97
+ const failedCount = Diagnostics.failedPlugins(diagnostics).length;
98
+ const firstError = diagnostics.filter(Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === "error");
99
+ const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : firstError?.message ?? "Build failed";
100
+ if (ctx.error) {
101
+ ctx.error(`[${name}] ${message}`);
102
+ return;
103
+ }
104
+ throw new Error(`[${name}] ${message}`, { cause: firstError?.cause });
105
+ }
106
+ }
107
+ return {
108
+ name,
109
+ enforce: "pre",
110
+ apply: isVite ? "build" : void 0,
111
+ async buildStart() {
112
+ await runBuild(this);
113
+ },
114
+ vite: {}
115
+ };
116
+ };
117
+ //#endregion
118
+ export { unpluginFactory as t };
119
+
120
+ //# sourceMappingURL=unpluginFactory-E2XDRtLl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unpluginFactory-E2XDRtLl.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 hooks.callHook('kubb:error', { error: diagnostic.cause ?? new Error(diagnostic.message) })\n } else if (diagnostic.severity === 'warning') {\n hooks.callHook('kubb:warn', { message: diagnostic.message })\n } else {\n 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,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,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,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_unpluginFactory = require("./unpluginFactory-Amggr1Ea.cjs");
2
+ const require_unpluginFactory = require("./unpluginFactory-65RF6Gbg.cjs");
3
3
  exports.unpluginFactory = require_unpluginFactory.unpluginFactory;
@@ -1,8 +1,15 @@
1
- import { t as __name } from "./chunk--u3MIqq1.js";
1
+ import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
2
  import { Options } from "./types.js";
3
3
  import { UnpluginFactory } from "unplugin";
4
4
 
5
5
  //#region src/unpluginFactory.d.ts
6
+ /**
7
+ * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).
8
+ *
9
+ * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs
10
+ * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS
11
+ * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.
12
+ */
6
13
  declare const unpluginFactory: UnpluginFactory<Options | undefined>;
7
14
  //#endregion
8
15
  export { unpluginFactory };
@@ -1,2 +1,2 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-C_rK_c2a.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-E2XDRtLl.js";
2
2
  export { unpluginFactory };
package/dist/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-Amggr1Ea.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-65RF6Gbg.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.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.cjs","names":["unpluginFactory"],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,gBAAA,sBAAA,CAAA,kBAAgCA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"vite.cjs","names":["unpluginFactory"],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,gBAAA,qBAAA,CAAA,CAAA,iBAAA,CAAgCA,wBAAAA,eAAe"}
package/dist/vite.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { t as __name } from "./chunk--u3MIqq1.js";
1
+ import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
2
  import { Options } from "./types.js";
3
- import * as _$vite from "vite";
4
3
 
5
4
  //#region src/vite.d.ts
6
- declare const _default: (options?: Options | undefined) => _$vite.Plugin<any> | _$vite.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => import("vite").Plugin<any> | import("vite").Plugin<any>[];
7
6
  //#endregion
8
7
  export { _default as default };
9
8
  //# sourceMappingURL=vite.d.ts.map
package/dist/vite.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-C_rK_c2a.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-E2XDRtLl.js";
2
2
  import { createVitePlugin } from "unplugin";
3
3
  //#region src/vite.ts
4
4
  var vite_default = createVitePlugin(unpluginFactory);
package/dist/vite.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,eAAe,iBAAiB,gBAAgB"}
1
+ {"version":3,"file":"vite.js","names":[],"sources":["../src/vite.ts"],"sourcesContent":["import { createVitePlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createVitePlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,eAAe,iBAAiB,eAAe"}
package/dist/webpack.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-Amggr1Ea.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-65RF6Gbg.cjs");
2
2
  //#region src/webpack.ts
3
3
  var webpack_default = (0, require("unplugin").createWebpackPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.cjs","names":["unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;AAMA,IAAA,mBAAA,sBAAA,CAAA,qBAAmCA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"webpack.cjs","names":["unpluginFactory"],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;AAMA,IAAA,mBAAA,qBAAA,CAAA,CAAA,oBAAA,CAAmCA,wBAAAA,eAAe"}
package/dist/webpack.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { t as __name } from "./chunk--u3MIqq1.js";
1
+ import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
2
2
  import { Options } from "./types.js";
3
3
  import { UnpluginFactoryOutput } from "unplugin";
4
4
  import { WebpackPluginInstance } from "webpack";
package/dist/webpack.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-C_rK_c2a.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-E2XDRtLl.js";
2
2
  import { createWebpackPlugin } from "unplugin";
3
3
  //#region src/webpack.ts
4
4
  var webpack_default = createWebpackPlugin(unpluginFactory);
@@ -1 +1 @@
1
- {"version":3,"file":"webpack.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;;AAMA,IAAA,kBAAe,oBAAoB,gBAAgB"}
1
+ {"version":3,"file":"webpack.js","names":[],"sources":["../src/webpack.ts"],"sourcesContent":["import type { UnpluginFactoryOutput } from 'unplugin'\nimport { createWebpackPlugin } from 'unplugin'\nimport type { WebpackPluginInstance } from 'webpack'\nimport type { Options } from './types.ts'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createWebpackPlugin(unpluginFactory) as unknown as UnpluginFactoryOutput<Options, WebpackPluginInstance>\n"],"mappings":";;;AAMA,IAAA,kBAAe,oBAAoB,eAAe"}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "unplugin-kubb",
3
- "version": "5.0.0-beta.9",
4
- "description": "Universal build integration for Kubb using unplugin. Plug OpenAPI code generation into Vite, Webpack, Rollup, esbuild, Rspack, Nuxt, and Astro as part of your regular build pipeline.",
3
+ "version": "5.0.0-beta.91",
4
+ "description": "Integration of Kubb for Vite, Webpack, Rollup, esbuild, Rspack, Nuxt, and Astro.",
5
5
  "keywords": [
6
6
  "astro",
7
7
  "codegen",
8
8
  "esbuild",
9
9
  "farm",
10
10
  "kubb",
11
+ "meta-framework",
11
12
  "nuxt",
12
- "openapi",
13
13
  "rollup",
14
14
  "rspack",
15
15
  "typescript",
@@ -25,7 +25,6 @@
25
25
  "directory": "packages/unplugin"
26
26
  },
27
27
  "files": [
28
- "src",
29
28
  "dist",
30
29
  "!/**/**.test.**",
31
30
  "!/**/__tests__/**",
@@ -100,22 +99,22 @@
100
99
  "registry": "https://registry.npmjs.org/"
101
100
  },
102
101
  "dependencies": {
103
- "unplugin": "^3.0.0",
104
- "@kubb/adapter-oas": "5.0.0-beta.9",
105
- "@kubb/core": "5.0.0-beta.9",
106
- "@kubb/parser-ts": "5.0.0-beta.9",
107
- "@kubb/middleware-barrel": "5.0.0-beta.9"
102
+ "unplugin": "^3.3.0",
103
+ "@kubb/core": "5.0.0-beta.91",
104
+ "@kubb/plugin-barrel": "5.0.0-beta.91",
105
+ "@kubb/adapter-oas": "5.0.0-beta.91",
106
+ "@kubb/parser-ts": "5.0.0-beta.91"
108
107
  },
109
108
  "devDependencies": {
110
109
  "@farmfe/core": "^1.7.11",
111
- "@nuxt/kit": "^4.4.4",
112
- "@nuxt/schema": "^4.4.4",
113
- "esbuild": "^0.28.0",
114
- "rolldown": "1.0.0-rc.16",
115
- "rollup": "^4.60.3",
116
- "vite": "^8.0.11",
117
- "webpack": "^5.106.2",
118
- "@internals/utils": "0.0.0"
110
+ "@nuxt/kit": "^4.4.8",
111
+ "@nuxt/schema": "^4.4.8",
112
+ "esbuild": "^0.28.1",
113
+ "rolldown": "^1.1.4",
114
+ "rollup": "^4.62.2",
115
+ "vite": "^8.1.3",
116
+ "webpack": "^5.108.4",
117
+ "@kubb/ast": "5.0.0-beta.91"
119
118
  },
120
119
  "peerDependencies": {
121
120
  "@farmfe/core": "^1.7.0",
@@ -162,8 +161,6 @@
162
161
  "clean": "node -e \"require('node:fs').rmSync('./dist', {recursive:true,force:true})\"",
163
162
  "lint": "oxlint .",
164
163
  "lint:fix": "oxlint --fix .",
165
- "release": "pnpm publish --no-git-check",
166
- "release:canary": "bash ../../.github/canary.sh && node ../../scripts/build.js canary && pnpm publish --no-git-check",
167
164
  "start": "tsdown --watch",
168
165
  "test": "vitest --passWithNoTests",
169
166
  "typecheck": "tsc -p ./tsconfig.json --noEmit --emitDeclarationOnly false"
@@ -1,279 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __name = (target, value) => __defProp(target, "name", {
5
- value,
6
- configurable: true
7
- });
8
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
- var __getOwnPropNames = Object.getOwnPropertyNames;
10
- var __getProtoOf = Object.getPrototypeOf;
11
- var __hasOwnProp = Object.prototype.hasOwnProperty;
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
- key = keys[i];
15
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
- get: ((k) => from[k]).bind(null, key),
17
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
- });
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
- //#endregion
27
- let node_process = require("node:process");
28
- node_process = __toESM(node_process, 1);
29
- let node_events = require("node:events");
30
- let _kubb_adapter_oas = require("@kubb/adapter-oas");
31
- let _kubb_core = require("@kubb/core");
32
- let _kubb_middleware_barrel = require("@kubb/middleware-barrel");
33
- let _kubb_parser_ts = require("@kubb/parser-ts");
34
- //#region ../../internals/utils/src/errors.ts
35
- /**
36
- * Coerces an unknown thrown value to an `Error` instance.
37
- * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.
38
- *
39
- * @example
40
- * ```ts
41
- * try { ... } catch(err) {
42
- * throw new BuildError('Build failed', { cause: toError(err), errors: [] })
43
- * }
44
- * ```
45
- */
46
- function toError(value) {
47
- return value instanceof Error ? value : new Error(String(value));
48
- }
49
- //#endregion
50
- //#region ../../internals/utils/src/asyncEventEmitter.ts
51
- /**
52
- * Typed `EventEmitter` that awaits all async listeners before resolving.
53
- * Wraps Node's `EventEmitter` with full TypeScript event-map inference.
54
- *
55
- * @example
56
- * ```ts
57
- * const emitter = new AsyncEventEmitter<{ build: [name: string] }>()
58
- * emitter.on('build', async (name) => { console.log(name) })
59
- * await emitter.emit('build', 'petstore') // all listeners awaited
60
- * ```
61
- */
62
- var AsyncEventEmitter = class {
63
- /**
64
- * Maximum number of listeners per event before Node emits a memory-leak warning.
65
- * @default 10
66
- */
67
- constructor(maxListener = 10) {
68
- this.#emitter.setMaxListeners(maxListener);
69
- }
70
- #emitter = new node_events.EventEmitter();
71
- /**
72
- * Emits `eventName` and awaits all registered listeners sequentially.
73
- * Throws if any listener rejects, wrapping the cause with the event name and serialized arguments.
74
- *
75
- * @example
76
- * ```ts
77
- * await emitter.emit('build', 'petstore')
78
- * ```
79
- */
80
- async emit(eventName, ...eventArgs) {
81
- const listeners = this.#emitter.listeners(eventName);
82
- if (listeners.length === 0) return;
83
- for (const listener of listeners) try {
84
- await listener(...eventArgs);
85
- } catch (err) {
86
- let serializedArgs;
87
- try {
88
- serializedArgs = JSON.stringify(eventArgs);
89
- } catch {
90
- serializedArgs = String(eventArgs);
91
- }
92
- throw new Error(`Error in async listener for "${eventName}" with eventArgs ${serializedArgs}`, { cause: toError(err) });
93
- }
94
- }
95
- /**
96
- * Registers a persistent listener for `eventName`.
97
- *
98
- * @example
99
- * ```ts
100
- * emitter.on('build', async (name) => { console.log(name) })
101
- * ```
102
- */
103
- on(eventName, handler) {
104
- this.#emitter.on(eventName, handler);
105
- }
106
- /**
107
- * Registers a one-shot listener that removes itself after the first invocation.
108
- *
109
- * @example
110
- * ```ts
111
- * emitter.onOnce('build', async (name) => { console.log(name) })
112
- * ```
113
- */
114
- onOnce(eventName, handler) {
115
- const wrapper = (...args) => {
116
- this.off(eventName, wrapper);
117
- return handler(...args);
118
- };
119
- this.on(eventName, wrapper);
120
- }
121
- /**
122
- * Removes a previously registered listener.
123
- *
124
- * @example
125
- * ```ts
126
- * emitter.off('build', handler)
127
- * ```
128
- */
129
- off(eventName, handler) {
130
- this.#emitter.off(eventName, handler);
131
- }
132
- /**
133
- * Returns the number of listeners registered for `eventName`.
134
- *
135
- * @example
136
- * ```ts
137
- * emitter.on('build', handler)
138
- * emitter.listenerCount('build') // 1
139
- * ```
140
- */
141
- listenerCount(eventName) {
142
- return this.#emitter.listenerCount(eventName);
143
- }
144
- /**
145
- * Removes all listeners from every event channel.
146
- *
147
- * @example
148
- * ```ts
149
- * emitter.removeAll()
150
- * ```
151
- */
152
- removeAll() {
153
- this.#emitter.removeAllListeners();
154
- }
155
- };
156
- //#endregion
157
- //#region package.json
158
- var version = "5.0.0-beta.9";
159
- //#endregion
160
- //#region src/unpluginFactory.ts
161
- const unpluginFactory = (options, meta) => {
162
- const name = "unplugin-kubb";
163
- const hooks = new AsyncEventEmitter();
164
- const isVite = meta.framework === "vite";
165
- hooks.on("kubb:lifecycle:start", ({ version }) => {
166
- console.log(`Kubb Unplugin ${version} 🧩`);
167
- });
168
- hooks.on("kubb:error", ({ error }) => {
169
- console.error(`✗ ${error?.message || "failed"}`);
170
- });
171
- hooks.on("kubb:warn", ({ message }) => {
172
- console.warn(`⚠ ${message}`);
173
- });
174
- hooks.on("kubb:info", ({ message }) => {
175
- console.info(`ℹ ${message}`);
176
- });
177
- hooks.on("kubb:success", ({ message }) => {
178
- console.log(`✓ ${message}`);
179
- });
180
- hooks.on("kubb:plugin:end", ({ plugin, duration }) => {
181
- const durationStr = duration >= 1e3 ? `${(duration / 1e3).toFixed(2)}s` : `${duration}ms`;
182
- console.log(`✓ ${plugin.name} completed in ${durationStr}`);
183
- });
184
- hooks.on("kubb:files:processing:end", () => {
185
- console.log("✓ Files written successfully");
186
- });
187
- hooks.on("kubb:generation:end", ({ config }) => {
188
- console.log(config.name ? `✓ Generation completed for ${config.name}` : "✓ Generation completed");
189
- });
190
- hooks.on("kubb:generation:summary", ({ config, status, failedPlugins }) => {
191
- const pluginsCount = config.plugins.length;
192
- const successCount = pluginsCount - failedPlugins.size;
193
- console.log(status === "success" ? `Kubb Summary: ✓ ${`${successCount} successful`}, ${pluginsCount} total` : `Kubb Summary: ✓ ${`${successCount} successful`}, ✗ ${`${failedPlugins.size} failed`}, ${pluginsCount} total`);
194
- });
195
- async function runBuild(ctx) {
196
- if (!options?.config) {
197
- if (ctx.error) ctx.error?.(`[${name}] Config is not set`);
198
- else console.error(`[${name}] Config is not set`);
199
- return;
200
- }
201
- const middleware = options.config.middleware?.length ? options.config.middleware : [(0, _kubb_middleware_barrel.middlewareBarrel)()];
202
- const hasBarrelMiddleware = middleware.some((m) => m.name === _kubb_middleware_barrel.middlewareBarrelName);
203
- const output = { ...options.config.output };
204
- if (hasBarrelMiddleware && output.barrel === void 0) output.barrel = { type: "named" };
205
- if (output.format === void 0) output.format = false;
206
- if (output.lint === void 0) output.lint = false;
207
- const config = {
208
- ...options.config,
209
- adapter: options.config.adapter ?? (0, _kubb_adapter_oas.adapterOas)(),
210
- parsers: options.config.parsers?.length ? options.config.parsers : [_kubb_parser_ts.parserTs, _kubb_parser_ts.parserTsx],
211
- middleware,
212
- output
213
- };
214
- const hrStart = node_process.default.hrtime();
215
- await hooks.emit("kubb:lifecycle:start", { version });
216
- const userConfig = config;
217
- const kubb = (0, _kubb_core.createKubb)(userConfig, { hooks });
218
- await kubb.setup();
219
- const resolvedConfig = kubb.config ?? userConfig;
220
- await hooks.emit("kubb:generation:start", { config: resolvedConfig });
221
- const { error, failedPlugins, pluginTimings, files, sources } = await kubb.safeBuild();
222
- const hasFailures = failedPlugins.size > 0 || error;
223
- if (hasFailures) [error, ...Array.from(failedPlugins).filter((it) => it.error).map((it) => it.error)].filter(Boolean).forEach((err) => {
224
- hooks.emit("kubb:error", { error: err });
225
- });
226
- await hooks.emit("kubb:generation:end", {
227
- config: resolvedConfig,
228
- files,
229
- sources
230
- });
231
- await hooks.emit("kubb:generation:summary", {
232
- config: resolvedConfig,
233
- failedPlugins,
234
- filesCreated: files.length,
235
- status: failedPlugins.size > 0 || error ? "failed" : "success",
236
- hrStart,
237
- pluginTimings
238
- });
239
- await hooks.emit("kubb:lifecycle:end");
240
- if (hasFailures) {
241
- const message = error?.message ?? `Build Error with ${failedPlugins.size} failed plugins`;
242
- if (ctx.error) {
243
- ctx.error(`[${name}] ${message}`);
244
- return;
245
- }
246
- throw new Error(`[${name}] ${message}`, { cause: error });
247
- }
248
- }
249
- return {
250
- name,
251
- enforce: "pre",
252
- apply: isVite ? "build" : void 0,
253
- async buildStart() {
254
- await runBuild(this);
255
- },
256
- vite: {}
257
- };
258
- };
259
- //#endregion
260
- Object.defineProperty(exports, "__name", {
261
- enumerable: true,
262
- get: function() {
263
- return __name;
264
- }
265
- });
266
- Object.defineProperty(exports, "__toESM", {
267
- enumerable: true,
268
- get: function() {
269
- return __toESM;
270
- }
271
- });
272
- Object.defineProperty(exports, "unpluginFactory", {
273
- enumerable: true,
274
- get: function() {
275
- return unpluginFactory;
276
- }
277
- });
278
-
279
- //# sourceMappingURL=unpluginFactory-Amggr1Ea.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unpluginFactory-Amggr1Ea.cjs","names":["#emitter","NodeEventEmitter","middlewareBarrelName","parserTs","parserTsx","process","unpluginVersion"],"sources":["../../../internals/utils/src/errors.ts","../../../internals/utils/src/asyncEventEmitter.ts","../package.json","../src/unpluginFactory.ts"],"sourcesContent":["/**\n * Thrown when one or more errors occur during a Kubb build.\n * Carries the full list of underlying errors on `errors`.\n *\n * @example\n * ```ts\n * throw new BuildError('Build failed', { errors: [err1, err2] })\n * ```\n */\nexport class BuildError extends Error {\n errors: Array<Error>\n\n constructor(message: string, options: { cause?: Error; errors: Array<Error> }) {\n super(message, { cause: options.cause })\n this.name = 'BuildError'\n this.errors = options.errors\n }\n}\n\n/**\n * Coerces an unknown thrown value to an `Error` instance.\n * Returns the value as-is when it is already an `Error`; otherwise wraps it with `String(value)`.\n *\n * @example\n * ```ts\n * try { ... } catch(err) {\n * throw new BuildError('Build failed', { cause: toError(err), errors: [] })\n * }\n * ```\n */\nexport function toError(value: unknown): Error {\n return value instanceof Error ? value : new Error(String(value))\n}\n\n/**\n * Extracts a human-readable message from any thrown value.\n *\n * @example\n * ```ts\n * getErrorMessage(new Error('oops')) // 'oops'\n * getErrorMessage('plain string') // 'plain string'\n * ```\n */\nexport function getErrorMessage(value: unknown): string {\n return value instanceof Error ? value.message : String(value)\n}\n\n/**\n * Extracts the `.cause` of an `Error` as an `Error`, or `undefined` when absent or not an `Error`.\n *\n * @example\n * ```ts\n * const cause = toCause(buildError) // Error | undefined\n * ```\n */\nexport function toCause(error: Error): Error | undefined {\n return error.cause instanceof Error ? error.cause : undefined\n}\n","import { EventEmitter as NodeEventEmitter } from 'node:events'\nimport { toError } from './errors.ts'\n\n/**\n * A function that can be registered as an event listener, synchronous or async.\n */\ntype AsyncListener<TArgs extends unknown[]> = (...args: TArgs) => void | Promise<void>\n\n/**\n * Typed `EventEmitter` that awaits all async listeners before resolving.\n * Wraps Node's `EventEmitter` with full TypeScript event-map inference.\n *\n * @example\n * ```ts\n * const emitter = new AsyncEventEmitter<{ build: [name: string] }>()\n * emitter.on('build', async (name) => { console.log(name) })\n * await emitter.emit('build', 'petstore') // all listeners awaited\n * ```\n */\nexport class AsyncEventEmitter<TEvents extends { [K in keyof TEvents]: unknown[] }> {\n /**\n * Maximum number of listeners per event before Node emits a memory-leak warning.\n * @default 10\n */\n constructor(maxListener = 10) {\n this.#emitter.setMaxListeners(maxListener)\n }\n\n #emitter = new NodeEventEmitter()\n\n /**\n * Emits `eventName` and awaits all registered listeners sequentially.\n * Throws if any listener rejects, wrapping the cause with the event name and serialized arguments.\n *\n * @example\n * ```ts\n * await emitter.emit('build', 'petstore')\n * ```\n */\n async emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void> {\n const listeners = this.#emitter.listeners(eventName) as Array<AsyncListener<TEvents[TEventName]>>\n\n if (listeners.length === 0) {\n return\n }\n\n for (const listener of listeners) {\n try {\n await listener(...eventArgs)\n } catch (err) {\n let serializedArgs: string\n try {\n serializedArgs = JSON.stringify(eventArgs)\n } catch {\n serializedArgs = String(eventArgs)\n }\n throw new Error(`Error in async listener for \"${eventName}\" with eventArgs ${serializedArgs}`, { cause: toError(err) })\n }\n }\n }\n\n /**\n * Registers a persistent listener for `eventName`.\n *\n * @example\n * ```ts\n * emitter.on('build', async (name) => { console.log(name) })\n * ```\n */\n on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: AsyncListener<TEvents[TEventName]>): void {\n this.#emitter.on(eventName, handler as AsyncListener<unknown[]>)\n }\n\n /**\n * Registers a one-shot listener that removes itself after the first invocation.\n *\n * @example\n * ```ts\n * emitter.onOnce('build', async (name) => { console.log(name) })\n * ```\n */\n onOnce<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: AsyncListener<TEvents[TEventName]>): void {\n const wrapper: AsyncListener<TEvents[TEventName]> = (...args) => {\n this.off(eventName, wrapper)\n return handler(...args)\n }\n this.on(eventName, wrapper)\n }\n\n /**\n * Removes a previously registered listener.\n *\n * @example\n * ```ts\n * emitter.off('build', handler)\n * ```\n */\n off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: AsyncListener<TEvents[TEventName]>): void {\n this.#emitter.off(eventName, handler as AsyncListener<unknown[]>)\n }\n\n /**\n * Returns the number of listeners registered for `eventName`.\n *\n * @example\n * ```ts\n * emitter.on('build', handler)\n * emitter.listenerCount('build') // 1\n * ```\n */\n listenerCount<TEventName extends keyof TEvents & string>(eventName: TEventName): number {\n return this.#emitter.listenerCount(eventName)\n }\n\n /**\n * Removes all listeners from every event channel.\n *\n * @example\n * ```ts\n * emitter.removeAll()\n * ```\n */\n removeAll(): void {\n this.#emitter.removeAllListeners()\n }\n}\n","","import process from 'node:process'\nimport { AsyncEventEmitter } from '@internals/utils'\nimport { adapterOas } from '@kubb/adapter-oas'\nimport { type Config, createKubb, type KubbHooks } from '@kubb/core'\nimport { middlewareBarrel, middlewareBarrelName } from '@kubb/middleware-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\nexport const unpluginFactory: UnpluginFactory<Options | undefined> = (options, meta) => {\n const name = 'unplugin-kubb' as const\n const hooks = new AsyncEventEmitter<KubbHooks>()\n const isVite = meta.framework === 'vite'\n\n hooks.on('kubb:lifecycle:start', ({ version }) => {\n console.log(`Kubb Unplugin ${version} 🧩`)\n })\n\n hooks.on('kubb:error', ({ error }) => {\n console.error(`✗ ${error?.message || 'failed'}`)\n })\n\n hooks.on('kubb:warn', ({ message }) => {\n console.warn(`⚠ ${message}`)\n })\n\n hooks.on('kubb:info', ({ message }) => {\n console.info(`ℹ ${message}`)\n })\n\n hooks.on('kubb:success', ({ message }) => {\n console.log(`✓ ${message}`)\n })\n\n hooks.on('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.on('kubb:files:processing:end', () => {\n const text = '✓ Files written successfully'\n\n console.log(text)\n })\n\n hooks.on('kubb:generation:end', ({ config }) => {\n console.log(config.name ? `✓ Generation completed for ${config.name}` : '✓ Generation completed')\n })\n\n hooks.on('kubb:generation:summary', ({ config, status, failedPlugins }) => {\n const pluginsCount = config.plugins.length\n const successCount = pluginsCount - failedPlugins.size\n\n console.log(\n status === 'success'\n ? `Kubb Summary: ✓ ${`${successCount} successful`}, ${pluginsCount} total`\n : `Kubb Summary: ✓ ${`${successCount} successful`}, ✗ ${`${failedPlugins.size} failed`}, ${pluginsCount} total`,\n )\n })\n\n async function runBuild(ctx: RollupContext) {\n if (!options?.config) {\n if (ctx.error) {\n ctx.error?.(`[${name}] Config is not set`)\n } else {\n console.error(`[${name}] Config is not set`)\n }\n return\n }\n\n const middleware = options.config.middleware?.length ? options.config.middleware : [middlewareBarrel()]\n const hasBarrelMiddleware = middleware.some((m) => m.name === middlewareBarrelName)\n const output = { ...options.config.output }\n if (hasBarrelMiddleware && output.barrel === undefined) {\n output.barrel = { type: 'named' }\n }\n if (output.format === undefined) {\n output.format = false\n }\n if (output.lint === undefined) {\n output.lint = false\n }\n\n const config = {\n ...options.config,\n adapter: options.config.adapter ?? adapterOas(),\n parsers: options.config.parsers?.length ? options.config.parsers : [parserTs, parserTsx],\n middleware,\n output,\n }\n const hrStart = process.hrtime()\n\n await hooks.emit('kubb:lifecycle:start', { version: unpluginVersion })\n\n const userConfig = config as Config\n\n const kubb = createKubb(\n userConfig,\n { hooks },\n )\n await kubb.setup()\n\n const resolvedConfig = kubb.config ?? userConfig\n\n await hooks.emit('kubb:generation:start', { config: resolvedConfig })\n\n const { error, failedPlugins, pluginTimings, files, sources } = await kubb.safeBuild()\n\n const hasFailures = failedPlugins.size > 0 || error\n if (hasFailures) {\n // Collect all errors from failed plugins and general error\n const allErrors: Error[] = [\n error,\n ...Array.from(failedPlugins)\n .filter((it) => it.error)\n .map((it) => it.error),\n ].filter(Boolean)\n\n allErrors.forEach((err) => {\n hooks.emit('kubb:error', { error: err })\n })\n }\n\n await hooks.emit('kubb:generation:end', { config: resolvedConfig, files, sources })\n await hooks.emit('kubb:generation:summary', {\n config: resolvedConfig,\n failedPlugins,\n filesCreated: files.length,\n status: failedPlugins.size > 0 || error ? 'failed' : 'success',\n hrStart,\n pluginTimings,\n })\n\n await hooks.emit('kubb:lifecycle:end')\n\n if (hasFailures) {\n const message = error?.message ?? `Build Error with ${failedPlugins.size} failed plugins`\n if (ctx.error) {\n ctx.error(`[${name}] ${message}`)\n return\n }\n\n throw new Error(`[${name}] ${message}`, { cause: error })\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,QAAQ,OAAuB;CAC7C,OAAO,iBAAiB,QAAQ,QAAQ,IAAI,MAAM,OAAO,MAAM,CAAC;;;;;;;;;;;;;;;ACZlE,IAAa,oBAAb,MAAoF;;;;;CAKlF,YAAY,cAAc,IAAI;EAC5B,KAAKA,SAAS,gBAAgB,YAAY;;CAG5C,WAAW,IAAIC,YAAAA,cAAkB;;;;;;;;;;CAWjC,MAAM,KAAgD,WAAuB,GAAG,WAA+C;EAC7H,MAAM,YAAY,KAAKD,SAAS,UAAU,UAAU;EAEpD,IAAI,UAAU,WAAW,GACvB;EAGF,KAAK,MAAM,YAAY,WACrB,IAAI;GACF,MAAM,SAAS,GAAG,UAAU;WACrB,KAAK;GACZ,IAAI;GACJ,IAAI;IACF,iBAAiB,KAAK,UAAU,UAAU;WACpC;IACN,iBAAiB,OAAO,UAAU;;GAEpC,MAAM,IAAI,MAAM,gCAAgC,UAAU,mBAAmB,kBAAkB,EAAE,OAAO,QAAQ,IAAI,EAAE,CAAC;;;;;;;;;;;CAa7H,GAA8C,WAAuB,SAAmD;EACtH,KAAKA,SAAS,GAAG,WAAW,QAAoC;;;;;;;;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