@kubb/core 5.0.0-alpha.5 → 5.0.0-alpha.50

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.
Files changed (71) hide show
  1. package/README.md +3 -2
  2. package/dist/PluginDriver-DtwggkXg.cjs +1082 -0
  3. package/dist/PluginDriver-DtwggkXg.cjs.map +1 -0
  4. package/dist/PluginDriver-mXeqWp-U.js +979 -0
  5. package/dist/PluginDriver-mXeqWp-U.js.map +1 -0
  6. package/dist/index.cjs +1013 -1829
  7. package/dist/index.cjs.map +1 -1
  8. package/dist/index.d.ts +274 -265
  9. package/dist/index.js +1003 -1799
  10. package/dist/index.js.map +1 -1
  11. package/dist/mocks.cjs +138 -0
  12. package/dist/mocks.cjs.map +1 -0
  13. package/dist/mocks.d.ts +74 -0
  14. package/dist/mocks.js +133 -0
  15. package/dist/mocks.js.map +1 -0
  16. package/dist/types-DfEv9d_c.d.ts +1721 -0
  17. package/package.json +51 -57
  18. package/src/FileManager.ts +133 -0
  19. package/src/FileProcessor.ts +86 -0
  20. package/src/Kubb.ts +154 -101
  21. package/src/PluginDriver.ts +418 -0
  22. package/src/constants.ts +43 -47
  23. package/src/createAdapter.ts +25 -0
  24. package/src/createKubb.ts +614 -0
  25. package/src/createRenderer.ts +57 -0
  26. package/src/createStorage.ts +58 -0
  27. package/src/defineGenerator.ts +88 -100
  28. package/src/defineLogger.ts +13 -3
  29. package/src/defineParser.ts +45 -0
  30. package/src/definePlugin.ts +68 -7
  31. package/src/defineResolver.ts +501 -0
  32. package/src/devtools.ts +14 -14
  33. package/src/index.ts +12 -17
  34. package/src/mocks.ts +171 -0
  35. package/src/renderNode.ts +35 -0
  36. package/src/storages/fsStorage.ts +40 -11
  37. package/src/storages/memoryStorage.ts +4 -3
  38. package/src/types.ts +575 -205
  39. package/src/utils/TreeNode.ts +47 -9
  40. package/src/utils/diagnostics.ts +4 -1
  41. package/src/utils/getBarrelFiles.ts +94 -16
  42. package/src/utils/isInputPath.ts +10 -0
  43. package/src/utils/packageJSON.ts +99 -0
  44. package/dist/PluginManager-vZodFEMe.d.ts +0 -1056
  45. package/dist/chunk-ByKO4r7w.cjs +0 -38
  46. package/dist/hooks.cjs +0 -60
  47. package/dist/hooks.cjs.map +0 -1
  48. package/dist/hooks.d.ts +0 -56
  49. package/dist/hooks.js +0 -56
  50. package/dist/hooks.js.map +0 -1
  51. package/src/BarrelManager.ts +0 -74
  52. package/src/PackageManager.ts +0 -180
  53. package/src/PluginManager.ts +0 -667
  54. package/src/PromiseManager.ts +0 -40
  55. package/src/build.ts +0 -419
  56. package/src/config.ts +0 -56
  57. package/src/defineAdapter.ts +0 -22
  58. package/src/defineStorage.ts +0 -56
  59. package/src/errors.ts +0 -1
  60. package/src/hooks/index.ts +0 -4
  61. package/src/hooks/useKubb.ts +0 -46
  62. package/src/hooks/useMode.ts +0 -11
  63. package/src/hooks/usePlugin.ts +0 -11
  64. package/src/hooks/usePluginManager.ts +0 -11
  65. package/src/utils/FunctionParams.ts +0 -155
  66. package/src/utils/executeStrategies.ts +0 -81
  67. package/src/utils/formatters.ts +0 -56
  68. package/src/utils/getConfigs.ts +0 -30
  69. package/src/utils/getPlugins.ts +0 -23
  70. package/src/utils/linters.ts +0 -25
  71. package/src/utils/resolveOptions.ts +0 -93
@@ -0,0 +1,1082 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __name = (target, value) => __defProp(target, "name", {
5
+ value,
6
+ configurable: true
7
+ });
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
14
+ key = keys[i];
15
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: ((k) => from[k]).bind(null, key),
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+ //#endregion
27
+ let node_path = require("node:path");
28
+ node_path = __toESM(node_path, 1);
29
+ let _kubb_ast = require("@kubb/ast");
30
+ let fflate = require("fflate");
31
+ let tinyexec = require("tinyexec");
32
+ //#region ../../internals/utils/src/casing.ts
33
+ /**
34
+ * Shared implementation for camelCase and PascalCase conversion.
35
+ * Splits on common word boundaries (spaces, hyphens, underscores, dots, slashes, colons)
36
+ * and capitalizes each word according to `pascal`.
37
+ *
38
+ * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
39
+ */
40
+ function toCamelOrPascal(text, pascal) {
41
+ return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
42
+ if (word.length > 1 && word === word.toUpperCase()) return word;
43
+ if (i === 0 && !pascal) return word.charAt(0).toLowerCase() + word.slice(1);
44
+ return word.charAt(0).toUpperCase() + word.slice(1);
45
+ }).join("").replace(/[^a-zA-Z0-9]/g, "");
46
+ }
47
+ /**
48
+ * Splits `text` on `.` and applies `transformPart` to each segment.
49
+ * The last segment receives `isLast = true`, all earlier segments receive `false`.
50
+ * Segments are joined with `/` to form a file path.
51
+ *
52
+ * Only splits on dots followed by a letter so that version numbers
53
+ * embedded in operationIds (e.g. `v2025.0`) are kept intact.
54
+ *
55
+ * Empty segments are filtered before joining. They arise when the text starts with
56
+ * a dot followed immediately by a letter (e.g. `..Schema` splits into `['..', 'Schema']`
57
+ * and `'..'` transforms to an empty string). Without this filter the join would produce
58
+ * a leading `/`, which `path.resolve` would interpret as an absolute path, allowing
59
+ * generated files to escape the configured output directory.
60
+ */
61
+ function applyToFileParts(text, transformPart) {
62
+ const parts = text.split(/\.(?=[a-zA-Z])/);
63
+ return parts.map((part, i) => transformPart(part, i === parts.length - 1)).filter(Boolean).join("/");
64
+ }
65
+ /**
66
+ * Converts `text` to camelCase.
67
+ * When `isFile` is `true`, dot-separated segments are each cased independently and joined with `/`.
68
+ *
69
+ * @example
70
+ * camelCase('hello-world') // 'helloWorld'
71
+ * camelCase('pet.petId', { isFile: true }) // 'pet/petId'
72
+ */
73
+ function camelCase(text, { isFile, prefix = "", suffix = "" } = {}) {
74
+ if (isFile) return applyToFileParts(text, (part, isLast) => camelCase(part, isLast ? {
75
+ prefix,
76
+ suffix
77
+ } : {}));
78
+ return toCamelOrPascal(`${prefix} ${text} ${suffix}`, false);
79
+ }
80
+ /**
81
+ * Converts `text` to PascalCase.
82
+ * When `isFile` is `true`, the last dot-separated segment is PascalCased and earlier segments are camelCased.
83
+ *
84
+ * @example
85
+ * pascalCase('hello-world') // 'HelloWorld'
86
+ * pascalCase('pet.petId', { isFile: true }) // 'pet/PetId'
87
+ */
88
+ function pascalCase(text, { isFile, prefix = "", suffix = "" } = {}) {
89
+ if (isFile) return applyToFileParts(text, (part, isLast) => isLast ? pascalCase(part, {
90
+ prefix,
91
+ suffix
92
+ }) : camelCase(part));
93
+ return toCamelOrPascal(`${prefix} ${text} ${suffix}`, true);
94
+ }
95
+ //#endregion
96
+ //#region ../../internals/utils/src/string.ts
97
+ /**
98
+ * Strips the file extension from a path or file name.
99
+ * Only removes the last `.ext` segment when the dot is not part of a directory name.
100
+ *
101
+ * @example
102
+ * trimExtName('petStore.ts') // 'petStore'
103
+ * trimExtName('/src/models/pet.ts') // '/src/models/pet'
104
+ * trimExtName('/project.v2/gen/pet.ts') // '/project.v2/gen/pet'
105
+ * trimExtName('noExtension') // 'noExtension'
106
+ */
107
+ function trimExtName(text) {
108
+ const dotIndex = text.lastIndexOf(".");
109
+ if (dotIndex > 0 && !text.includes("/", dotIndex)) return text.slice(0, dotIndex);
110
+ return text;
111
+ }
112
+ //#endregion
113
+ //#region src/constants.ts
114
+ /**
115
+ * Base URL for the Kubb Studio web app.
116
+ */
117
+ const DEFAULT_STUDIO_URL = "https://studio.kubb.dev";
118
+ /**
119
+ * Basename (without extension) of generated barrel files.
120
+ *
121
+ * Used to detect whether a path already points at a barrel so the generator
122
+ * avoids re-creating one on top of it.
123
+ */
124
+ const BARREL_BASENAME = "index";
125
+ /**
126
+ * File name used for generated barrel (index) files.
127
+ */
128
+ const BARREL_FILENAME = `${BARREL_BASENAME}.ts`;
129
+ /**
130
+ * Default banner style written at the top of every generated file.
131
+ */
132
+ const DEFAULT_BANNER = "simple";
133
+ /**
134
+ * Default file-extension mapping used when no explicit mapping is configured.
135
+ */
136
+ const DEFAULT_EXTENSION = { ".ts": ".ts" };
137
+ /**
138
+ * Numeric log-level thresholds used internally to compare verbosity.
139
+ *
140
+ * Higher numbers are more verbose.
141
+ */
142
+ const logLevel = {
143
+ silent: Number.NEGATIVE_INFINITY,
144
+ error: 0,
145
+ warn: 1,
146
+ info: 3,
147
+ verbose: 4,
148
+ debug: 5
149
+ };
150
+ //#endregion
151
+ //#region src/defineResolver.ts
152
+ const stringPatternCache = /* @__PURE__ */ new Map();
153
+ function testPattern(value, pattern) {
154
+ if (typeof pattern === "string") {
155
+ let regex = stringPatternCache.get(pattern);
156
+ if (!regex) {
157
+ regex = new RegExp(pattern);
158
+ stringPatternCache.set(pattern, regex);
159
+ }
160
+ return regex.test(value);
161
+ }
162
+ return value.match(pattern) !== null;
163
+ }
164
+ /**
165
+ * Checks if an operation matches a pattern for a given filter type (`tag`, `operationId`, `path`, `method`).
166
+ */
167
+ function matchesOperationPattern(node, type, pattern) {
168
+ switch (type) {
169
+ case "tag": return node.tags.some((tag) => testPattern(tag, pattern));
170
+ case "operationId": return testPattern(node.operationId, pattern);
171
+ case "path": return testPattern(node.path, pattern);
172
+ case "method": return testPattern(node.method.toLowerCase(), pattern);
173
+ case "contentType": return node.requestBody?.contentType ? testPattern(node.requestBody.contentType, pattern) : false;
174
+ default: return false;
175
+ }
176
+ }
177
+ /**
178
+ * Checks if a schema matches a pattern for a given filter type (`schemaName`).
179
+ *
180
+ * Returns `null` when the filter type doesn't apply to schemas.
181
+ */
182
+ function matchesSchemaPattern(node, type, pattern) {
183
+ switch (type) {
184
+ case "schemaName": return node.name ? testPattern(node.name, pattern) : false;
185
+ default: return null;
186
+ }
187
+ }
188
+ /**
189
+ * Default name resolver used by `defineResolver`.
190
+ *
191
+ * - `camelCase` for `function` and `file` types.
192
+ * - `PascalCase` for `type`.
193
+ * - `camelCase` for everything else.
194
+ */
195
+ function defaultResolver(name, type) {
196
+ let resolvedName = camelCase(name);
197
+ if (type === "file" || type === "function") resolvedName = camelCase(name, { isFile: type === "file" });
198
+ if (type === "type") resolvedName = pascalCase(name);
199
+ return resolvedName;
200
+ }
201
+ /**
202
+ * Default option resolver — applies include/exclude filters and merges matching override options.
203
+ *
204
+ * Returns `null` when the node is filtered out by an `exclude` rule or not matched by any `include` rule.
205
+ *
206
+ * @example Include/exclude filtering
207
+ * ```ts
208
+ * const options = defaultResolveOptions(operationNode, {
209
+ * options: { output: 'types' },
210
+ * exclude: [{ type: 'tag', pattern: 'internal' }],
211
+ * })
212
+ * // → null when node has tag 'internal'
213
+ * ```
214
+ *
215
+ * @example Override merging
216
+ * ```ts
217
+ * const options = defaultResolveOptions(operationNode, {
218
+ * options: { enumType: 'asConst' },
219
+ * override: [{ type: 'operationId', pattern: 'listPets', options: { enumType: 'enum' } }],
220
+ * })
221
+ * // → { enumType: 'enum' } when operationId matches
222
+ * ```
223
+ */
224
+ function defaultResolveOptions(node, { options, exclude = [], include, override = [] }) {
225
+ if ((0, _kubb_ast.isOperationNode)(node)) {
226
+ if (exclude.some(({ type, pattern }) => matchesOperationPattern(node, type, pattern))) return null;
227
+ if (include && !include.some(({ type, pattern }) => matchesOperationPattern(node, type, pattern))) return null;
228
+ const overrideOptions = override.find(({ type, pattern }) => matchesOperationPattern(node, type, pattern))?.options;
229
+ return {
230
+ ...options,
231
+ ...overrideOptions
232
+ };
233
+ }
234
+ if ((0, _kubb_ast.isSchemaNode)(node)) {
235
+ if (exclude.some(({ type, pattern }) => matchesSchemaPattern(node, type, pattern) === true)) return null;
236
+ if (include) {
237
+ const applicable = include.map(({ type, pattern }) => matchesSchemaPattern(node, type, pattern)).filter((r) => r !== null);
238
+ if (applicable.length > 0 && !applicable.includes(true)) return null;
239
+ }
240
+ const overrideOptions = override.find(({ type, pattern }) => matchesSchemaPattern(node, type, pattern) === true)?.options;
241
+ return {
242
+ ...options,
243
+ ...overrideOptions
244
+ };
245
+ }
246
+ return options;
247
+ }
248
+ /**
249
+ * Default path resolver used by `defineResolver`.
250
+ *
251
+ * - Returns the output directory in `single` mode.
252
+ * - Resolves into a tag- or path-based subdirectory when `group` and a `tag`/`path` value are provided.
253
+ * - Falls back to a flat `output/baseName` path otherwise.
254
+ *
255
+ * A custom `group.name` function overrides the default subdirectory naming.
256
+ * For `tag` groups the default is `${camelCase(tag)}Controller`.
257
+ * For `path` groups the default is the first path segment after `/`.
258
+ *
259
+ * @example Flat output
260
+ * ```ts
261
+ * defaultResolvePath({ baseName: 'petTypes.ts' }, { root: '/src', output: { path: 'types' } })
262
+ * // → '/src/types/petTypes.ts'
263
+ * ```
264
+ *
265
+ * @example Tag-based grouping
266
+ * ```ts
267
+ * defaultResolvePath(
268
+ * { baseName: 'petTypes.ts', tag: 'pets' },
269
+ * { root: '/src', output: { path: 'types' }, group: { type: 'tag' } },
270
+ * )
271
+ * // → '/src/types/petsController/petTypes.ts'
272
+ * ```
273
+ *
274
+ * @example Path-based grouping
275
+ * ```ts
276
+ * defaultResolvePath(
277
+ * { baseName: 'petTypes.ts', path: '/pets/list' },
278
+ * { root: '/src', output: { path: 'types' }, group: { type: 'path' } },
279
+ * )
280
+ * // → '/src/types/pets/petTypes.ts'
281
+ * ```
282
+ *
283
+ * @example Single-file mode
284
+ * ```ts
285
+ * defaultResolvePath(
286
+ * { baseName: 'petTypes.ts', pathMode: 'single' },
287
+ * { root: '/src', output: { path: 'types' } },
288
+ * )
289
+ * // → '/src/types'
290
+ * ```
291
+ */
292
+ function defaultResolvePath({ baseName, pathMode, tag, path: groupPath }, { root, output, group }) {
293
+ if ((pathMode ?? PluginDriver.getMode(node_path.default.resolve(root, output.path))) === "single") return node_path.default.resolve(root, output.path);
294
+ let result;
295
+ if (group && (groupPath || tag)) {
296
+ const groupValue = group.type === "path" ? groupPath : tag;
297
+ const defaultName = group.type === "tag" ? ({ group: g }) => `${camelCase(g)}Controller` : ({ group: g }) => {
298
+ const segment = g.split("/").filter((s) => s !== "" && s !== "." && s !== "..")[0];
299
+ return segment ? camelCase(segment) : "";
300
+ };
301
+ const resolveName = group.name ?? defaultName;
302
+ result = node_path.default.resolve(root, output.path, resolveName({ group: groupValue }), baseName);
303
+ } else result = node_path.default.resolve(root, output.path, baseName);
304
+ const outputDir = node_path.default.resolve(root, output.path);
305
+ const outputDirWithSep = outputDir.endsWith(node_path.default.sep) ? outputDir : `${outputDir}${node_path.default.sep}`;
306
+ if (result !== outputDir && !result.startsWith(outputDirWithSep)) throw new Error(`[Kubb] Resolved path "${result}" is outside the output directory "${outputDir}". This may indicate a path traversal attempt in the OpenAPI specification or a misconfigured group.name function.`);
307
+ return result;
308
+ }
309
+ /**
310
+ * Default file resolver used by `defineResolver`.
311
+ *
312
+ * Resolves a `FileNode` by combining name resolution (`resolver.default`) with
313
+ * path resolution (`resolver.resolvePath`). The resolved file always has empty
314
+ * `sources`, `imports`, and `exports` arrays — consumers populate those separately.
315
+ *
316
+ * In `single` mode the name is omitted and the file sits directly in the output directory.
317
+ *
318
+ * @example Resolve a schema file
319
+ * ```ts
320
+ * const file = defaultResolveFile.call(resolver,
321
+ * { name: 'pet', extname: '.ts' },
322
+ * { root: '/src', output: { path: 'types' } },
323
+ * )
324
+ * // → { baseName: 'pet.ts', path: '/src/types/pet.ts', sources: [], ... }
325
+ * ```
326
+ *
327
+ * @example Resolve an operation file with tag grouping
328
+ * ```ts
329
+ * const file = defaultResolveFile.call(resolver,
330
+ * { name: 'listPets', extname: '.ts', tag: 'pets' },
331
+ * { root: '/src', output: { path: 'types' }, group: { type: 'tag' } },
332
+ * )
333
+ * // → { baseName: 'listPets.ts', path: '/src/types/petsController/listPets.ts', ... }
334
+ * ```
335
+ */
336
+ function defaultResolveFile({ name, extname, tag, path: groupPath }, context) {
337
+ const pathMode = PluginDriver.getMode(node_path.default.resolve(context.root, context.output.path));
338
+ const baseName = `${pathMode === "single" ? "" : this.default(name, "file")}${extname}`;
339
+ const filePath = this.resolvePath({
340
+ baseName,
341
+ pathMode,
342
+ tag,
343
+ path: groupPath
344
+ }, context);
345
+ return (0, _kubb_ast.createFile)({
346
+ path: filePath,
347
+ baseName: node_path.default.basename(filePath),
348
+ meta: { pluginName: this.pluginName },
349
+ sources: [],
350
+ imports: [],
351
+ exports: []
352
+ });
353
+ }
354
+ /**
355
+ * Generates the default "Generated by Kubb" banner from config and optional node metadata.
356
+ */
357
+ function buildDefaultBanner({ title, description, version, config }) {
358
+ try {
359
+ let source = "";
360
+ if (Array.isArray(config.input)) {
361
+ const first = config.input[0];
362
+ if (first && "path" in first) source = node_path.default.basename(first.path);
363
+ } else if ("path" in config.input) source = node_path.default.basename(config.input.path);
364
+ else if ("data" in config.input) source = "text content";
365
+ let banner = "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n";
366
+ if (config.output.defaultBanner === "simple") {
367
+ banner += "*/\n";
368
+ return banner;
369
+ }
370
+ if (source) banner += `* Source: ${source}\n`;
371
+ if (title) banner += `* Title: ${title}\n`;
372
+ if (description) {
373
+ const formattedDescription = description.replace(/\n/gm, "\n* ");
374
+ banner += `* Description: ${formattedDescription}\n`;
375
+ }
376
+ if (version) banner += `* OpenAPI spec version: ${version}\n`;
377
+ banner += "*/\n";
378
+ return banner;
379
+ } catch (_error) {
380
+ return "/**\n* Generated by Kubb (https://kubb.dev/).\n* Do not edit manually.\n*/";
381
+ }
382
+ }
383
+ /**
384
+ * Default banner resolver — returns the banner string for a generated file.
385
+ *
386
+ * A user-supplied `output.banner` overrides the default Kubb "Generated by Kubb" notice.
387
+ * When no `output.banner` is set, the Kubb notice is used (including `title` and `version`
388
+ * from the OAS spec when a `node` is provided).
389
+ *
390
+ * - When `output.banner` is a function and `node` is provided, returns `output.banner(node)`.
391
+ * - When `output.banner` is a function and `node` is absent, falls back to the Kubb notice.
392
+ * - When `output.banner` is a string, returns it directly.
393
+ * - When `config.output.defaultBanner` is `false`, returns `undefined`.
394
+ * - Otherwise returns the Kubb "Generated by Kubb" notice.
395
+ *
396
+ * @example String banner overrides default
397
+ * ```ts
398
+ * defaultResolveBanner(undefined, { output: { banner: '// my banner' }, config })
399
+ * // → '// my banner'
400
+ * ```
401
+ *
402
+ * @example Function banner with node
403
+ * ```ts
404
+ * defaultResolveBanner(inputNode, { output: { banner: (node) => `// v${node.version}` }, config })
405
+ * // → '// v3.0.0'
406
+ * ```
407
+ *
408
+ * @example No user banner — Kubb notice with OAS metadata
409
+ * ```ts
410
+ * defaultResolveBanner(inputNode, { config })
411
+ * // → '/** Generated by Kubb ... Title: Pet Store ... *\/'
412
+ * ```
413
+ *
414
+ * @example Disabled default banner
415
+ * ```ts
416
+ * defaultResolveBanner(undefined, { config: { output: { defaultBanner: false }, ...config } })
417
+ * // → undefined
418
+ * ```
419
+ */
420
+ function defaultResolveBanner(node, { output, config }) {
421
+ if (typeof output?.banner === "function") return output.banner(node);
422
+ if (typeof output?.banner === "string") return output.banner;
423
+ if (config.output.defaultBanner === false) return;
424
+ return buildDefaultBanner({
425
+ title: node?.meta?.title,
426
+ version: node?.meta?.version,
427
+ config
428
+ });
429
+ }
430
+ /**
431
+ * Default footer resolver — returns the footer string for a generated file.
432
+ *
433
+ * - When `output.footer` is a function and `node` is provided, calls it with the node.
434
+ * - When `output.footer` is a function and `node` is absent, returns `undefined`.
435
+ * - When `output.footer` is a string, returns it directly.
436
+ * - Otherwise returns `undefined`.
437
+ *
438
+ * @example String footer
439
+ * ```ts
440
+ * defaultResolveFooter(undefined, { output: { footer: '// end of file' }, config })
441
+ * // → '// end of file'
442
+ * ```
443
+ *
444
+ * @example Function footer with node
445
+ * ```ts
446
+ * defaultResolveFooter(inputNode, { output: { footer: (node) => `// ${node.title}` }, config })
447
+ * // → '// Pet Store'
448
+ * ```
449
+ */
450
+ function defaultResolveFooter(node, { output }) {
451
+ if (typeof output?.footer === "function") return node ? output.footer(node) : void 0;
452
+ if (typeof output?.footer === "string") return output.footer;
453
+ }
454
+ /**
455
+ * Defines a resolver for a plugin, injecting built-in defaults for name casing,
456
+ * include/exclude/override filtering, path resolution, and file construction.
457
+ *
458
+ * All four defaults can be overridden by providing them in the builder function:
459
+ * - `default` — name casing strategy (camelCase / PascalCase)
460
+ * - `resolveOptions` — include/exclude/override filtering
461
+ * - `resolvePath` — output path computation
462
+ * - `resolveFile` — full `FileNode` construction
463
+ *
464
+ * Methods in the builder have access to `this` (the full resolver object), so they
465
+ * can call other resolver methods without circular imports.
466
+ *
467
+ * @example Basic resolver with naming helpers
468
+ * ```ts
469
+ * export const resolver = defineResolver<PluginTs>(() => ({
470
+ * name: 'default',
471
+ * resolveName(node) {
472
+ * return this.default(node.name, 'function')
473
+ * },
474
+ * resolveTypedName(node) {
475
+ * return this.default(node.name, 'type')
476
+ * },
477
+ * }))
478
+ * ```
479
+ *
480
+ * @example Override resolvePath for a custom output structure
481
+ * ```ts
482
+ * export const resolver = defineResolver<PluginTs>(() => ({
483
+ * name: 'custom',
484
+ * resolvePath({ baseName }, { root, output }) {
485
+ * return path.resolve(root, output.path, 'generated', baseName)
486
+ * },
487
+ * }))
488
+ * ```
489
+ *
490
+ * @example Use this.default inside a helper
491
+ * ```ts
492
+ * export const resolver = defineResolver<PluginTs>(() => ({
493
+ * name: 'default',
494
+ * resolveParamName(node, param) {
495
+ * return this.default(`${node.operationId} ${param.in} ${param.name}`, 'type')
496
+ * },
497
+ * }))
498
+ * ```
499
+ */
500
+ function defineResolver(build) {
501
+ return {
502
+ default: defaultResolver,
503
+ resolveOptions: defaultResolveOptions,
504
+ resolvePath: defaultResolvePath,
505
+ resolveFile: defaultResolveFile,
506
+ resolveBanner: defaultResolveBanner,
507
+ resolveFooter: defaultResolveFooter,
508
+ ...build()
509
+ };
510
+ }
511
+ //#endregion
512
+ //#region src/devtools.ts
513
+ /**
514
+ * Encodes an `InputNode` as a compressed, URL-safe string.
515
+ *
516
+ * The JSON representation is deflate-compressed with {@link deflateSync} before
517
+ * base64url encoding, which typically reduces payload size by 70–80 % and
518
+ * keeps URLs well within browser and server path-length limits.
519
+ *
520
+ * Use {@link decodeAst} to reverse.
521
+ */
522
+ function encodeAst(input) {
523
+ const compressed = (0, fflate.deflateSync)(new TextEncoder().encode(JSON.stringify(input)));
524
+ return Buffer.from(compressed).toString("base64url");
525
+ }
526
+ /**
527
+ * Constructs the Kubb Studio URL for the given `InputNode`.
528
+ * When `options.ast` is `true`, navigates to the AST inspector (`/ast`).
529
+ * The `input` is encoded and attached as the `?root=` query parameter so Studio
530
+ * can decode and render it without a round-trip to any server.
531
+ */
532
+ function getStudioUrl(input, studioUrl, options = {}) {
533
+ return `${studioUrl.replace(/\/$/, "")}${options.ast ? "/ast" : ""}?root=${encodeAst(input)}`;
534
+ }
535
+ /**
536
+ * Opens the Kubb Studio URL for the given `InputNode` in the default browser —
537
+ *
538
+ * Falls back to printing the URL if the browser cannot be launched.
539
+ */
540
+ async function openInStudio(input, studioUrl, options = {}) {
541
+ const url = getStudioUrl(input, studioUrl, options);
542
+ const cmd = process.platform === "win32" ? "cmd" : process.platform === "darwin" ? "open" : "xdg-open";
543
+ const args = process.platform === "win32" ? [
544
+ "/c",
545
+ "start",
546
+ "",
547
+ url
548
+ ] : [url];
549
+ try {
550
+ await (0, tinyexec.x)(cmd, args);
551
+ } catch {
552
+ console.log(`\n ${url}\n`);
553
+ }
554
+ }
555
+ //#endregion
556
+ //#region src/FileManager.ts
557
+ function mergeFile(a, b) {
558
+ return {
559
+ ...a,
560
+ sources: [...a.sources || [], ...b.sources || []],
561
+ imports: [...a.imports || [], ...b.imports || []],
562
+ exports: [...a.exports || [], ...b.exports || []]
563
+ };
564
+ }
565
+ /**
566
+ * In-memory file store for generated files.
567
+ *
568
+ * Files with the same `path` are merged — sources, imports, and exports are concatenated.
569
+ * The `files` getter returns all stored files sorted by path length (shortest first).
570
+ *
571
+ * @example
572
+ * ```ts
573
+ * import { FileManager } from '@kubb/core'
574
+ *
575
+ * const manager = new FileManager()
576
+ * manager.upsert(myFile)
577
+ * console.log(manager.files) // all stored files
578
+ * ```
579
+ */
580
+ var FileManager = class {
581
+ #cache = /* @__PURE__ */ new Map();
582
+ #filesCache = null;
583
+ /**
584
+ * Adds one or more files. Files with the same path are merged — sources, imports,
585
+ * and exports from all calls with the same path are concatenated together.
586
+ */
587
+ add(...files) {
588
+ const resolvedFiles = [];
589
+ const mergedFiles = /* @__PURE__ */ new Map();
590
+ for (const file of files) {
591
+ const existing = mergedFiles.get(file.path);
592
+ mergedFiles.set(file.path, existing ? mergeFile(existing, file) : file);
593
+ }
594
+ for (const file of mergedFiles.values()) {
595
+ const resolvedFile = (0, _kubb_ast.createFile)(file);
596
+ this.#cache.set(resolvedFile.path, resolvedFile);
597
+ resolvedFiles.push(resolvedFile);
598
+ }
599
+ this.#filesCache = null;
600
+ return resolvedFiles;
601
+ }
602
+ /**
603
+ * Adds or merges one or more files.
604
+ * If a file with the same path already exists, its sources/imports/exports are merged together.
605
+ */
606
+ upsert(...files) {
607
+ const resolvedFiles = [];
608
+ const mergedFiles = /* @__PURE__ */ new Map();
609
+ for (const file of files) {
610
+ const existing = mergedFiles.get(file.path);
611
+ mergedFiles.set(file.path, existing ? mergeFile(existing, file) : file);
612
+ }
613
+ for (const file of mergedFiles.values()) {
614
+ const existing = this.#cache.get(file.path);
615
+ const resolvedFile = (0, _kubb_ast.createFile)(existing ? mergeFile(existing, file) : file);
616
+ this.#cache.set(resolvedFile.path, resolvedFile);
617
+ resolvedFiles.push(resolvedFile);
618
+ }
619
+ this.#filesCache = null;
620
+ return resolvedFiles;
621
+ }
622
+ getByPath(path) {
623
+ return this.#cache.get(path) ?? null;
624
+ }
625
+ deleteByPath(path) {
626
+ this.#cache.delete(path);
627
+ this.#filesCache = null;
628
+ }
629
+ clear() {
630
+ this.#cache.clear();
631
+ this.#filesCache = null;
632
+ }
633
+ /**
634
+ * All stored files, sorted by path length (shorter paths first).
635
+ * Barrel/index files (e.g. index.ts) are sorted last within each length bucket.
636
+ */
637
+ get files() {
638
+ if (this.#filesCache) return this.#filesCache;
639
+ const keys = [...this.#cache.keys()];
640
+ const meta = /* @__PURE__ */ new Map();
641
+ for (const key of keys) meta.set(key, {
642
+ length: key.length,
643
+ isIndex: trimExtName(key).endsWith(BARREL_BASENAME)
644
+ });
645
+ keys.sort((a, b) => {
646
+ const ma = meta.get(a);
647
+ const mb = meta.get(b);
648
+ if (ma.length !== mb.length) return ma.length - mb.length;
649
+ if (ma.isIndex !== mb.isIndex) return ma.isIndex ? 1 : -1;
650
+ return 0;
651
+ });
652
+ const files = [];
653
+ for (const key of keys) {
654
+ const file = this.#cache.get(key);
655
+ if (file) files.push(file);
656
+ }
657
+ this.#filesCache = files;
658
+ return files;
659
+ }
660
+ };
661
+ //#endregion
662
+ //#region src/renderNode.ts
663
+ /**
664
+ * Handles the return value of a plugin AST hook or generator method.
665
+ *
666
+ * - Renderer output → rendered via the provided `rendererFactory` (e.g. JSX), files stored in `driver.fileManager`
667
+ * - `Array<FileNode>` → added directly into `driver.fileManager`
668
+ * - `void` / `null` / `undefined` → no-op (plugin handled it via `this.upsertFile`)
669
+ *
670
+ * Pass a `rendererFactory` (e.g. `jsxRenderer` from `@kubb/renderer-jsx`) when the result
671
+ * may be a renderer element. Generators that only return `Array<FileNode>` do not need one.
672
+ */
673
+ async function applyHookResult(result, driver, rendererFactory) {
674
+ if (!result) return;
675
+ if (Array.isArray(result)) {
676
+ driver.fileManager.upsert(...result);
677
+ return;
678
+ }
679
+ if (!rendererFactory) return;
680
+ const renderer = rendererFactory();
681
+ await renderer.render(result);
682
+ driver.fileManager.upsert(...renderer.files);
683
+ renderer.unmount();
684
+ }
685
+ //#endregion
686
+ //#region src/PluginDriver.ts
687
+ var PluginDriver = class PluginDriver {
688
+ config;
689
+ options;
690
+ /**
691
+ * Returns `'single'` when `fileOrFolder` has a file extension, `'split'` otherwise.
692
+ *
693
+ * @example
694
+ * ```ts
695
+ * PluginDriver.getMode('src/gen/types.ts') // 'single'
696
+ * PluginDriver.getMode('src/gen/types') // 'split'
697
+ * ```
698
+ */
699
+ static getMode(fileOrFolder) {
700
+ if (!fileOrFolder) return "split";
701
+ return (0, node_path.extname)(fileOrFolder) ? "single" : "split";
702
+ }
703
+ /**
704
+ * The universal `@kubb/ast` `InputNode` produced by the adapter, set by
705
+ * the build pipeline after the adapter's `parse()` resolves.
706
+ */
707
+ inputNode = void 0;
708
+ adapter = void 0;
709
+ #studioIsOpen = false;
710
+ /**
711
+ * Central file store for all generated files.
712
+ * Plugins should use `this.addFile()` / `this.upsertFile()` (via their context) to
713
+ * add files; this property gives direct read/write access when needed.
714
+ */
715
+ fileManager = new FileManager();
716
+ plugins = /* @__PURE__ */ new Map();
717
+ /**
718
+ * Tracks which plugins have generators registered via `addGenerator()` (event-based path).
719
+ * Used by the build loop to decide whether to emit generator events for a given plugin.
720
+ */
721
+ #pluginsWithEventGenerators = /* @__PURE__ */ new Set();
722
+ #resolvers = /* @__PURE__ */ new Map();
723
+ #defaultResolvers = /* @__PURE__ */ new Map();
724
+ #hookListeners = /* @__PURE__ */ new Map();
725
+ constructor(config, options) {
726
+ this.config = config;
727
+ this.options = options;
728
+ config.plugins.map((rawPlugin) => this.#normalizePlugin(rawPlugin)).filter((plugin) => {
729
+ if (typeof plugin.apply === "function") return plugin.apply(config);
730
+ return true;
731
+ }).sort((a, b) => {
732
+ if (b.dependencies?.includes(a.name)) return -1;
733
+ if (a.dependencies?.includes(b.name)) return 1;
734
+ return 0;
735
+ }).forEach((plugin) => {
736
+ this.plugins.set(plugin.name, plugin);
737
+ });
738
+ }
739
+ get hooks() {
740
+ return this.options.hooks;
741
+ }
742
+ /**
743
+ * Creates an `NormalizedPlugin` from a hook-style plugin and registers
744
+ * its lifecycle handlers on the `AsyncEventEmitter`.
745
+ */
746
+ #normalizePlugin(hookPlugin) {
747
+ const normalizedPlugin = {
748
+ name: hookPlugin.name,
749
+ dependencies: hookPlugin.dependencies,
750
+ options: {
751
+ output: { path: "." },
752
+ exclude: [],
753
+ override: []
754
+ }
755
+ };
756
+ this.registerPluginHooks(hookPlugin, normalizedPlugin);
757
+ return normalizedPlugin;
758
+ }
759
+ /**
760
+ * Registers a hook-style plugin's lifecycle handlers on the shared `AsyncEventEmitter`.
761
+ *
762
+ * For `kubb:plugin:setup`, the registered listener wraps the globally emitted context with a
763
+ * plugin-specific one so that `addGenerator`, `setResolver`, `setTransformer`, and
764
+ * `setRenderer` all target the correct `normalizedPlugin` entry in the plugins map.
765
+ *
766
+ * All other hooks are iterated and registered directly as pass-through listeners.
767
+ * Any event key present in the global `KubbHooks` interface can be subscribed to.
768
+ *
769
+ * External tooling can subscribe to any of these events via `hooks.on(...)` to observe
770
+ * the plugin lifecycle without modifying plugin behavior.
771
+ *
772
+ * @internal
773
+ */
774
+ registerPluginHooks(hookPlugin, normalizedPlugin) {
775
+ const { hooks } = hookPlugin;
776
+ if (hooks["kubb:plugin:setup"]) {
777
+ const setupHandler = (globalCtx) => {
778
+ const pluginCtx = {
779
+ ...globalCtx,
780
+ options: hookPlugin.options ?? {},
781
+ addGenerator: (gen) => {
782
+ this.registerGenerator(normalizedPlugin.name, gen);
783
+ },
784
+ setResolver: (resolver) => {
785
+ this.setPluginResolver(normalizedPlugin.name, resolver);
786
+ },
787
+ setTransformer: (visitor) => {
788
+ normalizedPlugin.transformer = visitor;
789
+ },
790
+ setRenderer: (renderer) => {
791
+ normalizedPlugin.renderer = renderer;
792
+ },
793
+ setOptions: (opts) => {
794
+ normalizedPlugin.options = {
795
+ ...normalizedPlugin.options,
796
+ ...opts
797
+ };
798
+ },
799
+ injectFile: ({ sources = [], ...rest }) => {
800
+ this.fileManager.add((0, _kubb_ast.createFile)({
801
+ imports: [],
802
+ exports: [],
803
+ sources,
804
+ ...rest
805
+ }));
806
+ }
807
+ };
808
+ return hooks["kubb:plugin:setup"](pluginCtx);
809
+ };
810
+ this.hooks.on("kubb:plugin:setup", setupHandler);
811
+ this.#trackHookListener("kubb:plugin:setup", setupHandler);
812
+ }
813
+ for (const [event, handler] of Object.entries(hooks)) {
814
+ if (event === "kubb:plugin:setup" || !handler) continue;
815
+ this.hooks.on(event, handler);
816
+ this.#trackHookListener(event, handler);
817
+ }
818
+ }
819
+ /**
820
+ * Emits the `kubb:plugin:setup` event so that all registered hook-style plugin listeners
821
+ * can configure generators, resolvers, transformers and renderers before `buildStart` runs.
822
+ *
823
+ * Call this once from `safeBuild` before the plugin execution loop begins.
824
+ */
825
+ async emitSetupHooks() {
826
+ const noop = () => {};
827
+ await this.hooks.emit("kubb:plugin:setup", {
828
+ config: this.config,
829
+ options: {},
830
+ addGenerator: noop,
831
+ setResolver: noop,
832
+ setTransformer: noop,
833
+ setRenderer: noop,
834
+ setOptions: noop,
835
+ injectFile: noop,
836
+ updateConfig: noop
837
+ });
838
+ }
839
+ /**
840
+ * Registers a generator for the given plugin on the shared event emitter.
841
+ *
842
+ * The generator's `schema`, `operation`, and `operations` methods are registered as
843
+ * listeners on `kubb:generate:schema`, `kubb:generate:operation`, and `kubb:generate:operations`
844
+ * respectively. Each listener is scoped to the owning plugin via a `ctx.plugin.name` check
845
+ * so that generators from different plugins do not cross-fire.
846
+ *
847
+ * The renderer resolution chain is: `generator.renderer → plugin.renderer → config.renderer`.
848
+ * Set `generator.renderer = null` to explicitly opt out of rendering even when the plugin
849
+ * declares a renderer.
850
+ *
851
+ * Call this method inside `addGenerator()` (in `kubb:plugin:setup`) to wire up a generator.
852
+ */
853
+ registerGenerator(pluginName, gen) {
854
+ const resolveRenderer = () => {
855
+ const plugin = this.plugins.get(pluginName);
856
+ return gen.renderer === null ? void 0 : gen.renderer ?? plugin?.renderer ?? this.config.renderer;
857
+ };
858
+ if (gen.schema) {
859
+ const schemaHandler = async (node, ctx) => {
860
+ if (ctx.plugin.name !== pluginName) return;
861
+ await applyHookResult(await gen.schema(node, ctx), this, resolveRenderer());
862
+ };
863
+ this.hooks.on("kubb:generate:schema", schemaHandler);
864
+ this.#trackHookListener("kubb:generate:schema", schemaHandler);
865
+ }
866
+ if (gen.operation) {
867
+ const operationHandler = async (node, ctx) => {
868
+ if (ctx.plugin.name !== pluginName) return;
869
+ await applyHookResult(await gen.operation(node, ctx), this, resolveRenderer());
870
+ };
871
+ this.hooks.on("kubb:generate:operation", operationHandler);
872
+ this.#trackHookListener("kubb:generate:operation", operationHandler);
873
+ }
874
+ if (gen.operations) {
875
+ const operationsHandler = async (nodes, ctx) => {
876
+ if (ctx.plugin.name !== pluginName) return;
877
+ await applyHookResult(await gen.operations(nodes, ctx), this, resolveRenderer());
878
+ };
879
+ this.hooks.on("kubb:generate:operations", operationsHandler);
880
+ this.#trackHookListener("kubb:generate:operations", operationsHandler);
881
+ }
882
+ this.#pluginsWithEventGenerators.add(pluginName);
883
+ }
884
+ /**
885
+ * Returns `true` when at least one generator was registered for the given plugin
886
+ * via `addGenerator()` in `kubb:plugin:setup` (event-based path).
887
+ *
888
+ * Used by the build loop to decide whether to walk the AST and emit generator events
889
+ * for a plugin that has no static `plugin.generators`.
890
+ */
891
+ hasRegisteredGenerators(pluginName) {
892
+ return this.#pluginsWithEventGenerators.has(pluginName);
893
+ }
894
+ /**
895
+ * Unregisters all plugin lifecycle listeners from the shared event emitter.
896
+ * Called at the end of a build to prevent listener leaks across repeated builds.
897
+ *
898
+ * @internal
899
+ */
900
+ dispose() {
901
+ for (const [event, handlers] of this.#hookListeners) for (const handler of handlers) this.hooks.off(event, handler);
902
+ this.#hookListeners.clear();
903
+ this.#pluginsWithEventGenerators.clear();
904
+ }
905
+ #trackHookListener(event, handler) {
906
+ let handlers = this.#hookListeners.get(event);
907
+ if (!handlers) {
908
+ handlers = /* @__PURE__ */ new Set();
909
+ this.#hookListeners.set(event, handlers);
910
+ }
911
+ handlers.add(handler);
912
+ }
913
+ #createDefaultResolver(pluginName) {
914
+ const existingResolver = this.#defaultResolvers.get(pluginName);
915
+ if (existingResolver) return existingResolver;
916
+ const resolver = defineResolver(() => ({
917
+ name: "default",
918
+ pluginName
919
+ }));
920
+ this.#defaultResolvers.set(pluginName, resolver);
921
+ return resolver;
922
+ }
923
+ /**
924
+ * Merges `partial` with the plugin's default resolver and stores the result.
925
+ * Also mirrors it onto `plugin.resolver` so callers using `getPlugin(name).resolver`
926
+ * get the up-to-date resolver without going through `getResolver()`.
927
+ */
928
+ setPluginResolver(pluginName, partial) {
929
+ const merged = {
930
+ ...this.#createDefaultResolver(pluginName),
931
+ ...partial
932
+ };
933
+ this.#resolvers.set(pluginName, merged);
934
+ const plugin = this.plugins.get(pluginName);
935
+ if (plugin) plugin.resolver = merged;
936
+ }
937
+ getResolver(pluginName) {
938
+ return this.#resolvers.get(pluginName) ?? this.plugins.get(pluginName)?.resolver ?? this.#createDefaultResolver(pluginName);
939
+ }
940
+ getContext(plugin) {
941
+ const driver = this;
942
+ return {
943
+ config: driver.config,
944
+ get root() {
945
+ return (0, node_path.resolve)(driver.config.root, driver.config.output.path);
946
+ },
947
+ getMode(output) {
948
+ return PluginDriver.getMode((0, node_path.resolve)(driver.config.root, driver.config.output.path, output.path));
949
+ },
950
+ hooks: driver.hooks,
951
+ plugin,
952
+ getPlugin: driver.getPlugin.bind(driver),
953
+ requirePlugin: driver.requirePlugin.bind(driver),
954
+ getResolver: driver.getResolver.bind(driver),
955
+ driver,
956
+ addFile: async (...files) => {
957
+ driver.fileManager.add(...files);
958
+ },
959
+ upsertFile: async (...files) => {
960
+ driver.fileManager.upsert(...files);
961
+ },
962
+ get inputNode() {
963
+ return driver.inputNode;
964
+ },
965
+ get adapter() {
966
+ return driver.adapter;
967
+ },
968
+ get resolver() {
969
+ return driver.getResolver(plugin.name);
970
+ },
971
+ get transformer() {
972
+ return plugin.transformer;
973
+ },
974
+ warn(message) {
975
+ driver.hooks.emit("kubb:warn", message);
976
+ },
977
+ error(error) {
978
+ driver.hooks.emit("kubb:error", typeof error === "string" ? new Error(error) : error);
979
+ },
980
+ info(message) {
981
+ driver.hooks.emit("kubb:info", message);
982
+ },
983
+ openInStudio(options) {
984
+ if (!driver.config.devtools || driver.#studioIsOpen) return;
985
+ if (typeof driver.config.devtools !== "object") throw new Error("Devtools must be an object");
986
+ if (!driver.inputNode || !driver.adapter) throw new Error("adapter is not defined, make sure you have set the parser in kubb.config.ts");
987
+ driver.#studioIsOpen = true;
988
+ const studioUrl = driver.config.devtools?.studioUrl ?? "https://studio.kubb.dev";
989
+ return openInStudio(driver.inputNode, studioUrl, options);
990
+ }
991
+ };
992
+ }
993
+ getPlugin(pluginName) {
994
+ return this.plugins.get(pluginName);
995
+ }
996
+ requirePlugin(pluginName) {
997
+ const plugin = this.plugins.get(pluginName);
998
+ if (!plugin) throw new Error(`[kubb] Plugin "${pluginName}" is required but not found. Make sure it is included in your Kubb config.`);
999
+ return plugin;
1000
+ }
1001
+ };
1002
+ //#endregion
1003
+ Object.defineProperty(exports, "BARREL_BASENAME", {
1004
+ enumerable: true,
1005
+ get: function() {
1006
+ return BARREL_BASENAME;
1007
+ }
1008
+ });
1009
+ Object.defineProperty(exports, "BARREL_FILENAME", {
1010
+ enumerable: true,
1011
+ get: function() {
1012
+ return BARREL_FILENAME;
1013
+ }
1014
+ });
1015
+ Object.defineProperty(exports, "DEFAULT_BANNER", {
1016
+ enumerable: true,
1017
+ get: function() {
1018
+ return DEFAULT_BANNER;
1019
+ }
1020
+ });
1021
+ Object.defineProperty(exports, "DEFAULT_EXTENSION", {
1022
+ enumerable: true,
1023
+ get: function() {
1024
+ return DEFAULT_EXTENSION;
1025
+ }
1026
+ });
1027
+ Object.defineProperty(exports, "DEFAULT_STUDIO_URL", {
1028
+ enumerable: true,
1029
+ get: function() {
1030
+ return DEFAULT_STUDIO_URL;
1031
+ }
1032
+ });
1033
+ Object.defineProperty(exports, "FileManager", {
1034
+ enumerable: true,
1035
+ get: function() {
1036
+ return FileManager;
1037
+ }
1038
+ });
1039
+ Object.defineProperty(exports, "PluginDriver", {
1040
+ enumerable: true,
1041
+ get: function() {
1042
+ return PluginDriver;
1043
+ }
1044
+ });
1045
+ Object.defineProperty(exports, "__name", {
1046
+ enumerable: true,
1047
+ get: function() {
1048
+ return __name;
1049
+ }
1050
+ });
1051
+ Object.defineProperty(exports, "__toESM", {
1052
+ enumerable: true,
1053
+ get: function() {
1054
+ return __toESM;
1055
+ }
1056
+ });
1057
+ Object.defineProperty(exports, "applyHookResult", {
1058
+ enumerable: true,
1059
+ get: function() {
1060
+ return applyHookResult;
1061
+ }
1062
+ });
1063
+ Object.defineProperty(exports, "camelCase", {
1064
+ enumerable: true,
1065
+ get: function() {
1066
+ return camelCase;
1067
+ }
1068
+ });
1069
+ Object.defineProperty(exports, "defineResolver", {
1070
+ enumerable: true,
1071
+ get: function() {
1072
+ return defineResolver;
1073
+ }
1074
+ });
1075
+ Object.defineProperty(exports, "logLevel", {
1076
+ enumerable: true,
1077
+ get: function() {
1078
+ return logLevel;
1079
+ }
1080
+ });
1081
+
1082
+ //# sourceMappingURL=PluginDriver-DtwggkXg.cjs.map