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
package/LICENSE CHANGED
@@ -1,14 +1,21 @@
1
- Copyright (c) 2026 Stijn Van Hulle
2
-
3
- This repository contains software under two licenses:
1
+ MIT License
4
2
 
5
- 1. Most of the code in this repository is licensed under the
6
- MIT License — see licenses/LICENSE-MIT for the full license text.
3
+ Copyright (c) 2026 Stijn Van Hulle
7
4
 
8
- 2. The following components are licensed under the
9
- GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later)
10
- see licenses/LICENSE-AGPL-3.0 for the full license text:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
11
 
12
- - packages/agent (published as @kubb/agent)
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
13
14
 
14
- Each package's own LICENSE file or package.json specifies its applicable license.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,19 +1,16 @@
1
1
  <div align="center">
2
- <h1>Kubb Unplugin</h1>
3
2
  <a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
4
- <img width="180" src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo">
3
+ <img src="https://kubb.dev/og.png" alt="Kubb banner">
5
4
  </a>
6
5
 
7
6
  [![npm version][npm-version-src]][npm-version-href]
8
7
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
9
- [![Coverage][coverage-src]][coverage-href]
8
+ [![Stars][stars-src]][stars-href]
10
9
  [![License][license-src]][license-href]
11
- [![Sponsors][sponsors-src]][sponsors-href]
10
+ [![Node][node-src]][node-href]
12
11
 
13
12
  <h4>
14
- <a href="https://codesandbox.io/s/github/kubb-labs/kubb/tree/main//examples/typescript" target="_blank">View Demo</a>
15
- <span> · </span>
16
- <a href="https://kubb.dev/" target="_blank">Documentation</a>
13
+ <a href="https://kubb.dev" target="_blank">Documentation</a>
17
14
  <span> · </span>
18
15
  <a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
19
16
  <span> · </span>
@@ -21,7 +18,13 @@
21
18
  </h4>
22
19
  </div>
23
20
 
24
- Universal build integration for Kubb using [unplugin](https://github.com/unjs/unplugin). Runs OpenAPI code generation as part of your build pipeline in Vite, Webpack, Rollup, esbuild, Rspack, Nuxt, and Astro.
21
+ <br />
22
+
23
+ # unplugin-kubb
24
+
25
+ ### Universal build integration for Kubb
26
+
27
+ Integration of Kubb for Vite, Webpack, Rollup, esbuild, Rspack, Nuxt, and Astro powered by [unplugin](https://github.com/unjs/unplugin).
25
28
 
26
29
  ## Installation
27
30
 
@@ -104,9 +107,10 @@ type Options = {
104
107
 
105
108
  ## Supporting Kubb
106
109
 
107
- Kubb is an MIT-licensed open source project with its ongoing development made possible entirely by the support of Sponsors. If you would like to become a sponsor, please consider:
110
+ Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
108
111
 
109
112
  - [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
113
+ - [See sponsorship tiers and our sponsors](https://kubb.dev/sponsors)
110
114
 
111
115
  <p align="center">
112
116
  <a href="https://github.com/sponsors/stijnvanhulle">
@@ -114,19 +118,19 @@ Kubb is an MIT-licensed open source project with its ongoing development made po
114
118
  </a>
115
119
  </p>
116
120
 
121
+ ## License
122
+
123
+ [MIT](https://github.com/kubb-labs/kubb/blob/main/licenses/LICENSE-MIT)
124
+
117
125
  <!-- Badges -->
118
126
 
119
- [npm-version-src]: https://img.shields.io/npm/v/unplugin-kubb?flat&colorA=18181B&colorB=f58517
120
- [npm-version-href]: https://npmjs.com/package/unplugin-kubb
121
- [npm-downloads-src]: https://img.shields.io/npm/dm/unplugin-kubb?flat&colorA=18181B&colorB=f58517
122
- [npm-downloads-href]: https://npmjs.com/package/unplugin-kubb
123
- [license-src]: https://img.shields.io/github/license/kubb-labs/kubb.svg?flat&colorA=18181B&colorB=f58517
127
+ [npm-version-src]: https://shieldcn.dev/npm/v/unplugin-kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
128
+ [npm-version-href]: https://npmx.dev/package/unplugin-kubb
129
+ [npm-downloads-src]: https://shieldcn.dev/npm/dm/unplugin-kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
130
+ [npm-downloads-href]: https://npmx.dev/package/unplugin-kubb
131
+ [stars-src]: https://shieldcn.dev/github/stars/kubb-labs/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
132
+ [stars-href]: https://github.com/kubb-labs/kubb
133
+ [license-src]: https://shieldcn.dev/npm/license/unplugin-kubb.svg?variant=secondary&size=xs&theme=zinc
124
134
  [license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
125
- [build-src]: https://img.shields.io/github/actions/workflow/status/kubb-labs/kubb/ci.yaml?style=flat&colorA=18181B&colorB=f58517
126
- [build-href]: https://www.npmjs.com/package/unplugin-kubb
127
- [minified-src]: https://img.shields.io/bundlephobia/min/unplugin-kubb?style=flat&colorA=18181B&colorB=f58517
128
- [minified-href]: https://www.npmjs.com/package/unplugin-kubb
129
- [coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
130
- [coverage-href]: https://www.npmjs.com/package/unplugin-kubb
131
- [sponsors-src]: https://img.shields.io/github/sponsors/stijnvanhulle?style=flat&colorA=18181B&colorB=f58517
132
- [sponsors-href]: https://github.com/sponsors/stijnvanhulle/
135
+ [node-src]: https://shieldcn.dev/npm/node/unplugin-kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
136
+ [node-href]: https://npmx.dev/package/unplugin-kubb
package/dist/astro.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_unpluginFactory = require("./unpluginFactory-Amggr1Ea.cjs");
1
+ const require_unpluginFactory = require("./unpluginFactory-65RF6Gbg.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) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"astro.cjs","names":["vitePlugin"],"sources":["../src/astro.ts"],"sourcesContent":["import type { Options } from './types.ts'\nimport vitePlugin from './vite.ts'\n\nexport default (options: Options): any => ({\n name: 'unplugin-kubb',\n hooks: {\n 'astro:config:setup': async (astro: any) => {\n astro.config.vite.plugins ||= []\n astro.config.vite.plugins.push(vitePlugin(options))\n },\n },\n})\n"],"mappings":";;;AAGA,IAAA,gBAAA,wCAAA,QAAgB,aAA2B;CACzC,MAAM;CACN,OAAO,EACL,sBAAsB,OAAO,UAAe;EAC1C,MAAM,OAAO,KAAK,YAAY,EAAE;EAChC,MAAM,OAAO,KAAK,QAAQ,KAAKA,aAAW,QAAQ,CAAC;IAEtD;CACF,GAAA,UAAA"}
1
+ {"version":3,"file":"astro.cjs","names":["vitePlugin"],"sources":["../src/astro.ts"],"sourcesContent":["import type { Options } from './types.ts'\nimport vitePlugin from './vite.ts'\n\nexport default (options: Options): any => ({\n name: 'unplugin-kubb',\n hooks: {\n 'astro:config:setup': async (astro: any) => {\n astro.config.vite.plugins ||= []\n astro.config.vite.plugins.push(vitePlugin(options))\n },\n },\n})\n"],"mappings":";;;AAGA,IAAA,gBAAA,wCAAA,QAAgB,aAA2B;CACzC,MAAM;CACN,OAAO,EACL,sBAAsB,OAAO,UAAe;EAC1C,MAAM,OAAO,KAAK,YAAY,CAAC;EAC/B,MAAM,OAAO,KAAK,QAAQ,KAAKA,aAAW,OAAO,CAAC;CACpD,EACF;AACF,IAAA,SAAA"}
package/dist/astro.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
 
4
4
  //#region src/astro.d.ts
package/dist/astro.js 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 vite_default from "./vite.js";
3
3
  //#region src/astro.ts
4
4
  var astro_default = /* @__PURE__ */ __name((options) => ({
package/dist/astro.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"astro.js","names":["vitePlugin"],"sources":["../src/astro.ts"],"sourcesContent":["import type { Options } from './types.ts'\nimport vitePlugin from './vite.ts'\n\nexport default (options: Options): any => ({\n name: 'unplugin-kubb',\n hooks: {\n 'astro:config:setup': async (astro: any) => {\n astro.config.vite.plugins ||= []\n astro.config.vite.plugins.push(vitePlugin(options))\n },\n },\n})\n"],"mappings":";;;AAGA,IAAA,gBAAA,wBAAgB,aAA2B;CACzC,MAAM;CACN,OAAO,EACL,sBAAsB,OAAO,UAAe;EAC1C,MAAM,OAAO,KAAK,YAAY,EAAE;EAChC,MAAM,OAAO,KAAK,QAAQ,KAAKA,aAAW,QAAQ,CAAC;IAEtD;CACF,GAAA,UAAA"}
1
+ {"version":3,"file":"astro.js","names":["vitePlugin"],"sources":["../src/astro.ts"],"sourcesContent":["import type { Options } from './types.ts'\nimport vitePlugin from './vite.ts'\n\nexport default (options: Options): any => ({\n name: 'unplugin-kubb',\n hooks: {\n 'astro:config:setup': async (astro: any) => {\n astro.config.vite.plugins ||= []\n astro.config.vite.plugins.push(vitePlugin(options))\n },\n },\n})\n"],"mappings":";;;AAGA,IAAA,gBAAA,wBAAgB,aAA2B;CACzC,MAAM;CACN,OAAO,EACL,sBAAsB,OAAO,UAAe;EAC1C,MAAM,OAAO,KAAK,YAAY,CAAC;EAC/B,MAAM,OAAO,KAAK,QAAQ,KAAKA,aAAW,OAAO,CAAC;CACpD,EACF;AACF,IAAA,SAAA"}
package/dist/esbuild.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/esbuild.ts
3
3
  var esbuild_default = (0, require("unplugin").createEsbuildPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild.cjs","names":["unpluginFactory"],"sources":["../src/esbuild.ts"],"sourcesContent":["import { createEsbuildPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createEsbuildPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,mBAAA,sBAAA,CAAA,qBAAmCA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"esbuild.cjs","names":["unpluginFactory"],"sources":["../src/esbuild.ts"],"sourcesContent":["import { createEsbuildPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createEsbuildPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,mBAAA,qBAAA,CAAA,CAAA,oBAAA,CAAmCA,wBAAAA,eAAe"}
package/dist/esbuild.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 _$esbuild from "esbuild";
4
3
 
5
4
  //#region src/esbuild.d.ts
6
- declare const _default: (options?: Options | undefined) => _$esbuild.Plugin;
5
+ declare const _default: (options?: Options | undefined) => import("esbuild").Plugin;
7
6
  //#endregion
8
7
  export { _default as default };
9
8
  //# sourceMappingURL=esbuild.d.ts.map
package/dist/esbuild.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 { createEsbuildPlugin } from "unplugin";
3
3
  //#region src/esbuild.ts
4
4
  var esbuild_default = createEsbuildPlugin(unpluginFactory);
@@ -1 +1 @@
1
- {"version":3,"file":"esbuild.js","names":[],"sources":["../src/esbuild.ts"],"sourcesContent":["import { createEsbuildPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createEsbuildPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,kBAAe,oBAAoB,gBAAgB"}
1
+ {"version":3,"file":"esbuild.js","names":[],"sources":["../src/esbuild.ts"],"sourcesContent":["import { createEsbuildPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createEsbuildPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,kBAAe,oBAAoB,eAAe"}
package/dist/farm.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/farm.ts
3
3
  var farm_default = (0, require("unplugin").createFarmPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
package/dist/farm.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"farm.cjs","names":["unpluginFactory"],"sources":["../src/farm.ts"],"sourcesContent":["import { createFarmPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createFarmPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,gBAAA,sBAAA,CAAA,kBAAgCA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"farm.cjs","names":["unpluginFactory"],"sources":["../src/farm.ts"],"sourcesContent":["import { createFarmPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createFarmPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,gBAAA,qBAAA,CAAA,CAAA,iBAAA,CAAgCA,wBAAAA,eAAe"}
package/dist/farm.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 _$_farmfe_core0 from "@farmfe/core";
4
3
 
5
4
  //#region src/farm.d.ts
6
- declare const _default: (options?: Options | undefined) => _$_farmfe_core0.JsPlugin;
5
+ declare const _default: (options?: Options | undefined) => import("@farmfe/core").JsPlugin;
7
6
  //#endregion
8
7
  export { _default as default };
9
8
  //# sourceMappingURL=farm.d.ts.map
package/dist/farm.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 { createFarmPlugin } from "unplugin";
3
3
  //#region src/farm.ts
4
4
  var farm_default = createFarmPlugin(unpluginFactory);
package/dist/farm.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"farm.js","names":[],"sources":["../src/farm.ts"],"sourcesContent":["import { createFarmPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createFarmPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,eAAe,iBAAiB,gBAAgB"}
1
+ {"version":3,"file":"farm.js","names":[],"sources":["../src/farm.ts"],"sourcesContent":["import { createFarmPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createFarmPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,eAAe,iBAAiB,eAAe"}
package/dist/index.cjs CHANGED
@@ -2,9 +2,9 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_unpluginFactory = require("./unpluginFactory-Amggr1Ea.cjs");
5
+ const require_unpluginFactory = require("./unpluginFactory-65RF6Gbg.cjs");
6
6
  //#region src/index.ts
7
- const plugin = /* @__PURE__ */ (0, require("unplugin").createUnplugin)(require_unpluginFactory.unpluginFactory);
7
+ const plugin = /* #__PURE__ */ (0, require("unplugin").createUnplugin)(require_unpluginFactory.unpluginFactory);
8
8
  //#endregion
9
9
  exports.default = plugin;
10
10
  exports.unplugin = plugin;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["unpluginFactory"],"sources":["../src/index.ts"],"sourcesContent":["import { createUnplugin } from 'unplugin'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport type { BarrelType } from '@kubb/middleware-barrel'\nexport type { Options } from './types.ts'\nexport { unpluginFactory } from './unpluginFactory.ts'\n\nconst plugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport { plugin as unplugin, plugin as default }\n"],"mappings":";;;;;;AAOA,MAAM,SAAyB,iBAAA,sBAAA,CAAA,gBAAeA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"index.cjs","names":["unpluginFactory"],"sources":["../src/index.ts"],"sourcesContent":["import { createUnplugin } from 'unplugin'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport type { BarrelType } from '@kubb/plugin-barrel'\nexport type { Options } from './types.ts'\nexport { unpluginFactory } from './unpluginFactory.ts'\n\nconst plugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport { plugin as unplugin, plugin as default }\n"],"mappings":";;;;;;AAOA,MAAM,SAAyB,iBAAA,qBAAA,CAAA,CAAA,eAAA,CAAeA,wBAAAA,eAAe"}
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
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 "./unpluginFactory.js";
4
- import * as _$unplugin from "unplugin";
5
- import { BarrelType } from "@kubb/middleware-barrel";
4
+ import { BarrelType } from "@kubb/plugin-barrel";
6
5
 
7
6
  //#region src/index.d.ts
8
- declare const plugin: _$unplugin.UnpluginInstance<Options | undefined, boolean>;
7
+ declare const plugin: import("unplugin").UnpluginInstance<Options | undefined, boolean>;
9
8
  //#endregion
10
9
  export { type BarrelType, type Options, plugin as default, plugin as unplugin, unpluginFactory };
11
10
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { t as unpluginFactory } from "./unpluginFactory-C_rK_c2a.js";
1
+ import { t as unpluginFactory } from "./unpluginFactory-E2XDRtLl.js";
2
2
  import { createUnplugin } from "unplugin";
3
3
  //#region src/index.ts
4
- const plugin = /* @__PURE__ */ createUnplugin(unpluginFactory);
4
+ const plugin = /* #__PURE__ */ createUnplugin(unpluginFactory);
5
5
  //#endregion
6
6
  export { plugin as default, plugin as unplugin, unpluginFactory };
7
7
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createUnplugin } from 'unplugin'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport type { BarrelType } from '@kubb/middleware-barrel'\nexport type { Options } from './types.ts'\nexport { unpluginFactory } from './unpluginFactory.ts'\n\nconst plugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport { plugin as unplugin, plugin as default }\n"],"mappings":";;;AAOA,MAAM,SAAyB,+BAAe,gBAAgB"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { createUnplugin } from 'unplugin'\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport type { BarrelType } from '@kubb/plugin-barrel'\nexport type { Options } from './types.ts'\nexport { unpluginFactory } from './unpluginFactory.ts'\n\nconst plugin = /* #__PURE__ */ createUnplugin(unpluginFactory)\n\nexport { plugin as unplugin, plugin as default }\n"],"mappings":";;;AAOA,MAAM,SAAyB,+BAAe,eAAe"}
package/dist/nuxt.cjs CHANGED
@@ -1,4 +1,4 @@
1
- require("./unpluginFactory-Amggr1Ea.cjs");
1
+ require("./unpluginFactory-65RF6Gbg.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/nuxt.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"nuxt.cjs","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport type { Options } from './types.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport interface ModuleOptions extends Options {}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-kubb',\n configKey: 'unpluginKubb',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n addVitePlugin(() => vite(options))\n addWebpackPlugin(() => webpack(options))\n },\n})\n"],"mappings":";;;;;;AASA,IAAA,gBAAA,GAAA,UAAA,kBAA+C;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;EACZ;CACD,UAAU,KAAA;CACV,MAAM,SAAS,OAAO;EACpB,CAAA,GAAA,UAAA,qBAAoBA,aAAK,QAAQ,CAAC;EAClC,CAAA,GAAA,UAAA,wBAAuBC,gBAAQ,QAAQ,CAAC;;CAE3C,CAAC"}
1
+ {"version":3,"file":"nuxt.cjs","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport type { Options } from './types.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport interface ModuleOptions extends Options {}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-kubb',\n configKey: 'unpluginKubb',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n addVitePlugin(() => vite(options))\n addWebpackPlugin(() => webpack(options))\n },\n})\n"],"mappings":";;;;;;AASA,IAAA,gBAAA,GAAA,UAAA,iBAAA,CAA+C;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;CACb;CACA,UAAU,KAAA;CACV,MAAM,SAAS,OAAO;EACpB,CAAA,GAAA,UAAA,cAAA,OAAoBA,aAAK,OAAO,CAAC;EACjC,CAAA,GAAA,UAAA,iBAAA,OAAuBC,gBAAQ,OAAO,CAAC;CACzC;AACF,CAAC"}
package/dist/nuxt.d.ts CHANGED
@@ -1,10 +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 _$_nuxt_schema0 from "@nuxt/schema";
4
-
5
3
  //#region src/nuxt.d.ts
6
4
  interface ModuleOptions extends Options {}
7
- declare const _default: _$_nuxt_schema0.NuxtModule<ModuleOptions, ModuleOptions, false>;
5
+ declare const _default: import("@nuxt/schema").NuxtModule<ModuleOptions, ModuleOptions, false>;
8
6
  //#endregion
9
7
  export { ModuleOptions, _default as default };
10
8
  //# sourceMappingURL=nuxt.d.ts.map
package/dist/nuxt.js CHANGED
@@ -1,4 +1,4 @@
1
- import "./chunk--u3MIqq1.js";
1
+ import "./rolldown-runtime-C0LytTxp.js";
2
2
  import vite_default from "./vite.js";
3
3
  import webpack_default from "./webpack.js";
4
4
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
package/dist/nuxt.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"nuxt.js","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport type { Options } from './types.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport interface ModuleOptions extends Options {}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-kubb',\n configKey: 'unpluginKubb',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n addVitePlugin(() => vite(options))\n addWebpackPlugin(() => webpack(options))\n },\n})\n"],"mappings":";;;;;;AASA,IAAA,eAAe,iBAAgC;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;EACZ;CACD,UAAU,KAAA;CACV,MAAM,SAAS,OAAO;EACpB,oBAAoBA,aAAK,QAAQ,CAAC;EAClC,uBAAuBC,gBAAQ,QAAQ,CAAC;;CAE3C,CAAC"}
1
+ {"version":3,"file":"nuxt.js","names":["vite","webpack"],"sources":["../src/nuxt.ts"],"sourcesContent":["import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from '@nuxt/kit'\nimport '@nuxt/schema'\n\nimport type { Options } from './types.ts'\nimport vite from './vite.ts'\nimport webpack from './webpack.ts'\n\nexport interface ModuleOptions extends Options {}\n\nexport default defineNuxtModule<ModuleOptions>({\n meta: {\n name: 'nuxt-unplugin-kubb',\n configKey: 'unpluginKubb',\n },\n defaults: undefined,\n setup(options, _nuxt) {\n addVitePlugin(() => vite(options))\n addWebpackPlugin(() => webpack(options))\n },\n})\n"],"mappings":";;;;;;AASA,IAAA,eAAe,iBAAgC;CAC7C,MAAM;EACJ,MAAM;EACN,WAAW;CACb;CACA,UAAU,KAAA;CACV,MAAM,SAAS,OAAO;EACpB,oBAAoBA,aAAK,OAAO,CAAC;EACjC,uBAAuBC,gBAAQ,OAAO,CAAC;CACzC;AACF,CAAC"}
package/dist/rolldown.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/rolldown.ts
3
3
  var rolldown_default = (0, require("unplugin").createRolldownPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"rolldown.cjs","names":["unpluginFactory"],"sources":["../src/rolldown.ts"],"sourcesContent":["import { createRolldownPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRolldownPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,oBAAA,sBAAA,CAAA,sBAAoCA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"rolldown.cjs","names":["unpluginFactory"],"sources":["../src/rolldown.ts"],"sourcesContent":["import { createRolldownPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRolldownPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,oBAAA,qBAAA,CAAA,CAAA,qBAAA,CAAoCA,wBAAAA,eAAe"}
@@ -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 _$rolldown from "rolldown";
4
3
 
5
4
  //#region src/rolldown.d.ts
6
- declare const _default: (options?: Options | undefined) => _$rolldown.Plugin<any> | _$rolldown.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => import("rolldown").Plugin<any> | import("rolldown").Plugin<any>[];
7
6
  //#endregion
8
7
  export { _default as default };
9
8
  //# sourceMappingURL=rolldown.d.ts.map
package/dist/rolldown.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 { createRolldownPlugin } from "unplugin";
3
3
  //#region src/rolldown.ts
4
4
  var rolldown_default = createRolldownPlugin(unpluginFactory);
@@ -1 +1 @@
1
- {"version":3,"file":"rolldown.js","names":[],"sources":["../src/rolldown.ts"],"sourcesContent":["import { createRolldownPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRolldownPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,mBAAe,qBAAqB,gBAAgB"}
1
+ {"version":3,"file":"rolldown.js","names":[],"sources":["../src/rolldown.ts"],"sourcesContent":["import { createRolldownPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRolldownPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,mBAAe,qBAAqB,eAAe"}
package/dist/rollup.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/rollup.ts
3
3
  var rollup_default = (0, require("unplugin").createRollupPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.cjs","names":["unpluginFactory"],"sources":["../src/rollup.ts"],"sourcesContent":["import { createRollupPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRollupPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,kBAAA,sBAAA,CAAA,oBAAkCA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"rollup.cjs","names":["unpluginFactory"],"sources":["../src/rollup.ts"],"sourcesContent":["import { createRollupPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRollupPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,kBAAA,qBAAA,CAAA,CAAA,mBAAA,CAAkCA,wBAAAA,eAAe"}
package/dist/rollup.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 _$rollup from "rollup";
4
3
 
5
4
  //#region src/rollup.d.ts
6
- declare const _default: (options?: Options | undefined) => _$rollup.Plugin<any> | _$rollup.Plugin<any>[];
5
+ declare const _default: (options?: Options | undefined) => import("rollup").Plugin<any> | import("rollup").Plugin<any>[];
7
6
  //#endregion
8
7
  export { _default as default };
9
8
  //# sourceMappingURL=rollup.d.ts.map
package/dist/rollup.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 { createRollupPlugin } from "unplugin";
3
3
  //#region src/rollup.ts
4
4
  var rollup_default = createRollupPlugin(unpluginFactory);
@@ -1 +1 @@
1
- {"version":3,"file":"rollup.js","names":[],"sources":["../src/rollup.ts"],"sourcesContent":["import { createRollupPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRollupPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,iBAAe,mBAAmB,gBAAgB"}
1
+ {"version":3,"file":"rollup.js","names":[],"sources":["../src/rollup.ts"],"sourcesContent":["import { createRollupPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRollupPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,iBAAe,mBAAmB,eAAe"}
package/dist/rspack.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/rspack.ts
3
3
  var rspack_default = (0, require("unplugin").createRspackPlugin)(require_unpluginFactory.unpluginFactory);
4
4
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"rspack.cjs","names":["unpluginFactory"],"sources":["../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRspackPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,kBAAA,sBAAA,CAAA,oBAAkCA,wBAAAA,gBAAgB"}
1
+ {"version":3,"file":"rspack.cjs","names":["unpluginFactory"],"sources":["../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRspackPlugin(unpluginFactory)\n"],"mappings":";;AAIA,IAAA,kBAAA,qBAAA,CAAA,CAAA,mBAAA,CAAkCA,wBAAAA,eAAe"}
package/dist/rspack.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
 
4
4
  //#region src/rspack.d.ts
package/dist/rspack.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 { createRspackPlugin } from "unplugin";
3
3
  //#region src/rspack.ts
4
4
  var rspack_default = createRspackPlugin(unpluginFactory);
@@ -1 +1 @@
1
- {"version":3,"file":"rspack.js","names":[],"sources":["../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRspackPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,iBAAe,mBAAmB,gBAAgB"}
1
+ {"version":3,"file":"rspack.js","names":[],"sources":["../src/rspack.ts"],"sourcesContent":["import { createRspackPlugin } from 'unplugin'\n\nimport { unpluginFactory } from './unpluginFactory.ts'\n\nexport default createRspackPlugin(unpluginFactory)\n"],"mappings":";;;AAIA,IAAA,iBAAe,mBAAmB,eAAe"}
package/dist/types.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 { UserConfig } from "@kubb/core";
3
3
 
4
4
  //#region src/types.d.ts
@@ -0,0 +1,157 @@
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 _kubb_adapter_oas = require("@kubb/adapter-oas");
30
+ let _kubb_core = require("@kubb/core");
31
+ let _kubb_plugin_barrel = require("@kubb/plugin-barrel");
32
+ let _kubb_parser_ts = require("@kubb/parser-ts");
33
+ //#region package.json
34
+ var version = "5.0.0-beta.91";
35
+ //#endregion
36
+ //#region src/unpluginFactory.ts
37
+ /**
38
+ * Builds the Kubb unplugin for any unplugin-supported bundler (Vite, Rollup, Webpack, esbuild).
39
+ *
40
+ * Registers hook handlers that log lifecycle, diagnostics, and a per-plugin summary, then runs
41
+ * the Kubb build during `buildStart`. When the config omits them, it fills in defaults: the OAS
42
+ * adapter, the TS and TSX parsers, and a barrel plugin. Under Vite it only applies during `build`.
43
+ */
44
+ const unpluginFactory = (options, meta) => {
45
+ const name = "unplugin-kubb";
46
+ const hooks = new _kubb_core.Hookable();
47
+ const isVite = meta.framework === "vite";
48
+ hooks.hook("kubb:lifecycle:start", ({ version }) => {
49
+ console.log(`Kubb Unplugin ${version} 🧩`);
50
+ });
51
+ hooks.hook("kubb:error", ({ error }) => {
52
+ console.error(`✗ ${error?.message || "failed"}`);
53
+ });
54
+ hooks.hook("kubb:warn", ({ message }) => {
55
+ console.warn(`⚠ ${message}`);
56
+ });
57
+ hooks.hook("kubb:info", ({ message }) => {
58
+ console.info(`ℹ ${message}`);
59
+ });
60
+ hooks.hook("kubb:success", ({ message }) => {
61
+ console.log(`✓ ${message}`);
62
+ });
63
+ hooks.hook("kubb:plugin:end", ({ plugin, duration }) => {
64
+ const durationStr = duration >= 1e3 ? `${(duration / 1e3).toFixed(2)}s` : `${duration}ms`;
65
+ console.log(`✓ ${plugin.name} completed in ${durationStr}`);
66
+ });
67
+ hooks.hook("kubb:files:processing:end", () => {
68
+ console.log("✓ Files written successfully");
69
+ });
70
+ hooks.hook("kubb:generation:end", ({ config, status, diagnostics }) => {
71
+ console.log(config.name ? `✓ Generation completed for ${config.name}` : "✓ Generation completed");
72
+ if (!diagnostics || !status) return;
73
+ const failedCount = _kubb_core.Diagnostics.failedPlugins(diagnostics).length;
74
+ const pluginsCount = config.plugins.length;
75
+ const successCount = pluginsCount - failedCount;
76
+ console.log(status === "success" ? `Kubb Summary: ✓ ${`${successCount} successful`}, ${pluginsCount} total` : `Kubb Summary: ✓ ${`${successCount} successful`}, ✗ ${`${failedCount} failed`}, ${pluginsCount} total`);
77
+ });
78
+ async function runBuild(ctx) {
79
+ if (!options?.config) {
80
+ (ctx.error ?? console.error)(`[${name}] Config is not set`);
81
+ return;
82
+ }
83
+ const { adapter, output, plugins } = (0, _kubb_core.applyConfigDefaults)(options.config, {
84
+ defaultAdapter: (0, _kubb_adapter_oas.adapterOas)(),
85
+ barrelPlugin: (0, _kubb_plugin_barrel.pluginBarrel)(),
86
+ barrelPluginName: _kubb_plugin_barrel.pluginBarrelName,
87
+ defaultOutput: {
88
+ barrel: { type: "named" },
89
+ format: false,
90
+ lint: false
91
+ }
92
+ });
93
+ const config = {
94
+ ...options.config,
95
+ adapter,
96
+ parsers: options.config.parsers?.length ? options.config.parsers : [(0, _kubb_parser_ts.parserTs)(), (0, _kubb_parser_ts.parserTsx)()],
97
+ plugins,
98
+ output
99
+ };
100
+ const hrStart = node_process.default.hrtime();
101
+ await hooks.callHook("kubb:lifecycle:start", { version });
102
+ const kubb = (0, _kubb_core.createKubb)(config, { hooks });
103
+ await kubb.setup();
104
+ await hooks.callHook("kubb:generation:start", { config: kubb.config });
105
+ const { diagnostics, files, storage } = await kubb.safeBuild();
106
+ const hasFailures = _kubb_core.Diagnostics.hasError(diagnostics);
107
+ for (const diagnostic of diagnostics) {
108
+ if (!_kubb_core.Diagnostics.isProblem(diagnostic)) continue;
109
+ if (diagnostic.severity === "error") hooks.callHook("kubb:error", { error: diagnostic.cause ?? new Error(diagnostic.message) });
110
+ else if (diagnostic.severity === "warning") hooks.callHook("kubb:warn", { message: diagnostic.message });
111
+ else hooks.callHook("kubb:info", { message: diagnostic.message });
112
+ }
113
+ await hooks.callHook("kubb:generation:end", {
114
+ config: kubb.config,
115
+ storage,
116
+ diagnostics,
117
+ filesCreated: files.length,
118
+ status: hasFailures ? "failed" : "success",
119
+ hrStart
120
+ });
121
+ await hooks.callHook("kubb:lifecycle:end");
122
+ if (hasFailures) {
123
+ const failedCount = _kubb_core.Diagnostics.failedPlugins(diagnostics).length;
124
+ const firstError = diagnostics.filter(_kubb_core.Diagnostics.isProblem).find((diagnostic) => diagnostic.severity === "error");
125
+ const message = failedCount > 0 ? `Build Error with ${failedCount} failed plugins` : firstError?.message ?? "Build failed";
126
+ if (ctx.error) {
127
+ ctx.error(`[${name}] ${message}`);
128
+ return;
129
+ }
130
+ throw new Error(`[${name}] ${message}`, { cause: firstError?.cause });
131
+ }
132
+ }
133
+ return {
134
+ name,
135
+ enforce: "pre",
136
+ apply: isVite ? "build" : void 0,
137
+ async buildStart() {
138
+ await runBuild(this);
139
+ },
140
+ vite: {}
141
+ };
142
+ };
143
+ //#endregion
144
+ Object.defineProperty(exports, "__name", {
145
+ enumerable: true,
146
+ get: function() {
147
+ return __name;
148
+ }
149
+ });
150
+ Object.defineProperty(exports, "unpluginFactory", {
151
+ enumerable: true,
152
+ get: function() {
153
+ return unpluginFactory;
154
+ }
155
+ });
156
+
157
+ //# sourceMappingURL=unpluginFactory-65RF6Gbg.cjs.map