@kubb/core 5.0.0-alpha.9 → 5.0.0-beta.1
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 +23 -20
- package/dist/PluginDriver-BXibeQk-.cjs +1036 -0
- package/dist/PluginDriver-BXibeQk-.cjs.map +1 -0
- package/dist/PluginDriver-DV3p2Hky.js +945 -0
- package/dist/PluginDriver-DV3p2Hky.js.map +1 -0
- package/dist/index.cjs +729 -1641
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +271 -225
- package/dist/index.js +713 -1609
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +145 -0
- package/dist/mocks.cjs.map +1 -0
- package/dist/mocks.d.ts +80 -0
- package/dist/mocks.js +140 -0
- package/dist/mocks.js.map +1 -0
- package/dist/types-CuNocrbJ.d.ts +2148 -0
- package/package.json +51 -57
- package/src/FileManager.ts +115 -0
- package/src/FileProcessor.ts +86 -0
- package/src/Kubb.ts +207 -131
- package/src/PluginDriver.ts +325 -564
- package/src/constants.ts +20 -47
- package/src/createAdapter.ts +13 -6
- package/src/createKubb.ts +548 -0
- package/src/createRenderer.ts +57 -0
- package/src/createStorage.ts +13 -1
- package/src/defineGenerator.ts +77 -124
- package/src/defineLogger.ts +4 -2
- package/src/defineMiddleware.ts +62 -0
- package/src/defineParser.ts +44 -0
- package/src/definePlugin.ts +83 -0
- package/src/defineResolver.ts +418 -28
- package/src/devtools.ts +14 -14
- package/src/index.ts +13 -15
- package/src/mocks.ts +178 -0
- package/src/renderNode.ts +35 -0
- package/src/storages/fsStorage.ts +41 -11
- package/src/storages/memoryStorage.ts +4 -2
- package/src/types.ts +1031 -283
- package/src/utils/diagnostics.ts +4 -1
- package/src/utils/isInputPath.ts +10 -0
- package/src/utils/packageJSON.ts +50 -12
- package/dist/PluginDriver-BkFepPdm.d.ts +0 -1054
- package/dist/chunk-ByKO4r7w.cjs +0 -38
- package/dist/hooks.cjs +0 -103
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.d.ts +0 -77
- package/dist/hooks.js +0 -98
- package/dist/hooks.js.map +0 -1
- package/src/build.ts +0 -418
- package/src/config.ts +0 -56
- package/src/createPlugin.ts +0 -28
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useKubb.ts +0 -143
- package/src/hooks/useMode.ts +0 -11
- package/src/hooks/usePlugin.ts +0 -11
- package/src/hooks/usePluginDriver.ts +0 -11
- package/src/utils/FunctionParams.ts +0 -155
- package/src/utils/TreeNode.ts +0 -215
- package/src/utils/executeStrategies.ts +0 -81
- package/src/utils/formatters.ts +0 -56
- package/src/utils/getBarrelFiles.ts +0 -141
- package/src/utils/getConfigs.ts +0 -12
- package/src/utils/linters.ts +0 -25
package/README.md
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<a href="https://kubb.dev
|
|
2
|
+
<a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
|
|
3
3
|
<img width="180" src="https://raw.githubusercontent.com/kubb-labs/kubb/main/assets/logo.png" alt="Kubb logo">
|
|
4
4
|
</a>
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
[![npm version][npm-version-src]][npm-version-href]
|
|
8
7
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
9
8
|
[![Coverage][coverage-src]][coverage-href]
|
|
10
9
|
[![License][license-src]][license-href]
|
|
11
10
|
[![Sponsors][sponsors-src]][sponsors-href]
|
|
11
|
+
|
|
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
|
+
|
|
12
16
|
<h4>
|
|
13
|
-
<a href="https://
|
|
14
|
-
<span> · </span>
|
|
15
|
-
<a href="https://kubb.dev/kubb" target="_blank">Documentation</a>
|
|
17
|
+
<a href="https://kubb.dev" target="_blank">Documentation</a>
|
|
16
18
|
<span> · </span>
|
|
17
19
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
18
20
|
<span> · </span>
|
|
@@ -22,6 +24,14 @@
|
|
|
22
24
|
|
|
23
25
|
<br />
|
|
24
26
|
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @kubb/core
|
|
31
|
+
# or
|
|
32
|
+
pnpm add @kubb/core
|
|
33
|
+
```
|
|
34
|
+
|
|
25
35
|
## Quick Start
|
|
26
36
|
|
|
27
37
|
Get started with Kubb in seconds:
|
|
@@ -31,6 +41,7 @@ npx kubb init
|
|
|
31
41
|
```
|
|
32
42
|
|
|
33
43
|
The interactive setup will:
|
|
44
|
+
|
|
34
45
|
- Create a `package.json` (if needed)
|
|
35
46
|
- Guide you through plugin selection
|
|
36
47
|
- Install packages automatically
|
|
@@ -45,14 +56,14 @@ npx kubb generate
|
|
|
45
56
|
See the [documentation](https://kubb.dev) for detailed usage and advanced features.
|
|
46
57
|
|
|
47
58
|
## Features
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
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.
|
|
52
64
|
- Model Context Protocol (MCP) server for AI assistants like [Claude](https://claude.ai), [Cursor](https://cursor.sh), and other MCP-compatible tools.
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
- And so much more ...
|
|
65
|
+
- JSX-based renderer (`@kubb/renderer-jsx`) for building custom plugin output.
|
|
66
|
+
- Barrel file generation via the `@kubb/middleware-barrel` middleware.
|
|
56
67
|
|
|
57
68
|
## Supporting Kubb
|
|
58
69
|
|
|
@@ -149,13 +160,6 @@ Kubb is an open source project with its ongoing development made possible entire
|
|
|
149
160
|
<!-- markdownlint-restore -->
|
|
150
161
|
<!-- prettier-ignore-end -->
|
|
151
162
|
|
|
152
|
-
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
153
|
-
<!-- prettier-ignore-start -->
|
|
154
|
-
<!-- markdownlint-disable -->
|
|
155
|
-
|
|
156
|
-
<!-- markdownlint-restore -->
|
|
157
|
-
<!-- prettier-ignore-end -->
|
|
158
|
-
|
|
159
163
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
160
164
|
|
|
161
165
|
## License
|
|
@@ -178,7 +182,6 @@ See [LICENSE](./LICENSE) for details.
|
|
|
178
182
|
</picture>
|
|
179
183
|
</a>
|
|
180
184
|
|
|
181
|
-
|
|
182
185
|
<!-- Badges -->
|
|
183
186
|
|
|
184
187
|
[npm-version-src]: https://img.shields.io/npm/v/@kubb/core?flat&colorA=18181B&colorB=f58517
|