@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.
- package/dist/{Fabric-CVe8cc8b.d.ts → Fabric-RmoYWGrr.d.cts} +4 -4
- package/dist/{Fabric-BezqNTQ9.d.cts → Fabric-cIhiQpgN.d.ts} +4 -4
- package/dist/defineProperty-DwFON4j7.cjs +367 -0
- package/dist/defineProperty-DwFON4j7.cjs.map +1 -0
- package/dist/defineProperty-fiNt9UhD.js +325 -0
- package/dist/defineProperty-fiNt9UhD.js.map +1 -0
- package/dist/{getRelativePath-C6lvNCs7.cjs → getRelativePath-eCdp2Z8M.cjs} +1 -2
- package/dist/{getRelativePath-C6lvNCs7.cjs.map → getRelativePath-eCdp2Z8M.cjs.map} +1 -1
- package/dist/index.cjs +20 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +20 -19
- package/dist/index.js.map +1 -1
- package/dist/parsers/typescript.cjs +2 -2
- package/dist/parsers/typescript.d.cts +2 -2
- package/dist/parsers/typescript.d.ts +2 -2
- package/dist/parsers/typescript.js +1 -1
- package/dist/parsers.cjs +2 -2
- package/dist/parsers.d.cts +2 -2
- package/dist/parsers.d.ts +2 -2
- package/dist/parsers.js +1 -1
- package/dist/plugins.cjs +79 -46
- package/dist/plugins.cjs.map +1 -1
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +78 -43
- package/dist/plugins.js.map +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{typescriptParser-B5SxjtvV.d.ts → typescriptParser-BjqVuRHF.d.cts} +3 -14
- package/dist/{typescriptParser-CWT7zCJy.js → typescriptParser-CvJg4PQJ.js} +27 -45
- package/dist/typescriptParser-CvJg4PQJ.js.map +1 -0
- package/dist/{typescriptParser-PfAO0SSm.d.cts → typescriptParser-Cy9_9o6I.d.ts} +3 -14
- package/dist/{typescriptParser-CNHO6H2_.cjs → typescriptParser-D6-3Z7Lj.cjs} +28 -46
- package/dist/typescriptParser-D6-3Z7Lj.cjs.map +1 -0
- package/package.json +1 -1
- package/src/Fabric.ts +1 -1
- package/src/FileManager.ts +2 -2
- package/src/FileProcessor.ts +8 -15
- package/src/createFile.ts +110 -57
- package/src/defineFabric.ts +15 -3
- package/src/parsers/typescriptParser.ts +55 -73
- package/src/plugins/barrelPlugin.ts +63 -36
- package/src/utils/TreeNode.ts +54 -27
- package/dist/defineProperty-DZi5DvrW.cjs +0 -390
- package/dist/defineProperty-DZi5DvrW.cjs.map +0 -1
- package/dist/defineProperty-DcP1vZ2K.js +0 -346
- package/dist/defineProperty-DcP1vZ2K.js.map +0 -1
- package/dist/typescriptParser-CNHO6H2_.cjs.map +0 -1
- package/dist/typescriptParser-CWT7zCJy.js.map +0 -1
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
import { t as trimExtName } from "./trimExtName-CeOVQVbu.js";
|
|
2
|
-
import { orderBy } from "natural-orderby";
|
|
3
|
-
import { createHash } from "node:crypto";
|
|
4
|
-
import path from "node:path";
|
|
5
|
-
|
|
6
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/lazyDataLastImpl-BDhrIOwR.js
|
|
7
|
-
function e$1(e$2, t$5, n$4) {
|
|
8
|
-
let r$4 = (n$5) => e$2(n$5, ...t$5);
|
|
9
|
-
return n$4 === void 0 ? r$4 : Object.assign(r$4, {
|
|
10
|
-
lazy: n$4,
|
|
11
|
-
lazyArgs: t$5
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purry-DH9cw9sy.js
|
|
17
|
-
function t$3(t$5, n$4, r$4) {
|
|
18
|
-
let i$2 = t$5.length - n$4.length;
|
|
19
|
-
if (i$2 === 0) return t$5(...n$4);
|
|
20
|
-
if (i$2 === 1) return e$1(t$5, n$4, r$4);
|
|
21
|
-
throw Error(`Wrong number of arguments`);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/utilityEvaluators-DORpnx39.js
|
|
26
|
-
const e = {
|
|
27
|
-
done: !0,
|
|
28
|
-
hasNext: !1
|
|
29
|
-
}, t$1 = {
|
|
30
|
-
done: !1,
|
|
31
|
-
hasNext: !1
|
|
32
|
-
}, n$3 = () => e, r$3 = (e$2) => ({
|
|
33
|
-
hasNext: !0,
|
|
34
|
-
next: e$2,
|
|
35
|
-
done: !1
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/pipe-jLehR9-P.js
|
|
40
|
-
function t$4(e$2, ...t$5) {
|
|
41
|
-
let a$1 = e$2, o = t$5.map((e$3) => `lazy` in e$3 ? r$2(e$3) : void 0), s = 0;
|
|
42
|
-
for (; s < t$5.length;) {
|
|
43
|
-
if (o[s] === void 0 || !i$1(a$1)) {
|
|
44
|
-
let e$4 = t$5[s];
|
|
45
|
-
a$1 = e$4(a$1), s += 1;
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
let e$3 = [];
|
|
49
|
-
for (let n$4 = s; n$4 < t$5.length; n$4++) {
|
|
50
|
-
let t$6 = o[n$4];
|
|
51
|
-
if (t$6 === void 0 || (e$3.push(t$6), t$6.isSingle)) break;
|
|
52
|
-
}
|
|
53
|
-
let r$4 = [];
|
|
54
|
-
for (let t$6 of a$1) if (n$2(t$6, r$4, e$3)) break;
|
|
55
|
-
let { isSingle: c } = e$3.at(-1);
|
|
56
|
-
a$1 = c ? r$4[0] : r$4, s += e$3.length;
|
|
57
|
-
}
|
|
58
|
-
return a$1;
|
|
59
|
-
}
|
|
60
|
-
function n$2(t$5, r$4, i$2) {
|
|
61
|
-
if (i$2.length === 0) return r$4.push(t$5), !1;
|
|
62
|
-
let a$1 = t$5, o = t$1, s = !1;
|
|
63
|
-
for (let [e$2, t$6] of i$2.entries()) {
|
|
64
|
-
let { index: c, items: l } = t$6;
|
|
65
|
-
if (l.push(a$1), o = t$6(a$1, c, l), t$6.index += 1, o.hasNext) {
|
|
66
|
-
var _o$hasMany;
|
|
67
|
-
if ((_o$hasMany = o.hasMany) !== null && _o$hasMany !== void 0 ? _o$hasMany : !1) {
|
|
68
|
-
for (let t$7 of o.next) if (n$2(t$7, r$4, i$2.slice(e$2 + 1))) return !0;
|
|
69
|
-
return s;
|
|
70
|
-
}
|
|
71
|
-
a$1 = o.next;
|
|
72
|
-
}
|
|
73
|
-
if (!o.hasNext) break;
|
|
74
|
-
o.done && (s = !0);
|
|
75
|
-
}
|
|
76
|
-
return o.hasNext && r$4.push(a$1), s;
|
|
77
|
-
}
|
|
78
|
-
function r$2(e$2) {
|
|
79
|
-
var _t$single;
|
|
80
|
-
let { lazy: t$5, lazyArgs: n$4 } = e$2, r$4 = t$5(...n$4);
|
|
81
|
-
return Object.assign(r$4, {
|
|
82
|
-
isSingle: (_t$single = t$5.single) !== null && _t$single !== void 0 ? _t$single : !1,
|
|
83
|
-
index: 0,
|
|
84
|
-
items: []
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
function i$1(e$2) {
|
|
88
|
-
return typeof e$2 == `string` || typeof e$2 == `object` && !!e$2 && Symbol.iterator in e$2;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/purryFromLazy-3oywCNIb.js
|
|
93
|
-
function t$2(t$5, n$4) {
|
|
94
|
-
let r$4 = n$4.length - t$5.length;
|
|
95
|
-
if (r$4 === 1) {
|
|
96
|
-
let [r$5, ...i$2] = n$4;
|
|
97
|
-
return t$4(r$5, {
|
|
98
|
-
lazy: t$5,
|
|
99
|
-
lazyArgs: i$2
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
if (r$4 === 0) {
|
|
103
|
-
let r$5 = {
|
|
104
|
-
lazy: t$5,
|
|
105
|
-
lazyArgs: n$4
|
|
106
|
-
};
|
|
107
|
-
return Object.assign((t$6) => t$4(t$6, r$5), r$5);
|
|
108
|
-
}
|
|
109
|
-
throw Error(`Wrong number of arguments`);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
//#endregion
|
|
113
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/isDeepEqual-jLo35Woq.js
|
|
114
|
-
function t(...t$5) {
|
|
115
|
-
return t$3(n$1, t$5);
|
|
116
|
-
}
|
|
117
|
-
function n$1(e$2, t$5) {
|
|
118
|
-
if (e$2 === t$5 || Object.is(e$2, t$5)) return !0;
|
|
119
|
-
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;
|
|
120
|
-
if (Array.isArray(e$2)) return r$1(e$2, t$5);
|
|
121
|
-
if (e$2 instanceof Map) return i(e$2, t$5);
|
|
122
|
-
if (e$2 instanceof Set) return a(e$2, t$5);
|
|
123
|
-
if (e$2 instanceof Date) return e$2.getTime() === t$5.getTime();
|
|
124
|
-
if (e$2 instanceof RegExp) return e$2.toString() === t$5.toString();
|
|
125
|
-
if (Object.keys(e$2).length !== Object.keys(t$5).length) return !1;
|
|
126
|
-
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;
|
|
127
|
-
return !0;
|
|
128
|
-
}
|
|
129
|
-
function r$1(e$2, t$5) {
|
|
130
|
-
if (e$2.length !== t$5.length) return !1;
|
|
131
|
-
for (let [r$4, i$2] of e$2.entries()) if (!n$1(i$2, t$5[r$4])) return !1;
|
|
132
|
-
return !0;
|
|
133
|
-
}
|
|
134
|
-
function i(e$2, t$5) {
|
|
135
|
-
if (e$2.size !== t$5.size) return !1;
|
|
136
|
-
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;
|
|
137
|
-
return !0;
|
|
138
|
-
}
|
|
139
|
-
function a(e$2, t$5) {
|
|
140
|
-
if (e$2.size !== t$5.size) return !1;
|
|
141
|
-
let r$4 = [...t$5];
|
|
142
|
-
for (let t$6 of e$2) {
|
|
143
|
-
let e$3 = !1;
|
|
144
|
-
for (let [i$2, a$1] of r$4.entries()) if (n$1(t$6, a$1)) {
|
|
145
|
-
e$3 = !0, r$4.splice(i$2, 1);
|
|
146
|
-
break;
|
|
147
|
-
}
|
|
148
|
-
if (!e$3) return !1;
|
|
149
|
-
}
|
|
150
|
-
return !0;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
//#endregion
|
|
154
|
-
//#region ../../node_modules/.pnpm/remeda@2.32.0/node_modules/remeda/dist/uniqueBy-C_PxkF_D.js
|
|
155
|
-
function n(...e$2) {
|
|
156
|
-
return t$2(r, e$2);
|
|
157
|
-
}
|
|
158
|
-
function r(t$5) {
|
|
159
|
-
let n$4 = t$5, r$4 = /* @__PURE__ */ new Set();
|
|
160
|
-
return (t$6, i$2, a$1) => {
|
|
161
|
-
let o = n$4(t$6, i$2, a$1);
|
|
162
|
-
return r$4.has(o) ? t$1 : (r$4.add(o), {
|
|
163
|
-
done: !1,
|
|
164
|
-
hasNext: !0,
|
|
165
|
-
next: t$6
|
|
166
|
-
});
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region src/createFile.ts
|
|
172
|
-
function combineSources(sources) {
|
|
173
|
-
return n(sources, (obj) => [
|
|
174
|
-
obj.name,
|
|
175
|
-
obj.isExportable,
|
|
176
|
-
obj.isTypeOnly
|
|
177
|
-
]);
|
|
178
|
-
}
|
|
179
|
-
function combineExports(exports) {
|
|
180
|
-
return orderBy(exports, [
|
|
181
|
-
(v) => !!Array.isArray(v.name),
|
|
182
|
-
(v) => !v.isTypeOnly,
|
|
183
|
-
(v) => v.path,
|
|
184
|
-
(v) => !!v.name,
|
|
185
|
-
(v) => Array.isArray(v.name) ? orderBy(v.name) : v.name
|
|
186
|
-
]).reduce((prev, curr) => {
|
|
187
|
-
const name = curr.name;
|
|
188
|
-
const prevByPath = prev.findLast((imp) => imp.path === curr.path);
|
|
189
|
-
if (prev.findLast((imp) => imp.path === curr.path && t(imp.name, name) && imp.isTypeOnly)) return prev;
|
|
190
|
-
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;
|
|
191
|
-
if (!prevByPath) return [...prev, {
|
|
192
|
-
...curr,
|
|
193
|
-
name: Array.isArray(name) ? [...new Set(name)] : name
|
|
194
|
-
}];
|
|
195
|
-
if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(curr.name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
|
|
196
|
-
prevByPath.name = [...new Set([...prevByPath.name, ...curr.name])];
|
|
197
|
-
return prev;
|
|
198
|
-
}
|
|
199
|
-
return [...prev, curr];
|
|
200
|
-
}, []);
|
|
201
|
-
}
|
|
202
|
-
function combineImports(imports, exports, source) {
|
|
203
|
-
const exportedNameLookup = /* @__PURE__ */ new Set();
|
|
204
|
-
for (const item of exports) {
|
|
205
|
-
const { name } = item;
|
|
206
|
-
if (!name) continue;
|
|
207
|
-
if (Array.isArray(name)) {
|
|
208
|
-
for (const value of name) if (value) exportedNameLookup.add(value);
|
|
209
|
-
continue;
|
|
210
|
-
}
|
|
211
|
-
exportedNameLookup.add(name);
|
|
212
|
-
}
|
|
213
|
-
const usageCache = /* @__PURE__ */ new Map();
|
|
214
|
-
const hasImportInSource = (importName) => {
|
|
215
|
-
if (!source) return true;
|
|
216
|
-
const cached = usageCache.get(importName);
|
|
217
|
-
if (cached !== void 0) return cached;
|
|
218
|
-
const isUsed = source.includes(importName) || exportedNameLookup.has(importName);
|
|
219
|
-
usageCache.set(importName, isUsed);
|
|
220
|
-
return isUsed;
|
|
221
|
-
};
|
|
222
|
-
return orderBy(imports, [
|
|
223
|
-
(v) => !!Array.isArray(v.name),
|
|
224
|
-
(v) => !v.isTypeOnly,
|
|
225
|
-
(v) => v.path,
|
|
226
|
-
(v) => !!v.name,
|
|
227
|
-
(v) => Array.isArray(v.name) ? orderBy(v.name) : v.name
|
|
228
|
-
]).reduce((prev, curr) => {
|
|
229
|
-
let name = Array.isArray(curr.name) ? [...new Set(curr.name)] : curr.name;
|
|
230
|
-
if (curr.path === curr.root) return prev;
|
|
231
|
-
if (Array.isArray(name)) name = name.filter((item) => typeof item === "string" ? hasImportInSource(item) : hasImportInSource(item.propertyName));
|
|
232
|
-
const prevByPath = prev.findLast((imp) => imp.path === curr.path && imp.isTypeOnly === curr.isTypeOnly);
|
|
233
|
-
const uniquePrev = prev.findLast((imp) => imp.path === curr.path && t(imp.name, name) && imp.isTypeOnly === curr.isTypeOnly);
|
|
234
|
-
if (prev.findLast((imp) => imp.path === curr.path && t(imp.name, name) && imp.isTypeOnly)) return prev;
|
|
235
|
-
if (uniquePrev || Array.isArray(name) && !name.length) return prev;
|
|
236
|
-
if (!prevByPath) return [...prev, {
|
|
237
|
-
...curr,
|
|
238
|
-
name
|
|
239
|
-
}];
|
|
240
|
-
if (prevByPath && Array.isArray(prevByPath.name) && Array.isArray(name) && prevByPath.isTypeOnly === curr.isTypeOnly) {
|
|
241
|
-
prevByPath.name = [...new Set([...prevByPath.name, ...name])];
|
|
242
|
-
return prev;
|
|
243
|
-
}
|
|
244
|
-
if (!Array.isArray(name) && name && !hasImportInSource(name)) return prev;
|
|
245
|
-
return [...prev, curr];
|
|
246
|
-
}, []);
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* Helper to create a file with name and id set
|
|
250
|
-
*/
|
|
251
|
-
function createFile(file) {
|
|
252
|
-
var _file$exports, _file$imports, _file$sources;
|
|
253
|
-
const extname = path.extname(file.baseName);
|
|
254
|
-
if (!extname) throw new Error(`No extname found for ${file.baseName}`);
|
|
255
|
-
const source = file.sources.map((item) => item.value).join("\n\n");
|
|
256
|
-
const exports = ((_file$exports = file.exports) === null || _file$exports === void 0 ? void 0 : _file$exports.length) ? combineExports(file.exports) : [];
|
|
257
|
-
const imports = ((_file$imports = file.imports) === null || _file$imports === void 0 ? void 0 : _file$imports.length) && source ? combineImports(file.imports, exports, source) : [];
|
|
258
|
-
const sources = ((_file$sources = file.sources) === null || _file$sources === void 0 ? void 0 : _file$sources.length) ? combineSources(file.sources) : [];
|
|
259
|
-
return {
|
|
260
|
-
...file,
|
|
261
|
-
id: createHash("sha256").update(file.path).digest("hex"),
|
|
262
|
-
name: trimExtName(file.baseName),
|
|
263
|
-
extname,
|
|
264
|
-
imports,
|
|
265
|
-
exports,
|
|
266
|
-
sources,
|
|
267
|
-
meta: file.meta || {}
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
//#endregion
|
|
272
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/checkPrivateRedeclaration.js
|
|
273
|
-
function _checkPrivateRedeclaration(e$2, t$5) {
|
|
274
|
-
if (t$5.has(e$2)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
//#endregion
|
|
278
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/classPrivateFieldInitSpec.js
|
|
279
|
-
function _classPrivateFieldInitSpec(e$2, t$5, a$1) {
|
|
280
|
-
_checkPrivateRedeclaration(e$2, t$5), t$5.set(e$2, a$1);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
//#endregion
|
|
284
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/assertClassBrand.js
|
|
285
|
-
function _assertClassBrand(e$2, t$5, n$4) {
|
|
286
|
-
if ("function" == typeof e$2 ? e$2 === t$5 : e$2.has(t$5)) return arguments.length < 3 ? t$5 : n$4;
|
|
287
|
-
throw new TypeError("Private element is not present on this object");
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/classPrivateFieldGet2.js
|
|
292
|
-
function _classPrivateFieldGet2(s, a$1) {
|
|
293
|
-
return s.get(_assertClassBrand(s, a$1));
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
//#endregion
|
|
297
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/classPrivateFieldSet2.js
|
|
298
|
-
function _classPrivateFieldSet2(s, a$1, r$4) {
|
|
299
|
-
return s.set(_assertClassBrand(s, a$1), r$4), r$4;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
//#endregion
|
|
303
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/typeof.js
|
|
304
|
-
function _typeof(o) {
|
|
305
|
-
"@babel/helpers - typeof";
|
|
306
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
307
|
-
return typeof o$1;
|
|
308
|
-
} : function(o$1) {
|
|
309
|
-
return o$1 && "function" == typeof Symbol && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
310
|
-
}, _typeof(o);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
//#endregion
|
|
314
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/toPrimitive.js
|
|
315
|
-
function toPrimitive(t$5, r$4) {
|
|
316
|
-
if ("object" != _typeof(t$5) || !t$5) return t$5;
|
|
317
|
-
var e$2 = t$5[Symbol.toPrimitive];
|
|
318
|
-
if (void 0 !== e$2) {
|
|
319
|
-
var i$2 = e$2.call(t$5, r$4 || "default");
|
|
320
|
-
if ("object" != _typeof(i$2)) return i$2;
|
|
321
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
322
|
-
}
|
|
323
|
-
return ("string" === r$4 ? String : Number)(t$5);
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
//#endregion
|
|
327
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/toPropertyKey.js
|
|
328
|
-
function toPropertyKey(t$5) {
|
|
329
|
-
var i$2 = toPrimitive(t$5, "string");
|
|
330
|
-
return "symbol" == _typeof(i$2) ? i$2 : i$2 + "";
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
//#endregion
|
|
334
|
-
//#region \0@oxc-project+runtime@0.95.0/helpers/defineProperty.js
|
|
335
|
-
function _defineProperty(e$2, r$4, t$5) {
|
|
336
|
-
return (r$4 = toPropertyKey(r$4)) in e$2 ? Object.defineProperty(e$2, r$4, {
|
|
337
|
-
value: t$5,
|
|
338
|
-
enumerable: !0,
|
|
339
|
-
configurable: !0,
|
|
340
|
-
writable: !0
|
|
341
|
-
}) : e$2[r$4] = t$5, e$2;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
//#endregion
|
|
345
|
-
export { _classPrivateFieldInitSpec as a, _assertClassBrand as i, _classPrivateFieldSet2 as n, _checkPrivateRedeclaration as o, _classPrivateFieldGet2 as r, createFile as s, _defineProperty as t };
|
|
346
|
-
//# sourceMappingURL=defineProperty-DcP1vZ2K.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defineProperty-DcP1vZ2K.js","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","isDeepEqual"],"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,IAA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ACrB,EAAE,CAAC;;;;;AAMR,SAAgB,WAA0C,MAA0D;;CAClH,MAAM,UAAU,KAAK,QAAQ,KAAK,SAAS;AAC3C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wBAAwB,KAAK,WAAW;CAG1D,MAAM,SAAS,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;CAClE,MAAM,4BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;CACxE,MAAM,4BAAU,KAAK,uEAAS,WAAU,SAAS,eAAe,KAAK,SAAS,SAAS,OAAO,GAAG,EAAE;CACnG,MAAM,4BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;AAExE,QAAO;EACL,GAAG;EACH,IAAI,WAAW,SAAS,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,MAAM;EACxD,MAAM,YAAY,KAAK,SAAS;EAChC;EACS;EACA;EACA;EACT,MAAM,KAAK,QAAS,EAAE;EACvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescriptParser-CNHO6H2_.cjs","names":["ts","output: string","getRelativePath","path","importPropertyName: ts.Identifier | undefined","importName: ts.NamedImportBindings | undefined","createParser","trimExtName"],"sources":["../src/parsers/typescriptParser.ts"],"sourcesContent":["import path from 'node:path'\nimport ts from 'typescript'\nimport { getRelativePath } from '../utils/getRelativePath.ts'\nimport { trimExtName } from '../utils/trimExtName.ts'\nimport { createParser } from './createParser.ts'\n\nconst { factory } = ts\n\ntype PrintOptions = {\n source?: string\n baseName?: string\n scriptKind?: ts.ScriptKind\n}\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n */\nconst escapeNewLines = (code: string) => code.replace(/\\n\\n/g, '\\n/* :newline: */')\n\n/**\n * Reverses {@link escapeNewLines} and restores new lines\n */\nconst restoreNewLines = (code: string) => code.replace(/\\/\\* :newline: \\*\\//g, '\\n')\n\n/**\n * Convert AST TypeScript/TSX nodes to a string based on the TypeScript printer.\n * Ensures consistent output across environments.\n * Also works as a formatter when `source` is provided without `elements`.\n */\nexport function print(elements: Array<ts.Node> = [], { source = '', baseName = 'print.tsx', scriptKind = ts.ScriptKind.TSX }: PrintOptions = {}): string {\n const sourceFile = ts.createSourceFile(baseName, escapeNewLines(source), ts.ScriptTarget.ES2022, true, scriptKind)\n\n const printer = ts.createPrinter({\n omitTrailingSemicolon: true,\n newLine: ts.NewLineKind.LineFeed,\n removeComments: false,\n noEmitHelpers: true,\n })\n\n let output: string\n\n if (elements.length > 0) {\n // Print only provided nodes\n const nodes = elements.filter(Boolean).sort((a, b) => (a.pos ?? 0) - (b.pos ?? 0))\n output = printer.printList(ts.ListFormat.MultiLine, factory.createNodeArray(nodes), sourceFile)\n } else {\n // Format the whole file\n output = printer.printFile(sourceFile)\n }\n\n return restoreNewLines(output).replace(/\\r\\n/g, '\\n')\n}\n\nexport function createImport({\n name,\n path,\n root,\n isTypeOnly = false,\n isNameSpace = false,\n}: {\n name: string | Array<string | { propertyName: string; name?: string }>\n path: string\n root?: string\n isTypeOnly?: boolean\n isNameSpace?: boolean\n}) {\n const resolvePath = root ? getRelativePath(root, path) : path\n\n if (!Array.isArray(name)) {\n let importPropertyName: ts.Identifier | undefined = factory.createIdentifier(name)\n let importName: ts.NamedImportBindings | undefined\n\n if (isNameSpace) {\n importPropertyName = undefined\n importName = factory.createNamespaceImport(factory.createIdentifier(name))\n }\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, importPropertyName, importName),\n factory.createStringLiteral(resolvePath),\n undefined,\n )\n }\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(\n isTypeOnly,\n undefined,\n factory.createNamedImports(\n name.map((item) => {\n if (typeof item === 'object') {\n const obj = item as { propertyName: string; name?: string }\n if (obj.name) {\n return factory.createImportSpecifier(false, factory.createIdentifier(obj.propertyName), factory.createIdentifier(obj.name))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(obj.propertyName))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(item))\n }),\n ),\n ),\n factory.createStringLiteral(resolvePath),\n undefined,\n )\n}\n\nexport function createExport({\n path,\n asAlias,\n isTypeOnly = false,\n name,\n}: {\n path: string\n asAlias?: boolean\n isTypeOnly?: boolean\n name?: string | Array<ts.Identifier | string>\n}) {\n if (name && !Array.isArray(name) && !asAlias) {\n console.warn(`When using name as string, asAlias should be true ${name}`)\n }\n\n if (!Array.isArray(name)) {\n const parsedName = name?.match(/^\\d/) ? `_${name?.slice(1)}` : name\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n asAlias && parsedName ? factory.createNamespaceExport(factory.createIdentifier(parsedName)) : undefined,\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n factory.createNamedExports(\n name.map((propertyName) => {\n return factory.createExportSpecifier(false, undefined, typeof propertyName === 'string' ? factory.createIdentifier(propertyName) : propertyName)\n }),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\nexport const typescriptParser = createParser({\n name: 'typescript',\n extNames: ['.ts', '.js'],\n install() {},\n async parse(file, options = { extname: '.ts' }) {\n const source = file.sources.map((item) => item.value).join('\\n\\n')\n\n const importNodes = file.imports\n .map((item) => {\n const importPath = item.root ? getRelativePath(item.root, item.path) : item.path\n const hasExtname = !!path.extname(importPath)\n\n return createImport({\n name: item.name,\n path: options.extname && hasExtname ? `${trimExtName(importPath)}${options.extname}` : item.root ? trimExtName(importPath) : importPath,\n isTypeOnly: item.isTypeOnly,\n })\n })\n .filter(Boolean)\n\n const exportNodes = file.exports\n .map((item) => {\n const exportPath = item.path\n\n const hasExtname = !!path.extname(exportPath)\n\n return createExport({\n name: item.name,\n path: options.extname && hasExtname ? `${trimExtName(item.path)}${options.extname}` : trimExtName(item.path),\n isTypeOnly: item.isTypeOnly,\n asAlias: item.asAlias,\n })\n })\n .filter(Boolean)\n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SAAS,OAAO,EAAE;EAC9C,MAAM,SAAS,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;EAElE,MAAM,cAAc,KAAK,QACtB,KAAK,SAAS;GACb,MAAM,aAAa,KAAK,OAAOJ,wCAAgB,KAAK,MAAM,KAAK,KAAK,GAAG,KAAK;GAC5E,MAAM,aAAa,CAAC,CAACC,kBAAK,QAAQ,WAAW;AAE7C,UAAO,aAAa;IAClB,MAAM,KAAK;IACX,MAAM,QAAQ,WAAW,aAAa,GAAGI,gCAAY,WAAW,GAAG,QAAQ,YAAY,KAAK,OAAOA,gCAAY,WAAW,GAAG;IAC7H,YAAY,KAAK;IAClB,CAAC;IACF,CACD,OAAO,QAAQ;EAElB,MAAM,cAAc,KAAK,QACtB,KAAK,SAAS;GACb,MAAM,aAAa,KAAK;GAExB,MAAM,aAAa,CAAC,CAACJ,kBAAK,QAAQ,WAAW;AAE7C,UAAO,aAAa;IAClB,MAAM,KAAK;IACX,MAAM,QAAQ,WAAW,aAAa,GAAGI,gCAAY,KAAK,KAAK,GAAG,QAAQ,YAAYA,gCAAY,KAAK,KAAK;IAC5G,YAAY,KAAK;IACjB,SAAS,KAAK;IACf,CAAC;IACF,CACD,OAAO,QAAQ;AAElB,SAAO;GAAC,KAAK;GAAQ,MAAM,CAAC,GAAG,aAAa,GAAG,YAAY,CAAC;GAAE;GAAQ,KAAK;GAAO,CAAC,KAAK,KAAK;;CAEhG,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescriptParser-CWT7zCJy.js","names":["output: string","path","importPropertyName: ts.Identifier | undefined","importName: ts.NamedImportBindings | undefined"],"sources":["../src/parsers/typescriptParser.ts"],"sourcesContent":["import path from 'node:path'\nimport ts from 'typescript'\nimport { getRelativePath } from '../utils/getRelativePath.ts'\nimport { trimExtName } from '../utils/trimExtName.ts'\nimport { createParser } from './createParser.ts'\n\nconst { factory } = ts\n\ntype PrintOptions = {\n source?: string\n baseName?: string\n scriptKind?: ts.ScriptKind\n}\n\n/**\n * Escaped new lines in code with block comments so they can be restored by {@link restoreNewLines}\n */\nconst escapeNewLines = (code: string) => code.replace(/\\n\\n/g, '\\n/* :newline: */')\n\n/**\n * Reverses {@link escapeNewLines} and restores new lines\n */\nconst restoreNewLines = (code: string) => code.replace(/\\/\\* :newline: \\*\\//g, '\\n')\n\n/**\n * Convert AST TypeScript/TSX nodes to a string based on the TypeScript printer.\n * Ensures consistent output across environments.\n * Also works as a formatter when `source` is provided without `elements`.\n */\nexport function print(elements: Array<ts.Node> = [], { source = '', baseName = 'print.tsx', scriptKind = ts.ScriptKind.TSX }: PrintOptions = {}): string {\n const sourceFile = ts.createSourceFile(baseName, escapeNewLines(source), ts.ScriptTarget.ES2022, true, scriptKind)\n\n const printer = ts.createPrinter({\n omitTrailingSemicolon: true,\n newLine: ts.NewLineKind.LineFeed,\n removeComments: false,\n noEmitHelpers: true,\n })\n\n let output: string\n\n if (elements.length > 0) {\n // Print only provided nodes\n const nodes = elements.filter(Boolean).sort((a, b) => (a.pos ?? 0) - (b.pos ?? 0))\n output = printer.printList(ts.ListFormat.MultiLine, factory.createNodeArray(nodes), sourceFile)\n } else {\n // Format the whole file\n output = printer.printFile(sourceFile)\n }\n\n return restoreNewLines(output).replace(/\\r\\n/g, '\\n')\n}\n\nexport function createImport({\n name,\n path,\n root,\n isTypeOnly = false,\n isNameSpace = false,\n}: {\n name: string | Array<string | { propertyName: string; name?: string }>\n path: string\n root?: string\n isTypeOnly?: boolean\n isNameSpace?: boolean\n}) {\n const resolvePath = root ? getRelativePath(root, path) : path\n\n if (!Array.isArray(name)) {\n let importPropertyName: ts.Identifier | undefined = factory.createIdentifier(name)\n let importName: ts.NamedImportBindings | undefined\n\n if (isNameSpace) {\n importPropertyName = undefined\n importName = factory.createNamespaceImport(factory.createIdentifier(name))\n }\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, importPropertyName, importName),\n factory.createStringLiteral(resolvePath),\n undefined,\n )\n }\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(\n isTypeOnly,\n undefined,\n factory.createNamedImports(\n name.map((item) => {\n if (typeof item === 'object') {\n const obj = item as { propertyName: string; name?: string }\n if (obj.name) {\n return factory.createImportSpecifier(false, factory.createIdentifier(obj.propertyName), factory.createIdentifier(obj.name))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(obj.propertyName))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(item))\n }),\n ),\n ),\n factory.createStringLiteral(resolvePath),\n undefined,\n )\n}\n\nexport function createExport({\n path,\n asAlias,\n isTypeOnly = false,\n name,\n}: {\n path: string\n asAlias?: boolean\n isTypeOnly?: boolean\n name?: string | Array<ts.Identifier | string>\n}) {\n if (name && !Array.isArray(name) && !asAlias) {\n console.warn(`When using name as string, asAlias should be true ${name}`)\n }\n\n if (!Array.isArray(name)) {\n const parsedName = name?.match(/^\\d/) ? `_${name?.slice(1)}` : name\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n asAlias && parsedName ? factory.createNamespaceExport(factory.createIdentifier(parsedName)) : undefined,\n factory.createStringLiteral(path),\n undefined,\n )\n }\n\n return factory.createExportDeclaration(\n undefined,\n isTypeOnly,\n factory.createNamedExports(\n name.map((propertyName) => {\n return factory.createExportSpecifier(false, undefined, typeof propertyName === 'string' ? factory.createIdentifier(propertyName) : propertyName)\n }),\n ),\n factory.createStringLiteral(path),\n undefined,\n )\n}\n\nexport const typescriptParser = createParser({\n name: 'typescript',\n extNames: ['.ts', '.js'],\n install() {},\n async parse(file, options = { extname: '.ts' }) {\n const source = file.sources.map((item) => item.value).join('\\n\\n')\n\n const importNodes = file.imports\n .map((item) => {\n const importPath = item.root ? getRelativePath(item.root, item.path) : item.path\n const hasExtname = !!path.extname(importPath)\n\n return createImport({\n name: item.name,\n path: options.extname && hasExtname ? `${trimExtName(importPath)}${options.extname}` : item.root ? trimExtName(importPath) : importPath,\n isTypeOnly: item.isTypeOnly,\n })\n })\n .filter(Boolean)\n\n const exportNodes = file.exports\n .map((item) => {\n const exportPath = item.path\n\n const hasExtname = !!path.extname(exportPath)\n\n return createExport({\n name: item.name,\n path: options.extname && hasExtname ? `${trimExtName(item.path)}${options.extname}` : trimExtName(item.path),\n isTypeOnly: item.isTypeOnly,\n asAlias: item.asAlias,\n })\n })\n .filter(Boolean)\n\n return [file.banner, print([...importNodes, ...exportNodes]), source, file.footer].join('\\n')\n },\n})\n"],"mappings":";;;;;;;AAMA,MAAM,EAAE,YAAY;;;;AAWpB,MAAM,kBAAkB,SAAiB,KAAK,QAAQ,SAAS,oBAAoB;;;;AAKnF,MAAM,mBAAmB,SAAiB,KAAK,QAAQ,wBAAwB,KAAK;;;;;;AAOpF,SAAgB,MAAM,WAA2B,EAAE,EAAE,EAAE,SAAS,IAAI,WAAW,aAAa,aAAa,GAAG,WAAW,QAAsB,EAAE,EAAU;CACvJ,MAAM,aAAa,GAAG,iBAAiB,UAAU,eAAe,OAAO,EAAE,GAAG,aAAa,QAAQ,MAAM,WAAW;CAElH,MAAM,UAAU,GAAG,cAAc;EAC/B,uBAAuB;EACvB,SAAS,GAAG,YAAY;EACxB,gBAAgB;EAChB,eAAe;EAChB,CAAC;CAEF,IAAIA;AAEJ,KAAI,SAAS,SAAS,GAAG;EAEvB,MAAM,QAAQ,SAAS,OAAO,QAAQ,CAAC,MAAM,GAAG,MAAM;;qBAAC,EAAE,8CAAO,gBAAM,EAAE,8CAAO;IAAG;AAClF,WAAS,QAAQ,UAAU,GAAG,WAAW,WAAW,QAAQ,gBAAgB,MAAM,EAAE,WAAW;OAG/F,UAAS,QAAQ,UAAU,WAAW;AAGxC,QAAO,gBAAgB,OAAO,CAAC,QAAQ,SAAS,KAAK;;AAGvD,SAAgB,aAAa,EAC3B,MACA,cACA,MACA,aAAa,OACb,cAAc,SAOb;CACD,MAAM,cAAc,OAAO,gBAAgB,MAAMC,OAAK,GAAGA;AAEzD,KAAI,CA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