@kubb/core 0.42.0 → 0.42.1

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
@@ -230,20 +230,10 @@ declare class FileManager {
230
230
  private getCache;
231
231
  private getCacheByPath;
232
232
  private getCountByStatus;
233
- private getSource;
233
+ getSource(file: File): string;
234
234
  get files(): File[];
235
235
  add(file: File): Promise<File>;
236
236
  addOrAppend(file: File): Promise<File>;
237
- build(file: File): {
238
- source: string;
239
- fileName: string;
240
- path: string;
241
- imports?: {
242
- name: string | string[];
243
- path: string;
244
- type?: boolean | undefined;
245
- }[] | undefined;
246
- };
247
237
  combine(files: Array<File | null>): File[];
248
238
  setStatus(id: UUID, status: Status): void;
249
239
  get(id: UUID): File | undefined;
@@ -17263,12 +17263,6 @@ ${file.source}`,
17263
17263
  }
17264
17264
  return this.add(file);
17265
17265
  }
17266
- build(file) {
17267
- return {
17268
- ...file,
17269
- source: this.getSource(file)
17270
- };
17271
- }
17272
17266
  combine(files) {
17273
17267
  return files.filter(Boolean).reduce((acc, curr) => {
17274
17268
  const prevIndex = acc.findIndex((item) => item.path === curr.path);
@@ -17612,12 +17606,12 @@ ${curr.source}`,
17612
17606
  fileManager.events.onSuccess(async () => {
17613
17607
  await pluginManager.hookParallel("buildEnd");
17614
17608
  setTimeout(() => {
17615
- done({ files: fileManager.files.map((file) => fileManager.build(file)) });
17609
+ done({ files: fileManager.files.map((file) => ({ ...file, source: fileManager.getSource(file) })) });
17616
17610
  }, 1e3);
17617
17611
  });
17618
17612
  fileManager.events.onAdd(async (id, file) => {
17619
17613
  const { path } = file;
17620
- let { source: code } = fileManager.build(file);
17614
+ let code = fileManager.getSource(file);
17621
17615
  const loadedResult = await pluginManager.hookFirst("load", [path]);
17622
17616
  if (loadedResult) {
17623
17617
  code = loadedResult;