@kubb/fabric-core 0.11.7 → 0.12.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/dist/{Fabric-BoTE1-WX.d.cts → Fabric-BbVC650D.d.cts} +86 -15
- package/dist/{Fabric-CWquRFa2.d.ts → Fabric-eh92yS1R.d.ts} +86 -15
- package/dist/Root-BT59jU0W.js +931 -0
- package/dist/Root-BT59jU0W.js.map +1 -0
- package/dist/Root-SC_lWG_q.cjs +1057 -0
- package/dist/Root-SC_lWG_q.cjs.map +1 -0
- package/dist/{defaultParser-CFIT3sEE.cjs → defaultParser-2ym3KiZd.cjs} +3 -4
- package/dist/{defaultParser-CFIT3sEE.cjs.map → defaultParser-2ym3KiZd.cjs.map} +1 -1
- package/dist/{defaultParser-DZ2kzujH.js → defaultParser-DDFR9BTS.js} +2 -2
- package/dist/{defaultParser-DZ2kzujH.js.map → defaultParser-DDFR9BTS.js.map} +1 -1
- package/dist/{getRelativePath-y7WcYR5C.js → getRelativePath-COUEoqbz.js} +11 -2
- package/dist/getRelativePath-COUEoqbz.js.map +1 -0
- package/dist/{getRelativePath-BllDunh0.cjs → getRelativePath-jYLCpluV.cjs} +16 -1
- package/dist/getRelativePath-jYLCpluV.cjs.map +1 -0
- package/dist/index.cjs +129 -448
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -90
- package/dist/index.d.ts +54 -90
- package/dist/index.js +92 -416
- package/dist/index.js.map +1 -1
- package/dist/parsers/typescript.cjs +7 -107
- package/dist/parsers/typescript.d.cts +1 -1
- package/dist/parsers/typescript.d.ts +1 -1
- package/dist/parsers/typescript.js +2 -101
- package/dist/parsers.cjs +7 -8
- package/dist/parsers.cjs.map +1 -1
- package/dist/parsers.d.cts +1 -1
- package/dist/parsers.d.ts +1 -1
- package/dist/parsers.js +3 -3
- package/dist/plugins.cjs +103 -9
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.cts +32 -9
- package/dist/plugins.d.ts +32 -9
- package/dist/plugins.js +96 -3
- package/dist/plugins.js.map +1 -1
- package/dist/types-BI7rICUP.d.cts +31 -0
- package/dist/types-DpITKjSb.d.ts +32 -0
- package/dist/types.cjs +6 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +4 -3
- package/dist/types.d.ts +4 -3
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typescriptParser-DyosyI_A.js +101 -0
- package/dist/typescriptParser-DyosyI_A.js.map +1 -0
- package/dist/typescriptParser-qjzb2pIh.cjs +137 -0
- package/dist/typescriptParser-qjzb2pIh.cjs.map +1 -0
- package/dist/{TreeNode-DomNP5og.d.cts → useNodeTree-CmXKaRqq.d.cts} +10 -3
- package/dist/{TreeNode-C1VnIF0o.d.ts → useNodeTree-DUdlgys5.d.ts} +10 -3
- package/package.json +3 -2
- package/src/Fabric.ts +13 -5
- package/src/KubbFile.ts +3 -11
- package/src/components/App.ts +6 -5
- package/src/components/Br.ts +11 -0
- package/src/components/Const.ts +6 -5
- package/src/components/Dedent.ts +10 -0
- package/src/components/File.ts +21 -16
- package/src/components/Function.ts +17 -13
- package/src/components/Indent.ts +7 -0
- package/src/components/Root.ts +6 -5
- package/src/components/Type.ts +6 -5
- package/src/components/__snapshots__/arrow_function_with_generics.ts +3 -3
- package/src/components/__snapshots__/async_arrow_function.ts +3 -3
- package/src/components/__snapshots__/async_function.ts +2 -2
- package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +2 -2
- package/src/components/__snapshots__/basic_arrow_function.ts +3 -3
- package/src/components/__snapshots__/basic_export.ts +1 -0
- package/src/components/__snapshots__/basic_function.ts +2 -2
- package/src/components/__snapshots__/basic_import.ts +1 -0
- package/src/components/__snapshots__/default_exported_arrow_function.ts +3 -3
- package/src/components/__snapshots__/default_exported_function.ts +2 -2
- package/src/components/__snapshots__/exported_arrow_function.ts +3 -3
- package/src/components/__snapshots__/exported_function.ts +2 -2
- package/src/components/__snapshots__/function_with_JSDoc.ts +2 -2
- package/src/components/__snapshots__/function_with_generics.ts +2 -2
- package/src/components/__snapshots__/function_with_parameters.ts +2 -2
- package/src/components/__snapshots__/function_with_return_type.ts +2 -2
- package/src/components/__snapshots__/matches_with_root_import.ts +1 -0
- package/src/components/__snapshots__/named_export.ts +1 -0
- package/src/components/__snapshots__/named_export_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_import.ts +1 -0
- package/src/components/__snapshots__/named_import_(object).ts +1 -0
- package/src/components/__snapshots__/named_import_(object_advanced).ts +1 -0
- package/src/components/__snapshots__/named_typed_export.ts +1 -0
- package/src/components/__snapshots__/named_typed_import.ts +1 -0
- package/src/components/__snapshots__/typed_export.ts +1 -0
- package/src/components/__snapshots__/typed_import.ts +1 -0
- package/src/contexts/RenderContext.ts +13 -0
- package/src/createComponent.ts +34 -0
- package/src/index.ts +9 -9
- package/src/intrinsic.ts +143 -0
- package/src/plugins/fsxPlugin/Runtime.ts +96 -0
- package/src/plugins/fsxPlugin/fsxPlugin.ts +45 -0
- package/src/plugins/index.ts +1 -0
- package/src/types.ts +4 -1
- package/dist/TreeNode-CC3a0Bae.js +0 -447
- package/dist/TreeNode-CC3a0Bae.js.map +0 -1
- package/dist/TreeNode-CFchatCw.cjs +0 -494
- package/dist/TreeNode-CFchatCw.cjs.map +0 -1
- package/dist/defineParser-CVCxqqzB.cjs +0 -18
- package/dist/defineParser-CVCxqqzB.cjs.map +0 -1
- package/dist/defineParser-Lco7nlj0.js +0 -13
- package/dist/defineParser-Lco7nlj0.js.map +0 -1
- package/dist/getRelativePath-BllDunh0.cjs.map +0 -1
- package/dist/getRelativePath-y7WcYR5C.js.map +0 -1
- package/dist/parsers/typescript.cjs.map +0 -1
- package/dist/parsers/typescript.js.map +0 -1
- package/dist/types-DYepTJ6F.d.cts +0 -82
- package/dist/types-yNaQHNUB.d.ts +0 -83
- package/src/components/Text.ts +0 -27
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import { n as __name } from "./chunk-8X4u0d05.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { A as Path, D as File$1, M as Source, O as Import, T as Export, _ as inject, b as FileManager, c as FabricOptions, d as renderIndent, f as renderIntrinsic, g as createContext, h as Context, j as ResolvedFile, n as FabricComponent, p as RenderContext, r as FabricConfig, s as FabricNode, t as Fabric, v as provide, w as BaseName, x as FileProcessor, y as unprovide } from "./Fabric-eh92yS1R.js";
|
|
3
|
+
import { n as useNodeTree, r as TreeNode, t as ComponentNode } from "./useNodeTree-DUdlgys5.js";
|
|
4
|
+
import { n as RootContext, t as JSDoc } from "./types-DpITKjSb.js";
|
|
5
5
|
|
|
6
|
+
//#region src/createComponent.d.ts
|
|
7
|
+
type MakeChildrenOptional<T extends object> = T extends {
|
|
8
|
+
children?: any;
|
|
9
|
+
} ? Omit<T, 'children'> & Partial<Pick<T, 'children'>> : T;
|
|
10
|
+
type ComponentBuilder<T extends object> = {
|
|
11
|
+
(...args: unknown extends T ? [] : {} extends Omit<T, 'children'> ? [props?: MakeChildrenOptional<T>] : [props: MakeChildrenOptional<T>]): FabricComponent<T>;
|
|
12
|
+
displayName?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
declare function createComponent<TProps extends object>(type: string, Component: (props: TProps) => FabricNode): ComponentBuilder<TProps>;
|
|
15
|
+
//#endregion
|
|
6
16
|
//#region src/components/App.d.ts
|
|
7
17
|
type AppProps<TMeta extends Object = Object> = {
|
|
8
18
|
/**
|
|
@@ -12,18 +22,18 @@ type AppProps<TMeta extends Object = Object> = {
|
|
|
12
22
|
/**
|
|
13
23
|
* Children nodes.
|
|
14
24
|
*/
|
|
15
|
-
children?:
|
|
25
|
+
children?: FabricNode;
|
|
16
26
|
};
|
|
17
27
|
/**
|
|
18
28
|
* App container containing the AppContext carrying `meta` and an `exit` hook.
|
|
19
29
|
*/
|
|
20
|
-
declare
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
declare const App: ComponentBuilder<AppProps<Object>>;
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/components/Br.d.ts
|
|
33
|
+
/**
|
|
34
|
+
* Generates a line break in the output.
|
|
35
|
+
*/
|
|
36
|
+
declare const Br: ComponentBuilder<object>;
|
|
27
37
|
//#endregion
|
|
28
38
|
//#region src/components/Const.d.ts
|
|
29
39
|
type ConstProps = {
|
|
@@ -50,18 +60,18 @@ type ConstProps = {
|
|
|
50
60
|
/**
|
|
51
61
|
* Children nodes.
|
|
52
62
|
*/
|
|
53
|
-
children?:
|
|
63
|
+
children?: FabricNode;
|
|
54
64
|
};
|
|
55
65
|
/**
|
|
56
66
|
* Generates a TypeScript constant declaration.
|
|
57
67
|
*/
|
|
58
|
-
declare
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
declare const Const: ComponentBuilder<ConstProps>;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/components/Dedent.d.ts
|
|
71
|
+
/**
|
|
72
|
+
* Dedent component for reducing indentation level in rendered output.
|
|
73
|
+
*/
|
|
74
|
+
declare const Dedent: ComponentBuilder<object>;
|
|
65
75
|
//#endregion
|
|
66
76
|
//#region src/components/File.d.ts
|
|
67
77
|
type FileProps<TMeta extends object = object> = {
|
|
@@ -81,52 +91,43 @@ type FileProps<TMeta extends object = object> = {
|
|
|
81
91
|
/**
|
|
82
92
|
* Children nodes.
|
|
83
93
|
*/
|
|
84
|
-
children?:
|
|
94
|
+
children?: FabricNode;
|
|
85
95
|
};
|
|
86
96
|
/**
|
|
87
97
|
* Adds files to the FileManager
|
|
88
98
|
*/
|
|
89
|
-
declare
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
var Source: typeof FileSource;
|
|
95
|
-
var Import: typeof FileImport;
|
|
96
|
-
var Export: typeof FileExport;
|
|
97
|
-
}
|
|
99
|
+
declare const File: ComponentBuilder<FileProps<object>> & {
|
|
100
|
+
Source: typeof FileSource;
|
|
101
|
+
Import: typeof FileImport;
|
|
102
|
+
Export: typeof FileExport;
|
|
103
|
+
};
|
|
98
104
|
type FileSourceProps = Omit<Source, 'value'> & {
|
|
99
105
|
/**
|
|
100
106
|
* Children nodes.
|
|
101
107
|
*/
|
|
102
|
-
children?:
|
|
108
|
+
children?: FabricNode;
|
|
103
109
|
};
|
|
104
110
|
/**
|
|
105
111
|
* FileSource - for adding source code to a file
|
|
106
112
|
*
|
|
107
113
|
* Returns the provided children string so the fsx renderer can collect it.
|
|
108
114
|
*/
|
|
109
|
-
declare
|
|
110
|
-
children,
|
|
111
|
-
...props
|
|
112
|
-
}: FileSourceProps): string;
|
|
113
|
-
type FileExportProps = Export;
|
|
115
|
+
declare const FileSource: ComponentBuilder<FileSourceProps>;
|
|
114
116
|
/**
|
|
115
117
|
* FileExport - for adding exports to a file
|
|
116
118
|
*
|
|
117
119
|
* No-op function used by renderers to record exports.
|
|
118
120
|
*/
|
|
119
|
-
declare
|
|
120
|
-
type FileImportProps = Import;
|
|
121
|
+
declare const FileExport: ComponentBuilder<Export>;
|
|
121
122
|
/**
|
|
122
123
|
* FileImport - for adding imports to a file
|
|
123
124
|
*
|
|
124
125
|
* No-op function used by renderers to record imports.
|
|
125
126
|
*/
|
|
126
|
-
declare
|
|
127
|
+
declare const FileImport: ComponentBuilder<Import>;
|
|
127
128
|
//#endregion
|
|
128
129
|
//#region src/components/Function.d.ts
|
|
129
|
-
type
|
|
130
|
+
type FunctionProps = {
|
|
130
131
|
/**
|
|
131
132
|
* Name of the function.
|
|
132
133
|
*/
|
|
@@ -163,20 +164,15 @@ type Props$1 = {
|
|
|
163
164
|
/**
|
|
164
165
|
* Children nodes.
|
|
165
166
|
*/
|
|
166
|
-
children?:
|
|
167
|
+
children?: FabricNode;
|
|
167
168
|
};
|
|
168
169
|
/**
|
|
169
170
|
* Generates a TypeScript function declaration.
|
|
170
171
|
*/
|
|
171
|
-
declare
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
declare namespace Function {
|
|
176
|
-
var displayName: string;
|
|
177
|
-
var Arrow: typeof ArrowFunction;
|
|
178
|
-
}
|
|
179
|
-
type ArrowFunctionProps = Props$1 & {
|
|
172
|
+
declare const Function: ComponentBuilder<FunctionProps> & {
|
|
173
|
+
Arrow: typeof ArrowFunction;
|
|
174
|
+
};
|
|
175
|
+
type ArrowFunctionProps = FunctionProps & {
|
|
180
176
|
/**
|
|
181
177
|
* Create Arrow function in one line
|
|
182
178
|
*/
|
|
@@ -189,13 +185,10 @@ type ArrowFunctionProps = Props$1 & {
|
|
|
189
185
|
* the same options as `Function`. Use `singleLine` to produce a one-line
|
|
190
186
|
* arrow expression.
|
|
191
187
|
*/
|
|
192
|
-
declare
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
declare namespace ArrowFunction {
|
|
197
|
-
var displayName: string;
|
|
198
|
-
}
|
|
188
|
+
declare const ArrowFunction: ComponentBuilder<ArrowFunctionProps>;
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/components/Indent.d.ts
|
|
191
|
+
declare const Indent: ComponentBuilder<object>;
|
|
199
192
|
//#endregion
|
|
200
193
|
//#region src/components/Root.d.ts
|
|
201
194
|
type RootProps = {
|
|
@@ -218,35 +211,12 @@ type RootProps = {
|
|
|
218
211
|
/**
|
|
219
212
|
* Children nodes.
|
|
220
213
|
*/
|
|
221
|
-
children?:
|
|
214
|
+
children?: FabricNode;
|
|
222
215
|
};
|
|
223
216
|
/**
|
|
224
217
|
* This component provides the root behavior for the Fabric runtime.
|
|
225
218
|
*/
|
|
226
|
-
declare
|
|
227
|
-
onError,
|
|
228
|
-
onExit,
|
|
229
|
-
treeNode,
|
|
230
|
-
fileManager,
|
|
231
|
-
children
|
|
232
|
-
}: RootProps): string;
|
|
233
|
-
declare namespace Root {
|
|
234
|
-
var displayName: string;
|
|
235
|
-
}
|
|
236
|
-
//#endregion
|
|
237
|
-
//#region src/components/Text.d.ts
|
|
238
|
-
type Props = {
|
|
239
|
-
/**
|
|
240
|
-
* Children nodes.
|
|
241
|
-
*/
|
|
242
|
-
children?: string | (() => string | Array<string> | undefined);
|
|
243
|
-
};
|
|
244
|
-
/**
|
|
245
|
-
* Generates a text node from string or function returning string/array of strings.
|
|
246
|
-
*/
|
|
247
|
-
declare function Text({
|
|
248
|
-
children
|
|
249
|
-
}: Props): string;
|
|
219
|
+
declare const Root: ComponentBuilder<RootProps>;
|
|
250
220
|
//#endregion
|
|
251
221
|
//#region src/components/Type.d.ts
|
|
252
222
|
type TypeProps = {
|
|
@@ -265,18 +235,12 @@ type TypeProps = {
|
|
|
265
235
|
/**
|
|
266
236
|
* Children nodes.
|
|
267
237
|
*/
|
|
268
|
-
children?:
|
|
238
|
+
children?: FabricNode;
|
|
269
239
|
};
|
|
270
240
|
/**
|
|
271
241
|
* Generates a TypeScript type declaration.
|
|
272
242
|
*/
|
|
273
|
-
declare
|
|
274
|
-
children,
|
|
275
|
-
...props
|
|
276
|
-
}: TypeProps): string;
|
|
277
|
-
declare namespace Type {
|
|
278
|
-
var displayName: string;
|
|
279
|
-
}
|
|
243
|
+
declare const Type: ComponentBuilder<TypeProps>;
|
|
280
244
|
//#endregion
|
|
281
245
|
//#region src/contexts/AppContext.d.ts
|
|
282
246
|
type AppContextProps<TMeta extends object = object> = {
|
|
@@ -377,5 +341,5 @@ declare function createJSDoc({
|
|
|
377
341
|
//#region src/utils/getRelativePath.d.ts
|
|
378
342
|
declare function getRelativePath(rootDir?: string | null, filePath?: string | null, platform?: 'windows' | 'mac' | 'linux'): string;
|
|
379
343
|
//#endregion
|
|
380
|
-
export { App, AppContext,
|
|
344
|
+
export { App, AppContext, Br, Const, Dedent, File, FileContext, FileManager, FileProcessor, Function, Indent, NodeTreeContext, RenderContext, Root, RootContext, TreeNode, Type, createComponent, createContext, createFabric, createFile, createJSDoc, getRelativePath, inject, provide, renderIndent, renderIntrinsic, unprovide, useApp, useContext, useFile, useFileManager, useLifecycle, useNodeTree };
|
|
381
345
|
//# sourceMappingURL=index.d.ts.map
|