@kubb/core 5.0.0-beta.2 → 5.0.0-beta.20

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 (42) hide show
  1. package/README.md +8 -38
  2. package/dist/{PluginDriver-BXibeQk-.cjs → KubbDriver-BXSnJ3qM.cjs} +719 -164
  3. package/dist/KubbDriver-BXSnJ3qM.cjs.map +1 -0
  4. package/dist/{PluginDriver-DV3p2Hky.js → KubbDriver-Cxii_rBp.js} +693 -162
  5. package/dist/KubbDriver-Cxii_rBp.js.map +1 -0
  6. package/dist/{types-CC09VtBt.d.ts → createKubb-Dcmtjqds.d.ts} +1395 -1238
  7. package/dist/index.cjs +556 -785
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.ts +2 -185
  10. package/dist/index.js +551 -783
  11. package/dist/index.js.map +1 -1
  12. package/dist/mocks.cjs +30 -21
  13. package/dist/mocks.cjs.map +1 -1
  14. package/dist/mocks.d.ts +5 -5
  15. package/dist/mocks.js +29 -20
  16. package/dist/mocks.js.map +1 -1
  17. package/package.json +6 -18
  18. package/src/FileManager.ts +12 -0
  19. package/src/FileProcessor.ts +37 -38
  20. package/src/{PluginDriver.ts → KubbDriver.ts} +249 -86
  21. package/src/constants.ts +11 -6
  22. package/src/createAdapter.ts +84 -1
  23. package/src/createKubb.ts +1336 -297
  24. package/src/createRenderer.ts +23 -22
  25. package/src/defineGenerator.ts +96 -7
  26. package/src/defineLogger.ts +42 -3
  27. package/src/defineMiddleware.ts +1 -1
  28. package/src/defineParser.ts +1 -1
  29. package/src/definePlugin.ts +304 -8
  30. package/src/defineResolver.ts +268 -147
  31. package/src/devtools.ts +8 -1
  32. package/src/index.ts +2 -2
  33. package/src/mocks.ts +11 -14
  34. package/src/storages/fsStorage.ts +13 -37
  35. package/src/types.ts +38 -1292
  36. package/dist/PluginDriver-BXibeQk-.cjs.map +0 -1
  37. package/dist/PluginDriver-DV3p2Hky.js.map +0 -1
  38. package/src/Kubb.ts +0 -300
  39. package/src/renderNode.ts +0 -35
  40. package/src/utils/diagnostics.ts +0 -18
  41. package/src/utils/isInputPath.ts +0 -10
  42. package/src/utils/packageJSON.ts +0 -99
package/README.md CHANGED
@@ -1,4 +1,5 @@
1
1
  <div align="center">
2
+ <h1>@kubb/core</h1>
2
3
  <a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
3
4
  <img width="180" src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo">
4
5
  </a>
@@ -9,10 +10,6 @@
9
10
  [![License][license-src]][license-href]
10
11
  [![Sponsors][sponsors-src]][sponsors-href]
11
12
 
12
- ### The meta framework for code generation
13
-
14
- **Stop writing glue code. Define your API once and Kubb generates types, clients, hooks, validators, mocks and more.**
15
-
16
13
  <h4>
17
14
  <a href="https://kubb.dev" target="_blank">Documentation</a>
18
15
  <span> · </span>
@@ -24,47 +21,20 @@
24
21
 
25
22
  <br />
26
23
 
24
+ Core engine for Kubb's plugin-based code generation system. Provides the plugin driver, file manager, `defineConfig`, `definePlugin`, `defineMiddleware`, and the build orchestration layer used by every Kubb plugin.
25
+
26
+ > **Note:** Most users should install the [`kubb`](https://npmjs.com/package/kubb) meta-package instead of `@kubb/core` directly. Install `@kubb/core` only when building custom plugins or extending the Kubb internals.
27
+
27
28
  ## Installation
28
29
 
29
30
  ```bash
30
- npm install @kubb/core
31
+ bun add @kubb/core
31
32
  # or
32
33
  pnpm add @kubb/core
34
+ # or
35
+ npm install @kubb/core
33
36
  ```
34
37
 
35
- ## Quick Start
36
-
37
- Get started with Kubb in seconds:
38
-
39
- ```bash
40
- npx kubb init
41
- ```
42
-
43
- The interactive setup will:
44
-
45
- - Create a `package.json` (if needed)
46
- - Guide you through plugin selection
47
- - Install packages automatically
48
- - Generate `kubb.config.ts`
49
-
50
- Then generate your code:
51
-
52
- ```bash
53
- npx kubb generate
54
- ```
55
-
56
- See the [documentation](https://kubb.dev) for detailed usage and advanced features.
57
-
58
- ## Features
59
-
60
- - Works with Node.js 22+ and TypeScript 6.
61
- - Convert Swagger 2.0, OpenAPI 3.0, and OpenAPI 3.1 to TypeScript types, API clients, and more via the [plugin ecosystem](https://github.com/kubb-labs/kubb-plugins).
62
- - Extensible plugin and middleware system for customizing and composing code generation.
63
- - CLI support with interactive setup, progress bar, and detailed logs.
64
- - Model Context Protocol (MCP) server for AI assistants like [Claude](https://claude.ai), [Cursor](https://cursor.sh), and other MCP-compatible tools.
65
- - JSX-based renderer (`@kubb/renderer-jsx`) for building custom plugin output.
66
- - Barrel file generation via the `@kubb/middleware-barrel` middleware.
67
-
68
38
  ## Supporting Kubb
69
39
 
70
40
  Kubb is an 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: