@kubb/fabric-core 0.13.2 → 0.14.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-BOjvMvNC.d.ts → Fabric-CFkgoZwY.d.ts} +4 -1
- package/dist/chunk-MlS0t1Af.cjs +53 -0
- package/dist/chunk-O_arW02_.js +17 -0
- package/dist/defaultParser-D0_-Uy2Z.cjs +19 -0
- package/dist/{defaultParser-BAgmtMo_.cjs.map → defaultParser-D0_-Uy2Z.cjs.map} +1 -1
- package/dist/{defaultParser-C1atU7yU.js → defaultParser-iCpMSYCp.js} +4 -4
- package/dist/{defaultParser-C1atU7yU.js.map → defaultParser-iCpMSYCp.js.map} +1 -1
- package/dist/{getRelativePath-BcieQL5M.js → getRelativePath-NAm_Y-vp.js} +3 -5
- package/dist/{getRelativePath-BcieQL5M.js.map → getRelativePath-NAm_Y-vp.js.map} +1 -1
- package/dist/{getRelativePath-DVG8dIzW.cjs → getRelativePath-WX4HB169.cjs} +18 -21
- package/dist/{getRelativePath-DVG8dIzW.cjs.map → getRelativePath-WX4HB169.cjs.map} +1 -1
- package/dist/index.cjs +75 -93
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +54 -54
- package/dist/index.js +71 -88
- package/dist/index.js.map +1 -1
- package/dist/{onProcessExit-DENCUkMz.cjs → onProcessExit-C2AuepQI.cjs} +213 -227
- package/dist/onProcessExit-C2AuepQI.cjs.map +1 -0
- package/dist/{onProcessExit-B0rJqX4s.js → onProcessExit-Cput7j2c.js} +124 -137
- package/dist/onProcessExit-Cput7j2c.js.map +1 -0
- package/dist/parsers/typescript.cjs +4 -5
- package/dist/parsers/typescript.cjs.map +1 -1
- package/dist/parsers/typescript.d.ts +2 -1
- package/dist/parsers/typescript.js +3 -3
- package/dist/parsers/typescript.js.map +1 -1
- package/dist/parsers.cjs +6 -6
- package/dist/parsers.cjs.map +1 -1
- package/dist/parsers.d.ts +2 -1
- package/dist/parsers.js +4 -4
- package/dist/plugins.cjs +7 -13
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.ts +5 -4
- package/dist/plugins.js +6 -11
- package/dist/plugins.js.map +1 -1
- package/dist/{RootContext-BQHfIhhC.d.ts → types-BwR3_cUx.d.ts} +10 -4
- package/dist/types.cjs +13 -15
- package/dist/types.d.ts +4 -11
- package/dist/types.js +2 -3
- package/dist/{useNodeTree-Brj-fAVZ.d.ts → useNodeTree-Wc1WxA05.d.ts} +3 -2
- package/package.json +4 -3
- package/src/components/{App.ts → Fabric.ts} +8 -8
- package/src/composables/{useApp.ts → useFabric.ts} +4 -4
- package/src/contexts/{AppContext.ts → FabricContext.ts} +2 -2
- package/src/index.ts +4 -6
- package/src/plugins/fsxPlugin/fsxPlugin.ts +4 -4
- package/dist/Fabric-w9Y9duM6.d.ts +0 -516
- package/dist/RootContext-Cbs-UQXM.d.ts +0 -26
- package/dist/chunk-BYypO7fO.js +0 -18
- package/dist/chunk-uaV2rQ02.cjs +0 -53
- package/dist/defaultParser-BAgmtMo_.cjs +0 -20
- package/dist/onProcessExit-B0rJqX4s.js.map +0 -1
- package/dist/onProcessExit-DENCUkMz.cjs.map +0 -1
- 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,6 +1,6 @@
|
|
|
1
|
-
const require_chunk = require(
|
|
2
|
-
const require_getRelativePath = require(
|
|
3
|
-
const require_defaultParser = require(
|
|
1
|
+
const require_chunk = require("./chunk-MlS0t1Af.cjs");
|
|
2
|
+
const require_getRelativePath = require("./getRelativePath-WX4HB169.cjs");
|
|
3
|
+
const require_defaultParser = require("./defaultParser-D0_-Uy2Z.cjs");
|
|
4
4
|
let remeda = require("remeda");
|
|
5
5
|
let node_crypto = require("node:crypto");
|
|
6
6
|
let node_path = require("node:path");
|
|
@@ -8,7 +8,6 @@ node_path = require_chunk.__toESM(node_path);
|
|
|
8
8
|
let p_limit = require("p-limit");
|
|
9
9
|
p_limit = require_chunk.__toESM(p_limit);
|
|
10
10
|
let node_events = require("node:events");
|
|
11
|
-
|
|
12
11
|
//#region src/context.ts
|
|
13
12
|
/**
|
|
14
13
|
* Context stack for tracking the current context values
|
|
@@ -73,14 +72,130 @@ function createContext(defaultValue) {
|
|
|
73
72
|
contextDefaults.set(key, defaultValue);
|
|
74
73
|
return key;
|
|
75
74
|
}
|
|
76
|
-
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/contexts/RenderContext.ts
|
|
77
|
+
/**
|
|
78
|
+
* Provides a context for tracking rendering state such as indentation and line length.
|
|
79
|
+
*/
|
|
80
|
+
const RenderContext = createContext({
|
|
81
|
+
indentLevel: 0,
|
|
82
|
+
indentSize: 2,
|
|
83
|
+
currentLineLength: 0,
|
|
84
|
+
shouldBreak: false
|
|
85
|
+
});
|
|
86
|
+
//#endregion
|
|
87
|
+
//#region src/intrinsic.ts
|
|
88
|
+
function isFabricElement(value) {
|
|
89
|
+
return typeof value === "function" && "type" in value && "component" in value;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Type guard to check if a value is an intrinsic element
|
|
93
|
+
*/
|
|
94
|
+
function isIntrinsic(value) {
|
|
95
|
+
return value && typeof value === "object" && value.__intrinsic === true;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Render a single intrinsic node
|
|
99
|
+
*/
|
|
100
|
+
function renderIntrinsicNode(node, renderContext) {
|
|
101
|
+
switch (node.type) {
|
|
102
|
+
case "br":
|
|
103
|
+
renderContext.currentLineLength = 0;
|
|
104
|
+
return "\n";
|
|
105
|
+
case "indent":
|
|
106
|
+
renderContext.indentLevel++;
|
|
107
|
+
return "";
|
|
108
|
+
case "dedent":
|
|
109
|
+
renderContext.indentLevel = Math.max(0, renderContext.indentLevel - 1);
|
|
110
|
+
return "";
|
|
111
|
+
default: return "";
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Helper: render a plain string while applying current indentation at the
|
|
116
|
+
* start of each logical line. This ensures `${indent}` intrinsics affect
|
|
117
|
+
* subsequent string content.
|
|
118
|
+
*/
|
|
119
|
+
function renderIndent(content, renderContext) {
|
|
120
|
+
if (content.length === 0) return "";
|
|
121
|
+
const indentStr = " ".repeat(renderContext.indentLevel * renderContext.indentSize);
|
|
122
|
+
const lines = content.split("\n");
|
|
123
|
+
let out = "";
|
|
124
|
+
for (const [i, line] of lines.entries()) {
|
|
125
|
+
if (renderContext.currentLineLength === 0 && line.length > 0) {
|
|
126
|
+
out += indentStr + line;
|
|
127
|
+
renderContext.currentLineLength = indentStr.length + line.length;
|
|
128
|
+
} else {
|
|
129
|
+
out += line;
|
|
130
|
+
renderContext.currentLineLength += line.length;
|
|
131
|
+
}
|
|
132
|
+
if (i !== lines.length - 1) {
|
|
133
|
+
out += "\n";
|
|
134
|
+
renderContext.currentLineLength = 0;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
function renderIntrinsic(children, context) {
|
|
140
|
+
const renderContext = context || inject(RenderContext);
|
|
141
|
+
provide(RenderContext, renderContext);
|
|
142
|
+
if (!children) return "";
|
|
143
|
+
if (isFabricElement(children)) try {
|
|
144
|
+
return renderIntrinsic(children());
|
|
145
|
+
} catch {
|
|
146
|
+
return "";
|
|
147
|
+
}
|
|
148
|
+
if (Array.isArray(children)) return children.map((child) => renderIntrinsic(child)).join("");
|
|
149
|
+
if (isIntrinsic(children)) return renderIntrinsicNode(children, renderContext);
|
|
150
|
+
if (typeof children === "function") return renderIntrinsic(children());
|
|
151
|
+
if (typeof children === "string") return renderIndent(children, renderContext);
|
|
152
|
+
if (typeof children === "number") return renderIndent(String(children), renderContext);
|
|
153
|
+
if (typeof children === "boolean") return renderIndent(children ? "true" : "false", renderContext);
|
|
154
|
+
try {
|
|
155
|
+
return renderIndent(children, renderContext);
|
|
156
|
+
} catch {
|
|
157
|
+
return "";
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Create an intrinsic element
|
|
162
|
+
*/
|
|
163
|
+
function createIntrinsic(type) {
|
|
164
|
+
return {
|
|
165
|
+
type,
|
|
166
|
+
__intrinsic: true
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/createComponent.ts
|
|
171
|
+
function createComponent(type, Component) {
|
|
172
|
+
return (...args) => {
|
|
173
|
+
const fn = (() => renderIntrinsic(Component(args[0])));
|
|
174
|
+
fn.component = Component;
|
|
175
|
+
fn.props = args[0];
|
|
176
|
+
fn.type = type;
|
|
177
|
+
fn.children = (...children) => {
|
|
178
|
+
const propsWithChildren = {
|
|
179
|
+
...args[0] ?? {},
|
|
180
|
+
children() {
|
|
181
|
+
return renderIntrinsic(children);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const fnChild = (() => renderIntrinsic(Component(propsWithChildren)));
|
|
185
|
+
fnChild.component = Component;
|
|
186
|
+
fnChild.props = args[0];
|
|
187
|
+
fnChild.type = type;
|
|
188
|
+
return fnChild;
|
|
189
|
+
};
|
|
190
|
+
return fn;
|
|
191
|
+
};
|
|
192
|
+
}
|
|
77
193
|
//#endregion
|
|
78
194
|
//#region src/contexts/NodeTreeContext.ts
|
|
79
195
|
/**
|
|
80
196
|
* Context for having the current NodeTree
|
|
81
197
|
*/
|
|
82
198
|
const NodeTreeContext = createContext(null);
|
|
83
|
-
|
|
84
199
|
//#endregion
|
|
85
200
|
//#region src/createFile.ts
|
|
86
201
|
function combineSources(sources) {
|
|
@@ -192,7 +307,6 @@ function createFile(file) {
|
|
|
192
307
|
meta: file.meta || {}
|
|
193
308
|
};
|
|
194
309
|
}
|
|
195
|
-
|
|
196
310
|
//#endregion
|
|
197
311
|
//#region src/utils/AsyncEventEmitter.ts
|
|
198
312
|
var AsyncEventEmitter = class {
|
|
@@ -243,7 +357,6 @@ var AsyncEventEmitter = class {
|
|
|
243
357
|
this.#emitter.removeAllListeners();
|
|
244
358
|
}
|
|
245
359
|
};
|
|
246
|
-
|
|
247
360
|
//#endregion
|
|
248
361
|
//#region src/FileProcessor.ts
|
|
249
362
|
var FileProcessor = class {
|
|
@@ -298,7 +411,6 @@ var FileProcessor = class {
|
|
|
298
411
|
return files;
|
|
299
412
|
}
|
|
300
413
|
};
|
|
301
|
-
|
|
302
414
|
//#endregion
|
|
303
415
|
//#region src/utils/Cache.ts
|
|
304
416
|
var Cache = class {
|
|
@@ -323,7 +435,6 @@ var Cache = class {
|
|
|
323
435
|
}
|
|
324
436
|
flush() {}
|
|
325
437
|
};
|
|
326
|
-
|
|
327
438
|
//#endregion
|
|
328
439
|
//#region src/FileManager.ts
|
|
329
440
|
function mergeFile(a, b) {
|
|
@@ -425,7 +536,6 @@ var FileManager = class {
|
|
|
425
536
|
return resolvedFiles;
|
|
426
537
|
}
|
|
427
538
|
};
|
|
428
|
-
|
|
429
539
|
//#endregion
|
|
430
540
|
//#region src/utils/TreeNode.ts
|
|
431
541
|
var TreeNode = class TreeNode {
|
|
@@ -537,7 +647,6 @@ var TreeNode = class TreeNode {
|
|
|
537
647
|
return treeNode;
|
|
538
648
|
}
|
|
539
649
|
};
|
|
540
|
-
|
|
541
650
|
//#endregion
|
|
542
651
|
//#region src/contexts/RootContext.ts
|
|
543
652
|
/**
|
|
@@ -552,128 +661,6 @@ const RootContext = createContext({
|
|
|
552
661
|
}),
|
|
553
662
|
fileManager: new FileManager()
|
|
554
663
|
});
|
|
555
|
-
|
|
556
|
-
//#endregion
|
|
557
|
-
//#region src/contexts/RenderContext.ts
|
|
558
|
-
/**
|
|
559
|
-
* Provides a context for tracking rendering state such as indentation and line length.
|
|
560
|
-
*/
|
|
561
|
-
const RenderContext = createContext({
|
|
562
|
-
indentLevel: 0,
|
|
563
|
-
indentSize: 2,
|
|
564
|
-
currentLineLength: 0,
|
|
565
|
-
shouldBreak: false
|
|
566
|
-
});
|
|
567
|
-
|
|
568
|
-
//#endregion
|
|
569
|
-
//#region src/intrinsic.ts
|
|
570
|
-
function isFabricElement(value) {
|
|
571
|
-
return typeof value === "function" && "type" in value && "component" in value;
|
|
572
|
-
}
|
|
573
|
-
/**
|
|
574
|
-
* Type guard to check if a value is an intrinsic element
|
|
575
|
-
*/
|
|
576
|
-
function isIntrinsic(value) {
|
|
577
|
-
return value && typeof value === "object" && value.__intrinsic === true;
|
|
578
|
-
}
|
|
579
|
-
/**
|
|
580
|
-
* Render a single intrinsic node
|
|
581
|
-
*/
|
|
582
|
-
function renderIntrinsicNode(node, renderContext) {
|
|
583
|
-
switch (node.type) {
|
|
584
|
-
case "br":
|
|
585
|
-
renderContext.currentLineLength = 0;
|
|
586
|
-
return "\n";
|
|
587
|
-
case "indent":
|
|
588
|
-
renderContext.indentLevel++;
|
|
589
|
-
return "";
|
|
590
|
-
case "dedent":
|
|
591
|
-
renderContext.indentLevel = Math.max(0, renderContext.indentLevel - 1);
|
|
592
|
-
return "";
|
|
593
|
-
default: return "";
|
|
594
|
-
}
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* Helper: render a plain string while applying current indentation at the
|
|
598
|
-
* start of each logical line. This ensures `${indent}` intrinsics affect
|
|
599
|
-
* subsequent string content.
|
|
600
|
-
*/
|
|
601
|
-
function renderIndent(content, renderContext) {
|
|
602
|
-
if (content.length === 0) return "";
|
|
603
|
-
const indentStr = " ".repeat(renderContext.indentLevel * renderContext.indentSize);
|
|
604
|
-
const lines = content.split("\n");
|
|
605
|
-
let out = "";
|
|
606
|
-
for (const [i, line] of lines.entries()) {
|
|
607
|
-
if (renderContext.currentLineLength === 0 && line.length > 0) {
|
|
608
|
-
out += indentStr + line;
|
|
609
|
-
renderContext.currentLineLength = indentStr.length + line.length;
|
|
610
|
-
} else {
|
|
611
|
-
out += line;
|
|
612
|
-
renderContext.currentLineLength += line.length;
|
|
613
|
-
}
|
|
614
|
-
if (i !== lines.length - 1) {
|
|
615
|
-
out += "\n";
|
|
616
|
-
renderContext.currentLineLength = 0;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
return out;
|
|
620
|
-
}
|
|
621
|
-
function renderIntrinsic(children, context) {
|
|
622
|
-
const renderContext = context || inject(RenderContext);
|
|
623
|
-
provide(RenderContext, renderContext);
|
|
624
|
-
if (!children) return "";
|
|
625
|
-
if (isFabricElement(children)) try {
|
|
626
|
-
return renderIntrinsic(children());
|
|
627
|
-
} catch {
|
|
628
|
-
return "";
|
|
629
|
-
}
|
|
630
|
-
if (Array.isArray(children)) return children.map((child) => renderIntrinsic(child)).join("");
|
|
631
|
-
if (isIntrinsic(children)) return renderIntrinsicNode(children, renderContext);
|
|
632
|
-
if (typeof children === "function") return renderIntrinsic(children());
|
|
633
|
-
if (typeof children === "string") return renderIndent(children, renderContext);
|
|
634
|
-
if (typeof children === "number") return renderIndent(String(children), renderContext);
|
|
635
|
-
if (typeof children === "boolean") return renderIndent(children ? "true" : "false", renderContext);
|
|
636
|
-
try {
|
|
637
|
-
return renderIndent(children, renderContext);
|
|
638
|
-
} catch {
|
|
639
|
-
return "";
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* Create an intrinsic element
|
|
644
|
-
*/
|
|
645
|
-
function createIntrinsic(type) {
|
|
646
|
-
return {
|
|
647
|
-
type,
|
|
648
|
-
__intrinsic: true
|
|
649
|
-
};
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
//#endregion
|
|
653
|
-
//#region src/createComponent.ts
|
|
654
|
-
function createComponent(type, Component) {
|
|
655
|
-
return (...args) => {
|
|
656
|
-
const fn = (() => renderIntrinsic(Component(args[0])));
|
|
657
|
-
fn.component = Component;
|
|
658
|
-
fn.props = args[0];
|
|
659
|
-
fn.type = type;
|
|
660
|
-
fn.children = (...children) => {
|
|
661
|
-
const propsWithChildren = {
|
|
662
|
-
...args[0] ?? {},
|
|
663
|
-
children() {
|
|
664
|
-
return renderIntrinsic(children);
|
|
665
|
-
}
|
|
666
|
-
};
|
|
667
|
-
const fnChild = (() => renderIntrinsic(Component(propsWithChildren)));
|
|
668
|
-
fnChild.component = Component;
|
|
669
|
-
fnChild.props = args[0];
|
|
670
|
-
fnChild.type = type;
|
|
671
|
-
return fnChild;
|
|
672
|
-
};
|
|
673
|
-
return fn;
|
|
674
|
-
};
|
|
675
|
-
}
|
|
676
|
-
|
|
677
664
|
//#endregion
|
|
678
665
|
//#region src/components/Root.ts
|
|
679
666
|
/**
|
|
@@ -712,7 +699,6 @@ const Root = createComponent("Root", ({ onError, onExit, treeNode, fileManager,
|
|
|
712
699
|
}
|
|
713
700
|
});
|
|
714
701
|
Root.displayName = "Root";
|
|
715
|
-
|
|
716
702
|
//#endregion
|
|
717
703
|
//#region src/utils/onProcessExit.ts
|
|
718
704
|
const SIGNALS = [
|
|
@@ -752,114 +738,114 @@ function onProcessExit(callback) {
|
|
|
752
738
|
}
|
|
753
739
|
return unsubscribe;
|
|
754
740
|
}
|
|
755
|
-
|
|
756
741
|
//#endregion
|
|
757
|
-
Object.defineProperty(exports,
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
742
|
+
Object.defineProperty(exports, "AsyncEventEmitter", {
|
|
743
|
+
enumerable: true,
|
|
744
|
+
get: function() {
|
|
745
|
+
return AsyncEventEmitter;
|
|
746
|
+
}
|
|
762
747
|
});
|
|
763
|
-
Object.defineProperty(exports,
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
748
|
+
Object.defineProperty(exports, "FileManager", {
|
|
749
|
+
enumerable: true,
|
|
750
|
+
get: function() {
|
|
751
|
+
return FileManager;
|
|
752
|
+
}
|
|
768
753
|
});
|
|
769
|
-
Object.defineProperty(exports,
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
754
|
+
Object.defineProperty(exports, "FileProcessor", {
|
|
755
|
+
enumerable: true,
|
|
756
|
+
get: function() {
|
|
757
|
+
return FileProcessor;
|
|
758
|
+
}
|
|
774
759
|
});
|
|
775
|
-
Object.defineProperty(exports,
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
760
|
+
Object.defineProperty(exports, "NodeTreeContext", {
|
|
761
|
+
enumerable: true,
|
|
762
|
+
get: function() {
|
|
763
|
+
return NodeTreeContext;
|
|
764
|
+
}
|
|
780
765
|
});
|
|
781
|
-
Object.defineProperty(exports,
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
766
|
+
Object.defineProperty(exports, "RenderContext", {
|
|
767
|
+
enumerable: true,
|
|
768
|
+
get: function() {
|
|
769
|
+
return RenderContext;
|
|
770
|
+
}
|
|
786
771
|
});
|
|
787
|
-
Object.defineProperty(exports,
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
772
|
+
Object.defineProperty(exports, "Root", {
|
|
773
|
+
enumerable: true,
|
|
774
|
+
get: function() {
|
|
775
|
+
return Root;
|
|
776
|
+
}
|
|
792
777
|
});
|
|
793
|
-
Object.defineProperty(exports,
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
778
|
+
Object.defineProperty(exports, "RootContext", {
|
|
779
|
+
enumerable: true,
|
|
780
|
+
get: function() {
|
|
781
|
+
return RootContext;
|
|
782
|
+
}
|
|
798
783
|
});
|
|
799
|
-
Object.defineProperty(exports,
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
784
|
+
Object.defineProperty(exports, "TreeNode", {
|
|
785
|
+
enumerable: true,
|
|
786
|
+
get: function() {
|
|
787
|
+
return TreeNode;
|
|
788
|
+
}
|
|
804
789
|
});
|
|
805
|
-
Object.defineProperty(exports,
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
790
|
+
Object.defineProperty(exports, "createComponent", {
|
|
791
|
+
enumerable: true,
|
|
792
|
+
get: function() {
|
|
793
|
+
return createComponent;
|
|
794
|
+
}
|
|
810
795
|
});
|
|
811
|
-
Object.defineProperty(exports,
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
796
|
+
Object.defineProperty(exports, "createContext", {
|
|
797
|
+
enumerable: true,
|
|
798
|
+
get: function() {
|
|
799
|
+
return createContext;
|
|
800
|
+
}
|
|
816
801
|
});
|
|
817
|
-
Object.defineProperty(exports,
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
802
|
+
Object.defineProperty(exports, "createFile", {
|
|
803
|
+
enumerable: true,
|
|
804
|
+
get: function() {
|
|
805
|
+
return createFile;
|
|
806
|
+
}
|
|
822
807
|
});
|
|
823
|
-
Object.defineProperty(exports,
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
808
|
+
Object.defineProperty(exports, "createIntrinsic", {
|
|
809
|
+
enumerable: true,
|
|
810
|
+
get: function() {
|
|
811
|
+
return createIntrinsic;
|
|
812
|
+
}
|
|
828
813
|
});
|
|
829
|
-
Object.defineProperty(exports,
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
814
|
+
Object.defineProperty(exports, "inject", {
|
|
815
|
+
enumerable: true,
|
|
816
|
+
get: function() {
|
|
817
|
+
return inject;
|
|
818
|
+
}
|
|
834
819
|
});
|
|
835
|
-
Object.defineProperty(exports,
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
820
|
+
Object.defineProperty(exports, "onProcessExit", {
|
|
821
|
+
enumerable: true,
|
|
822
|
+
get: function() {
|
|
823
|
+
return onProcessExit;
|
|
824
|
+
}
|
|
840
825
|
});
|
|
841
|
-
Object.defineProperty(exports,
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
826
|
+
Object.defineProperty(exports, "provide", {
|
|
827
|
+
enumerable: true,
|
|
828
|
+
get: function() {
|
|
829
|
+
return provide;
|
|
830
|
+
}
|
|
846
831
|
});
|
|
847
|
-
Object.defineProperty(exports,
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
832
|
+
Object.defineProperty(exports, "renderIndent", {
|
|
833
|
+
enumerable: true,
|
|
834
|
+
get: function() {
|
|
835
|
+
return renderIndent;
|
|
836
|
+
}
|
|
852
837
|
});
|
|
853
|
-
Object.defineProperty(exports,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
838
|
+
Object.defineProperty(exports, "renderIntrinsic", {
|
|
839
|
+
enumerable: true,
|
|
840
|
+
get: function() {
|
|
841
|
+
return renderIntrinsic;
|
|
842
|
+
}
|
|
858
843
|
});
|
|
859
|
-
Object.defineProperty(exports,
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
844
|
+
Object.defineProperty(exports, "unprovide", {
|
|
845
|
+
enumerable: true,
|
|
846
|
+
get: function() {
|
|
847
|
+
return unprovide;
|
|
848
|
+
}
|
|
864
849
|
});
|
|
865
|
-
|
|
850
|
+
|
|
851
|
+
//# sourceMappingURL=onProcessExit-C2AuepQI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onProcessExit-C2AuepQI.cjs","names":["path","trimExtName","#emitter","#mode","NodeEventEmitter","defaultParser","#limit","#buffer","#resolveName","#resolvePath","#cache","#filesCache","trimExtName","#childrenMap","#cachedLeaves"],"sources":["../src/context.ts","../src/contexts/RenderContext.ts","../src/intrinsic.ts","../src/createComponent.ts","../src/contexts/NodeTreeContext.ts","../src/createFile.ts","../src/utils/AsyncEventEmitter.ts","../src/FileProcessor.ts","../src/utils/Cache.ts","../src/FileManager.ts","../src/utils/TreeNode.ts","../src/contexts/RootContext.ts","../src/components/Root.ts","../src/utils/onProcessExit.ts"],"sourcesContent":["/**\n * Context type that carries type information about its value\n * This is a branded symbol type that enables type-safe context usage\n */\nexport type Context<T> = symbol & { readonly __type: T }\n\n/**\n * Context stack for tracking the current context values\n *\n * Note: This uses a global Map for simplicity in code generation scenarios.\n * For concurrent runtime execution, consider using AsyncLocalStorage or\n * instance-based context management.\n */\nconst contextStack = new Map<symbol, unknown[]>()\nconst contextDefaults = new Map<symbol, unknown>()\n\n/**\n * Provides a value to descendant components (Vue 3 style)\n *\n * @example\n * ```ts\n * const ThemeKey = Symbol('theme')\n * provide(ThemeKey, { color: 'blue' })\n * ```\n */\nexport function provide<T>(key: symbol | Context<T>, value: T): void {\n if (!contextStack.has(key)) {\n contextStack.set(key, [])\n }\n contextStack.get(key)!.push(value)\n}\n\n/**\n * Injects a value provided by an ancestor component (Vue 3 style)\n *\n * @example\n * ```ts\n * const theme = inject(ThemeKey, { color: 'default' })\n * ```\n */\nexport function inject<T>(key: symbol | Context<T>, defaultValue?: T): T {\n const stack = contextStack.get(key)\n if (!stack || stack.length === 0) {\n if (defaultValue !== undefined) {\n return defaultValue\n }\n const storedDefault = contextDefaults.get(key)\n if (storedDefault !== undefined) {\n return storedDefault as T\n }\n throw new Error(`No value provided for key: ${key.toString()}`)\n }\n return stack[stack.length - 1] as T\n}\n\n/**\n * Unprovides a value (for cleanup)\n * @internal\n */\nexport function unprovide<T>(key: symbol | Context<T>): void {\n const stack = contextStack.get(key)\n if (stack && stack.length > 0) {\n stack.pop()\n }\n}\n\n/**\n * Creates a context key with a default value (React-style compatibility)\n *\n * @example\n * ```ts\n * const ThemeContext = createContext({ color: 'blue' })\n * // ThemeContext is now typed as Context<{ color: string }>\n * const theme = useContext(ThemeContext) // theme is { color: string }\n * ```\n */\nexport function createContext<T>(defaultValue: T): Context<T> {\n const key = Symbol('context') as Context<T>\n contextDefaults.set(key, defaultValue)\n\n return key\n}\n","import { createContext } from '../context.ts'\n\nexport type RenderContextProps = {\n indentLevel: number\n indentSize: number\n currentLineLength: number\n shouldBreak: boolean\n}\n\n/**\n * Provides a context for tracking rendering state such as indentation and line length.\n */\nexport const RenderContext = createContext<RenderContextProps>({ indentLevel: 0, indentSize: 2, currentLineLength: 0, shouldBreak: false })\n","import { inject, provide } from './context.ts'\nimport { RenderContext, type RenderContextProps } from './contexts/RenderContext.ts'\nimport type { FabricElement, FabricNode } from './Fabric.ts'\n\ntype IntrinsicType =\n | 'br' // Line break - adds newline with current indentation\n | 'indent' // Increase indentation level\n | 'dedent' // Decrease indentation level\n\nexport type Intrinsic = {\n type: IntrinsicType\n __intrinsic: true\n}\n\nfunction isFabricElement<TProps extends object = object>(value: any): value is FabricElement<TProps> {\n return typeof value === 'function' && 'type' in value && 'component' in value\n}\n\n/**\n * Type guard to check if a value is an intrinsic element\n */\nexport function isIntrinsic(value: any): value is Intrinsic {\n return value && typeof value === 'object' && value.__intrinsic === true\n}\n\n/**\n * Render a single intrinsic node\n */\nfunction renderIntrinsicNode(node: Intrinsic, renderContext: RenderContextProps): string {\n switch (node.type) {\n case 'br':\n renderContext.currentLineLength = 0\n return '\\n'\n\n case 'indent':\n renderContext.indentLevel++\n return ''\n\n case 'dedent':\n renderContext.indentLevel = Math.max(0, renderContext.indentLevel - 1)\n return ''\n\n default:\n return ''\n }\n}\n\n/**\n * Helper: render a plain string while applying current indentation at the\n * start of each logical line. This ensures `${indent}` intrinsics affect\n * subsequent string content.\n */\nexport function renderIndent(content: string, renderContext: RenderContextProps): string {\n if (content.length === 0) {\n return ''\n }\n\n const indentStr = ' '.repeat(renderContext.indentLevel * renderContext.indentSize)\n const lines = content.split('\\n')\n let out = ''\n\n for (const [i, line] of lines.entries()) {\n if (renderContext.currentLineLength === 0 && line.length > 0) {\n // At start of a (logical) line: prefix indentation\n out += indentStr + line\n renderContext.currentLineLength = indentStr.length + line.length\n } else {\n out += line\n renderContext.currentLineLength += line.length\n }\n\n // If not the last line, add newline and reset line length so next line gets indentation\n if (i !== lines.length - 1) {\n out += '\\n'\n renderContext.currentLineLength = 0\n }\n }\n\n return out\n}\n\nexport function renderIntrinsic(children: FabricNode, context?: RenderContextProps): string {\n const renderContext = context || inject(RenderContext)\n\n provide(RenderContext, renderContext)\n\n if (!children) {\n return ''\n }\n\n if (isFabricElement(children)) {\n try {\n // FabricElements are already wrapped in transform by createComponent\n // Just call them and return the result (which is already a string)\n const result = children()\n return renderIntrinsic(result)\n } catch {\n return ''\n }\n }\n\n if (Array.isArray(children)) {\n return children.map((child) => renderIntrinsic(child)).join('')\n }\n\n if (isIntrinsic(children)) {\n // Render intrinsic node(s) using the shared render context\n return renderIntrinsicNode(children, renderContext)\n }\n\n if (typeof children === 'function') {\n return renderIntrinsic(children())\n }\n\n if (typeof children === 'string') {\n return renderIndent(children, renderContext)\n }\n\n if (typeof children === 'number') {\n return renderIndent(String(children), renderContext)\n }\n\n if (typeof children === 'boolean') {\n return renderIndent(children ? 'true' : 'false', renderContext)\n }\n\n // Fallback for FabricElement/object-like values\n try {\n return renderIndent(children, renderContext)\n } catch {\n return ''\n }\n}\n\n/**\n * Create an intrinsic element\n */\nexport function createIntrinsic(type: IntrinsicType): Intrinsic {\n return {\n type,\n __intrinsic: true,\n }\n}\n","import type { FabricComponent, FabricElement, FabricNode } from './Fabric.ts'\nimport { renderIntrinsic } from './intrinsic.ts'\n\ntype MakeChildrenOptional<T extends object> = T extends { children?: any } ? Omit<T, 'children'> & Partial<Pick<T, 'children'>> : T\n\nexport type ComponentBuilder<T extends object> = {\n (...args: unknown extends T ? [] : {} extends Omit<T, 'children'> ? [props?: MakeChildrenOptional<T>] : [props: MakeChildrenOptional<T>]): FabricComponent<T>\n displayName?: string | undefined\n}\n\nexport function createComponent<TProps extends object>(type: string, Component: (props: TProps) => FabricNode): ComponentBuilder<TProps> {\n return (...args) => {\n const fn: FabricComponent<TProps> = (() => renderIntrinsic(Component(args[0] as TProps) as FabricNode)) as any\n fn.component = Component\n fn.props = args[0]! as TProps\n fn.type = type\n fn.children = (...children: Array<FabricNode>) => {\n const propsWithChildren = {\n ...(args[0] ?? {}),\n children() {\n return renderIntrinsic(children)\n },\n } as unknown as TProps\n\n const fnChild = (() => renderIntrinsic(Component(propsWithChildren) as FabricNode)) as FabricElement<TProps>\n fnChild.component = Component\n fnChild.props = args[0]! as TProps\n fnChild.type = type\n return fnChild\n }\n\n return fn\n }\n}\n","import type { ComponentNode } from '../composables/useNodeTree.ts'\nimport { createContext } from '../context.ts'\nimport type { TreeNode } from '../utils/TreeNode.ts'\n\n/**\n * Context for having the current NodeTree\n */\nexport const NodeTreeContext = createContext<TreeNode<ComponentNode> | null>(null)\n","import { createHash } from 'node:crypto'\nimport path from 'node:path'\nimport { sortBy, uniqueBy } from 'remeda'\nimport type * as KubbFile from './KubbFile.ts'\nimport { trimExtName } from './utils/trimExtName.ts'\n\nexport function combineSources(sources: Array<KubbFile.Source>): Array<KubbFile.Source> {\n return uniqueBy(sources, (obj) => {\n // For named sources, deduplicate by name, isExportable, and isTypeOnly\n // For unnamed sources, include the value to avoid deduplicating different code blocks\n // If both name and value are undefined, use an empty string as the unique identifier\n const uniqueId = obj.name ?? obj.value ?? ''\n const isExportable = obj.isExportable ?? false\n const isTypeOnly = obj.isTypeOnly ?? false\n return `${uniqueId}:${isExportable}:${isTypeOnly}`\n })\n}\n\nexport function combineExports(exports: Array<KubbFile.Export>): Array<KubbFile.Export> {\n const sorted = sortBy(\n exports,\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n // join with null byte — can't appear in identifiers, so avoids collisions between e.g. ['a','b'] and ['a,b']\n (v) => (Array.isArray(v.name) ? [...v.name].sort().join('\\0') : (v.name ?? '')),\n )\n\n const prev: Array<KubbFile.Export> = []\n // Map to track items by path for O(1) lookup\n const pathMap = new Map<string, KubbFile.Export>()\n // Map to track unique items by path+name+isTypeOnly+asAlias\n const uniqueMap = new Map<string, KubbFile.Export>()\n\n for (const curr of sorted) {\n const name = curr.name\n const pathKey = curr.path\n const prevByPath = pathMap.get(pathKey)\n\n // Create unique key for path+name+isTypeOnly\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${pathKey}:${nameKey}:${curr.isTypeOnly}`\n\n // Create unique key for path+name+isTypeOnly+asAlias\n const uniqueKey = `${pathNameTypeKey}:${curr.asAlias || ''}`\n const uniquePrev = uniqueMap.get(uniqueKey)\n\n // we already have an item that was unique enough or name field is empty or prev asAlias is set but current has no changes\n if (uniquePrev || (Array.isArray(name) && !name.length) || (prevByPath?.asAlias && !curr.asAlias)) {\n continue\n }\n\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name: Array.isArray(name) ? [...new Set(name)] : name,\n }\n prev.push(newItem)\n pathMap.set(pathKey, newItem)\n uniqueMap.set(uniqueKey, newItem)\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])]\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(uniqueKey, curr)\n }\n\n return prev\n}\n\nexport function combineImports(imports: Array<KubbFile.Import>, exports: Array<KubbFile.Export>, source?: string): Array<KubbFile.Import> {\n const exportedNameLookup = new Set<string>()\n for (const item of exports) {\n const { name } = item\n if (!name) {\n continue\n }\n\n if (Array.isArray(name)) {\n for (const value of name) {\n if (value) {\n exportedNameLookup.add(value)\n }\n }\n continue\n }\n\n exportedNameLookup.add(name)\n }\n\n const usageCache = new Map<string, boolean>()\n const hasImportInSource = (importName: string): boolean => {\n if (!source) {\n return true\n }\n\n const cached = usageCache.get(importName)\n if (cached !== undefined) {\n return cached\n }\n\n const isUsed = source.includes(importName) || exportedNameLookup.has(importName)\n usageCache.set(importName, isUsed)\n\n return isUsed\n }\n\n const sorted = sortBy(\n imports,\n (v) => Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n // join with null byte — can't appear in identifiers, so avoids collisions between e.g. ['a','b'] and ['a,b']\n (v) => (Array.isArray(v.name) ? [...v.name].sort().join('\\0') : (v.name ?? '')),\n )\n\n const prev: Array<KubbFile.Import> = []\n // Map to track items by path+isTypeOnly for O(1) lookup\n const pathTypeMap = new Map<string, KubbFile.Import>()\n // Map to track unique items by path+name+isTypeOnly\n const uniqueMap = new Map<string, KubbFile.Import>()\n\n for (const curr of sorted) {\n let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name\n\n if (curr.path === curr.root) {\n // root and path are the same file, remove the \"./\" import\n continue\n }\n\n // merge all names and check if the importName is being used in the generated source and if not filter those imports out\n if (Array.isArray(name)) {\n name = name.filter((item) => (typeof item === 'string' ? hasImportInSource(item) : hasImportInSource(item.propertyName)))\n }\n\n const pathTypeKey = `${curr.path}:${curr.isTypeOnly}`\n const prevByPath = pathTypeMap.get(pathTypeKey)\n\n // Create key for name comparison\n const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || ''\n const pathNameTypeKey = `${curr.path}:${nameKey}:${curr.isTypeOnly}`\n const uniquePrev = uniqueMap.get(pathNameTypeKey)\n\n // already unique enough or name is empty\n if (uniquePrev || (Array.isArray(name) && !name.length)) {\n continue\n }\n\n // new item, append name\n if (!prevByPath) {\n const newItem = {\n ...curr,\n name,\n }\n prev.push(newItem)\n pathTypeMap.set(pathTypeKey, newItem)\n uniqueMap.set(pathNameTypeKey, newItem)\n continue\n }\n\n // merge all names when prev and current both have the same isTypeOnly set\n if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {\n prevByPath.name = [...new Set([...prevByPath.name, ...name])]\n continue\n }\n\n // no import was found in the source, ignore import\n if (!Array.isArray(name) && name && !hasImportInSource(name)) {\n continue\n }\n\n prev.push(curr)\n uniqueMap.set(pathNameTypeKey, curr)\n }\n\n return prev\n}\n\n/**\n * Helper to create a file with name and id set\n */\nexport function createFile<TMeta extends object = object>(file: KubbFile.File<TMeta>): KubbFile.ResolvedFile<TMeta> {\n const extname = path.extname(file.baseName) as KubbFile.Extname\n if (!extname) {\n throw new Error(`No extname found for ${file.baseName}`)\n }\n\n const source = file.sources.map((item) => item.value).join('\\n\\n')\n const exports = file.exports?.length ? combineExports(file.exports) : []\n const imports = file.imports?.length && source ? combineImports(file.imports, exports, source) : []\n const sources = file.sources?.length ? combineSources(file.sources) : []\n\n return {\n ...file,\n id: createHash('sha256').update(file.path).digest('hex'),\n name: trimExtName(file.baseName),\n extname,\n imports: imports,\n exports: exports,\n sources: sources,\n meta: file.meta || ({} as TMeta),\n }\n}\n","import { EventEmitter as NodeEventEmitter } from 'node:events'\nimport type { FabricMode } from '../Fabric.ts'\n\ntype Options = {\n mode?: FabricMode\n maxListener?: number\n}\n\nexport class AsyncEventEmitter<TEvents extends Record<string, any>> {\n constructor({ maxListener = 100, mode = 'sequential' }: Options = {}) {\n this.#emitter.setMaxListeners(maxListener)\n this.#mode = mode\n }\n\n #emitter = new NodeEventEmitter()\n #mode: FabricMode\n\n async emit<TEventName extends keyof TEvents & string>(eventName: TEventName, ...eventArgs: TEvents[TEventName]): Promise<void> {\n const listeners = this.#emitter.listeners(eventName) as Array<(...args: TEvents[TEventName]) => any>\n\n if (listeners.length === 0) {\n return\n }\n\n const errors: Error[] = []\n\n if (this.#mode === 'sequential') {\n // Run listeners one by one, in order\n for (const listener of listeners) {\n try {\n await listener(...eventArgs)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n errors.push(error)\n }\n }\n } else {\n // Run all listeners concurrently\n const promises = listeners.map(async (listener) => {\n try {\n await listener(...eventArgs)\n } catch (err) {\n const error = err instanceof Error ? err : new Error(String(err))\n errors.push(error)\n }\n })\n await Promise.all(promises)\n }\n\n if (errors.length === 1) {\n throw errors[0]\n }\n\n if (errors.length > 1) {\n throw new AggregateError(errors, `Errors in async listeners for \"${eventName}\"`)\n }\n }\n\n on<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void {\n this.#emitter.on(eventName, handler as any)\n }\n\n onOnce<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArgs: TEvents[TEventName]) => void): void {\n const wrapper = (...args: TEvents[TEventName]) => {\n this.off(eventName, wrapper)\n handler(...args)\n }\n this.on(eventName, wrapper)\n }\n\n off<TEventName extends keyof TEvents & string>(eventName: TEventName, handler: (...eventArg: TEvents[TEventName]) => void): void {\n this.#emitter.off(eventName, handler as any)\n }\n\n removeAll(): void {\n this.#emitter.removeAllListeners()\n }\n}\n","import pLimit from 'p-limit'\nimport type { FabricEvents, FabricMode } from './Fabric.ts'\nimport type * as KubbFile from './KubbFile.ts'\nimport { defaultParser } from './parsers/defaultParser.ts'\nimport type { Parser } from './parsers/types.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\n\nexport type ProcessFilesProps = {\n parsers?: Map<KubbFile.Extname, Parser>\n extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>\n dryRun?: boolean\n /**\n * @default 'sequential'\n */\n mode?: FabricMode\n}\n\ntype GetParseOptions = {\n parsers?: Map<KubbFile.Extname, Parser>\n extension?: Record<KubbFile.Extname, KubbFile.Extname | ''>\n}\n\ntype Options = {\n events?: AsyncEventEmitter<FabricEvents>\n}\n\nexport class FileProcessor {\n #limit = pLimit(100)\n events: AsyncEventEmitter<FabricEvents>\n\n constructor({ events = new AsyncEventEmitter<FabricEvents>() }: Options = {}) {\n this.events = events\n\n return this\n }\n\n async parse(file: KubbFile.ResolvedFile, { parsers, extension }: GetParseOptions = {}): Promise<string> {\n const parseExtName = extension?.[file.extname] || undefined\n\n if (!parsers) {\n console.warn('No parsers provided, using default parser. If you want to use a specific parser, please provide it in the options.')\n\n return defaultParser.parse(file, { extname: parseExtName })\n }\n\n if (!file.extname) {\n return defaultParser.parse(file, { extname: parseExtName })\n }\n\n const parser = parsers.get(file.extname)\n\n if (!parser) {\n return defaultParser.parse(file, { extname: parseExtName })\n }\n\n return parser.parse(file, { extname: parseExtName })\n }\n\n async run(\n files: Array<KubbFile.ResolvedFile>,\n { parsers, mode = 'sequential', dryRun, extension }: ProcessFilesProps = {},\n ): Promise<KubbFile.ResolvedFile[]> {\n await this.events.emit('files:processing:start', files)\n\n const total = files.length\n let processed = 0\n\n const processOne = async (resolvedFile: KubbFile.ResolvedFile, index: number) => {\n await this.events.emit('file:processing:start', resolvedFile, index, total)\n\n const source = dryRun ? undefined : await this.parse(resolvedFile, { extension, parsers })\n\n const currentProcessed = ++processed\n const percentage = (currentProcessed / total) * 100\n\n await this.events.emit('file:processing:update', {\n file: resolvedFile,\n source,\n processed: currentProcessed,\n percentage,\n total,\n })\n\n await this.events.emit('file:processing:end', resolvedFile, index, total)\n }\n\n if (mode === 'sequential') {\n async function* asyncFiles() {\n for (let index = 0; index < files.length; index++) {\n yield [files[index], index] as const\n }\n }\n\n for await (const [file, index] of asyncFiles()) {\n if (file) {\n await processOne(file, index)\n }\n }\n } else {\n const promises = files.map((resolvedFile, index) => this.#limit(() => processOne(resolvedFile, index)))\n await Promise.all(promises)\n }\n\n await this.events.emit('files:processing:end', files)\n\n return files\n }\n}\n","export class Cache<T> {\n #buffer = new Map<string, T>()\n\n get(key: string): T | null {\n return this.#buffer.get(key) ?? null\n }\n\n set(key: string, value: T): void {\n this.#buffer.set(key, value)\n }\n\n delete(key: string): void {\n this.#buffer.delete(key)\n }\n\n clear(): void {\n this.#buffer.clear()\n }\n\n keys(): string[] {\n return [...this.#buffer.keys()]\n }\n\n values(): Array<T> {\n return [...this.#buffer.values()]\n }\n\n flush(): void {\n // No-op for base cache\n }\n}\n","import { sortBy } from 'remeda'\nimport { createFile } from './createFile.ts'\nimport type { FabricEvents } from './Fabric.ts'\nimport { FileProcessor, type ProcessFilesProps } from './FileProcessor.ts'\nimport type * as KubbFile from './KubbFile.ts'\nimport { AsyncEventEmitter } from './utils/AsyncEventEmitter.ts'\nimport { Cache } from './utils/Cache.ts'\nimport { trimExtName } from './utils/trimExtName.ts'\n\nfunction mergeFile<TMeta extends object = object>(a: KubbFile.File<TMeta>, b: KubbFile.File<TMeta>): KubbFile.File<TMeta> {\n return {\n ...a,\n sources: [...(a.sources || []), ...(b.sources || [])],\n imports: [...(a.imports || []), ...(b.imports || [])],\n exports: [...(a.exports || []), ...(b.exports || [])],\n }\n}\n\ntype Options = {\n events?: AsyncEventEmitter<FabricEvents>\n}\n\nexport class FileManager {\n #cache = new Cache<KubbFile.ResolvedFile>()\n #filesCache: Array<KubbFile.ResolvedFile> | null = null\n events: AsyncEventEmitter<FabricEvents>\n processor: FileProcessor\n\n constructor({ events = new AsyncEventEmitter<FabricEvents>() }: Options = {}) {\n this.processor = new FileProcessor({ events })\n\n this.events = events\n return this\n }\n\n #resolvePath(file: KubbFile.File): KubbFile.File {\n this.events.emit('file:resolve:path', file)\n\n return file\n }\n\n #resolveName(file: KubbFile.File): KubbFile.File {\n this.events.emit('file:resolve:name', file)\n\n return file\n }\n\n add(...files: Array<KubbFile.File>): Array<KubbFile.ResolvedFile> {\n const resolvedFiles: Array<KubbFile.ResolvedFile> = []\n\n const mergedFiles = new Map<string, KubbFile.File>()\n\n files.forEach((file) => {\n const existing = mergedFiles.get(file.path)\n if (existing) {\n mergedFiles.set(file.path, mergeFile(existing, file))\n } else {\n mergedFiles.set(file.path, file)\n }\n })\n\n for (let file of mergedFiles.values()) {\n file = this.#resolveName(file)\n file = this.#resolvePath(file)\n\n const resolvedFile = createFile(file)\n\n this.#cache.set(resolvedFile.path, resolvedFile)\n this.flush()\n\n resolvedFiles.push(resolvedFile)\n }\n\n this.events.emit('files:added', resolvedFiles)\n\n return resolvedFiles\n }\n\n upsert(...files: Array<KubbFile.File>): Array<KubbFile.ResolvedFile> {\n const resolvedFiles: Array<KubbFile.ResolvedFile> = []\n\n const mergedFiles = new Map<string, KubbFile.File>()\n\n files.forEach((file) => {\n const existing = mergedFiles.get(file.path)\n if (existing) {\n mergedFiles.set(file.path, mergeFile(existing, file))\n } else {\n mergedFiles.set(file.path, file)\n }\n })\n\n for (let file of mergedFiles.values()) {\n const existing = this.#cache.get(file.path)\n\n file = this.#resolveName(file)\n file = this.#resolvePath(file)\n\n const merged = existing ? mergeFile(existing, file) : file\n const resolvedFile = createFile(merged)\n\n this.#cache.set(resolvedFile.path, resolvedFile)\n this.flush()\n\n resolvedFiles.push(resolvedFile)\n }\n\n this.events.emit('files:added', resolvedFiles)\n\n return resolvedFiles\n }\n\n flush() {\n this.#filesCache = null\n this.#cache.flush()\n }\n\n getByPath(path: KubbFile.Path): KubbFile.ResolvedFile | null {\n return this.#cache.get(path)\n }\n\n deleteByPath(path: KubbFile.Path): void {\n this.#cache.delete(path)\n this.#filesCache = null\n }\n\n clear(): void {\n this.#cache.clear()\n this.#filesCache = null\n }\n\n get files(): Array<KubbFile.ResolvedFile> {\n if (this.#filesCache) {\n return this.#filesCache\n }\n\n const cachedKeys = this.#cache.keys()\n\n // order by path length and if file is a barrel file\n const keys = sortBy(\n cachedKeys,\n (v) => v.length,\n (v) => trimExtName(v).endsWith('index'),\n )\n\n const files: Array<KubbFile.ResolvedFile> = []\n\n for (const key of keys) {\n const file = this.#cache.get(key)\n if (file) {\n files.push(file)\n }\n }\n\n this.#filesCache = files\n\n return files\n }\n\n //TODO add test and check if write of FileManager contains the newly added file\n async write(options: ProcessFilesProps): Promise<KubbFile.ResolvedFile[]> {\n await this.events.emit('files:writing:start', this.files)\n\n const resolvedFiles = await this.processor.run(this.files, options)\n\n this.clear()\n\n await this.events.emit('files:writing:end', resolvedFiles)\n\n return resolvedFiles\n }\n}\n","import type * as KubbFile from '../KubbFile.ts'\n\ntype BarrelData = {\n file?: KubbFile.File\n path: string\n name: string\n}\n\nexport type Graph = {\n nodes: Array<{ id: string; label: string }>\n edges: Array<{ from: string; to: string }>\n}\n\nexport class TreeNode<TData = unknown> {\n data: TData\n parent?: TreeNode<TData>\n children: Array<TreeNode<TData>> = []\n #childrenMap = new Map<string, TreeNode<TData>>()\n #cachedLeaves?: Array<TreeNode<TData>>\n\n constructor(data: TData, parent?: TreeNode<TData>) {\n this.data = data\n this.parent = parent\n }\n\n addChild(data: TData): TreeNode<TData> {\n const child = new TreeNode(data, this)\n this.children.push(child)\n // Update Map if data has a name property (for BarrelData)\n if (typeof data === 'object' && data !== null && 'name' in data) {\n this.#childrenMap.set((data as { name: string }).name, child)\n }\n this.#cachedLeaves = undefined // invalidate cached leaves\n return child\n }\n\n getChildByName(name: string): TreeNode<TData> | undefined {\n return this.#childrenMap.get(name)\n }\n\n get leaves(): Array<TreeNode<TData>> {\n if (this.#cachedLeaves) return this.#cachedLeaves\n if (this.children.length === 0) return [this]\n\n const result: Array<TreeNode<TData>> = []\n const stack: Array<TreeNode<TData>> = [...this.children]\n const visited = new Set<TreeNode<TData>>()\n\n while (stack.length > 0) {\n const node = stack.pop()!\n if (visited.has(node)) {\n continue\n }\n visited.add(node)\n\n if (node.children.length > 0) {\n stack.push(...node.children)\n } else {\n result.push(node)\n }\n }\n\n this.#cachedLeaves = result\n return result\n }\n\n forEach(callback: (node: TreeNode<TData>) => void): this {\n const stack: Array<TreeNode<TData>> = [this]\n\n for (let i = 0; i < stack.length; i++) {\n const node = stack[i]!\n callback(node)\n\n if (node.children.length > 0) {\n stack.push(...node.children)\n }\n }\n\n return this\n }\n\n findDeep(predicate: (node: TreeNode<TData>) => boolean): TreeNode<TData> | undefined {\n for (const leaf of this.leaves) {\n if (predicate(leaf)) return leaf\n }\n return undefined\n }\n\n static toGraph(root: TreeNode<BarrelData>): Graph {\n const nodes: Array<{ id: string; label: string }> = []\n const edges: Array<{ from: string; to: string }> = []\n\n const stack: Array<TreeNode<BarrelData>> = [root]\n\n for (let i = 0; i < stack.length; i++) {\n const node = stack[i]!\n\n nodes.push({\n id: node.data.path,\n label: node.data.name,\n })\n\n const children = node.children\n if (children.length > 0) {\n for (let j = 0, len = children.length; j < len; j++) {\n const child = children[j]!\n edges.push({\n from: node.data.path,\n to: child.data.path,\n })\n stack.push(child)\n }\n }\n }\n\n return { nodes, edges }\n }\n\n static fromFiles(files: Array<KubbFile.File>, rootFolder = ''): TreeNode<BarrelData> | null {\n const normalizePath = (p: string): string => p.replace(/\\\\/g, '/')\n const normalizedRoot = normalizePath(rootFolder)\n const rootPrefix = normalizedRoot.endsWith('/') ? normalizedRoot : `${normalizedRoot}/`\n\n const normalizedPaths = new Map<KubbFile.File, string>()\n const filteredFiles: Array<KubbFile.File> = []\n for (const file of files) {\n const filePath = normalizedPaths.get(file) ?? normalizePath(file.path)\n normalizedPaths.set(file, filePath)\n if (!filePath.endsWith('.json') && (!rootFolder || filePath.startsWith(rootPrefix))) {\n filteredFiles.push(file)\n }\n }\n\n if (filteredFiles.length === 0) {\n return null\n }\n\n const treeNode = new TreeNode<BarrelData>({\n name: rootFolder || '',\n path: rootFolder || '',\n file: undefined,\n })\n\n for (const file of filteredFiles) {\n const filePath = normalizedPaths.get(file)!\n const relPath = filePath.slice(rootPrefix.length)\n const parts = relPath.split('/')\n\n let current = treeNode\n let currentPath = rootFolder\n\n for (const [index, part] of parts.entries()) {\n const isLast = index === parts.length - 1\n currentPath += (currentPath.endsWith('/') ? '' : '/') + part\n\n let next = current.getChildByName(part)\n\n if (!next) {\n next = current.addChild({\n name: part,\n path: currentPath,\n file: isLast ? file : undefined,\n })\n }\n\n current = next\n }\n }\n\n return treeNode\n }\n}\n","import type { ComponentNode } from '../composables/useNodeTree.ts'\nimport { createContext } from '../context.ts'\nimport { FileManager } from '../FileManager.ts'\nimport { TreeNode } from '../utils/TreeNode.ts'\n\nexport type RootContextProps = {\n /**\n * Exit (unmount) the whole app.\n */\n exit: (error?: Error) => void\n /**\n * TreeNode representing the tree structure of the app.\n */\n treeNode: TreeNode<ComponentNode>\n /**\n * FileManager instance for managing files within the app.\n */\n fileManager: FileManager\n}\n\n/**\n * Context providing root-level functionalities such as exit hook, tree node structure, and file management.\n * Define in the `render` helper of the runtime.\n */\nexport const RootContext = createContext<RootContextProps>({\n exit: () => {},\n treeNode: new TreeNode({ type: 'Root', props: {} }),\n fileManager: new FileManager(),\n})\n","import type { ComponentNode } from '../composables/useNodeTree.ts'\nimport { provide } from '../context.ts'\nimport { NodeTreeContext } from '../contexts/NodeTreeContext.ts'\nimport { RootContext } from '../contexts/RootContext.ts'\nimport { createComponent } from '../createComponent.ts'\nimport type { FabricNode } from '../Fabric.ts'\nimport type { FileManager } from '../FileManager.ts'\nimport type { TreeNode } from '../utils/TreeNode.ts'\n\nexport type RootProps = {\n /**\n * Callback to exit the Fabric application.\n *\n * Call this to stop rendering and clean up resources.\n */\n onExit: (error?: Error) => void\n /**\n * Error handler for runtime exceptions.\n *\n * Receives errors thrown during component rendering.\n */\n onError: (error: Error) => void\n /**\n * Tree structure representing the component hierarchy.\n *\n * Used internally for tracking component relationships.\n */\n treeNode: TreeNode<ComponentNode>\n /**\n * FileManager instance for file operations.\n *\n * Manages all files created during rendering.\n */\n fileManager: FileManager\n /**\n * Child components.\n */\n children?: FabricNode\n}\n\n/**\n * Root component providing core Fabric runtime context.\n *\n * This component is typically used internally by the Fabric renderer.\n * It provides the root context including FileManager, error handling,\n * and lifecycle management.\n *\n * @example\n * ```tsx\n * <Root\n * onExit={(error) => process.exit(error ? 1 : 0)}\n * onError={(error) => console.error(error)}\n * treeNode={treeNode}\n * fileManager={fileManager}\n * >\n * <App>\n * Your components here\n * </App>\n * </Root>\n * ```\n */\nexport const Root = createComponent('Root', ({ onError, onExit, treeNode, fileManager, children }: RootProps) => {\n provide(RootContext, { exit: onExit, treeNode, fileManager })\n provide(NodeTreeContext, treeNode)\n\n try {\n return children\n } catch (e) {\n if (e instanceof Error) {\n onError?.(e)\n }\n return ''\n }\n})\n\nRoot.displayName = 'Root'\n","const SIGNALS: NodeJS.Signals[] = ['SIGINT', 'SIGTERM', 'SIGHUP']\n\n/**\n * Register a callback to run when the process exits (via exit event or common signals).\n * Returns an unsubscribe function.\n *\n * Dynamically adjusts `process.maxListeners` to avoid MaxListenersExceededWarning\n * when multiple instances are created (e.g. in tests).\n */\nexport function onProcessExit(callback: (code: number | null) => void): () => void {\n const exitHandler = (code: number) => callback(code)\n\n const signalHandlers = new Map<NodeJS.Signals, () => void>()\n const count = SIGNALS.length + 1 // SIGINT + SIGTERM + SIGHUP + exit\n\n // Increase the limit to accommodate this registration\n process.setMaxListeners(process.getMaxListeners() + count)\n\n for (const signal of SIGNALS) {\n const handler = () => {\n unsubscribe()\n try {\n callback(null)\n } finally {\n process.kill(process.pid, signal)\n }\n }\n signalHandlers.set(signal, handler)\n process.on(signal, handler)\n }\n\n process.on('exit', exitHandler)\n\n function unsubscribe() {\n process.removeListener('exit', exitHandler)\n for (const [signal, handler] of signalHandlers) {\n process.removeListener(signal, handler)\n }\n // Restore the limit when listeners are removed\n process.setMaxListeners(Math.max(process.getMaxListeners() - count, 0))\n }\n\n return unsubscribe\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAM,+BAAe,IAAI,KAAwB;AACjD,MAAM,kCAAkB,IAAI,KAAsB;;;;;;;;;;AAWlD,SAAgB,QAAW,KAA0B,OAAgB;AACnE,KAAI,CAAC,aAAa,IAAI,IAAI,CACxB,cAAa,IAAI,KAAK,EAAE,CAAC;AAE3B,cAAa,IAAI,IAAI,CAAE,KAAK,MAAM;;;;;;;;;;AAWpC,SAAgB,OAAU,KAA0B,cAAqB;CACvE,MAAM,QAAQ,aAAa,IAAI,IAAI;AACnC,KAAI,CAAC,SAAS,MAAM,WAAW,GAAG;AAChC,MAAI,iBAAiB,KAAA,EACnB,QAAO;EAET,MAAM,gBAAgB,gBAAgB,IAAI,IAAI;AAC9C,MAAI,kBAAkB,KAAA,EACpB,QAAO;AAET,QAAM,IAAI,MAAM,8BAA8B,IAAI,UAAU,GAAG;;AAEjE,QAAO,MAAM,MAAM,SAAS;;;;;;AAO9B,SAAgB,UAAa,KAAgC;CAC3D,MAAM,QAAQ,aAAa,IAAI,IAAI;AACnC,KAAI,SAAS,MAAM,SAAS,EAC1B,OAAM,KAAK;;;;;;;;;;;;AAcf,SAAgB,cAAiB,cAA6B;CAC5D,MAAM,MAAM,OAAO,UAAU;AAC7B,iBAAgB,IAAI,KAAK,aAAa;AAEtC,QAAO;;;;;;;ACpET,MAAa,gBAAgB,cAAkC;CAAE,aAAa;CAAG,YAAY;CAAG,mBAAmB;CAAG,aAAa;CAAO,C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