@kubb/core 5.0.0-alpha.7 → 5.0.0-alpha.71
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 +3 -2
- 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 +730 -1773
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +289 -240
- package/dist/index.js +717 -1741
- package/dist/index.js.map +1 -1
- package/dist/mocks.cjs +139 -0
- package/dist/mocks.cjs.map +1 -0
- package/dist/mocks.d.ts +74 -0
- package/dist/mocks.js +134 -0
- package/dist/mocks.js.map +1 -0
- package/dist/types-DWtkW2RX.d.ts +1915 -0
- package/package.json +51 -57
- package/src/FileManager.ts +115 -0
- package/src/FileProcessor.ts +86 -0
- package/src/Kubb.ts +205 -130
- package/src/PluginDriver.ts +326 -565
- package/src/constants.ts +20 -47
- package/src/createAdapter.ts +25 -0
- package/src/createKubb.ts +546 -0
- package/src/createRenderer.ts +57 -0
- package/src/createStorage.ts +58 -0
- package/src/defineGenerator.ts +88 -100
- package/src/defineLogger.ts +13 -3
- package/src/defineMiddleware.ts +64 -0
- package/src/defineParser.ts +45 -0
- package/src/definePlugin.ts +78 -7
- package/src/defineResolver.ts +521 -0
- package/src/devtools.ts +14 -14
- package/src/index.ts +13 -16
- package/src/mocks.ts +172 -0
- package/src/renderNode.ts +35 -0
- package/src/storages/fsStorage.ts +43 -13
- package/src/storages/memoryStorage.ts +6 -4
- package/src/types.ts +752 -226
- package/src/utils/diagnostics.ts +4 -1
- package/src/utils/isInputPath.ts +10 -0
- package/src/utils/packageJSON.ts +99 -0
- package/dist/PluginDriver-Dma9KhLK.d.ts +0 -1056
- package/dist/chunk-ByKO4r7w.cjs +0 -38
- package/dist/hooks.cjs +0 -102
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.d.ts +0 -75
- package/dist/hooks.js +0 -97
- package/dist/hooks.js.map +0 -1
- package/src/PackageManager.ts +0 -180
- package/src/build.ts +0 -419
- package/src/config.ts +0 -56
- package/src/defineAdapter.ts +0 -22
- package/src/defineStorage.ts +0 -56
- package/src/errors.ts +0 -1
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useKubb.ts +0 -138
- 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 -30
- package/src/utils/getPlugins.ts +0 -23
- package/src/utils/linters.ts +0 -25
- package/src/utils/resolveOptions.ts +0 -93
package/src/Kubb.ts
CHANGED
|
@@ -1,37 +1,73 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import type { AsyncEventEmitter } from '@internals/utils'
|
|
2
|
+
import type { OperationNode, SchemaNode } from '@kubb/ast'
|
|
3
|
+
import type { BuildOutput } from './createKubb.ts'
|
|
4
|
+
import type { PluginDriver } from './PluginDriver.ts'
|
|
5
|
+
import type {
|
|
6
|
+
Config,
|
|
7
|
+
GeneratorContext,
|
|
8
|
+
KubbBuildEndContext,
|
|
9
|
+
KubbBuildStartContext,
|
|
10
|
+
KubbConfigEndContext,
|
|
11
|
+
KubbDebugContext,
|
|
12
|
+
KubbErrorContext,
|
|
13
|
+
KubbFileProcessingUpdateContext,
|
|
14
|
+
KubbFilesProcessingEndContext,
|
|
15
|
+
KubbFilesProcessingStartContext,
|
|
16
|
+
KubbGenerationEndContext,
|
|
17
|
+
KubbGenerationStartContext,
|
|
18
|
+
KubbGenerationSummaryContext,
|
|
19
|
+
KubbHookEndContext,
|
|
20
|
+
KubbHookStartContext,
|
|
21
|
+
KubbInfoContext,
|
|
22
|
+
KubbLifecycleStartContext,
|
|
23
|
+
KubbPluginEndContext,
|
|
24
|
+
KubbPluginSetupContext,
|
|
25
|
+
KubbPluginStartContext,
|
|
26
|
+
KubbPluginsEndContext,
|
|
27
|
+
KubbSuccessContext,
|
|
28
|
+
KubbVersionNewContext,
|
|
29
|
+
KubbWarnContext,
|
|
30
|
+
} from './types'
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The instance returned by {@link createKubb}.
|
|
34
|
+
*/
|
|
35
|
+
export type Kubb = {
|
|
36
|
+
/**
|
|
37
|
+
* The shared event emitter. Attach listeners here before calling `setup()` or `build()`.
|
|
38
|
+
*/
|
|
39
|
+
readonly hooks: AsyncEventEmitter<KubbHooks>
|
|
40
|
+
/**
|
|
41
|
+
* Raw generated source, keyed by absolute file path.
|
|
42
|
+
* Populated after a successful `build()` or `safeBuild()` call.
|
|
43
|
+
*/
|
|
44
|
+
readonly sources: Map<string, string>
|
|
45
|
+
/**
|
|
46
|
+
* The plugin driver. Available after `setup()` has been called.
|
|
47
|
+
*/
|
|
48
|
+
readonly driver: PluginDriver | undefined
|
|
49
|
+
/**
|
|
50
|
+
* The resolved config with applied defaults. Available after `setup()` has been called.
|
|
51
|
+
*/
|
|
52
|
+
readonly config: Config | undefined
|
|
53
|
+
/**
|
|
54
|
+
* Initializes all Kubb infrastructure: validates input, applies config defaults,
|
|
55
|
+
* runs the adapter, and creates the PluginDriver.
|
|
56
|
+
*
|
|
57
|
+
* Calling `build()` or `safeBuild()` without calling `setup()` first will
|
|
58
|
+
* automatically invoke `setup()` before proceeding.
|
|
59
|
+
*/
|
|
60
|
+
setup(): Promise<void>
|
|
61
|
+
/**
|
|
62
|
+
* Runs a full Kubb build and throws on any error or plugin failure.
|
|
63
|
+
* Automatically calls `setup()` if it has not been called yet.
|
|
64
|
+
*/
|
|
65
|
+
build(): Promise<BuildOutput>
|
|
66
|
+
/**
|
|
67
|
+
* Runs a full Kubb build and captures errors instead of throwing.
|
|
68
|
+
* Automatically calls `setup()` if it has not been called yet.
|
|
69
|
+
*/
|
|
70
|
+
safeBuild(): Promise<BuildOutput>
|
|
35
71
|
}
|
|
36
72
|
|
|
37
73
|
/**
|
|
@@ -40,213 +76,252 @@ type ExecutedMeta<H extends PluginLifecycleHooks = PluginLifecycleHooks> = {
|
|
|
40
76
|
*
|
|
41
77
|
* @example
|
|
42
78
|
* ```typescript
|
|
43
|
-
* import type { AsyncEventEmitter } from '@
|
|
44
|
-
* import type {
|
|
79
|
+
* import type { AsyncEventEmitter } from '@internals/utils'
|
|
80
|
+
* import type { KubbHooks } from '@kubb/core'
|
|
45
81
|
*
|
|
46
|
-
* const
|
|
82
|
+
* const hooks: AsyncEventEmitter<KubbHooks> = new AsyncEventEmitter()
|
|
47
83
|
*
|
|
48
|
-
*
|
|
84
|
+
* hooks.on('kubb:lifecycle:start', () => {
|
|
49
85
|
* console.log('Starting Kubb generation')
|
|
50
86
|
* })
|
|
51
87
|
*
|
|
52
|
-
*
|
|
88
|
+
* hooks.on('kubb:plugin:end', ({ plugin, duration }) => {
|
|
53
89
|
* console.log(`Plugin ${plugin.name} completed in ${duration}ms`)
|
|
54
90
|
* })
|
|
55
91
|
* ```
|
|
56
92
|
*/
|
|
57
|
-
export interface
|
|
93
|
+
export interface KubbHooks {
|
|
58
94
|
/**
|
|
59
95
|
* Emitted at the beginning of the Kubb lifecycle, before any code generation starts.
|
|
60
96
|
*/
|
|
61
|
-
'lifecycle:start': [
|
|
62
|
-
|
|
97
|
+
'kubb:lifecycle:start': [ctx: KubbLifecycleStartContext]
|
|
63
98
|
/**
|
|
64
99
|
* Emitted at the end of the Kubb lifecycle, after all code generation is complete.
|
|
65
100
|
*/
|
|
66
|
-
'lifecycle:end': []
|
|
101
|
+
'kubb:lifecycle:end': []
|
|
67
102
|
|
|
68
103
|
/**
|
|
69
104
|
* Emitted when configuration loading starts.
|
|
70
105
|
*/
|
|
71
|
-
'config:start': []
|
|
72
|
-
|
|
106
|
+
'kubb:config:start': []
|
|
73
107
|
/**
|
|
74
108
|
* Emitted when configuration loading is complete.
|
|
75
109
|
*/
|
|
76
|
-
'config:end': [
|
|
110
|
+
'kubb:config:end': [ctx: KubbConfigEndContext]
|
|
77
111
|
|
|
78
112
|
/**
|
|
79
113
|
* Emitted when code generation phase starts.
|
|
80
114
|
*/
|
|
81
|
-
'generation:start': [
|
|
82
|
-
|
|
115
|
+
'kubb:generation:start': [ctx: KubbGenerationStartContext]
|
|
83
116
|
/**
|
|
84
117
|
* Emitted when code generation phase completes.
|
|
85
118
|
*/
|
|
86
|
-
'generation:end': [
|
|
87
|
-
|
|
119
|
+
'kubb:generation:end': [ctx: KubbGenerationEndContext]
|
|
88
120
|
/**
|
|
89
121
|
* Emitted with a summary of the generation results.
|
|
90
122
|
* Contains summary lines, title, and success status.
|
|
91
123
|
*/
|
|
92
|
-
'generation:summary': [
|
|
93
|
-
Config: Config,
|
|
94
|
-
{
|
|
95
|
-
failedPlugins: Set<{ plugin: Plugin; error: Error }>
|
|
96
|
-
status: 'success' | 'failed'
|
|
97
|
-
hrStart: [number, number]
|
|
98
|
-
filesCreated: number
|
|
99
|
-
pluginTimings?: Map<string, number>
|
|
100
|
-
},
|
|
101
|
-
]
|
|
124
|
+
'kubb:generation:summary': [ctx: KubbGenerationSummaryContext]
|
|
102
125
|
|
|
103
126
|
/**
|
|
104
127
|
* Emitted when code formatting starts (e.g., running Biome or Prettier).
|
|
105
128
|
*/
|
|
106
|
-
'format:start': []
|
|
107
|
-
|
|
129
|
+
'kubb:format:start': []
|
|
108
130
|
/**
|
|
109
131
|
* Emitted when code formatting completes.
|
|
110
132
|
*/
|
|
111
|
-
'format:end': []
|
|
133
|
+
'kubb:format:end': []
|
|
112
134
|
|
|
113
135
|
/**
|
|
114
136
|
* Emitted when linting starts.
|
|
115
137
|
*/
|
|
116
|
-
'lint:start': []
|
|
117
|
-
|
|
138
|
+
'kubb:lint:start': []
|
|
118
139
|
/**
|
|
119
140
|
* Emitted when linting completes.
|
|
120
141
|
*/
|
|
121
|
-
'lint:end': []
|
|
142
|
+
'kubb:lint:end': []
|
|
122
143
|
|
|
123
144
|
/**
|
|
124
145
|
* Emitted when plugin hooks execution starts.
|
|
125
146
|
*/
|
|
126
|
-
'hooks:start': []
|
|
127
|
-
|
|
147
|
+
'kubb:hooks:start': []
|
|
128
148
|
/**
|
|
129
149
|
* Emitted when plugin hooks execution completes.
|
|
130
150
|
*/
|
|
131
|
-
'hooks:end': []
|
|
151
|
+
'kubb:hooks:end': []
|
|
132
152
|
|
|
133
153
|
/**
|
|
134
|
-
* Emitted when a single hook execution starts
|
|
154
|
+
* Emitted when a single hook execution starts (e.g., format or lint).
|
|
135
155
|
* The callback should be invoked when the command completes.
|
|
136
156
|
*/
|
|
137
|
-
'hook:start': [
|
|
157
|
+
'kubb:hook:start': [ctx: KubbHookStartContext]
|
|
138
158
|
/**
|
|
139
159
|
* Emitted when a single hook execution completes.
|
|
140
160
|
*/
|
|
141
|
-
'hook:end': [
|
|
142
|
-
{
|
|
143
|
-
id?: string
|
|
144
|
-
command: string
|
|
145
|
-
args?: readonly string[]
|
|
146
|
-
success: boolean
|
|
147
|
-
error: Error | null
|
|
148
|
-
},
|
|
149
|
-
]
|
|
161
|
+
'kubb:hook:end': [ctx: KubbHookEndContext]
|
|
150
162
|
|
|
151
163
|
/**
|
|
152
164
|
* Emitted when a new version of Kubb is available.
|
|
153
165
|
*/
|
|
154
|
-
'version:new': [
|
|
166
|
+
'kubb:version:new': [ctx: KubbVersionNewContext]
|
|
155
167
|
|
|
156
168
|
/**
|
|
157
169
|
* Informational message event.
|
|
158
170
|
*/
|
|
159
|
-
info: [
|
|
160
|
-
|
|
171
|
+
'kubb:info': [ctx: KubbInfoContext]
|
|
161
172
|
/**
|
|
162
173
|
* Error event. Emitted when an error occurs during code generation.
|
|
163
174
|
*/
|
|
164
|
-
error: [
|
|
165
|
-
|
|
175
|
+
'kubb:error': [ctx: KubbErrorContext]
|
|
166
176
|
/**
|
|
167
177
|
* Success message event.
|
|
168
178
|
*/
|
|
169
|
-
success: [
|
|
170
|
-
|
|
179
|
+
'kubb:success': [ctx: KubbSuccessContext]
|
|
171
180
|
/**
|
|
172
181
|
* Warning message event.
|
|
173
182
|
*/
|
|
174
|
-
warn: [
|
|
175
|
-
|
|
183
|
+
'kubb:warn': [ctx: KubbWarnContext]
|
|
176
184
|
/**
|
|
177
185
|
* Debug event for detailed logging.
|
|
178
186
|
* Contains timestamp, log messages, and optional filename.
|
|
179
187
|
*/
|
|
180
|
-
debug: [
|
|
188
|
+
'kubb:debug': [ctx: KubbDebugContext]
|
|
181
189
|
|
|
182
190
|
/**
|
|
183
191
|
* Emitted when file processing starts.
|
|
184
192
|
* Contains the list of files to be processed.
|
|
185
193
|
*/
|
|
186
|
-
'files:processing:start': [
|
|
187
|
-
|
|
194
|
+
'kubb:files:processing:start': [ctx: KubbFilesProcessingStartContext]
|
|
188
195
|
/**
|
|
189
196
|
* Emitted for each file being processed, providing progress updates.
|
|
190
197
|
* Contains processed count, total count, percentage, and file details.
|
|
191
198
|
*/
|
|
192
|
-
'file:processing:update': [
|
|
193
|
-
{
|
|
194
|
-
/** Number of files processed so far */
|
|
195
|
-
processed: number
|
|
196
|
-
/** Total number of files to process */
|
|
197
|
-
total: number
|
|
198
|
-
/** Processing percentage (0-100) */
|
|
199
|
-
percentage: number
|
|
200
|
-
/** Optional source identifier */
|
|
201
|
-
source?: string
|
|
202
|
-
/** The file being processed */
|
|
203
|
-
file: KubbFile.ResolvedFile
|
|
204
|
-
/**
|
|
205
|
-
* Kubb configuration (not present in Fabric).
|
|
206
|
-
* Provides access to the current config during file processing.
|
|
207
|
-
*/
|
|
208
|
-
config: Config
|
|
209
|
-
},
|
|
210
|
-
]
|
|
211
|
-
|
|
199
|
+
'kubb:file:processing:update': [ctx: KubbFileProcessingUpdateContext]
|
|
212
200
|
/**
|
|
213
201
|
* Emitted when file processing completes.
|
|
214
202
|
* Contains the list of processed files.
|
|
215
203
|
*/
|
|
216
|
-
'files:processing:end': [
|
|
204
|
+
'kubb:files:processing:end': [ctx: KubbFilesProcessingEndContext]
|
|
217
205
|
|
|
218
206
|
/**
|
|
219
207
|
* Emitted when a plugin starts executing.
|
|
220
208
|
*/
|
|
221
|
-
'plugin:start': [
|
|
222
|
-
|
|
209
|
+
'kubb:plugin:start': [ctx: KubbPluginStartContext]
|
|
223
210
|
/**
|
|
224
211
|
* Emitted when a plugin completes execution.
|
|
225
|
-
* Duration in ms
|
|
212
|
+
* Duration in ms.
|
|
226
213
|
*/
|
|
227
|
-
'plugin:end': [
|
|
214
|
+
'kubb:plugin:end': [ctx: KubbPluginEndContext]
|
|
228
215
|
|
|
229
216
|
/**
|
|
230
|
-
*
|
|
231
|
-
*
|
|
217
|
+
* Fired once — before any plugin's `buildStart` runs — so that hook-style plugins
|
|
218
|
+
* can register generators, configure resolvers/transformers/renderers, or inject
|
|
219
|
+
* extra files. All `kubb:plugin:setup` handlers registered via `definePlugin` receive
|
|
220
|
+
* a plugin-specific context (with the correct `addGenerator` closure).
|
|
221
|
+
* External tooling can observe this event via `hooks.on('kubb:plugin:setup', …)`.
|
|
232
222
|
*/
|
|
233
|
-
'
|
|
234
|
-
|
|
223
|
+
'kubb:plugin:setup': [ctx: KubbPluginSetupContext]
|
|
235
224
|
/**
|
|
236
|
-
*
|
|
237
|
-
*
|
|
225
|
+
* Fired immediately before the plugin execution loop begins.
|
|
226
|
+
* The adapter has already parsed the source and `inputNode` is available.
|
|
238
227
|
*/
|
|
239
|
-
'
|
|
240
|
-
|
|
228
|
+
'kubb:build:start': [ctx: KubbBuildStartContext]
|
|
241
229
|
/**
|
|
242
|
-
*
|
|
243
|
-
*
|
|
230
|
+
* Fired after all plugins have run and all per-plugin barrels have been generated,
|
|
231
|
+
* but BEFORE files are written to disk.
|
|
232
|
+
* Use this event to inject final files (e.g. a root barrel) that must be persisted
|
|
233
|
+
* in the same write pass as the plugin output.
|
|
244
234
|
*/
|
|
245
|
-
'plugins:
|
|
235
|
+
'kubb:plugins:end': [ctx: KubbPluginsEndContext]
|
|
236
|
+
/**
|
|
237
|
+
* Fired after all files have been written to disk.
|
|
238
|
+
*/
|
|
239
|
+
'kubb:build:end': [ctx: KubbBuildEndContext]
|
|
246
240
|
|
|
247
241
|
/**
|
|
248
|
-
* Emitted
|
|
249
|
-
*
|
|
242
|
+
* Emitted for each schema node during the AST walk.
|
|
243
|
+
* Generator listeners registered via `addGenerator()` in `kubb:plugin:setup` respond to this event.
|
|
244
|
+
* The `ctx.plugin.name` identifies which plugin is driving the current walk.
|
|
245
|
+
* `ctx.options` carries the per-node resolved options (after exclude/include/override).
|
|
250
246
|
*/
|
|
251
|
-
'
|
|
247
|
+
'kubb:generate:schema': [node: SchemaNode, ctx: GeneratorContext]
|
|
248
|
+
/**
|
|
249
|
+
* Emitted for each operation node during the AST walk.
|
|
250
|
+
* Generator listeners registered via `addGenerator()` in `kubb:plugin:setup` respond to this event.
|
|
251
|
+
* The `ctx.plugin.name` identifies which plugin is driving the current walk.
|
|
252
|
+
* `ctx.options` carries the per-node resolved options (after exclude/include/override).
|
|
253
|
+
*/
|
|
254
|
+
'kubb:generate:operation': [node: OperationNode, ctx: GeneratorContext]
|
|
255
|
+
/**
|
|
256
|
+
* Emitted once after all operations have been walked, with the full collected array.
|
|
257
|
+
* Generator listeners with an `operations()` method respond to this event.
|
|
258
|
+
* The `ctx.plugin.name` identifies which plugin is driving the current walk.
|
|
259
|
+
* `ctx.options` carries the plugin-level resolved options for the batch call.
|
|
260
|
+
*/
|
|
261
|
+
'kubb:generate:operations': [nodes: Array<OperationNode>, ctx: GeneratorContext]
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
declare global {
|
|
265
|
+
namespace Kubb {
|
|
266
|
+
/**
|
|
267
|
+
* Registry that maps plugin names to their `PluginFactoryOptions`.
|
|
268
|
+
* Augment this interface in each plugin's `types.ts` to enable automatic
|
|
269
|
+
* typing for `getPlugin` and `requirePlugin`.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* ```ts
|
|
273
|
+
* // packages/plugin-ts/src/types.ts
|
|
274
|
+
* declare global {
|
|
275
|
+
* namespace Kubb {
|
|
276
|
+
* interface PluginRegistry {
|
|
277
|
+
* 'plugin-ts': PluginTs
|
|
278
|
+
* }
|
|
279
|
+
* }
|
|
280
|
+
* }
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
interface PluginRegistry {}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Extension point for root `Config['output']` options.
|
|
287
|
+
* Augment the `output` key in middleware or plugin packages to add extra fields
|
|
288
|
+
* to the global output configuration without touching core types.
|
|
289
|
+
*
|
|
290
|
+
* @example
|
|
291
|
+
* ```ts
|
|
292
|
+
* // packages/middleware-barrel/src/types.ts
|
|
293
|
+
* declare global {
|
|
294
|
+
* namespace Kubb {
|
|
295
|
+
* interface ConfigOptionsRegistry {
|
|
296
|
+
* output: {
|
|
297
|
+
* barrelType?: import('./types.ts').BarrelType | false
|
|
298
|
+
* }
|
|
299
|
+
* }
|
|
300
|
+
* }
|
|
301
|
+
* }
|
|
302
|
+
* ```
|
|
303
|
+
*/
|
|
304
|
+
interface ConfigOptionsRegistry {}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Extension point for per-plugin `Output` options.
|
|
308
|
+
* Augment the `output` key in middleware or plugin packages to add extra fields
|
|
309
|
+
* to the per-plugin output configuration without touching core types.
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* ```ts
|
|
313
|
+
* // packages/middleware-barrel/src/types.ts
|
|
314
|
+
* declare global {
|
|
315
|
+
* namespace Kubb {
|
|
316
|
+
* interface PluginOptionsRegistry {
|
|
317
|
+
* output: {
|
|
318
|
+
* barrelType?: import('./types.ts').BarrelType | false
|
|
319
|
+
* }
|
|
320
|
+
* }
|
|
321
|
+
* }
|
|
322
|
+
* }
|
|
323
|
+
* ```
|
|
324
|
+
*/
|
|
325
|
+
interface PluginOptionsRegistry {}
|
|
326
|
+
}
|
|
252
327
|
}
|