@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.
- package/README.md +21 -24
- package/dist/{Fabric-C7RMr4BK.d.ts → Fabric-CW62g3zB.d.ts} +113 -22
- package/dist/{Fabric-CStIaz99.d.cts → Fabric-CbgH_1H3.d.cts} +113 -22
- package/dist/globals.d.cts +2 -2
- package/dist/globals.d.ts +2 -2
- package/dist/index.cjs +3 -3
- package/dist/index.d.cts +10 -24
- package/dist/index.d.ts +10 -24
- package/dist/index.js +3 -3
- package/dist/jsx-dev-runtime.cjs +4 -4
- package/dist/jsx-dev-runtime.cjs.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +5 -5
- package/dist/jsx-dev-runtime.d.ts +5 -5
- package/dist/jsx-dev-runtime.js +4 -4
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/{jsx-namespace-DLxNuglH.d.cts → jsx-namespace-B2a_dVTm.d.cts} +2 -2
- package/dist/{jsx-namespace-BLxjMbms.d.ts → jsx-namespace-DsvCR0v-.d.ts} +2 -2
- package/dist/{jsx-runtime-rr0rZsW1.cjs → jsx-runtime-DqTOrEsT.cjs} +5 -5
- package/dist/{jsx-runtime-rr0rZsW1.cjs.map → jsx-runtime-DqTOrEsT.cjs.map} +1 -1
- package/dist/{jsx-runtime-CG-6bzfH.js → jsx-runtime-zJCtyvtC.js} +5 -5
- package/dist/{jsx-runtime-CG-6bzfH.js.map → jsx-runtime-zJCtyvtC.js.map} +1 -1
- package/dist/jsx-runtime.cjs +2 -2
- package/dist/jsx-runtime.d.cts +5 -5
- package/dist/jsx-runtime.d.ts +5 -5
- package/dist/jsx-runtime.js +2 -2
- package/dist/parsers.d.cts +5 -5
- package/dist/parsers.d.ts +5 -5
- package/dist/plugins.cjs +3 -3
- package/dist/plugins.d.cts +5 -5
- package/dist/plugins.d.ts +5 -5
- package/dist/plugins.js +3 -3
- package/dist/{react-DIj83RKM.js → react-B97TdWcV.js} +6 -6
- package/dist/{react-DIj83RKM.js.map → react-B97TdWcV.js.map} +1 -1
- package/dist/{react-7XRHSAt0.cjs → react-D_EYlsv-.cjs} +6 -6
- package/dist/{react-7XRHSAt0.cjs.map → react-D_EYlsv-.cjs.map} +1 -1
- package/dist/{reactPlugin-Botk9gkY.cjs → reactPlugin-CpRWhf6R.cjs} +13 -13
- package/dist/{reactPlugin-Botk9gkY.cjs.map → reactPlugin-CpRWhf6R.cjs.map} +1 -1
- package/dist/{reactPlugin-DajNNKBt.d.cts → reactPlugin-DWhl3kTD.d.cts} +2 -2
- package/dist/{reactPlugin-CjfIGdZW.js → reactPlugin-PG1kqZRe.js} +14 -14
- package/dist/{reactPlugin-CjfIGdZW.js.map → reactPlugin-PG1kqZRe.js.map} +1 -1
- package/dist/{reactPlugin-TmG3R6xY.d.ts → reactPlugin-yet1vypn.d.ts} +2 -2
- package/dist/{types-KXnjAqUg.d.ts → types-BB0-ElWk.d.ts} +2 -2
- package/dist/{types-BZlZnQLJ.d.cts → types-DM7YVFCN.d.cts} +2 -2
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +3 -3
- 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
|
-
- `
|
|
93
|
-
- `
|
|
94
|
-
- `
|
|
95
|
-
- `file:start { file, index, total }`
|
|
96
|
-
- `file:end { file, index, total }`
|
|
97
|
-
- `
|
|
98
|
-
- `
|
|
99
|
-
- `
|
|
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 `
|
|
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 `
|
|
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
|
|
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
|
-
#### `
|
|
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 {
|
|
204
|
+
import { definePlugin } from '@kubb/fabric-core/plugins'
|
|
208
205
|
|
|
209
|
-
const helloPlugin =
|
|
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
|
-
#### `
|
|
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 {
|
|
280
|
+
import { defineParser } from '@kubb/fabric-core/parsers'
|
|
284
281
|
|
|
285
|
-
const vueParser =
|
|
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
|
-
/**
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
-
/**
|
|
265
|
-
|
|
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
|
-
*
|
|
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
|
-
'
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
287
|
-
|
|
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
|
-
/**
|
|
293
|
-
|
|
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
|
-
*
|
|
300
|
-
*
|
|
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
|
-
'
|
|
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
|
-
/**
|
|
310
|
-
|
|
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-
|
|
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
|
-
/**
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
-
/**
|
|
265
|
-
|
|
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
|
-
*
|
|
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
|
-
'
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
287
|
-
|
|
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
|
-
/**
|
|
293
|
-
|
|
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
|
-
*
|
|
300
|
-
*
|
|
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
|
-
'
|
|
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
|
-
/**
|
|
310
|
-
|
|
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-
|
|
466
|
+
//# sourceMappingURL=Fabric-CbgH_1H3.d.cts.map
|
package/dist/globals.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./Fabric-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
3
|
-
const require_reactPlugin = require('./reactPlugin-
|
|
4
|
-
const require_jsx_runtime = require('./jsx-runtime-
|
|
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-
|
|
2
|
-
import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-
|
|
3
|
-
import { t as Options$1 } from "./reactPlugin-
|
|
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/
|
|
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
|
-
*
|
|
10
|
+
* Creates a new Fabric instance
|
|
21
11
|
*
|
|
22
12
|
* @example
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* })
|
|
13
|
+
* const fabric = createFabric()
|
|
14
|
+
* fabric.use(myPlugin())
|
|
26
15
|
*/
|
|
27
|
-
declare function
|
|
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,
|
|
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-
|
|
2
|
-
import { a as JSDoc, d as KubbNode, g as FunctionParams, o as Key, y as createFunctionParams } from "./types-
|
|
3
|
-
import { t as Options$1 } from "./reactPlugin-
|
|
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/
|
|
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
|
-
*
|
|
10
|
+
* Creates a new Fabric instance
|
|
21
11
|
*
|
|
22
12
|
* @example
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* })
|
|
13
|
+
* const fabric = createFabric()
|
|
14
|
+
* fabric.use(myPlugin())
|
|
26
15
|
*/
|
|
27
|
-
declare function
|
|
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,
|
|
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-
|
|
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-
|
|
4
|
-
import { i as jsxs, n as jsx, t as Fragment$1 } from "./jsx-runtime-
|
|
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";
|
package/dist/jsx-dev-runtime.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-BrXtsOCC.cjs');
|
|
2
|
-
const require_react$1 = require('./react-
|
|
2
|
+
const require_react$1 = require('./react-D_EYlsv-.cjs');
|
|
3
3
|
|
|
4
|
-
//#region ../../node_modules/.pnpm/react@19.2.
|
|
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.
|
|
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.
|
|
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();
|