@kubb/core 5.0.0-beta.2 → 5.0.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -38
- package/dist/KubbDriver-BBRa5CH2.cjs +2231 -0
- package/dist/KubbDriver-BBRa5CH2.cjs.map +1 -0
- package/dist/KubbDriver-Cq1isv2P.js +2110 -0
- package/dist/KubbDriver-Cq1isv2P.js.map +1 -0
- package/dist/{types-CC09VtBt.d.ts → createKubb-CYrw_xaR.d.ts} +1414 -1255
- package/dist/index.cjs +221 -1074
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -185
- package/dist/index.js +211 -1068
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +30 -21
- package/dist/mocks.cjs.map +1 -1
- package/dist/mocks.d.ts +5 -5
- package/dist/mocks.js +29 -20
- package/dist/mocks.js.map +1 -1
- package/package.json +6 -18
- package/src/FileManager.ts +75 -58
- package/src/FileProcessor.ts +48 -38
- package/src/KubbDriver.ts +915 -0
- package/src/constants.ts +11 -6
- package/src/createAdapter.ts +84 -1
- package/src/createKubb.ts +1022 -485
- package/src/createRenderer.ts +33 -22
- package/src/defineGenerator.ts +96 -7
- package/src/defineLogger.ts +42 -3
- package/src/defineMiddleware.ts +1 -1
- package/src/defineParser.ts +1 -1
- package/src/definePlugin.ts +304 -8
- package/src/defineResolver.ts +271 -150
- package/src/devtools.ts +8 -1
- package/src/index.ts +2 -2
- package/src/mocks.ts +11 -14
- package/src/storages/fsStorage.ts +13 -37
- package/src/types.ts +39 -1292
- package/dist/PluginDriver-BXibeQk-.cjs +0 -1036
- package/dist/PluginDriver-BXibeQk-.cjs.map +0 -1
- package/dist/PluginDriver-DV3p2Hky.js +0 -945
- package/dist/PluginDriver-DV3p2Hky.js.map +0 -1
- package/src/Kubb.ts +0 -300
- package/src/PluginDriver.ts +0 -424
- package/src/renderNode.ts +0 -35
- package/src/utils/diagnostics.ts +0 -18
- package/src/utils/isInputPath.ts +0 -10
- 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
|
-
|
|
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:
|