kubb 5.0.0-beta.8 → 5.0.0-beta.81
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/LICENSE +17 -10
- package/README.md +51 -45
- package/bin/kubb.js +11 -3
- package/dist/ast.cjs +374 -0
- package/dist/ast.d.ts +3 -0
- package/dist/ast.js +2 -0
- package/dist/config.cjs +3 -0
- package/dist/config.d.ts +3 -0
- package/dist/config.js +2 -0
- package/dist/defineConfig-Bz5OdPiM.d.ts +63 -0
- package/dist/defineConfig-DrauI0Xo.js +112 -0
- package/dist/defineConfig-DrauI0Xo.js.map +1 -0
- package/dist/defineConfig-T5v3Qrv-.cjs +117 -0
- package/dist/defineConfig-T5v3Qrv-.cjs.map +1 -0
- package/dist/index.cjs +2 -78
- package/dist/index.d.ts +3 -44
- package/dist/index.js +1 -77
- package/dist/jsx/jsx-dev-runtime.cjs +9 -0
- package/dist/jsx/jsx-dev-runtime.d.ts +1 -0
- package/dist/jsx/jsx-dev-runtime.js +2 -0
- package/dist/jsx/jsx-runtime.cjs +9 -0
- package/dist/jsx/jsx-runtime.d.ts +1 -0
- package/dist/jsx/jsx-runtime.js +2 -0
- package/dist/jsx.cjs +18 -0
- package/dist/jsx.d.ts +2 -0
- package/dist/jsx.js +3 -0
- package/dist/kit/testing.cjs +9 -0
- package/dist/kit/testing.d.ts +1 -0
- package/dist/kit/testing.js +2 -0
- package/dist/kit.cjs +9 -0
- package/dist/kit.d.ts +1 -0
- package/dist/kit.js +2 -0
- package/package.json +42 -33
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/src/defineConfig.ts +0 -91
- package/src/index.ts +0 -2
- /package/dist/{chunk--u3MIqq1.js → rolldown-runtime-C0LytTxp.js} +0 -0
package/LICENSE
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
This repository contains software under two licenses:
|
|
1
|
+
MIT License
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
MIT License — see licenses/LICENSE-MIT for the full license text.
|
|
3
|
+
Copyright (c) 2026 Stijn Van Hulle
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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,18 +1,15 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<h1>kubb</h1>
|
|
3
2
|
<a href="https://kubb.dev" target="_blank" rel="noopener noreferrer">
|
|
4
|
-
<img
|
|
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
|
-
[![
|
|
8
|
+
[![Stars][stars-src]][stars-href]
|
|
10
9
|
[![License][license-src]][license-href]
|
|
11
|
-
[![
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
Point Kubb at an OpenAPI spec and it generates types, clients, hooks, validators, mocks, and more.
|
|
10
|
+
[![Coverage][coverage-src]][coverage-href]
|
|
11
|
+
[![Node][node-src]][node-href]
|
|
12
|
+
[![OC Backers][oc-backers-src]][oc-backers-href]
|
|
16
13
|
|
|
17
14
|
<h4>
|
|
18
15
|
<a href="https://kubb.dev" target="_blank">Documentation</a>
|
|
@@ -25,6 +22,12 @@ Point Kubb at an OpenAPI spec and it generates types, clients, hooks, validators
|
|
|
25
22
|
|
|
26
23
|
<br />
|
|
27
24
|
|
|
25
|
+
# Kubb
|
|
26
|
+
|
|
27
|
+
### The meta framework for code generation
|
|
28
|
+
|
|
29
|
+
Point Kubb at a schema and it generates types, clients, hooks, validators, mocks, and more.
|
|
30
|
+
|
|
28
31
|
## Installation
|
|
29
32
|
|
|
30
33
|
```bash
|
|
@@ -53,26 +56,39 @@ See the [documentation](https://kubb.dev) for detailed usage and advanced featur
|
|
|
53
56
|
|
|
54
57
|
## Features
|
|
55
58
|
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- JSX
|
|
62
|
-
-
|
|
59
|
+
- Generate TypeScript types, type-safe clients, [TanStack Query](https://github.com/TanStack/query) and [SWR](https://github.com/vercel/swr) hooks, [Zod](https://github.com/colinhacks/zod) validators, [Faker](https://github.com/faker-js/faker) mocks, and [MSW](https://github.com/mswjs/msw) handlers from one schema.
|
|
60
|
+
- Generate a typed [axios](https://axios-http.com/) or [Fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) client with status-keyed results, auth, validation, file uploads, server-sent events, interceptors, and a swappable transport.
|
|
61
|
+
- Read OpenAPI 2.0, 3.0, and 3.1 through adapters like [`@kubb/adapter-oas`](https://npmx.dev/package/@kubb/adapter-oas), with output for Node.js and Bun.
|
|
62
|
+
- Enable only the [plugins](https://github.com/kubb-labs/plugins) you need: `plugin-ts`, `plugin-axios`, `plugin-fetch`, `plugin-react-query`, `plugin-vue-query`, `plugin-swr`, `plugin-zod`, `plugin-faker`, `plugin-msw`, `plugin-cypress`, `plugin-redoc`, `plugin-mcp`.
|
|
63
|
+
- Shape the output by grouping files by tag, including or excluding operations, and writing to disk, memory, or a custom storage backend.
|
|
64
|
+
- Build your own output with custom plugins, adapters, and the JSX renderer (`@kubb/renderer-jsx`).
|
|
65
|
+
- Run generation in your bundler with `unplugin-kubb` for [Vite](https://github.com/vitejs/vite), [Nuxt](https://github.com/nuxt/nuxt), [Astro](https://github.com/withastro/astro), [webpack](https://github.com/webpack/webpack), and more.
|
|
66
|
+
- Drive generation from AI tools over the built-in MCP server ([Claude](https://claude.ai), [Cursor](https://cursor.sh)) or inside [Claude Code](https://kubb.dev/docs/5.x/ai/claude).
|
|
63
67
|
|
|
64
68
|
## Supporting Kubb
|
|
65
69
|
|
|
66
|
-
Kubb is an open source project
|
|
70
|
+
Kubb is an open source project, and its development is funded entirely by sponsors. If you would like to become a sponsor, please consider:
|
|
67
71
|
|
|
68
72
|
- [Become a Sponsor on GitHub](https://github.com/sponsors/stijnvanhulle)
|
|
73
|
+
- [Back Kubb on Open Collective](https://opencollective.com/kubb)
|
|
74
|
+
- [See sponsorship tiers and our sponsors](https://kubb.dev/sponsors)
|
|
69
75
|
|
|
70
76
|
<p align="center">
|
|
71
77
|
<a href="https://github.com/sponsors/stijnvanhulle">
|
|
72
|
-
<img src="https://
|
|
78
|
+
<img src="https://shieldcn.dev/sponsors/stijnvanhulle.svg?titleAlign=center&mode=dark" alt="stijnvanhulle sponsors" width="100%" />
|
|
73
79
|
</a>
|
|
74
80
|
</p>
|
|
75
81
|
|
|
82
|
+
## Contributing
|
|
83
|
+
|
|
84
|
+
We welcome contributions that help improve Kubb. A few ways to get involved:
|
|
85
|
+
|
|
86
|
+
- Found a bug? File it in the [issue tracker](https://github.com/kubb-labs/kubb/issues).
|
|
87
|
+
- Have an idea to improve Kubb? [Open an issue](https://github.com/kubb-labs/kubb/issues/new) to share it.
|
|
88
|
+
- Need help? Ask the community on [Discord](https://discord.gg/4dQjA6vrWX).
|
|
89
|
+
|
|
90
|
+
See [CONTRIBUTING.md](https://github.com/kubb-labs/kubb/blob/main/CONTRIBUTING.md) for the project structure, local setup, and commands.
|
|
91
|
+
|
|
76
92
|
## Contributors [![Contributors][contributors-src]][contributors-href]
|
|
77
93
|
|
|
78
94
|
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
|
|
@@ -160,39 +176,29 @@ Kubb is an open source project with its ongoing development made possible entire
|
|
|
160
176
|
|
|
161
177
|
## License
|
|
162
178
|
|
|
163
|
-
|
|
164
|
-
under AGPL-3.0-or-later.
|
|
165
|
-
|
|
166
|
-
- **Most packages** — [MIT](./licenses/LICENSE-MIT)
|
|
167
|
-
- **`@kubb/agent`** — [AGPL-3.0-or-later](./licenses/LICENSE-AGPL-3.0)
|
|
179
|
+
This repository is licensed under the [MIT License](./licenses/LICENSE-MIT), Copyright © 2025 [Stijn Van Hulle](https://stijnvanhulle.be).
|
|
168
180
|
|
|
169
181
|
See [LICENSE](./LICENSE) for details.
|
|
170
182
|
|
|
171
|
-
## Star
|
|
183
|
+
## Star history
|
|
172
184
|
|
|
173
|
-
<
|
|
174
|
-
<picture>
|
|
175
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=kubb-labs/kubb&type=Date&theme=dark" />
|
|
176
|
-
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=kubb-labs/kubb&type=Date" />
|
|
177
|
-
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=kubb-labs/kubb&type=Date" />
|
|
178
|
-
</picture>
|
|
179
|
-
</a>
|
|
185
|
+
<img alt="Star history chart" src="https://shieldcn.dev/chart/github/stars/kubb-labs/kubb.svg?theme=orange" width="100%" />
|
|
180
186
|
|
|
181
187
|
<!-- Badges -->
|
|
182
188
|
|
|
183
|
-
[npm-version-src]: https://
|
|
184
|
-
[npm-version-href]: https://npmx.dev/package
|
|
185
|
-
[npm-downloads-src]: https://
|
|
186
|
-
[npm-downloads-href]: https://
|
|
187
|
-
[
|
|
188
|
-
[
|
|
189
|
-
[
|
|
190
|
-
[
|
|
191
|
-
[
|
|
192
|
-
[
|
|
193
|
-
[
|
|
194
|
-
[coverage-href]: https://www.npmjs.com/package/@kubb/core
|
|
195
|
-
[contributors-src]: https://img.shields.io/github/contributors/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517&label=%20
|
|
189
|
+
[npm-version-src]: https://shieldcn.dev/npm/v/@kubb/core.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
190
|
+
[npm-version-href]: https://npmx.dev/package/kubb
|
|
191
|
+
[npm-downloads-src]: https://shieldcn.dev/npm/dm/@kubb/core.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
192
|
+
[npm-downloads-href]: https://npmx.dev/package/kubb
|
|
193
|
+
[stars-src]: https://shieldcn.dev/github/stars/kubb-labs/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
194
|
+
[stars-href]: https://github.com/kubb-labs/kubb
|
|
195
|
+
[license-src]: https://shieldcn.dev/npm/license/kubb.svg?variant=secondary&size=xs&theme=zinc
|
|
196
|
+
[license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
|
|
197
|
+
[node-src]: https://shieldcn.dev/npm/node/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
198
|
+
[node-href]: https://npmx.dev/package/kubb
|
|
199
|
+
[contributors-src]: https://shieldcn.dev/github/contributors/kubb-labs/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
196
200
|
[contributors-href]: #contributors-
|
|
197
|
-
[
|
|
198
|
-
[
|
|
201
|
+
[coverage-src]: https://shieldcn.dev/codecov/github/kubb-labs/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
202
|
+
[coverage-href]: https://app.codecov.io/gh/kubb-labs/kubb
|
|
203
|
+
[oc-backers-src]: https://shieldcn.dev/opencollective/backers/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
|
|
204
|
+
[oc-backers-href]: https://opencollective.com/kubb
|
package/bin/kubb.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
|
|
3
|
+
process.setSourceMapsEnabled?.(true)
|
|
4
|
+
process.title = 'Kubb'
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
const { run } = await import('@kubb/cli')
|
|
8
|
+
await run(process.argv)
|
|
9
|
+
} catch (err) {
|
|
10
|
+
console.error(err)
|
|
11
|
+
process.exit(1)
|
|
12
|
+
}
|
package/dist/ast.cjs
ADDED
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _kubb_ast = require("@kubb/ast");
|
|
3
|
+
Object.defineProperty(exports, "applyMacros", {
|
|
4
|
+
enumerable: true,
|
|
5
|
+
get: function() {
|
|
6
|
+
return _kubb_ast.applyMacros;
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
Object.defineProperty(exports, "arrowFunctionDef", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function() {
|
|
12
|
+
return _kubb_ast.arrowFunctionDef;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
Object.defineProperty(exports, "breakDef", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function() {
|
|
18
|
+
return _kubb_ast.breakDef;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(exports, "buildJSDoc", {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function() {
|
|
24
|
+
return _kubb_ast.buildJSDoc;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
Object.defineProperty(exports, "buildList", {
|
|
28
|
+
enumerable: true,
|
|
29
|
+
get: function() {
|
|
30
|
+
return _kubb_ast.buildList;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(exports, "buildObject", {
|
|
34
|
+
enumerable: true,
|
|
35
|
+
get: function() {
|
|
36
|
+
return _kubb_ast.buildObject;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(exports, "childName", {
|
|
40
|
+
enumerable: true,
|
|
41
|
+
get: function() {
|
|
42
|
+
return _kubb_ast.childName;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
Object.defineProperty(exports, "collect", {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
get: function() {
|
|
48
|
+
return _kubb_ast.collect;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(exports, "collectUsedSchemaNames", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function() {
|
|
54
|
+
return _kubb_ast.collectUsedSchemaNames;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, "composeMacros", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function() {
|
|
60
|
+
return _kubb_ast.composeMacros;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, "constDef", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function() {
|
|
66
|
+
return _kubb_ast.constDef;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, "containsCircularRef", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function() {
|
|
72
|
+
return _kubb_ast.containsCircularRef;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(exports, "contentDef", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
get: function() {
|
|
78
|
+
return _kubb_ast.contentDef;
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(exports, "createPrinter", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
get: function() {
|
|
84
|
+
return _kubb_ast.createPrinter;
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(exports, "defineDialect", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function() {
|
|
90
|
+
return _kubb_ast.defineDialect;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, "defineMacro", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function() {
|
|
96
|
+
return _kubb_ast.defineMacro;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(exports, "defineNode", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function() {
|
|
102
|
+
return _kubb_ast.defineNode;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, "enumPropName", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function() {
|
|
108
|
+
return _kubb_ast.enumPropName;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(exports, "exportDef", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function() {
|
|
114
|
+
return _kubb_ast.exportDef;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, "extractRefName", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function() {
|
|
120
|
+
return _kubb_ast.extractRefName;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(exports, "extractStringsFromNodes", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function() {
|
|
126
|
+
return _kubb_ast.extractStringsFromNodes;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(exports, "fileDef", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
get: function() {
|
|
132
|
+
return _kubb_ast.fileDef;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(exports, "findCircularSchemas", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function() {
|
|
138
|
+
return _kubb_ast.findCircularSchemas;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(exports, "functionDef", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
get: function() {
|
|
144
|
+
return _kubb_ast.functionDef;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, "getNestedAccessor", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function() {
|
|
150
|
+
return _kubb_ast.getNestedAccessor;
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
Object.defineProperty(exports, "importDef", {
|
|
154
|
+
enumerable: true,
|
|
155
|
+
get: function() {
|
|
156
|
+
return _kubb_ast.importDef;
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
Object.defineProperty(exports, "inputDef", {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function() {
|
|
162
|
+
return _kubb_ast.inputDef;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
Object.defineProperty(exports, "isHttpOperationNode", {
|
|
166
|
+
enumerable: true,
|
|
167
|
+
get: function() {
|
|
168
|
+
return _kubb_ast.isHttpOperationNode;
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
Object.defineProperty(exports, "isStringType", {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
get: function() {
|
|
174
|
+
return _kubb_ast.isStringType;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
Object.defineProperty(exports, "isValidVarName", {
|
|
178
|
+
enumerable: true,
|
|
179
|
+
get: function() {
|
|
180
|
+
return _kubb_ast.isValidVarName;
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
Object.defineProperty(exports, "jsStringEscape", {
|
|
184
|
+
enumerable: true,
|
|
185
|
+
get: function() {
|
|
186
|
+
return _kubb_ast.jsStringEscape;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
Object.defineProperty(exports, "jsxDef", {
|
|
190
|
+
enumerable: true,
|
|
191
|
+
get: function() {
|
|
192
|
+
return _kubb_ast.jsxDef;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
Object.defineProperty(exports, "lazyGetter", {
|
|
196
|
+
enumerable: true,
|
|
197
|
+
get: function() {
|
|
198
|
+
return _kubb_ast.lazyGetter;
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
Object.defineProperty(exports, "macroDiscriminatorEnum", {
|
|
202
|
+
enumerable: true,
|
|
203
|
+
get: function() {
|
|
204
|
+
return _kubb_ast.macroDiscriminatorEnum;
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
Object.defineProperty(exports, "macroEnumName", {
|
|
208
|
+
enumerable: true,
|
|
209
|
+
get: function() {
|
|
210
|
+
return _kubb_ast.macroEnumName;
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
Object.defineProperty(exports, "macroSimplifyUnion", {
|
|
214
|
+
enumerable: true,
|
|
215
|
+
get: function() {
|
|
216
|
+
return _kubb_ast.macroSimplifyUnion;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
Object.defineProperty(exports, "mapSchemaItems", {
|
|
220
|
+
enumerable: true,
|
|
221
|
+
get: function() {
|
|
222
|
+
return _kubb_ast.mapSchemaItems;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
Object.defineProperty(exports, "mapSchemaMembers", {
|
|
226
|
+
enumerable: true,
|
|
227
|
+
get: function() {
|
|
228
|
+
return _kubb_ast.mapSchemaMembers;
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
Object.defineProperty(exports, "mapSchemaProperties", {
|
|
232
|
+
enumerable: true,
|
|
233
|
+
get: function() {
|
|
234
|
+
return _kubb_ast.mapSchemaProperties;
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
Object.defineProperty(exports, "mergeAdjacentObjectsLazy", {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function() {
|
|
240
|
+
return _kubb_ast.mergeAdjacentObjectsLazy;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
Object.defineProperty(exports, "narrowSchema", {
|
|
244
|
+
enumerable: true,
|
|
245
|
+
get: function() {
|
|
246
|
+
return _kubb_ast.narrowSchema;
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
Object.defineProperty(exports, "nodeDefs", {
|
|
250
|
+
enumerable: true,
|
|
251
|
+
get: function() {
|
|
252
|
+
return _kubb_ast.nodeDefs;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
Object.defineProperty(exports, "objectKey", {
|
|
256
|
+
enumerable: true,
|
|
257
|
+
get: function() {
|
|
258
|
+
return _kubb_ast.objectKey;
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
Object.defineProperty(exports, "operationDef", {
|
|
262
|
+
enumerable: true,
|
|
263
|
+
get: function() {
|
|
264
|
+
return _kubb_ast.operationDef;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
Object.defineProperty(exports, "optionality", {
|
|
268
|
+
enumerable: true,
|
|
269
|
+
get: function() {
|
|
270
|
+
return _kubb_ast.optionality;
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
Object.defineProperty(exports, "outputDef", {
|
|
274
|
+
enumerable: true,
|
|
275
|
+
get: function() {
|
|
276
|
+
return _kubb_ast.outputDef;
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
Object.defineProperty(exports, "parameterDef", {
|
|
280
|
+
enumerable: true,
|
|
281
|
+
get: function() {
|
|
282
|
+
return _kubb_ast.parameterDef;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
Object.defineProperty(exports, "propertyDef", {
|
|
286
|
+
enumerable: true,
|
|
287
|
+
get: function() {
|
|
288
|
+
return _kubb_ast.propertyDef;
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
Object.defineProperty(exports, "requestBodyDef", {
|
|
292
|
+
enumerable: true,
|
|
293
|
+
get: function() {
|
|
294
|
+
return _kubb_ast.requestBodyDef;
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
Object.defineProperty(exports, "responseDef", {
|
|
298
|
+
enumerable: true,
|
|
299
|
+
get: function() {
|
|
300
|
+
return _kubb_ast.responseDef;
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
Object.defineProperty(exports, "schemaDef", {
|
|
304
|
+
enumerable: true,
|
|
305
|
+
get: function() {
|
|
306
|
+
return _kubb_ast.schemaDef;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
Object.defineProperty(exports, "schemaTypes", {
|
|
310
|
+
enumerable: true,
|
|
311
|
+
get: function() {
|
|
312
|
+
return _kubb_ast.schemaTypes;
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
Object.defineProperty(exports, "sourceDef", {
|
|
316
|
+
enumerable: true,
|
|
317
|
+
get: function() {
|
|
318
|
+
return _kubb_ast.sourceDef;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
Object.defineProperty(exports, "stringify", {
|
|
322
|
+
enumerable: true,
|
|
323
|
+
get: function() {
|
|
324
|
+
return _kubb_ast.stringify;
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
Object.defineProperty(exports, "stringifyObject", {
|
|
328
|
+
enumerable: true,
|
|
329
|
+
get: function() {
|
|
330
|
+
return _kubb_ast.stringifyObject;
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
Object.defineProperty(exports, "syncSchemaRef", {
|
|
334
|
+
enumerable: true,
|
|
335
|
+
get: function() {
|
|
336
|
+
return _kubb_ast.syncSchemaRef;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
Object.defineProperty(exports, "textDef", {
|
|
340
|
+
enumerable: true,
|
|
341
|
+
get: function() {
|
|
342
|
+
return _kubb_ast.textDef;
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
Object.defineProperty(exports, "toRegExpString", {
|
|
346
|
+
enumerable: true,
|
|
347
|
+
get: function() {
|
|
348
|
+
return _kubb_ast.toRegExpString;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
Object.defineProperty(exports, "transform", {
|
|
352
|
+
enumerable: true,
|
|
353
|
+
get: function() {
|
|
354
|
+
return _kubb_ast.transform;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
Object.defineProperty(exports, "trimQuotes", {
|
|
358
|
+
enumerable: true,
|
|
359
|
+
get: function() {
|
|
360
|
+
return _kubb_ast.trimQuotes;
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
Object.defineProperty(exports, "typeDef", {
|
|
364
|
+
enumerable: true,
|
|
365
|
+
get: function() {
|
|
366
|
+
return _kubb_ast.typeDef;
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
Object.defineProperty(exports, "walk", {
|
|
370
|
+
enumerable: true,
|
|
371
|
+
get: function() {
|
|
372
|
+
return _kubb_ast.walk;
|
|
373
|
+
}
|
|
374
|
+
});
|
package/dist/ast.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { applyMacros, arrowFunctionDef, breakDef, buildJSDoc, buildList, buildObject, childName, collect, collectUsedSchemaNames, composeMacros, constDef, containsCircularRef, contentDef, createPrinter, defineDialect, defineMacro, defineNode, enumPropName, exportDef, extractRefName, extractStringsFromNodes, fileDef, findCircularSchemas, functionDef, getNestedAccessor, importDef, inputDef, isHttpOperationNode, isStringType, isValidVarName, jsStringEscape, jsxDef, lazyGetter, macroDiscriminatorEnum, macroEnumName, macroSimplifyUnion, mapSchemaItems, mapSchemaMembers, mapSchemaProperties, mergeAdjacentObjectsLazy, narrowSchema, nodeDefs, objectKey, operationDef, optionality, outputDef, parameterDef, propertyDef, requestBodyDef, responseDef, schemaDef, schemaTypes, sourceDef, stringify, stringifyObject, syncSchemaRef, textDef, toRegExpString, transform, trimQuotes, typeDef, walk } from "@kubb/ast";
|
|
2
|
+
export type * from "@kubb/ast";
|
|
3
|
+
export { applyMacros, arrowFunctionDef, breakDef, buildJSDoc, buildList, buildObject, childName, collect, collectUsedSchemaNames, composeMacros, constDef, containsCircularRef, contentDef, createPrinter, defineDialect, defineMacro, defineNode, enumPropName, exportDef, extractRefName, extractStringsFromNodes, fileDef, findCircularSchemas, functionDef, getNestedAccessor, importDef, inputDef, isHttpOperationNode, isStringType, isValidVarName, jsStringEscape, jsxDef, lazyGetter, macroDiscriminatorEnum, macroEnumName, macroSimplifyUnion, mapSchemaItems, mapSchemaMembers, mapSchemaProperties, mergeAdjacentObjectsLazy, narrowSchema, nodeDefs, objectKey, operationDef, optionality, outputDef, parameterDef, propertyDef, requestBodyDef, responseDef, schemaDef, schemaTypes, sourceDef, stringify, stringifyObject, syncSchemaRef, textDef, toRegExpString, transform, trimQuotes, typeDef, walk };
|
package/dist/ast.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { applyMacros, arrowFunctionDef, breakDef, buildJSDoc, buildList, buildObject, childName, collect, collectUsedSchemaNames, composeMacros, constDef, containsCircularRef, contentDef, createPrinter, defineDialect, defineMacro, defineNode, enumPropName, exportDef, extractRefName, extractStringsFromNodes, fileDef, findCircularSchemas, functionDef, getNestedAccessor, importDef, inputDef, isHttpOperationNode, isStringType, isValidVarName, jsStringEscape, jsxDef, lazyGetter, macroDiscriminatorEnum, macroEnumName, macroSimplifyUnion, mapSchemaItems, mapSchemaMembers, mapSchemaProperties, mergeAdjacentObjectsLazy, narrowSchema, nodeDefs, objectKey, operationDef, optionality, outputDef, parameterDef, propertyDef, requestBodyDef, responseDef, schemaDef, schemaTypes, sourceDef, stringify, stringifyObject, syncSchemaRef, textDef, toRegExpString, transform, trimQuotes, typeDef, walk } from "@kubb/ast";
|
|
2
|
+
export { applyMacros, arrowFunctionDef, breakDef, buildJSDoc, buildList, buildObject, childName, collect, collectUsedSchemaNames, composeMacros, constDef, containsCircularRef, contentDef, createPrinter, defineDialect, defineMacro, defineNode, enumPropName, exportDef, extractRefName, extractStringsFromNodes, fileDef, findCircularSchemas, functionDef, getNestedAccessor, importDef, inputDef, isHttpOperationNode, isStringType, isValidVarName, jsStringEscape, jsxDef, lazyGetter, macroDiscriminatorEnum, macroEnumName, macroSimplifyUnion, mapSchemaItems, mapSchemaMembers, mapSchemaProperties, mergeAdjacentObjectsLazy, narrowSchema, nodeDefs, objectKey, operationDef, optionality, outputDef, parameterDef, propertyDef, requestBodyDef, responseDef, schemaDef, schemaTypes, sourceDef, stringify, stringifyObject, syncSchemaRef, textDef, toRegExpString, transform, trimQuotes, typeDef, walk };
|
package/dist/config.cjs
ADDED
package/dist/config.d.ts
ADDED
package/dist/config.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { t as __name } from "./rolldown-runtime-C0LytTxp.js";
|
|
2
|
+
import { CLIOptions, UserConfig } from "@kubb/core";
|
|
3
|
+
|
|
4
|
+
//#region ../../internals/utils/src/promise.d.ts
|
|
5
|
+
/** A value that may already be resolved or still pending.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* function load(id: string): PossiblePromise<string> {
|
|
10
|
+
* return cache.get(id) ?? fetchRemote(id)
|
|
11
|
+
* }
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
type PossiblePromise<T> = Promise<T> | T;
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region src/defineConfig.d.ts
|
|
17
|
+
type AnyConfigResult = UserConfig<any> | Array<UserConfig<any>>;
|
|
18
|
+
type ConfigInput = AnyConfigResult | Promise<AnyConfigResult> | ((cli: CLIOptions) => PossiblePromise<AnyConfigResult>);
|
|
19
|
+
type NormalizeConfig<TConfig> = TConfig extends Array<UserConfig<infer TInput>> ? Array<UserConfig<TInput>> : TConfig extends UserConfig<infer TInput> ? UserConfig<TInput> : never;
|
|
20
|
+
type DefinedConfig<TConfig extends ConfigInput> = TConfig extends ((cli: CLIOptions) => PossiblePromise<infer TResult>) ? (cli: CLIOptions) => Promise<NormalizeConfig<TResult>> : TConfig extends Promise<infer TResult> ? Promise<NormalizeConfig<TResult>> : NormalizeConfig<TConfig>;
|
|
21
|
+
/**
|
|
22
|
+
* Defines a Kubb build configuration and fills in defaults for any omitted fields.
|
|
23
|
+
*
|
|
24
|
+
* Defaults applied when omitted:
|
|
25
|
+
* - `adapter` → `adapterOas()` (OpenAPI 2.0/3.0/3.1).
|
|
26
|
+
* - `parsers` → `[parserTs, parserTsx, parserMd]`.
|
|
27
|
+
* - `reporters` → `[cliReporter, jsonReporter, fileReporter]`.
|
|
28
|
+
* - `plugins` → `pluginBarrel()` is appended when not already present.
|
|
29
|
+
* - `output.barrel` → `{ type: 'named' }` only when `pluginBarrel` is
|
|
30
|
+
* in the plugins list.
|
|
31
|
+
* - `output.format` and `output.lint` → `false`.
|
|
32
|
+
*
|
|
33
|
+
* Accepts a config object, an array of configs, a Promise resolving to one,
|
|
34
|
+
* or a function that receives the parsed CLI options and returns any of the
|
|
35
|
+
* above. The return type is preserved so async/array variants stay typed.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { defineConfig } from 'kubb'
|
|
40
|
+
* import { pluginTs } from '@kubb/plugin-ts'
|
|
41
|
+
*
|
|
42
|
+
* export default defineConfig({
|
|
43
|
+
* input: { path: './petStore.yaml' },
|
|
44
|
+
* output: { path: './src/gen' },
|
|
45
|
+
* plugins: [pluginTs()],
|
|
46
|
+
* })
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Function form with CLI options
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { defineConfig } from 'kubb'
|
|
52
|
+
*
|
|
53
|
+
* export default defineConfig(({ input }) => ({
|
|
54
|
+
* input: { path: input ?? './petStore.yaml' },
|
|
55
|
+
* output: { path: './src/gen' },
|
|
56
|
+
* plugins: [],
|
|
57
|
+
* }))
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
declare function defineConfig<TConfig extends ConfigInput>(config: TConfig): DefinedConfig<TConfig>;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { defineConfig as t };
|
|
63
|
+
//# sourceMappingURL=defineConfig-Bz5OdPiM.d.ts.map
|