@kubb/fabric-core 0.2.19 → 0.3.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 (51) hide show
  1. package/dist/{Fabric-CVe8cc8b.d.ts → Fabric-RmoYWGrr.d.cts} +4 -4
  2. package/dist/{Fabric-BezqNTQ9.d.cts → Fabric-cIhiQpgN.d.ts} +4 -4
  3. package/dist/defineProperty-DwFON4j7.cjs +367 -0
  4. package/dist/defineProperty-DwFON4j7.cjs.map +1 -0
  5. package/dist/defineProperty-fiNt9UhD.js +325 -0
  6. package/dist/defineProperty-fiNt9UhD.js.map +1 -0
  7. package/dist/{getRelativePath-C6lvNCs7.cjs → getRelativePath-eCdp2Z8M.cjs} +1 -2
  8. package/dist/{getRelativePath-C6lvNCs7.cjs.map → getRelativePath-eCdp2Z8M.cjs.map} +1 -1
  9. package/dist/index.cjs +20 -21
  10. package/dist/index.cjs.map +1 -1
  11. package/dist/index.d.cts +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.js +20 -19
  14. package/dist/index.js.map +1 -1
  15. package/dist/parsers/typescript.cjs +2 -2
  16. package/dist/parsers/typescript.d.cts +2 -2
  17. package/dist/parsers/typescript.d.ts +2 -2
  18. package/dist/parsers/typescript.js +1 -1
  19. package/dist/parsers.cjs +2 -2
  20. package/dist/parsers.d.cts +2 -2
  21. package/dist/parsers.d.ts +2 -2
  22. package/dist/parsers.js +1 -1
  23. package/dist/plugins.cjs +79 -46
  24. package/dist/plugins.cjs.map +1 -1
  25. package/dist/plugins.d.cts +1 -1
  26. package/dist/plugins.d.ts +1 -1
  27. package/dist/plugins.js +78 -43
  28. package/dist/plugins.js.map +1 -1
  29. package/dist/types.d.cts +1 -1
  30. package/dist/types.d.ts +1 -1
  31. package/dist/{typescriptParser-CWT7zCJy.js → typescriptParser-BFhqWjdo.js} +20 -35
  32. package/dist/typescriptParser-BFhqWjdo.js.map +1 -0
  33. package/dist/{typescriptParser-B5SxjtvV.d.ts → typescriptParser-BjqVuRHF.d.cts} +3 -14
  34. package/dist/{typescriptParser-PfAO0SSm.d.cts → typescriptParser-Cy9_9o6I.d.ts} +3 -14
  35. package/dist/{typescriptParser-CNHO6H2_.cjs → typescriptParser-DJxEGCz3.cjs} +21 -36
  36. package/dist/typescriptParser-DJxEGCz3.cjs.map +1 -0
  37. package/package.json +1 -1
  38. package/src/Fabric.ts +1 -1
  39. package/src/FileManager.ts +2 -2
  40. package/src/FileProcessor.ts +8 -15
  41. package/src/createFile.ts +110 -57
  42. package/src/defineFabric.ts +15 -3
  43. package/src/parsers/typescriptParser.ts +33 -50
  44. package/src/plugins/barrelPlugin.ts +63 -36
  45. package/src/utils/TreeNode.ts +54 -27
  46. package/dist/defineProperty-DZi5DvrW.cjs +0 -390
  47. package/dist/defineProperty-DZi5DvrW.cjs.map +0 -1
  48. package/dist/defineProperty-DcP1vZ2K.js +0 -346
  49. package/dist/defineProperty-DcP1vZ2K.js.map +0 -1
  50. package/dist/typescriptParser-CNHO6H2_.cjs.map +0 -1
  51. package/dist/typescriptParser-CWT7zCJy.js.map +0 -1
@@ -153,7 +153,7 @@ declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
153
153
  //#endregion
154
154
  //#region src/FileProcessor.d.ts
155
155
  type ProcessFilesProps = {
156
- parsers?: Set<Parser>;
156
+ parsers?: Map<Extname, Parser>;
157
157
  extension?: Record<Extname, Extname | ''>;
158
158
  dryRun?: boolean;
159
159
  /**
@@ -162,7 +162,7 @@ type ProcessFilesProps = {
162
162
  mode?: FabricMode;
163
163
  };
164
164
  type GetParseOptions = {
165
- parsers?: Set<Parser>;
165
+ parsers?: Map<Extname, Parser>;
166
166
  extension?: Record<Extname, Extname | ''>;
167
167
  };
168
168
  type Options$1 = {
@@ -324,7 +324,7 @@ interface FabricContext<T extends FabricOptions = FabricOptions> extends AsyncEv
324
324
  addFile(...files: File[]): Promise<void>;
325
325
  /** Track installed plugins and parsers to prevent duplicates. */
326
326
  installedPlugins: Set<Plugin>;
327
- installedParsers: Set<Parser>;
327
+ installedParsers: Map<Extname, Parser>;
328
328
  }
329
329
  /**
330
330
  * Base configuration object for Fabric.
@@ -365,4 +365,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
365
365
  }
366
366
  //#endregion
367
367
  export { FabricOptions as a, FileManager as c, UserParser as d, Extname as f, ResolvedFile as h, FabricMode as i, FileProcessor as l, KubbFile_d_exports as m, FabricConfig as n, Plugin as o, File as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u };
368
- //# sourceMappingURL=Fabric-CVe8cc8b.d.ts.map
368
+ //# sourceMappingURL=Fabric-RmoYWGrr.d.cts.map
@@ -153,7 +153,7 @@ declare class AsyncEventEmitter<TEvents extends Record<string, any>> {
153
153
  //#endregion
154
154
  //#region src/FileProcessor.d.ts
155
155
  type ProcessFilesProps = {
156
- parsers?: Set<Parser>;
156
+ parsers?: Map<Extname, Parser>;
157
157
  extension?: Record<Extname, Extname | ''>;
158
158
  dryRun?: boolean;
159
159
  /**
@@ -162,7 +162,7 @@ type ProcessFilesProps = {
162
162
  mode?: FabricMode;
163
163
  };
164
164
  type GetParseOptions = {
165
- parsers?: Set<Parser>;
165
+ parsers?: Map<Extname, Parser>;
166
166
  extension?: Record<Extname, Extname | ''>;
167
167
  };
168
168
  type Options$1 = {
@@ -324,7 +324,7 @@ interface FabricContext<T extends FabricOptions = FabricOptions> extends AsyncEv
324
324
  addFile(...files: File[]): Promise<void>;
325
325
  /** Track installed plugins and parsers to prevent duplicates. */
326
326
  installedPlugins: Set<Plugin>;
327
- installedParsers: Set<Parser>;
327
+ installedParsers: Map<Extname, Parser>;
328
328
  }
329
329
  /**
330
330
  * Base configuration object for Fabric.
@@ -365,4 +365,4 @@ interface Fabric<T extends FabricOptions = FabricOptions> extends Kubb.Fabric {
365
365
  }
366
366
  //#endregion
367
367
  export { FabricOptions as a, FileManager as c, UserParser as d, Extname as f, ResolvedFile as h, FabricMode as i, FileProcessor as l, KubbFile_d_exports as m, FabricConfig as n, Plugin as o, File as p, FabricContext as r, UserPlugin as s, Fabric as t, Parser as u };
368
- //# sourceMappingURL=Fabric-BezqNTQ9.d.cts.map
368
+ //# sourceMappingURL=Fabric-cIhiQpgN.d.ts.map
@@ -0,0 +1,367 @@
1
+ const require_trimExtName = require('./trimExtName-Bb4zGVF1.cjs');
2
+ let natural_orderby = require("natural-orderby");
3
+ let node_crypto = require("node:crypto");
4
+ let node_path = require("node:path");
5
+ node_path = require_trimExtName.__toESM(node_path);
6
+
7
+ //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js
8
+ const e = {
9
+ done: !0,
10
+ hasNext: !1
11
+ }, t = {
12
+ done: !1,
13
+ hasNext: !1
14
+ }, n$2 = () => e, r$2 = (e$1) => ({
15
+ hasNext: !0,
16
+ next: e$1,
17
+ done: !1
18
+ });
19
+
20
+ //#endregion
21
+ //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js
22
+ function t$2(e$1, ...t$3) {
23
+ let a = e$1, o = t$3.map((e$2) => `lazy` in e$2 ? r$1(e$2) : void 0), s = 0;
24
+ for (; s < t$3.length;) {
25
+ if (o[s] === void 0 || !i(a)) {
26
+ let e$3 = t$3[s];
27
+ a = e$3(a), s += 1;
28
+ continue;
29
+ }
30
+ let e$2 = [];
31
+ for (let n$3 = s; n$3 < t$3.length; n$3++) {
32
+ let t$4 = o[n$3];
33
+ if (t$4 === void 0 || (e$2.push(t$4), t$4.isSingle)) break;
34
+ }
35
+ let r$3 = [];
36
+ for (let t$4 of a) if (n$1(t$4, r$3, e$2)) break;
37
+ let { isSingle: c } = e$2.at(-1);
38
+ a = c ? r$3[0] : r$3, s += e$2.length;
39
+ }
40
+ return a;
41
+ }
42
+ function n$1(t$3, r$3, i$1) {
43
+ if (i$1.length === 0) return r$3.push(t$3), !1;
44
+ let a = t$3, o = t, s = !1;
45
+ for (let [e$1, t$4] of i$1.entries()) {
46
+ let { index: c, items: l } = t$4;
47
+ if (l.push(a), o = t$4(a, c, l), t$4.index += 1, o.hasNext) {
48
+ var _o$hasMany;
49
+ if ((_o$hasMany = o.hasMany) !== null && _o$hasMany !== void 0 ? _o$hasMany : !1) {
50
+ for (let t$5 of o.next) if (n$1(t$5, r$3, i$1.slice(e$1 + 1))) return !0;
51
+ return s;
52
+ }
53
+ a = o.next;
54
+ }
55
+ if (!o.hasNext) break;
56
+ o.done && (s = !0);
57
+ }
58
+ return o.hasNext && r$3.push(a), s;
59
+ }
60
+ function r$1(e$1) {
61
+ var _t$single;
62
+ let { lazy: t$3, lazyArgs: n$3 } = e$1, r$3 = t$3(...n$3);
63
+ return Object.assign(r$3, {
64
+ isSingle: (_t$single = t$3.single) !== null && _t$single !== void 0 ? _t$single : !1,
65
+ index: 0,
66
+ items: []
67
+ });
68
+ }
69
+ function i(e$1) {
70
+ return typeof e$1 == `string` || typeof e$1 == `object` && !!e$1 && Symbol.iterator in e$1;
71
+ }
72
+
73
+ //#endregion
74
+ //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js
75
+ function t$1(t$3, n$3) {
76
+ let r$3 = n$3.length - t$3.length;
77
+ if (r$3 === 1) {
78
+ let [r$4, ...i$1] = n$3;
79
+ return t$2(r$4, {
80
+ lazy: t$3,
81
+ lazyArgs: i$1
82
+ });
83
+ }
84
+ if (r$3 === 0) {
85
+ let r$4 = {
86
+ lazy: t$3,
87
+ lazyArgs: n$3
88
+ };
89
+ return Object.assign((t$4) => t$2(t$4, r$4), r$4);
90
+ }
91
+ throw Error(`Wrong number of arguments`);
92
+ }
93
+
94
+ //#endregion
95
+ //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js
96
+ function n(...e$1) {
97
+ return t$1(r, e$1);
98
+ }
99
+ function r(t$3) {
100
+ let n$3 = t$3, r$3 = /* @__PURE__ */ new Set();
101
+ return (t$4, i$1, a) => {
102
+ let o = n$3(t$4, i$1, a);
103
+ return r$3.has(o) ? t : (r$3.add(o), {
104
+ done: !1,
105
+ hasNext: !0,
106
+ next: t$4
107
+ });
108
+ };
109
+ }
110
+
111
+ //#endregion
112
+ //#region src/createFile.ts
113
+ function combineSources(sources) {
114
+ return n(sources, (obj) => [
115
+ obj.name,
116
+ obj.isExportable,
117
+ obj.isTypeOnly
118
+ ]);
119
+ }
120
+ function combineExports(exports$1) {
121
+ const sorted = (0, natural_orderby.orderBy)(exports$1, [
122
+ (v) => !!Array.isArray(v.name),
123
+ (v) => !v.isTypeOnly,
124
+ (v) => v.path,
125
+ (v) => !!v.name,
126
+ (v) => Array.isArray(v.name) ? (0, natural_orderby.orderBy)(v.name) : v.name
127
+ ]);
128
+ const prev = [];
129
+ const pathMap = /* @__PURE__ */ new Map();
130
+ const uniqueMap = /* @__PURE__ */ new Map();
131
+ const pathNameTypeTrueMap = /* @__PURE__ */ new Map();
132
+ for (const curr of sorted) {
133
+ const name = curr.name;
134
+ const pathKey = curr.path;
135
+ const prevByPath = pathMap.get(pathKey);
136
+ const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || "";
137
+ const pathNameTypeKey = `${pathKey}:${nameKey}:${curr.isTypeOnly}`;
138
+ const pathNameKey = `${pathKey}:${nameKey}`;
139
+ if (pathNameTypeTrueMap.get(pathNameKey)) continue;
140
+ const uniqueKey = `${pathNameTypeKey}:${curr.asAlias || ""}`;
141
+ if (uniqueMap.get(uniqueKey) || Array.isArray(name) && !name.length || (prevByPath === null || prevByPath === void 0 ? void 0 : prevByPath.asAlias) && !curr.asAlias) continue;
142
+ if (!prevByPath) {
143
+ const newItem = {
144
+ ...curr,
145
+ name: Array.isArray(name) ? [...new Set(name)] : name
146
+ };
147
+ prev.push(newItem);
148
+ pathMap.set(pathKey, newItem);
149
+ uniqueMap.set(uniqueKey, newItem);
150
+ if (newItem.isTypeOnly) pathNameTypeTrueMap.set(pathNameKey, newItem);
151
+ continue;
152
+ }
153
+ if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
154
+ prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])];
155
+ continue;
156
+ }
157
+ prev.push(curr);
158
+ uniqueMap.set(uniqueKey, curr);
159
+ if (curr.isTypeOnly) pathNameTypeTrueMap.set(pathNameKey, curr);
160
+ }
161
+ return prev;
162
+ }
163
+ function combineImports(imports, exports$1, source) {
164
+ const exportedNameLookup = /* @__PURE__ */ new Set();
165
+ for (const item of exports$1) {
166
+ const { name } = item;
167
+ if (!name) continue;
168
+ if (Array.isArray(name)) {
169
+ for (const value of name) if (value) exportedNameLookup.add(value);
170
+ continue;
171
+ }
172
+ exportedNameLookup.add(name);
173
+ }
174
+ const usageCache = /* @__PURE__ */ new Map();
175
+ const hasImportInSource = (importName) => {
176
+ if (!source) return true;
177
+ const cached = usageCache.get(importName);
178
+ if (cached !== void 0) return cached;
179
+ const isUsed = source.includes(importName) || exportedNameLookup.has(importName);
180
+ usageCache.set(importName, isUsed);
181
+ return isUsed;
182
+ };
183
+ const sorted = (0, natural_orderby.orderBy)(imports, [
184
+ (v) => !!Array.isArray(v.name),
185
+ (v) => !v.isTypeOnly,
186
+ (v) => v.path,
187
+ (v) => !!v.name,
188
+ (v) => Array.isArray(v.name) ? (0, natural_orderby.orderBy)(v.name) : v.name
189
+ ]);
190
+ const prev = [];
191
+ const pathTypeMap = /* @__PURE__ */ new Map();
192
+ const uniqueMap = /* @__PURE__ */ new Map();
193
+ const pathNameTypeTrueMap = /* @__PURE__ */ new Map();
194
+ for (const curr of sorted) {
195
+ let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
196
+ if (curr.path === curr.root) continue;
197
+ if (Array.isArray(name)) name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
198
+ const pathTypeKey = `${curr.path}:${curr.isTypeOnly}`;
199
+ const prevByPath = pathTypeMap.get(pathTypeKey);
200
+ const nameKey = Array.isArray(name) ? JSON.stringify(name) : name || "";
201
+ const pathNameTypeKey = `${curr.path}:${nameKey}:${curr.isTypeOnly}`;
202
+ const uniquePrev = uniqueMap.get(pathNameTypeKey);
203
+ const pathNameKey = `${curr.path}:${nameKey}`;
204
+ if (pathNameTypeTrueMap.get(pathNameKey)) continue;
205
+ if (uniquePrev || Array.isArray(name) && !name.length) continue;
206
+ if (!prevByPath) {
207
+ const newItem = {
208
+ ...curr,
209
+ name
210
+ };
211
+ prev.push(newItem);
212
+ pathTypeMap.set(pathTypeKey, newItem);
213
+ uniqueMap.set(pathNameTypeKey, newItem);
214
+ if (newItem.isTypeOnly) pathNameTypeTrueMap.set(pathNameKey, newItem);
215
+ continue;
216
+ }
217
+ if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
218
+ prevByPath.name = [...new Set([...prevByPath.name, ...name])];
219
+ continue;
220
+ }
221
+ if (!Array.isArray(name) && name && !hasImportInSource(name)) continue;
222
+ prev.push(curr);
223
+ uniqueMap.set(pathNameTypeKey, curr);
224
+ if (curr.isTypeOnly) pathNameTypeTrueMap.set(pathNameKey, curr);
225
+ }
226
+ return prev;
227
+ }
228
+ /**
229
+ * Helper to create a file with name and id set
230
+ */
231
+ function createFile(file) {
232
+ var _file$exports, _file$imports, _file$sources;
233
+ const extname = node_path.default.extname(file.baseName);
234
+ if (!extname) throw new Error(`No extname found for ${file.baseName}`);
235
+ const source = file.sources.map((item) => item.value).join("\n\n");
236
+ const exports$1 = ((_file$exports = file.exports) === null || _file$exports === void 0 ? void 0 : _file$exports.length) ? combineExports(file.exports) : [];
237
+ const imports = ((_file$imports = file.imports) === null || _file$imports === void 0 ? void 0 : _file$imports.length) && source ? combineImports(file.imports, exports$1, source) : [];
238
+ const sources = ((_file$sources = file.sources) === null || _file$sources === void 0 ? void 0 : _file$sources.length) ? combineSources(file.sources) : [];
239
+ return {
240
+ ...file,
241
+ id: (0, node_crypto.createHash)("sha256").update(file.path).digest("hex"),
242
+ name: require_trimExtName.trimExtName(file.baseName),
243
+ extname,
244
+ imports,
245
+ exports: exports$1,
246
+ sources,
247
+ meta: file.meta || {}
248
+ };
249
+ }
250
+
251
+ //#endregion
252
+ //#region \0@oxc-project+runtime@0.96.0/helpers/checkPrivateRedeclaration.js
253
+ function _checkPrivateRedeclaration(e$1, t$3) {
254
+ if (t$3.has(e$1)) throw new TypeError("Cannot initialize the same private elements twice on an object");
255
+ }
256
+
257
+ //#endregion
258
+ //#region \0@oxc-project+runtime@0.96.0/helpers/classPrivateFieldInitSpec.js
259
+ function _classPrivateFieldInitSpec(e$1, t$3, a) {
260
+ _checkPrivateRedeclaration(e$1, t$3), t$3.set(e$1, a);
261
+ }
262
+
263
+ //#endregion
264
+ //#region \0@oxc-project+runtime@0.96.0/helpers/assertClassBrand.js
265
+ function _assertClassBrand(e$1, t$3, n$3) {
266
+ if ("function" == typeof e$1 ? e$1 === t$3 : e$1.has(t$3)) return arguments.length < 3 ? t$3 : n$3;
267
+ throw new TypeError("Private element is not present on this object");
268
+ }
269
+
270
+ //#endregion
271
+ //#region \0@oxc-project+runtime@0.96.0/helpers/classPrivateFieldGet2.js
272
+ function _classPrivateFieldGet2(s, a) {
273
+ return s.get(_assertClassBrand(s, a));
274
+ }
275
+
276
+ //#endregion
277
+ //#region \0@oxc-project+runtime@0.96.0/helpers/classPrivateFieldSet2.js
278
+ function _classPrivateFieldSet2(s, a, r$3) {
279
+ return s.set(_assertClassBrand(s, a), r$3), r$3;
280
+ }
281
+
282
+ //#endregion
283
+ //#region \0@oxc-project+runtime@0.96.0/helpers/typeof.js
284
+ function _typeof(o) {
285
+ "@babel/helpers - typeof";
286
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
287
+ return typeof o$1;
288
+ } : function(o$1) {
289
+ return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
290
+ }, _typeof(o);
291
+ }
292
+
293
+ //#endregion
294
+ //#region \0@oxc-project+runtime@0.96.0/helpers/toPrimitive.js
295
+ function toPrimitive(t$3, r$3) {
296
+ if ("object" != _typeof(t$3) || !t$3) return t$3;
297
+ var e$1 = t$3[Symbol.toPrimitive];
298
+ if (void 0 !== e$1) {
299
+ var i$1 = e$1.call(t$3, r$3 || "default");
300
+ if ("object" != _typeof(i$1)) return i$1;
301
+ throw new TypeError("@@toPrimitive must return a primitive value.");
302
+ }
303
+ return ("string" === r$3 ? String : Number)(t$3);
304
+ }
305
+
306
+ //#endregion
307
+ //#region \0@oxc-project+runtime@0.96.0/helpers/toPropertyKey.js
308
+ function toPropertyKey(t$3) {
309
+ var i$1 = toPrimitive(t$3, "string");
310
+ return "symbol" == _typeof(i$1) ? i$1 : i$1 + "";
311
+ }
312
+
313
+ //#endregion
314
+ //#region \0@oxc-project+runtime@0.96.0/helpers/defineProperty.js
315
+ function _defineProperty(e$1, r$3, t$3) {
316
+ return (r$3 = toPropertyKey(r$3)) in e$1 ? Object.defineProperty(e$1, r$3, {
317
+ value: t$3,
318
+ enumerable: !0,
319
+ configurable: !0,
320
+ writable: !0
321
+ }) : e$1[r$3] = t$3, e$1;
322
+ }
323
+
324
+ //#endregion
325
+ Object.defineProperty(exports, '_assertClassBrand', {
326
+ enumerable: true,
327
+ get: function () {
328
+ return _assertClassBrand;
329
+ }
330
+ });
331
+ Object.defineProperty(exports, '_checkPrivateRedeclaration', {
332
+ enumerable: true,
333
+ get: function () {
334
+ return _checkPrivateRedeclaration;
335
+ }
336
+ });
337
+ Object.defineProperty(exports, '_classPrivateFieldGet2', {
338
+ enumerable: true,
339
+ get: function () {
340
+ return _classPrivateFieldGet2;
341
+ }
342
+ });
343
+ Object.defineProperty(exports, '_classPrivateFieldInitSpec', {
344
+ enumerable: true,
345
+ get: function () {
346
+ return _classPrivateFieldInitSpec;
347
+ }
348
+ });
349
+ Object.defineProperty(exports, '_classPrivateFieldSet2', {
350
+ enumerable: true,
351
+ get: function () {
352
+ return _classPrivateFieldSet2;
353
+ }
354
+ });
355
+ Object.defineProperty(exports, '_defineProperty', {
356
+ enumerable: true,
357
+ get: function () {
358
+ return _defineProperty;
359
+ }
360
+ });
361
+ Object.defineProperty(exports, 'createFile', {
362
+ enumerable: true,
363
+ get: function () {
364
+ return createFile;
365
+ }
366
+ });
367
+ //# sourceMappingURL=defineProperty-DwFON4j7.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defineProperty-DwFON4j7.cjs","names":["n","r","e","t","e","r","n","i","t","r","n","i","e","e","t","n","r","i","uniqueBy","exports","prev: Array<KubbFile.Export>","prev: Array<KubbFile.Import>","path","trimExtName"],"sources":["../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js","../src/createFile.ts"],"sourcesContent":["const e={done:!0,hasNext:!1},t={done:!1,hasNext:!1},n=()=>e,r=e=>({hasNext:!0,next:e,done:!1});export{t as SKIP_ITEM,n as lazyEmptyEvaluator,r as lazyIdentityEvaluator};\n//# sourceMappingURL=utilityEvaluators-DORpnx39.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";function t(e,...t){let a=e,o=t.map(e=>`lazy`in e?r(e):void 0),s=0;for(;s<t.length;){if(o[s]===void 0||!i(a)){let e=t[s];a=e(a),s+=1;continue}let e=[];for(let n=s;n<t.length;n++){let t=o[n];if(t===void 0||(e.push(t),t.isSingle))break}let r=[];for(let t of a)if(n(t,r,e))break;let{isSingle:c}=e.at(-1);a=c?r[0]:r,s+=e.length}return a}function n(t,r,i){if(i.length===0)return r.push(t),!1;let a=t,o=e,s=!1;for(let[e,t]of i.entries()){let{index:c,items:l}=t;if(l.push(a),o=t(a,c,l),t.index+=1,o.hasNext){if(o.hasMany??!1){for(let t of o.next)if(n(t,r,i.slice(e+1)))return!0;return s}a=o.next}if(!o.hasNext)break;o.done&&(s=!0)}return o.hasNext&&r.push(a),s}function r(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function i(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}export{t as pipe};\n//# sourceMappingURL=pipe-jLehR9-P.js.map","import{pipe as e}from\"./pipe-jLehR9-P.js\";function t(t,n){let r=n.length-t.length;if(r===1){let[r,...i]=n;return e(r,{lazy:t,lazyArgs:i})}if(r===0){let r={lazy:t,lazyArgs:n};return Object.assign(t=>e(t,r),r)}throw Error(`Wrong number of arguments`)}export{t as purryFromLazy};\n//# sourceMappingURL=purryFromLazy-3oywCNIb.js.map","import{SKIP_ITEM as e}from\"./utilityEvaluators-DORpnx39.js\";import{purryFromLazy as t}from\"./purryFromLazy-3oywCNIb.js\";function n(...e){return t(r,e)}function r(t){let n=t,r=new Set;return(t,i,a)=>{let o=n(t,i,a);return r.has(o)?e:(r.add(o),{done:!1,hasNext:!0,next:t})}}export{n as uniqueBy};\n//# sourceMappingURL=uniqueBy-C_PxkF_D.js.map","import { createHash } from 'node:crypto'\nimport path from 'node:path'\nimport { orderBy } from 'natural-orderby'\nimport { 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) => [obj.name, obj.isExportable, obj.isTypeOnly] as const)\n}\n\nexport function combineExports(exports: Array<KubbFile.Export>): Array<KubbFile.Export> {\n const sorted = orderBy(exports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : 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 // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = 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 // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${pathKey}:${nameKey}`\n const prevByPathAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathAndIsTypeOnly) {\n // we already have an export that has the same path and name but uses `isTypeOnly` (export type ...)\n continue\n }\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 // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\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 // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\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 = orderBy(imports, [\n (v) => !!Array.isArray(v.name),\n (v) => !v.isTypeOnly,\n (v) => v.path,\n (v) => !!v.name,\n (v) => (Array.isArray(v.name) ? orderBy(v.name) : 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 // Map to track items by path+name where isTypeOnly=true (for type-only check)\n const pathNameTypeTrueMap = 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 // Check if there's already an item with the same path+name but with isTypeOnly=true\n const pathNameKey = `${curr.path}:${nameKey}`\n const prevByPathNameAndIsTypeOnly = pathNameTypeTrueMap.get(pathNameKey)\n\n if (prevByPathNameAndIsTypeOnly) {\n // we already have an import that has the same path and name but uses `isTypeOnly` (import type ...)\n continue\n }\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 // Track items with isTypeOnly=true for the type-only check\n if (newItem.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, newItem)\n }\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 // Track items with isTypeOnly=true for the type-only check\n if (curr.isTypeOnly) {\n pathNameTypeTrueMap.set(pathNameKey, curr)\n }\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"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;;;;;AAAA,MAAM,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAAC,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAACA,YAAM,GAAEC,OAAE,SAAI;CAAC,SAAQ,CAAC;CAAE,MAAKC;CAAE,MAAK,CAAC;CAAE;;;;ACAjC,SAASC,IAAE,KAAE,GAAGA,KAAE;CAAC,IAAI,IAAEC,KAAE,IAAED,IAAE,KAAI,QAAG,UAASC,MAAEC,IAAED,IAAE,GAAC,KAAK,EAAE,EAAC,IAAE;AAAE,QAAK,IAAED,IAAE,SAAQ;AAAC,MAAG,EAAE,OAAK,KAAK,KAAG,CAAC,EAAE,EAAE,EAAC;GAAC,IAAIC,MAAED,IAAE;AAAG,OAAEC,IAAE,EAAE,EAAC,KAAG;AAAE;;EAAS,IAAIA,MAAE,EAAE;AAAC,OAAI,IAAIE,MAAE,GAAEA,MAAEH,IAAE,QAAO,OAAI;GAAC,IAAIA,MAAE,EAAEG;AAAG,OAAGH,QAAI,KAAK,MAAIC,IAAE,KAAKD,IAAE,EAACA,IAAE,UAAU;;EAAM,IAAIE,MAAE,EAAE;AAAC,OAAI,IAAIF,OAAK,EAAE,KAAGG,IAAEH,KAAEE,KAAED,IAAE,CAAC;EAAM,IAAG,EAAC,UAAS,MAAGA,IAAE,GAAG,GAAG;AAAC,MAAE,IAAEC,IAAE,KAAGA,KAAE,KAAGD,IAAE;;AAAO,QAAO;;AAAE,SAASE,IAAE,KAAE,KAAE,KAAE;AAAC,KAAGC,IAAE,WAAS,EAAE,QAAOF,IAAE,KAAKF,IAA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