@kubb/react-fabric 0.5.4 → 0.6.0

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 (47) hide show
  1. package/README.md +21 -24
  2. package/dist/{Fabric-C7RMr4BK.d.ts → Fabric-CW62g3zB.d.ts} +113 -22
  3. package/dist/{Fabric-CStIaz99.d.cts → Fabric-CbgH_1H3.d.cts} +113 -22
  4. package/dist/globals.d.cts +2 -2
  5. package/dist/globals.d.ts +2 -2
  6. package/dist/index.cjs +3 -3
  7. package/dist/index.d.cts +10 -24
  8. package/dist/index.d.ts +10 -24
  9. package/dist/index.js +3 -3
  10. package/dist/jsx-dev-runtime.cjs +4 -4
  11. package/dist/jsx-dev-runtime.cjs.map +1 -1
  12. package/dist/jsx-dev-runtime.d.cts +5 -5
  13. package/dist/jsx-dev-runtime.d.ts +5 -5
  14. package/dist/jsx-dev-runtime.js +4 -4
  15. package/dist/jsx-dev-runtime.js.map +1 -1
  16. package/dist/{jsx-namespace-DLxNuglH.d.cts → jsx-namespace-B2a_dVTm.d.cts} +2 -2
  17. package/dist/{jsx-namespace-BLxjMbms.d.ts → jsx-namespace-DsvCR0v-.d.ts} +2 -2
  18. package/dist/{jsx-runtime-rr0rZsW1.cjs → jsx-runtime-DqTOrEsT.cjs} +5 -5
  19. package/dist/{jsx-runtime-rr0rZsW1.cjs.map → jsx-runtime-DqTOrEsT.cjs.map} +1 -1
  20. package/dist/{jsx-runtime-CG-6bzfH.js → jsx-runtime-zJCtyvtC.js} +5 -5
  21. package/dist/{jsx-runtime-CG-6bzfH.js.map → jsx-runtime-zJCtyvtC.js.map} +1 -1
  22. package/dist/jsx-runtime.cjs +2 -2
  23. package/dist/jsx-runtime.d.cts +5 -5
  24. package/dist/jsx-runtime.d.ts +5 -5
  25. package/dist/jsx-runtime.js +2 -2
  26. package/dist/parsers.d.cts +5 -5
  27. package/dist/parsers.d.ts +5 -5
  28. package/dist/plugins.cjs +3 -3
  29. package/dist/plugins.d.cts +5 -5
  30. package/dist/plugins.d.ts +5 -5
  31. package/dist/plugins.js +3 -3
  32. package/dist/{react-DIj83RKM.js → react-B97TdWcV.js} +6 -6
  33. package/dist/{react-DIj83RKM.js.map → react-B97TdWcV.js.map} +1 -1
  34. package/dist/{react-7XRHSAt0.cjs → react-D_EYlsv-.cjs} +6 -6
  35. package/dist/{react-7XRHSAt0.cjs.map → react-D_EYlsv-.cjs.map} +1 -1
  36. package/dist/{reactPlugin-Botk9gkY.cjs → reactPlugin-CpRWhf6R.cjs} +13 -13
  37. package/dist/{reactPlugin-Botk9gkY.cjs.map → reactPlugin-CpRWhf6R.cjs.map} +1 -1
  38. package/dist/{reactPlugin-DajNNKBt.d.cts → reactPlugin-DWhl3kTD.d.cts} +2 -2
  39. package/dist/{reactPlugin-CjfIGdZW.js → reactPlugin-PG1kqZRe.js} +14 -14
  40. package/dist/{reactPlugin-CjfIGdZW.js.map → reactPlugin-PG1kqZRe.js.map} +1 -1
  41. package/dist/{reactPlugin-TmG3R6xY.d.ts → reactPlugin-yet1vypn.d.ts} +2 -2
  42. package/dist/{types-KXnjAqUg.d.ts → types-BB0-ElWk.d.ts} +2 -2
  43. package/dist/{types-BZlZnQLJ.d.cts → types-DM7YVFCN.d.cts} +2 -2
  44. package/dist/types.d.cts +2 -2
  45. package/dist/types.d.ts +2 -2
  46. package/package.json +3 -3
  47. package/src/plugins/reactPlugin.ts +5 -5
package/README.md CHANGED
@@ -82,26 +82,23 @@ Returns a Fabric instance with:
82
82
  - `fabric.files` — getter with all queued files.
83
83
  - `fabric.context` — internal context holding events, options, FileManager, installed plugins/parsers.
84
84
 
85
- ### `defineFabric(instance?): () => Fabric`
86
- Factory to create your own `createFabric` with an optional bootstrap `instance(fabric)` called on creation.
87
-
88
85
  ### Events (emitted by the core during processing)
89
- - `start`
90
- - `end`
91
- - `render { fabric }`
92
- - `file:add { files }`
93
- - `write:start { files }`
94
- - `write:end { files }`
95
- - `file:start { file, index, total }`
96
- - `file:end { file, index, total }`
97
- - `process:start { files }`
98
- - `process:progress { file, source, processed, percentage, total }`
99
- - `process:end { files }`
86
+ - `lifecycle:start`
87
+ - `lifecycle:end`
88
+ - `lifecycle:render { fabric }`
89
+ - `files:added { files }`
90
+ - `files:writing:start { files }`
91
+ - `files:writing:end { files }`
92
+ - `file:processing:start { file, index, total }`
93
+ - `file:processing:end { file, index, total }`
94
+ - `files:processing:start { files }`
95
+ - `files:processing:update { file, source, processed, percentage, total }`
96
+ - `files:processing:end { files }`
100
97
 
101
98
 
102
99
  ## Plugins
103
100
  #### `fsPlugin`
104
- Writes files to disk on `process:progress`, supports dry runs and cleaning an output folder before writing.
101
+ Writes files to disk on `files:processing:update`, supports dry runs and cleaning an output folder before writing.
105
102
 
106
103
  ```
107
104
  import { fsPlugin } from '@kubb/fabric-core/plugins'
@@ -110,7 +107,7 @@ import { fsPlugin } from '@kubb/fabric-core/plugins'
110
107
  | Option | Type | Default | Description |
111
108
  |---|----------------------------------------------------------------------|---|-----------------------------------------------------------------------|
112
109
  | dryRun | `boolean` | `false` | If true, do not write files to disk. |
113
- | onBeforeWrite | `(path: string, data: string \| undefined) => void \| Promise<void>` | — | Called right before each file write on `process:progress`. |
110
+ | onBeforeWrite | `(path: string, data: string \| undefined) => void \| Promise<void>` | — | Called right before each file write on `files:processing:update`. |
114
111
  | clean | `{ path: string }` | — | If provided, removes the directory at `path` before writing any files. |
115
112
 
116
113
  Injected `fabric.write` options (via `fsPlugin`):
@@ -120,7 +117,7 @@ Injected `fabric.write` options (via `fsPlugin`):
120
117
  | extension | `Record<Extname, Extname \| ''>` | — | Maps input file extensions to output extensions. When set, the matching parser (by extNames) is used. |
121
118
 
122
119
  #### `barrelPlugin`
123
- Generates `index.ts` barrel files per folder at `process:end`. `writeEntry` creates a single entry barrel at `root`.
120
+ Generates `index.ts` barrel files per folder when `files:writing:start` is triggered. `writeEntry` creates a single entry barrel at `root`.
124
121
 
125
122
  ```
126
123
  import { barrelPlugin } from '@kubb/fabric-core/plugins'
@@ -190,7 +187,7 @@ Injected methods (via `reactPlugin`):
190
187
  | `renderToString` | `(App: React.ElementType) => Promise<string> \| string` | Render a React component tree and return the final output as a string (without writing to stdout). |
191
188
  | `waitUntilExit` | `() => Promise<void>` | Wait until the rendered app exits, resolves when unmounted and emits the core `end` event. |
192
189
 
193
- #### `createPlugin`
190
+ #### `definePlugin`
194
191
 
195
192
  Factory to declare a plugin that can be registered via `fabric.use`.
196
193
 
@@ -204,12 +201,12 @@ Example:
204
201
 
205
202
  ```ts
206
203
  import { createFabric } from '@kubb/fabric-core'
207
- import { createPlugin } from '@kubb/fabric-core/plugins'
204
+ import { definePlugin } from '@kubb/fabric-core/plugins'
208
205
 
209
- const helloPlugin = createPlugin<{ name?: string }, { sayHello: (msg?: string) => void }>({
206
+ const helloPlugin = definePlugin<{ name?: string }, { sayHello: (msg?: string) => void }>({
210
207
  name: 'helloPlugin',
211
208
  install(fabric, options) {
212
- fabric.context.events.on('start', () => {
209
+ fabric.context.events.on('lifecycle:start', () => {
213
210
  console.log('Fabric started')
214
211
  })
215
212
  },
@@ -266,7 +263,7 @@ import { defaultParser } @kubb/fabric-core/parsers`
266
263
  |---|---|---|--------------------------------------------------------------------------|
267
264
  | file | `KubbFile.File` | -| File that will be used to be parsed. |
268
265
 
269
- #### `createParser`
266
+ #### `defineParser`
270
267
  Factory to declare a parser that can be registered via `fabric.use` and selected by `extNames` during `fabirc.write`.
271
268
 
272
269
  | Field | Required | Description |
@@ -280,9 +277,9 @@ Example:
280
277
 
281
278
  ```ts
282
279
  import { createFabric } from '@kubb/fabric-core'
283
- import { createParser } from '@kubb/fabric-core/parsers'
280
+ import { defineParser } from '@kubb/fabric-core/parsers'
284
281
 
285
- const vueParser = createParser<{ banner?: string }>({
282
+ const vueParser = defineParser<{ banner?: string }>({
286
283
  name: 'vueParser',
287
284
  extNames: ['.vue'],
288
285
  async install(fabric, options) {
@@ -251,63 +251,154 @@ interface FabricOptions {
251
251
  type FabricMode = 'sequential' | 'parallel';
252
252
  /**
253
253
  * Event definitions emitted during the Fabric lifecycle.
254
+ *
255
+ * These events allow plugins and external code to hook into different stages
256
+ * of the file generation process. All events are asynchronous and can be
257
+ * listened to using `fabric.context.on()` or `fabric.context.onOnce()`.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * fabric.context.on('lifecycle:start', async () => {
262
+ * console.log('Fabric started!')
263
+ * })
264
+ * ```
254
265
  */
255
266
  interface FabricEvents {
256
- /** Called at the beginning of the app lifecycle. */
257
- start: [];
258
- /** Called at the end of the app lifecycle. */
259
- end: [];
260
- /** Called when Fabric is rendering. */
261
- render: [{
267
+ /**
268
+ * Emitted when the Fabric application lifecycle begins.
269
+ * This is typically the first event fired when starting a Fabric run.
270
+ * Use this to perform initial setup or logging.
271
+ */
272
+ 'lifecycle:start': [];
273
+ /**
274
+ * Emitted when the Fabric application lifecycle completes.
275
+ * This is typically the last event fired after all processing is done.
276
+ * Use this for cleanup tasks or final reporting.
277
+ */
278
+ 'lifecycle:end': [];
279
+ /**
280
+ * Emitted when Fabric starts rendering (used with reactPlugin).
281
+ * Provides access to the Fabric instance for render-time operations.
282
+ *
283
+ * @property fabric - The current Fabric instance being rendered
284
+ */
285
+ 'lifecycle:render': [{
262
286
  fabric: Fabric;
263
287
  }];
264
- /** Called once before any files are processed. */
265
- 'process:start': [{
288
+ /**
289
+ * Emitted once before file processing begins.
290
+ * Provides the complete list of files that will be processed.
291
+ * Use this to prepare for batch operations or display initial file counts.
292
+ *
293
+ * @property files - Array of all files queued for processing
294
+ */
295
+ 'files:processing:start': [{
266
296
  files: ResolvedFile[];
267
297
  }];
268
298
  /**
269
- * Called when FileManager is adding files to its cache
299
+ * Emitted when files are successfully added to the FileManager's internal cache.
300
+ * This happens after files pass through path and name resolution.
301
+ * Use this to track which files have been registered.
302
+ *
303
+ * @property files - Array of files that were just added to the cache
270
304
  */
271
- 'file:add': [{
305
+ 'files:added': [{
272
306
  files: ResolvedFile[];
273
307
  }];
308
+ /**
309
+ * Emitted during file path resolution, before a file is cached.
310
+ * Listeners can modify the file's path property to customize output location.
311
+ * This is called for each file being added via `addFile()` or `upsertFile()`.
312
+ *
313
+ * @property file - The file whose path is being resolved (mutable)
314
+ */
274
315
  'file:resolve:path': [{
275
316
  file: File;
276
317
  }];
318
+ /**
319
+ * Emitted during file name resolution, before a file is cached.
320
+ * Listeners can modify the file's name-related properties to customize naming.
321
+ * This is called for each file being added via `addFile()` or `upsertFile()`.
322
+ *
323
+ * @property file - The file whose name is being resolved (mutable)
324
+ */
277
325
  'file:resolve:name': [{
278
326
  file: File;
279
327
  }];
280
- 'write:start': [{
328
+ /**
329
+ * Emitted just before files are written to disk.
330
+ * Provides all files that will be written in this batch.
331
+ * Use this to perform pre-write operations like creating directories.
332
+ *
333
+ * @property files - Array of files about to be written to disk
334
+ */
335
+ 'files:writing:start': [{
281
336
  files: ResolvedFile[];
282
337
  }];
283
- 'write:end': [{
338
+ /**
339
+ * Emitted after all files have been successfully written to disk.
340
+ * Provides all files that were written in this batch.
341
+ * Use this for post-write operations like running formatters or reporting.
342
+ *
343
+ * @property files - Array of files that were written to disk
344
+ */
345
+ 'files:writing:end': [{
284
346
  files: ResolvedFile[];
285
347
  }];
286
- /** Called for each file when processing begins. */
287
- 'file:start': [{
348
+ /**
349
+ * Emitted when an individual file starts being processed.
350
+ * This happens for each file in the queue, before parsing.
351
+ * Use this for per-file setup or detailed logging.
352
+ *
353
+ * @property file - The file starting processing
354
+ * @property index - Zero-based position of this file in the queue
355
+ * @property total - Total number of files to process
356
+ */
357
+ 'file:processing:start': [{
288
358
  file: ResolvedFile;
289
359
  index: number;
290
360
  total: number;
291
361
  }];
292
- /** Called for each file when processing completes. */
293
- 'file:end': [{
362
+ /**
363
+ * Emitted when an individual file completes processing.
364
+ * This happens after the file has been parsed and handled.
365
+ * Use this for per-file cleanup or progress tracking.
366
+ *
367
+ * @property file - The file that finished processing
368
+ * @property index - Zero-based position of this file in the queue
369
+ * @property total - Total number of files to process
370
+ */
371
+ 'file:processing:end': [{
294
372
  file: ResolvedFile;
295
373
  index: number;
296
374
  total: number;
297
375
  }];
298
376
  /**
299
- * Called periodically (or per file) to indicate progress.
300
- * Useful for progress bars or logging.
377
+ * Emitted after each file is processed, providing progress metrics.
378
+ * This is the primary event for implementing progress bars or tracking.
379
+ * Plugins like fsPlugin use this to write files to disk.
380
+ *
381
+ * @property processed - Number of files processed so far
382
+ * @property total - Total number of files to process
383
+ * @property percentage - Completion percentage (0-100)
384
+ * @property source - Optional parsed source code of the file
385
+ * @property file - The file that was just processed
301
386
  */
302
- 'process:progress': [{
387
+ 'file:processing:update': [{
303
388
  processed: number;
304
389
  total: number;
305
390
  percentage: number;
306
391
  source?: string;
307
392
  file: ResolvedFile;
308
393
  }];
309
- /** Called once all files have been processed successfully. */
310
- 'process:end': [{
394
+ /**
395
+ * Emitted once all files have been successfully processed.
396
+ * This marks the completion of the processing phase.
397
+ * Use this to perform batch operations on all processed files.
398
+ *
399
+ * @property files - Array of all files that were processed
400
+ */
401
+ 'files:processing:end': [{
311
402
  files: ResolvedFile[];
312
403
  }];
313
404
  }
@@ -372,4 +463,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
372
463
  }
373
464
  //#endregion
374
465
  export { KubbFile_d_exports as _, FabricOptions as a, Source as b, FileManager as c, UserParser as d, BaseName as f, Import as g, File as h, FabricMode as i, FileProcessor as l, Extname as m, FabricConfig as n, Plugin as o, Export as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u, Path as v, ResolvedFile as y };
375
- //# sourceMappingURL=Fabric-C7RMr4BK.d.ts.map
466
+ //# sourceMappingURL=Fabric-CW62g3zB.d.ts.map
@@ -251,63 +251,154 @@ interface FabricOptions {
251
251
  type FabricMode = 'sequential' | 'parallel';
252
252
  /**
253
253
  * Event definitions emitted during the Fabric lifecycle.
254
+ *
255
+ * These events allow plugins and external code to hook into different stages
256
+ * of the file generation process. All events are asynchronous and can be
257
+ * listened to using `fabric.context.on()` or `fabric.context.onOnce()`.
258
+ *
259
+ * @example
260
+ * ```ts
261
+ * fabric.context.on('lifecycle:start', async () => {
262
+ * console.log('Fabric started!')
263
+ * })
264
+ * ```
254
265
  */
255
266
  interface FabricEvents {
256
- /** Called at the beginning of the app lifecycle. */
257
- start: [];
258
- /** Called at the end of the app lifecycle. */
259
- end: [];
260
- /** Called when Fabric is rendering. */
261
- render: [{
267
+ /**
268
+ * Emitted when the Fabric application lifecycle begins.
269
+ * This is typically the first event fired when starting a Fabric run.
270
+ * Use this to perform initial setup or logging.
271
+ */
272
+ 'lifecycle:start': [];
273
+ /**
274
+ * Emitted when the Fabric application lifecycle completes.
275
+ * This is typically the last event fired after all processing is done.
276
+ * Use this for cleanup tasks or final reporting.
277
+ */
278
+ 'lifecycle:end': [];
279
+ /**
280
+ * Emitted when Fabric starts rendering (used with reactPlugin).
281
+ * Provides access to the Fabric instance for render-time operations.
282
+ *
283
+ * @property fabric - The current Fabric instance being rendered
284
+ */
285
+ 'lifecycle:render': [{
262
286
  fabric: Fabric;
263
287
  }];
264
- /** Called once before any files are processed. */
265
- 'process:start': [{
288
+ /**
289
+ * Emitted once before file processing begins.
290
+ * Provides the complete list of files that will be processed.
291
+ * Use this to prepare for batch operations or display initial file counts.
292
+ *
293
+ * @property files - Array of all files queued for processing
294
+ */
295
+ 'files:processing:start': [{
266
296
  files: ResolvedFile[];
267
297
  }];
268
298
  /**
269
- * Called when FileManager is adding files to its cache
299
+ * Emitted when files are successfully added to the FileManager's internal cache.
300
+ * This happens after files pass through path and name resolution.
301
+ * Use this to track which files have been registered.
302
+ *
303
+ * @property files - Array of files that were just added to the cache
270
304
  */
271
- 'file:add': [{
305
+ 'files:added': [{
272
306
  files: ResolvedFile[];
273
307
  }];
308
+ /**
309
+ * Emitted during file path resolution, before a file is cached.
310
+ * Listeners can modify the file's path property to customize output location.
311
+ * This is called for each file being added via `addFile()` or `upsertFile()`.
312
+ *
313
+ * @property file - The file whose path is being resolved (mutable)
314
+ */
274
315
  'file:resolve:path': [{
275
316
  file: File;
276
317
  }];
318
+ /**
319
+ * Emitted during file name resolution, before a file is cached.
320
+ * Listeners can modify the file's name-related properties to customize naming.
321
+ * This is called for each file being added via `addFile()` or `upsertFile()`.
322
+ *
323
+ * @property file - The file whose name is being resolved (mutable)
324
+ */
277
325
  'file:resolve:name': [{
278
326
  file: File;
279
327
  }];
280
- 'write:start': [{
328
+ /**
329
+ * Emitted just before files are written to disk.
330
+ * Provides all files that will be written in this batch.
331
+ * Use this to perform pre-write operations like creating directories.
332
+ *
333
+ * @property files - Array of files about to be written to disk
334
+ */
335
+ 'files:writing:start': [{
281
336
  files: ResolvedFile[];
282
337
  }];
283
- 'write:end': [{
338
+ /**
339
+ * Emitted after all files have been successfully written to disk.
340
+ * Provides all files that were written in this batch.
341
+ * Use this for post-write operations like running formatters or reporting.
342
+ *
343
+ * @property files - Array of files that were written to disk
344
+ */
345
+ 'files:writing:end': [{
284
346
  files: ResolvedFile[];
285
347
  }];
286
- /** Called for each file when processing begins. */
287
- 'file:start': [{
348
+ /**
349
+ * Emitted when an individual file starts being processed.
350
+ * This happens for each file in the queue, before parsing.
351
+ * Use this for per-file setup or detailed logging.
352
+ *
353
+ * @property file - The file starting processing
354
+ * @property index - Zero-based position of this file in the queue
355
+ * @property total - Total number of files to process
356
+ */
357
+ 'file:processing:start': [{
288
358
  file: ResolvedFile;
289
359
  index: number;
290
360
  total: number;
291
361
  }];
292
- /** Called for each file when processing completes. */
293
- 'file:end': [{
362
+ /**
363
+ * Emitted when an individual file completes processing.
364
+ * This happens after the file has been parsed and handled.
365
+ * Use this for per-file cleanup or progress tracking.
366
+ *
367
+ * @property file - The file that finished processing
368
+ * @property index - Zero-based position of this file in the queue
369
+ * @property total - Total number of files to process
370
+ */
371
+ 'file:processing:end': [{
294
372
  file: ResolvedFile;
295
373
  index: number;
296
374
  total: number;
297
375
  }];
298
376
  /**
299
- * Called periodically (or per file) to indicate progress.
300
- * Useful for progress bars or logging.
377
+ * Emitted after each file is processed, providing progress metrics.
378
+ * This is the primary event for implementing progress bars or tracking.
379
+ * Plugins like fsPlugin use this to write files to disk.
380
+ *
381
+ * @property processed - Number of files processed so far
382
+ * @property total - Total number of files to process
383
+ * @property percentage - Completion percentage (0-100)
384
+ * @property source - Optional parsed source code of the file
385
+ * @property file - The file that was just processed
301
386
  */
302
- 'process:progress': [{
387
+ 'file:processing:update': [{
303
388
  processed: number;
304
389
  total: number;
305
390
  percentage: number;
306
391
  source?: string;
307
392
  file: ResolvedFile;
308
393
  }];
309
- /** Called once all files have been processed successfully. */
310
- 'process:end': [{
394
+ /**
395
+ * Emitted once all files have been successfully processed.
396
+ * This marks the completion of the processing phase.
397
+ * Use this to perform batch operations on all processed files.
398
+ *
399
+ * @property files - Array of all files that were processed
400
+ */
401
+ 'files:processing:end': [{
311
402
  files: ResolvedFile[];
312
403
  }];
313
404
  }
@@ -372,4 +463,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
372
463
  }
373
464
  //#endregion
374
465
  export { KubbFile_d_exports as _, FabricOptions as a, Source as b, FileManager as c, UserParser as d, BaseName as f, Import as g, File as h, FabricMode as i, FileProcessor as l, Extname as m, FabricConfig as n, Plugin as o, Export as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u, Path as v, ResolvedFile as y };
375
- //# sourceMappingURL=Fabric-CStIaz99.d.cts.map
466
+ //# sourceMappingURL=Fabric-CbgH_1H3.d.cts.map
@@ -1,5 +1,5 @@
1
- import "./Fabric-CStIaz99.cjs";
2
- import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-BZlZnQLJ.cjs";
1
+ import "./Fabric-CbgH_1H3.cjs";
2
+ import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-DM7YVFCN.cjs";
3
3
  import React from "react";
4
4
 
5
5
  //#region src/globals.d.ts
package/dist/globals.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import "./Fabric-C7RMr4BK.js";
2
- import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-KXnjAqUg.js";
1
+ import "./Fabric-CW62g3zB.js";
2
+ import { c as KubbExportProps, d as KubbNode, f as KubbSourceProps, l as KubbFileProps, m as LineBreakProps, p as KubbTextProps, s as KubbElement, u as KubbImportProps } from "./types-BB0-ElWk.js";
3
3
  import React from "react";
4
4
 
5
5
  //#region src/globals.d.ts
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-BrXtsOCC.cjs');
2
- const require_react$1 = require('./react-7XRHSAt0.cjs');
3
- const require_reactPlugin = require('./reactPlugin-Botk9gkY.cjs');
4
- const require_jsx_runtime = require('./jsx-runtime-rr0rZsW1.cjs');
2
+ const require_react$1 = require('./react-D_EYlsv-.cjs');
3
+ const require_reactPlugin = require('./reactPlugin-CpRWhf6R.cjs');
4
+ const require_jsx_runtime = require('./jsx-runtime-DqTOrEsT.cjs');
5
5
  const require_devtools = require('./devtools-CRkwwngz.cjs');
6
6
  let __kubb_fabric_core = require("@kubb/fabric-core");
7
7
  let dedent = require("dedent");
package/dist/index.d.cts CHANGED
@@ -1,33 +1,19 @@
1
- import { a as FabricOptions, b as Source, c as FileManager, f as BaseName, g as Import, h as File$1, i as FabricMode, l as FileProcessor, n as FabricConfig, p as Export, t as Fabric, v as Path, y as ResolvedFile } from "./Fabric-CStIaz99.cjs";
2
- import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-BZlZnQLJ.cjs";
3
- import { t as Options$1 } from "./reactPlugin-DajNNKBt.cjs";
1
+ import { a as FabricOptions, b as Source, c as FileManager, f as BaseName, g as Import, h as File$1, i as FabricMode, l as FileProcessor, n as FabricConfig, p as Export, t as Fabric, v as Path, y as ResolvedFile } from "./Fabric-CbgH_1H3.cjs";
2
+ import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-DM7YVFCN.cjs";
3
+ import { t as Options$1 } from "./reactPlugin-DWhl3kTD.cjs";
4
4
  import * as react3 from "react";
5
5
  import React, { ReactNode } from "react";
6
6
 
7
- //#region ../fabric-core/src/defineFabric.d.ts
8
- /**
9
- * Function that initializes the root Fabric instance.
10
- *
11
- * Used for setting up plugins, parsers, or performing side effects
12
- * once the Fabric context is ready.
13
- */
14
- type FabricInitializer<T extends FabricOptions> = (fabric: Fabric<T>) => void | Promise<void>;
15
- /**
16
- * A function returned by {@link defineFabric} that creates a Fabric instance.
17
- */
18
- type CreateFabric<T extends FabricOptions> = (config?: FabricConfig<T>) => Fabric<T>;
7
+ //#region ../fabric-core/src/createFabric.d.ts
8
+
19
9
  /**
20
- * Defines a new Fabric factory function.
10
+ * Creates a new Fabric instance
21
11
  *
22
12
  * @example
23
- * export const createFabric = defineFabric((fabric) => {
24
- * fabric.use(myPlugin())
25
- * })
13
+ * const fabric = createFabric()
14
+ * fabric.use(myPlugin())
26
15
  */
27
- declare function defineFabric<T extends FabricOptions>(init?: FabricInitializer<T>): CreateFabric<T>;
28
- //#endregion
29
- //#region ../fabric-core/src/createFabric.d.ts
30
- declare const createFabric: CreateFabric<FabricOptions>;
16
+ declare function createFabric<T extends FabricOptions>(config?: FabricConfig<T>): Fabric<T>;
31
17
  //#endregion
32
18
  //#region ../fabric-core/src/createFile.d.ts
33
19
  /**
@@ -369,5 +355,5 @@ declare const useEffect: typeof react3.useEffect;
369
355
  declare const useReducer: typeof react3.useReducer;
370
356
  declare const useRef: typeof react3.useRef;
371
357
  //#endregion
372
- export { App, Const, type Fabric, File, FileManager, FileProcessor, Fragment, Function, FunctionParams, Indent, Runtime, Type, createContext, createElement, createFabric, createFile, createFunctionParams, createReactFabric, defineFabric, use, useApp, useContext, useEffect, useFile, useLifecycle, useReducer, useRef, useState };
358
+ export { App, Const, type Fabric, File, FileManager, FileProcessor, Fragment, Function, FunctionParams, Indent, Runtime, Type, createContext, createElement, createFabric, createFile, createFunctionParams, createReactFabric, use, useApp, useContext, useEffect, useFile, useLifecycle, useReducer, useRef, useState };
373
359
  //# sourceMappingURL=index.d.cts.map
package/dist/index.d.ts CHANGED
@@ -1,33 +1,19 @@
1
- import { a as FabricOptions, b as Source, c as FileManager, f as BaseName, g as Import, h as File$1, i as FabricMode, l as FileProcessor, n as FabricConfig, p as Export, t as Fabric, v as Path, y as ResolvedFile } from "./Fabric-C7RMr4BK.js";
2
- import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-KXnjAqUg.js";
3
- import { t as Options$1 } from "./reactPlugin-TmG3R6xY.js";
1
+ import { a as FabricOptions, b as Source, c as FileManager, f as BaseName, g as Import, h as File$1, i as FabricMode, l as FileProcessor, n as FabricConfig, p as Export, t as Fabric, v as Path, y as ResolvedFile } from "./Fabric-CW62g3zB.js";
2
+ import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-BB0-ElWk.js";
3
+ import { t as Options$1 } from "./reactPlugin-yet1vypn.js";
4
4
  import * as react3 from "react";
5
5
  import React, { ReactNode } from "react";
6
6
 
7
- //#region ../fabric-core/src/defineFabric.d.ts
8
- /**
9
- * Function that initializes the root Fabric instance.
10
- *
11
- * Used for setting up plugins, parsers, or performing side effects
12
- * once the Fabric context is ready.
13
- */
14
- type FabricInitializer<T extends FabricOptions> = (fabric: Fabric<T>) => void | Promise<void>;
15
- /**
16
- * A function returned by {@link defineFabric} that creates a Fabric instance.
17
- */
18
- type CreateFabric<T extends FabricOptions> = (config?: FabricConfig<T>) => Fabric<T>;
7
+ //#region ../fabric-core/src/createFabric.d.ts
8
+
19
9
  /**
20
- * Defines a new Fabric factory function.
10
+ * Creates a new Fabric instance
21
11
  *
22
12
  * @example
23
- * export const createFabric = defineFabric((fabric) => {
24
- * fabric.use(myPlugin())
25
- * })
13
+ * const fabric = createFabric()
14
+ * fabric.use(myPlugin())
26
15
  */
27
- declare function defineFabric<T extends FabricOptions>(init?: FabricInitializer<T>): CreateFabric<T>;
28
- //#endregion
29
- //#region ../fabric-core/src/createFabric.d.ts
30
- declare const createFabric: CreateFabric<FabricOptions>;
16
+ declare function createFabric<T extends FabricOptions>(config?: FabricConfig<T>): Fabric<T>;
31
17
  //#endregion
32
18
  //#region ../fabric-core/src/createFile.d.ts
33
19
  /**
@@ -369,5 +355,5 @@ declare const useEffect: typeof react3.useEffect;
369
355
  declare const useReducer: typeof react3.useReducer;
370
356
  declare const useRef: typeof react3.useRef;
371
357
  //#endregion
372
- export { App, Const, type Fabric, File, FileManager, FileProcessor, Fragment, Function, FunctionParams, Indent, Runtime, Type, createContext, createElement, createFabric, createFile, createFunctionParams, createReactFabric, defineFabric, use, useApp, useContext, useEffect, useFile, useLifecycle, useReducer, useRef, useState };
358
+ export { App, Const, type Fabric, File, FileManager, FileProcessor, Fragment, Function, FunctionParams, Indent, Runtime, Type, createContext, createElement, createFabric, createFile, createFunctionParams, createReactFabric, use, useApp, useContext, useEffect, useFile, useLifecycle, useReducer, useRef, useState };
373
359
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { r as __toESM } from "./chunk-B1nHLT4p.js";
2
- import { t as require_react } from "./react-DIj83RKM.js";
3
- import { a as _classPrivateFieldInitSpec, i as _classPrivateFieldGet2, n as Runtime, o as Root, r as _classPrivateFieldSet2, s as RootContext, t as reactPlugin } from "./reactPlugin-CjfIGdZW.js";
4
- import { i as jsxs, n as jsx, t as Fragment$1 } from "./jsx-runtime-CG-6bzfH.js";
2
+ import { t as require_react } from "./react-B97TdWcV.js";
3
+ import { a as _classPrivateFieldInitSpec, i as _classPrivateFieldGet2, n as Runtime, o as Root, r as _classPrivateFieldSet2, s as RootContext, t as reactPlugin } from "./reactPlugin-PG1kqZRe.js";
4
+ import { i as jsxs, n as jsx, t as Fragment$1 } from "./jsx-runtime-zJCtyvtC.js";
5
5
  import { t as open } from "./devtools-D6dZodXp.js";
6
6
  import { createFabric } from "@kubb/fabric-core";
7
7
  import dedent from "dedent";
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require('./chunk-BrXtsOCC.cjs');
2
- const require_react$1 = require('./react-7XRHSAt0.cjs');
2
+ const require_react$1 = require('./react-D_EYlsv-.cjs');
3
3
 
4
- //#region ../../node_modules/.pnpm/react@19.2.1/node_modules/react/cjs/react-jsx-dev-runtime.production.js
4
+ //#region ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-dev-runtime.production.js
5
5
  /**
6
6
  * @license React
7
7
  * react-jsx-dev-runtime.production.js
@@ -18,7 +18,7 @@ var require_react_jsx_dev_runtime_production = /* @__PURE__ */ require_chunk.__c
18
18
  }));
19
19
 
20
20
  //#endregion
21
- //#region ../../node_modules/.pnpm/react@19.2.1/node_modules/react/cjs/react-jsx-dev-runtime.development.js
21
+ //#region ../../node_modules/.pnpm/react@19.2.3/node_modules/react/cjs/react-jsx-dev-runtime.development.js
22
22
  /**
23
23
  * @license React
24
24
  * react-jsx-dev-runtime.development.js
@@ -214,7 +214,7 @@ var require_react_jsx_dev_runtime_development = /* @__PURE__ */ require_chunk.__
214
214
  }));
215
215
 
216
216
  //#endregion
217
- //#region ../../node_modules/.pnpm/react@19.2.1/node_modules/react/jsx-dev-runtime.js
217
+ //#region ../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-dev-runtime.js
218
218
  var require_jsx_dev_runtime = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
219
219
  if (process.env.NODE_ENV === "production") module.exports = require_react_jsx_dev_runtime_production();
220
220
  else module.exports = require_react_jsx_dev_runtime_development();