@kubb/core 0.37.16 → 0.37.18

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/dist/index.d.ts CHANGED
@@ -177,7 +177,7 @@ declare const clean: (path: string) => Promise<unknown>;
177
177
  declare const getRelativePath: (root?: string | null, file?: string | null) => string;
178
178
  type PathMode = 'file' | 'directory';
179
179
  declare const getPathMode: (path: string | undefined | null) => PathMode | undefined;
180
- declare const read: (path: string) => Promise<Buffer>;
180
+ declare const read: (path: string) => Promise<string>;
181
181
 
182
182
  /**
183
183
  * @deprecated Use userFile instead
@@ -247,7 +247,7 @@ declare class FileManager {
247
247
  get(id: UUID): File | undefined;
248
248
  remove(id: UUID): void;
249
249
  write(...params: Parameters<typeof write>): Promise<void>;
250
- read(...params: Parameters<typeof read>): Promise<Buffer>;
250
+ read(...params: Parameters<typeof read>): Promise<string>;
251
251
  }
252
252
 
253
253
  declare class TreeNode<T = unknown> {
@@ -309,6 +309,7 @@ type Options = {
309
309
  load: PluginContext['load'];
310
310
  };
311
311
  type CorePluginOptions = PluginFactoryOptions<Options, false, PluginContext>;
312
+ declare const name: "core";
312
313
 
313
314
  /**
314
315
  * Get the type of the first argument in a function.
@@ -375,4 +376,4 @@ declare abstract class SchemaGenerator<TOptions extends object, TInput, TOutput>
375
376
  abstract build(schema: TInput, name: string, description?: string): TOutput;
376
377
  }
377
378
 
378
- export { Argument0, CLIOptions, Cache, CacheStore, CorePluginOptions, EmittedFile, File, FileManager, FileName, Generator, KubbBuild, KubbConfig, KubbJSONPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OptionalPath, Path, PathMode, PluginContext, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, ResolveIdParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, UUID, ValidationPluginError, build, clean, createPlugin, createPluginCache, build as default, defineConfig, getPathMode, getRelativePath, hooks, isPromise, read, validatePlugins, write };
379
+ export { Argument0, CLIOptions, Cache, CacheStore, CorePluginOptions, EmittedFile, File, FileManager, FileName, Generator, KubbBuild, KubbConfig, KubbJSONPlugin, KubbPlugin, KubbPluginKind, KubbUserConfig, LogLevel, LogType, Logger, MaybePromise, OptionalPath, Path, PathMode, PluginContext, PluginFactoryOptions, PluginLifecycle, PluginLifecycleHooks, PluginManager, ResolveIdParams, SchemaGenerator, Status, Strategy, TransformResult, TreeNode, UUID, ValidationPluginError, build, clean, createPlugin, createPluginCache, build as default, defineConfig, getPathMode, getRelativePath, hooks, isPromise, name, read, validatePlugins, write };
@@ -1,4 +1,4 @@
1
- (function (exports) {
1
+ var kubb = (function (exports) {
2
2
  'use strict';
3
3
 
4
4
  var __create = Object.create;
@@ -15681,7 +15681,7 @@
15681
15681
  };
15682
15682
  var read = async (path) => {
15683
15683
  try {
15684
- return import_fs2.promises.readFile(path);
15684
+ return import_fs2.promises.readFile(path, { encoding: "utf8" });
15685
15685
  } catch (err) {
15686
15686
  console.error(err);
15687
15687
  throw err;
@@ -16211,6 +16211,7 @@ ${file.source}`
16211
16211
  };
16212
16212
 
16213
16213
  // src/build.ts
16214
+ var import_path4 = __toESM(require_path_browserify());
16214
16215
  async function transformReducer(_previousCode, result, _plugin) {
16215
16216
  if (result === null) {
16216
16217
  return null;
@@ -16252,6 +16253,11 @@ ${file.source}`
16252
16253
  }
16253
16254
  });
16254
16255
  await pluginManager.hookParallel("buildStart", [config]);
16256
+ pluginManager.fileManager.add({
16257
+ path: typeof config.input === "string" ? "input" : import_path4.default.resolve(config.root, config.input.path),
16258
+ fileName: typeof config.input === "string" ? "input" : config.input.path,
16259
+ source: typeof config.input === "string" ? config.input : await read(import_path4.default.resolve(config.root, config.input.path))
16260
+ });
16255
16261
  }
16256
16262
  function build(options) {
16257
16263
  return new Promise((resolve, reject) => {
@@ -16325,6 +16331,7 @@ ${file.source}`
16325
16331
  exports.getRelativePath = getRelativePath;
16326
16332
  exports.hooks = hooks;
16327
16333
  exports.isPromise = isPromise;
16334
+ exports.name = name;
16328
16335
  exports.read = read;
16329
16336
  exports.validatePlugins = validatePlugins;
16330
16337
  exports.write = write;