@kubb/core 5.0.0-alpha.9 → 5.0.0-beta.10
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 +13 -40
- package/dist/PluginDriver-Cu1Kj9S-.cjs +1075 -0
- package/dist/PluginDriver-Cu1Kj9S-.cjs.map +1 -0
- package/dist/PluginDriver-D8Z0Htid.js +978 -0
- package/dist/PluginDriver-D8Z0Htid.js.map +1 -0
- package/dist/createKubb-ALdb8lmq.d.ts +2082 -0
- package/dist/index.cjs +747 -1667
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +175 -269
- package/dist/index.js +734 -1638
- 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/package.json +47 -60
- package/src/FileManager.ts +115 -0
- package/src/FileProcessor.ts +86 -0
- package/src/PluginDriver.ts +355 -561
- package/src/constants.ts +21 -48
- package/src/createAdapter.ts +88 -5
- package/src/createKubb.ts +1266 -0
- package/src/createRenderer.ts +57 -0
- package/src/createStorage.ts +13 -1
- package/src/defineGenerator.ts +160 -119
- package/src/defineLogger.ts +46 -5
- package/src/defineMiddleware.ts +62 -0
- package/src/defineParser.ts +44 -0
- package/src/definePlugin.ts +379 -0
- package/src/defineResolver.ts +548 -25
- package/src/devtools.ts +22 -15
- package/src/index.ts +13 -15
- package/src/mocks.ts +177 -0
- package/src/storages/fsStorage.ts +13 -8
- package/src/storages/memoryStorage.ts +4 -2
- package/src/types.ts +40 -547
- 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/Kubb.ts +0 -224
- 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/diagnostics.ts +0 -15
- 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/src/utils/packageJSON.ts +0 -61
package/README.md
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
2
|
+
<h1>@kubb/core</h1>
|
|
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>
|
|
5
6
|
|
|
6
|
-
|
|
7
7
|
[![npm version][npm-version-src]][npm-version-href]
|
|
8
8
|
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
9
9
|
[![Coverage][coverage-src]][coverage-href]
|
|
10
10
|
[![License][license-src]][license-href]
|
|
11
11
|
[![Sponsors][sponsors-src]][sponsors-href]
|
|
12
|
+
|
|
12
13
|
<h4>
|
|
13
|
-
<a href="https://
|
|
14
|
-
<span> · </span>
|
|
15
|
-
<a href="https://kubb.dev/kubb" target="_blank">Documentation</a>
|
|
14
|
+
<a href="https://kubb.dev" target="_blank">Documentation</a>
|
|
16
15
|
<span> · </span>
|
|
17
16
|
<a href="https://github.com/kubb-labs/kubb/issues/" target="_blank">Report Bug</a>
|
|
18
17
|
<span> · </span>
|
|
@@ -22,38 +21,20 @@
|
|
|
22
21
|
|
|
23
22
|
<br />
|
|
24
23
|
|
|
25
|
-
|
|
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.
|
|
26
25
|
|
|
27
|
-
|
|
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.
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
npx kubb init
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
The interactive setup will:
|
|
34
|
-
- Create a `package.json` (if needed)
|
|
35
|
-
- Guide you through plugin selection
|
|
36
|
-
- Install packages automatically
|
|
37
|
-
- Generate `kubb.config.ts`
|
|
38
|
-
|
|
39
|
-
Then generate your code:
|
|
28
|
+
## Installation
|
|
40
29
|
|
|
41
30
|
```bash
|
|
42
|
-
|
|
31
|
+
bun add @kubb/core
|
|
32
|
+
# or
|
|
33
|
+
pnpm add @kubb/core
|
|
34
|
+
# or
|
|
35
|
+
npm install @kubb/core
|
|
43
36
|
```
|
|
44
37
|
|
|
45
|
-
See the [documentation](https://kubb.dev) for detailed usage and advanced features.
|
|
46
|
-
|
|
47
|
-
## Features
|
|
48
|
-
- Works with Node.js 20+.
|
|
49
|
-
- Convert Swagger 2.0, OpenAPI 3.0, and OpenAPI 3.1 to TypeScript, Zod, React-Query, ...
|
|
50
|
-
- Plugin ecosystem to extend beyond the default plugins we provide.
|
|
51
|
-
- CLI support with progress bar and detailed logs.
|
|
52
|
-
- Model Context Protocol (MCP) server for AI assistants like [Claude](https://claude.ai), [Cursor](https://cursor.sh), and other MCP-compatible tools.
|
|
53
|
-
- Debug tools with React DevTools.
|
|
54
|
-
- Generates barrel files (index.ts).
|
|
55
|
-
- And so much more ...
|
|
56
|
-
|
|
57
38
|
## Supporting Kubb
|
|
58
39
|
|
|
59
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:
|
|
@@ -141,7 +122,7 @@ Kubb is an open source project with its ongoing development made possible entire
|
|
|
141
122
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/skoropadas"><img src="https://avatars.githubusercontent.com/u/20700969?v=4?s=100" width="100px;" alt="Alex Skoropad"/><br /><sub><b>Alex Skoropad</b></sub></a><br /><a href="https://github.com/kubb-labs/kubb/commits?author=skoropadas" title="Code">💻</a></td>
|
|
142
123
|
<td align="center" valign="top" width="14.28%"><a href="https://pateljay.io"><img src="https://avatars.githubusercontent.com/u/36803168?v=4?s=100" width="100px;" alt="Jay Patel"/><br /><sub><b>Jay Patel</b></sub></a><br /><a href="https://github.com/kubb-labs/kubb/commits?author=jay-babu" title="Code">💻</a></td>
|
|
143
124
|
<td align="center" valign="top" width="14.28%"><a href="https://hamzamihaidaniel.com"><img src="https://avatars.githubusercontent.com/u/12731515?v=4?s=100" width="100px;" alt="Hamza Mihai Daniel"/><br /><sub><b>Hamza Mihai Daniel</b></sub></a><br /><a href="https://github.com/kubb-labs/kubb/commits?author=hamzamihaidanielx" title="Code">💻</a></td>
|
|
144
|
-
<td align="center" valign="top" width="14.28%"><a href="https://github.com/
|
|
125
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/DesselBane"><img src="https://avatars.githubusercontent.com/u/12199480?v=4?s=100" width="100px;" alt="DesselBane"/><br /><sub><b>DesselBane</b></sub></a><br /><a href="https://github.com/kubb-labs/kubb/commits?author=DesselBane" title="Code">💻</a></td>
|
|
145
126
|
</tr>
|
|
146
127
|
</tbody>
|
|
147
128
|
</table>
|
|
@@ -149,13 +130,6 @@ Kubb is an open source project with its ongoing development made possible entire
|
|
|
149
130
|
<!-- markdownlint-restore -->
|
|
150
131
|
<!-- prettier-ignore-end -->
|
|
151
132
|
|
|
152
|
-
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
153
|
-
<!-- prettier-ignore-start -->
|
|
154
|
-
<!-- markdownlint-disable -->
|
|
155
|
-
|
|
156
|
-
<!-- markdownlint-restore -->
|
|
157
|
-
<!-- prettier-ignore-end -->
|
|
158
|
-
|
|
159
133
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
160
134
|
|
|
161
135
|
## License
|
|
@@ -178,7 +152,6 @@ See [LICENSE](./LICENSE) for details.
|
|
|
178
152
|
</picture>
|
|
179
153
|
</a>
|
|
180
154
|
|
|
181
|
-
|
|
182
155
|
<!-- Badges -->
|
|
183
156
|
|
|
184
157
|
[npm-version-src]: https://img.shields.io/npm/v/@kubb/core?flat&colorA=18181B&colorB=f58517
|