@kubb/fabric-core 0.13.2 → 0.13.3
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/{Fabric-BOjvMvNC.d.ts → Fabric-D4udrNnL.d.ts} +4 -1
- package/dist/{RootContext-BQHfIhhC.d.ts → RootContext-BEiEsH2Z.d.ts} +4 -3
- package/dist/{chunk-BYypO7fO.js → chunk-BVHe6Par.js} +5 -1
- package/dist/{chunk-uaV2rQ02.cjs → chunk-DVipidnM.cjs} +10 -0
- package/dist/{defaultParser-C1atU7yU.js → defaultParser-BD_N68Bo.js} +3 -2
- package/dist/{defaultParser-C1atU7yU.js.map → defaultParser-BD_N68Bo.js.map} +1 -1
- package/dist/{defaultParser-BAgmtMo_.cjs → defaultParser-BK-zOanQ.cjs} +3 -2
- package/dist/{defaultParser-BAgmtMo_.cjs.map → defaultParser-BK-zOanQ.cjs.map} +1 -1
- package/dist/{getRelativePath-BcieQL5M.js → getRelativePath-C4Au07ON.js} +2 -1
- package/dist/{getRelativePath-BcieQL5M.js.map → getRelativePath-C4Au07ON.js.map} +1 -1
- package/dist/{getRelativePath-DVG8dIzW.cjs → getRelativePath-DpbA6qm5.cjs} +2 -2
- package/dist/{getRelativePath-DVG8dIzW.cjs.map → getRelativePath-DpbA6qm5.cjs.map} +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/{onProcessExit-DENCUkMz.cjs → onProcessExit-BHrZkYzP.cjs} +4 -4
- package/dist/{onProcessExit-DENCUkMz.cjs.map → onProcessExit-BHrZkYzP.cjs.map} +1 -1
- package/dist/{onProcessExit-B0rJqX4s.js → onProcessExit-CnZym153.js} +4 -3
- package/dist/{onProcessExit-B0rJqX4s.js.map → onProcessExit-CnZym153.js.map} +1 -1
- package/dist/parsers/typescript.cjs +2 -2
- package/dist/parsers/typescript.d.ts +2 -1
- package/dist/parsers/typescript.js +2 -1
- package/dist/parsers/typescript.js.map +1 -1
- package/dist/parsers.cjs +3 -2
- package/dist/parsers.cjs.map +1 -1
- package/dist/parsers.d.ts +2 -1
- package/dist/parsers.js +3 -2
- package/dist/parsers.js.map +1 -1
- package/dist/plugins.cjs +3 -3
- package/dist/plugins.d.ts +3 -2
- package/dist/plugins.js +3 -2
- package/dist/plugins.js.map +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.d.ts +4 -3
- package/dist/types.js +1 -1
- package/dist/{useNodeTree-Brj-fAVZ.d.ts → useNodeTree-CPJ6Y80N.d.ts} +3 -2
- package/package.json +3 -2
- package/dist/Fabric-w9Y9duM6.d.ts +0 -516
- package/dist/RootContext-Cbs-UQXM.d.ts +0 -26
- package/dist/useNodeTree-6ZhDpI13.d.ts +0 -58
- package/src/components/__snapshots__/arrow_function_with_generics.ts +0 -3
- package/src/components/__snapshots__/async_arrow_function.ts +0 -3
- package/src/components/__snapshots__/async_function.ts +0 -3
- package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +0 -3
- package/src/components/__snapshots__/basic_arrow_function.ts +0 -3
- package/src/components/__snapshots__/basic_const.ts +0 -1
- package/src/components/__snapshots__/basic_export.ts +0 -1
- package/src/components/__snapshots__/basic_function.ts +0 -3
- package/src/components/__snapshots__/basic_import.ts +0 -1
- package/src/components/__snapshots__/basic_type.ts +0 -1
- package/src/components/__snapshots__/const_with_JSDoc.ts +0 -4
- package/src/components/__snapshots__/const_with_as_const.ts +0 -1
- package/src/components/__snapshots__/const_with_type.ts +0 -1
- package/src/components/__snapshots__/default_exported_arrow_function.ts +0 -3
- package/src/components/__snapshots__/default_exported_function.ts +0 -3
- package/src/components/__snapshots__/exported_arrow_function.ts +0 -3
- package/src/components/__snapshots__/exported_const.ts +0 -1
- package/src/components/__snapshots__/exported_function.ts +0 -3
- package/src/components/__snapshots__/exported_type.ts +0 -1
- package/src/components/__snapshots__/function_with_JSDoc.ts +0 -6
- package/src/components/__snapshots__/function_with_generics.ts +0 -3
- package/src/components/__snapshots__/function_with_parameters.ts +0 -3
- package/src/components/__snapshots__/function_with_return_type.ts +0 -3
- package/src/components/__snapshots__/matches_with_root_import.ts +0 -1
- package/src/components/__snapshots__/named_export.ts +0 -1
- package/src/components/__snapshots__/named_export_(object_advanced).ts +0 -1
- package/src/components/__snapshots__/named_import.ts +0 -1
- package/src/components/__snapshots__/named_import_(object).ts +0 -1
- package/src/components/__snapshots__/named_import_(object_advanced).ts +0 -1
- package/src/components/__snapshots__/named_typed_export.ts +0 -1
- package/src/components/__snapshots__/named_typed_import.ts +0 -1
- package/src/components/__snapshots__/single_line_arrow_function.ts +0 -1
- package/src/components/__snapshots__/type_with_JSDoc.ts +0 -4
- package/src/components/__snapshots__/typed_export.ts +0 -1
- package/src/components/__snapshots__/typed_import.ts +0 -1
|
@@ -1,516 +0,0 @@
|
|
|
1
|
-
declare namespace KubbFile_d_exports {
|
|
2
|
-
export { BaseName, Export, Extname, File, Import, Mode, Path, ResolvedFile, Source };
|
|
3
|
-
}
|
|
4
|
-
type ImportName = string | Array<string | {
|
|
5
|
-
propertyName: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
}>;
|
|
8
|
-
type Import = {
|
|
9
|
-
/**
|
|
10
|
-
* Import name to be used
|
|
11
|
-
* @example ["useState"]
|
|
12
|
-
* @example "React"
|
|
13
|
-
*/
|
|
14
|
-
name: ImportName;
|
|
15
|
-
/**
|
|
16
|
-
* Path for the import
|
|
17
|
-
* @example '@kubb/core'
|
|
18
|
-
*/
|
|
19
|
-
path: string;
|
|
20
|
-
/**
|
|
21
|
-
* Add type-only import prefix.
|
|
22
|
-
* - `true` generates `import type { Type } from './path'`
|
|
23
|
-
* - `false` generates `import { Type } from './path'`
|
|
24
|
-
* @default false
|
|
25
|
-
*/
|
|
26
|
-
isTypeOnly?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Import entire module as namespace.
|
|
29
|
-
* - `true` generates `import * as Name from './path'`
|
|
30
|
-
* - `false` generates standard import
|
|
31
|
-
* @default false
|
|
32
|
-
*/
|
|
33
|
-
isNameSpace?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* When root is set it will get the path with relative getRelativePath(root, path).
|
|
36
|
-
*/
|
|
37
|
-
root?: string;
|
|
38
|
-
};
|
|
39
|
-
type Source = {
|
|
40
|
-
name?: string;
|
|
41
|
-
value?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Make this source a type-only export.
|
|
44
|
-
* - `true` marks source as type export
|
|
45
|
-
* - `false` marks source as value export
|
|
46
|
-
* @default false
|
|
47
|
-
*/
|
|
48
|
-
isTypeOnly?: boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Include export keyword in source.
|
|
51
|
-
* - `true` generates exportable const or type
|
|
52
|
-
* - `false` generates internal declaration
|
|
53
|
-
* @default false
|
|
54
|
-
*/
|
|
55
|
-
isExportable?: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Include in barrel file generation.
|
|
58
|
-
* - `true` adds to barrel exports
|
|
59
|
-
* - `false` excludes from barrel exports
|
|
60
|
-
* @default false
|
|
61
|
-
*/
|
|
62
|
-
isIndexable?: boolean;
|
|
63
|
-
};
|
|
64
|
-
type Export = {
|
|
65
|
-
/**
|
|
66
|
-
* Export name to be used.
|
|
67
|
-
* @example ["useState"]
|
|
68
|
-
* @example "React"
|
|
69
|
-
*/
|
|
70
|
-
name?: string | Array<string>;
|
|
71
|
-
/**
|
|
72
|
-
* Path for the import.
|
|
73
|
-
* @example '@kubb/core'
|
|
74
|
-
*/
|
|
75
|
-
path: string;
|
|
76
|
-
/**
|
|
77
|
-
* Add type-only export prefix.
|
|
78
|
-
* - `true` generates `export type { Type } from './path'`
|
|
79
|
-
* - `false` generates `export { Type } from './path'`
|
|
80
|
-
* @default false
|
|
81
|
-
*/
|
|
82
|
-
isTypeOnly?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Export as aliased namespace.
|
|
85
|
-
* - `true` generates `export * as aliasName from './path'`
|
|
86
|
-
* - `false` generates standard export
|
|
87
|
-
* @default false
|
|
88
|
-
*/
|
|
89
|
-
asAlias?: boolean;
|
|
90
|
-
};
|
|
91
|
-
type Extname = '.ts' | '.js' | '.tsx' | '.json' | `.${string}`;
|
|
92
|
-
type Mode = 'single' | 'split';
|
|
93
|
-
/**
|
|
94
|
-
* Name to be used to dynamically create the baseName(based on input.path)
|
|
95
|
-
* Based on UNIX basename
|
|
96
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
97
|
-
*/
|
|
98
|
-
type BaseName = `${string}.${string}`;
|
|
99
|
-
/**
|
|
100
|
-
* Path will be full qualified path to a specified file
|
|
101
|
-
*/
|
|
102
|
-
type Path = string;
|
|
103
|
-
type File<TMeta extends object = object> = {
|
|
104
|
-
/**
|
|
105
|
-
* Name to be used to create the path
|
|
106
|
-
* Based on UNIX basename, `${name}.extname`
|
|
107
|
-
* @link https://nodejs.org/api/path.html#pathbasenamepath-suffix
|
|
108
|
-
*/
|
|
109
|
-
baseName: BaseName;
|
|
110
|
-
/**
|
|
111
|
-
* Path will be full qualified path to a specified file
|
|
112
|
-
*/
|
|
113
|
-
path: Path;
|
|
114
|
-
sources: Array<Source>;
|
|
115
|
-
imports: Array<Import>;
|
|
116
|
-
exports: Array<Export>;
|
|
117
|
-
/**
|
|
118
|
-
* Use extra meta, this is getting used to generate the barrel/index files.
|
|
119
|
-
*/
|
|
120
|
-
meta?: TMeta;
|
|
121
|
-
banner?: string;
|
|
122
|
-
footer?: string;
|
|
123
|
-
};
|
|
124
|
-
type ResolvedFile<TMeta extends object = object> = File<TMeta> & {
|
|
125
|
-
/**
|
|
126
|
-
* @default hash
|
|
127
|
-
*/
|
|
128
|
-
id: string;
|
|
129
|
-
/**
|
|
130
|
-
* Contains the first part of the baseName, generated based on baseName
|
|
131
|
-
* @link https://nodejs.org/api/path.html#pathformatpathobject
|
|
132
|
-
*/
|
|
133
|
-
name: string;
|
|
134
|
-
extname: Extname;
|
|
135
|
-
imports: Array<Import>;
|
|
136
|
-
exports: Array<Export>;
|
|
137
|
-
};
|
|
138
|
-
//#endregion
|
|
139
|
-
//#region src/parsers/types.d.ts
|
|
140
|
-
type PrintOptions = {
|
|
141
|
-
extname?: Extname;
|
|
142
|
-
};
|
|
143
|
-
type Parser<TOptions = unknown, TMeta extends object = any> = {
|
|
144
|
-
name: string;
|
|
145
|
-
type: 'parser';
|
|
146
|
-
/**
|
|
147
|
-
* Undefined is being used for the defaultParser
|
|
148
|
-
*/
|
|
149
|
-
extNames: Array<Extname> | undefined;
|
|
150
|
-
install: Install<TOptions>;
|
|
151
|
-
/**
|
|
152
|
-
* Convert a file to string
|
|
153
|
-
*/
|
|
154
|
-
parse(file: ResolvedFile<TMeta>, options: PrintOptions): Promise<string> | string;
|
|
155
|
-
};
|
|
156
|
-
type UserParser<TOptions = unknown, TMeta extends object = any> = Omit<Parser<TOptions, TMeta>, 'type'>;
|
|
157
|
-
//#endregion
|
|
158
|
-
//#region src/utils/AsyncEventEmitter.d.ts
|
|
159
|
-
type Options$2 = {
|
|
160
|
-
mode?: FabricMode;
|
|
161
|
-
maxListener?: number;
|
|
162
|
-
};
|
|
163
|
-
declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
|
|
164
|
-
#private;
|
|
165
|
-
constructor({
|
|
166
|
-
maxListener,
|
|
167
|
-
mode
|
|
168
|
-
}?: Options$2);
|
|
169
|
-
emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void>;
|
|
170
|
-
on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
171
|
-
onOnce<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArgs: TEvents[TEventName]) => void): void;
|
|
172
|
-
off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void;
|
|
173
|
-
removeAll(): void;
|
|
174
|
-
}
|
|
175
|
-
//#endregion
|
|
176
|
-
//#region src/FileProcessor.d.ts
|
|
177
|
-
type ProcessFilesProps = {
|
|
178
|
-
parsers?: Map<Extname, Parser>;
|
|
179
|
-
extension?: Record<Extname, Extname | ''>;
|
|
180
|
-
dryRun?: boolean;
|
|
181
|
-
/**
|
|
182
|
-
* @default 'sequential'
|
|
183
|
-
*/
|
|
184
|
-
mode?: FabricMode;
|
|
185
|
-
};
|
|
186
|
-
type GetParseOptions = {
|
|
187
|
-
parsers?: Map<Extname, Parser>;
|
|
188
|
-
extension?: Record<Extname, Extname | ''>;
|
|
189
|
-
};
|
|
190
|
-
type Options$1 = {
|
|
191
|
-
events?: AsyncEventEmitter<FabricEvents>;
|
|
192
|
-
};
|
|
193
|
-
declare class FileProcessor {
|
|
194
|
-
#private;
|
|
195
|
-
events: AsyncEventEmitter<FabricEvents>;
|
|
196
|
-
constructor({
|
|
197
|
-
events
|
|
198
|
-
}?: Options$1);
|
|
199
|
-
parse(file: ResolvedFile, {
|
|
200
|
-
parsers,
|
|
201
|
-
extension
|
|
202
|
-
}?: GetParseOptions): Promise<string>;
|
|
203
|
-
run(files: Array<ResolvedFile>, {
|
|
204
|
-
parsers,
|
|
205
|
-
mode,
|
|
206
|
-
dryRun,
|
|
207
|
-
extension
|
|
208
|
-
}?: ProcessFilesProps): Promise<ResolvedFile[]>;
|
|
209
|
-
}
|
|
210
|
-
//#endregion
|
|
211
|
-
//#region src/FileManager.d.ts
|
|
212
|
-
type Options = {
|
|
213
|
-
events?: AsyncEventEmitter<FabricEvents>;
|
|
214
|
-
};
|
|
215
|
-
declare class FileManager {
|
|
216
|
-
#private;
|
|
217
|
-
events: AsyncEventEmitter<FabricEvents>;
|
|
218
|
-
processor: FileProcessor;
|
|
219
|
-
constructor({
|
|
220
|
-
events
|
|
221
|
-
}?: Options);
|
|
222
|
-
add(...files: Array<File>): Array<ResolvedFile>;
|
|
223
|
-
upsert(...files: Array<File>): Array<ResolvedFile>;
|
|
224
|
-
flush(): void;
|
|
225
|
-
getByPath(path: Path): ResolvedFile | null;
|
|
226
|
-
deleteByPath(path: Path): void;
|
|
227
|
-
clear(): void;
|
|
228
|
-
get files(): Array<ResolvedFile>;
|
|
229
|
-
write(options: ProcessFilesProps): Promise<ResolvedFile[]>;
|
|
230
|
-
}
|
|
231
|
-
//#endregion
|
|
232
|
-
//#region src/context.d.ts
|
|
233
|
-
/**
|
|
234
|
-
* Context type that carries type information about its value
|
|
235
|
-
* This is a branded symbol type that enables type-safe context usage
|
|
236
|
-
*/
|
|
237
|
-
type Context<T> = symbol & {
|
|
238
|
-
readonly __type: T;
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* Provides a value to descendant components (Vue 3 style)
|
|
242
|
-
*
|
|
243
|
-
* @example
|
|
244
|
-
* ```ts
|
|
245
|
-
* const ThemeKey = Symbol('theme')
|
|
246
|
-
* provide(ThemeKey, { color: 'blue' })
|
|
247
|
-
* ```
|
|
248
|
-
*/
|
|
249
|
-
declare function provide<T>(key: symbol | Context<T>, value: T): void;
|
|
250
|
-
/**
|
|
251
|
-
* Injects a value provided by an ancestor component (Vue 3 style)
|
|
252
|
-
*
|
|
253
|
-
* @example
|
|
254
|
-
* ```ts
|
|
255
|
-
* const theme = inject(ThemeKey, { color: 'default' })
|
|
256
|
-
* ```
|
|
257
|
-
*/
|
|
258
|
-
declare function inject<T>(key: symbol | Context<T>, defaultValue?: T): T;
|
|
259
|
-
/**
|
|
260
|
-
* Unprovides a value (for cleanup)
|
|
261
|
-
* @internal
|
|
262
|
-
*/
|
|
263
|
-
declare function unprovide<T>(key: symbol | Context<T>): void;
|
|
264
|
-
/**
|
|
265
|
-
* Creates a context key with a default value (React-style compatibility)
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* ```ts
|
|
269
|
-
* const ThemeContext = createContext({ color: 'blue' })
|
|
270
|
-
* // ThemeContext is now typed as Context<{ color: string }>
|
|
271
|
-
* const theme = useContext(ThemeContext) // theme is { color: string }
|
|
272
|
-
* ```
|
|
273
|
-
*/
|
|
274
|
-
declare function createContext<T>(defaultValue: T): Context<T>;
|
|
275
|
-
//#endregion
|
|
276
|
-
//#region src/contexts/RenderContext.d.ts
|
|
277
|
-
type RenderContextProps = {
|
|
278
|
-
indentLevel: number;
|
|
279
|
-
indentSize: number;
|
|
280
|
-
currentLineLength: number;
|
|
281
|
-
shouldBreak: boolean;
|
|
282
|
-
};
|
|
283
|
-
/**
|
|
284
|
-
* Provides a context for tracking rendering state such as indentation and line length.
|
|
285
|
-
*/
|
|
286
|
-
declare const RenderContext: Context<RenderContextProps>;
|
|
287
|
-
//#endregion
|
|
288
|
-
//#region src/intrinsic.d.ts
|
|
289
|
-
type IntrinsicType = 'br' | 'indent' | 'dedent';
|
|
290
|
-
type Intrinsic = {
|
|
291
|
-
type: IntrinsicType;
|
|
292
|
-
__intrinsic: true;
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* Helper: render a plain string while applying current indentation at the
|
|
296
|
-
* start of each logical line. This ensures `${indent}` intrinsics affect
|
|
297
|
-
* subsequent string content.
|
|
298
|
-
*/
|
|
299
|
-
declare function renderIndent(content: string, renderContext: RenderContextProps): string;
|
|
300
|
-
declare function renderIntrinsic(children: FabricNode, context?: RenderContextProps): string;
|
|
301
|
-
//#endregion
|
|
302
|
-
//#region src/plugins/types.d.ts
|
|
303
|
-
type Plugin<TOptions = unknown, TAppExtension extends Record<string, any> = {}> = {
|
|
304
|
-
name: string;
|
|
305
|
-
type: 'plugin';
|
|
306
|
-
install: Install<TOptions>;
|
|
307
|
-
/**
|
|
308
|
-
* Runtime app overrides or extensions.
|
|
309
|
-
* Merged into the app instance after install.
|
|
310
|
-
* This cannot be async
|
|
311
|
-
*/
|
|
312
|
-
inject?: Inject<TOptions, TAppExtension>;
|
|
313
|
-
};
|
|
314
|
-
type UserPlugin<TOptions = unknown, TAppExtension extends Record<string, any> = {}> = Omit<Plugin<TOptions, TAppExtension>, 'type'>;
|
|
315
|
-
//#endregion
|
|
316
|
-
//#region src/Fabric.d.ts
|
|
317
|
-
type FabricElement<TProps extends object = object> = {
|
|
318
|
-
(): FabricNode;
|
|
319
|
-
type: string;
|
|
320
|
-
component: (props: TProps) => FabricNode;
|
|
321
|
-
props: TProps;
|
|
322
|
-
};
|
|
323
|
-
type FabricNode = FabricElement<any> | string | number | boolean | null | undefined | Intrinsic | Array<FabricNode>;
|
|
324
|
-
type FabricComponent<TProps extends object = object> = FabricElement<TProps> & {
|
|
325
|
-
children(...children: Array<FabricNode>): FabricElement<TProps>;
|
|
326
|
-
};
|
|
327
|
-
/**
|
|
328
|
-
* Defines core runtime options for Fabric.
|
|
329
|
-
*/
|
|
330
|
-
interface FabricOptions {
|
|
331
|
-
/**
|
|
332
|
-
* Determines how Fabric processes files.
|
|
333
|
-
* - `sequential`: files are processed one by one
|
|
334
|
-
* - `parallel`: files are processed concurrently
|
|
335
|
-
*
|
|
336
|
-
* @default 'sequential'
|
|
337
|
-
*/
|
|
338
|
-
mode?: FabricMode;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Available modes for file processing.
|
|
342
|
-
* @default 'sequential'
|
|
343
|
-
*/
|
|
344
|
-
type FabricMode = 'sequential' | 'parallel';
|
|
345
|
-
/**
|
|
346
|
-
* Event definitions emitted during the Fabric lifecycle.
|
|
347
|
-
*
|
|
348
|
-
* These events allow plugins and external code to hook into different stages
|
|
349
|
-
* of the file generation process. All events are asynchronous and can be
|
|
350
|
-
* listened to using `fabric.context.on()` or `fabric.context.onOnce()`.
|
|
351
|
-
*
|
|
352
|
-
* @example
|
|
353
|
-
* ```ts
|
|
354
|
-
* fabric.context.on('lifecycle:start', async () => {
|
|
355
|
-
* console.log('Fabric started!')
|
|
356
|
-
* })
|
|
357
|
-
* ```
|
|
358
|
-
*/
|
|
359
|
-
interface FabricEvents {
|
|
360
|
-
/**
|
|
361
|
-
* Emitted when the Fabric application lifecycle begins.
|
|
362
|
-
* This is typically the first event fired when starting a Fabric run.
|
|
363
|
-
* Use this to perform initial setup or logging.
|
|
364
|
-
*/
|
|
365
|
-
'lifecycle:start': [];
|
|
366
|
-
/**
|
|
367
|
-
* Emitted when the Fabric application lifecycle completes.
|
|
368
|
-
* This is typically the last event fired after all processing is done.
|
|
369
|
-
* Use this for cleanup tasks or final reporting.
|
|
370
|
-
*/
|
|
371
|
-
'lifecycle:end': [];
|
|
372
|
-
/**
|
|
373
|
-
* Emitted when Fabric starts rendering (used with reactPlugin).
|
|
374
|
-
* Provides access to the Fabric instance for render-time operations.
|
|
375
|
-
*/
|
|
376
|
-
'lifecycle:render': [fabric: Fabric];
|
|
377
|
-
/**
|
|
378
|
-
* Emitted once before file processing begins.
|
|
379
|
-
* Provides the complete list of files that will be processed.
|
|
380
|
-
* Use this to prepare for batch operations or display initial file counts.
|
|
381
|
-
*/
|
|
382
|
-
'files:processing:start': [files: Array<ResolvedFile>];
|
|
383
|
-
/**
|
|
384
|
-
* Emitted when files are successfully added to the FileManager's internal cache.
|
|
385
|
-
* This happens after files pass through path and name resolution.
|
|
386
|
-
* Use this to track which files have been registered.
|
|
387
|
-
*/
|
|
388
|
-
'files:added': [files: Array<ResolvedFile>];
|
|
389
|
-
/**
|
|
390
|
-
* Emitted during file path resolution, before a file is cached.
|
|
391
|
-
* Listeners can modify the file's path property to customize output location.
|
|
392
|
-
* This is called for each file being added via `addFile()` or `upsertFile()`.
|
|
393
|
-
*/
|
|
394
|
-
'file:resolve:path': [file: File];
|
|
395
|
-
/**
|
|
396
|
-
* Emitted during file name resolution, before a file is cached.
|
|
397
|
-
* Listeners can modify the file's name-related properties to customize naming.
|
|
398
|
-
* This is called for each file being added via `addFile()` or `upsertFile()`.
|
|
399
|
-
*/
|
|
400
|
-
'file:resolve:name': [file: File];
|
|
401
|
-
/**
|
|
402
|
-
* Emitted just before files are written to disk.
|
|
403
|
-
* Provides all files that will be written in this batch.
|
|
404
|
-
* Use this to perform pre-write operations like creating directories.
|
|
405
|
-
*/
|
|
406
|
-
'files:writing:start': [files: Array<ResolvedFile>];
|
|
407
|
-
/**
|
|
408
|
-
* Emitted after all files have been successfully written to disk.
|
|
409
|
-
* Provides all files that were written in this batch.
|
|
410
|
-
* Use this for post-write operations like running formatters or reporting.
|
|
411
|
-
*/
|
|
412
|
-
'files:writing:end': [files: Array<ResolvedFile>];
|
|
413
|
-
/**
|
|
414
|
-
* Emitted when an individual file starts being processed.
|
|
415
|
-
* This happens for each file in the queue, before parsing.
|
|
416
|
-
* Use this for per-file setup or detailed logging.
|
|
417
|
-
*/
|
|
418
|
-
'file:processing:start': [file: ResolvedFile, index: number, total: number];
|
|
419
|
-
/**
|
|
420
|
-
* Emitted when an individual file completes processing.
|
|
421
|
-
* This happens after the file has been parsed and handled.
|
|
422
|
-
* Use this for per-file cleanup or progress tracking.
|
|
423
|
-
*/
|
|
424
|
-
'file:processing:end': [file: ResolvedFile, index: number, total: number];
|
|
425
|
-
/**
|
|
426
|
-
* Emitted after each file is processed, providing progress metrics.
|
|
427
|
-
* This is the primary event for implementing progress bars or tracking.
|
|
428
|
-
* Plugins like fsPlugin use this to write files to disk.
|
|
429
|
-
*
|
|
430
|
-
* @property processed - Number of files processed so far
|
|
431
|
-
* @property total - Total number of files to process
|
|
432
|
-
* @property percentage - Completion percentage (0-100)
|
|
433
|
-
* @property source - Optional parsed source code of the file
|
|
434
|
-
* @property file - The file that was just processed
|
|
435
|
-
*/
|
|
436
|
-
'file:processing:update': [{
|
|
437
|
-
processed: number;
|
|
438
|
-
total: number;
|
|
439
|
-
percentage: number;
|
|
440
|
-
source?: string;
|
|
441
|
-
file: ResolvedFile;
|
|
442
|
-
}];
|
|
443
|
-
/**
|
|
444
|
-
* Emitted once all files have been successfully processed.
|
|
445
|
-
* This marks the completion of the processing phase.
|
|
446
|
-
* Use this to perform batch operations on all processed files.
|
|
447
|
-
*/
|
|
448
|
-
'files:processing:end': [files: Array<ResolvedFile>];
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Shared context passed to all plugins, parsers, and Fabric internals.
|
|
452
|
-
*/
|
|
453
|
-
interface FabricContext<T extends FabricOptions = FabricOptions> extends AsyncEventEmitter<FabricEvents> {
|
|
454
|
-
/** The active Fabric configuration. */
|
|
455
|
-
config: FabricConfig<T>;
|
|
456
|
-
/** The internal file manager handling file creation, merging, and writing. */
|
|
457
|
-
fileManager: FileManager;
|
|
458
|
-
/** List of files currently in memory. */
|
|
459
|
-
files: ResolvedFile[];
|
|
460
|
-
/** Add new files to the file manager. */
|
|
461
|
-
addFile(...files: File[]): Promise<void>;
|
|
462
|
-
/** Track installed plugins and parsers to prevent duplicates. */
|
|
463
|
-
installedPlugins: Set<Plugin>;
|
|
464
|
-
installedParsers: Map<Extname, Parser>;
|
|
465
|
-
}
|
|
466
|
-
/**
|
|
467
|
-
* Base configuration object for Fabric.
|
|
468
|
-
*/
|
|
469
|
-
type FabricConfig<T extends FabricOptions = FabricOptions> = T;
|
|
470
|
-
/**
|
|
471
|
-
* Utility type that checks whether all properties of `T` are optional.
|
|
472
|
-
*/
|
|
473
|
-
type AllOptional<T> = {} extends T ? true : false;
|
|
474
|
-
/**
|
|
475
|
-
* Defines the signature of a plugin or parser's `install` function.
|
|
476
|
-
*/
|
|
477
|
-
type Install<TOptions = unknown> = TOptions extends any[] ? (context: FabricContext, ...options: TOptions) => void | Promise<void> : AllOptional<TOptions> extends true ? (context: FabricContext, options?: TOptions) => void | Promise<void> : (context: FabricContext, options: TOptions) => void | Promise<void>;
|
|
478
|
-
/**
|
|
479
|
-
* Defines the signature of a plugin or parser's `inject` function.
|
|
480
|
-
* Returns an object that extends the Fabric instance.
|
|
481
|
-
*/
|
|
482
|
-
type Inject<TOptions = unknown, TExtension extends Record<string, any> = {}> = TOptions extends any[] ? (context: FabricContext, ...options: TOptions) => Partial<TExtension> : AllOptional<TOptions> extends true ? (context: FabricContext, options?: TOptions) => Partial<TExtension> : (context: FabricContext, options: TOptions) => Partial<TExtension>;
|
|
483
|
-
/**
|
|
484
|
-
* The main Fabric runtime interface.
|
|
485
|
-
* Provides access to the current context, registered plugins, files, and utility methods.
|
|
486
|
-
*/
|
|
487
|
-
interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
|
|
488
|
-
/** The shared context for this Fabric instance. */
|
|
489
|
-
context: FabricContext<T>;
|
|
490
|
-
/** The files managed by this Fabric instance. */
|
|
491
|
-
files: ResolvedFile[];
|
|
492
|
-
/**
|
|
493
|
-
* Install a plugin or parser into Fabric.
|
|
494
|
-
*
|
|
495
|
-
* @param target - The plugin or parser to install.
|
|
496
|
-
* @param options - Optional configuration or arguments for the target.
|
|
497
|
-
* @returns A Fabric instance extended by the plugin (if applicable).
|
|
498
|
-
*/
|
|
499
|
-
use<TPluginOptions = unknown, TMeta extends object = object, TExtension extends Record<string, any> = {}>(target: Plugin<TPluginOptions, TExtension> | Parser<TPluginOptions, TMeta>, ...options: TPluginOptions extends any[] ? NoInfer<TPluginOptions> : AllOptional<TPluginOptions> extends true ? [NoInfer<TPluginOptions>?] : [NoInfer<TPluginOptions>]): (this & TExtension) | Promise<this & TExtension>;
|
|
500
|
-
/**
|
|
501
|
-
* Add one or more files to the Fabric file manager.
|
|
502
|
-
*/
|
|
503
|
-
addFile(...files: File[]): Promise<void>;
|
|
504
|
-
/**
|
|
505
|
-
* Add one or more files to the Fabric file manager and merge the source, imports, exports
|
|
506
|
-
*/
|
|
507
|
-
upsertFile(...files: File[]): Promise<void>;
|
|
508
|
-
/**
|
|
509
|
-
* Unmount the Fabric instance and remove all registered event listeners.
|
|
510
|
-
* Plugins may extend this to perform additional cleanup (e.g. process signal listeners).
|
|
511
|
-
*/
|
|
512
|
-
unmount(error?: Error | number | null): void;
|
|
513
|
-
}
|
|
514
|
-
//#endregion
|
|
515
|
-
export { Path as A, UserParser as C, File as D, Extname as E, Source as M, Import as O, Parser as S, Export as T, inject as _, FabricElement as a, FileManager as b, FabricOptions as c, renderIndent as d, renderIntrinsic as f, createContext as g, Context as h, FabricContext as i, ResolvedFile as j, KubbFile_d_exports as k, Plugin as l, RenderContextProps as m, FabricComponent as n, FabricMode as o, RenderContext as p, FabricConfig as r, FabricNode as s, Fabric as t, UserPlugin as u, provide as v, BaseName as w, FileProcessor as x, unprovide as y };
|
|
516
|
-
//# sourceMappingURL=Fabric-w9Y9duM6.d.ts.map
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { b as FileManager, h as Context } from "./Fabric-w9Y9duM6.js";
|
|
2
|
-
import { r as TreeNode, t as ComponentNode } from "./useNodeTree-Brj-fAVZ.js";
|
|
3
|
-
|
|
4
|
-
//#region src/contexts/RootContext.d.ts
|
|
5
|
-
type RootContextProps = {
|
|
6
|
-
/**
|
|
7
|
-
* Exit (unmount) the whole app.
|
|
8
|
-
*/
|
|
9
|
-
exit: (error?: Error) => void;
|
|
10
|
-
/**
|
|
11
|
-
* TreeNode representing the tree structure of the app.
|
|
12
|
-
*/
|
|
13
|
-
treeNode: TreeNode<ComponentNode>;
|
|
14
|
-
/**
|
|
15
|
-
* FileManager instance for managing files within the app.
|
|
16
|
-
*/
|
|
17
|
-
fileManager: FileManager;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Context providing root-level functionalities such as exit hook, tree node structure, and file management.
|
|
21
|
-
* Define in the `render` helper of the runtime.
|
|
22
|
-
*/
|
|
23
|
-
declare const RootContext: Context<RootContextProps>;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { RootContextProps as n, RootContext as t };
|
|
26
|
-
//# sourceMappingURL=RootContext-Cbs-UQXM.d.ts.map
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { D as File } from "./Fabric-BOjvMvNC.js";
|
|
2
|
-
|
|
3
|
-
//#region src/utils/TreeNode.d.ts
|
|
4
|
-
type BarrelData = {
|
|
5
|
-
file?: File;
|
|
6
|
-
path: string;
|
|
7
|
-
name: string;
|
|
8
|
-
};
|
|
9
|
-
type Graph = {
|
|
10
|
-
nodes: Array<{
|
|
11
|
-
id: string;
|
|
12
|
-
label: string;
|
|
13
|
-
}>;
|
|
14
|
-
edges: Array<{
|
|
15
|
-
from: string;
|
|
16
|
-
to: string;
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
declare class TreeNode<TData = unknown> {
|
|
20
|
-
#private;
|
|
21
|
-
data: TData;
|
|
22
|
-
parent?: TreeNode<TData>;
|
|
23
|
-
children: Array<TreeNode<TData>>;
|
|
24
|
-
constructor(data: TData, parent?: TreeNode<TData>);
|
|
25
|
-
addChild(data: TData): TreeNode<TData>;
|
|
26
|
-
getChildByName(name: string): TreeNode<TData> | undefined;
|
|
27
|
-
get leaves(): Array<TreeNode<TData>>;
|
|
28
|
-
forEach(callback: (node: TreeNode<TData>) => void): this;
|
|
29
|
-
findDeep(predicate: (node: TreeNode<TData>) => boolean): TreeNode<TData> | undefined;
|
|
30
|
-
static toGraph(root: TreeNode<BarrelData>): Graph;
|
|
31
|
-
static fromFiles(files: Array<File>, rootFolder?: string): TreeNode<BarrelData> | null;
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/composables/useNodeTree.d.ts
|
|
35
|
-
type ComponentNode = {
|
|
36
|
-
type: string;
|
|
37
|
-
props: Record<string, unknown>;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* Accesses the current node tree for tracking component hierarchy.
|
|
41
|
-
*
|
|
42
|
-
* Use this composable to inspect or manipulate the component tree structure.
|
|
43
|
-
* Returns null if not within a component that provides NodeTreeContext.
|
|
44
|
-
*
|
|
45
|
-
* @returns The current TreeNode or null
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* ```ts
|
|
49
|
-
* const nodeTree = useNodeTree()
|
|
50
|
-
* if (nodeTree) {
|
|
51
|
-
* const childTree = nodeTree.addChild({ type: 'MyComponent', props: {} })
|
|
52
|
-
* }
|
|
53
|
-
* ```
|
|
54
|
-
*/
|
|
55
|
-
declare function useNodeTree(): TreeNode<ComponentNode> | null;
|
|
56
|
-
//#endregion
|
|
57
|
-
export { useNodeTree as n, TreeNode as r, ComponentNode as t };
|
|
58
|
-
//# sourceMappingURL=useNodeTree-6ZhDpI13.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const myVar = "hello"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "@kubb/fabric-core";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import fabric from "@kubb/fabric-core";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
type MyType = { a: string }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const myVar = "hello" as const
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const myVar: string = "hello"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const myVar = "hello"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type MyType = { a: string }
|