@kubb/fabric-core 0.2.19 → 0.3.1

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-B5SxjtvV.d.ts → typescriptParser-BjqVuRHF.d.cts} +3 -14
  32. package/dist/{typescriptParser-CWT7zCJy.js → typescriptParser-CvJg4PQJ.js} +27 -45
  33. package/dist/typescriptParser-CvJg4PQJ.js.map +1 -0
  34. package/dist/{typescriptParser-PfAO0SSm.d.cts → typescriptParser-Cy9_9o6I.d.ts} +3 -14
  35. package/dist/{typescriptParser-CNHO6H2_.cjs → typescriptParser-D6-3Z7Lj.cjs} +28 -46
  36. package/dist/typescriptParser-D6-3Z7Lj.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 +55 -73
  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
@@ -15,6 +15,7 @@ export class TreeNode<TData = unknown> {
15
15
  data: TData
16
16
  parent?: TreeNode<TData>
17
17
  children: Array<TreeNode<TData>> = []
18
+ #childrenMap = new Map<string, TreeNode<TData>>()
18
19
  #cachedLeaves?: Array<TreeNode<TData>>
19
20
 
20
21
  constructor(data: TData, parent?: TreeNode<TData>) {
@@ -25,20 +26,35 @@ export class TreeNode<TData = unknown> {
25
26
  addChild(data: TData): TreeNode<TData> {
26
27
  const child = new TreeNode(data, this)
27
28
  this.children.push(child)
29
+ // Update Map if data has a name property (for BarrelData)
30
+ if (typeof data === 'object' && data !== null && 'name' in data) {
31
+ this.#childrenMap.set((data as { name: string }).name, child)
32
+ }
28
33
  this.#cachedLeaves = undefined // invalidate cached leaves
29
34
  return child
30
35
  }
31
36
 
37
+ getChildByName(name: string): TreeNode<TData> | undefined {
38
+ return this.#childrenMap.get(name)
39
+ }
40
+
32
41
  get leaves(): Array<TreeNode<TData>> {
33
42
  if (this.#cachedLeaves) return this.#cachedLeaves
34
43
  if (this.children.length === 0) return [this]
35
44
 
36
- const stack: Array<TreeNode<TData>> = [...this.children]
37
45
  const result: Array<TreeNode<TData>> = []
46
+ const stack: Array<TreeNode<TData>> = [...this.children]
47
+ const visited = new Set<TreeNode<TData>>()
38
48
 
39
- for (const node of stack) {
40
- if (node.children.length) {
41
- for (const child of node.children) stack.push(child)
49
+ while (stack.length > 0) {
50
+ const node = stack.pop()!
51
+ if (visited.has(node)) {
52
+ continue
53
+ }
54
+ visited.add(node)
55
+
56
+ if (node.children.length > 0) {
57
+ stack.push(...node.children)
42
58
  } else {
43
59
  result.push(node)
44
60
  }
@@ -51,12 +67,15 @@ export class TreeNode<TData = unknown> {
51
67
  forEach(callback: (node: TreeNode<TData>) => void): this {
52
68
  const stack: Array<TreeNode<TData>> = [this]
53
69
 
54
- for (const node of stack) {
70
+ for (let i = 0; i < stack.length; i++) {
71
+ const node = stack[i]!
55
72
  callback(node)
56
- if (node.children.length) {
57
- for (const child of node.children) stack.push(child)
73
+
74
+ if (node.children.length > 0) {
75
+ stack.push(...node.children)
58
76
  }
59
77
  }
78
+
60
79
  return this
61
80
  }
62
81
 
@@ -71,19 +90,28 @@ export class TreeNode<TData = unknown> {
71
90
  const nodes: Array<{ id: string; label: string }> = []
72
91
  const edges: Array<{ from: string; to: string }> = []
73
92
 
74
- root.forEach((node) => {
93
+ const stack: Array<TreeNode<BarrelData>> = [root]
94
+
95
+ for (let i = 0; i < stack.length; i++) {
96
+ const node = stack[i]!
97
+
75
98
  nodes.push({
76
99
  id: node.data.path,
77
100
  label: node.data.name,
78
101
  })
79
102
 
80
- for (const child of node.children) {
81
- edges.push({
82
- from: node.data.path,
83
- to: child.data.path,
84
- })
103
+ const children = node.children
104
+ if (children.length > 0) {
105
+ for (let j = 0, len = children.length; j < len; j++) {
106
+ const child = children[j]!
107
+ edges.push({
108
+ from: node.data.path,
109
+ to: child.data.path,
110
+ })
111
+ stack.push(child)
112
+ }
85
113
  }
86
- })
114
+ }
87
115
 
88
116
  return { nodes, edges }
89
117
  }
@@ -93,11 +121,15 @@ export class TreeNode<TData = unknown> {
93
121
  const normalizedRoot = normalizePath(rootFolder)
94
122
  const rootPrefix = normalizedRoot.endsWith('/') ? normalizedRoot : `${normalizedRoot}/`
95
123
 
96
- const filteredFiles = files.filter((file) => {
97
- const filePath = normalizePath(file.path)
98
-
99
- return !filePath.endsWith('.json') && (!rootFolder || filePath.startsWith(rootPrefix))
100
- })
124
+ const normalizedPaths = new Map<KubbFile.File, string>()
125
+ const filteredFiles: Array<KubbFile.File> = []
126
+ for (const file of files) {
127
+ const filePath = normalizedPaths.get(file) ?? normalizePath(file.path)
128
+ normalizedPaths.set(file, filePath)
129
+ if (!filePath.endsWith('.json') && (!rootFolder || filePath.startsWith(rootPrefix))) {
130
+ filteredFiles.push(file)
131
+ }
132
+ }
101
133
 
102
134
  if (filteredFiles.length === 0) {
103
135
  return null
@@ -110,7 +142,8 @@ export class TreeNode<TData = unknown> {
110
142
  })
111
143
 
112
144
  for (const file of filteredFiles) {
113
- const relPath = normalizePath(file.path).slice(rootPrefix.length)
145
+ const filePath = normalizedPaths.get(file)!
146
+ const relPath = filePath.slice(rootPrefix.length)
114
147
  const parts = relPath.split('/')
115
148
 
116
149
  let current = treeNode
@@ -120,13 +153,7 @@ export class TreeNode<TData = unknown> {
120
153
  const isLast = index === parts.length - 1
121
154
  currentPath += (currentPath.endsWith('/') ? '' : '/') + part
122
155
 
123
- let next: TreeNode<BarrelData> | undefined
124
- for (const child of current.children) {
125
- if ((child.data as BarrelData).name === part) {
126
- next = child
127
- break
128
- }
129
- }
156
+ let next = current.getChildByName(part)
130
157
 
131
158
  if (!next) {
132
159
  next = current.addChild({
@@ -1,390 +0,0 @@
1
- const require_trimExtName = require('./trimExtName-Bb4zGVF1.cjs');
2
- let natural_orderby = require("natural-orderby");
3
- natural_orderby = require_trimExtName.__toESM(natural_orderby);
4
- let node_crypto = require("node:crypto");
5
- node_crypto = require_trimExtName.__toESM(node_crypto);
6
- let node_path = require("node:path");
7
- node_path = require_trimExtName.__toESM(node_path);
8
-
9
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
10
- function e$1(e$2, t$5, n$4) {
11
- let r$4 = (n$5) => e$2(n$5, ...t$5);
12
- return n$4 === void 0 ? r$4 : Object.assign(r$4, {
13
- lazy: n$4,
14
- lazyArgs: t$5
15
- });
16
- }
17
-
18
- //#endregion
19
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
20
- function t$3(t$5, n$4, r$4) {
21
- let i$2 = t$5.length - n$4.length;
22
- if (i$2 === 0) return t$5(...n$4);
23
- if (i$2 === 1) return e$1(t$5, n$4, r$4);
24
- throw Error(`Wrong number of arguments`);
25
- }
26
-
27
- //#endregion
28
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js
29
- const e = {
30
- done: !0,
31
- hasNext: !1
32
- }, t$1 = {
33
- done: !1,
34
- hasNext: !1
35
- }, n$3 = () => e, r$3 = (e$2) => ({
36
- hasNext: !0,
37
- next: e$2,
38
- done: !1
39
- });
40
-
41
- //#endregion
42
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js
43
- function t$4(e$2, ...t$5) {
44
- let a$1 = e$2, o = t$5.map((e$3) => `lazy` in e$3 ? r$2(e$3) : void 0), s = 0;
45
- for (; s < t$5.length;) {
46
- if (o[s] === void 0 || !i$1(a$1)) {
47
- let e$4 = t$5[s];
48
- a$1 = e$4(a$1), s += 1;
49
- continue;
50
- }
51
- let e$3 = [];
52
- for (let n$4 = s; n$4 < t$5.length; n$4++) {
53
- let t$6 = o[n$4];
54
- if (t$6 === void 0 || (e$3.push(t$6), t$6.isSingle)) break;
55
- }
56
- let r$4 = [];
57
- for (let t$6 of a$1) if (n$2(t$6, r$4, e$3)) break;
58
- let { isSingle: c } = e$3.at(-1);
59
- a$1 = c ? r$4[0] : r$4, s += e$3.length;
60
- }
61
- return a$1;
62
- }
63
- function n$2(t$5, r$4, i$2) {
64
- if (i$2.length === 0) return r$4.push(t$5), !1;
65
- let a$1 = t$5, o = t$1, s = !1;
66
- for (let [e$2, t$6] of i$2.entries()) {
67
- let { index: c, items: l } = t$6;
68
- if (l.push(a$1), o = t$6(a$1, c, l), t$6.index += 1, o.hasNext) {
69
- var _o$hasMany;
70
- if ((_o$hasMany = o.hasMany) !== null && _o$hasMany !== void 0 ? _o$hasMany : !1) {
71
- for (let t$7 of o.next) if (n$2(t$7, r$4, i$2.slice(e$2 + 1))) return !0;
72
- return s;
73
- }
74
- a$1 = o.next;
75
- }
76
- if (!o.hasNext) break;
77
- o.done && (s = !0);
78
- }
79
- return o.hasNext && r$4.push(a$1), s;
80
- }
81
- function r$2(e$2) {
82
- var _t$single;
83
- let { lazy: t$5, lazyArgs: n$4 } = e$2, r$4 = t$5(...n$4);
84
- return Object.assign(r$4, {
85
- isSingle: (_t$single = t$5.single) !== null && _t$single !== void 0 ? _t$single : !1,
86
- index: 0,
87
- items: []
88
- });
89
- }
90
- function i$1(e$2) {
91
- return typeof e$2 == `string` || typeof e$2 == `object` && !!e$2 && Symbol.iterator in e$2;
92
- }
93
-
94
- //#endregion
95
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js
96
- function t$2(t$5, n$4) {
97
- let r$4 = n$4.length - t$5.length;
98
- if (r$4 === 1) {
99
- let [r$5, ...i$2] = n$4;
100
- return t$4(r$5, {
101
- lazy: t$5,
102
- lazyArgs: i$2
103
- });
104
- }
105
- if (r$4 === 0) {
106
- let r$5 = {
107
- lazy: t$5,
108
- lazyArgs: n$4
109
- };
110
- return Object.assign((t$6) => t$4(t$6, r$5), r$5);
111
- }
112
- throw Error(`Wrong number of arguments`);
113
- }
114
-
115
- //#endregion
116
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/isDeepEqual-jLo35Woq.js
117
- function t(...t$5) {
118
- return t$3(n$1, t$5);
119
- }
120
- function n$1(e$2, t$5) {
121
- if (e$2 === t$5 || Object.is(e$2, t$5)) return !0;
122
- if (typeof e$2 != `object` || typeof t$5 != `object` || e$2 === null || t$5 === null || Object.getPrototypeOf(e$2) !== Object.getPrototypeOf(t$5)) return !1;
123
- if (Array.isArray(e$2)) return r$1(e$2, t$5);
124
- if (e$2 instanceof Map) return i(e$2, t$5);
125
- if (e$2 instanceof Set) return a(e$2, t$5);
126
- if (e$2 instanceof Date) return e$2.getTime() === t$5.getTime();
127
- if (e$2 instanceof RegExp) return e$2.toString() === t$5.toString();
128
- if (Object.keys(e$2).length !== Object.keys(t$5).length) return !1;
129
- for (let [r$4, i$2] of Object.entries(e$2)) if (!(r$4 in t$5) || !n$1(i$2, t$5[r$4])) return !1;
130
- return !0;
131
- }
132
- function r$1(e$2, t$5) {
133
- if (e$2.length !== t$5.length) return !1;
134
- for (let [r$4, i$2] of e$2.entries()) if (!n$1(i$2, t$5[r$4])) return !1;
135
- return !0;
136
- }
137
- function i(e$2, t$5) {
138
- if (e$2.size !== t$5.size) return !1;
139
- for (let [r$4, i$2] of e$2.entries()) if (!t$5.has(r$4) || !n$1(i$2, t$5.get(r$4))) return !1;
140
- return !0;
141
- }
142
- function a(e$2, t$5) {
143
- if (e$2.size !== t$5.size) return !1;
144
- let r$4 = [...t$5];
145
- for (let t$6 of e$2) {
146
- let e$3 = !1;
147
- for (let [i$2, a$1] of r$4.entries()) if (n$1(t$6, a$1)) {
148
- e$3 = !0, r$4.splice(i$2, 1);
149
- break;
150
- }
151
- if (!e$3) return !1;
152
- }
153
- return !0;
154
- }
155
-
156
- //#endregion
157
- //#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js
158
- function n(...e$2) {
159
- return t$2(r, e$2);
160
- }
161
- function r(t$5) {
162
- let n$4 = t$5, r$4 = /* @__PURE__ */ new Set();
163
- return (t$6, i$2, a$1) => {
164
- let o = n$4(t$6, i$2, a$1);
165
- return r$4.has(o) ? t$1 : (r$4.add(o), {
166
- done: !1,
167
- hasNext: !0,
168
- next: t$6
169
- });
170
- };
171
- }
172
-
173
- //#endregion
174
- //#region src/createFile.ts
175
- function combineSources(sources) {
176
- return n(sources, (obj) => [
177
- obj.name,
178
- obj.isExportable,
179
- obj.isTypeOnly
180
- ]);
181
- }
182
- function combineExports(exports$1) {
183
- return (0, natural_orderby.orderBy)(exports$1, [
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
- ]).reduce((prev, curr) => {
190
- const name = curr.name;
191
- const prevByPath = prev.findLast((imp) => imp.path === curr.path);
192
- if (prev.findLast((imp) => imp.path === curr.path && t(imp.name, name) && imp.isTypeOnly)) return prev;
193
- if (prev.findLast((imp) => imp.path === curr.path && t(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias) || Array.isArray(name) && !name.length || (prevByPath === null || prevByPath === void 0 ? void 0 : prevByPath.asAlias) && !curr.asAlias) return prev;
194
- if (!prevByPath) return [...prev, {
195
- ...curr,
196
- name: Array.isArray(name) ? [...new Set(name)] : name
197
- }];
198
- if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
199
- prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])];
200
- return prev;
201
- }
202
- return [...prev, curr];
203
- }, []);
204
- }
205
- function combineImports(imports, exports$1, source) {
206
- const exportedNameLookup = /* @__PURE__ */ new Set();
207
- for (const item of exports$1) {
208
- const { name } = item;
209
- if (!name) continue;
210
- if (Array.isArray(name)) {
211
- for (const value of name) if (value) exportedNameLookup.add(value);
212
- continue;
213
- }
214
- exportedNameLookup.add(name);
215
- }
216
- const usageCache = /* @__PURE__ */ new Map();
217
- const hasImportInSource = (importName) => {
218
- if (!source) return true;
219
- const cached = usageCache.get(importName);
220
- if (cached !== void 0) return cached;
221
- const isUsed = source.includes(importName) || exportedNameLookup.has(importName);
222
- usageCache.set(importName, isUsed);
223
- return isUsed;
224
- };
225
- return (0, natural_orderby.orderBy)(imports, [
226
- (v) => !!Array.isArray(v.name),
227
- (v) => !v.isTypeOnly,
228
- (v) => v.path,
229
- (v) => !!v.name,
230
- (v) => Array.isArray(v.name) ? (0, natural_orderby.orderBy)(v.name) : v.name
231
- ]).reduce((prev, curr) => {
232
- let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
233
- if (curr.path === curr.root) return prev;
234
- if (Array.isArray(name)) name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
235
- const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
236
- const uniquePrev = prev.findLast((imp) => imp.path === curr.path && t(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
237
- if (prev.findLast((imp) => imp.path === curr.path && t(imp.name, name) && imp.isTypeOnly)) return prev;
238
- if (uniquePrev || Array.isArray(name) && !name.length) return prev;
239
- if (!prevByPath) return [...prev, {
240
- ...curr,
241
- name
242
- }];
243
- if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
244
- prevByPath.name = [...new Set([...prevByPath.name, ...name])];
245
- return prev;
246
- }
247
- if (!Array.isArray(name) && name && !hasImportInSource(name)) return prev;
248
- return [...prev, curr];
249
- }, []);
250
- }
251
- /**
252
- * Helper to create a file with name and id set
253
- */
254
- function createFile(file) {
255
- var _file$exports, _file$imports, _file$sources;
256
- const extname = node_path.default.extname(file.baseName);
257
- if (!extname) throw new Error(`No extname found for ${file.baseName}`);
258
- const source = file.sources.map((item) => item.value).join("\n\n");
259
- const exports$1 = ((_file$exports = file.exports) === null || _file$exports === void 0 ? void 0 : _file$exports.length) ? combineExports(file.exports) : [];
260
- const imports = ((_file$imports = file.imports) === null || _file$imports === void 0 ? void 0 : _file$imports.length) && source ? combineImports(file.imports, exports$1, source) : [];
261
- const sources = ((_file$sources = file.sources) === null || _file$sources === void 0 ? void 0 : _file$sources.length) ? combineSources(file.sources) : [];
262
- return {
263
- ...file,
264
- id: (0, node_crypto.createHash)("sha256").update(file.path).digest("hex"),
265
- name: require_trimExtName.trimExtName(file.baseName),
266
- extname,
267
- imports,
268
- exports: exports$1,
269
- sources,
270
- meta: file.meta || {}
271
- };
272
- }
273
-
274
- //#endregion
275
- //#region \0@oxc-project+runtime@0.95.0/helpers/checkPrivateRedeclaration.js
276
- function _checkPrivateRedeclaration(e$2, t$5) {
277
- if (t$5.has(e$2)) throw new TypeError("Cannot initialize the same private elements twice on an object");
278
- }
279
-
280
- //#endregion
281
- //#region \0@oxc-project+runtime@0.95.0/helpers/classPrivateFieldInitSpec.js
282
- function _classPrivateFieldInitSpec(e$2, t$5, a$1) {
283
- _checkPrivateRedeclaration(e$2, t$5), t$5.set(e$2, a$1);
284
- }
285
-
286
- //#endregion
287
- //#region \0@oxc-project+runtime@0.95.0/helpers/assertClassBrand.js
288
- function _assertClassBrand(e$2, t$5, n$4) {
289
- if ("function" == typeof e$2 ? e$2 === t$5 : e$2.has(t$5)) return arguments.length < 3 ? t$5 : n$4;
290
- throw new TypeError("Private element is not present on this object");
291
- }
292
-
293
- //#endregion
294
- //#region \0@oxc-project+runtime@0.95.0/helpers/classPrivateFieldGet2.js
295
- function _classPrivateFieldGet2(s, a$1) {
296
- return s.get(_assertClassBrand(s, a$1));
297
- }
298
-
299
- //#endregion
300
- //#region \0@oxc-project+runtime@0.95.0/helpers/classPrivateFieldSet2.js
301
- function _classPrivateFieldSet2(s, a$1, r$4) {
302
- return s.set(_assertClassBrand(s, a$1), r$4), r$4;
303
- }
304
-
305
- //#endregion
306
- //#region \0@oxc-project+runtime@0.95.0/helpers/typeof.js
307
- function _typeof(o) {
308
- "@babel/helpers - typeof";
309
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
310
- return typeof o$1;
311
- } : function(o$1) {
312
- return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
313
- }, _typeof(o);
314
- }
315
-
316
- //#endregion
317
- //#region \0@oxc-project+runtime@0.95.0/helpers/toPrimitive.js
318
- function toPrimitive(t$5, r$4) {
319
- if ("object" != _typeof(t$5) || !t$5) return t$5;
320
- var e$2 = t$5[Symbol.toPrimitive];
321
- if (void 0 !== e$2) {
322
- var i$2 = e$2.call(t$5, r$4 || "default");
323
- if ("object" != _typeof(i$2)) return i$2;
324
- throw new TypeError("@@toPrimitive must return a primitive value.");
325
- }
326
- return ("string" === r$4 ? String : Number)(t$5);
327
- }
328
-
329
- //#endregion
330
- //#region \0@oxc-project+runtime@0.95.0/helpers/toPropertyKey.js
331
- function toPropertyKey(t$5) {
332
- var i$2 = toPrimitive(t$5, "string");
333
- return "symbol" == _typeof(i$2) ? i$2 : i$2 + "";
334
- }
335
-
336
- //#endregion
337
- //#region \0@oxc-project+runtime@0.95.0/helpers/defineProperty.js
338
- function _defineProperty(e$2, r$4, t$5) {
339
- return (r$4 = toPropertyKey(r$4)) in e$2 ? Object.defineProperty(e$2, r$4, {
340
- value: t$5,
341
- enumerable: !0,
342
- configurable: !0,
343
- writable: !0
344
- }) : e$2[r$4] = t$5, e$2;
345
- }
346
-
347
- //#endregion
348
- Object.defineProperty(exports, '_assertClassBrand', {
349
- enumerable: true,
350
- get: function () {
351
- return _assertClassBrand;
352
- }
353
- });
354
- Object.defineProperty(exports, '_checkPrivateRedeclaration', {
355
- enumerable: true,
356
- get: function () {
357
- return _checkPrivateRedeclaration;
358
- }
359
- });
360
- Object.defineProperty(exports, '_classPrivateFieldGet2', {
361
- enumerable: true,
362
- get: function () {
363
- return _classPrivateFieldGet2;
364
- }
365
- });
366
- Object.defineProperty(exports, '_classPrivateFieldInitSpec', {
367
- enumerable: true,
368
- get: function () {
369
- return _classPrivateFieldInitSpec;
370
- }
371
- });
372
- Object.defineProperty(exports, '_classPrivateFieldSet2', {
373
- enumerable: true,
374
- get: function () {
375
- return _classPrivateFieldSet2;
376
- }
377
- });
378
- Object.defineProperty(exports, '_defineProperty', {
379
- enumerable: true,
380
- get: function () {
381
- return _defineProperty;
382
- }
383
- });
384
- Object.defineProperty(exports, 'createFile', {
385
- enumerable: true,
386
- get: function () {
387
- return createFile;
388
- }
389
- });
390
- //# sourceMappingURL=defineProperty-DZi5DvrW.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"defineProperty-DZi5DvrW.cjs","names":["e","r","n","t","t","i","n","e","r","t","n","r","e","t","a","e","r","i","n","t","r","n","i","e","t","e","n","r","i","a","e","t","n","r","i","a","uniqueBy","exports","isDeepEqual","path","trimExtName"],"sources":["../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js","../../../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/isDeepEqual-jLo35Woq.js","../../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js","../src/createFile.ts"],"sourcesContent":["function e(e,t,n){let r=n=>e(n,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}export{e as lazyDataLastImpl};\n//# sourceMappingURL=lazyDataLastImpl-BDhrIOwR.js.map","import{lazyDataLastImpl as e}from\"./lazyDataLastImpl-BDhrIOwR.js\";function t(t,n,r){let i=t.length-n.length;if(i===0)return t(...n);if(i===1)return e(t,n,r);throw Error(`Wrong number of arguments`)}export{t as purry};\n//# sourceMappingURL=purry-DH9cw9sy.js.map","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{purry as e}from\"./purry-DH9cw9sy.js\";function t(...t){return e(n,t)}function n(e,t){if(e===t||Object.is(e,t))return!0;if(typeof e!=`object`||typeof t!=`object`||e===null||t===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Array.isArray(e))return r(e,t);if(e instanceof Map)return i(e,t);if(e instanceof Set)return a(e,t);if(e instanceof Date)return e.getTime()===t.getTime();if(e instanceof RegExp)return e.toString()===t.toString();if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let[r,i]of Object.entries(e))if(!(r in t)||!n(i,t[r]))return!1;return!0}function r(e,t){if(e.length!==t.length)return!1;for(let[r,i]of e.entries())if(!n(i,t[r]))return!1;return!0}function i(e,t){if(e.size!==t.size)return!1;for(let[r,i]of e.entries())if(!t.has(r)||!n(i,t.get(r)))return!1;return!0}function a(e,t){if(e.size!==t.size)return!1;let r=[...t];for(let t of e){let e=!1;for(let[i,a]of r.entries())if(n(t,a)){e=!0,r.splice(i,1);break}if(!e)return!1}return!0}export{t as isDeepEqual};\n//# sourceMappingURL=isDeepEqual-jLo35Woq.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 { isDeepEqual, 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 return 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 ]).reduce(\n (prev, curr) => {\n const name = curr.name\n const prevByPath = prev.findLast((imp) => imp.path === curr.path)\n const prevByPathAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isDeepEqual(imp.name, name) && imp.isTypeOnly)\n\n if (prevByPathAndIsTypeOnly) {\n // we already have an export that has the same path but uses `isTypeOnly` (export type ...)\n return prev\n }\n\n const uniquePrev = prev.findLast(\n (imp) => imp.path === curr.path && isDeepEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly && imp.asAlias === curr.asAlias,\n )\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 return prev\n }\n\n if (!prevByPath) {\n return [\n ...prev,\n {\n ...curr,\n name: Array.isArray(name) ? [...new Set(name)] : name,\n },\n ]\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\n return prev\n }\n\n return [...prev, curr]\n },\n [] as Array<KubbFile.Export>,\n )\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 return 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 ]).reduce<Array<KubbFile.Import>>((prev, curr) => {\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 return prev\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 prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly)\n const uniquePrev = prev.findLast((imp) => imp.path === curr.path && isDeepEqual(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly)\n const prevByPathNameAndIsTypeOnly = prev.findLast((imp) => imp.path === curr.path && isDeepEqual(imp.name, name) && imp.isTypeOnly)\n\n if (prevByPathNameAndIsTypeOnly) {\n // we already have an export that has the same path but uses `isTypeOnly` (import type ...)\n return prev\n }\n\n // already unique enough or name is empty\n if (uniquePrev || (Array.isArray(name) && !name.length)) {\n return prev\n }\n\n // new item, append name\n if (!prevByPath) {\n return [\n ...prev,\n {\n ...curr,\n name,\n },\n ]\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\n return prev\n }\n\n // no import was found in the source, ignore import\n if (!Array.isArray(name) && name && !hasImportInSource(name)) {\n return prev\n }\n\n return [...prev, curr]\n }, [])\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,4,5,6],"mappings":";;;;;;;;;AAAA,SAASA,IAAE,KAAE,KAAE,KAAE;CAAC,IAAIC,OAAE,QAAGD,IAAEE,KAAE,GAAGC,IAAE;AAAC,QAAOD,QAAI,KAAK,IAAED,MAAE,OAAO,OAAOA,KAAE;EAAC,MAAKC;EAAE,UAASC;EAAE,CAAC;;;;;ACA3B,SAASC,IAAE,KAAE,KAAE,KAAE;CAAC,IAAIC,MAAED,IAAE,SAAOE,IAAE;AAAO,KAAGD,QAAI,EAAE,QAAOD,IAAE,GAAGE,IAAE;AAAC,KAAGD,QAAI,EAAE,QAAOE,IAAEH,KAAEE,KAAEE,IAAE;AAAC,OAAM,MAAM,4BAA4B;;;;;ACArM,MAAM,IAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAACC,MAAE;CAAC,MAAK,CAAC;CAAE,SAAQ,CAAC;CAAE,EAACC,YAAM,GAAEC,OAAE,SAAI;CAAC,SAAQ,CAAC;CAAE,MAAKC;CAAE,MAAK,CAAC;CAAE;;;;ACAjC,SAASC,IAAE,KAAE,GAAGA,KAAE;CAAC,IAAIC,MAAEC,KAAE,IAAEF,IAAE,KAAI,QAAG,UAASE,MAAEC,IAAED,IAAE,GAAC,KAAK,EAAE,EAAC,IAAE;AAAE,QAAK,I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