@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.
Files changed (110) hide show
  1. package/dist/{Fabric-BoTE1-WX.d.cts → Fabric-BbVC650D.d.cts} +86 -15
  2. package/dist/{Fabric-CWquRFa2.d.ts → Fabric-eh92yS1R.d.ts} +86 -15
  3. package/dist/Root-BT59jU0W.js +931 -0
  4. package/dist/Root-BT59jU0W.js.map +1 -0
  5. package/dist/Root-SC_lWG_q.cjs +1057 -0
  6. package/dist/Root-SC_lWG_q.cjs.map +1 -0
  7. package/dist/{defaultParser-CFIT3sEE.cjs → defaultParser-2ym3KiZd.cjs} +3 -4
  8. package/dist/{defaultParser-CFIT3sEE.cjs.map → defaultParser-2ym3KiZd.cjs.map} +1 -1
  9. package/dist/{defaultParser-DZ2kzujH.js → defaultParser-DDFR9BTS.js} +2 -2
  10. package/dist/{defaultParser-DZ2kzujH.js.map → defaultParser-DDFR9BTS.js.map} +1 -1
  11. package/dist/{getRelativePath-y7WcYR5C.js → getRelativePath-COUEoqbz.js} +11 -2
  12. package/dist/getRelativePath-COUEoqbz.js.map +1 -0
  13. package/dist/{getRelativePath-BllDunh0.cjs → getRelativePath-jYLCpluV.cjs} +16 -1
  14. package/dist/getRelativePath-jYLCpluV.cjs.map +1 -0
  15. package/dist/index.cjs +129 -448
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.d.cts +54 -90
  18. package/dist/index.d.ts +54 -90
  19. package/dist/index.js +92 -416
  20. package/dist/index.js.map +1 -1
  21. package/dist/parsers/typescript.cjs +7 -107
  22. package/dist/parsers/typescript.d.cts +1 -1
  23. package/dist/parsers/typescript.d.ts +1 -1
  24. package/dist/parsers/typescript.js +2 -101
  25. package/dist/parsers.cjs +7 -8
  26. package/dist/parsers.cjs.map +1 -1
  27. package/dist/parsers.d.cts +1 -1
  28. package/dist/parsers.d.ts +1 -1
  29. package/dist/parsers.js +3 -3
  30. package/dist/plugins.cjs +103 -9
  31. package/dist/plugins.cjs.map +1 -1
  32. package/dist/plugins.d.cts +32 -9
  33. package/dist/plugins.d.ts +32 -9
  34. package/dist/plugins.js +96 -3
  35. package/dist/plugins.js.map +1 -1
  36. package/dist/types-BI7rICUP.d.cts +31 -0
  37. package/dist/types-DpITKjSb.d.ts +32 -0
  38. package/dist/types.cjs +6 -0
  39. package/dist/types.cjs.map +1 -1
  40. package/dist/types.d.cts +4 -3
  41. package/dist/types.d.ts +4 -3
  42. package/dist/types.js +1 -1
  43. package/dist/types.js.map +1 -1
  44. package/dist/typescriptParser-DyosyI_A.js +101 -0
  45. package/dist/typescriptParser-DyosyI_A.js.map +1 -0
  46. package/dist/typescriptParser-qjzb2pIh.cjs +137 -0
  47. package/dist/typescriptParser-qjzb2pIh.cjs.map +1 -0
  48. package/dist/{TreeNode-DomNP5og.d.cts → useNodeTree-CmXKaRqq.d.cts} +10 -3
  49. package/dist/{TreeNode-C1VnIF0o.d.ts → useNodeTree-DUdlgys5.d.ts} +10 -3
  50. package/package.json +3 -2
  51. package/src/Fabric.ts +13 -5
  52. package/src/KubbFile.ts +3 -11
  53. package/src/components/App.ts +6 -5
  54. package/src/components/Br.ts +11 -0
  55. package/src/components/Const.ts +6 -5
  56. package/src/components/Dedent.ts +10 -0
  57. package/src/components/File.ts +21 -16
  58. package/src/components/Function.ts +17 -13
  59. package/src/components/Indent.ts +7 -0
  60. package/src/components/Root.ts +6 -5
  61. package/src/components/Type.ts +6 -5
  62. package/src/components/__snapshots__/arrow_function_with_generics.ts +3 -3
  63. package/src/components/__snapshots__/async_arrow_function.ts +3 -3
  64. package/src/components/__snapshots__/async_function.ts +2 -2
  65. package/src/components/__snapshots__/async_function_with_Promise_return_type.ts +2 -2
  66. package/src/components/__snapshots__/basic_arrow_function.ts +3 -3
  67. package/src/components/__snapshots__/basic_export.ts +1 -0
  68. package/src/components/__snapshots__/basic_function.ts +2 -2
  69. package/src/components/__snapshots__/basic_import.ts +1 -0
  70. package/src/components/__snapshots__/default_exported_arrow_function.ts +3 -3
  71. package/src/components/__snapshots__/default_exported_function.ts +2 -2
  72. package/src/components/__snapshots__/exported_arrow_function.ts +3 -3
  73. package/src/components/__snapshots__/exported_function.ts +2 -2
  74. package/src/components/__snapshots__/function_with_JSDoc.ts +2 -2
  75. package/src/components/__snapshots__/function_with_generics.ts +2 -2
  76. package/src/components/__snapshots__/function_with_parameters.ts +2 -2
  77. package/src/components/__snapshots__/function_with_return_type.ts +2 -2
  78. package/src/components/__snapshots__/matches_with_root_import.ts +1 -0
  79. package/src/components/__snapshots__/named_export.ts +1 -0
  80. package/src/components/__snapshots__/named_export_(object_advanced).ts +1 -0
  81. package/src/components/__snapshots__/named_import.ts +1 -0
  82. package/src/components/__snapshots__/named_import_(object).ts +1 -0
  83. package/src/components/__snapshots__/named_import_(object_advanced).ts +1 -0
  84. package/src/components/__snapshots__/named_typed_export.ts +1 -0
  85. package/src/components/__snapshots__/named_typed_import.ts +1 -0
  86. package/src/components/__snapshots__/typed_export.ts +1 -0
  87. package/src/components/__snapshots__/typed_import.ts +1 -0
  88. package/src/contexts/RenderContext.ts +13 -0
  89. package/src/createComponent.ts +34 -0
  90. package/src/index.ts +9 -9
  91. package/src/intrinsic.ts +143 -0
  92. package/src/plugins/fsxPlugin/Runtime.ts +96 -0
  93. package/src/plugins/fsxPlugin/fsxPlugin.ts +45 -0
  94. package/src/plugins/index.ts +1 -0
  95. package/src/types.ts +4 -1
  96. package/dist/TreeNode-CC3a0Bae.js +0 -447
  97. package/dist/TreeNode-CC3a0Bae.js.map +0 -1
  98. package/dist/TreeNode-CFchatCw.cjs +0 -494
  99. package/dist/TreeNode-CFchatCw.cjs.map +0 -1
  100. package/dist/defineParser-CVCxqqzB.cjs +0 -18
  101. package/dist/defineParser-CVCxqqzB.cjs.map +0 -1
  102. package/dist/defineParser-Lco7nlj0.js +0 -13
  103. package/dist/defineParser-Lco7nlj0.js.map +0 -1
  104. package/dist/getRelativePath-BllDunh0.cjs.map +0 -1
  105. package/dist/getRelativePath-y7WcYR5C.js.map +0 -1
  106. package/dist/parsers/typescript.cjs.map +0 -1
  107. package/dist/parsers/typescript.js.map +0 -1
  108. package/dist/types-DYepTJ6F.d.cts +0 -82
  109. package/dist/types-yNaQHNUB.d.ts +0 -83
  110. package/src/components/Text.ts +0 -27
@@ -1,82 +0,0 @@
1
- import { c as FileManager, x as __name } from "./Fabric-BoTE1-WX.cjs";
2
- import { t as TreeNode } from "./TreeNode-DomNP5og.cjs";
3
-
4
- //#region src/composables/useNodeTree.d.ts
5
- type ComponentNode = {
6
- type: string;
7
- props: Record<string, unknown>;
8
- };
9
- declare function useNodeTree(): TreeNode<ComponentNode> | null;
10
- //#endregion
11
- //#region src/context.d.ts
12
- /**
13
- * Context type that carries type information about its value
14
- * This is a branded symbol type that enables type-safe context usage
15
- */
16
- type Context<T> = symbol & {
17
- readonly __type: T;
18
- };
19
- /**
20
- * Provides a value to descendant components (Vue 3 style)
21
- *
22
- * @example
23
- * ```ts
24
- * const ThemeKey = Symbol('theme')
25
- * provide(ThemeKey, { color: 'blue' })
26
- * ```
27
- */
28
- declare function provide<T>(key: symbol | Context<T>, value: T): void;
29
- /**
30
- * Injects a value provided by an ancestor component (Vue 3 style)
31
- *
32
- * @example
33
- * ```ts
34
- * const theme = inject(ThemeKey, { color: 'default' })
35
- * ```
36
- */
37
- declare function inject<T>(key: symbol | Context<T>, defaultValue?: T): T;
38
- /**
39
- * Unprovides a value (for cleanup)
40
- * @internal
41
- */
42
- declare function unprovide<T>(key: symbol | Context<T>): void;
43
- /**
44
- * Creates a context key with a default value (React-style compatibility)
45
- *
46
- * @example
47
- * ```ts
48
- * const ThemeContext = createContext({ color: 'blue' })
49
- * // ThemeContext is now typed as Context<{ color: string }>
50
- * const theme = useContext(ThemeContext) // theme is { color: string }
51
- * ```
52
- */
53
- declare function createContext<T>(defaultValue: T): Context<T>;
54
- //#endregion
55
- //#region src/contexts/RootContext.d.ts
56
- type RootContextProps = {
57
- /**
58
- * Exit (unmount) the whole app.
59
- */
60
- exit: (error?: Error) => void;
61
- /**
62
- * TreeNode representing the tree structure of the app.
63
- */
64
- treeNode: TreeNode<ComponentNode>;
65
- /**
66
- * FileManager instance for managing files within the app.
67
- */
68
- fileManager: FileManager;
69
- };
70
- /**
71
- * Context providing root-level functionalities such as exit hook, tree node structure, and file management.
72
- * Define in the `render` helper of the runtime.
73
- */
74
- declare const RootContext: Context<RootContextProps>;
75
- //#endregion
76
- //#region src/types.d.ts
77
- type JSDoc = {
78
- comments: string[];
79
- };
80
- //#endregion
81
- export { createContext as a, unprovide as c, Context as i, ComponentNode as l, RootContext as n, inject as o, RootContextProps as r, provide as s, JSDoc as t, useNodeTree as u };
82
- //# sourceMappingURL=types-DYepTJ6F.d.cts.map
@@ -1,83 +0,0 @@
1
- import { n as __name } from "./chunk-8X4u0d05.js";
2
- import { c as FileManager } from "./Fabric-CWquRFa2.js";
3
- import { t as TreeNode } from "./TreeNode-C1VnIF0o.js";
4
-
5
- //#region src/composables/useNodeTree.d.ts
6
- type ComponentNode = {
7
- type: string;
8
- props: Record<string, unknown>;
9
- };
10
- declare function useNodeTree(): TreeNode<ComponentNode> | null;
11
- //#endregion
12
- //#region src/context.d.ts
13
- /**
14
- * Context type that carries type information about its value
15
- * This is a branded symbol type that enables type-safe context usage
16
- */
17
- type Context<T> = symbol & {
18
- readonly __type: T;
19
- };
20
- /**
21
- * Provides a value to descendant components (Vue 3 style)
22
- *
23
- * @example
24
- * ```ts
25
- * const ThemeKey = Symbol('theme')
26
- * provide(ThemeKey, { color: 'blue' })
27
- * ```
28
- */
29
- declare function provide<T>(key: symbol | Context<T>, value: T): void;
30
- /**
31
- * Injects a value provided by an ancestor component (Vue 3 style)
32
- *
33
- * @example
34
- * ```ts
35
- * const theme = inject(ThemeKey, { color: 'default' })
36
- * ```
37
- */
38
- declare function inject<T>(key: symbol | Context<T>, defaultValue?: T): T;
39
- /**
40
- * Unprovides a value (for cleanup)
41
- * @internal
42
- */
43
- declare function unprovide<T>(key: symbol | Context<T>): void;
44
- /**
45
- * Creates a context key with a default value (React-style compatibility)
46
- *
47
- * @example
48
- * ```ts
49
- * const ThemeContext = createContext({ color: 'blue' })
50
- * // ThemeContext is now typed as Context<{ color: string }>
51
- * const theme = useContext(ThemeContext) // theme is { color: string }
52
- * ```
53
- */
54
- declare function createContext<T>(defaultValue: T): Context<T>;
55
- //#endregion
56
- //#region src/contexts/RootContext.d.ts
57
- type RootContextProps = {
58
- /**
59
- * Exit (unmount) the whole app.
60
- */
61
- exit: (error?: Error) => void;
62
- /**
63
- * TreeNode representing the tree structure of the app.
64
- */
65
- treeNode: TreeNode<ComponentNode>;
66
- /**
67
- * FileManager instance for managing files within the app.
68
- */
69
- fileManager: FileManager;
70
- };
71
- /**
72
- * Context providing root-level functionalities such as exit hook, tree node structure, and file management.
73
- * Define in the `render` helper of the runtime.
74
- */
75
- declare const RootContext: Context<RootContextProps>;
76
- //#endregion
77
- //#region src/types.d.ts
78
- type JSDoc = {
79
- comments: string[];
80
- };
81
- //#endregion
82
- export { createContext as a, unprovide as c, Context as i, ComponentNode as l, RootContext as n, inject as o, RootContextProps as r, provide as s, JSDoc as t, useNodeTree as u };
83
- //# sourceMappingURL=types-yNaQHNUB.d.ts.map
@@ -1,27 +0,0 @@
1
- type Props = {
2
- /**
3
- * Children nodes.
4
- */
5
- children?: string | (() => string | Array<string> | undefined)
6
- }
7
-
8
- /**
9
- * Generates a text node from string or function returning string/array of strings.
10
- */
11
- export function Text({ children }: Props): string {
12
- if (!children) {
13
- return ''
14
- }
15
-
16
- if (typeof children === 'string') {
17
- return children
18
- }
19
-
20
- const value = children()
21
-
22
- if (Array.isArray(value)) {
23
- return value.join('\n')
24
- }
25
-
26
- return value || ''
27
- }