@kubb/fabric-core 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Fabric-RmoYWGrr.d.cts → Fabric-BqMP-L92.d.cts} +1 -1
- package/dist/{Fabric-cIhiQpgN.d.ts → Fabric-CkskSjFr.d.ts} +1 -1
- package/dist/{createParser-17uGjfu3.js → createParser-D_ANHZTa.js} +1 -1
- package/dist/{createParser-17uGjfu3.js.map → createParser-D_ANHZTa.js.map} +1 -1
- package/dist/{defaultParser--HzU9LPa.js → defaultParser-Csot2aaT.js} +2 -2
- package/dist/{defaultParser--HzU9LPa.js.map → defaultParser-Csot2aaT.js.map} +1 -1
- package/dist/{defineProperty-fiNt9UhD.js → defineProperty-CZYGPppK.js} +11 -11
- package/dist/{defineProperty-fiNt9UhD.js.map → defineProperty-CZYGPppK.js.map} +1 -1
- package/dist/{defineProperty-DwFON4j7.cjs → defineProperty-CtWoWQ5I.cjs} +10 -10
- package/dist/{defineProperty-DwFON4j7.cjs.map → defineProperty-CtWoWQ5I.cjs.map} +1 -1
- package/dist/{getRelativePath-CERJmYkp.js → getRelativePath-DayVrg5k.js} +1 -1
- package/dist/{getRelativePath-CERJmYkp.js.map → getRelativePath-DayVrg5k.js.map} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/parsers/typescript.d.cts +2 -2
- package/dist/parsers/typescript.d.ts +2 -2
- package/dist/parsers/typescript.js +4 -4
- package/dist/parsers.d.cts +2 -2
- package/dist/parsers.d.ts +2 -2
- package/dist/parsers.js +5 -5
- package/dist/plugins.cjs +1 -1
- package/dist/plugins.d.cts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +3 -3
- package/dist/{trimExtName-CeOVQVbu.js → trimExtName-Dq2Z7SCT.js} +1 -1
- package/dist/{trimExtName-CeOVQVbu.js.map → trimExtName-Dq2Z7SCT.js.map} +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/{typescriptParser-Cy9_9o6I.d.ts → typescriptParser-4vB6Ej7d.d.ts} +2 -2
- package/dist/{typescriptParser-CvJg4PQJ.js → typescriptParser-Cw2wm0gX.js} +4 -4
- package/dist/{typescriptParser-CvJg4PQJ.js.map → typescriptParser-Cw2wm0gX.js.map} +1 -1
- package/dist/{typescriptParser-BjqVuRHF.d.cts → typescriptParser-Dw2j-g-3.d.cts} +2 -2
- package/package.json +1 -1
|
@@ -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-
|
|
368
|
+
//# sourceMappingURL=Fabric-BqMP-L92.d.cts.map
|
|
@@ -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-
|
|
368
|
+
//# sourceMappingURL=Fabric-CkskSjFr.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createParser-
|
|
1
|
+
{"version":3,"file":"createParser-D_ANHZTa.js","names":[],"sources":["../src/parsers/createParser.ts"],"sourcesContent":["import type { Parser, UserParser } from './types.ts'\n\nexport function createParser<TOptions = unknown, TMeta extends object = any>(parser: UserParser<TOptions, TMeta>): Parser<TOptions, TMeta> {\n return {\n type: 'parser',\n ...parser,\n }\n}\n"],"mappings":";AAEA,SAAgB,aAA6D,QAA8D;AACzI,QAAO;EACL,MAAM;EACN,GAAG;EACJ"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createParser } from "./createParser-
|
|
1
|
+
import { t as createParser } from "./createParser-D_ANHZTa.js";
|
|
2
2
|
|
|
3
3
|
//#region src/parsers/defaultParser.ts
|
|
4
4
|
const defaultParser = createParser({
|
|
@@ -12,4 +12,4 @@ const defaultParser = createParser({
|
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
export { defaultParser as t };
|
|
15
|
-
//# sourceMappingURL=defaultParser
|
|
15
|
+
//# sourceMappingURL=defaultParser-Csot2aaT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultParser
|
|
1
|
+
{"version":3,"file":"defaultParser-Csot2aaT.js","names":[],"sources":["../src/parsers/defaultParser.ts"],"sourcesContent":["import { createParser } from './createParser.ts'\n\nexport const defaultParser = createParser({\n name: 'default',\n extNames: ['.json'],\n install() {},\n async parse(file) {\n return file.sources.map((item) => item.value).join('\\n\\n')\n },\n})\n"],"mappings":";;;AAEA,MAAa,gBAAgB,aAAa;CACxC,MAAM;CACN,UAAU,CAAC,QAAQ;CACnB,UAAU;CACV,MAAM,MAAM,MAAM;AAChB,SAAO,KAAK,QAAQ,KAAK,SAAS,KAAK,MAAM,CAAC,KAAK,OAAO;;CAE7D,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as trimExtName } from "./trimExtName-
|
|
1
|
+
import { t as trimExtName } from "./trimExtName-Dq2Z7SCT.js";
|
|
2
2
|
import { orderBy } from "natural-orderby";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import path from "node:path";
|
|
@@ -248,38 +248,38 @@ function createFile(file) {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
//#endregion
|
|
251
|
-
//#region \0@oxc-project+runtime@0.
|
|
251
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/checkPrivateRedeclaration.js
|
|
252
252
|
function _checkPrivateRedeclaration(e$1, t$3) {
|
|
253
253
|
if (t$3.has(e$1)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
//#endregion
|
|
257
|
-
//#region \0@oxc-project+runtime@0.
|
|
257
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldInitSpec.js
|
|
258
258
|
function _classPrivateFieldInitSpec(e$1, t$3, a) {
|
|
259
259
|
_checkPrivateRedeclaration(e$1, t$3), t$3.set(e$1, a);
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
//#endregion
|
|
263
|
-
//#region \0@oxc-project+runtime@0.
|
|
263
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/assertClassBrand.js
|
|
264
264
|
function _assertClassBrand(e$1, t$3, n$3) {
|
|
265
265
|
if ("function" == typeof e$1 ? e$1 === t$3 : e$1.has(t$3)) return arguments.length < 3 ? t$3 : n$3;
|
|
266
266
|
throw new TypeError("Private element is not present on this object");
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
//#endregion
|
|
270
|
-
//#region \0@oxc-project+runtime@0.
|
|
270
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldGet2.js
|
|
271
271
|
function _classPrivateFieldGet2(s, a) {
|
|
272
272
|
return s.get(_assertClassBrand(s, a));
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
//#endregion
|
|
276
|
-
//#region \0@oxc-project+runtime@0.
|
|
276
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldSet2.js
|
|
277
277
|
function _classPrivateFieldSet2(s, a, r$3) {
|
|
278
278
|
return s.set(_assertClassBrand(s, a), r$3), r$3;
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
//#endregion
|
|
282
|
-
//#region \0@oxc-project+runtime@0.
|
|
282
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/typeof.js
|
|
283
283
|
function _typeof(o) {
|
|
284
284
|
"@babel/helpers - typeof";
|
|
285
285
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -290,7 +290,7 @@ function _typeof(o) {
|
|
|
290
290
|
}
|
|
291
291
|
|
|
292
292
|
//#endregion
|
|
293
|
-
//#region \0@oxc-project+runtime@0.
|
|
293
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/toPrimitive.js
|
|
294
294
|
function toPrimitive(t$3, r$3) {
|
|
295
295
|
if ("object" != _typeof(t$3) || !t$3) return t$3;
|
|
296
296
|
var e$1 = t$3[Symbol.toPrimitive];
|
|
@@ -303,14 +303,14 @@ function toPrimitive(t$3, r$3) {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
//#endregion
|
|
306
|
-
//#region \0@oxc-project+runtime@0.
|
|
306
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/toPropertyKey.js
|
|
307
307
|
function toPropertyKey(t$3) {
|
|
308
308
|
var i$1 = toPrimitive(t$3, "string");
|
|
309
309
|
return "symbol" == _typeof(i$1) ? i$1 : i$1 + "";
|
|
310
310
|
}
|
|
311
311
|
|
|
312
312
|
//#endregion
|
|
313
|
-
//#region \0@oxc-project+runtime@0.
|
|
313
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/defineProperty.js
|
|
314
314
|
function _defineProperty(e$1, r$3, t$3) {
|
|
315
315
|
return (r$3 = toPropertyKey(r$3)) in e$1 ? Object.defineProperty(e$1, r$3, {
|
|
316
316
|
value: t$3,
|
|
@@ -322,4 +322,4 @@ function _defineProperty(e$1, r$3, t$3) {
|
|
|
322
322
|
|
|
323
323
|
//#endregion
|
|
324
324
|
export { _classPrivateFieldInitSpec as a, _assertClassBrand as i, _classPrivateFieldSet2 as n, _checkPrivateRedeclaration as o, _classPrivateFieldGet2 as r, createFile as s, _defineProperty as t };
|
|
325
|
-
//# sourceMappingURL=defineProperty-
|
|
325
|
+
//# sourceMappingURL=defineProperty-CZYGPppK.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineProperty-fiNt9UhD.js","names":["n","r","e","t","e","r","n","i","t","r","n","i","e","e","t","n","r","i","uniqueBy","prev: Array<KubbFile.Export>","prev: Array<KubbFile.Import>"],"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}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AQ,KAAK,IAAI,WAAW,eAAe,KAAK,YAAY;AACpH,cAAW,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,WAAW,MAAM,GAAG,KAAK,CAAC,CAAC;AAC7D;;AAIF,MAAI,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,kBAAkB,KAAK,CAC1D;AAGF,OAAK,KAAK,KAAK;AACf,YAAU,IAAI,iBAAiB,KAAK;AAEpC,MAAI,KAAK,WACP,qBAAoB,IAAI,aAAa,KAAK;;AAI9C,QAAO;;;;;AAMT,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
|
+
{"version":3,"file":"defineProperty-CZYGPppK.js","names":["n","r","e","t","e","r","n","i","t","r","n","i","e","e","t","n","r","i","uniqueBy","prev: Array<KubbFile.Export>","prev: Array<KubbFile.Import>"],"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,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AS;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"}
|
|
@@ -249,38 +249,38 @@ function createFile(file) {
|
|
|
249
249
|
}
|
|
250
250
|
|
|
251
251
|
//#endregion
|
|
252
|
-
//#region \0@oxc-project+runtime@0.
|
|
252
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/checkPrivateRedeclaration.js
|
|
253
253
|
function _checkPrivateRedeclaration(e$1, t$3) {
|
|
254
254
|
if (t$3.has(e$1)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
//#endregion
|
|
258
|
-
//#region \0@oxc-project+runtime@0.
|
|
258
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldInitSpec.js
|
|
259
259
|
function _classPrivateFieldInitSpec(e$1, t$3, a) {
|
|
260
260
|
_checkPrivateRedeclaration(e$1, t$3), t$3.set(e$1, a);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
//#endregion
|
|
264
|
-
//#region \0@oxc-project+runtime@0.
|
|
264
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/assertClassBrand.js
|
|
265
265
|
function _assertClassBrand(e$1, t$3, n$3) {
|
|
266
266
|
if ("function" == typeof e$1 ? e$1 === t$3 : e$1.has(t$3)) return arguments.length < 3 ? t$3 : n$3;
|
|
267
267
|
throw new TypeError("Private element is not present on this object");
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
//#endregion
|
|
271
|
-
//#region \0@oxc-project+runtime@0.
|
|
271
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldGet2.js
|
|
272
272
|
function _classPrivateFieldGet2(s, a) {
|
|
273
273
|
return s.get(_assertClassBrand(s, a));
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
//#endregion
|
|
277
|
-
//#region \0@oxc-project+runtime@0.
|
|
277
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateFieldSet2.js
|
|
278
278
|
function _classPrivateFieldSet2(s, a, r$3) {
|
|
279
279
|
return s.set(_assertClassBrand(s, a), r$3), r$3;
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
//#endregion
|
|
283
|
-
//#region \0@oxc-project+runtime@0.
|
|
283
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/typeof.js
|
|
284
284
|
function _typeof(o) {
|
|
285
285
|
"@babel/helpers - typeof";
|
|
286
286
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -291,7 +291,7 @@ function _typeof(o) {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
//#endregion
|
|
294
|
-
//#region \0@oxc-project+runtime@0.
|
|
294
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/toPrimitive.js
|
|
295
295
|
function toPrimitive(t$3, r$3) {
|
|
296
296
|
if ("object" != _typeof(t$3) || !t$3) return t$3;
|
|
297
297
|
var e$1 = t$3[Symbol.toPrimitive];
|
|
@@ -304,14 +304,14 @@ function toPrimitive(t$3, r$3) {
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
//#endregion
|
|
307
|
-
//#region \0@oxc-project+runtime@0.
|
|
307
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/toPropertyKey.js
|
|
308
308
|
function toPropertyKey(t$3) {
|
|
309
309
|
var i$1 = toPrimitive(t$3, "string");
|
|
310
310
|
return "symbol" == _typeof(i$1) ? i$1 : i$1 + "";
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
//#endregion
|
|
314
|
-
//#region \0@oxc-project+runtime@0.
|
|
314
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/defineProperty.js
|
|
315
315
|
function _defineProperty(e$1, r$3, t$3) {
|
|
316
316
|
return (r$3 = toPropertyKey(r$3)) in e$1 ? Object.defineProperty(e$1, r$3, {
|
|
317
317
|
value: t$3,
|
|
@@ -364,4 +364,4 @@ Object.defineProperty(exports, 'createFile', {
|
|
|
364
364
|
return createFile;
|
|
365
365
|
}
|
|
366
366
|
});
|
|
367
|
-
//# sourceMappingURL=defineProperty-
|
|
367
|
+
//# sourceMappingURL=defineProperty-CtWoWQ5I.cjs.map
|
|
@@ -1 +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,KAA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AU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;AAExE,QAAO;EACL,GAAG;EACH,gCAAe,SAAS,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,MAAM;EACxD,MAAMI,gCAAY,KAAK,SAAS;EAChC;EACS;EACT,SAASJ;EACA;EACT,MAAM,KAAK,QAAS,EAAE;EACvB"}
|
|
1
|
+
{"version":3,"file":"defineProperty-CtWoWQ5I.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,IAAE,EAAC,CAAC;CAAE,IAAI,IAAEA,KAAE,IAAEC,GAAE,IAAE,CAAC;AAAE,MA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WACV,qBAAoB,IAAI,aAAa,QAAQ;AAE/C;;AAIF,MAAI,cAAc,MAAM,QAAQ,WAAW,KAAK,IAAI,MAAM,QAAQ,KAAK,IAAI,WAAW,eAAe,KAAK,YAAY;AACpH,cAAW,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,WAAW,MAAM,GAAG,KAAK,CAAC,CAAC;AAC7D;;AAIF,MAAI,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAQ,CAAC,kBAAkB,KAAK,CAC1D;AAGF,OAAK,KAAK,KAAK;AACf,YAAU,IAAI,iBAAiB,KAAK;AAEpC,MAAI,KAAK,WACP,qBAAoB,IAAI,aAAa,KAAK;;AAI9C,QAAO;;;;;AAMT,SAAgB,WAA0C,MAA0D;;CAClH,MAAM,UAAUC,kBAAK,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,MAAMH,8BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;CACxE,MAAM,4BAAU,KAAK,uEAAS,WAAU,SAAS,eAAe,KAAK,SAASA,WAAS,OAAO,GAAG,EAAE;CACnG,MAAM,4BAAU,KAAK,uEAAS,UAAS,eAAe,KAAK,QAAQ,GAAG,EAAE;AAExE,QAAO;EACL,GAAG;EACH,gCAAe,SAAS,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,MAAM;EACxD,MAAMI,gCAAY,KAAK,SAAS;EAChC;EACS;EACT,SAASJ;EACA;EACT,MAAM,KAAK,QAAS,EAAE;EACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getRelativePath-
|
|
1
|
+
{"version":3,"file":"getRelativePath-DayVrg5k.js","names":["path"],"sources":["../src/utils/getRelativePath.ts"],"sourcesContent":["import { normalize, relative } from 'node:path'\n\nfunction slash(path: string, platform: 'windows' | 'mac' | 'linux' = 'linux') {\n const isWindowsPath = /^\\\\\\\\\\?\\\\/.test(path)\n const normalizedPath = normalize(path)\n\n if (['linux', 'mac'].includes(platform) && !isWindowsPath) {\n // linux and mac\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n }\n\n // windows\n return normalizedPath.replaceAll(/\\\\/g, '/').replace('../', '')\n}\n\nexport function getRelativePath(rootDir?: string | null, filePath?: string | null, platform: 'windows' | 'mac' | 'linux' = 'linux'): string {\n if (!rootDir || !filePath) {\n throw new Error(`Root and file should be filled in when retrieving the relativePath, ${rootDir || ''} ${filePath || ''}`)\n }\n\n const relativePath = relative(rootDir, filePath)\n\n // On Windows, paths are separated with a \"\\\"\n // However, web browsers use \"/\" no matter the platform\n const slashedPath = slash(relativePath, platform)\n\n if (slashedPath.startsWith('../')) {\n return slashedPath\n }\n\n return `./${slashedPath}`\n}\n"],"mappings":";;;AAEA,SAAS,MAAM,QAAc,WAAwC,SAAS;CAC5E,MAAM,gBAAgB,YAAY,KAAKA,OAAK;CAC5C,MAAM,iBAAiB,UAAUA,OAAK;AAEtC,KAAI,CAAC,SAAS,MAAM,CAAC,SAAS,SAAS,IAAI,CAAC,cAE1C,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;AAIjE,QAAO,eAAe,WAAW,OAAO,IAAI,CAAC,QAAQ,OAAO,GAAG;;AAGjE,SAAgB,gBAAgB,SAAyB,UAA0B,WAAwC,SAAiB;AAC1I,KAAI,CAAC,WAAW,CAAC,SACf,OAAM,IAAI,MAAM,uEAAuE,WAAW,GAAG,GAAG,YAAY,KAAK;CAO3H,MAAM,cAAc,MAJC,SAAS,SAAS,SAAS,EAIR,SAAS;AAEjD,KAAI,YAAY,WAAW,MAAM,CAC/B,QAAO;AAGT,QAAO,KAAK"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_trimExtName = require('./trimExtName-Bb4zGVF1.cjs');
|
|
2
|
-
const require_defineProperty = require('./defineProperty-
|
|
2
|
+
const require_defineProperty = require('./defineProperty-CtWoWQ5I.cjs');
|
|
3
3
|
require('./createParser-C4IkyTs5.cjs');
|
|
4
4
|
const require_defaultParser = require('./defaultParser-n9VW2iVf.cjs');
|
|
5
5
|
let natural_orderby = require("natural-orderby");
|
|
@@ -157,7 +157,7 @@ var Cache = class {
|
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
//#endregion
|
|
160
|
-
//#region \0@oxc-project+runtime@0.
|
|
160
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateMethodInitSpec.js
|
|
161
161
|
function _classPrivateMethodInitSpec(e$1, a) {
|
|
162
162
|
require_defineProperty._checkPrivateRedeclaration(e$1, a), a.add(e$1);
|
|
163
163
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FabricOptions, c as FileManager, h as ResolvedFile, l as FileProcessor, n as FabricConfig, p as File, t as Fabric } from "./Fabric-
|
|
1
|
+
import { a as FabricOptions, c as FileManager, h as ResolvedFile, l as FileProcessor, n as FabricConfig, p as File, t as Fabric } from "./Fabric-BqMP-L92.cjs";
|
|
2
2
|
|
|
3
3
|
//#region src/defineFabric.d.ts
|
|
4
4
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as FabricOptions, c as FileManager, h as ResolvedFile, l as FileProcessor, n as FabricConfig, p as File, t as Fabric } from "./Fabric-
|
|
1
|
+
import { a as FabricOptions, c as FileManager, h as ResolvedFile, l as FileProcessor, n as FabricConfig, p as File, t as Fabric } from "./Fabric-CkskSjFr.js";
|
|
2
2
|
|
|
3
3
|
//#region src/defineFabric.d.ts
|
|
4
4
|
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as _classPrivateFieldInitSpec, i as _assertClassBrand, n as _classPrivateFieldSet2, o as _checkPrivateRedeclaration, r as _classPrivateFieldGet2, s as createFile, t as _defineProperty } from "./defineProperty-
|
|
2
|
-
import { t as trimExtName } from "./trimExtName-
|
|
3
|
-
import "./createParser-
|
|
4
|
-
import { t as defaultParser } from "./defaultParser
|
|
1
|
+
import { a as _classPrivateFieldInitSpec, i as _assertClassBrand, n as _classPrivateFieldSet2, o as _checkPrivateRedeclaration, r as _classPrivateFieldGet2, s as createFile, t as _defineProperty } from "./defineProperty-CZYGPppK.js";
|
|
2
|
+
import { t as trimExtName } from "./trimExtName-Dq2Z7SCT.js";
|
|
3
|
+
import "./createParser-D_ANHZTa.js";
|
|
4
|
+
import { t as defaultParser } from "./defaultParser-Csot2aaT.js";
|
|
5
5
|
import { orderBy } from "natural-orderby";
|
|
6
6
|
import pLimit from "p-limit";
|
|
7
7
|
import { EventEmitter } from "node:events";
|
|
@@ -156,7 +156,7 @@ var Cache = class {
|
|
|
156
156
|
};
|
|
157
157
|
|
|
158
158
|
//#endregion
|
|
159
|
-
//#region \0@oxc-project+runtime@0.
|
|
159
|
+
//#region \0@oxc-project+runtime@0.97.0/helpers/classPrivateMethodInitSpec.js
|
|
160
160
|
function _classPrivateMethodInitSpec(e$1, a) {
|
|
161
161
|
_checkPrivateRedeclaration(e$1, a), a.add(e$1);
|
|
162
162
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../Fabric-
|
|
2
|
-
import { i as typescriptParser, n as createImport, r as print, t as createExport } from "../typescriptParser-
|
|
1
|
+
import "../Fabric-BqMP-L92.cjs";
|
|
2
|
+
import { i as typescriptParser, n as createImport, r as print, t as createExport } from "../typescriptParser-Dw2j-g-3.cjs";
|
|
3
3
|
export { createExport, createImport, print, typescriptParser };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../Fabric-
|
|
2
|
-
import { i as typescriptParser, n as createImport, r as print, t as createExport } from "../typescriptParser-
|
|
1
|
+
import "../Fabric-CkskSjFr.js";
|
|
2
|
+
import { i as typescriptParser, n as createImport, r as print, t as createExport } from "../typescriptParser-4vB6Ej7d.js";
|
|
3
3
|
export { createExport, createImport, print, typescriptParser };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../trimExtName-
|
|
2
|
-
import "../createParser-
|
|
3
|
-
import "../getRelativePath-
|
|
4
|
-
import { i as typescriptParser, n as createImport, r as print, t as createExport } from "../typescriptParser-
|
|
1
|
+
import "../trimExtName-Dq2Z7SCT.js";
|
|
2
|
+
import "../createParser-D_ANHZTa.js";
|
|
3
|
+
import "../getRelativePath-DayVrg5k.js";
|
|
4
|
+
import { i as typescriptParser, n as createImport, r as print, t as createExport } from "../typescriptParser-Cw2wm0gX.js";
|
|
5
5
|
|
|
6
6
|
export { createExport, createImport, print, typescriptParser };
|
package/dist/parsers.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as UserParser, u as Parser } from "./Fabric-
|
|
2
|
-
import { i as typescriptParser } from "./typescriptParser-
|
|
1
|
+
import { d as UserParser, u as Parser } from "./Fabric-BqMP-L92.cjs";
|
|
2
|
+
import { i as typescriptParser } from "./typescriptParser-Dw2j-g-3.cjs";
|
|
3
3
|
|
|
4
4
|
//#region src/parsers/createParser.d.ts
|
|
5
5
|
declare function createParser<TOptions = unknown, TMeta extends object = any>(parser: UserParser<TOptions, TMeta>): Parser<TOptions, TMeta>;
|
package/dist/parsers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as UserParser, u as Parser } from "./Fabric-
|
|
2
|
-
import { i as typescriptParser } from "./typescriptParser-
|
|
1
|
+
import { d as UserParser, u as Parser } from "./Fabric-CkskSjFr.js";
|
|
2
|
+
import { i as typescriptParser } from "./typescriptParser-4vB6Ej7d.js";
|
|
3
3
|
|
|
4
4
|
//#region src/parsers/createParser.d.ts
|
|
5
5
|
declare function createParser<TOptions = unknown, TMeta extends object = any>(parser: UserParser<TOptions, TMeta>): Parser<TOptions, TMeta>;
|
package/dist/parsers.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./trimExtName-
|
|
2
|
-
import { t as createParser } from "./createParser-
|
|
3
|
-
import { t as defaultParser } from "./defaultParser
|
|
4
|
-
import "./getRelativePath-
|
|
5
|
-
import { i as typescriptParser } from "./typescriptParser-
|
|
1
|
+
import "./trimExtName-Dq2Z7SCT.js";
|
|
2
|
+
import { t as createParser } from "./createParser-D_ANHZTa.js";
|
|
3
|
+
import { t as defaultParser } from "./defaultParser-Csot2aaT.js";
|
|
4
|
+
import "./getRelativePath-DayVrg5k.js";
|
|
5
|
+
import { i as typescriptParser } from "./typescriptParser-Cw2wm0gX.js";
|
|
6
6
|
|
|
7
7
|
//#region src/parsers/tsxParser.ts
|
|
8
8
|
const tsxParser = createParser({
|
package/dist/plugins.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_trimExtName = require('./trimExtName-Bb4zGVF1.cjs');
|
|
2
|
-
const require_defineProperty = require('./defineProperty-
|
|
2
|
+
const require_defineProperty = require('./defineProperty-CtWoWQ5I.cjs');
|
|
3
3
|
const require_getRelativePath = require('./getRelativePath-eCdp2Z8M.cjs');
|
|
4
4
|
let node_path = require("node:path");
|
|
5
5
|
node_path = require_trimExtName.__toESM(node_path);
|
package/dist/plugins.d.cts
CHANGED
package/dist/plugins.d.ts
CHANGED
package/dist/plugins.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _classPrivateFieldGet2, s as createFile, t as _defineProperty } from "./defineProperty-
|
|
2
|
-
import "./trimExtName-
|
|
3
|
-
import { t as getRelativePath } from "./getRelativePath-
|
|
1
|
+
import { a as _classPrivateFieldInitSpec, n as _classPrivateFieldSet2, r as _classPrivateFieldGet2, s as createFile, t as _defineProperty } from "./defineProperty-CZYGPppK.js";
|
|
2
|
+
import "./trimExtName-Dq2Z7SCT.js";
|
|
3
|
+
import { t as getRelativePath } from "./getRelativePath-DayVrg5k.js";
|
|
4
4
|
import path, { relative, resolve } from "node:path";
|
|
5
5
|
import fs from "fs-extra";
|
|
6
6
|
import http from "node:http";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trimExtName-
|
|
1
|
+
{"version":3,"file":"trimExtName-Dq2Z7SCT.js","names":[],"sources":["../src/utils/trimExtName.ts"],"sourcesContent":["export function trimExtName(text: string): string {\n return text.replace(/\\.[^/.]+$/, '')\n}\n"],"mappings":";AAAA,SAAgB,YAAY,MAAsB;AAChD,QAAO,KAAK,QAAQ,aAAa,GAAG"}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FabricOptions, i as FabricMode, m as KubbFile_d_exports, n as FabricConfig, r as FabricContext } from "./Fabric-
|
|
1
|
+
import { a as FabricOptions, i as FabricMode, m as KubbFile_d_exports, n as FabricConfig, r as FabricContext } from "./Fabric-BqMP-L92.cjs";
|
|
2
2
|
export { type FabricConfig, type FabricContext, type FabricMode, type FabricOptions, KubbFile_d_exports as KubbFile };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FabricOptions, i as FabricMode, m as KubbFile_d_exports, n as FabricConfig, r as FabricContext } from "./Fabric-
|
|
1
|
+
import { a as FabricOptions, i as FabricMode, m as KubbFile_d_exports, n as FabricConfig, r as FabricContext } from "./Fabric-CkskSjFr.js";
|
|
2
2
|
export { type FabricConfig, type FabricContext, type FabricMode, type FabricOptions, KubbFile_d_exports as KubbFile };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as Parser } from "./Fabric-
|
|
1
|
+
import { u as Parser } from "./Fabric-CkskSjFr.js";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
|
|
4
4
|
//#region src/parsers/typescriptParser.d.ts
|
|
@@ -36,4 +36,4 @@ declare function createExport({
|
|
|
36
36
|
declare const typescriptParser: Parser<[], any>;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { typescriptParser as i, createImport as n, print as r, createExport as t };
|
|
39
|
-
//# sourceMappingURL=typescriptParser-
|
|
39
|
+
//# sourceMappingURL=typescriptParser-4vB6Ej7d.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as trimExtName } from "./trimExtName-
|
|
2
|
-
import { t as createParser } from "./createParser-
|
|
3
|
-
import { t as getRelativePath } from "./getRelativePath-
|
|
1
|
+
import { t as trimExtName } from "./trimExtName-Dq2Z7SCT.js";
|
|
2
|
+
import { t as createParser } from "./createParser-D_ANHZTa.js";
|
|
3
|
+
import { t as getRelativePath } from "./getRelativePath-DayVrg5k.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import ts from "typescript";
|
|
6
6
|
|
|
@@ -85,4 +85,4 @@ const typescriptParser = createParser({
|
|
|
85
85
|
|
|
86
86
|
//#endregion
|
|
87
87
|
export { typescriptParser as i, createImport as n, print as r, createExport as t };
|
|
88
|
-
//# sourceMappingURL=typescriptParser-
|
|
88
|
+
//# sourceMappingURL=typescriptParser-Cw2wm0gX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescriptParser-
|
|
1
|
+
{"version":3,"file":"typescriptParser-Cw2wm0gX.js","names":["path","sourceParts: Array<string>","importNodes: Array<ts.ImportDeclaration>","exportNodes: Array<ts.ExportDeclaration>"],"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\n/**\n * Convert AST TypeScript/TSX nodes to a string based on the TypeScript printer.\n */\nexport function print(...elements: Array<ts.Node>): string {\n const sourceFile = ts.createSourceFile('print.tsx', '', ts.ScriptTarget.ES2022, true, ts.ScriptKind.TSX)\n\n const printer = ts.createPrinter({\n omitTrailingSemicolon: true,\n newLine: ts.NewLineKind.LineFeed,\n removeComments: false,\n noEmitHelpers: true,\n })\n\n for (const node of elements) {\n if (node.kind === ts.SyntaxKind.Unknown) {\n console.error('⚠️ Unknown node found:', node)\n }\n }\n\n const output = printer.printList(ts.ListFormat.MultiLine, factory.createNodeArray(elements.filter(Boolean)), sourceFile)\n\n return 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 // Namespace or default import\n if (!Array.isArray(name)) {\n if (isNameSpace) {\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, undefined, factory.createNamespaceImport(factory.createIdentifier(name))),\n factory.createStringLiteral(resolvePath),\n undefined,\n )\n }\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, factory.createIdentifier(name), undefined),\n factory.createStringLiteral(resolvePath),\n undefined,\n )\n }\n\n // Named imports\n const specifiers = name.map((item) => {\n if (typeof item === 'object') {\n const { propertyName, name: alias } = item\n return factory.createImportSpecifier(false, alias ? factory.createIdentifier(propertyName) : undefined, factory.createIdentifier(alias ?? propertyName))\n }\n\n return factory.createImportSpecifier(false, undefined, factory.createIdentifier(item))\n })\n\n return factory.createImportDeclaration(\n undefined,\n factory.createImportClause(isTypeOnly, undefined, factory.createNamedImports(specifiers)),\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 sourceParts: Array<string> = []\n for (const item of file.sources) {\n if (item.value) {\n sourceParts.push(item.value)\n }\n }\n const source = sourceParts.join('\\n\\n')\n\n const importNodes: Array<ts.ImportDeclaration> = []\n for (const item of file.imports) {\n const importPath = item.root ? getRelativePath(item.root, item.path) : item.path\n const hasExtname = !!path.extname(importPath)\n\n importNodes.push(\n 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 }\n\n const exportNodes: Array<ts.ExportDeclaration> = []\n for (const item of file.exports) {\n const exportPath = item.path\n const hasExtname = !!path.extname(exportPath)\n\n exportNodes.push(\n 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 }\n\n const parts = [file.banner, print(...importNodes, ...exportNodes), source, file.footer].filter((segment): segment is string => segment != null)\n return parts.join('\\n')\n },\n})\n"],"mappings":";;;;;;;AAMA,MAAM,EAAE,YAAY;;;;AAKpB,SAAgB,MAAM,GAAG,UAAkC;CACzD,MAAM,aAAa,GAAG,iBAAiB,aAAa,IAAI,GAAG,aAAa,QAAQ,MAAM,GAAG,WAAW,IAAI;CAExG,MAAM,UAAU,GAAG,cAAc;EAC/B,uBAAuB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GAC/B,MAAM,aAAa,KAAK;GACxB,MAAM,aAAa,CAAC,CAAC,KAAK,QAAQ,WAAW;AAE7C,eAAY,KACV,aAAa;IACX,MAAM,KAAK;IACX,MAAM,QAAQ,WAAW,aAAa,GAAG,YAAY,KAAK,KAAK,GAAG,QAAQ,YAAY,YAAY,KAAK,KAAK;IAC5G,YAAY,KAAK;IACjB,SAAS,KAAK;IACf,CAAC,CACH;;AAIH,SADc;GAAC,KAAK;GAAQ,MAAM,GAAG,aAAa,GAAG,YAAY;GAAE;GAAQ,KAAK;GAAO,CAAC,QAAQ,YAA+B,WAAW,KAAK,CAClI,KAAK,KAAK;;CAE1B,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as Parser } from "./Fabric-
|
|
1
|
+
import { u as Parser } from "./Fabric-BqMP-L92.cjs";
|
|
2
2
|
import ts from "typescript";
|
|
3
3
|
|
|
4
4
|
//#region src/parsers/typescriptParser.d.ts
|
|
@@ -36,4 +36,4 @@ declare function createExport({
|
|
|
36
36
|
declare const typescriptParser: Parser<[], any>;
|
|
37
37
|
//#endregion
|
|
38
38
|
export { typescriptParser as i, createImport as n, print as r, createExport as t };
|
|
39
|
-
//# sourceMappingURL=typescriptParser-
|
|
39
|
+
//# sourceMappingURL=typescriptParser-Dw2j-g-3.d.cts.map
|
package/package.json
CHANGED